diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/authors.el | 1 | ||||
-rw-r--r-- | lisp/emacs-lisp/autoload.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/avl-tree.el | 16 | ||||
-rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 7 | ||||
-rw-r--r-- | lisp/emacs-lisp/chart.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/cl-extra.el | 3 | ||||
-rw-r--r-- | lisp/emacs-lisp/easy-mmode.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/edebug.el | 15 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio-opt.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/eieio.el | 6 | ||||
-rw-r--r-- | lisp/emacs-lisp/ert-x.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/ert.el | 2 | ||||
-rw-r--r-- | lisp/emacs-lisp/lisp.el | 16 | ||||
-rw-r--r-- | lisp/emacs-lisp/regexp-opt.el | 27 | ||||
-rw-r--r-- | lisp/emacs-lisp/timer.el | 2 |
16 files changed, 69 insertions, 43 deletions
diff --git a/lisp/emacs-lisp/authors.el b/lisp/emacs-lisp/authors.el index 22e0ade987d..6f2c6f73eca 100644 --- a/lisp/emacs-lisp/authors.el +++ b/lisp/emacs-lisp/authors.el @@ -170,6 +170,7 @@ files.") ("Thomas Dye" "Tom Dye") ("Thomas Horsley" "Tom Horsley") ; FIXME ? ("Thomas Wurgler" "Tom Wurgler") + ("Toby Cubitt" "Toby S\\. Cubitt") ("Tomohiko Morioka" "MORIOKA Tomohiko") ("Torbjörn Axelsson" "Torbjvrn Axelsson") ("Torbjörn Einarsson" "Torbj.*rn Einarsson") diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 5af666b9ded..921b08b10a8 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -762,9 +762,6 @@ write its autoloads into the specified file instead." (define-obsolete-function-alias 'update-autoloads-from-directories 'update-directory-autoloads "22.1") -(defvar autoload-make-program (or (getenv "MAKE") "make") - "Name of the make program in use during the Emacs build process.") - ;;;###autoload (defun batch-update-autoloads () "Update loaddefs.el autoloads in batch mode. diff --git a/lisp/emacs-lisp/avl-tree.el b/lisp/emacs-lisp/avl-tree.el index cb5ea048999..9f348767478 100644 --- a/lisp/emacs-lisp/avl-tree.el +++ b/lisp/emacs-lisp/avl-tree.el @@ -295,9 +295,9 @@ Return t if the height of the tree has grown." (if (> (* sgn b2) 0) (- sgn) 0) (avl-tree--node-balance p1) (if (< (* sgn b2) 0) sgn 0) - (avl-tree--node-branch node branch) p2 - (avl-tree--node-balance - (avl-tree--node-branch node branch)) 0)) + (avl-tree--node-branch node branch) p2)) + (setf (avl-tree--node-balance + (avl-tree--node-branch node branch)) 0) nil)))) (defun avl-tree--do-enter (cmpfun root branch data &optional updatefun) @@ -339,6 +339,16 @@ inserted data." (cons nil newdata)) ; return value )))) +(defun avl-tree--check (tree) + "Check the tree's balance." + (avl-tree--check-node (avl-tree--root tree))) +(defun avl-tree--check-node (node) + (if (null node) 0 + (let ((dl (avl-tree--check-node (avl-tree--node-left node))) + (dr (avl-tree--check-node (avl-tree--node-right node)))) + (assert (= (- dr dl) (avl-tree--node-balance node))) + (1+ (max dl dr))))) + ;; ---------------------------------------------------------------- diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 78ac29d89df..3b324a09659 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el @@ -1237,7 +1237,7 @@ string-to-multibyte tan truncate unibyte-char-to-multibyte upcase user-full-name - user-login-name user-original-login-name user-variable-p + user-login-name user-original-login-name custom-variable-p vconcat window-buffer window-dedicated-p window-edges window-height window-hscroll window-minibuffer-p window-width diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 2ee878e5213..93c6518d215 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2694,7 +2694,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (limits '(5 ; Use the 1-byte varref codes, 63 ; 1-constlim ; 1-byte byte-constant codes, 255 ; 2-byte varref codes, - 65535)) ; 3-byte codes for the rest. + 65535 ; 3-byte codes for the rest. + 65535)) ; twice since we step when we swap. limit) (while (or rest other) (setq limit (car limits)) @@ -2708,8 +2709,8 @@ If FORM is a lambda or a macro, byte-compile it as a function." (setcdr (car rest) (setq i (1+ i))) (setq ret (cons (car rest) ret)))) (setq rest (cdr rest))) - (setq limits (cdr limits) - rest (prog1 other + (setq limits (cdr limits) ;Step + rest (prog1 other ;&Swap. (setq other rest)))) (apply 'vector (nreverse (mapcar 'car ret))))) diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 19766feac5a..2e3abb2e9d3 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -82,7 +82,7 @@ Colors will be the background color.") Useful if new Emacs is used on B&W display.") (defcustom chart-face-use-pixmaps nil - "*Non-nil to use fancy pixmaps in the background of chart face colors." + "Non-nil to use fancy pixmaps in the background of chart face colors." :group 'eieio :type 'boolean) diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index 9ac5ce7d2f0..9a3d8cf705b 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 -;; Copyright (C) 1993, 2000-2012 Free Software Foundation, Inc. +;; Copyright (C) 1993, 2000-2012 Free Software Foundation, Inc. ;; Author: Dave Gillespie <daveg@synaptics.com> ;; Keywords: extensions @@ -430,7 +430,6 @@ With two arguments, return rounding and remainder of their quotient." ;; Random numbers. -(defvar *random-state*) ;;;###autoload (defun random* (lim &optional state) "Return a random nonnegative number less than LIM, an integer or float. diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index 88698a1f069..0d6716a2e63 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -260,7 +260,7 @@ the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'. ;; repeat-command still does the toggling correctly. (interactive (list (or current-prefix-arg 'toggle))) (let ((,last-message (current-message))) - (,@(if setter (list setter) + (,@(if setter `(funcall #',setter) (list (if (symbolp mode) 'setq 'setf) mode)) (if (eq arg 'toggle) (not ,mode) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index c241ac710cf..f47feebe5d2 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1,6 +1,6 @@ ;;; edebug.el --- a source-level debugger for Emacs Lisp -;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. +;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. ;; Author: Daniel LaLiberte <liberte@holonexus.org> ;; Maintainer: FSF @@ -191,6 +191,7 @@ Use this with caution since it is not debugged." (defcustom edebug-unwrap-results nil "Non-nil if Edebug should unwrap results of expressions. +That is, Edebug will try to remove its own instrumentation from the result. This is useful when debugging macros where the results of expressions are instrumented expressions. But don't do this when results might be circular or an infinite loop will result." @@ -2028,7 +2029,10 @@ expressions; a `progn' form will be returned enclosing these forms." (def-edebug-spec apply (function-form &rest form)) (def-edebug-spec funcall (function-form &rest form)) -;; FIXME? The manual has a gate here. +;; FIXME? The manual uses this form (maybe that's just for illustration?): +;; (def-edebug-spec let +;; ((&rest &or symbolp (gate symbolp &optional form)) +;; body)) (def-edebug-spec let ((&rest &or (symbolp &optional form) symbolp) body)) @@ -3740,7 +3744,7 @@ This prints the value into current buffer." ;; FIXME eh? (defvar gud-inhibit-global-bindings - "*Non-nil means don't do global rebindings of C-x C-a subcommands.") + "Non-nil means don't do global rebindings of C-x C-a subcommands.") ;; Global GUD bindings for all emacs-lisp-mode buffers. (unless gud-inhibit-global-bindings @@ -4157,6 +4161,8 @@ You must include newlines in FMT to break lines, but one newline is appended." ;;; Frequency count and coverage ;; FIXME should this use overlays instead? +;; Definitely, IMO. The current business with undo in +;; edebug-temp-display-freq-count is horrid. (defun edebug-display-freq-count () "Display the frequency count data for each line of the current definition. The frequency counts are inserted as comment lines after each line, @@ -4226,6 +4232,8 @@ reinstrument it." (insert "\n") (setq i first-index))))) +;; FIXME this does not work very well. Eg if you press an arrow key, +;; or make a mouse-click, it fails with "Non-character input-event". (defun edebug-temp-display-freq-count () "Temporarily display the frequency count data for the current definition. It is removed when you hit any char." @@ -4235,6 +4243,7 @@ It is removed when you hit any char." (undo-boundary) (edebug-display-freq-count) (setq unread-command-char (read-char)) + ;; Yuck! This doesn't seem to work at all for me. (undo))) diff --git a/lisp/emacs-lisp/eieio-opt.el b/lisp/emacs-lisp/eieio-opt.el index 10816aaa43c..a899839f68a 100644 --- a/lisp/emacs-lisp/eieio-opt.el +++ b/lisp/emacs-lisp/eieio-opt.el @@ -72,8 +72,7 @@ Argument CH-PREFIX is another character prefix to display." ;;; CLASS COMPLETION / DOCUMENTATION -;;;###autoload -(defalias 'describe-class 'eieio-describe-class) +;;;###autoload(defalias 'describe-class 'eieio-describe-class) ;;;###autoload (defun eieio-describe-class (class &optional headerfcn) @@ -305,8 +304,7 @@ are not abstract." ;;; METHOD COMPLETION / DOC (defalias 'describe-method 'eieio-describe-generic) -;;;###autoload -(defalias 'describe-generic 'eieio-describe-generic) +;;;###autoload(defalias 'describe-generic 'eieio-describe-generic) (defalias 'eieio-describe-method 'eieio-describe-generic) ;;;###autoload diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index cdf7237b766..f1c1bf8965c 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -79,7 +79,7 @@ ;; (defvar eieio-hook nil - "*This hook is executed, then cleared each time `defclass' is called.") + "This hook is executed, then cleared each time `defclass' is called.") (defvar eieio-error-unsupported-class-tags nil "Non-nil to throw an error if an encountered tag is unsupported. @@ -87,7 +87,7 @@ This may prevent classes from CLOS applications from being used with EIEIO since EIEIO does not support all CLOS tags.") (defvar eieio-skip-typecheck nil - "*If non-nil, skip all slot typechecking. + "If non-nil, skip all slot typechecking. Set this to t permanently if a program is functioning well to get a small speed increase. This variable is also used internally to handle default setting for optimization purposes.") @@ -2044,7 +2044,7 @@ During executions, the list is first generated, then as each next method is called, the next method is popped off the stack.") (defvar eieio-pre-method-execution-hooks nil - "*Hooks run just before a method is executed. + "Hooks run just before a method is executed. The hook function must accept one argument, the list of forms about to be executed.") diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index 257d0528cbc..a7916354c91 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -3,7 +3,7 @@ ;; Copyright (C) 2008, 2010-2012 Free Software Foundation, Inc. ;; Author: Lennart Borgman (lennart O borgman A gmail O com) -;; Author: Christian Ohler <ohler@gnu.org> +;; Christian Ohler <ohler@gnu.org> ;; This file is part of GNU Emacs. diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index 9cbe29bf322..ad5e20cb8a4 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -1405,7 +1405,7 @@ RESULT must be an `ert-test-result-with-condition'." ;;; Running tests in batch mode. (defvar ert-batch-backtrace-right-margin 70 - "*The maximum line length for printing backtraces in `ert-run-tests-batch'.") + "The maximum line length for printing backtraces in `ert-run-tests-batch'.") ;;;###autoload (defun ert-run-tests-batch (&optional selector) diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 4efdc3240cd..bcb7fab026b 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -447,7 +447,21 @@ Optional ARG is ignored." ;; Try first in this order for the sake of languages with nested ;; functions where several can end at the same place as with ;; the offside rule, e.g. Python. - (beginning-of-defun) + + ;; Finding the start of the function is a bit problematic since + ;; `beginning-of-defun' when we are on the first character of + ;; the function might go to the previous function. + ;; + ;; Therefore we first move one character forward and then call + ;; `beginning-of-defun'. However now we must check that we did + ;; not move into the next function. + (let ((here (point))) + (unless (eolp) + (forward-char)) + (beginning-of-defun) + (when (< (point) here) + (goto-char here) + (beginning-of-defun))) (setq beg (point)) (end-of-defun) (setq end (point)) diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index 6d12fe19277..72e3c398dc0 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -136,9 +136,6 @@ This means the number of non-shy regexp grouping constructs ;;; Workhorse functions. -(eval-when-compile - (require 'cl)) - (defun regexp-opt-group (strings &optional paren lax) "Return a regexp to match a string in the sorted list STRINGS. If PAREN non-nil, output regexp parentheses around returned regexp. @@ -248,15 +245,15 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher." ;; ;; Make a character map but extract character set meta characters. (dolist (char chars) - (case char - (?\] - (setq bracket "]")) - (?^ - (setq caret "^")) - (?- - (setq dash "-")) - (otherwise - (aset charmap char t)))) + (cond + ((eq char ?\]) + (setq bracket "]")) + ((eq char ?^) + (setq caret "^")) + ((eq char ?-) + (setq dash "-")) + (t + (aset charmap char t)))) ;; ;; Make a character set from the map using ranges where applicable. (map-char-table @@ -268,14 +265,14 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher." (setq charset (format "%s%c-%c" charset start end)) (while (>= end start) (setq charset (format "%s%c" charset start)) - (incf start))) + (setq start (1+ start)))) (setq start (car c) end (cdr c))) (if (= (1- c) end) (setq end c) (if (> end (+ start 2)) (setq charset (format "%s%c-%c" charset start end)) (while (>= end start) (setq charset (format "%s%c" charset start)) - (incf start))) + (setq start (1+ start)))) (setq start c end c))))) charmap) (when (>= end start) @@ -283,7 +280,7 @@ Merges keywords to avoid backtracking in Emacs's regexp matcher." (setq charset (format "%s%c-%c" charset start end)) (while (>= end start) (setq charset (format "%s%c" charset start)) - (incf start)))) + (setq start (1+ start))))) ;; ;; Make sure a caret is not first and a dash is first or last. (if (and (string-equal charset "") (string-equal bracket "")) diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index b6b7c266263..87b6cceb24b 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -241,7 +241,7 @@ and idle timers such as are scheduled by `run-with-idle-timer'." "Third-to-last timer that was run.") (defvar timer-max-repeats 10 - "*Maximum number of times to repeat a timer, if many repeats are delayed. + "Maximum number of times to repeat a timer, if many repeats are delayed. Timer invocations can be delayed because Emacs is suspended or busy, or because the system's time changes. If such an occurrence makes it appear that many invocations are overdue, this variable controls |