summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/advice.el2
-rw-r--r--lisp/emacs-lisp/assoc.el2
-rw-r--r--lisp/emacs-lisp/authors.el6
-rw-r--r--lisp/emacs-lisp/bindat.el12
-rw-r--r--lisp/emacs-lisp/byte-run.el2
-rw-r--r--lisp/emacs-lisp/cl-compat.el2
-rw-r--r--lisp/emacs-lisp/cl-extra.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el16
-rw-r--r--lisp/emacs-lisp/cl-seq.el2
-rw-r--r--lisp/emacs-lisp/cl-specs.el2
-rw-r--r--lisp/emacs-lisp/cl.el2
-rw-r--r--lisp/emacs-lisp/crm.el2
-rw-r--r--lisp/emacs-lisp/cust-print.el2
-rw-r--r--lisp/emacs-lisp/derived.el2
-rw-r--r--lisp/emacs-lisp/easy-mmode.el2
-rw-r--r--lisp/emacs-lisp/easymenu.el12
-rw-r--r--lisp/emacs-lisp/eldoc.el2
-rw-r--r--lisp/emacs-lisp/elint.el2
-rw-r--r--lisp/emacs-lisp/ewoc.el2
-rw-r--r--lisp/emacs-lisp/find-func.el2
-rw-r--r--lisp/emacs-lisp/find-gc.el2
-rw-r--r--lisp/emacs-lisp/float-sup.el2
-rw-r--r--lisp/emacs-lisp/generic.el2
-rw-r--r--lisp/emacs-lisp/gulp.el2
-rw-r--r--lisp/emacs-lisp/helper.el2
-rw-r--r--lisp/emacs-lisp/lisp.el105
-rw-r--r--lisp/emacs-lisp/lmenu.el2
-rw-r--r--lisp/emacs-lisp/lselect.el2
-rw-r--r--lisp/emacs-lisp/map-ynp.el2
-rw-r--r--lisp/emacs-lisp/regexp-opt.el2
-rw-r--r--lisp/emacs-lisp/regi.el2
-rw-r--r--lisp/emacs-lisp/ring.el2
-rw-r--r--lisp/emacs-lisp/shadow.el2
-rw-r--r--lisp/emacs-lisp/sregex.el2
-rw-r--r--lisp/emacs-lisp/syntax.el43
-rw-r--r--lisp/emacs-lisp/timer.el2
-rw-r--r--lisp/emacs-lisp/tq.el2
-rw-r--r--lisp/emacs-lisp/trace.el2
38 files changed, 148 insertions, 110 deletions
diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el
index 5aa8bbd14cc..f6037c065fe 100644
--- a/lisp/emacs-lisp/advice.el
+++ b/lisp/emacs-lisp/advice.el
@@ -1,6 +1,6 @@
;;; advice.el --- an overloading mechanism for Emacs Lisp functions
-;; Copyright (C) 1993, 1994, 2000, 2001, 2004,
+;; Copyright (C) 1993, 1994, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Hans Chalupsky <hans@cs.buffalo.edu>
diff --git a/lisp/emacs-lisp/assoc.el b/lisp/emacs-lisp/assoc.el
index f3d0b9efc9b..1d710cceb48 100644
--- a/lisp/emacs-lisp/assoc.el
+++ b/lisp/emacs-lisp/assoc.el
@@ -1,6 +1,6 @@
;;; assoc.el --- insert/delete/sort functions on association lists
-;; Copyright (C) 1996, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Barry A. Warsaw <bwarsaw@cen.com>
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el
index 3c2d937624e..a19f054a468 100644
--- a/lisp/emacs-lisp/authors.el
+++ b/lisp/emacs-lisp/authors.el
@@ -1,6 +1,6 @@
;;; authors.el --- utility for maintaining Emacs' AUTHORS file -*-coding: iso-2022-7bit;-*-
-;; Copyright (C) 2000, 2002, 2003, 2004, 2005,
+;; Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Gerd Moellmann <gerd@gnu.org>
@@ -75,7 +75,7 @@ files.")
(nil "(afs@hplb.hpl.hp.com)")
(nil "<Use-Author-Address-Header@\\[127.1\\]>")
(nil "Code Extracted")
- (nil "Fsf")
+ (nil "\\`FSF")
(nil "ISO-2022-JP")
("Jaeyoun Chung" "Jae-youn Chung" "Jae-you Chung" "Chung Jae-youn")
("Jan Dj,Ad(Brv" "Jan D." "Jan Djarv")
@@ -300,6 +300,8 @@ found) in the repository.")
("GETTING.GNU.SOFTWARE" . "FTP")
("leim-Makefile" . "leim/Makefile")
("leim-Makefile.in" . "leim/Makefile.in")
+ ("emacs-lisp/testcover-ses.el" . "tcover-ses.el")
+ ("emacs-lisp/testcover-unsafep.el" . "tcover-unsafep.el")
("INSTALL-CVS" . "INSTALL.CVS")
)
"Alist of files which have been renamed during their lifetime.
diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el
index 792272ef88a..6053fb3cf09 100644
--- a/lisp/emacs-lisp/bindat.el
+++ b/lisp/emacs-lisp/bindat.el
@@ -319,8 +319,8 @@
((eq type 'struct)
(setq data (bindat--unpack-group (eval len))))
((eq type 'repeat)
- (let ((index 0))
- (while (< index len)
+ (let ((index 0) (count len))
+ (while (< index count)
(setq data (cons (bindat--unpack-group (nthcdr tail item)) data))
(setq index (1+ index)))
(setq data (nreverse data))))
@@ -415,8 +415,8 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..."
(bindat--length-group
(if field (bindat-get-field struct field) struct) (eval len)))
((eq type 'repeat)
- (let ((index 0))
- (while (< index len)
+ (let ((index 0) (count len))
+ (while (< index count)
(bindat--length-group
(nth index (bindat-get-field struct field))
(nthcdr tail item))
@@ -559,8 +559,8 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..."
(bindat--pack-group
(if field (bindat-get-field struct field) struct) (eval len)))
((eq type 'repeat)
- (let ((index 0))
- (while (< index len)
+ (let ((index 0) (count len))
+ (while (< index count)
(bindat--pack-group
(nth index (bindat-get-field struct field))
(nthcdr tail item))
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index ba68b842305..9c6da5f7b3c 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -1,6 +1,6 @@
;;; byte-run.el --- byte-compiler support for inlining
-;; Copyright (C) 1992, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Jamie Zawinski <jwz@lucid.com>
diff --git a/lisp/emacs-lisp/cl-compat.el b/lisp/emacs-lisp/cl-compat.el
index 34f9642fe1f..8b2c786ca04 100644
--- a/lisp/emacs-lisp/cl-compat.el
+++ b/lisp/emacs-lisp/cl-compat.el
@@ -1,6 +1,6 @@
;;; cl-compat.el --- Common Lisp extensions for GNU Emacs Lisp (compatibility)
-;; Copyright (C) 1993, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el
index 2e741408c04..55c95b655d4 100644
--- a/lisp/emacs-lisp/cl-extra.el
+++ b/lisp/emacs-lisp/cl-extra.el
@@ -1,6 +1,6 @@
;;; cl-extra.el --- Common Lisp features, part 2 -*-byte-compile-dynamic: t;-*-
-;; Copyright (C) 1993, 2000, 2002, 2003, 2004,
+;; Copyright (C) 1993, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index b7d63acc861..ba556512532 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -1,6 +1,7 @@
;;; cl-macs.el --- Common Lisp macros -*-byte-compile-dynamic: t;-*-
-;; Copyright (C) 1993, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005, 2006
+;; Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
;; Version: 2.02
@@ -2291,10 +2292,15 @@ copier, a `NAME-p' predicate, and setf-able `NAME-SLOT' accessors.
(if (cadr (memq :read-only (cddr desc)))
(list 'error (format "%s is a read-only slot"
accessor))
- (list 'cl-struct-setf-expander 'cl-x
- (list 'quote name) (list 'quote accessor)
- (and pred-check (list 'quote pred-check))
- pos)))
+ ;; If cl is loaded only for compilation,
+ ;; the call to cl-struct-setf-expander would
+ ;; cause a warning because it may not be
+ ;; defined at run time. Suppress that warning.
+ (list 'with-no-warnings
+ (list 'cl-struct-setf-expander 'cl-x
+ (list 'quote name) (list 'quote accessor)
+ (and pred-check (list 'quote pred-check))
+ pos))))
forms)
(if print-auto
(nconc print-func
diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el
index 6b14acd23df..11609d8a4ca 100644
--- a/lisp/emacs-lisp/cl-seq.el
+++ b/lisp/emacs-lisp/cl-seq.el
@@ -1,6 +1,6 @@
;;; cl-seq.el --- Common Lisp features, part 3 -*-byte-compile-dynamic: t;-*-
-;; Copyright (C) 1993, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
diff --git a/lisp/emacs-lisp/cl-specs.el b/lisp/emacs-lisp/cl-specs.el
index 9d3f1f63061..644d0736d84 100644
--- a/lisp/emacs-lisp/cl-specs.el
+++ b/lisp/emacs-lisp/cl-specs.el
@@ -1,6 +1,6 @@
;;; cl-specs.el --- Edebug specs for cl.el -*- no-byte-compile: t -*-
-;; Copyright (C) 1993, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Daniel LaLiberte <liberte@holonexus.org>
;; Keywords: lisp, tools, maint
diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el
index d2d68189230..0c9091e2128 100644
--- a/lisp/emacs-lisp/cl.el
+++ b/lisp/emacs-lisp/cl.el
@@ -1,6 +1,6 @@
;;; cl.el --- Common Lisp extensions for Emacs -*-byte-compile-dynamic: t;-*-
-;; Copyright (C) 1993, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Dave Gillespie <daveg@synaptics.com>
diff --git a/lisp/emacs-lisp/crm.el b/lisp/emacs-lisp/crm.el
index 11d4d7fb2ba..6fd98583ccc 100644
--- a/lisp/emacs-lisp/crm.el
+++ b/lisp/emacs-lisp/crm.el
@@ -1,7 +1,7 @@
;;; crm.el --- read multiple strings with completion
;; Copyright (C) 1985, 1986, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Sen Nagata <sen@eccosys.com>
;; Keywords: completion, minibuffer, multiple elements
diff --git a/lisp/emacs-lisp/cust-print.el b/lisp/emacs-lisp/cust-print.el
index f37a5348552..c38702c38f6 100644
--- a/lisp/emacs-lisp/cust-print.el
+++ b/lisp/emacs-lisp/cust-print.el
@@ -1,6 +1,6 @@
;;; cust-print.el --- handles print-level and print-circle
-;; Copyright (C) 1992, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Daniel LaLiberte <liberte@holonexus.org>
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 10482bd49c4..8bb4e5f7643 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -1,7 +1,7 @@
;;; derived.el --- allow inheritance of major modes
;; (formerly mode-clone.el)
-;; Copyright (C) 1993, 1994, 1999, 2002, 2003, 2004,
+;; Copyright (C) 1993, 1994, 1999, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: David Megginson (dmeggins@aix1.uottawa.ca)
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index de8f0a91af4..213854edb54 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -274,7 +274,7 @@ With zero or negative ARG turn mode off.
(defalias 'easy-mmode-define-global-mode 'define-global-minor-mode)
;;;###autoload
(defmacro define-global-minor-mode (global-mode mode turn-on &rest keys)
- "Make GLOBAL-MODE out of the buffer-local minor MODE.
+ "Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE.
TURN-ON is a function that will be called with no args in every buffer
and that should try to turn MODE on if applicable for that buffer.
KEYS is a list of CL-style keyword arguments. As the minor mode
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 92f5251a8b1..06cafb17e61 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -1,7 +1,7 @@
;;; easymenu.el --- support the easymenu interface for defining a menu
-;; Copyright (C) 1994, 1996, 1998, 1999, 2000, 2002, 2003, 2004,
-;; 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 1996, 1998, 1999, 2000, 2001, 2002, 2003,
+;; 2004, 2005, 2006 Free Software Foundation, Inc.
;; Keywords: emulations
;; Author: Richard Stallman <rms@gnu.org>
@@ -443,20 +443,24 @@ When non-nil, NOEXP indicates that CALLBACK cannot be an expression
command))
;;;###autoload
-(defun easy-menu-change (path name items &optional before)
+(defun easy-menu-change (path name items &optional before map)
"Change menu found at PATH as item NAME to contain ITEMS.
PATH is a list of strings for locating the menu that
should contain a submenu named NAME.
ITEMS is a list of menu items, as in `easy-menu-define'.
These items entirely replace the previous items in that submenu.
+If MAP is specified, it should normally be a keymap; nil stands for the local
+menu-bar keymap. It can also be a symbol, which has earlier been used as the
+first argument in a call to `easy-menu-define', or the value of such a symbol.
+
If the menu located by PATH has no submenu named NAME, add one.
If the optional argument BEFORE is present, add it just before
the submenu named BEFORE, otherwise add it at the end of the menu.
To implement dynamic menus, either call this from
`menu-bar-update-hook' or use a menu filter."
- (easy-menu-add-item nil path (easy-menu-create-menu name items) before))
+ (easy-menu-add-item map path (easy-menu-create-menu name items) before))
;; XEmacs needs the following two functions to add and remove menus.
;; In Emacs this is done automatically when switching keymaps, so
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 98d778f1507..3bf34279b79 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -1,6 +1,6 @@
;;; eldoc.el --- show function arglist or variable docstring in echo area
-;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004,
+;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Noah Friedman <friedman@splode.com>
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 85c0026e801..124817427d6 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -1,6 +1,6 @@
;;; elint.el --- Lint Emacs Lisp
-;; Copyright (C) 1997, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Peter Liljenberg <petli@lysator.liu.se>
diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el
index b4857f4310d..0ffaf564ba4 100644
--- a/lisp/emacs-lisp/ewoc.el
+++ b/lisp/emacs-lisp/ewoc.el
@@ -1,7 +1,7 @@
;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer
;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Per Cederqvist <ceder@lysator.liu.se>
;; Inge Wallin <inge@lysator.liu.se>
diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el
index a51493d22ea..35ba803d78e 100644
--- a/lisp/emacs-lisp/find-func.el
+++ b/lisp/emacs-lisp/find-func.el
@@ -397,7 +397,7 @@ The library where VARIABLE is defined is searched for in FILE or
;;;###autoload
(defun find-variable (variable)
- "Find the definition of the VARIABLE near point.
+ "Find the definition of the VARIABLE at or before point.
Finds the library containing the definition of the variable
near point (selected by `variable-at-point') in a buffer and
diff --git a/lisp/emacs-lisp/find-gc.el b/lisp/emacs-lisp/find-gc.el
index dedadfa8c36..482a72eece2 100644
--- a/lisp/emacs-lisp/find-gc.el
+++ b/lisp/emacs-lisp/find-gc.el
@@ -1,6 +1,6 @@
;;; find-gc.el --- detect functions that call the garbage collector
-;; Copyright (C) 1992, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
diff --git a/lisp/emacs-lisp/float-sup.el b/lisp/emacs-lisp/float-sup.el
index fb367d1cac4..dc630e72c92 100644
--- a/lisp/emacs-lisp/float-sup.el
+++ b/lisp/emacs-lisp/float-sup.el
@@ -1,6 +1,6 @@
;;; float-sup.el --- define some constants useful for floating point numbers.
-;; Copyright (C) 1985, 1986, 1987, 2002, 2003, 2004,
+;; Copyright (C) 1985, 1986, 1987, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
diff --git a/lisp/emacs-lisp/generic.el b/lisp/emacs-lisp/generic.el
index 20df0b7ad6f..b8f944ea8bc 100644
--- a/lisp/emacs-lisp/generic.el
+++ b/lisp/emacs-lisp/generic.el
@@ -1,6 +1,6 @@
;;; generic.el --- defining simple major modes with comment and font-lock
;;
-;; Copyright (C) 1997, 1999, 2002, 2003, 2004,
+;; Copyright (C) 1997, 1999, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;;
;; Author: Peter Breton <pbreton@cs.umb.edu>
diff --git a/lisp/emacs-lisp/gulp.el b/lisp/emacs-lisp/gulp.el
index d6b963a7e3d..6fc2dba9273 100644
--- a/lisp/emacs-lisp/gulp.el
+++ b/lisp/emacs-lisp/gulp.el
@@ -1,6 +1,6 @@
;;; gulp.el --- ask for updates for Lisp packages
-;; Copyright (C) 1996, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Sam Shteingold <shteingd@math.ucla.edu>
diff --git a/lisp/emacs-lisp/helper.el b/lisp/emacs-lisp/helper.el
index 92eb86ce676..a7cf792a4ba 100644
--- a/lisp/emacs-lisp/helper.el
+++ b/lisp/emacs-lisp/helper.el
@@ -1,6 +1,6 @@
;;; helper.el --- utility help package supporting help in electric modes
-;; Copyright (C) 1985, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: K. Shane Hartman
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el
index 6bc7da7ba28..895bec256d4 100644
--- a/lisp/emacs-lisp/lisp.el
+++ b/lisp/emacs-lisp/lisp.el
@@ -1,6 +1,6 @@
;;; lisp.el --- Lisp editing commands for Emacs
-;; Copyright (C) 1985, 1986, 1994, 2000, 2002, 2003, 2004,
+;; Copyright (C) 1985, 1986, 1994, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
@@ -185,13 +185,18 @@ With ARG, do it that many times. Negative arg -N
means move forward to Nth following beginning of defun.
Returns t unless search stops due to beginning or end of buffer.
-Normally a defun starts when there is a char with open-parenthesis
-syntax at the beginning of a line. If `defun-prompt-regexp' is
-non-nil, then a string which matches that regexp may precede the
-open-parenthesis, and point ends up at the beginning of the line.
-
If variable `beginning-of-defun-function' is non-nil, its value
-is called as a function to find the defun's beginning."
+is called as a function to find the defun's beginning.
+
+Normally a defun is assumed to start where there is a char with
+open-parenthesis syntax at the beginning of a line. If
+`defun-prompt-regexp' is non-nil, then a string which matches
+that regexp may precede the open-parenthesis, and point ends up
+at the beginning of the line.
+
+If `defun-prompt-regexp' and `open-paren-in-column-0-is-defun-start'
+are both nil, the function instead finds an open-paren at the
+outermost level."
(interactive "p")
(or (not (eq this-command 'beginning-of-defun))
(eq last-command 'beginning-of-defun)
@@ -208,9 +213,9 @@ is non-nil.
If variable `beginning-of-defun-function' is non-nil, its value
is called as a function to find the defun's beginning."
- (interactive "p") ; change this to "P", maybe, if we ever come to pass ARG
- ; to beginning-of-defun-function.
- (unless arg (setq arg 1)) ; The call might not be interactive.
+ (interactive "p") ; change this to "P", maybe, if we ever come to pass ARG
+ ; to beginning-of-defun-function.
+ (unless arg (setq arg 1))
(cond
(beginning-of-defun-function
(if (> arg 0)
@@ -230,42 +235,56 @@ is called as a function to find the defun's beginning."
nil 'move arg)
(progn (goto-char (1- (match-end 0)))) t))
+ ;; If open-paren-in-column-0-is-defun-start and defun-prompt-regexp
+ ;; are both nil, column 0 has no significance - so scan forward
+ ;; from BOB to see how nested point is, then carry on from there.
+ ;;
+ ;; It is generally not a good idea to land up here, because the
+ ;; call to scan-lists below can be extremely slow. This is because
+ ;; back_comment in syntax.c may have to scan from bob to find the
+ ;; beginning of each comment. Fixing this is not trivial -- cyd.
+
+ ((eq arg 0))
(t
- ;; Column 0 has no significance - so scan forward from BOB to see how
- ;; nested point is, then carry on from there.
- (let* ((floor (point-min))
- (ceiling (point-max))
- (pps-state (let (syntax-begin-function
- font-lock-beginning-of-syntax-function)
- (syntax-ppss)))
- (nesting-depth (nth 0 pps-state)))
+ (let ((floor (point-min))
+ (ceiling (point-max))
+ (arg-+ve (> arg 0)))
(save-restriction
(widen)
- ;; Get outside of any string or comment.
- (if (nth 8 pps-state)
- (goto-char (nth 8 pps-state)))
-
- (cond
- ((> arg 0)
- (when (> nesting-depth 0)
- (up-list (- nesting-depth))
- (setq arg (1- arg)))
- ;; We're now outside of any defun.
- (backward-list arg)
- (if (< (point) floor) (goto-char floor)))
-
- ((< arg 0)
- (cond
- ((> nesting-depth 0)
- (up-list nesting-depth)
- (setq arg (1+ arg)))
- ((not (looking-at "\\s("))
- ;; We're between defuns, and not at the start of one.
- (setq arg (1+ arg))))
- (forward-list (- arg))
- (down-list)
- (backward-char)
- (if (> (point) ceiling) (goto-char ceiling)))))))))
+ (let ((ppss (let (syntax-begin-function
+ font-lock-beginning-of-syntax-function)
+ (syntax-ppss)))
+ ;; position of least enclosing paren, or nil.
+ encl-pos)
+ ;; Back out of any comment/string, so that encl-pos will always
+ ;; become nil if we're at top-level.
+ (when (nth 8 ppss)
+ (goto-char (nth 8 ppss))
+ (setq ppss (syntax-ppss))) ; should be fast, due to cache.
+ (setq encl-pos (syntax-ppss-toplevel-pos ppss))
+ (if encl-pos (goto-char encl-pos))
+
+ (and encl-pos arg-+ve (setq arg (1- arg)))
+ (and (not encl-pos) (not arg-+ve) (not (looking-at "\\s("))
+ (setq arg (1+ arg)))
+
+ (condition-case nil ; to catch crazy parens.
+ (progn
+ (goto-char (scan-lists (point) (- arg) 0))
+ (if arg-+ve
+ (if (>= (point) floor)
+ t
+ (goto-char floor)
+ nil)
+ ;; forward to next (, or trigger the c-c
+ (goto-char (1- (scan-lists (point) 1 -1)))
+ (if (<= (point) ceiling)
+ t
+ (goto-char ceiling)
+ nil)))
+ (error
+ (goto-char (if arg-+ve floor ceiling))
+ nil))))))))
(defvar end-of-defun-function nil
"If non-nil, function for function `end-of-defun' to call.
diff --git a/lisp/emacs-lisp/lmenu.el b/lisp/emacs-lisp/lmenu.el
index aa87b7fed09..0f6904356ae 100644
--- a/lisp/emacs-lisp/lmenu.el
+++ b/lisp/emacs-lisp/lmenu.el
@@ -1,6 +1,6 @@
;;; lmenu.el --- emulate Lucid's menubar support
-;; Copyright (C) 1992, 1993, 1994, 1997, 2002, 2003, 2004,
+;; Copyright (C) 1992, 1993, 1994, 1997, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Keywords: emulations obsolete
diff --git a/lisp/emacs-lisp/lselect.el b/lisp/emacs-lisp/lselect.el
index 5aed4822818..8b18d1a1123 100644
--- a/lisp/emacs-lisp/lselect.el
+++ b/lisp/emacs-lisp/lselect.el
@@ -1,6 +1,6 @@
;;; lselect.el --- Lucid interface to X Selections
-;; Copyright (C) 1990, 1993, 2002, 2003, 2004,
+;; Copyright (C) 1990, 1993, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el
index dc966a75cd6..7b2dac6cd45 100644
--- a/lisp/emacs-lisp/map-ynp.el
+++ b/lisp/emacs-lisp/map-ynp.el
@@ -1,6 +1,6 @@
;;; map-ynp.el --- general-purpose boolean question-asker
-;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2002, 2003,
+;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@gnu.org>
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el
index 931ebf28bd2..894ff1a8967 100644
--- a/lisp/emacs-lisp/regexp-opt.el
+++ b/lisp/emacs-lisp/regexp-opt.el
@@ -1,6 +1,6 @@
;;; regexp-opt.el --- generate efficient regexps to match strings
-;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
+;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
;; 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
;; Author: Simon Marshall <simon@gnu.org>
diff --git a/lisp/emacs-lisp/regi.el b/lisp/emacs-lisp/regi.el
index 06ed2880ee1..bc6c9983b19 100644
--- a/lisp/emacs-lisp/regi.el
+++ b/lisp/emacs-lisp/regi.el
@@ -1,6 +1,6 @@
;;; regi.el --- REGular expression Interpreting engine
-;; Copyright (C) 1993, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: 1993 Barry A. Warsaw, Century Computing, Inc. <bwarsaw@cen.com>
diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el
index c5391f94b05..f775513e961 100644
--- a/lisp/emacs-lisp/ring.el
+++ b/lisp/emacs-lisp/ring.el
@@ -1,6 +1,6 @@
;;; ring.el --- handle rings of items
-;; Copyright (C) 1992, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index 7162aa822b7..98f3e30f10e 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -1,6 +1,6 @@
;;; shadow.el --- locate Emacs Lisp file shadowings
-;; Copyright (C) 1995, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1995, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Author: Terry Jones <terry@santafe.edu>
diff --git a/lisp/emacs-lisp/sregex.el b/lisp/emacs-lisp/sregex.el
index 23145bccc36..5d37eb99859 100644
--- a/lisp/emacs-lisp/sregex.el
+++ b/lisp/emacs-lisp/sregex.el
@@ -1,6 +1,6 @@
;;; sregex.el --- symbolic regular expressions
-;; Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004,
+;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Bob Glickstein <bobg+sregex@zanshin.com>
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 695d7877b38..0937076a7f4 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -52,6 +52,22 @@
(defsubst syntax-ppss-depth (ppss)
(nth 0 ppss))
+(defun syntax-ppss-toplevel-pos (ppss)
+ "Get the latest syntactically outermost position found in a syntactic scan.
+PPSS is a scan state, as returned by `partial-parse-sexp' or `syntax-ppss'.
+An \"outermost position\" means one that it is outside of any syntactic entity:
+outside of any parentheses, comments, or strings encountered in the scan.
+If no such position is recorded in PPSS (because the end of the scan was
+itself at the outermost level), return nil."
+ ;; BEWARE! We rely on the undocumented 9th field. The 9th field currently
+ ;; contains the list of positions of the enclosing open-parens.
+ ;; I.e. those positions are outside of any string/comment and the first of
+ ;; those is outside of any paren (i.e. corresponds to a nil ppss).
+ ;; If this list is empty but we are in a string or comment, then the 8th
+ ;; field contains a similar "toplevel" position.
+ (or (car (nth 9 ppss))
+ (nth 8 ppss)))
+
(defsubst syntax-ppss-context (ppss)
(cond
((nth 3 ppss) 'string)
@@ -87,8 +103,7 @@ point (where the PPSS is equivalent to nil).")
;; depend on the text after BEG (which is presumably changed). So if
;; BEG=(car (nth 10 syntax-ppss-last)) don't reuse that data because the
;; assumed nil state at BEG may not be valid any more.
- (if (<= beg (or (car (nth 10 syntax-ppss-last))
- (nth 9 syntax-ppss-last)
+ (if (<= beg (or (syntax-ppss-toplevel-pos (cdr syntax-ppss-last))
(nth 3 syntax-ppss-last)
0))
(setq syntax-ppss-last nil)
@@ -136,22 +151,14 @@ Point is at POS when this function returns."
(cond
;; Use OLD-PPSS if possible and close enough.
((and (not old-pos) old-ppss
- ;; BEWARE! We rely on the undocumented 9th field. The 9th
- ;; field currently contains the list of positions of
- ;; open-parens of the enclosing parens. I.e. those
- ;; positions are outside of any string/comment
- ;; and the first of those is outside of any paren
- ;; (i.e. corresponds to a nil ppss). If this list is empty
- ;; but we are in a string or comment, then the 8th field
- ;; contains a similar "toplevel" position. If `pt-min' is
- ;; too far from `pos', we could try to use other positions
- ;; in (nth 9 old-ppss), but that doesn't seem to happen in
- ;; practice and it would complicate this code (and the
- ;; before-change-function code even more). But maybe it
- ;; would be useful in "degenerate" cases such as when the
- ;; whole file is wrapped in a set of parenthesis.
- (setq pt-min (or (car (nth 9 old-ppss))
- (nth 8 old-ppss)
+ ;; If `pt-min' is too far from `pos', we could try to use
+ ;; other positions in (nth 9 old-ppss), but that doesn't
+ ;; seem to happen in practice and it would complicate this
+ ;; code (and the before-change-function code even more).
+ ;; But maybe it would be useful in "degenerate" cases such
+ ;; as when the whole file is wrapped in a set
+ ;; of parentheses.
+ (setq pt-min (or (syntax-ppss-toplevel-pos old-ppss)
(nth 2 old-ppss)))
(<= pt-min pos) (< (- pos pt-min) syntax-ppss-max-span))
(incf (car (aref syntax-ppss-stats 1)))
diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el
index 0c66a207351..4ad4dac1d58 100644
--- a/lisp/emacs-lisp/timer.el
+++ b/lisp/emacs-lisp/timer.el
@@ -1,6 +1,6 @@
;;; timer.el --- run a function with args at some time in future
-;; Copyright (C) 1996, 2002, 2003, 2004, 2005,
+;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
;; 2006 Free Software Foundation, Inc.
;; Maintainer: FSF
diff --git a/lisp/emacs-lisp/tq.el b/lisp/emacs-lisp/tq.el
index 1e1e143f0f0..7c4303b5b79 100644
--- a/lisp/emacs-lisp/tq.el
+++ b/lisp/emacs-lisp/tq.el
@@ -1,6 +1,6 @@
;;; tq.el --- utility to maintain a transaction queue
-;; Copyright (C) 1985, 1986, 1987, 1992, 2002, 2003, 2004,
+;; Copyright (C) 1985, 1986, 1987, 1992, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Scott Draves <spot@cs.cmu.edu>
diff --git a/lisp/emacs-lisp/trace.el b/lisp/emacs-lisp/trace.el
index 191be58c0b5..5250a34b3fd 100644
--- a/lisp/emacs-lisp/trace.el
+++ b/lisp/emacs-lisp/trace.el
@@ -1,6 +1,6 @@
;;; trace.el --- tracing facility for Emacs Lisp functions
-;; Copyright (C) 1993, 1998, 2000, 2002, 2003, 2004,
+;; Copyright (C) 1993, 1998, 2000, 2001, 2002, 2003, 2004,
;; 2005, 2006 Free Software Foundation, Inc.
;; Author: Hans Chalupsky <hans@cs.buffalo.edu>