aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/byte-opt.el7
-rw-r--r--lisp/emacs-lisp/bytecomp.el58
-rw-r--r--lisp/emacs-lisp/easymenu.el35
-rw-r--r--lisp/emacs-lisp/elp.el1
4 files changed, 41 insertions, 60 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index e00bebc91d5..856a31551df 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1,6 +1,7 @@
1;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler 1;;; byte-opt.el --- the optimization passes of the emacs-lisp byte compiler
2 2
3;; Copyright (c) 1991,1994,2000,01,02,2004 Free Software Foundation, Inc. 3;; Copyright (c) 1991, 1994, 2000, 2001, 2002, 2004
4;; Free Software Foundation, Inc.
4 5
5;; Author: Jamie Zawinski <jwz@lucid.com> 6;; Author: Jamie Zawinski <jwz@lucid.com>
6;; Hallvard Furuseth <hbf@ulrik.uio.no> 7;; Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -266,7 +267,7 @@
266 (cdr (assq name byte-compile-function-environment))))) 267 (cdr (assq name byte-compile-function-environment)))))
267 (if (and (consp fn) (eq (car fn) 'autoload)) 268 (if (and (consp fn) (eq (car fn) 'autoload))
268 (error "File `%s' didn't define `%s'" (nth 1 fn) name)) 269 (error "File `%s' didn't define `%s'" (nth 1 fn) name))
269 (if (symbolp fn) 270 (if (and (symbolp fn) (not (eq fn t)))
270 (byte-compile-inline-expand (cons fn (cdr form))) 271 (byte-compile-inline-expand (cons fn (cdr form)))
271 (if (byte-code-function-p fn) 272 (if (byte-code-function-p fn)
272 (let (string) 273 (let (string)
@@ -2032,5 +2033,5 @@ If FOR-EFFECT is non-nil, the return value is assumed to be of no importance."
2032 byte-optimize-lapcode)))) 2033 byte-optimize-lapcode))))
2033 nil) 2034 nil)
2034 2035
2035;;; arch-tag: 0f14076b-737e-4bef-aae6-908826ec1ff1 2036;; arch-tag: 0f14076b-737e-4bef-aae6-908826ec1ff1
2036;;; byte-opt.el ends here 2037;;; byte-opt.el ends here
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 2116cc33b34..ee29039e05e 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1,7 +1,7 @@
1;;; bytecomp.el --- compilation of Lisp code into byte code 1;;; bytecomp.el --- compilation of Lisp code into byte code
2 2
3;; Copyright (C) 1985,86,87,92,94,1998,2000,01,02,03,2004 3;; Copyright (C) 1985, 1986, 1987, 1992, 1994, 1998, 2000, 2001, 2002,
4;; Free Software Foundation, Inc. 4;; 2003, 2004 Free Software Foundation, Inc.
5 5
6;; Author: Jamie Zawinski <jwz@lucid.com> 6;; Author: Jamie Zawinski <jwz@lucid.com>
7;; Hallvard Furuseth <hbf@ulrik.uio.no> 7;; Hallvard Furuseth <hbf@ulrik.uio.no>
@@ -447,7 +447,9 @@ Each element looks like (MACRONAME . DEFINITION). It is
447 "Alist of functions defined in the file being compiled. 447 "Alist of functions defined in the file being compiled.
448This is so we can inline them when necessary. 448This is so we can inline them when necessary.
449Each element looks like (FUNCTIONNAME . DEFINITION). It is 449Each element looks like (FUNCTIONNAME . DEFINITION). It is
450\(FUNCTIONNAME . nil) when a function is redefined as a macro.") 450\(FUNCTIONNAME . nil) when a function is redefined as a macro.
451It is \(FUNCTIONNAME . t) when all we know is that it was defined,
452and we don't know the definition.")
451 453
452(defvar byte-compile-unresolved-functions nil 454(defvar byte-compile-unresolved-functions nil
453 "Alist of undefined functions to which calls have been compiled. 455 "Alist of undefined functions to which calls have been compiled.
@@ -1103,6 +1105,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1103 1105
1104;;; sanity-checking arglists 1106;;; sanity-checking arglists
1105 1107
1108;; If a function has an entry saying (FUNCTION . t).
1109;; that means we know it is defined but we don't know how.
1110;; If a function has an entry saying (FUNCTION . nil),
1111;; that means treat it as not defined.
1106(defun byte-compile-fdefinition (name macro-p) 1112(defun byte-compile-fdefinition (name macro-p)
1107 (let* ((list (if macro-p 1113 (let* ((list (if macro-p
1108 byte-compile-macro-environment 1114 byte-compile-macro-environment
@@ -1168,7 +1174,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1168(defun byte-compile-callargs-warn (form) 1174(defun byte-compile-callargs-warn (form)
1169 (let* ((def (or (byte-compile-fdefinition (car form) nil) 1175 (let* ((def (or (byte-compile-fdefinition (car form) nil)
1170 (byte-compile-fdefinition (car form) t))) 1176 (byte-compile-fdefinition (car form) t)))
1171 (sig (if def 1177 (sig (if (and def (not (eq def t)))
1172 (byte-compile-arglist-signature 1178 (byte-compile-arglist-signature
1173 (if (eq 'lambda (car-safe def)) 1179 (if (eq 'lambda (car-safe def))
1174 (nth 1 def) 1180 (nth 1 def)
@@ -1198,7 +1204,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1198 (byte-compile-format-warn form) 1204 (byte-compile-format-warn form)
1199 ;; Check to see if the function will be available at runtime 1205 ;; Check to see if the function will be available at runtime
1200 ;; and/or remember its arity if it's unknown. 1206 ;; and/or remember its arity if it's unknown.
1201 (or (and (or sig (fboundp (car form))) ; might be a subr or autoload. 1207 (or (and (or def (fboundp (car form))) ; might be a subr or autoload.
1202 (not (memq (car form) byte-compile-noruntime-functions))) 1208 (not (memq (car form) byte-compile-noruntime-functions)))
1203 (eq (car form) byte-compile-current-form) ; ## this doesn't work 1209 (eq (car form) byte-compile-current-form) ; ## this doesn't work
1204 ; with recursion. 1210 ; with recursion.
@@ -1209,9 +1215,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1209 (if cons 1215 (if cons
1210 (or (memq n (cdr cons)) 1216 (or (memq n (cdr cons))
1211 (setcdr cons (cons n (cdr cons)))) 1217 (setcdr cons (cons n (cdr cons))))
1212 (setq byte-compile-unresolved-functions 1218 (push (list (car form) n)
1213 (cons (list (car form) n) 1219 byte-compile-unresolved-functions))))))
1214 byte-compile-unresolved-functions)))))))
1215 1220
1216(defun byte-compile-format-warn (form) 1221(defun byte-compile-format-warn (form)
1217 "Warn if FORM is `format'-like with inconsistent args. 1222 "Warn if FORM is `format'-like with inconsistent args.
@@ -1243,7 +1248,7 @@ extra args."
1243;; number of arguments. 1248;; number of arguments.
1244(defun byte-compile-arglist-warn (form macrop) 1249(defun byte-compile-arglist-warn (form macrop)
1245 (let ((old (byte-compile-fdefinition (nth 1 form) macrop))) 1250 (let ((old (byte-compile-fdefinition (nth 1 form) macrop)))
1246 (if old 1251 (if (and old (not (eq old t)))
1247 (let ((sig1 (byte-compile-arglist-signature 1252 (let ((sig1 (byte-compile-arglist-signature
1248 (if (eq 'lambda (car-safe old)) 1253 (if (eq 'lambda (car-safe old))
1249 (nth 1 old) 1254 (nth 1 old)
@@ -2123,9 +2128,9 @@ list that represents a doc string reference.
2123 (eq (car (nth 1 form)) 'quote) 2128 (eq (car (nth 1 form)) 'quote)
2124 (consp (cdr (nth 1 form))) 2129 (consp (cdr (nth 1 form)))
2125 (symbolp (nth 1 (nth 1 form)))) 2130 (symbolp (nth 1 (nth 1 form))))
2126 (add-to-list 'byte-compile-function-environment 2131 (push (cons (nth 1 (nth 1 form))
2127 (cons (nth 1 (nth 1 form)) 2132 (cons 'autoload (cdr (cdr form))))
2128 (cons 'autoload (cdr (cdr form)))))) 2133 byte-compile-function-environment))
2129 (if (stringp (nth 3 form)) 2134 (if (stringp (nth 3 form))
2130 form 2135 form
2131 ;; No doc string, so we can compile this as a normal form. 2136 ;; No doc string, so we can compile this as a normal form.
@@ -3608,7 +3613,6 @@ being undefined will be suppressed."
3608(byte-defop-compiler-1 defconst byte-compile-defvar) 3613(byte-defop-compiler-1 defconst byte-compile-defvar)
3609(byte-defop-compiler-1 autoload) 3614(byte-defop-compiler-1 autoload)
3610(byte-defop-compiler-1 lambda byte-compile-lambda-form) 3615(byte-defop-compiler-1 lambda byte-compile-lambda-form)
3611(byte-defop-compiler-1 defalias)
3612 3616
3613(defun byte-compile-defun (form) 3617(defun byte-compile-defun (form)
3614 ;; This is not used for file-level defuns with doc strings. 3618 ;; This is not used for file-level defuns with doc strings.
@@ -3710,22 +3714,22 @@ being undefined will be suppressed."
3710 (error "`lambda' used as function name is invalid")) 3714 (error "`lambda' used as function name is invalid"))
3711 3715
3712;; Compile normally, but deal with warnings for the function being defined. 3716;; Compile normally, but deal with warnings for the function being defined.
3713(defun byte-compile-defalias (form) 3717(put 'defalias 'byte-hunk-handler 'byte-compile-file-form-defalias)
3718(defun byte-compile-file-form-defalias (form)
3714 (if (and (consp (cdr form)) (consp (nth 1 form)) 3719 (if (and (consp (cdr form)) (consp (nth 1 form))
3715 (eq (car (nth 1 form)) 'quote) 3720 (eq (car (nth 1 form)) 'quote)
3716 (consp (cdr (nth 1 form))) 3721 (consp (cdr (nth 1 form)))
3717 (symbolp (nth 1 (nth 1 form))) 3722 (symbolp (nth 1 (nth 1 form))))
3718 (consp (nthcdr 2 form)) 3723 (let ((constant
3719 (consp (nth 2 form)) 3724 (and (consp (nthcdr 2 form))
3720 (eq (car (nth 2 form)) 'quote) 3725 (consp (nth 2 form))
3721 (consp (cdr (nth 2 form))) 3726 (eq (car (nth 2 form)) 'quote)
3722 (symbolp (nth 1 (nth 2 form)))) 3727 (consp (cdr (nth 2 form)))
3723 (progn 3728 (symbolp (nth 1 (nth 2 form))))))
3724 (byte-compile-defalias-warn (nth 1 (nth 1 form))) 3729 (byte-compile-defalias-warn (nth 1 (nth 1 form)))
3725 (setq byte-compile-function-environment 3730 (push (cons (nth 1 (nth 1 form))
3726 (cons (cons (nth 1 (nth 1 form)) 3731 (if constant (nth 1 (nth 2 form)) t))
3727 (nth 1 (nth 2 form))) 3732 byte-compile-function-environment)))
3728 byte-compile-function-environment))))
3729 (byte-compile-normal-call form)) 3733 (byte-compile-normal-call form))
3730 3734
3731;; Turn off warnings about prior calls to the function being defalias'd. 3735;; Turn off warnings about prior calls to the function being defalias'd.
@@ -3928,7 +3932,7 @@ invoked interactively."
3928 (while rest 3932 (while rest
3929 (or (nth 1 (car rest)) 3933 (or (nth 1 (car rest))
3930 (null (setq f (car (car rest)))) 3934 (null (setq f (car (car rest))))
3931 (byte-compile-fdefinition f t) 3935 (functionp (byte-compile-fdefinition f t))
3932 (commandp (byte-compile-fdefinition f nil)) 3936 (commandp (byte-compile-fdefinition f nil))
3933 (setq uncalled (cons f uncalled))) 3937 (setq uncalled (cons f uncalled)))
3934 (setq rest (cdr rest))) 3938 (setq rest (cdr rest)))
@@ -4110,5 +4114,5 @@ For example, invoke `emacs -batch -f batch-byte-recompile-directory .'."
4110 4114
4111(run-hooks 'bytecomp-load-hook) 4115(run-hooks 'bytecomp-load-hook)
4112 4116
4113;;; arch-tag: 9c97b0f0-8745-4571-bfc3-8dceb677292a 4117;; arch-tag: 9c97b0f0-8745-4571-bfc3-8dceb677292a
4114;;; bytecomp.el ends here 4118;;; bytecomp.el ends here
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el
index 7b18756fd7e..b0f3b9b9d3e 100644
--- a/lisp/emacs-lisp/easymenu.el
+++ b/lisp/emacs-lisp/easymenu.el
@@ -42,25 +42,7 @@ menus, turn this variable off, otherwise it is probably better to keep it on."
42 :version "20.3") 42 :version "20.3")
43 43
44(defsubst easy-menu-intern (s) 44(defsubst easy-menu-intern (s)
45 (if (stringp s) 45 (if (stringp s) (intern s) s))
46 (let ((copy (copy-sequence s))
47 (pos 0)
48 found)
49 ;; For each letter that starts a word, flip its case.
50 ;; This way, the usual convention for menu strings (capitalized)
51 ;; corresponds to the usual convention for menu item event types
52 ;; (all lower case). It's a 1-1 mapping so causes no conflicts.
53 (while (setq found (string-match "\\<\\sw" copy pos))
54 (setq pos (match-end 0))
55 (unless (= (upcase (aref copy found))
56 (downcase (aref copy found)))
57 (aset copy found
58 (if (= (upcase (aref copy found))
59 (aref copy found))
60 (downcase (aref copy found))
61 (upcase (aref copy found))))))
62 (intern copy))
63 s))
64 46
65;;;###autoload 47;;;###autoload
66(put 'easy-menu-define 'lisp-indent-function 'defun) 48(put 'easy-menu-define 'lisp-indent-function 'defun)
@@ -396,6 +378,7 @@ otherwise put the new binding last in MENU.
396BEFORE can be either a string (menu item name) or a symbol 378BEFORE can be either a string (menu item name) or a symbol
397\(the fake function key for the menu item). 379\(the fake function key for the menu item).
398KEY does not have to be a symbol, and comparison is done with equal." 380KEY does not have to be a symbol, and comparison is done with equal."
381 (if (symbolp menu) (setq menu (indirect-function menu)))
399 (let ((inserted (null item)) ; Fake already inserted. 382 (let ((inserted (null item)) ; Fake already inserted.
400 tail done) 383 tail done)
401 (while (not done) 384 (while (not done)
@@ -437,8 +420,7 @@ ITEM should be a keymap binding of the form (KEY . MENU-ITEM)."
437 (error nil)) ;`item' might not be a proper list. 420 (error nil)) ;`item' might not be a proper list.
438 ;; Also check the string version of the symbol name, 421 ;; Also check the string version of the symbol name,
439 ;; for backwards compatibility. 422 ;; for backwards compatibility.
440 (eq (car-safe item) (intern name)) 423 (eq (car-safe item) (intern name)))))))
441 (eq (car-safe item) (easy-menu-intern name)))))))
442 424
443(defun easy-menu-always-true-p (x) 425(defun easy-menu-always-true-p (x)
444 "Return true if form X never evaluates to nil." 426 "Return true if form X never evaluates to nil."
@@ -541,15 +523,10 @@ earlier by `easy-menu-define' or `easy-menu-create-menu'."
541 (easy-menu-define-key map (easy-menu-intern (car item)) 523 (easy-menu-define-key map (easy-menu-intern (car item))
542 (cdr item) before) 524 (cdr item) before)
543 (if (or (keymapp item) 525 (if (or (keymapp item)
544 (and (symbolp item) (keymapp (symbol-value item)))) 526 (and (symbolp item) (keymapp (symbol-value item))
527 (setq item (symbol-value item))))
545 ;; Item is a keymap, find the prompt string and use as item name. 528 ;; Item is a keymap, find the prompt string and use as item name.
546 (let ((tail (easy-menu-get-map item nil)) name) 529 (setq item (cons (keymap-prompt item) item)))
547 (if (not (keymapp item)) (setq item tail))
548 (while (and (null name) (consp (setq tail (cdr tail)))
549 (not (keymapp tail)))
550 (if (stringp (car tail)) (setq name (car tail)) ; Got a name.
551 (setq tail (cdr tail))))
552 (setq item (cons name item))))
553 (easy-menu-do-add-item map item before))) 530 (easy-menu-do-add-item map item before)))
554 531
555(defun easy-menu-item-present-p (map path name) 532(defun easy-menu-item-present-p (map path name)
diff --git a/lisp/emacs-lisp/elp.el b/lisp/emacs-lisp/elp.el
index d701db9e9b6..82ce6f404f7 100644
--- a/lisp/emacs-lisp/elp.el
+++ b/lisp/emacs-lisp/elp.el
@@ -564,7 +564,6 @@ displayed."
564 (generate-new-buffer elp-results-buffer)))) 564 (generate-new-buffer elp-results-buffer))))
565 (set-buffer resultsbuf) 565 (set-buffer resultsbuf)
566 (erase-buffer) 566 (erase-buffer)
567 (beginning-of-buffer)
568 ;; get the length of the longest function name being profiled 567 ;; get the length of the longest function name being profiled
569 (let* ((longest 0) 568 (let* ((longest 0)
570 (title "Function Name") 569 (title "Function Name")