From 972debf2e7381b4fd2c70f9c1fd585d8bd137917 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 4 Sep 2012 13:40:25 -0400 Subject: Macro-expand interpreted code during load. * src/lread.c (readevalloop): Call internal-macroexpand-for-load to perform eager (load-time) macro-expansion. * src/lisp.mk (lisp): Add macroexp. * lisp/loadup.el: Load macroexp. Remove hack. * lisp/emacs-lisp/macroexp.el (macroexp--eval-if-compile): New function. (macroexp--expand-all): Use it to get better warnings. (macroexp--backtrace, macroexp--trim-backtrace-frame) (internal-macroexpand-for-load): New functions. (macroexp--pending-eager-loads): New var. (emacs-startup-hook): New hack to replace one in loadup.el. * lisp/emacs-lisp/cl-macs.el (cl--compiler-macro-list*) (cl--compiler-macro-cXXr): Move to top, before they can be used. (cl-psetf): Simplify. (cl-defstruct): Add indent rule. --- lisp/emacs-lisp/cl-loaddefs.el | 28 ++++++----- lisp/emacs-lisp/cl-macs.el | 56 +++++++++++---------- lisp/emacs-lisp/macroexp.el | 110 ++++++++++++++++++++++++++++++++++++++--- lisp/emacs-lisp/pcase.el | 2 + 4 files changed, 148 insertions(+), 48 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 470ca17d3a0..7d70d22c9cd 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -249,8 +249,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;*** -;;;### (autoloads (cl--compiler-macro-cXXr cl--compiler-macro-list* -;;;;;; cl--compiler-macro-adjoin cl-defsubst cl-compiler-macroexpand +;;;### (autoloads (cl--compiler-macro-adjoin cl-defsubst cl-compiler-macroexpand ;;;;;; cl-define-compiler-macro cl-assert cl-check-type cl-typep ;;;;;; cl-deftype cl-defstruct cl-callf2 cl-callf cl-letf* cl-letf ;;;;;; cl-rotatef cl-shiftf cl-remf cl-psetf cl-declare cl-the cl-locally @@ -260,9 +259,20 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-do cl-loop cl-return-from cl-return cl-block cl-etypecase ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp -;;;;;; cl-gensym) "cl-macs" "cl-macs.el" "9676d5517e8b9246c09fe78984c68bef") +;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) +;;;;;; "cl-macs" "cl-macs.el" "e09b4be5072a8b52d40af6e073876e76") ;;; Generated autoloads from cl-macs.el +(autoload 'cl--compiler-macro-list* "cl-macs" "\ + + +\(fn FORM ARG &rest OTHERS)" nil nil) + +(autoload 'cl--compiler-macro-cXXr "cl-macs" "\ + + +\(fn FORM X)" nil nil) + (autoload 'cl-gensym "cl-macs" "\ Generate a new uninterned symbol. The name is made by appending a number to PREFIX, default \"G\". @@ -659,6 +669,8 @@ value, that slot cannot be set via `setf'. (put 'cl-defstruct 'doc-string-elt '2) +(put 'cl-defstruct 'lisp-indent-function '1) + (autoload 'cl-deftype "cl-macs" "\ Define NAME as a new data type. The type name can then be used in `cl-typecase', `cl-check-type', etc. @@ -722,16 +734,6 @@ surrounded by (cl-block NAME ...). \(fn FORM A LIST &rest KEYS)" nil nil) -(autoload 'cl--compiler-macro-list* "cl-macs" "\ - - -\(fn FORM ARG &rest OTHERS)" nil nil) - -(autoload 'cl--compiler-macro-cXXr "cl-macs" "\ - - -\(fn FORM X)" nil nil) - ;;;*** ;;;### (autoloads (cl-tree-equal cl-nsublis cl-sublis cl-nsubst-if-not diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 9a59aa0c6db..aba412cc8f5 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -58,6 +58,33 @@ ;;; Initialization. +;; Place compiler macros at the beginning, otherwise uses of the corresponding +;; functions can lead to recursive-loads that prevent the calls from +;; being optimized. + +;;;###autoload +(defun cl--compiler-macro-list* (_form arg &rest others) + (let* ((args (reverse (cons arg others))) + (form (car args))) + (while (setq args (cdr args)) + (setq form `(cons ,(car args) ,form))) + form)) + +;;;###autoload +(defun cl--compiler-macro-cXXr (form x) + (let* ((head (car form)) + (n (symbol-name (car form))) + (i (- (length n) 2))) + (if (not (string-match "c[ad]+r\\'" n)) + (if (and (fboundp head) (symbolp (symbol-function head))) + (cl--compiler-macro-cXXr (cons (symbol-function head) (cdr form)) + x) + (error "Compiler macro for cXXr applied to non-cXXr form")) + (while (> i (match-beginning 0)) + (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x)) + (setq i (1- i))) + x))) + ;;; Some predicates for analyzing Lisp forms. ;; These are used by various ;; macro expanders to optimize the results in certain common cases. @@ -1905,8 +1932,6 @@ See Info node `(cl)Declarations' for details." (cl-do-proclaim (pop specs) nil))) nil) - - ;;; The standard modify macros. ;; `setf' is now part of core Elisp, defined in gv.el. @@ -1929,7 +1954,7 @@ before assigning any PLACEs to the corresponding values. (or p (error "Odd number of arguments to cl-psetf")) (pop p)) (if simple - `(progn (setf ,@args) nil) + `(progn (setq ,@args) nil) (setq args (reverse args)) (let ((expr `(setf ,(cadr args) ,(car args)))) (while (setq args (cddr args)) @@ -2119,7 +2144,7 @@ one keyword is supported, `:read-only'. If this has a non-nil value, that slot cannot be set via `setf'. \(fn NAME SLOTS...)" - (declare (doc-string 2) + (declare (doc-string 2) (indent 1) (debug (&define ;Makes top-level form not be wrapped. [&or symbolp @@ -2597,14 +2622,6 @@ surrounded by (cl-block NAME ...). `(if (cl-member ,a ,list ,@keys) ,list (cons ,a ,list)) form)) -;;;###autoload -(defun cl--compiler-macro-list* (_form arg &rest others) - (let* ((args (reverse (cons arg others))) - (form (car args))) - (while (setq args (cdr args)) - (setq form `(cons ,(car args) ,form))) - form)) - (defun cl--compiler-macro-get (_form sym prop &optional def) (if def `(cl-getf (symbol-plist ,sym) ,prop ,def) @@ -2616,21 +2633,6 @@ surrounded by (cl-block NAME ...). (cl--make-type-test temp (cl--const-expr-val type))) form)) -;;;###autoload -(defun cl--compiler-macro-cXXr (form x) - (let* ((head (car form)) - (n (symbol-name (car form))) - (i (- (length n) 2))) - (if (not (string-match "c[ad]+r\\'" n)) - (if (and (fboundp head) (symbolp (symbol-function head))) - (cl--compiler-macro-cXXr (cons (symbol-function head) (cdr form)) - x) - (error "Compiler macro for cXXr applied to non-cXXr form")) - (while (> i (match-beginning 0)) - (setq x (list (if (eq (aref n i) ?a) 'car 'cdr) x)) - (setq i (1- i))) - x))) - (dolist (y '(cl-first cl-second cl-third cl-fourth cl-fifth cl-sixth cl-seventh cl-eighth cl-ninth cl-tenth diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 70eab149837..394225d697e 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -100,6 +100,17 @@ each clause." (error (message "Compiler-macro error for %S: %S" (car form) err) form))) +(defun macroexp--eval-if-compile (&rest _forms) + "Pseudo function used internally by macroexp to delay warnings. +The purpose is to delay warnings to bytecomp.el, so they can use things +like `byte-compile-log-warning' to get better file-and-line-number data +and also to avoid outputting the warning during normal execution." + nil) +(put 'macroexp--eval-if-compile 'byte-compile + (lambda (form) + (mapc (lambda (x) (funcall (eval x))) (cdr form)) + (byte-compile-constant nil))) + (defun macroexp--expand-all (form) "Expand all macros in FORM. This is an internal version of `macroexpand-all'. @@ -112,14 +123,17 @@ Assumes the caller has bound `macroexpand-all-environment'." (macroexpand (macroexp--all-forms form 1) macroexpand-all-environment) ;; Normal form; get its expansion, and then expand arguments. - (let ((new-form (macroexpand form macroexpand-all-environment))) - (when (and (not (eq form new-form)) ;It was a macro call. - (car-safe form) - (symbolp (car form)) - (get (car form) 'byte-obsolete-info) - (fboundp 'byte-compile-warn-obsolete)) - (byte-compile-warn-obsolete (car form))) - (setq form new-form)) + (let ((new-form + (macroexpand form macroexpand-all-environment))) + (setq form + (if (and (not (eq form new-form)) ;It was a macro call. + (car-safe form) + (symbolp (car form)) + (get (car form) 'byte-obsolete-info)) + `(progn (macroexp--eval-if-compile + (lambda () (byte-compile-warn-obsolete ',(car form)))) + ,new-form) + new-form))) (pcase form (`(cond . ,clauses) (macroexp--cons 'cond (macroexp--all-clauses clauses) form)) @@ -323,6 +337,86 @@ symbol itself." "Return non-nil if EXP can be copied without extra cost." (or (symbolp exp) (macroexp-const-p exp))) +;;; Load-time macro-expansion. + +;; Because macro-expansion used to be more lazy, eager macro-expansion +;; tends to bump into previously harmless/unnoticeable cyclic-dependencies. +;; So, we have to delay macro-expansion like we used to when we detect +;; such a cycle, and we also want to help coders resolve those cycles (since +;; they can be non-obvious) by providing a usefully trimmed backtrace +;; (hopefully) highlighting the problem. + +(defun macroexp--backtrace () + "Return the Elisp backtrace, more recent frames first." + (let ((bt ()) + (i 0)) + (while + (let ((frame (backtrace-frame i))) + (when frame + (push frame bt) + (setq i (1+ i))))) + (nreverse bt))) + +(defun macroexp--trim-backtrace-frame (frame) + (pcase frame + (`(,_ macroexpand (,head . ,_) . ,_) `(macroexpand (,head …))) + (`(,_ internal-macroexpand-for-load (,head ,second . ,_) . ,_) + (if (or (symbolp second) + (and (eq 'quote (car-safe second)) + (symbolp (cadr second)))) + `(macroexpand-all (,head ,second …)) + '(macroexpand-all …))) + (`(,_ load-with-code-conversion ,name . ,_) + `(load ,(file-name-nondirectory name))))) + +(defvar macroexp--pending-eager-loads nil + "Stack of files currently undergoing eager macro-expansion.") + +(defun internal-macroexpand-for-load (form) + ;; Called from the eager-macroexpansion in readevalloop. + (cond + ;; Don't repeat the same warning for every top-level element. + ((eq 'skip (car macroexp--pending-eager-loads)) form) + ;; If we detect a cycle, skip macro-expansion for now, and output a warning + ;; with a trimmed backtrace. + ((and load-file-name (member load-file-name macroexp--pending-eager-loads)) + (let* ((bt (delq nil + (mapcar #'macroexp--trim-backtrace-frame + (macroexp--backtrace)))) + (elem `(load ,(file-name-nondirectory load-file-name))) + (tail (member elem (cdr (member elem bt))))) + (if tail (setcdr tail (list '…))) + (if (eq (car-safe (car bt)) 'macroexpand-all) (setq bt (cdr bt))) + (message "Warning: Eager macro-expansion skipped due to cycle:\n %s" + (mapconcat #'prin1-to-string (nreverse bt) " => ")) + (push 'skip macroexp--pending-eager-loads) + form)) + (t + (condition-case err + (let ((macroexp--pending-eager-loads + (cons load-file-name macroexp--pending-eager-loads))) + (macroexpand-all form)) + (error + ;; Hopefully this shouldn't happen thanks to the cycle detection, + ;; but in case it does happen, let's catch the error and give the + ;; code a chance to macro-expand later. + (message "Eager macro-expansion failure: %S" err) + form))))) + +;; ¡¡¡ Big Ugly Hack !!! +;; src/bootstrap-emacs is mostly used to compile .el files, so it needs +;; macroexp, bytecomp, cconv, and byte-opt to be fast. Generally this is done +;; by compiling those files first, but this only makes a difference if those +;; files are not preloaded. But macroexp.el is preloaded so we reload it if +;; the current version is interpreted and there's a compiled version available. +(eval-when-compile + (add-hook 'emacs-startup-hook + (lambda () + (and (not (byte-code-function-p + (symbol-function 'macroexpand-all))) + (locate-library "macroexp.elc") + (load "macroexp.elc"))))) + (provide 'macroexp) ;;; macroexp.el ends here diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 4aeed7e4d0e..09e47b69b91 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -60,6 +60,8 @@ ;; is in a loop, the repeated macro-expansion becomes terribly costly, so we ;; memoize previous macro expansions to try and avoid recomputing them ;; over and over again. +;; FIXME: Now that macroexpansion is also performed when loading an interpreted +;; file, this is not a real problem any more. (defconst pcase--memoize (make-hash-table :weakness 'key :test 'eq)) ;; (defconst pcase--memoize-1 (make-hash-table :test 'eq)) ;; (defconst pcase--memoize-2 (make-hash-table :weakness 'key :test 'equal)) -- cgit v1.2.3 From d458ef98df8da78f9f102da5f4a066df400ca8cd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 6 Sep 2012 11:35:08 -0400 Subject: * lisp/emacs-lisp/cl-macs.el (cl--do-arglist): Understand _ on &key args. (cl--make-usage-args): Strip _ from argument names. Fixes: debbugs:12367 --- lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/cl-macs.el | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1e09fe0850d..37064b6680b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-09-06 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl--do-arglist): Understand _ on &key args + (bug#12367). + (cl--make-usage-args): Strip _ from argument names. + 2012-09-06 Rüdiger Sonderfeld * progmodes/vhdl-mode.el (vhdl-speedbar-initialize): Don't use diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index aba412cc8f5..312c37261e2 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -393,9 +393,14 @@ its argument list allows full Common Lisp conventions." (mapcar (lambda (x) (cond ((symbolp x) - (if (eq ?\& (aref (symbol-name x) 0)) - (setq state x) - (make-symbol (upcase (symbol-name x))))) + (let ((first (aref (symbol-name x) 0))) + (if (eq ?\& first) + (setq state x) + ;; Strip a leading underscore, since it only + ;; means that this argument is unused. + (make-symbol (upcase (if (eq ?_ first) + (substring (symbol-name x) 1) + (symbol-name x))))))) ((not (consp x)) x) ((memq state '(nil &rest)) (cl--make-usage-args x)) (t ;(VAR INITFORM SVAR) or ((KEYWORD VAR) INITFORM SVAR). @@ -479,7 +484,13 @@ its argument list allows full Common Lisp conventions." (let ((arg (pop args))) (or (consp arg) (setq arg (list arg))) (let* ((karg (if (consp (car arg)) (caar arg) - (intern (format ":%s" (car arg))))) + (let ((name (symbol-name (car arg)))) + ;; Strip a leading underscore, since it only + ;; means that this argument is unused, but + ;; shouldn't affect the key's name (bug#12367). + (if (eq ?_ (aref name 0)) + (setq name (substring name 1))) + (intern (format ":%s" name))))) (varg (if (consp (car arg)) (cl-cadar arg) (car arg))) (def (if (cdr arg) (cadr arg) (or (car cl--bind-defs) (cadr (assq varg cl--bind-defs))))) -- cgit v1.2.3 From e5c2edf79ba2b75a3572839fcb9de612f93ab630 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 7 Sep 2012 16:58:31 +0800 Subject: Add a utility function buffer-narrowed-p, and use it. * lisp/subr.el (buffer-narrowed-p): New function. * lisp/ses.el (ses-widen): * lisp/simple.el (count-words--buffer-message): * lisp/net/browse-url.el (browse-url-of-buffer): Use it * lisp/simple.el (count-words-region): Don't signal an error if there is a non-nil prefix arg and the mark is not set. * doc/lispref/positions.texi (Narrowing): Document buffer-narrowed-p. --- doc/lispref/ChangeLog | 2 ++ doc/lispref/positions.texi | 29 +++++++++++++++++------------ etc/NEWS | 3 +++ lisp/ChangeLog | 9 ++++++++- lisp/emacs-lisp/cl-loaddefs.el | 2 +- lisp/net/browse-url.el | 2 +- lisp/ses.el | 4 +--- lisp/simple.el | 8 ++++---- lisp/subr.el | 4 ++++ 9 files changed, 41 insertions(+), 22 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index bd21100dd4c..179f81990a7 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,5 +1,7 @@ 2012-09-07 Chong Yidong + * positions.texi (Narrowing): Document buffer-narrowed-p. + * markers.texi (Moving Markers): Add xref to Point (Bug#7151). * syntax.texi (Low-Level Parsing): Add xref to Parser State diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index a0c65319850..c4576e6456d 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi @@ -874,18 +874,18 @@ commands to a limited range of characters in a buffer. The text that remains addressable is called the @dfn{accessible portion} of the buffer. - Narrowing is specified with two buffer positions which become the -beginning and end of the accessible portion. For most editing commands -and most Emacs primitives, these positions replace the values of the -beginning and end of the buffer. While narrowing is in effect, no text -outside the accessible portion is displayed, and point cannot move -outside the accessible portion. - - Values such as positions or line numbers, which usually count from the -beginning of the buffer, do so despite narrowing, but the functions -which use them refuse to operate on text that is inaccessible. - - The commands for saving buffers are unaffected by narrowing; they save + Narrowing is specified with two buffer positions, which become the +beginning and end of the accessible portion. For most editing +commands and primitives, these positions replace the values of the +beginning and end of the buffer. While narrowing is in effect, no +text outside the accessible portion is displayed, and point cannot +move outside the accessible portion. Note that narrowing does not +alter actual buffer positions (@pxref{Point}); it only determines +which positions are considered the accessible portion of the buffer. +Most functions refuse to operate on text that is outside the +accessible portion. + + Commands for saving buffers are unaffected by narrowing; they save the entire buffer regardless of any narrowing. If you need to display in a single buffer several very different @@ -924,6 +924,11 @@ It is equivalent to the following expression: @end example @end deffn +@defun buffer-narrowed-p +This function returns non-@code{nil} if the buffer is narrowed, and +@code{nil} otherwise. +@end defun + @defspec save-restriction body@dots{} This special form saves the current bounds of the accessible portion, evaluates the @var{body} forms, and finally restores the saved bounds, diff --git a/etc/NEWS b/etc/NEWS index bc1c49fe946..b85d64f83a3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -645,6 +645,9 @@ The interpretation of the DECLS is determined by `defun-declarations-alist'. ** New error type and new function `user-error'. Doesn't trigger the debugger. ++++ +** New utility function `buffer-narrowed-p'. + ** Window changes *** The functions get-lru-window, get-mru-window and get-largest-window diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 33e641b5fc1..7aae8fd7854 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,13 @@ 2012-09-07 Chong Yidong - * simple.el (count-words--buffer-message): Fix narrowing check. + * subr.el (buffer-narrowed-p): New function. + + * ses.el (ses-widen): + * simple.el (count-words--buffer-message): + * net/browse-url.el (browse-url-of-buffer): Use it + + * simple.el (count-words-region): Don't signal an error if there + is a non-nil prefix arg and the mark is not set. * help.el (describe-key-briefly): Allow the message to be seen when invoked from the minibuffer (Bug#7014). diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index 7d70d22c9cd..a59beaeb7ac 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "e09b4be5072a8b52d40af6e073876e76") +;;;;;; "cl-macs" "cl-macs.el" "9f9bae5b8ccaf325bd59ba9be2b27c44") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 20d71215926..d1d33bfe566 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -743,7 +743,7 @@ narrowed." (and buffer (set-buffer buffer)) (let ((file-name ;; Ignore real name if restricted - (and (= (- (point-max) (point-min)) (buffer-size)) + (and (not (buffer-narrowed-p)) (or buffer-file-name (and (boundp 'dired-directory) dired-directory))))) (or file-name diff --git a/lisp/ses.el b/lisp/ses.el index 8add16a6996..7cdac74e310 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -1270,11 +1270,9 @@ when the width of cell (ROW,COL) has changed." ;; The data area ;;---------------------------------------------------------------------------- -(defun ses-narrowed-p () (/= (- (point-max) (point-min)) (buffer-size))) - (defun ses-widen () "Turn off narrowing, to be reenabled at end of command loop." - (if (ses-narrowed-p) + (if (buffer-narrowed-p) (setq ses--deferred-narrow t)) (widen)) diff --git a/lisp/simple.el b/lisp/simple.el index ca73ba1b03a..d87ae3c5c15 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -974,7 +974,9 @@ rather than the region. If called from Lisp, return the number of words between positions START and END." - (interactive "r\nP") + (interactive (if current-prefix-arg + (list nil nil current-prefix-arg) + (list (region-beginning) (region-end) nil))) (cond ((not (called-interactively-p 'any)) (count-words start end)) (arg @@ -1008,9 +1010,7 @@ END, without printing any message." (defun count-words--buffer-message () (count-words--message - (if (= (- (point-max) (point-min)) (buffer-size)) - "Buffer" - "Narrowed part of buffer") + (if (buffer-narrowed-p) "Narrowed part of buffer" "Buffer") (point-min) (point-max))) (defun count-words--message (str start end) diff --git a/lisp/subr.el b/lisp/subr.el index 74afd59f8d5..621622e70eb 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2647,6 +2647,10 @@ directory if it does not exist." ;;;; Misc. useful functions. +(defsubst buffer-narrowed-p () + "Return non-nil if the current buffer is narrowed." + (/= (- (point-max) (point-min)) (buffer-size))) + (defun find-tag-default () "Determine default tag to search for, based on text at point. If there is no plausible default, return nil." -- cgit v1.2.3 From daac280ae09b00e8a218ba3b6f9205d2372e93db Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 7 Sep 2012 16:14:55 -0400 Subject: * lisp/emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. --- lisp/ChangeLog | 12 ++++++++---- lisp/emacs-lisp/byte-run.el | 7 +++---- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index efdc0b80d13..052b85ef757 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,11 @@ +2012-09-07 Stefan Monnier + + * emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. + 2012-09-07 Matt McClure (tiny change) - * progmodes/python.el (python-shell-send-string): When - default-directory is remote, create temp file on remote + * progmodes/python.el (python-shell-send-string): + When default-directory is remote, create temp file on remote filesystem. (python-shell-send-file): When file is remote, pass local view of file paths to remote Python interpreter. (Bug#12340) @@ -15,8 +19,8 @@ * subr.el (read-char-choice): Allow quitting via ESC ESC. - * userlock.el (ask-user-about-supersession-threat): Use - read-char-choice (Bug#12093). + * userlock.el (ask-user-about-supersession-threat): + Use read-char-choice (Bug#12093). 2012-09-07 Chong Yidong diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 9b66c8ffd60..d1382f42b19 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -185,11 +185,10 @@ The return value is undefined. ((and (featurep 'cl) (memq (car x) ;C.f. cl-do-proclaim. '(special inline notinline optimize warn))) - (if (null (stringp docstring)) - (push (list 'declare x) body) - (setcdr body (cons (list 'declare x) (cdr body)))) + (push (list 'declare x) + (if (stringp docstring) (cdr body) body)) nil) - (t (message "Warning: Unknown defun property %S in %S" + (t (message "Warning: Unknown defun property `%S' in %S" (car x) name))))) decls)) (def (list 'defalias -- cgit v1.2.3 From fa2bcf435d9774c0e8542ba36b11ef4722f9675c Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 8 Sep 2012 15:28:11 +0200 Subject: Fix handling of debugger window. (Bug#8789) * window.el (display-buffer-in-previous-window): New buffer display action function. * emacs-lisp/debug.el (debugger-bury-or-kill): New option. (debugger-previous-window): New variable. (debug): Rewrite using display-buffer-in-previous-window, quit-restore-window and debugger-bury-or-kill. (Bug#8789) --- etc/NEWS | 25 +++++--- lisp/ChangeLog | 10 +++ lisp/emacs-lisp/debug.el | 163 ++++++++++++++++++++++++++--------------------- lisp/window.el | 56 ++++++++++++++++ 4 files changed, 174 insertions(+), 80 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/etc/NEWS b/etc/NEWS index 55b8388ca27..7a9c9a21c97 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -645,6 +645,8 @@ The interpretation of the DECLS is determined by `defun-declarations-alist'. ** New error type and new function `user-error'. Doesn't trigger the debugger. +** New option `debugger-bury-or-kill'. + +++ ** New utility function `buffer-narrowed-p'. @@ -653,20 +655,25 @@ The interpretation of the DECLS is determined by `defun-declarations-alist'. *** The functions get-lru-window, get-mru-window and get-largest-window now accept a third argument to avoid choosing the selected window. -*** New macro with-temp-buffer-window. +*** New macro `with-temp-buffer-window'. + +*** New option `temp-buffer-resize-frames'. -*** New option temp-buffer-resize-frames. +*** New function `fit-frame-to-buffer' and new option + `fit-frame-to-buffer-bottom-margin'. -*** New function fit-frame-to-buffer and new option - fit-frame-to-buffer-bottom-margin. +*** New display action functions `display-buffer-below-selected' and +`display-buffer-in-previous-window'. -*** New display action function display-buffer-below-selected. +*** New display action alist entry `inhibit-switch-frame', if non-nil, +tells display action functions to avoid changing which frame is +selected. -*** New display action alist `inhibit-switch-frame', if non-nil, tells -display action functions to avoid changing which frame is selected. +*** New display action alist entry `pop-up-frame-parameters', if +non-nil, specifies frame parameters to give any newly-created frame. -*** New display action alist `pop-up-frame-parameters', if non-nil, -specifies frame parameters to give any newly-created frame. +*** New display action alist entry `previous-window', if non-nil, +specifies window to reuse in `display-buffer-in-previous-window'. *** The following variables are obsolete, as they can be replaced by appropriate entries in the `display-buffer-alist' function introduced diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 052b85ef757..e10fe9166e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2012-09-08 Martin Rudalics + + * window.el (display-buffer-in-previous-window): New buffer + display action function. + + * emacs-lisp/debug.el (debugger-bury-or-kill): New option. + (debugger-previous-window): New variable. + (debug): Rewrite using display-buffer-in-previous-window, + quit-restore-window and debugger-bury-or-kill. (Bug#8789) + 2012-09-07 Stefan Monnier * emacs-lisp/byte-run.el (defun): Tweak message. Simplify code. diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 7bc93a19d1a..188c0800eb8 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -48,6 +48,39 @@ the middle is discarded, and just the beginning and end are displayed." :group 'debugger :version "21.1") +(defcustom debugger-bury-or-kill 'bury + "How to proceed with the debugger buffer when exiting `debug'. +The value used here affects the behavior of operations on any +window previously showing the debugger buffer. + +`nil' means that if its window is not deleted when exiting the + debugger, invoking `switch-to-prev-buffer' will usually show + the debugger buffer again. + +`append' means that if the window is not deleted, the debugger + buffer moves to the end of the window's previous buffers so + it's less likely that a future invocation of + `switch-to-prev-buffer' will switch to it. Also, it moves the + buffer to the end of the frame's buffer list. + +`bury' means that if the window is not deleted, its buffer is + removed from the window's list of previous buffers. Also, it + moves the buffer to the end of the frame's buffer list. This + value provides the most reliable remedy to not have + `switch-to-prev-buffer' switch to the debugger buffer again + without killing the buffer. + +`kill' means to kill the debugger buffer. + +The value used here is passed to `quit-restore-window'." + :type '(choice + (const :tag "Keep alive" nil) + (const :tag "Append" 'append) + (const :tag "Bury" 'bury) + (const :tag "Kill" 'kill)) + :group 'debugger + :version "24.2") + (defvar debug-function-list nil "List of functions currently set for debug on entry.") @@ -60,6 +93,9 @@ the middle is discarded, and just the beginning and end are displayed." (defvar debugger-old-buffer nil "This is the buffer that was current when the debugger was entered.") +(defvar debugger-previous-window nil + "This is the window last showing the debugger buffer.") + (defvar debugger-previous-backtrace nil "The contents of the previous backtrace (including text properties). This is to optimize `debugger-make-xrefs'.") @@ -133,7 +169,7 @@ first will be printed into the backtrace buffer." (with-current-buffer (get-buffer "*Backtrace*") (list major-mode (buffer-string))))) (debugger-buffer (get-buffer-create "*Backtrace*")) - (debugger-old-buffer (current-buffer)) + (debugger-window nil) (debugger-step-after-exit nil) (debugger-will-be-back nil) ;; Don't keep reading from an executing kbd macro! @@ -184,78 +220,63 @@ first will be printed into the backtrace buffer." (cursor-in-echo-area nil)) (unwind-protect (save-excursion - (save-window-excursion - (with-no-warnings - (setq unread-command-char -1)) - (when (eq (car debugger-args) 'debug) - ;; Skip the frames for backtrace-debug, byte-code, - ;; and implement-debug-on-entry. - (backtrace-debug 4 t) - ;; Place an extra debug-on-exit for macro's. - (when (eq 'lambda (car-safe (cadr (backtrace-frame 4)))) - (backtrace-debug 5 t))) - (pop-to-buffer debugger-buffer) - (debugger-mode) - (debugger-setup-buffer debugger-args) - (when noninteractive - ;; If the backtrace is long, save the beginning - ;; and the end, but discard the middle. - (when (> (count-lines (point-min) (point-max)) - debugger-batch-max-lines) - (goto-char (point-min)) - (forward-line (/ 2 debugger-batch-max-lines)) - (let ((middlestart (point))) - (goto-char (point-max)) - (forward-line (- (/ 2 debugger-batch-max-lines) - debugger-batch-max-lines)) - (delete-region middlestart (point))) - (insert "...\n")) + (with-no-warnings + (setq unread-command-char -1)) + (when (eq (car debugger-args) 'debug) + ;; Skip the frames for backtrace-debug, byte-code, + ;; and implement-debug-on-entry. + (backtrace-debug 4 t) + ;; Place an extra debug-on-exit for macro's. + (when (eq 'lambda (car-safe (cadr (backtrace-frame 4)))) + (backtrace-debug 5 t))) + (pop-to-buffer + debugger-buffer + `((display-buffer-reuse-window + display-buffer-in-previous-window) + . (,(when debugger-previous-window + `(previous-window . ,debugger-previous-window))))) + (setq debugger-window (selected-window)) + (setq debugger-previous-window debugger-window) + (debugger-mode) + (debugger-setup-buffer debugger-args) + (when noninteractive + ;; If the backtrace is long, save the beginning + ;; and the end, but discard the middle. + (when (> (count-lines (point-min) (point-max)) + debugger-batch-max-lines) (goto-char (point-min)) - (message "%s" (buffer-string)) - (kill-emacs -1)) + (forward-line (/ 2 debugger-batch-max-lines)) + (let ((middlestart (point))) + (goto-char (point-max)) + (forward-line (- (/ 2 debugger-batch-max-lines) + debugger-batch-max-lines)) + (delete-region middlestart (point))) + (insert "...\n")) + (goto-char (point-min)) + (message "%s" (buffer-string)) + (kill-emacs -1)) + (message "") + (let ((standard-output nil) + (buffer-read-only t)) (message "") - (let ((standard-output nil) - (buffer-read-only t)) - (message "") - ;; Make sure we unbind buffer-read-only in the right buffer. - (save-excursion - (recursive-edit))))) - ;; Kill or at least neuter the backtrace buffer, so that users - ;; don't try to execute debugger commands in an invalid context. - (if (get-buffer-window debugger-buffer 0) - ;; Still visible despite the save-window-excursion? Maybe it - ;; it's in a pop-up frame. It would be annoying to delete and - ;; recreate it every time the debugger stops, so instead we'll - ;; erase it (and maybe hide it) but keep it alive. - (with-current-buffer debugger-buffer - (with-selected-window (get-buffer-window debugger-buffer 0) - (when (and (window-dedicated-p (selected-window)) - (not debugger-will-be-back)) - ;; If the window is not dedicated, burying the buffer - ;; will mean that the frame created for it is left - ;; around showing some random buffer, and next time we - ;; pop to the debugger buffer we'll create yet - ;; another frame. - ;; If debugger-will-be-back is non-nil, the frame - ;; would need to be de-iconified anyway immediately - ;; after when we re-enter the debugger, so iconifying it - ;; here would cause flashing. - ;; Drew Adams is not happy with this: he wants to frame - ;; to be left at the top-level, still working on how - ;; best to do that. - (bury-buffer)))) - (unless debugger-previous-state - (kill-buffer debugger-buffer))) - ;; Restore the previous state of the debugger-buffer, in case we were - ;; in a recursive invocation of the debugger. - (when (buffer-live-p debugger-buffer) - (with-current-buffer debugger-buffer - (let ((inhibit-read-only t)) - (erase-buffer) - (if (null debugger-previous-state) - (fundamental-mode) - (insert (nth 1 debugger-previous-state)) - (funcall (nth 0 debugger-previous-state)))))) + ;; Make sure we unbind buffer-read-only in the right buffer. + (save-excursion + (recursive-edit)))) + (when (and (window-live-p debugger-window) + (eq (window-buffer debugger-window) debugger-buffer)) + ;; Unshow debugger-buffer. + (quit-restore-window debugger-window debugger-bury-or-kill)) + ;; Restore previous state of debugger-buffer in case we were + ;; in a recursive invocation of the debugger, otherwise just + ;; erase the buffer and put it into fundamental mode. + (when (buffer-live-p debugger-buffer) + (with-current-buffer debugger-buffer + (let ((inhibit-read-only t)) + (erase-buffer) + (if (null debugger-previous-state) + (fundamental-mode) + (insert (nth 1 debugger-previous-state)) + (funcall (nth 0 debugger-previous-state)))))) (with-timeout-unsuspend debugger-with-timeout-suspend) (set-match-data debugger-outer-match-data))) ;; Put into effect the modified values of these variables diff --git a/lisp/window.el b/lisp/window.el index 0e03268029c..b071a8e9c50 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5521,6 +5521,62 @@ the selected one." (window--display-buffer buffer window 'reuse display-buffer-mark-dedicated))))) +(defun display-buffer-in-previous-window (buffer alist) + "Display BUFFER in a window previously showing it. +If ALIST has a non-nil `inhibit-same-window' entry, the selected +window is not eligible for reuse. + +If ALIST contains a `reusable-frames' entry, its value determines +which frames to search for a reusable window: + nil -- the selected frame (actually the last non-minibuffer frame) + A frame -- just that frame + `visible' -- all visible frames + 0 -- all frames on the current terminal + t -- all frames. + +If ALIST contains no `reusable-frames' entry, search just the +selected frame if `display-buffer-reuse-frames' and +`pop-up-frames' are both nil; search all frames on the current +terminal if either of those variables is non-nil. + +If ALIST has a `previous-window' entry, the window specified by +that entry will override any other window found by the methods +above, even if that window never showed BUFFER before." + (let* ((alist-entry (assq 'reusable-frames alist)) + (inhibit-same-window + (cdr (assq 'inhibit-same-window alist))) + (frames (cond + (alist-entry (cdr alist-entry)) + ((if (eq pop-up-frames 'graphic-only) + (display-graphic-p) + pop-up-frames) + 0) + (display-buffer-reuse-frames 0) + (t (last-nonminibuffer-frame)))) + entry best-window second-best-window window) + ;; Scan windows whether they have shown the buffer recently. + (catch 'best + (dolist (window (window-list-1 (frame-first-window) 'nomini frames)) + (when (and (assq buffer (window-prev-buffers window)) + (not (window-dedicated-p window))) + (if (eq window (selected-window)) + (unless inhibit-same-window + (setq second-best-window window)) + (setq best-window window) + (throw 'best t))))) + ;; When ALIST has a `previous-window' entry, that entry may override + ;; anything we found so far. + (when (and (setq window (cdr (assq 'previous-window alist))) + (window-live-p window) + (not (window-dedicated-p window))) + (if (eq window (selected-window)) + (unless inhibit-same-window + (setq second-best-window window)) + (setq best-window window))) + ;; Return best or second best window found. + (when (setq window (or best-window second-best-window)) + (window--display-buffer buffer window 'reuse)))) + (defun display-buffer-use-some-window (buffer alist) "Display BUFFER in an existing window. Search for a usable window, set that window to the buffer, and -- cgit v1.2.3 From 011474aa5af24faeceac60348315552313774b10 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 9 Sep 2012 14:43:47 +0800 Subject: Allow scrolling in y-or-n-p. * lisp/replace.el (query-replace-map): Bind four new symbols for requesting window scrolling. * lisp/subr.el (y-or-n-p): Handle the window-scrolling bindings in query-replace-map. * lisp/custom.el (custom-theme-load-confirm): Use y-or-n-p. * lisp/window.el (scroll-other-window-down): Make the arg optional. * lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys since they are now in query-replace-map. * doc/lispref/minibuf.texi (Yes-or-No Queries): Document recentering and scrolling in y-or-n-p. Remove gratuitous example. * doc/lispref/searching.texi (Search and Replace): Document window scrolling entries in query-replace-map. Fixes: debbugs:8948 --- doc/lispref/ChangeLog | 8 ++++++++ doc/lispref/minibuf.texi | 48 ++++++++-------------------------------------- doc/lispref/searching.texi | 8 +++++++- etc/NEWS | 4 ++++ lisp/ChangeLog | 15 +++++++++++++++ lisp/custom.el | 45 +++++++++++++------------------------------ lisp/emacs-lisp/map-ynp.el | 10 ---------- lisp/replace.el | 22 +++++++++++++++++---- lisp/subr.el | 42 +++++++++++++++++++++++++++++----------- lisp/window.el | 2 +- 10 files changed, 105 insertions(+), 99 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 57ee374af49..79691bfb181 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,11 @@ +2012-09-09 Chong Yidong + + * minibuf.texi (Yes-or-No Queries): Document recentering and + scrolling in y-or-n-p. Remove gratuitous example. + + * searching.texi (Search and Replace): Document window scrolling + entries in query-replace-map. + 2012-09-08 Chong Yidong * syntax.texi (Syntax Table Internals): Define "raw syntax diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 4cf096b8663..cdc47b7c91d 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -1888,46 +1888,14 @@ Echo Area}), which uses the same screen space as the minibuffer. The cursor moves to the echo area while the question is being asked. The answers and their meanings, even @samp{y} and @samp{n}, are not -hardwired. The keymap @code{query-replace-map} specifies them. -@xref{Search and Replace}. - -In the following example, the user first types @kbd{q}, which is -invalid. At the next prompt the user types @kbd{y}. - -@c Need an interactive example, because otherwise the return value -@c obscures the display of the valid answer. -@smallexample -@group -(defun ask () - (interactive) - (y-or-n-p "Do you need a lift? ")) - -;; @r{After evaluation of the preceding definition, @kbd{M-x ask}} -;; @r{causes the following prompt to appear in the echo area:} -@end group - -@group ----------- Echo area ---------- -Do you need a lift? (y or n) ----------- Echo area ---------- -@end group - -;; @r{If the user then types @kbd{q}, the following appears:} - -@group ----------- Echo area ---------- -Please answer y or n. Do you need a lift? (y or n) ----------- Echo area ---------- -@end group - -;; @r{When the user types a valid answer,} -;; @r{it is displayed after the question:} - -@group ----------- Echo area ---------- -Do you need a lift? (y or n) y ----------- Echo area ---------- -@end group +hardwired, and are specified by the keymap @code{query-replace-map} +(@pxref{Search and Replace}). In particular, if the user enters the +special responses @code{recenter}, @code{scroll-up}, +@code{scroll-down}, @code{scroll-other-window}, or +@code{scroll-other-window-down} (respectively bound to @kbd{C-l}, +@kbd{C-v}, @kbd{M-v}, @kbd{C-M-v} and @kbd{C-M-S-v} in +@code{query-replace-map}), this function performs the specified window +recentering or scrolling operation, and poses the question again. @end smallexample @noindent diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index 0fa681ecb51..edd1d30e28d 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1796,7 +1796,13 @@ Delete the text being considered, then enter a recursive edit to replace it. @item recenter -Redisplay and center the window, then ask the same question again. +@itemx scroll-up +@itemx scroll-down +@itemx scroll-other-window +@itemx scroll-other-window-down +Perform the specified window scroll operation, then ask the same +question again. Only @code{y-or-n-p} and related functions use this +answer. @item quit Perform a quit right away. Only @code{y-or-n-p} and related functions diff --git a/etc/NEWS b/etc/NEWS index 742744fc9dd..dac7915767d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -78,6 +78,10 @@ been adding them there, put them somewhere else, eg site-lisp. * Changes in Emacs 24.3 +** You can now scroll the selected window in most y-or-n prompts. +Typing C-v or M-v at a prompt scrolls forward or backward +respectively, without leaving the y-or-n prompt. + ** Help changes *** `C-h f' (describe-function) can now perform autoloading. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7f730556ac..8f089af6f5c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2012-09-09 Chong Yidong + + * replace.el (query-replace-map): Bind four new symbols for + requesting window scrolling. + + * subr.el (y-or-n-p): Handle the window-scrolling bindings in + query-replace-map (Bug#8948). + + * custom.el (custom-theme-load-confirm): Use y-or-n-p. + + * emacs-lisp/map-ynp.el (map-y-or-n-p): Don't bind scrolling keys + since they are now in query-replace-map. + + * window.el (scroll-other-window-down): Make the arg optional. + 2012-09-09 Chong Yidong * files.el (hack-local-variables-confirm): Use quit-window to kill diff --git a/lisp/custom.el b/lisp/custom.el index fb166dd35f7..3eb2895888d 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1223,38 +1223,19 @@ Return t if THEME was successfully loaded, nil otherwise." "Query the user about loading a Custom theme that may not be safe. The theme should be in the current buffer. If the user agrees, query also about adding HASH to `custom-safe-themes'." - (if noninteractive - nil - (let ((exit-chars '(?y ?n ?\s)) - window prompt char) - (save-window-excursion - (rename-buffer "*Custom Theme*" t) - (emacs-lisp-mode) - (setq window (display-buffer (current-buffer))) - (setq prompt - (format "Loading a theme can run Lisp code. Really load?%s" - (if (and window - (< (line-number-at-pos (point-max)) - (window-body-height))) - " (y or n) " - (push ?\C-v exit-chars) - "\nType y or n, or C-v to scroll: "))) - (goto-char (point-min)) - (while (null char) - (setq char (read-char-choice prompt exit-chars)) - (when (eq char ?\C-v) - (if window - (with-selected-window window - (condition-case nil - (scroll-up) - (error (goto-char (point-min)))))) - (setq char nil))) - (when (memq char '(?\s ?y)) - ;; Offer to save to `custom-safe-themes'. - (and (or custom-file user-init-file) - (y-or-n-p "Treat this theme as safe in future sessions? ") - (customize-push-and-save 'custom-safe-themes (list hash))) - t))))) + (unless noninteractive + (save-window-excursion + (rename-buffer "*Custom Theme*" t) + (emacs-lisp-mode) + (setq window (pop-to-buffer (current-buffer))) + (goto-char (point-min)) + (prog1 (when (y-or-n-p "Loading a theme can run Lisp code. Really load? ") + ;; Offer to save to `custom-safe-themes'. + (and (or custom-file user-init-file) + (y-or-n-p "Treat this theme as safe in future sessions? ") + (customize-push-and-save 'custom-safe-themes (list hash))) + t) + (quit-window))))) (defun custom-theme-name-valid-p (name) "Return t if NAME is a valid name for a Custom theme, nil otherwise. diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index e7806440bf3..289751f4944 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -123,16 +123,6 @@ Returns the number of actions taken." map (let ((map (make-sparse-keymap))) (set-keymap-parent map query-replace-map) - (define-key map [?\C-\M-v] 'scroll-other-window) - (define-key map [M-next] 'scroll-other-window) - (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) - (define-key map [M-prior] 'scroll-other-window-down) - ;; The above are rather inconvenient, so maybe we should - ;; provide the non-other keys for the other-scroll as well. - ;; (define-key map [?\C-v] 'scroll-other-window) - ;; (define-key map [next] 'scroll-other-window) - ;; (define-key map [?\M-v] 'scroll-other-window-down) - ;; (define-key map [prior] 'scroll-other-window-down) (dolist (elt action-alist) (define-key map (vector (car elt)) (vector (nth 1 elt)))) map))) diff --git a/lisp/replace.el b/lisp/replace.el index 194805a8f3e..b30b671122e 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1617,14 +1617,28 @@ E to edit the replacement string" (define-key map "?" 'help) (define-key map "\C-g" 'quit) (define-key map "\C-]" 'quit) - (define-key map "\e" 'exit-prefix) + (define-key map "\C-v" 'scroll-up) + (define-key map "\M-v" 'scroll-down) + (define-key map [next] 'scroll-up) + (define-key map [prior] 'scroll-down) + (define-key map [?\C-\M-v] 'scroll-other-window) + (define-key map [M-next] 'scroll-other-window) + (define-key map [?\C-\M-\S-v] 'scroll-other-window-down) + (define-key map [M-prior] 'scroll-other-window-down) + ;; Binding ESC would prohibit the M-v binding. Instead, callers + ;; should check for ESC specially. + ;; (define-key map "\e" 'exit-prefix) (define-key map [escape] 'exit-prefix) map) - "Keymap that defines the responses to questions in `query-replace'. + "Keymap of responses to questions posed by commands like `query-replace'. The \"bindings\" in this map are not commands; they are answers. The valid answers include `act', `skip', `act-and-show', -`exit', `act-and-exit', `edit', `edit-replacement', `delete-and-edit', -`recenter', `automatic', `backup', `exit-prefix', `quit', and `help'.") +`act-and-exit', `exit', `exit-prefix', `recenter', `scroll-up', +`scroll-down', `scroll-other-window', `scroll-other-window-down', +`edit', `edit-replacement', `delete-and-edit', `automatic', +`backup', `quit', and `help'. + +This keymap is used by `y-or-n-p' as well as `query-replace'.") (defvar multi-query-replace-map (let ((map (make-sparse-keymap))) diff --git a/lisp/subr.el b/lisp/subr.el index 21dd270caef..be785ff8fba 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2319,11 +2319,19 @@ floating point support." PROMPT is the string to display to ask the question. It should end in a space; `y-or-n-p' adds \"(y or n) \" to it. -No confirmation of the answer is requested; a single character is enough. -Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses -the bindings in `query-replace-map'; see the documentation of that variable -for more information. In this case, the useful bindings are `act', `skip', -`recenter', and `quit'.\) +No confirmation of the answer is requested; a single character is +enough. SPC also means yes, and DEL means no. + +To be precise, this function translates user input into responses +by consulting the bindings in `query-replace-map'; see the +documentation of that variable for more information. In this +case, the useful bindings are `act', `skip', `recenter', +`scroll-up', `scroll-down', and `quit'. +An `act' response means yes, and a `skip' response means no. +A `quit' response means to invoke `keyboard-quit'. +If the user enters `recenter', `scroll-up', or `scroll-down' +responses, perform the requested window recentering or scrolling +and ask again. Under a windowing system a dialog box will be used if `last-nonmenu-event' is nil and `use-dialog-box' is non-nil." @@ -2355,21 +2363,33 @@ is nil and `use-dialog-box' is non-nil." "" " ") "(y or n) ")) (while - (let* ((key + (let* ((scroll-actions '(recenter scroll-up scroll-down + scroll-other-window scroll-other-window-down)) + (key (let ((cursor-in-echo-area t)) (when minibuffer-auto-raise (raise-frame (window-frame (minibuffer-window)))) - (read-key (propertize (if (eq answer 'recenter) + (read-key (propertize (if (memq answer scroll-actions) prompt (concat "Please answer y or n. " prompt)) 'face 'minibuffer-prompt))))) (setq answer (lookup-key query-replace-map (vector key) t)) (cond - ((memq answer '(skip act)) nil) - ((eq answer 'recenter) (recenter) t) - ((memq answer '(exit-prefix quit)) (signal 'quit nil) t) - (t t))) + ((memq answer '(skip act)) nil) + ((eq answer 'recenter) + (recenter) t) + ((eq answer 'scroll-up) + (ignore-errors (scroll-up-command)) t) + ((eq answer 'scroll-down) + (ignore-errors (scroll-down-command)) t) + ((eq answer 'scroll-other-window) + (ignore-errors (scroll-other-window)) t) + ((eq answer 'scroll-other-window-down) + (ignore-errors (scroll-other-window-down)) t) + ((or (memq answer '(exit-prefix quit)) (eq key ?\e)) + (signal 'quit nil) t) + (t t))) (ding) (discard-input)))) (let ((ret (eq answer 'act))) diff --git a/lisp/window.el b/lisp/window.el index b071a8e9c50..dd1f55450c3 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6301,7 +6301,7 @@ This is different from `scroll-down-command' that scrolls a full screen." (put 'scroll-down-line 'scroll-command t) -(defun scroll-other-window-down (lines) +(defun scroll-other-window-down (&optional lines) "Scroll the \"other window\" down. For more details, see the documentation for `scroll-other-window'." (interactive "P") -- cgit v1.2.3 From 9b851e2550c1d627413ecc6c626a0dfe1bbbf33b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 9 Sep 2012 21:16:13 -0400 Subject: New emacs-lisp-byte-code-mode; misc minor changes. * lisp/emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. (emacs-lisp-byte-code-comment) (emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode): New functions. (eval-sexp-add-defvars): Don't skip defvars in column >0. (eval-defun-2): Remove bogus interactive spec. (lisp-indent-line): Remove redundant whole-exp code, now done in indent-according-to-mode. (save-match-data): Remove redundant indent data. * lisp/emacs-lisp/benchmark.el (benchmark-run, benchmark-run-compiled): Use `declare'. * lisp/gnus/qp.el (quoted-printable-decode-region): Inline+CSE+strength-reduction. --- lisp/ChangeLog | 15 ++++++++ lisp/emacs-lisp/benchmark.el | 6 ++-- lisp/emacs-lisp/cl-loaddefs.el | 2 +- lisp/emacs-lisp/cl-macs.el | 8 +++++ lisp/emacs-lisp/lisp-mode.el | 77 +++++++++++++++++++++++++++++++++--------- lisp/gnus/ChangeLog | 4 +++ lisp/gnus/qp.el | 20 +++++------ 7 files changed, 101 insertions(+), 31 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6ec52876d49..8de59875674 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2012-09-10 Stefan Monnier + + * emacs-lisp/lisp-mode.el (emacs-list-byte-code-comment-re): New var. + (emacs-lisp-byte-code-comment) + (emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode): + New functions. + (eval-sexp-add-defvars): Don't skip defvars in column >0. + (eval-defun-2): Remove bogus interactive spec. + (lisp-indent-line): Remove redundant whole-exp code, now done in + indent-according-to-mode. + (save-match-data): Remove redundant indent data. + + * emacs-lisp/benchmark.el (benchmark-run, benchmark-run-compiled): + Use `declare'. + 2012-09-09 Juri Linkov * replace.el (replace-regexp-lax-whitespace): New defcustom. diff --git a/lisp/emacs-lisp/benchmark.el b/lisp/emacs-lisp/benchmark.el index 646be3e1b71..9029c81f279 100644 --- a/lisp/emacs-lisp/benchmark.el +++ b/lisp/emacs-lisp/benchmark.el @@ -53,6 +53,7 @@ FORMS once. Return a list of the total elapsed time for execution, the number of garbage collections that ran, and the time taken by garbage collection. See also `benchmark-run-compiled'." + (declare (indent 1) (debug t)) (unless (natnump repetitions) (setq forms (cons repetitions forms) repetitions 1)) @@ -69,8 +70,6 @@ See also `benchmark-run-compiled'." `(benchmark-elapse ,@forms)) (- gcs-done ,gcs) (- gc-elapsed ,gc))))) -(put 'benchmark-run 'edebug-form-spec t) -(put 'benchmark-run 'lisp-indent-function 2) ;;;###autoload (defmacro benchmark-run-compiled (&optional repetitions &rest forms) @@ -78,6 +77,7 @@ See also `benchmark-run-compiled'." This is like `benchmark-run', but what is timed is a funcall of the byte code obtained by wrapping FORMS in a `lambda' and compiling the result. The overhead of the `lambda's is accounted for." + (declare (indent 1) (debug t)) (unless (natnump repetitions) (setq forms (cons repetitions forms) repetitions 1)) @@ -96,8 +96,6 @@ result. The overhead of the `lambda's is accounted for." (funcall ,lambda-code)))) `(benchmark-elapse (funcall ,code))) (- gcs-done ,gcs) (- gc-elapsed ,gc))))) -(put 'benchmark-run-compiled 'edebug-form-spec t) -(put 'benchmark-run-compiled 'lisp-indent-function 2) ;;;###autoload (defun benchmark (repetitions form) diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index a59beaeb7ac..c12e8ccacb1 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "9f9bae5b8ccaf325bd59ba9be2b27c44") +;;;;;; "cl-macs" "cl-macs.el" "6d0676869af66e5b5a671f95ee069461") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 312c37261e2..16ac14f8fe9 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -1463,8 +1463,15 @@ Valid clauses are: cl--loop-accum-var)))) (defun cl--loop-build-ands (clauses) + "Return various representations of (and . CLAUSES). +CLAUSES is a list of Elisp expressions, where clauses of the form +\(progn E1 E2 E3 .. t) are the focus of particular optimizations. +The return value has shape (COND BODY COMBO) +such that COMBO is equivalent to (and . CLAUSES)." (let ((ands nil) (body nil)) + ;; Look through `clauses', trying to optimize (progn ,@A t) (progn ,@B) ,@C + ;; into (progn ,@A ,@B) ,@C. (while clauses (if (and (eq (car-safe (car clauses)) 'progn) (eq (car (last (car clauses))) t)) @@ -1475,6 +1482,7 @@ Valid clauses are: (cl-cdadr clauses) (list (cadr clauses)))) (cddr clauses))) + ;; A final (progn ,@A t) is moved outside of the `and'. (setq body (cdr (butlast (pop clauses))))) (push (pop clauses) ands))) (setq ands (or (nreverse ands) (list t))) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 666e31f690f..64aac4b81db 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -431,6 +431,61 @@ if that value is non-nil." (add-hook 'completion-at-point-functions 'lisp-completion-at-point nil 'local)) +;;; Emacs Lisp Byte-Code mode + +(eval-and-compile + (defconst emacs-list-byte-code-comment-re + (concat "\\(#\\)@\\([0-9]+\\) " + ;; Make sure it's a docstring and not a lazy-loaded byte-code. + "\\(?:[^(]\\|([^\"]\\)"))) + +(defun emacs-lisp-byte-code-comment (end &optional _point) + "Try to syntactically mark the #@NNN ....^_ docstrings in byte-code files." + (let ((ppss (syntax-ppss))) + (when (and (nth 4 ppss) + (eq (char-after (nth 8 ppss)) ?#)) + (let* ((n (save-excursion + (goto-char (nth 8 ppss)) + (when (looking-at emacs-list-byte-code-comment-re) + (string-to-number (match-string 2))))) + ;; `maxdiff' tries to make sure the loop below terminates. + (maxdiff n)) + (when n + (let* ((bchar (match-end 2)) + (b (position-bytes bchar))) + (goto-char (+ b n)) + (while (let ((diff (- (position-bytes (point)) b n))) + (unless (zerop diff) + (when (> diff maxdiff) (setq diff maxdiff)) + (forward-char (- diff)) + (setq maxdiff (if (> diff 0) diff + (max (1- maxdiff) 1))) + t)))) + (if (<= (point) end) + (put-text-property (1- (point)) (point) + 'syntax-table + (string-to-syntax "> b")) + (goto-char end))))))) + +(defun emacs-lisp-byte-code-syntax-propertize (start end) + (emacs-lisp-byte-code-comment end (point)) + (funcall + (syntax-propertize-rules + (emacs-list-byte-code-comment-re + (1 (prog1 "< b" (emacs-lisp-byte-code-comment end (point)))))) + start end)) + +(add-to-list 'auto-mode-alist '("\\.elc\\'" . emacs-lisp-byte-code-mode)) +(define-derived-mode emacs-lisp-byte-code-mode emacs-lisp-mode + "Elisp-Byte-Code" + "Major mode for *.elc files." + ;; TODO: Add way to disassemble byte-code under point. + (setq-local open-paren-in-column-0-is-defun-start nil) + (setq-local syntax-propertize-function + #'emacs-lisp-byte-code-syntax-propertize)) + +;;; Generic Lisp mode. + (defvar lisp-mode-map (let ((map (make-sparse-keymap)) (menu-map (make-sparse-keymap "Lisp"))) @@ -730,10 +785,12 @@ POS specifies the starting position where EXP was found and defaults to point." (let ((vars ())) (goto-char (point-min)) (while (re-search-forward - "^(def\\(?:var\\|const\\|custom\\)[ \t\n]+\\([^; '()\n\t]+\\)" + "(def\\(?:var\\|const\\|custom\\)[ \t\n]+\\([^; '()\n\t]+\\)" pos t) (let ((var (intern (match-string 1)))) - (unless (special-variable-p var) + (and (not (special-variable-p var)) + (save-excursion + (zerop (car (syntax-ppss (match-beginning 0))))) (push var vars)))) `(progn ,@(mapcar (lambda (v) `(defvar ,v)) vars) ,exp))))) @@ -820,7 +877,6 @@ if it already has a value.\) With argument, insert value in current buffer after the defun. Return the result of evaluation." - (interactive "P") ;; FIXME: the print-length/level bindings should only be applied while ;; printing, not while evaluating. (let ((debug-on-error eval-expression-debug-on-error) @@ -925,6 +981,7 @@ rigidly along with this one." (if (or (null indent) (looking-at "\\s<\\s<\\s<")) ;; Don't alter indentation of a ;;; comment line ;; or a line that starts in a string. + ;; FIXME: inconsistency: comment-indent moves ;;; to column 0. (goto-char (- (point-max) pos)) (if (and (looking-at "\\s<") (not (looking-at "\\s<\\s<"))) ;; Single-semicolon comment lines should be indented @@ -939,18 +996,7 @@ rigidly along with this one." ;; If initial point was within line's indentation, ;; position after the indentation. Else stay at same point in text. (if (> (- (point-max) pos) (point)) - (goto-char (- (point-max) pos))) - ;; If desired, shift remaining lines of expression the same amount. - (and whole-exp (not (zerop shift-amt)) - (save-excursion - (goto-char beg) - (forward-sexp 1) - (setq end (point)) - (goto-char beg) - (forward-line 1) - (setq beg (point)) - (> end beg)) - (indent-code-rigidly beg end shift-amt))))) + (goto-char (- (point-max) pos)))))) (defvar calculate-lisp-indent-last-sexp) @@ -1230,7 +1276,6 @@ Lisp function does not specify a special indentation." (put 'prog2 'lisp-indent-function 2) (put 'save-excursion 'lisp-indent-function 0) (put 'save-restriction 'lisp-indent-function 0) -(put 'save-match-data 'lisp-indent-function 0) (put 'save-current-buffer 'lisp-indent-function 0) (put 'let 'lisp-indent-function 1) (put 'let* 'lisp-indent-function 1) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index d9f80103435..5644c394f7e 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2012-09-10 Stefan Monnier + + * qp.el (quoted-printable-decode-region): Inline+CSE+strength-reduction. + 2012-09-07 Chong Yidong * gnus-util.el diff --git a/lisp/gnus/qp.el b/lisp/gnus/qp.el index bfa1fe0a6d4..c4487c68b5c 100644 --- a/lisp/gnus/qp.el +++ b/lisp/gnus/qp.el @@ -53,14 +53,7 @@ them into characters should be done separately." ;; or both of which are lowercase letters in "abcdef", is ;; formally illegal. A robust implementation might choose to ;; recognize them as the corresponding uppercase letters.'' - (let ((case-fold-search t) - (decode-hex #'(lambda (n1 n2) - (+ (* (if (<= n1 ?9) (- n1 ?0) - (if (<= n1 ?F) (+ (- n1 ?A) 10) - (+ (- n1 ?a) 10))) 16) - (if (<= n2 ?9) (- n2 ?0) - (if (<= n2 ?F) (+ (- n2 ?A) 10) - (+ (- n2 ?a) 10))))))) + (let ((case-fold-search t)) (narrow-to-region from to) ;; Do this in case we're called from Gnus, say, in a buffer ;; which already contains non-ASCII characters which would @@ -78,8 +71,15 @@ them into characters should be done separately." (let* ((n (/ (- (match-end 0) (point)) 3)) (str (make-string n 0))) (dotimes (i n) - (aset str i (funcall decode-hex (char-after (1+ (point))) - (char-after (+ 2 (point))))) + (let ((n1 (char-after (1+ (point)))) + (n2 (char-after (+ 2 (point))))) + (aset str i + (+ (* 16 (- n1 (if (<= n1 ?9) ?0 + (if (<= n1 ?F) (- ?A 10) + (- ?a 10))))) + (- n2 (if (<= n2 ?9) ?0 + (if (<= n2 ?F) (- ?A 10) + (- ?a 10))))))) (forward-char 3)) (delete-region (match-beginning 0) (match-end 0)) (insert str))) -- cgit v1.2.3 From 511fd0b2f470a33bf7f3d101ab03fcf47b797218 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 11 Sep 2012 00:13:21 -0700 Subject: load-path-shadows-font-lock-keywords tweak * lisp/emacs-lisp/shadow.el (load-path-shadows-font-lock-keywords): Be more robust about locating simple.el. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/shadow.el | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5d0d00be9dc..b448f30e5e3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-11 Glenn Morris + + * emacs-lisp/shadow.el (load-path-shadows-font-lock-keywords): + Be more robust about locating simple.el. + 2012-09-10 Glenn Morris * mail/emacsbug.el (report-emacs-bug): Trap load-path-shadows errors. diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index 286c4937b5b..bceec296ad8 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -158,8 +158,14 @@ See the documentation for `list-load-path-shadows' for further information." (eq 0 (call-process "cmp" nil nil nil "-s" f1 f2)))))))) (defvar load-path-shadows-font-lock-keywords + ;; The idea is that shadows of files supplied with Emacs are more + ;; serious than various versions of external packages shadowing each + ;; other. `((,(format "hides \\(%s.*\\)" - (file-name-directory (locate-library "simple.el"))) + (file-name-directory + (or (locate-library "simple") + (file-name-as-directory + (expand-file-name "../lisp" data-directory))))) . (1 font-lock-warning-face))) "Keywords to highlight in `load-path-shadows-mode'.") -- cgit v1.2.3 From 45b82ad0ebedaa1b7094912e218bea1510c33feb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 11 Sep 2012 20:14:50 -0400 Subject: * src/eval.c: Add `inhibit-debugger'. (Qinhibit_debugger): New symbol. (call_debugger): Bind it instead of Qdebug_on_error. (maybe_call_debugger): Test Vinhibit_debugger. (syms_of_eval): Define inhibit-debugger. * src/xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. (syms_of_xdisp): Remove inhibit-debug-on-message. * lisp/emacs-lisp/debug.el (debug): Don't bind debug-on-error since inhibit-debugger is bound instead. --- etc/NEWS | 14 +++++++++----- lisp/ChangeLog | 9 +++++++-- lisp/emacs-lisp/debug.el | 2 -- src/ChangeLog | 10 ++++++++++ src/composite.h | 2 +- src/eval.c | 15 +++++++++++---- src/keyboard.c | 4 ++-- src/xdisp.c | 19 +++---------------- 8 files changed, 43 insertions(+), 32 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/etc/NEWS b/etc/NEWS index af4bcf11dbb..e095ca795e4 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -675,7 +675,15 @@ The interpretation of the DECLS is determined by `defun-declarations-alist'. ** New error type and new function `user-error'. Doesn't trigger the debugger. -** New option `debugger-bury-or-kill'. +** Debugger +*** New option `debugger-bury-or-kill'. + +*** Set `debug-on-message' to enter the debugger when a certain +message is displayed in the echo area. This can be useful when trying +to work out which code is doing something. + +*** New var `inhibit-debugger', automatically set to prevent accidental +recursive invocations. +++ ** New utility function `buffer-narrowed-p'. @@ -1977,10 +1985,6 @@ instead of jumping all the way to the top-level. *** Set `debug-on-event' to enter the debugger on events like SIGUSR1. This can be useful when `inhibit-quit' is set. -*** Set `debug-on-message' to enter the debugger when a certain -message is displayed in the echo area. This can be useful when trying -to work out which code is doing something. - ** The new function `server-eval-at' allows evaluation of Lisp forms on named Emacs server instances. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cdc021d192f..202b41891eb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-12 Stefan Monnier + + * emacs-lisp/debug.el (debug): Don't bind debug-on-error since + inhibit-debugger is bound instead. + 2012-09-11 Bastien Guerry * subr.el (set-temporary-overlay-map): Add a docstring. @@ -24,8 +29,8 @@ 2012-09-10 Dan Nicolaescu - * vc/diff-mode.el (diff-mode-menu): Bind - diff-remove-trailing-whitespace. + * vc/diff-mode.el (diff-mode-menu): + Bind diff-remove-trailing-whitespace. 2012-09-10 Stefan Monnier diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 188c0800eb8..bdb35e424d0 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -162,8 +162,6 @@ first will be printed into the backtrace buffer." (unless noninteractive (message "Entering debugger...")) (let (debugger-value - (debug-on-error nil) - (debug-on-quit nil) (debugger-previous-state (if (get-buffer "*Backtrace*") (with-current-buffer (get-buffer "*Backtrace*") diff --git a/src/ChangeLog b/src/ChangeLog index f4cae50d8ed..a005b1d80c7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2012-09-12 Stefan Monnier + + * eval.c: Add `inhibit-debugger'. + (Qinhibit_debugger): New symbol. + (call_debugger): Bind it instead of Qdebug_on_error. + (maybe_call_debugger): Test Vinhibit_debugger. + (syms_of_eval): Define inhibit-debugger. + * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message. + (syms_of_xdisp): Remove inhibit-debug-on-message. + 2012-09-11 Paul Eggert Avoid _setjmp/_longjmp problems with local nonvolatile variables. diff --git a/src/composite.h b/src/composite.h index 68f5b27ee42..9462b932c66 100644 --- a/src/composite.h +++ b/src/composite.h @@ -113,7 +113,7 @@ extern Lisp_Object composition_temp; && (end - start) == COMPOSITION_LENGTH (prop)) /* Return the Nth glyph of composition specified by CMP. CMP is a - pointer to `struct composition'. */ + pointer to `struct composition'. */ #define COMPOSITION_GLYPH(cmp, n) \ XINT (XVECTOR (XVECTOR (XHASH_TABLE (composition_hash_table) \ ->key_and_value) \ diff --git a/src/eval.c b/src/eval.c index 4f0d6c69a51..8a8a507a1b6 100644 --- a/src/eval.c +++ b/src/eval.c @@ -69,7 +69,7 @@ Lisp_Object Qautoload, Qmacro, Qexit, Qinteractive, Qcommandp; Lisp_Object Qinhibit_quit; Lisp_Object Qand_rest; static Lisp_Object Qand_optional; -static Lisp_Object Qdebug_on_error; +static Lisp_Object Qinhibit_debugger; static Lisp_Object Qdeclare; Lisp_Object Qinternal_interpreter_environment, Qclosure; @@ -229,7 +229,7 @@ call_debugger (Lisp_Object arg) specbind (intern ("debugger-may-continue"), debug_while_redisplaying ? Qnil : Qt); specbind (Qinhibit_redisplay, Qnil); - specbind (Qdebug_on_error, Qnil); + specbind (Qinhibit_debugger, Qt); #if 0 /* Binding this prevents execution of Lisp code during redisplay, which necessarily leads to display problems. */ @@ -1725,6 +1725,7 @@ maybe_call_debugger (Lisp_Object conditions, Lisp_Object sig, Lisp_Object data) /* Don't try to run the debugger with interrupts blocked. The editing loop would return anyway. */ ! INPUT_BLOCKED_P + && NILP (Vinhibit_debugger) /* Does user want to enter debugger for this kind of error? */ && (EQ (sig, Qquit) ? debug_on_quit @@ -3467,7 +3468,7 @@ before making `inhibit-quit' nil. */); DEFSYM (Qinhibit_quit, "inhibit-quit"); DEFSYM (Qautoload, "autoload"); - DEFSYM (Qdebug_on_error, "debug-on-error"); + DEFSYM (Qinhibit_debugger, "inhibit-debugger"); DEFSYM (Qmacro, "macro"); DEFSYM (Qdeclare, "declare"); @@ -3482,6 +3483,12 @@ before making `inhibit-quit' nil. */); DEFSYM (Qclosure, "closure"); DEFSYM (Qdebug, "debug"); + DEFVAR_LISP ("inhibit-debugger", Vinhibit_debugger, + doc: /* Non-nil means never enter the debugger. +Normally set while the debugger is already active, to avoid recursive +invocations. */); + Vinhibit_debugger = Qnil; + DEFVAR_LISP ("debug-on-error", Vdebug_on_error, doc: /* Non-nil means enter debugger if an error is signaled. Does not apply to errors handled by `condition-case' or those @@ -3491,7 +3498,7 @@ if one of its condition symbols appears in the list. When you evaluate an expression interactively, this variable is temporarily non-nil if `eval-expression-debug-on-error' is non-nil. The command `toggle-debug-on-error' toggles this. -See also the variable `debug-on-quit'. */); +See also the variable `debug-on-quit' and `inhibit-debugger'. */); Vdebug_on_error = Qnil; DEFVAR_LISP ("debug-ignored-errors", Vdebug_ignored_errors, diff --git a/src/keyboard.c b/src/keyboard.c index 42c67f68ede..8091258578c 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4133,7 +4133,7 @@ kbd_buffer_get_event (KBOARD **kbp, *used_mouse_menu = 1; #endif #ifdef HAVE_NS - /* certain system events are non-key events */ + /* Certain system events are non-key events. */ if (used_mouse_menu && event->kind == NS_NONKEY_EVENT) *used_mouse_menu = 1; @@ -4161,7 +4161,7 @@ kbd_buffer_get_event (KBOARD **kbp, so x remains nil. */ x = Qnil; - /* XXX Can f or mouse_position_hook be NULL here? */ + /* XXX Can f or mouse_position_hook be NULL here? */ if (f && FRAME_TERMINAL (f)->mouse_position_hook) (*FRAME_TERMINAL (f)->mouse_position_hook) (&f, 0, &bar_window, &part, &x, &y, &t); diff --git a/src/xdisp.c b/src/xdisp.c index c1e05d6df15..e9d9595d91e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -364,7 +364,6 @@ static Lisp_Object Qslice; Lisp_Object Qcenter; static Lisp_Object Qmargin, Qpointer; static Lisp_Object Qline_height; -static Lisp_Object Qinhibit_debug_on_message; /* These setters are used only in this file, so they can be private. */ static inline void @@ -10590,8 +10589,6 @@ static void set_message (const char *s, Lisp_Object string, ptrdiff_t nbytes, int multibyte_p) { - ptrdiff_t count = SPECPDL_INDEX (); - message_enable_multibyte = ((s && multibyte_p) || (STRINGP (string) && STRING_MULTIBYTE (string))); @@ -10601,14 +10598,9 @@ set_message (const char *s, Lisp_Object string, message_buf_print = 0; help_echo_showing_p = 0; - if (NILP (Vinhibit_debug_on_message) && STRINGP (Vdebug_on_message) + if (STRINGP (Vdebug_on_message) && fast_string_match (Vdebug_on_message, string) >= 0) - { - specbind (Qinhibit_debug_on_message, Qt); - call_debugger (list2 (Qerror, string)); - } - - unbind_to (count, Qnil); + call_debugger (list2 (Qerror, string)); } @@ -12800,7 +12792,7 @@ overlay_arrow_at_row (struct it *it, struct glyph_row *row) return make_number (fringe_bitmap); } #endif - return make_number (-1); /* Use default arrow bitmap */ + return make_number (-1); /* Use default arrow bitmap. */ } return overlay_arrow_string_or_property (var); } @@ -29316,11 +29308,6 @@ Its value should be an ASCII acronym string, `hex-code', `empty-box', or DEFVAR_LISP ("debug-on-message", Vdebug_on_message, doc: /* If non-nil, debug if a message matching this regexp is displayed. */); Vdebug_on_message = Qnil; - - DEFVAR_LISP ("inhibit-debug-on-message", Vinhibit_debug_on_message, - doc: /* If non-nil, inhibit `debug-on-message' from entering the debugger. */); - Vinhibit_debug_on_message = Qnil; - DEFSYM(Qinhibit_debug_on_message, "inhibit-debug-on-message"); } -- cgit v1.2.3 From 60c49c0fe92cde4e9f4d2db0ee15e55b7c7aa1cb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 12 Sep 2012 09:12:48 -0400 Subject: * lisp/emacs-lisp/edebug.el (edebug-enter): Don't mess with overriding-local-map and pre/post-command-hook here. (edebug-recursive-edit): Do it here instead. (edebug-outside-unread-command-char): Remove all uses of unread-command-char. Fixes: debbugs:12345 --- lisp/ChangeLog | 6 +++ lisp/emacs-lisp/edebug.el | 106 +++++++++++++++++----------------------------- 2 files changed, 46 insertions(+), 66 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 202b41891eb..f24ccb3aaa6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 2012-09-12 Stefan Monnier + * emacs-lisp/edebug.el (edebug-enter): Don't mess with + overriding-local-map and pre/post-command-hook here. + (edebug-recursive-edit): Do it here instead (bug#12345). + (edebug-outside-unread-command-char): Remove all uses of + unread-command-char. + * emacs-lisp/debug.el (debug): Don't bind debug-on-error since inhibit-debugger is bound instead. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 7fcd339d6d2..17f6f79cd66 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2248,47 +2248,14 @@ error is signaled again. (debug-on-quit edebug-on-quit) ;; Lexical bindings must be uncompiled for this to work. - (cl-lexical-debug t) - - (edebug-outside-overriding-local-map overriding-local-map) - (edebug-outside-overriding-terminal-local-map - overriding-terminal-local-map) - - ;; Save the outside value of executing macro. (here??) - (edebug-outside-executing-macro executing-kbd-macro) - (edebug-outside-pre-command-hook - (edebug-var-status 'pre-command-hook)) - (edebug-outside-post-command-hook - (edebug-var-status 'post-command-hook))) + (cl-lexical-debug t)) (unwind-protect - (let (;; Don't keep reading from an executing kbd macro - ;; within edebug unless edebug-continue-kbd-macro is - ;; non-nil. Again, local binding may not be best. - (executing-kbd-macro - (if edebug-continue-kbd-macro executing-kbd-macro)) - - ;; Don't get confused by the user's keymap changes. - (overriding-local-map nil) - (overriding-terminal-local-map nil) - - (signal-hook-function 'edebug-signal) - - ;; Disable command hooks. This is essential when - ;; a hook function is instrumented - to avoid infinite loop. - ;; This may be more than we need, however. - (pre-command-hook nil) - (post-command-hook nil)) + (let ((signal-hook-function 'edebug-signal)) (setq edebug-execution-mode (or edebug-next-execution-mode edebug-initial-mode edebug-execution-mode) edebug-next-execution-mode nil) - (edebug-enter edebug-function edebug-args edebug-body)) - ;; Reset global variables in case outside value was changed. - (setq executing-kbd-macro edebug-outside-executing-macro) - (edebug-restore-status - 'post-command-hook edebug-outside-post-command-hook) - (edebug-restore-status - 'pre-command-hook edebug-outside-pre-command-hook))) + (edebug-enter edebug-function edebug-args edebug-body)))) (let* ((edebug-data (get edebug-function 'edebug)) (edebug-def-mark (car edebug-data)) ; mark at def start @@ -2804,7 +2771,6 @@ MSG is printed after `::::} '." ;; in versions where the variable is *not* built-in. ;; Emacs 18 FIXME -(defvar edebug-outside-unread-command-char) ;; Emacs 19. (defvar edebug-outside-last-command-event) @@ -2814,15 +2780,6 @@ MSG is printed after `::::} '." (defvar edebug-outside-last-nonmenu-event) (defvar edebug-outside-track-mouse) -;; Disable byte compiler warnings about unread-command-char and -event -;; (maybe works with byte-compile-version 2.22 at least) -(defvar edebug-unread-command-char-warning) -(defvar edebug-unread-command-event-warning) -(eval-when-compile ; FIXME - (setq edebug-unread-command-char-warning - (get 'unread-command-char 'byte-obsolete-variable)) - (put 'unread-command-char 'byte-obsolete-variable nil)) - (defun edebug-recursive-edit () ;; Start up a recursive edit inside of edebug. ;; The current buffer is the edebug-buffer, which is put into edebug-mode. @@ -2844,14 +2801,24 @@ MSG is printed after `::::} '." (edebug-outside-map (current-local-map)) - (edebug-outside-standard-output standard-output) + (edebug-outside-overriding-local-map overriding-local-map) + (edebug-outside-overriding-terminal-local-map + overriding-terminal-local-map) + + ;; Save the outside value of executing macro. (here??) + (edebug-outside-executing-macro executing-kbd-macro) + (edebug-outside-pre-command-hook + (edebug-var-status 'pre-command-hook)) + (edebug-outside-post-command-hook + (edebug-var-status 'post-command-hook)) + + (edebug-outside-standard-output standard-output) (edebug-outside-standard-input standard-input) (edebug-outside-defining-kbd-macro defining-kbd-macro) (edebug-outside-last-command last-command) (edebug-outside-this-command this-command) - (edebug-outside-unread-command-char unread-command-char) ; FIXME (edebug-outside-current-prefix-arg current-prefix-arg) (edebug-outside-last-input-event last-input-event) @@ -2867,9 +2834,6 @@ MSG is printed after `::::} '." ;; We could set these to the values for previous edebug call. (last-command last-command) (this-command this-command) - - ;; Assume no edebug command sets unread-command-char. - (unread-command-char -1) (current-prefix-arg nil) ;; More for Emacs 19 @@ -2879,7 +2843,17 @@ MSG is printed after `::::} '." (last-nonmenu-event nil) (track-mouse nil) - ;; Bind again to outside values. + ;; Don't keep reading from an executing kbd macro + ;; within edebug unless edebug-continue-kbd-macro is + ;; non-nil. Again, local binding may not be best. + (executing-kbd-macro + (if edebug-continue-kbd-macro executing-kbd-macro)) + + ;; Don't get confused by the user's keymap changes. + (overriding-local-map nil) + (overriding-terminal-local-map nil) + + ;; Bind again to outside values. (debug-on-error edebug-outside-debug-on-error) (debug-on-quit edebug-outside-debug-on-quit) @@ -2887,6 +2861,12 @@ MSG is printed after `::::} '." (defining-kbd-macro (if edebug-continue-kbd-macro defining-kbd-macro)) + ;; Disable command hooks. This is essential when + ;; a hook function is instrumented - to avoid infinite loop. + ;; This may be more than we need, however. + (pre-command-hook nil) + (post-command-hook nil) + ;; others?? ) @@ -2933,7 +2913,6 @@ MSG is printed after `::::} '." last-command-event edebug-outside-last-command-event last-command edebug-outside-last-command this-command edebug-outside-this-command - unread-command-char edebug-outside-unread-command-char current-prefix-arg edebug-outside-current-prefix-arg last-input-event edebug-outside-last-input-event last-event-frame edebug-outside-last-event-frame @@ -2942,9 +2921,13 @@ MSG is printed after `::::} '." standard-output edebug-outside-standard-output standard-input edebug-outside-standard-input - defining-kbd-macro edebug-outside-defining-kbd-macro - )) - )) + defining-kbd-macro edebug-outside-defining-kbd-macro) + + (setq executing-kbd-macro edebug-outside-executing-macro) + (edebug-restore-status + 'post-command-hook edebug-outside-post-command-hook) + (edebug-restore-status + 'pre-command-hook edebug-outside-pre-command-hook)))) ;;; Display related functions @@ -3562,7 +3545,6 @@ Return the result of the last expression." (last-command-event edebug-outside-last-command-event) (last-command edebug-outside-last-command) (this-command edebug-outside-this-command) - (unread-command-char edebug-outside-unread-command-char) (unread-command-events edebug-outside-unread-command-events) (current-prefix-arg edebug-outside-current-prefix-arg) (last-input-event edebug-outside-last-input-event) @@ -3602,7 +3584,6 @@ Return the result of the last expression." edebug-outside-last-command-event last-command-event edebug-outside-last-command last-command edebug-outside-this-command this-command - edebug-outside-unread-command-char unread-command-char edebug-outside-unread-command-events unread-command-events edebug-outside-current-prefix-arg current-prefix-arg edebug-outside-last-input-event last-input-event @@ -4240,7 +4221,7 @@ It is removed when you hit any char." (let ((buffer-read-only nil)) (undo-boundary) (edebug-display-freq-count) - (setq unread-command-char (read-char)) + (setq unread-command-events (append unread-command-events (read-event))) ;; Yuck! This doesn't seem to work at all for me. (undo))) @@ -4357,13 +4338,6 @@ With prefix argument, make it a temporary breakpoint." ;; Extension for bytecomp to resolve undefined function references. ;; Requires new byte compiler. -;; Reenable byte compiler warnings about unread-command-char and -event. -;; Disabled before edebug-recursive-edit. -(eval-when-compile - (if edebug-unread-command-char-warning - (put 'unread-command-char 'byte-obsolete-variable - edebug-unread-command-char-warning))) - (eval-when-compile ;; The body of eval-when-compile seems to get evaluated with eval-defun. ;; We only want to evaluate when actually byte compiling. -- cgit v1.2.3 From 4dece104ac5d50f934a13b7a817e27750f328278 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Wed, 12 Sep 2012 17:49:17 +0200 Subject: Try to keep height of debugger window consistent. (Bug#8789) * emacs-lisp/debug.el (debugger-previous-window-height): New variable. (debug): When debugger-jumping-flag is non-nil try to restore height of debugger window. (Bug#8789) --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/debug.el | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f24ccb3aaa6..0345c922a15 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-12 Martin Rudalics + + * emacs-lisp/debug.el (debugger-previous-window-height): New + variable. + (debug): When debugger-jumping-flag is non-nil try to restore + height of debugger window. (Bug#8789) + 2012-09-12 Stefan Monnier * emacs-lisp/edebug.el (edebug-enter): Don't mess with diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index bdb35e424d0..8b89e65c5d9 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -96,6 +96,9 @@ The value used here is passed to `quit-restore-window'." (defvar debugger-previous-window nil "This is the window last showing the debugger buffer.") +(defvar debugger-previous-window-height nil + "The last recorded height of `debugger-previous-window'.") + (defvar debugger-previous-backtrace nil "The contents of the previous backtrace (including text properties). This is to optimize `debugger-make-xrefs'.") @@ -234,7 +237,17 @@ first will be printed into the backtrace buffer." . (,(when debugger-previous-window `(previous-window . ,debugger-previous-window))))) (setq debugger-window (selected-window)) - (setq debugger-previous-window debugger-window) + (if (eq debugger-previous-window debugger-window) + (when debugger-jumping-flag + ;; Try to restore previous height of debugger + ;; window. + (condition-case nil + (window-resize + debugger-window + (- debugger-previous-window-height + (window-total-size debugger-window))) + (error nil))) + (setq debugger-previous-window debugger-window)) (debugger-mode) (debugger-setup-buffer debugger-args) (when noninteractive @@ -262,6 +275,9 @@ first will be printed into the backtrace buffer." (recursive-edit)))) (when (and (window-live-p debugger-window) (eq (window-buffer debugger-window) debugger-buffer)) + ;; Record height of debugger window. + (setq debugger-previous-window-height + (window-total-size debugger-window)) ;; Unshow debugger-buffer. (quit-restore-window debugger-window debugger-bury-or-kill)) ;; Restore previous state of debugger-buffer in case we were -- cgit v1.2.3 From bfeae2cf098dcf5bdb4af14d896e790cbe91d60f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 12 Sep 2012 15:16:36 -0400 Subject: Remove unread-command-char. * src/keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p) (Fdiscard_input, quit_throw_to_read_char, init_keyboard) (syms_of_keyboard): Remove support for unread-command-char. * lisp/emacs-lisp/debug.el (debugger-outer-unread-command-char, debug) (debugger-env-macro): Remove support for unread-command-char. * lisp/ehelp.el (with-electric-help): Accept functions in electric-help-form-to-execute. (electric-help-execute-extended, electric-help-ctrl-x-prefix): Use it. And replace unread-command-char -> unread-command-events. * lisp/subr.el (set-temporary-overlay-map): Minimize slightly the impact of the temporary map re-appearing on emulation-mode-map-alists. * lisp/emacs-lisp/edebug.el (def-edebug-form-spec): Remove, it's been broken since 22.1. --- doc/lispref/commands.texi | 11 ----------- etc/NEWS | 2 +- lisp/ChangeLog | 20 ++++++++++++++++++-- lisp/ehelp.el | 13 ++++++++++--- lisp/emacs-lisp/debug.el | 21 +-------------------- lisp/emacs-lisp/edebug.el | 5 ----- lisp/progmodes/ebrowse.el | 2 +- lisp/subr.el | 6 +----- src/ChangeLog | 6 ++++++ src/data.c | 2 +- src/keyboard.c | 25 ++++--------------------- 11 files changed, 43 insertions(+), 70 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 7e24de94fbe..dc0fa4c639d 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -2738,17 +2738,6 @@ This function converts the string or vector @var{key} to a list of individual events, which you can put in @code{unread-command-events}. @end defun -@ignore -@defvar unread-command-char -This variable holds a character to be read as command input. -A value of -1 means ``empty''. - -This variable is mostly obsolete now that you can use -@code{unread-command-events} instead; it exists only to support programs -written for Emacs versions 18 and earlier. -@end defvar -@end ignore - @defun input-pending-p @cindex waiting for command key input This function determines whether any command input is currently diff --git a/etc/NEWS b/etc/NEWS index e095ca795e4..a7388c4e9fa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -638,7 +638,7 @@ are deprecated and will be removed eventually. *** `facemenu-unlisted-faces' *** `rmail-decode-mime-charset' -*** `last-input-char' and `last-command-char' +*** `last-input-char', `last-command-char', `unread-command-char'. * Lisp changes in Emacs 24.3 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 56311198831..549b70a1de1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2012-09-12 Stefan Monnier + + * emacs-lisp/debug.el (debugger-outer-unread-command-char, debug) + (debugger-env-macro): Remove support for unread-command-char. + + * subr.el (set-temporary-overlay-map): Minimize slightly the impact of + the temporary map re-appearing on emulation-mode-map-alists. + + * emacs-lisp/edebug.el (def-edebug-form-spec): Remove, it's been broken + since 22.1. + + * ehelp.el (with-electric-help): Accept functions in + electric-help-form-to-execute. + (electric-help-execute-extended, electric-help-ctrl-x-prefix): Use it. + And replace unread-command-char -> unread-command-events. + 2012-09-12 Michael Albinus Sync with Tramp 2.2.6. @@ -9,8 +25,8 @@ 2012-09-12 Martin Rudalics - * emacs-lisp/debug.el (debugger-previous-window-height): New - variable. + * emacs-lisp/debug.el (debugger-previous-window-height): + New variable. (debug): When debugger-jumping-flag is non-nil try to restore height of debugger window. (Bug#8789) diff --git a/lisp/ehelp.el b/lisp/ehelp.el index abb897f73f6..281148d9cf6 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -193,7 +193,9 @@ BUFFER is put back into its original major mode." (replace-buffer-in-windows buffer) ;; must do this outside of save-window-excursion (bury-buffer buffer)) - (eval electric-help-form-to-execute)))) + (if (functionp electric-help-form-to-execute) + (funcall electric-help-form-to-execute) + (eval electric-help-form-to-execute))))) (defun electric-help-command-loop () (catch 'exit @@ -349,14 +351,19 @@ will select it.)" ;; continues with execute-extended-command. (defun electric-help-execute-extended (_prefixarg) (interactive "p") - (setq electric-help-form-to-execute '(execute-extended-command nil)) + (setq electric-help-form-to-execute + (lambda () (execute-extended-command nil))) (electric-help-retain)) ;; This is to be buond to C-x in ehelp mode. Retains ehelp buffer and then ;; continues with ctrl-x prefix. (defun electric-help-ctrl-x-prefix (_prefixarg) (interactive "p") - (setq electric-help-form-to-execute '(progn (message nil) (setq unread-command-char ?\C-x))) + (setq electric-help-form-to-execute + (lambda () + (message nil) + (setq unread-command-events + (append unread-command-events '(?\C-x))))) (electric-help-retain)) diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 8b89e65c5d9..774b4d3d600 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -110,10 +110,6 @@ This is to optimize `debugger-make-xrefs'.") (defvar debugger-outer-track-mouse) (defvar debugger-outer-last-command) (defvar debugger-outer-this-command) -;; unread-command-char is obsolete, -;; but we still save and restore it -;; in case some user program still tries to set it. -(defvar debugger-outer-unread-command-char) (defvar debugger-outer-unread-command-events) (defvar debugger-outer-unread-post-input-method-events) (defvar debugger-outer-last-input-event) @@ -185,8 +181,6 @@ first will be printed into the backtrace buffer." (debugger-outer-track-mouse track-mouse) (debugger-outer-last-command last-command) (debugger-outer-this-command this-command) - (debugger-outer-unread-command-char - (with-no-warnings unread-command-char)) (debugger-outer-unread-command-events unread-command-events) (debugger-outer-unread-post-input-method-events unread-post-input-method-events) @@ -221,8 +215,6 @@ first will be printed into the backtrace buffer." (cursor-in-echo-area nil)) (unwind-protect (save-excursion - (with-no-warnings - (setq unread-command-char -1)) (when (eq (car debugger-args) 'debug) ;; Skip the frames for backtrace-debug, byte-code, ;; and implement-debug-on-entry. @@ -302,8 +294,6 @@ first will be printed into the backtrace buffer." (setq track-mouse debugger-outer-track-mouse) (setq last-command debugger-outer-last-command) (setq this-command debugger-outer-this-command) - (with-no-warnings - (setq unread-command-char debugger-outer-unread-command-char)) (setq unread-command-events debugger-outer-unread-command-events) (setq unread-post-input-method-events debugger-outer-unread-post-input-method-events) @@ -605,16 +595,7 @@ Applies to the frame whose line point is on in the backtrace." (cursor-in-echo-area debugger-outer-cursor-in-echo-area)) (set-match-data debugger-outer-match-data) (prog1 - (let ((save-ucc (with-no-warnings unread-command-char))) - (unwind-protect - (progn - (with-no-warnings - (setq unread-command-char debugger-outer-unread-command-char)) - (prog1 (progn ,@body) - (with-no-warnings - (setq debugger-outer-unread-command-char unread-command-char)))) - (with-no-warnings - (setq unread-command-char save-ucc)))) + (progn ,@body) (setq debugger-outer-match-data (match-data)) (setq debugger-outer-load-read-function load-read-function) (setq debugger-outer-overriding-terminal-local-map diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 17f6f79cd66..f147fba167d 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -235,11 +235,6 @@ If the result is non-nil, then break. Errors are ignored." ;;; Form spec utilities. -(defmacro def-edebug-form-spec (symbol spec-form) - "For compatibility with old version." - (def-edebug-spec symbol (eval spec-form))) -(make-obsolete 'def-edebug-form-spec 'def-edebug-spec "22.1") - (defun get-edebug-spec (symbol) ;; Get the spec of symbol resolving all indirection. (let ((edebug-form-spec nil) diff --git a/lisp/progmodes/ebrowse.el b/lisp/progmodes/ebrowse.el index 1d29011762e..8ac54d6524e 100644 --- a/lisp/progmodes/ebrowse.el +++ b/lisp/progmodes/ebrowse.el @@ -4210,7 +4210,7 @@ NUMBER-OF-STATIC-VARIABLES:" ;; this will select the buffer from which the buffer menu was ;; invoked. But this buffer is not displayed in the buffer list if ;; it isn't a tree buffer. I therefore let the buffer menu command -;; loop read the command `p' via `unread-command-char'. This command +;; loop read the command `p' via `unread-command-events'. This command ;; has no effect since we are on the first line of the buffer. (defvar electric-buffer-menu-mode-hook nil) diff --git a/lisp/subr.el b/lisp/subr.el index 23b62b25c9c..aa1b10ce17d 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1250,11 +1250,6 @@ is converted into a string by expressing it in decimal." 'mode-line-inverse-video "use the appropriate faces instead." "21.1") -(make-obsolete-variable - 'unread-command-char - "use `unread-command-events' instead. That variable is a list of events -to reread, so it now uses nil to mean `no event', instead of -1." - "before 19.15") ;; Lisp manual only updated in 22.1. (define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro @@ -3928,6 +3923,7 @@ When KEEP-PRED is nil, the temporary keymap is used only once." (lookup-key ',map (this-command-keys-vector)))) (t `(funcall ',keep-pred))) + (set ',overlaysym nil) ;Just in case. (remove-hook 'pre-command-hook ',clearfunsym) (setq emulation-mode-map-alists (delq ',alist emulation-mode-map-alists)))))) diff --git a/src/ChangeLog b/src/ChangeLog index bfb6e5a87b3..8b47c52c23f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2012-09-12 Stefan Monnier + + * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p) + (Fdiscard_input, quit_throw_to_read_char, init_keyboard) + (syms_of_keyboard): Remove support for unread-command-char. + 2012-09-12 Eli Zaretskii * w32proc.c (sys_kill): If PID is our process ID and the signal is diff --git a/src/data.c b/src/data.c index d894ac71a65..5d7f036b70d 100644 --- a/src/data.c +++ b/src/data.c @@ -1164,7 +1164,7 @@ set_internal (Lisp_Object symbol, Lisp_Object newval, Lisp_Object where, the default binding is loaded, the loaded binding may be the wrong one. */ if (!EQ (blv->where, where) - /* Also unload a global binding (if the var is local_if_set). */ + /* Also unload a global binding (if the var is local_if_set). */ || (EQ (blv->valcell, blv->defcell))) { /* The currently loaded binding is not necessarily valid. diff --git a/src/keyboard.c b/src/keyboard.c index 8091258578c..7be3e9e118e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2366,15 +2366,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, goto reread_first; } - if (unread_command_char != -1) - { - XSETINT (c, unread_command_char); - unread_command_char = -1; - - reread = 1; - goto reread_first; - } - if (CONSP (Vunread_command_events)) { int was_disabled = 0; @@ -2559,7 +2550,6 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, && !NILP (prev_event) && ! EVENT_HAS_PARAMETERS (prev_event) /* Don't bring up a menu if we already have another event. */ && NILP (Vunread_command_events) - && unread_command_char < 0 && !detect_input_pending_run_timers (0)) { c = read_char_minibuf_menu_prompt (commandflag, nmaps, maps); @@ -2695,8 +2685,7 @@ read_char (int commandflag, ptrdiff_t nmaps, Lisp_Object *maps, && !EQ (XCAR (prev_event), Qmenu_bar) && !EQ (XCAR (prev_event), Qtool_bar) /* Don't bring up a menu if we already have another event. */ - && NILP (Vunread_command_events) - && unread_command_char < 0) + && NILP (Vunread_command_events)) { c = read_char_x_menu_prompt (nmaps, maps, prev_event, used_mouse_menu); @@ -10453,7 +10442,7 @@ clear_input_pending (void) int requeued_events_pending_p (void) { - return (!NILP (Vunread_command_events) || unread_command_char != -1); + return (!NILP (Vunread_command_events)); } @@ -10463,7 +10452,7 @@ Actually, the value is nil only if we can be sure that no input is available; if there is a doubt, the value is t. */) (void) { - if (!NILP (Vunread_command_events) || unread_command_char != -1 + if (!NILP (Vunread_command_events) || !NILP (Vunread_post_input_method_events) || !NILP (Vunread_input_method_events)) return (Qt); @@ -10651,7 +10640,6 @@ Also end any kbd macro being defined. */) update_mode_lines++; Vunread_command_events = Qnil; - unread_command_char = -1; discard_tty_input (); @@ -10991,7 +10979,6 @@ quit_throw_to_read_char (int from_signal) input_pending = 0; Vunread_command_events = Qnil; - unread_command_char = -1; #if 0 /* Currently, sit_for is called from read_char without turning off polling. And that can call set_waiting_for_input. @@ -11378,12 +11365,11 @@ delete_kboard (KBOARD *kb) void init_keyboard (void) { - /* This is correct before outermost invocation of the editor loop */ + /* This is correct before outermost invocation of the editor loop. */ command_loop_level = -1; immediate_quit = 0; quit_char = Ctl ('g'); Vunread_command_events = Qnil; - unread_command_char = -1; timer_idleness_start_time = invalid_emacs_time (); total_keys = 0; recent_keys_index = 0; @@ -11716,9 +11702,6 @@ as they will already have been added once as they were read for the first time. An element of the form (t . EVENT) forces EVENT to be added to that list. */); Vunread_command_events = Qnil; - DEFVAR_INT ("unread-command-char", unread_command_char, - doc: /* If not -1, an object to be read as next command input event. */); - DEFVAR_LISP ("unread-post-input-method-events", Vunread_post_input_method_events, doc: /* List of events to be processed as input by input methods. These events are processed before `unread-command-events' -- cgit v1.2.3 From bd8d610845a89c2cf5d7d75ff552df572b30f5e7 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 12 Sep 2012 22:00:41 -0400 Subject: * lisp/emacs-lisp/edebug.el: Use lexical-binding. Remove the "edebug-" prefix from non-dynamically-scoped variables. Mark unused args with underscore. (edebug-save-restriction, edebug-outside-excursion): Use `declare'. (edebug-form-data): Use defvar-local. (edebug-make-before-and-after-form, edebug-make-after-form): Use backquote. (edebug-args, edebug-value, edebug-after-index, edebug-arg-mode): Not dynamically scoped any more. (edebug--enter-trace): Add arguments `function' and `args'. Rename from edebug-enter-trace. (edebug-enter): Call it accordingly. Bind edebug-function explicitly. (edebug--update-coverage): Add `after-index' and `value' args. Rename from edebug-update-coverage. (edebug-slow-after): Call it accordingly. (edebug--recursive-edit): Add arg `arg-mode'. Rename from edebug-recursive-edit. (edebug--display): Call it accordingly. Add args `value', `offset-index', and `arg-mode'. Rename from edebug-display. (edebug-debugger, edebug): Call it accordingly. (edebug-eval-display-list): Use dolist. --- lisp/ChangeLog | 24 +++ lisp/emacs-lisp/edebug.el | 388 ++++++++++++++++++++++------------------------ 2 files changed, 212 insertions(+), 200 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ecb110bc30e..f0bbd7558bc 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,27 @@ +2012-09-13 Stefan Monnier + + * emacs-lisp/edebug.el: Use lexical-binding. + Remove the "edebug-" prefix from non-dynamically-scoped variables. + Mark unused args with underscore. + (edebug-save-restriction, edebug-outside-excursion): Use `declare'. + (edebug-form-data): Use defvar-local. + (edebug-make-before-and-after-form, edebug-make-after-form): + Use backquote. + (edebug-args, edebug-value, edebug-after-index, edebug-arg-mode): + Not dynamically scoped any more. + (edebug--enter-trace): Add arguments `function' and `args'. + Rename from edebug-enter-trace. + (edebug-enter): Call it accordingly. Bind edebug-function explicitly. + (edebug--update-coverage): Add `after-index' and `value' args. + Rename from edebug-update-coverage. + (edebug-slow-after): Call it accordingly. + (edebug--recursive-edit): Add arg `arg-mode'. Rename from + edebug-recursive-edit. + (edebug--display): Call it accordingly. Add args `value', + `offset-index', and `arg-mode'. Rename from edebug-display. + (edebug-debugger, edebug): Call it accordingly. + (edebug-eval-display-list): Use dolist. + 2012-09-12 Juri Linkov * info.el (Info-search): Don't check for isearch-mode and diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index f147fba167d..42260d12a82 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1,4 +1,4 @@ -;;; edebug.el --- a source-level debugger for Emacs Lisp +;;; edebug.el --- a source-level debugger for Emacs Lisp -*- lexical-binding: t -*- ;; Copyright (C) 1988-1995, 1997, 1999-2012 Free Software Foundation, Inc. @@ -237,7 +237,7 @@ If the result is non-nil, then break. Errors are ignored." (defun get-edebug-spec (symbol) ;; Get the spec of symbol resolving all indirection. - (let ((edebug-form-spec nil) + (let ((spec nil) (indirect symbol)) (while (progn @@ -245,9 +245,8 @@ If the result is non-nil, then break. Errors are ignored." (setq indirect (function-get indirect 'edebug-form-spec 'macro)))) ;; (edebug-trace "indirection: %s" edebug-form-spec) - (setq edebug-form-spec indirect)) - edebug-form-spec - )) + (setq spec indirect)) + spec)) ;;;###autoload (defun edebug-basic-spec (spec) @@ -337,9 +336,7 @@ A lambda list keyword is a symbol that starts with `&'." (lambda (e1 e2) (funcall function (car e1) (car e2)))))) -;;(def-edebug-spec edebug-save-restriction t) - -;; Not used. If it is used, def-edebug-spec must be defined before use. +;; Not used. '(defmacro edebug-save-restriction (&rest body) "Evaluate BODY while saving the current buffers restriction. BODY may change buffer outside of current restriction, unlike @@ -347,6 +344,7 @@ save-restriction. BODY may change the current buffer, and the restriction will be restored to the original buffer, and the current buffer remains current. Return the result of the last expression in BODY." + (declare (debug t)) `(let ((edebug:s-r-beg (point-min-marker)) (edebug:s-r-end (point-max-marker))) (unwind-protect @@ -621,19 +619,19 @@ already is one.)" ;; The internal data that is needed for edebugging is kept in the ;; buffer-local variable `edebug-form-data'. -(make-variable-buffer-local 'edebug-form-data) +(defvar-local edebug-form-data nil + "A list of entries associating symbols with buffer regions. +This is an automatic buffer local variable. Each entry looks like: +\(SYMBOL BEGIN-MARKER END-MARKER). The markers +are at the beginning and end of an entry level form and SYMBOL is +a symbol that holds all edebug related information for the form on its +property list. -(defvar edebug-form-data nil) -;; A list of entries associating symbols with buffer regions. -;; This is an automatic buffer local variable. Each entry looks like: -;; @code{(@var{symbol} @var{begin-marker} @var{end-marker}). The markers -;; are at the beginning and end of an entry level form and @var{symbol} is -;; a symbol that holds all edebug related information for the form on its -;; property list. +In the future (haha!), the symbol will be irrelevant and edebug data will +be stored in the definitions themselves rather than in the property +list of a symbol.") -;; In the future, the symbol will be irrelevant and edebug data will -;; be stored in the definitions themselves rather than in the property -;; list of a symbol. +;; FIXME: Use cl-defstruct. (defun edebug-make-form-data-entry (symbol begin end) (list symbol begin end)) @@ -648,7 +646,7 @@ already is one.)" (nth 2 entry)) (defsubst edebug-set-form-data-entry (entry name begin end) - (setcar entry name);; in case name is changed + (setcar entry name) ;; In case name is changed. (set-marker (nth 1 entry) begin) (set-marker (nth 2 entry) end)) @@ -1081,7 +1079,8 @@ already is one.)" ;; If it gets an error, make it nil. (let ((temp-hook edebug-setup-hook)) (setq edebug-setup-hook nil) - (run-hooks 'temp-hook)) + (if (functionp temp-hook) (funcall temp-hook) + (mapc #'funcall temp-hook))) (let (result edebug-top-window-data @@ -1218,8 +1217,8 @@ already is one.)" (defvar edebug-offset-list) ; the list of offset positions. (defun edebug-inc-offset (offset) - ;; modifies edebug-offset-index and edebug-offset-list - ;; accesses edebug-func-marc and buffer point + ;; Modifies edebug-offset-index and edebug-offset-list + ;; accesses edebug-func-marc and buffer point. (prog1 edebug-offset-index (setq edebug-offset-list (cons (- offset edebug-form-begin-marker) @@ -1232,13 +1231,11 @@ already is one.)" ;; given FORM. Looks like: ;; (edebug-after (edebug-before BEFORE-INDEX) AFTER-INDEX FORM) ;; Also increment the offset index for subsequent use. - (list 'edebug-after - (list 'edebug-before before-index) - after-index form)) + `(edebug-after (edebug-before ,before-index) ,after-index ,form)) (defun edebug-make-after-form (form after-index) ;; Like edebug-make-before-and-after-form, but only after. - (list 'edebug-after 0 after-index form)) + `(edebug-after 0 ,after-index ,form)) (defun edebug-unwrap (sexp) @@ -1514,18 +1511,18 @@ expressions; a `progn' form will be returned enclosing these forms." ;; Otherwise it signals an error. The place of the error is found ;; with the two before- and after-offset functions. -(defun edebug-no-match (cursor &rest edebug-args) +(defun edebug-no-match (cursor &rest args) ;; Throw a no-match, or signal an error immediately if gate is active. ;; Remember this point in case we need to report this error. (setq edebug-error-point (or edebug-error-point (edebug-before-offset cursor)) - edebug-best-error (or edebug-best-error edebug-args)) + edebug-best-error (or edebug-best-error args)) (if (and edebug-gate (not edebug-&optional)) (progn (if edebug-error-point (goto-char edebug-error-point)) - (apply 'edebug-syntax-error edebug-args)) - (funcall 'throw 'no-match edebug-args))) + (apply 'edebug-syntax-error args)) + (funcall 'throw 'no-match args))) (defun edebug-match (cursor specs) @@ -1752,7 +1749,7 @@ expressions; a `progn' form will be returned enclosing these forms." specs)))) -(defun edebug-match-gate (cursor) +(defun edebug-match-gate (_cursor) ;; Simply set the gate to prevent backtracking at this level. (setq edebug-gate t) nil) @@ -1841,7 +1838,7 @@ expressions; a `progn' form will be returned enclosing these forms." nil)) -(defun edebug-match-function (cursor) +(defun edebug-match-function (_cursor) (error "Use function-form instead of function in edebug spec")) (defun edebug-match-&define (cursor specs) @@ -1898,7 +1895,7 @@ expressions; a `progn' form will be returned enclosing these forms." (edebug-move-cursor cursor) (list name))) -(defun edebug-match-colon-name (cursor spec) +(defun edebug-match-colon-name (_cursor spec) ;; Set the edebug-def-name to the spec. (setq edebug-def-name (if edebug-def-name @@ -1983,6 +1980,8 @@ expressions; a `progn' form will be returned enclosing these forms." def-body)) ;; FIXME? Isn't this missing the doc-string? Cf defun. (def-edebug-spec defmacro + ;; FIXME: Improve `declare' so we can Edebug gv-expander and + ;; gv-setter declarations. (&define name lambda-list [&optional ("declare" &rest sexp)] def-body)) (def-edebug-spec arglist lambda-list) ;; deprecated - use lambda-list. @@ -2162,10 +2161,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; Dynamically bound variables, declared globally but left unbound. (defvar edebug-function) ; the function being executed. change name!! -(defvar edebug-args) ; the arguments of the function (defvar edebug-data) ; the edebug data for the function -(defvar edebug-value) ; the result of the expression -(defvar edebug-after-index) (defvar edebug-def-mark) ; the mark for the definition (defvar edebug-freq-count) ; the count of expression visits. (defvar edebug-coverage) ; the coverage results of each expression of function. @@ -2191,7 +2187,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;;; Handling signals -(defun edebug-signal (edebug-signal-name edebug-signal-data) +(defun edebug-signal (signal-name signal-data) "Signal an error. Args are SIGNAL-NAME, and associated DATA. A signal name is a symbol with an `error-conditions' property that is a list of condition names. @@ -2205,19 +2201,18 @@ See `condition-case'. This is the Edebug replacement for the standard `signal'. It should only be active while Edebug is. It checks `debug-on-error' to see whether it should call the debugger. When execution is resumed, the -error is signaled again. -\n(fn SIGNAL-NAME DATA)" - (if (and (listp debug-on-error) (memq edebug-signal-name debug-on-error)) - (edebug 'error (cons edebug-signal-name edebug-signal-data))) +error is signaled again." + (if (and (listp debug-on-error) (memq signal-name debug-on-error)) + (edebug 'error (cons signal-name signal-data))) ;; If we reach here without another non-local exit, then send signal again. ;; i.e. the signal is not continuable, yet. ;; Avoid infinite recursion. (let ((signal-hook-function nil)) - (signal edebug-signal-name edebug-signal-data))) + (signal signal-name signal-data))) ;;; Entering Edebug -(defun edebug-enter (edebug-function edebug-args edebug-body) +(defun edebug-enter (function args body) ;; Entering FUNC. The arguments are ARGS, and the body is BODY. ;; Setup edebug variables and evaluate BODY. This function is called ;; when a function evaluated with edebug-eval-top-level-form is entered. @@ -2226,50 +2221,51 @@ error is signaled again. ;; Is this the first time we are entering edebug since ;; lower-level recursive-edit command? ;; More precisely, this tests whether Edebug is currently active. - (if (not edebug-entered) - (let ((edebug-entered t) - ;; Binding max-lisp-eval-depth here is OK, - ;; but not inside an unwind-protect. - ;; Doing it here also keeps it from growing too large. - (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? - (max-specpdl-size (+ 200 max-specpdl-size)) - - (debugger edebug-debugger) ; only while edebug is active. - (edebug-outside-debug-on-error debug-on-error) - (edebug-outside-debug-on-quit debug-on-quit) - ;; Binding these may not be the right thing to do. - ;; We want to allow the global values to be changed. - (debug-on-error (or debug-on-error edebug-on-error)) - (debug-on-quit edebug-on-quit) - - ;; Lexical bindings must be uncompiled for this to work. - (cl-lexical-debug t)) - (unwind-protect - (let ((signal-hook-function 'edebug-signal)) - (setq edebug-execution-mode (or edebug-next-execution-mode - edebug-initial-mode - edebug-execution-mode) - edebug-next-execution-mode nil) - (edebug-enter edebug-function edebug-args edebug-body)))) - - (let* ((edebug-data (get edebug-function 'edebug)) - (edebug-def-mark (car edebug-data)) ; mark at def start - (edebug-freq-count (get edebug-function 'edebug-freq-count)) - (edebug-coverage (get edebug-function 'edebug-coverage)) - (edebug-buffer (marker-buffer edebug-def-mark)) - - (edebug-stack (cons edebug-function edebug-stack)) - (edebug-offset-indices (cons 0 edebug-offset-indices)) - ) - (if (get edebug-function 'edebug-on-entry) - (progn - (setq edebug-execution-mode 'step) - (if (eq (get edebug-function 'edebug-on-entry) 'temp) - (put edebug-function 'edebug-on-entry nil)))) - (if edebug-trace - (edebug-enter-trace edebug-body) - (funcall edebug-body)) - ))) + (let ((edebug-function function)) + (if (not edebug-entered) + (let ((edebug-entered t) + ;; Binding max-lisp-eval-depth here is OK, + ;; but not inside an unwind-protect. + ;; Doing it here also keeps it from growing too large. + (max-lisp-eval-depth (+ 100 max-lisp-eval-depth)) ; too much?? + (max-specpdl-size (+ 200 max-specpdl-size)) + + (debugger edebug-debugger) ; only while edebug is active. + (edebug-outside-debug-on-error debug-on-error) + (edebug-outside-debug-on-quit debug-on-quit) + ;; Binding these may not be the right thing to do. + ;; We want to allow the global values to be changed. + (debug-on-error (or debug-on-error edebug-on-error)) + (debug-on-quit edebug-on-quit) + + ;; Lexical bindings must be uncompiled for this to work. + (cl-lexical-debug t)) + (unwind-protect + (let ((signal-hook-function 'edebug-signal)) + (setq edebug-execution-mode (or edebug-next-execution-mode + edebug-initial-mode + edebug-execution-mode) + edebug-next-execution-mode nil) + (edebug-enter function args body)))) + + (let* ((edebug-data (get function 'edebug)) + (edebug-def-mark (car edebug-data)) ; mark at def start + (edebug-freq-count (get function 'edebug-freq-count)) + (edebug-coverage (get function 'edebug-coverage)) + (edebug-buffer (marker-buffer edebug-def-mark)) + + (edebug-stack (cons function edebug-stack)) + (edebug-offset-indices (cons 0 edebug-offset-indices)) + ) + (if (get function 'edebug-on-entry) + (progn + (setq edebug-execution-mode 'step) + (if (eq (get function 'edebug-on-entry) 'temp) + (put function 'edebug-on-entry nil)))) + (if edebug-trace + (edebug--enter-trace function args body) + (funcall body)) + )))) (defun edebug-var-status (var) "Return a cons cell describing the status of VAR's current binding. @@ -2296,14 +2292,14 @@ STATUS should be a list returned by `edebug-var-status'." (t (set var value))))) -(defun edebug-enter-trace (edebug-body) +(defun edebug--enter-trace (function args body) (let ((edebug-stack-depth (1+ edebug-stack-depth)) edebug-result) (edebug-print-trace-before - (format "%s args: %s" edebug-function edebug-args)) - (prog1 (setq edebug-result (funcall edebug-body)) + (format "%s args: %s" function args)) + (prog1 (setq edebug-result (funcall body)) (edebug-print-trace-after - (format "%s result: %s" edebug-function edebug-result))))) + (format "%s result: %s" function edebug-result))))) (def-edebug-spec edebug-tracing (form body)) @@ -2331,49 +2327,49 @@ MSG is printed after `::::} '." -(defun edebug-slow-before (edebug-before-index) +(defun edebug-slow-before (before-index) (unless edebug-active ;; Debug current function given BEFORE position. ;; Called from functions compiled with edebug-eval-top-level-form. ;; Return the before index. - (setcar edebug-offset-indices edebug-before-index) + (setcar edebug-offset-indices before-index) ;; Increment frequency count - (aset edebug-freq-count edebug-before-index - (1+ (aref edebug-freq-count edebug-before-index))) + (aset edebug-freq-count before-index + (1+ (aref edebug-freq-count before-index))) (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) (edebug-input-pending-p)) - (edebug-debugger edebug-before-index 'before nil))) - edebug-before-index) + (edebug-debugger before-index 'before nil))) + before-index) -(defun edebug-fast-before (edebug-before-index) +(defun edebug-fast-before (_before-index) ;; Do nothing. ) -(defun edebug-slow-after (edebug-before-index edebug-after-index edebug-value) +(defun edebug-slow-after (_before-index after-index value) (if edebug-active - edebug-value + value ;; Debug current function given AFTER position and VALUE. ;; Called from functions compiled with edebug-eval-top-level-form. ;; Return VALUE. - (setcar edebug-offset-indices edebug-after-index) + (setcar edebug-offset-indices after-index) ;; Increment frequency count - (aset edebug-freq-count edebug-after-index - (1+ (aref edebug-freq-count edebug-after-index))) - (if edebug-test-coverage (edebug-update-coverage)) + (aset edebug-freq-count after-index + (1+ (aref edebug-freq-count after-index))) + (if edebug-test-coverage (edebug--update-coverage after-index value)) (if (and (eq edebug-execution-mode 'Go-nonstop) (not (edebug-input-pending-p))) ;; Just return result. - edebug-value - (edebug-debugger edebug-after-index 'after edebug-value) + value + (edebug-debugger after-index 'after value) ))) -(defun edebug-fast-after (edebug-before-index edebug-after-index edebug-value) +(defun edebug-fast-after (_before-index _after-index value) ;; Do nothing but return the value. - edebug-value) + value) (defun edebug-run-slow () (defalias 'edebug-before 'edebug-slow-before) @@ -2387,19 +2383,18 @@ MSG is printed after `::::} '." (edebug-run-slow) -(defun edebug-update-coverage () - (let ((old-result (aref edebug-coverage edebug-after-index))) +(defun edebug--update-coverage (after-index value) + (let ((old-result (aref edebug-coverage after-index))) (cond ((eq 'ok-coverage old-result)) ((eq 'unknown old-result) - (aset edebug-coverage edebug-after-index edebug-value)) + (aset edebug-coverage after-index value)) ;; Test if a different result. - ((not (eq edebug-value old-result)) - (aset edebug-coverage edebug-after-index 'ok-coverage))))) + ((not (eq value old-result)) + (aset edebug-coverage after-index 'ok-coverage))))) ;; Dynamically declared unbound variables. -(defvar edebug-arg-mode) ; the mode, either before, after, or error (defvar edebug-breakpoints) (defvar edebug-break-data) ; break data for current function. (defvar edebug-break) ; whether a break occurred. @@ -2410,16 +2405,16 @@ MSG is printed after `::::} '." (defvar edebug-global-break-result nil) -(defun edebug-debugger (edebug-offset-index edebug-arg-mode edebug-value) +(defun edebug-debugger (offset-index arg-mode value) (if inhibit-redisplay ;; Don't really try to enter edebug within an eval from redisplay. - edebug-value + value ;; Check breakpoints and pending input. - ;; If edebug display should be updated, call edebug-display. - ;; Return edebug-value. + ;; If edebug display should be updated, call edebug--display. + ;; Return value. (let* ( ;; This needs to be here since breakpoints may be changed. (edebug-breakpoints (car (cdr edebug-data))) ; list of breakpoints - (edebug-break-data (assq edebug-offset-index edebug-breakpoints)) + (edebug-break-data (assq offset-index edebug-breakpoints)) (edebug-break-condition (car (cdr edebug-break-data))) (edebug-global-break (if edebug-global-break-condition @@ -2430,7 +2425,7 @@ MSG is printed after `::::} '." (error nil)))) (edebug-break)) -;;; (edebug-trace "exp: %s" edebug-value) + ;;(edebug-trace "exp: %s" value) ;; Test whether we should break. (setq edebug-break (or edebug-global-break @@ -2451,10 +2446,9 @@ MSG is printed after `::::} '." (if (or (not (memq edebug-execution-mode '(go continue Continue-fast))) edebug-break (edebug-input-pending-p)) - (edebug-display)) ; <--------------- display + (edebug--display value offset-index arg-mode)) ; <---------- display - edebug-value - ))) + value))) ;; window-start now stored with each function. @@ -2487,7 +2481,7 @@ MSG is printed after `::::} '." (defalias 'edebug-mark-marker 'mark-marker) -(defun edebug-display () +(defun edebug--display (value offset-index arg-mode) (unless (marker-position edebug-def-mark) ;; The buffer holding the source has been killed. ;; Let's at least show a backtrace so the user can figure out @@ -2496,11 +2490,11 @@ MSG is printed after `::::} '." ;; Setup windows for edebug, determine mode, maybe enter recursive-edit. ;; Uses local variables of edebug-enter, edebug-before, edebug-after ;; and edebug-debugger. - (let ((edebug-active t) ; for minor mode alist + (let ((edebug-active t) ; For minor mode alist. (edebug-with-timeout-suspend (with-timeout-suspend)) - edebug-stop ; should we enter recursive-edit + edebug-stop ; Should we enter recursive-edit? (edebug-point (+ edebug-def-mark - (aref (nth 2 edebug-data) edebug-offset-index))) + (aref (nth 2 edebug-data) offset-index))) edebug-buffer-outside-point ; current point in edebug-buffer ;; window displaying edebug-buffer (edebug-window-data (nth 3 edebug-data)) @@ -2509,12 +2503,12 @@ MSG is printed after `::::} '." (edebug-outside-point (point)) (edebug-outside-mark (edebug-mark)) (edebug-outside-unread-command-events unread-command-events) - edebug-outside-windows ; window or screen configuration + edebug-outside-windows ; Window or screen configuration. edebug-buffer-points - edebug-eval-buffer ; declared here so we can kill it below - (edebug-eval-result-list (and edebug-eval-list - (edebug-eval-result-list))) + edebug-eval-buffer ; Declared here so we can kill it below. + (eval-result-list (and edebug-eval-list + (edebug-eval-result-list))) edebug-trace-window edebug-trace-window-start @@ -2535,9 +2529,9 @@ MSG is printed after `::::} '." (let ((debug-on-error nil)) (error "Buffer defining %s not found" edebug-function))) - (if (eq 'after edebug-arg-mode) + (if (eq 'after arg-mode) ;; Compute result string now before windows are modified. - (edebug-compute-previous-result edebug-value)) + (edebug-compute-previous-result value)) (if edebug-save-windows ;; Save windows now before we modify them. @@ -2561,7 +2555,7 @@ MSG is printed after `::::} '." ;; Now display eval list, if any. ;; This is done after the pop to edebug-buffer ;; so that buffer-window correspondence is correct after quitting. - (edebug-eval-display edebug-eval-result-list) + (edebug-eval-display eval-result-list) ;; The evaluation list better not have deleted edebug-window-data. (select-window (car edebug-window-data)) (set-buffer edebug-buffer) @@ -2569,7 +2563,7 @@ MSG is printed after `::::} '." (setq edebug-buffer-outside-point (point)) (goto-char edebug-point) - (if (eq 'before edebug-arg-mode) + (if (eq 'before arg-mode) ;; Check whether positions are up-to-date. ;; This assumes point is never before symbol. (if (not (memq (following-char) '(?\( ?\# ?\` ))) @@ -2593,14 +2587,14 @@ MSG is printed after `::::} '." (edebug-overlay-arrow) (cond - ((eq 'error edebug-arg-mode) + ((eq 'error arg-mode) ;; Display error message (setq edebug-execution-mode 'step) (edebug-overlay-arrow) (beep) - (if (eq 'quit (car edebug-value)) + (if (eq 'quit (car value)) (message "Quit") - (edebug-report-error edebug-value))) + (edebug-report-error value))) (edebug-break (cond (edebug-global-break @@ -2618,7 +2612,7 @@ MSG is printed after `::::} '." (t (message ""))) (setq unread-command-events nil) - (if (eq 'after edebug-arg-mode) + (if (eq 'after arg-mode) (progn ;; Display result of previous evaluation. (if (and edebug-break @@ -2642,11 +2636,11 @@ MSG is printed after `::::} '." (unwind-protect (if (or edebug-stop (memq edebug-execution-mode '(step next)) - (eq edebug-arg-mode 'error)) + (eq arg-mode 'error)) (progn ;; (setq edebug-execution-mode 'step) ;; (edebug-overlay-arrow) ; This doesn't always show up. - (edebug-recursive-edit))) ; <---------- Recursive edit + (edebug--recursive-edit arg-mode))) ; <----- Recursive edit ;; Reset the edebug-window-data to whatever it is now. (let ((window (if (eq (window-buffer) edebug-buffer) @@ -2775,7 +2769,7 @@ MSG is printed after `::::} '." (defvar edebug-outside-last-nonmenu-event) (defvar edebug-outside-track-mouse) -(defun edebug-recursive-edit () +(defun edebug--recursive-edit (arg-mode) ;; Start up a recursive edit inside of edebug. ;; The current buffer is the edebug-buffer, which is put into edebug-mode. ;; Assume that none of the variables below are buffer-local. @@ -2866,7 +2860,7 @@ MSG is printed after `::::} '." ) (if (and (eq edebug-execution-mode 'go) - (not (memq edebug-arg-mode '(after error)))) + (not (memq arg-mode '(after error)))) (message "Break")) (setq buffer-read-only t) @@ -3082,7 +3076,7 @@ before returning. The default is one second." ;; Joe Wells, here is a start at your idea of adding a buffer to the internal -;; display list. Still need to use this list in edebug-display. +;; display list. Still need to use this list in edebug--display. '(defvar edebug-display-buffer-list nil "List of buffers that edebug will display when it is active.") @@ -3517,11 +3511,10 @@ edebug-mode." ;;; Evaluation of expressions -(def-edebug-spec edebug-outside-excursion t) - (defmacro edebug-outside-excursion (&rest body) "Evaluate an expression list in the outside context. Return the result of the last expression." + (declare (debug t)) `(save-excursion ; of current-buffer (if edebug-save-windows (progn @@ -3555,7 +3548,7 @@ Return the result of the last expression." (pre-command-hook (cdr edebug-outside-pre-command-hook)) (post-command-hook (cdr edebug-outside-post-command-hook)) - ;; See edebug-display + ;; See edebug-display. (overlay-arrow-position edebug-outside-o-a-p) (overlay-arrow-string edebug-outside-o-a-s) (cursor-in-echo-area edebug-outside-c-i-e-a) @@ -3609,18 +3602,18 @@ Return the result of the last expression." (defvar cl-debug-env) ; defined in cl; non-nil when lexical env used. -(defun edebug-eval (edebug-expr) +(defun edebug-eval (expr) ;; Are there cl lexical variables active? (eval (if (bound-and-true-p cl-debug-env) - (cl-macroexpand-all edebug-expr cl-debug-env) - edebug-expr) + (cl-macroexpand-all expr cl-debug-env) + expr) lexical-binding)) -(defun edebug-safe-eval (edebug-expr) +(defun edebug-safe-eval (expr) ;; Evaluate EXPR safely. ;; If there is an error, a string is returned describing the error. (condition-case edebug-err - (edebug-eval edebug-expr) + (edebug-eval expr) (error (edebug-format "%s: %s" ;; could (get (car edebug-err) 'error-message) (car (cdr edebug-err)))))) @@ -3628,17 +3621,17 @@ Return the result of the last expression." ;;; Printing -(defun edebug-report-error (edebug-value) +(defun edebug-report-error (value) ;; Print an error message like command level does. ;; This also prints the error name if it has no error-message. (message "%s: %s" - (or (get (car edebug-value) 'error-message) - (format "peculiar error (%s)" (car edebug-value))) + (or (get (car value) 'error-message) + (format "peculiar error (%s)" (car value))) (mapconcat (function (lambda (edebug-arg) ;; continuing after an error may ;; complain about edebug-arg. why?? (prin1-to-string edebug-arg))) - (cdr edebug-value) ", "))) + (cdr value) ", "))) (defvar print-readably) ; defined by lemacs ;; Alternatively, we could change the definition of @@ -3654,14 +3647,14 @@ Return the result of the last expression." (edebug-prin1-to-string value) (error "#Apparently circular structure#")))) -(defun edebug-compute-previous-result (edebug-previous-value) +(defun edebug-compute-previous-result (previous-value) (if edebug-unwrap-results - (setq edebug-previous-value - (edebug-unwrap* edebug-previous-value))) + (setq previous-value + (edebug-unwrap* previous-value))) (setq edebug-previous-result (concat "Result: " - (edebug-safe-prin1-to-string edebug-previous-value) - (eval-expression-print-format edebug-previous-value)))) + (edebug-safe-prin1-to-string previous-value) + (eval-expression-print-format previous-value)))) (defun edebug-previous-result () "Print the previous result." @@ -3676,7 +3669,7 @@ Return the result of the last expression." (defalias 'edebug-format 'format) (defalias 'edebug-message 'message) -(defun edebug-eval-expression (edebug-expr) +(defun edebug-eval-expression (expr) "Evaluate an expression in the outside environment. If interactive, prompt for the expression. Print result in minibuffer." @@ -3685,7 +3678,7 @@ Print result in minibuffer." 'read-expression-history))) (princ (edebug-outside-excursion - (setq values (cons (edebug-eval edebug-expr) values)) + (setq values (cons (edebug-eval expr) values)) (concat (edebug-safe-prin1-to-string (car values)) (eval-expression-print-format (car values)))))) @@ -3699,14 +3692,14 @@ Print value in minibuffer." "Evaluate sexp before point in outside environment; insert value. This prints the value into current buffer." (interactive) - (let* ((edebug-form (edebug-last-sexp)) - (edebug-result-string + (let* ((form (edebug-last-sexp)) + (result-string (edebug-outside-excursion - (edebug-safe-prin1-to-string (edebug-safe-eval edebug-form)))) + (edebug-safe-prin1-to-string (edebug-safe-eval form)))) (standard-output (current-buffer))) (princ "\n") ;; princ the string to get rid of quotes. - (princ edebug-result-string) + (princ result-string) (princ "\n") )) @@ -3898,20 +3891,17 @@ Options: (edebug-trace nil)) (mapcar 'edebug-safe-eval edebug-eval-list))) -(defun edebug-eval-display-list (edebug-eval-result-list) +(defun edebug-eval-display-list (eval-result-list) ;; Assumes edebug-eval-buffer exists. - (let ((edebug-eval-list-temp edebug-eval-list) - (standard-output edebug-eval-buffer) + (let ((standard-output edebug-eval-buffer) (edebug-comment-line (format ";%s\n" (make-string (- (window-width) 2) ?-)))) (set-buffer edebug-eval-buffer) (erase-buffer) - (while edebug-eval-list-temp - (prin1 (car edebug-eval-list-temp)) (terpri) - (prin1 (car edebug-eval-result-list)) (terpri) - (princ edebug-comment-line) - (setq edebug-eval-list-temp (cdr edebug-eval-list-temp)) - (setq edebug-eval-result-list (cdr edebug-eval-result-list))) + (dolist (exp edebug-eval-list) + (prin1 exp) (terpri) + (prin1 (pop eval-result-list)) (terpri) + (princ edebug-comment-line)) (edebug-pop-to-buffer edebug-eval-buffer) )) @@ -3924,18 +3914,16 @@ Options: ;; Should generalize this to be callable outside of edebug ;; with calls in user functions, e.g. (edebug-eval-display) -(defun edebug-eval-display (edebug-eval-result-list) - "Display expressions and evaluations in EDEBUG-EVAL-RESULT-LIST. +(defun edebug-eval-display (eval-result-list) + "Display expressions and evaluations in EVAL-RESULT-LIST. It modifies the context by popping up the eval display." - (if edebug-eval-result-list - (progn - (edebug-create-eval-buffer) - (edebug-eval-display-list edebug-eval-result-list) - ))) + (when eval-result-list + (edebug-create-eval-buffer) + (edebug-eval-display-list eval-result-list))) (defun edebug-eval-redisplay () "Redisplay eval list in outside environment. -May only be called from within `edebug-recursive-edit'." +May only be called from within `edebug--recursive-edit'." (edebug-create-eval-buffer) (edebug-outside-excursion (edebug-eval-display-list (edebug-eval-result-list)) @@ -3997,8 +3985,8 @@ May only be called from within `edebug-recursive-edit'." (define-key map "\C-c\C-u" 'edebug-update-eval-list) (define-key map "\C-x\C-e" 'edebug-eval-last-sexp) (define-key map "\C-j" 'edebug-eval-print-last-sexp) - map) -"Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") + map) + "Keymap for Edebug Eval mode. Superset of Lisp Interaction mode.") (put 'edebug-eval-mode 'mode-class 'special) @@ -4025,32 +4013,32 @@ Global commands prefixed by `global-edebug-prefix': ;; since they depend on the backtrace looking a certain way. But ;; edebug is not dependent on this, yet. -(defun edebug (&optional edebug-arg-mode &rest debugger-args) +(defun edebug (&optional arg-mode &rest args) "Replacement for `debug'. If we are running an edebugged function, show where we last were. Otherwise call `debug' normally." -;; (message "entered: %s depth: %s edebug-recursion-depth: %s" -;; edebug-entered (recursion-depth) edebug-recursion-depth) (sit-for 1) + ;;(message "entered: %s depth: %s edebug-recursion-depth: %s" + ;; edebug-entered (recursion-depth) edebug-recursion-depth) (sit-for 1) (if (and edebug-entered ; anything active? (eq (recursion-depth) edebug-recursion-depth)) (let (;; Where were we before the error occurred? - (edebug-offset-index (car edebug-offset-indices)) - ;; Bind variables required by edebug-display - (edebug-value (car debugger-args)) + (offset-index (car edebug-offset-indices)) + (value (car args)) + ;; Bind variables required by edebug--display. edebug-breakpoints edebug-break-data edebug-break-condition edebug-global-break - (edebug-break (null edebug-arg-mode)) ;; if called explicitly + (edebug-break (null arg-mode)) ;; If called explicitly. ) - (edebug-display) - (if (eq edebug-arg-mode 'error) + (edebug--display value offset-index arg-mode) + (if (eq arg-mode 'error) nil - edebug-value)) + value)) ;; Otherwise call debug normally. ;; Still need to remove extraneous edebug calls from stack. - (apply 'debug edebug-arg-mode debugger-args) + (apply 'debug arg-mode args) )) @@ -4061,7 +4049,7 @@ Otherwise call `debug' normally." (null (buffer-name edebug-backtrace-buffer))) (setq edebug-backtrace-buffer (generate-new-buffer "*Backtrace*")) - ;; else, could just display edebug-backtrace-buffer + ;; Else, could just display edebug-backtrace-buffer. ) (with-output-to-temp-buffer (buffer-name edebug-backtrace-buffer) (setq edebug-backtrace-buffer standard-output) @@ -4083,7 +4071,7 @@ Otherwise call `debug' normally." (beginning-of-line) (cond ((looking-at "^ \(edebug-after") - ;; Previous lines may contain code, so just delete this line + ;; Previous lines may contain code, so just delete this line. (setq last-ok-point (point)) (forward-line 1) (delete-region last-ok-point (point))) -- cgit v1.2.3 From c0c54fbddf0784b84b04f38aabee47067a920863 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 12 Sep 2012 22:29:05 -0400 Subject: * lisp/emacs-lisp/edebug.el (edebug-outside-unread-command-events): Fix last change. (edebug-update-eval-list): Use `push'. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/edebug.el | 13 ++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0bbd7558bc..89cc2106ba0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2012-09-13 Stefan Monnier + * emacs-lisp/edebug.el (edebug-outside-unread-command-events): + Fix last change. + (edebug-update-eval-list): Use `push'. + * emacs-lisp/edebug.el: Use lexical-binding. Remove the "edebug-" prefix from non-dynamically-scoped variables. Mark unused args with underscore. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 42260d12a82..8f0f24ad092 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2480,6 +2480,7 @@ MSG is printed after `::::} '." ;; Emacs 19 adds an arg to mark and mark-marker. (defalias 'edebug-mark-marker 'mark-marker) +(defvar edebug-outside-unread-command-events) (defun edebug--display (value offset-index arg-mode) (unless (marker-position edebug-def-mark) @@ -2763,7 +2764,6 @@ MSG is printed after `::::} '." ;; Emacs 19. (defvar edebug-outside-last-command-event) -(defvar edebug-outside-unread-command-events) (defvar edebug-outside-last-input-event) (defvar edebug-outside-last-event-frame) (defvar edebug-outside-last-nonmenu-event) @@ -3906,10 +3906,9 @@ Options: )) (defun edebug-create-eval-buffer () - (if (not (and edebug-eval-buffer (buffer-name edebug-eval-buffer))) - (progn - (set-buffer (setq edebug-eval-buffer (get-buffer-create "*edebug*"))) - (edebug-eval-mode)))) + (unless (and edebug-eval-buffer (buffer-name edebug-eval-buffer)) + (set-buffer (setq edebug-eval-buffer (get-buffer-create "*edebug*"))) + (edebug-eval-mode))) ;; Should generalize this to be callable outside of edebug ;; with calls in user functions, e.g. (edebug-eval-display) @@ -3947,7 +3946,7 @@ May only be called from within `edebug--recursive-edit'." (if (not (eobp)) (progn (forward-sexp 1) - (setq new-list (cons (edebug-last-sexp) new-list)))) + (push (edebug-last-sexp) new-list))) (while (re-search-forward "^;" nil t) (forward-line 1) @@ -3956,7 +3955,7 @@ May only be called from within `edebug--recursive-edit'." (not (eobp))) (progn (forward-sexp 1) - (setq new-list (cons (edebug-last-sexp) new-list))))) + (push (edebug-last-sexp) new-list)))) (setq edebug-eval-list (nreverse new-list)) (edebug-eval-redisplay) -- cgit v1.2.3 From 2168fe4f2ad6ea4320a0da7976294b0cdade1a20 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 12 Sep 2012 22:41:46 -0400 Subject: byte-compile-warning-prefix tweak * lisp/emacs-lisp/bytecomp.el (byte-compile-warning-prefix): If not compiling a file, try using load-file-name. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bytecomp.el | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 89cc2106ba0..41dc46021f6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-13 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-compile-warning-prefix): + If not compiling a file, try using load-file-name. + 2012-09-13 Stefan Monnier * emacs-lisp/edebug.el (edebug-outside-unread-command-events): diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 10bc37c6dcd..c42ae21aae5 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1016,6 +1016,10 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ((bufferp byte-compile-current-file) (format "Buffer %s:" (buffer-name byte-compile-current-file))) + ;; We might be simply loading a file that + ;; contains explicit calls to byte-compile functions. + ((stringp load-file-name) + (format "%s:" (file-relative-name load-file-name dir))) (t ""))) (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) -- cgit v1.2.3 From c18e885bdd2607ec1784c3e1585e581459408932 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 13 Sep 2012 09:23:06 -0700 Subject: Use a more backwards-compatible timer format. * etc/NEWS: Document it. * lisp/emacs-lisp/timer.el (timer): PSECS is now at the end, rather than being right after USECS, as that better supports old code that inadvisedly looked directly at the timer vector. * src/keyboard.c (decode_timer): Get PSECS from the 8th (origin-0) vector element, not from the 4th, since PSECS is now at the end. (Fcurrent_idle_time): Doc fix. Fixes: debbugs:12430 --- etc/ChangeLog | 5 +++++ etc/NEWS | 2 +- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/timer.el | 6 +++--- src/ChangeLog | 7 +++++++ src/keyboard.c | 4 ++-- 6 files changed, 25 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/etc/ChangeLog b/etc/ChangeLog index 26e9ada74da..66c229eaf78 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * NEWS: Document it, plus fix a typo. + 2012-09-13 Jan Djärv * NEWS (--with-x-toolkit): Mention that Gtk+ 3 is now default. diff --git a/etc/NEWS b/etc/NEWS index cbf13c2e87d..4c6ceae1688 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -110,7 +110,7 @@ file-attributes and format-time-string, have been changed accordingly. Old-format time stamps are still accepted. ** The format of timers in timer-list and timer-idle-list is now -[HIGH-SECONDS LOW-SECONDS USECS PSECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY]. +[TRIGGERED-P HI-SECS LO-SECS USECS REPEAT-DELAY FUNCTION ARGS IDLE-DELAY PSECS]. The PSECS slot is new, and uses picosecond resolution. It can be accessed via the new timer--psecs accessor. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6b132bb9134..5e51c67e8e8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * emacs-lisp/timer.el (timer): PSECS is now at the end, rather than + being right after USECS, as that better supports old code that + inadvisedly looked directly at the timer vector. + 2012-09-13 Kenichi Handa * language/chinese.el ("Chinese-GB", "Chinese-BIG5") diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index a66d5972d82..2248dde8c03 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -28,8 +28,8 @@ ;;; Code: ;; Layout of a timer vector: -;; [triggered-p high-seconds low-seconds usecs psecs repeat-delay -;; function args idle-delay] +;; [triggered-p high-seconds low-seconds usecs repeat-delay +;; function args idle-delay psecs] ;; triggered-p is nil if the timer is active (waiting to be triggered), ;; t if it is inactive ("already triggered", in theory) @@ -42,7 +42,7 @@ (:type vector) (:conc-name timer--)) (triggered t) - high-seconds low-seconds usecs psecs repeat-delay function args idle-delay) + high-seconds low-seconds usecs repeat-delay function args idle-delay psecs) (defun timerp (object) "Return t if OBJECT is a timer." diff --git a/src/ChangeLog b/src/ChangeLog index 153a0b59c62..a7fe68646d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2012-09-13 Paul Eggert + + Use a more backwards-compatible timer format (Bug#12430). + * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0) + vector element, not from the 4th, since PSECS is now at the end. + (Fcurrent_idle_time): Doc fix. + 2012-09-13 Dmitry Antipov Function to mark objects and remove killed buffers at once. diff --git a/src/keyboard.c b/src/keyboard.c index aec9028ae94..45638bc412b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4330,7 +4330,7 @@ decode_timer (Lisp_Object timer, EMACS_TIME *result) if (! NILP (vector[0])) return 0; - return decode_time_components (vector[1], vector[2], vector[3], vector[4], + return decode_time_components (vector[1], vector[2], vector[3], vector[8], result, 0); } @@ -4532,7 +4532,7 @@ in the same style as (current-time). The value when Emacs is not idle is nil. -NSEC is a multiple of the system clock resolution. */) +PSEC is a multiple of the system clock resolution. */) (void) { if (EMACS_TIME_VALID_P (timer_idleness_start_time)) -- cgit v1.2.3 From 2de39f089a464cc265b6c583684226d1a94abbfa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 13 Sep 2012 23:55:16 -0400 Subject: * lisp/emacs-lisp/edebug.el: Miscellaneous cleanup. Remove obsolete byte-compiler hack that tried to silence some warnings. (edebug-submit-bug-report): Remove. (edebug-get-buffer-window, edebug-sit-for, edebug-input-pending-p): Remove aliases, use the un-prefixed name instead. (edebug-pop-to-buffer): Consider other frames. (edebug-original-read):: Make it more obvious that it's always defined. (edebug--make-form-data-entry, edebug--form-data-name) (edebug--form-data-begin, edebug--form-data-end): Rename from the single-dashed name, and implement with cl-defstruct. (edebug-set-form-data-entry): Use the standard accessors. (edebug-make-top-form-data-entry): Use push. (edebug-no-match): Drop useless `funcall'. (mapcar, mapconcat, mapatoms, apply, funcall): Don't add debug specs to functions. (defsubst, dont-compile, eval-when-compile, eval-and-compile) (delay-mode-hooks, with-temp-file, with-temp-message, ad-dolist) (with-syntax-table, push, pop, 1value, noreturn, defadvice) (easy-menu-define, with-custom-print): Remove redundant specs. (edebug-outside-overriding-local-map) (edebug-outside-overriding-terminal-local-map): Remove, unused. (edebug--display): Bind unread-command-events directly to nil rather than binding it to unread-command-events and later setting it to nil. (edebug--display): Kill edebug-eval-buffer here... (edebug--recursive-edit): ...rather than here. Bind standard-output and standard-input. (edebug-eval): Check cl-macroexpand-all is fboundp. (edebug-temp-display-freq-count): Fix last change. * lisp/emacs-lisp/easymenu.el (easy-menu-define): Add `debug' spec. * lisp/subr.el (noreturn, 1value): Add `debug' spec. * lisp/emacs-lisp/advice.el: Require cl-lib. (ad-copy-tree): Remove, use copy-tree instead. (ad-dolist): Remove use dolist or cl-dolist instead. (ad-do-return): Remove, use cl-return instead. (defadvice): Add `debug' spec. --- lisp/ChangeLog | 39 +++++++ lisp/dired.el | 2 +- lisp/emacs-lisp/advice.el | 183 ++++++++++++------------------- lisp/emacs-lisp/easymenu.el | 2 +- lisp/emacs-lisp/edebug.el | 261 +++++++++++--------------------------------- lisp/subr.el | 2 + 6 files changed, 180 insertions(+), 309 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 15039358559..7163b4b4989 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,42 @@ +2012-09-14 Stefan Monnier + + * emacs-lisp/edebug.el: Miscellaneous cleanup. + Remove obsolete byte-compiler hack that tried to silence some warnings. + (edebug-submit-bug-report): Remove. + (edebug-get-buffer-window, edebug-sit-for, edebug-input-pending-p): + Remove aliases, use the un-prefixed name instead. + (edebug-pop-to-buffer): Consider other frames. + (edebug-original-read):: Make it more obvious that it's always defined. + (edebug--make-form-data-entry, edebug--form-data-name) + (edebug--form-data-begin, edebug--form-data-end): Rename from the + single-dashed name, and implement with cl-defstruct. + (edebug-set-form-data-entry): Use the standard accessors. + (edebug-make-top-form-data-entry): Use push. + (edebug-no-match): Drop useless `funcall'. + (mapcar, mapconcat, mapatoms, apply, funcall): Don't add debug specs + to functions. + (defsubst, dont-compile, eval-when-compile, eval-and-compile) + (delay-mode-hooks, with-temp-file, with-temp-message, ad-dolist) + (with-syntax-table, push, pop, 1value, noreturn, defadvice) + (easy-menu-define, with-custom-print): Remove redundant specs. + (edebug-outside-overriding-local-map) + (edebug-outside-overriding-terminal-local-map): Remove, unused. + (edebug--display): Bind unread-command-events directly to nil rather + than binding it to unread-command-events and later setting it to nil. + (edebug--display): Kill edebug-eval-buffer here... + (edebug--recursive-edit): ...rather than here. + Bind standard-output and standard-input. + (edebug-eval): Check cl-macroexpand-all is fboundp. + (edebug-temp-display-freq-count): Fix last change. + + * emacs-lisp/easymenu.el (easy-menu-define): Add `debug' spec. + * subr.el (noreturn, 1value): Add `debug' spec. + * emacs-lisp/advice.el: Require cl-lib. + (ad-copy-tree): Remove, use copy-tree instead. + (ad-dolist): Remove use dolist or cl-dolist instead. + (ad-do-return): Remove, use cl-return instead. + (defadvice): Add `debug' spec. + 2012-09-13 Juri Linkov * dired-aux.el (dired-do-chxxx): Use `eq' to detect empty input. diff --git a/lisp/dired.el b/lisp/dired.el index f4ae027181a..ebc8f5da6d5 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3744,7 +3744,7 @@ Ask means pop up a menu for the user to select one of copy, move or link." ;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command ;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown ;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff -;;;;;; dired-diff) "dired-aux" "dired-aux.el" "4b260eda371d319a6c8e8e5ec917e287") +;;;;;; dired-diff) "dired-aux" "dired-aux.el" "22ce64daa7ccb5698cb6b1279aa59ec2") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index cac76d2bce1..f0d277a3f69 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1,4 +1,4 @@ -;;; advice.el --- an overloading mechanism for Emacs Lisp functions +;;; advice.el --- An overloading mechanism for Emacs Lisp functions ;; Copyright (C) 1993-1994, 2000-2012 Free Software Foundation, Inc. @@ -1746,7 +1746,7 @@ (provide 'advice-preload) ;; During a normal load this is a noop: (require 'advice-preload "advice.el") - +(eval-when-compile (require 'cl-lib)) ;; @@ Variable definitions: ;; ======================== @@ -1812,54 +1812,6 @@ generates a copy of TREE." (funcall fUnCtIoN tReE)) (t tReE))) -;; this is just faster than `ad-substitute-tree': -(defun ad-copy-tree (tree) - "Return a copy of the list structure of TREE." - (cond ((consp tree) - (cons (ad-copy-tree (car tree)) - (ad-copy-tree (cdr tree)))) - (t tree))) - -(defmacro ad-dolist (varform &rest body) - "A Common-Lisp-style dolist iterator with the following syntax: - - (ad-dolist (VAR INIT-FORM [RESULT-FORM]) - BODY-FORM...) - -which will iterate over the list yielded by INIT-FORM binding VAR to the -current head at every iteration. If RESULT-FORM is supplied its value will -be returned at the end of the iteration, nil otherwise. The iteration can be -exited prematurely with `(ad-do-return [VALUE])'." - (let ((expansion - `(let ((ad-dO-vAr ,(car (cdr varform))) - ,(car varform)) - (while ad-dO-vAr - (setq ,(car varform) (car ad-dO-vAr)) - ,@body - ;;work around a backquote bug: - ;;(` ((,@ '(foo)) (bar))) => (append '(foo) '(((bar)))) wrong - ;;(` ((,@ '(foo)) (, '(bar)))) => (append '(foo) (list '(bar))) - ,'(setq ad-dO-vAr (cdr ad-dO-vAr))) - ,(car (cdr (cdr varform)))))) - ;;ok, this wastes some cons cells but only during compilation: - (if (catch 'contains-return - (ad-substitute-tree - (function (lambda (subtree) - (cond ((eq (car-safe subtree) 'ad-dolist)) - ((eq (car-safe subtree) 'ad-do-return) - (throw 'contains-return t))))) - 'identity body) - nil) - `(catch 'ad-dO-eXiT ,expansion) - expansion))) - -(defmacro ad-do-return (value) - `(throw 'ad-dO-eXiT ,value)) - -(if (not (get 'ad-dolist 'lisp-indent-hook)) - (put 'ad-dolist 'lisp-indent-hook 1)) - - ;; @@ Save real definitions of subrs used by Advice: ;; ================================================= ;; Advice depends on the real, unmodified functionality of various subrs, @@ -1924,16 +1876,16 @@ exited prematurely with `(ad-do-return [VALUE])'." ad-advised-functions))) (defmacro ad-do-advised-functions (varform &rest body) - "`ad-dolist'-style iterator that maps over `ad-advised-functions'. + "`dolist'-style iterator that maps over `ad-advised-functions'. \(ad-do-advised-functions (VAR [RESULT-FORM]) BODY-FORM...) On each iteration VAR will be bound to the name of an advised function \(a symbol)." - `(ad-dolist (,(car varform) + `(cl-dolist (,(car varform) ad-advised-functions ,(car (cdr varform))) - (setq ,(car varform) (intern (car ,(car varform)))) - ,@body)) + (setq ,(car varform) (intern (car ,(car varform)))) + ,@body)) (if (not (get 'ad-do-advised-functions 'lisp-indent-hook)) (put 'ad-do-advised-functions 'lisp-indent-hook 1)) @@ -1948,7 +1900,7 @@ On each iteration VAR will be bound to the name of an advised function `(put ,function 'ad-advice-info ,advice-info)) (defmacro ad-copy-advice-info (function) - `(ad-copy-tree (get ,function 'ad-advice-info))) + `(copy-tree (get ,function 'ad-advice-info))) (defmacro ad-is-advised (function) "Return non-nil if FUNCTION has any advice info associated with it. @@ -2022,8 +1974,8 @@ either t or nil, and DEFINITION should be a list of the form (defun ad-has-enabled-advice (function class) "True if at least one of FUNCTION's advices in CLASS is enabled." - (ad-dolist (advice (ad-get-advice-info-field function class)) - (if (ad-advice-enabled advice) (ad-do-return t)))) + (cl-dolist (advice (ad-get-advice-info-field function class)) + (if (ad-advice-enabled advice) (cl-return t)))) (defun ad-has-redefining-advice (function) "True if FUNCTION's advice info defines at least 1 redefining advice. @@ -2036,14 +1988,14 @@ Redefining advices affect the construction of an advised definition." (defun ad-has-any-advice (function) "True if the advice info of FUNCTION defines at least one advice." (and (ad-is-advised function) - (ad-dolist (class ad-advice-classes nil) + (cl-dolist (class ad-advice-classes nil) (if (ad-get-advice-info-field function class) - (ad-do-return t))))) + (cl-return t))))) (defun ad-get-enabled-advices (function class) "Return the list of enabled advices of FUNCTION in CLASS." (let (enabled-advices) - (ad-dolist (advice (ad-get-advice-info-field function class)) + (dolist (advice (ad-get-advice-info-field function class)) (if (ad-advice-enabled advice) (push advice enabled-advices))) (reverse enabled-advices))) @@ -2151,7 +2103,7 @@ function at point for which PREDICATE returns non-nil)." (ad-do-advised-functions (function) (if (or (null predicate) (funcall predicate function)) - (ad-do-return function))) + (cl-return function))) (error "ad-read-advised-function: %s" "There are no qualifying advised functions"))) (let* ((ad-pReDiCaTe predicate) @@ -2184,9 +2136,9 @@ be returned on empty input (defaults to the first non-empty advice class of FUNCTION)." (setq default (or default - (ad-dolist (class ad-advice-classes) + (cl-dolist (class ad-advice-classes) (if (ad-get-advice-info-field function class) - (ad-do-return class))) + (cl-return class))) (error "ad-read-advice-class: `%s' has no advices" function))) (let ((class (completing-read (format "%s (default %s): " (or prompt "Class") default) @@ -2255,18 +2207,18 @@ NAME can be a symbol or a regular expression matching part of an advice name. If CLASS is `any' all valid advice classes will be checked." (if (ad-is-advised function) (let (found-advice) - (ad-dolist (advice-class ad-advice-classes) + (cl-dolist (advice-class ad-advice-classes) (if (or (eq class 'any) (eq advice-class class)) (setq found-advice - (ad-dolist (advice (ad-get-advice-info-field + (cl-dolist (advice (ad-get-advice-info-field function advice-class)) (if (or (and (stringp name) (string-match name (symbol-name (ad-advice-name advice)))) (eq name (ad-advice-name advice))) - (ad-do-return advice))))) - (if found-advice (ad-do-return found-advice)))))) + (cl-return advice))))) + (if found-advice (cl-return found-advice)))))) (defun ad-enable-advice-internal (function class name flag) "Set enable FLAG of FUNCTION's advices in CLASS matching NAME. @@ -2277,10 +2229,10 @@ considered. The number of changed advices will be returned (or nil if FUNCTION was not advised)." (if (ad-is-advised function) (let ((matched-advices 0)) - (ad-dolist (advice-class ad-advice-classes) + (dolist (advice-class ad-advice-classes) (if (or (eq class 'any) (eq advice-class class)) - (ad-dolist (advice (ad-get-advice-info-field - function advice-class)) + (dolist (advice (ad-get-advice-info-field + function advice-class)) (cond ((or (and (stringp name) (string-match name (symbol-name (ad-advice-name advice)))) @@ -2868,8 +2820,8 @@ in any of these classes." (if origdoc (setq paragraphs (list origdoc))) (unless (eq style 'plain) (push (concat "This " origtype " is advised.") paragraphs)) - (ad-dolist (class ad-advice-classes) - (ad-dolist (advice (ad-get-enabled-advices function class)) + (dolist (class ad-advice-classes) + (dolist (advice (ad-get-enabled-advices function class)) (setq advice-docstring (ad-make-single-advice-docstring advice class style)) (if advice-docstring @@ -2891,24 +2843,24 @@ in any of these classes." (defun ad-advised-arglist (function) "Find first defined arglist in FUNCTION's redefining advices." - (ad-dolist (advice (append (ad-get-enabled-advices function 'before) + (cl-dolist (advice (append (ad-get-enabled-advices function 'before) (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((arglist (ad-arglist (ad-advice-definition advice)))) (if arglist ;; We found the first one, use it: - (ad-do-return arglist))))) + (cl-return arglist))))) (defun ad-advised-interactive-form (function) "Find first interactive form in FUNCTION's redefining advices." - (ad-dolist (advice (append (ad-get-enabled-advices function 'before) + (cl-dolist (advice (append (ad-get-enabled-advices function 'before) (ad-get-enabled-advices function 'around) (ad-get-enabled-advices function 'after))) (let ((interactive-form (ad-interactive-form (ad-advice-definition advice)))) (if interactive-form ;; We found the first one, use it: - (ad-do-return interactive-form))))) + (cl-return interactive-form))))) ;; @@@ Putting it all together: ;; ============================ @@ -2997,29 +2949,29 @@ and BEFORES, AROUNDS and AFTERS are the lists of advices with which ORIG should be modified. The assembled function will be returned." (let (before-forms around-form around-form-protected after-forms definition) - (ad-dolist (advice befores) - (cond ((and (ad-advice-protected advice) - before-forms) - (setq before-forms - `((unwind-protect - ,(ad-prognify before-forms) - ,@(ad-body-forms - (ad-advice-definition advice)))))) - (t (setq before-forms - (append before-forms - (ad-body-forms (ad-advice-definition advice))))))) + (dolist (advice befores) + (cond ((and (ad-advice-protected advice) + before-forms) + (setq before-forms + `((unwind-protect + ,(ad-prognify before-forms) + ,@(ad-body-forms + (ad-advice-definition advice)))))) + (t (setq before-forms + (append before-forms + (ad-body-forms (ad-advice-definition advice))))))) (setq around-form `(setq ad-return-value ,orig)) - (ad-dolist (advice (reverse arounds)) - ;; If any of the around advices is protected then we - ;; protect the complete around advice onion: - (if (ad-advice-protected advice) - (setq around-form-protected t)) - (setq around-form - (ad-substitute-tree - (function (lambda (form) (eq form 'ad-do-it))) - (function (lambda (form) around-form)) - (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) + (dolist (advice (reverse arounds)) + ;; If any of the around advices is protected then we + ;; protect the complete around advice onion: + (if (ad-advice-protected advice) + (setq around-form-protected t)) + (setq around-form + (ad-substitute-tree + (function (lambda (form) (eq form 'ad-do-it))) + (function (lambda (form) around-form)) + (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) (setq after-forms (if (and around-form-protected before-forms) @@ -3027,17 +2979,17 @@ should be modified. The assembled function will be returned." ,(ad-prognify before-forms) ,around-form)) (append before-forms (list around-form)))) - (ad-dolist (advice afters) - (cond ((and (ad-advice-protected advice) - after-forms) - (setq after-forms - `((unwind-protect - ,(ad-prognify after-forms) - ,@(ad-body-forms - (ad-advice-definition advice)))))) - (t (setq after-forms - (append after-forms - (ad-body-forms (ad-advice-definition advice))))))) + (dolist (advice afters) + (cond ((and (ad-advice-protected advice) + after-forms) + (setq after-forms + `((unwind-protect + ,(ad-prognify after-forms) + ,@(ad-body-forms + (ad-advice-definition advice)))))) + (t (setq after-forms + (append after-forms + (ad-body-forms (ad-advice-definition advice))))))) (setq definition `(,@(if (memq type '(macro special-form)) '(macro)) @@ -3171,11 +3123,11 @@ advised definition from scratch." (nth 2 cache-id))))) (defun ad-verify-cache-class-id (cache-class-id advices) - (ad-dolist (advice advices (null cache-class-id)) + (cl-dolist (advice advices (null cache-class-id)) (if (ad-advice-enabled advice) (if (eq (car cache-class-id) (ad-advice-name advice)) (setq cache-class-id (cdr cache-class-id)) - (ad-do-return nil))))) + (cl-return nil))))) ;; There should be a way to monitor if and why a cache verification failed ;; in order to determine whether a certain preactivation could be used or @@ -3670,7 +3622,16 @@ See Info node `(elisp)Advising Functions' for comprehensive documentation. usage: (defadvice FUNCTION (CLASS NAME [POSITION] [ARGLIST] FLAG...) [DOCSTRING] [INTERACTIVE-FORM] BODY...)" - (declare (doc-string 3)) + (declare (doc-string 3) + (debug (&define name ;; thing being advised. + (name ;; class is [&or "before" "around" "after" + ;; "activation" "deactivation"] + name ;; name of advice + &rest sexp ;; optional position and flags + ) + [&optional stringp] + [&optional ("interactive" interactive)] + def-body))) (if (not (ad-name-p function)) (error "defadvice: Invalid function name: %s" function)) (let* ((class (car args)) diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 7f9f8a33634..939fab78942 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -148,7 +148,7 @@ unselectable text. A string consisting solely of hyphens is displayed as a solid horizontal line. A menu item can be a list with the same format as MENU. This is a submenu." - (declare (indent defun)) + (declare (indent defun) (debug (symbolp body))) `(progn ,(if symbol `(defvar ,symbol nil ,doc)) (easy-menu-do-define (quote ,symbol) ,maps ,doc ,menu))) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 8f0f24ad092..d656dcf9526 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -52,10 +52,7 @@ ;;; Code: (require 'macroexp) - -;;; Bug reporting - -(defalias 'edebug-submit-bug-report 'report-emacs-bug) +(eval-when-compile (require 'cl-lib)) ;;; Options @@ -362,6 +359,7 @@ Return the result of the last expression in BODY." ;; Select WINDOW if it is provided and still exists. Otherwise, ;; if buffer is currently shown in several windows, choose one. ;; Otherwise, find a new window, possibly splitting one. + ;; FIXME: We should probably just be using `pop-to-buffer'. (setq window (cond ((and (edebug-window-live-p window) @@ -370,7 +368,7 @@ Return the result of the last expression in BODY." ((eq (window-buffer (selected-window)) buffer) ;; Selected window already displays BUFFER. (selected-window)) - ((edebug-get-buffer-window buffer)) + ((get-buffer-window buffer 0)) ((one-window-p 'nomini) ;; When there's one window only, split it. (split-window)) @@ -443,18 +441,14 @@ Return the result of the last expression in BODY." window-info) (set-window-configuration window-info))) -(defalias 'edebug-get-buffer-window 'get-buffer-window) -(defalias 'edebug-sit-for 'sit-for) -(defalias 'edebug-input-pending-p 'input-pending-p) - - ;;; Redefine read and eval functions ;; read is redefined to maybe instrument forms. ;; eval-defun is redefined to check edebug-all-forms and edebug-all-defs. ;; Save the original read function -(or (fboundp 'edebug-original-read) - (defalias 'edebug-original-read (symbol-function 'read))) +(defalias 'edebug-original-read + (symbol-function (if (fboundp 'edebug-original-read) + 'edebug-original-read 'read))) (defun edebug-read (&optional stream) "Read one Lisp expression as text from STREAM, return as Lisp object. @@ -621,8 +615,8 @@ already is one.)" (defvar-local edebug-form-data nil "A list of entries associating symbols with buffer regions. -This is an automatic buffer local variable. Each entry looks like: -\(SYMBOL BEGIN-MARKER END-MARKER). The markers +Each entry is an `edebug--form-data' struct with fields: +SYMBOL, BEGIN-MARKER, and END-MARKER. The markers are at the beginning and end of an entry level form and SYMBOL is a symbol that holds all edebug related information for the form on its property list. @@ -631,24 +625,17 @@ In the future (haha!), the symbol will be irrelevant and edebug data will be stored in the definitions themselves rather than in the property list of a symbol.") -;; FIXME: Use cl-defstruct. - -(defun edebug-make-form-data-entry (symbol begin end) - (list symbol begin end)) - -(defsubst edebug-form-data-name (entry) - (car entry)) - -(defsubst edebug-form-data-begin (entry) - (nth 1 entry)) - -(defsubst edebug-form-data-end (entry) - (nth 2 entry)) +(cl-defstruct (edebug--form-data + ;; Some callers expect accessors to return nil when passed nil. + (:type list) + (:constructor edebug--make-form-data-entry (name begin end)) + (:predicate nil) (:constructor nil) (:copier nil)) + name begin end) (defsubst edebug-set-form-data-entry (entry name begin end) - (setcar entry name) ;; In case name is changed. - (set-marker (nth 1 entry) begin) - (set-marker (nth 2 entry) end)) + (setf (edebug--form-data-name entry) name) ;; In case name is changed. + (set-marker (edebug--form-data-begin entry) begin) + (set-marker (edebug--form-data-end entry) end)) (defun edebug-get-form-data-entry (pnt &optional end-point) ;; Find the edebug form data entry which is closest to PNT. @@ -656,17 +643,17 @@ list of a symbol.") ;; Return `nil' if none found. (let ((rest edebug-form-data) closest-entry - (closest-dist 999999)) ;; need maxint here + (closest-dist 999999)) ;; Need maxint here. (while (and rest (< 0 closest-dist)) (let* ((entry (car rest)) - (begin (edebug-form-data-begin entry)) + (begin (edebug--form-data-begin entry)) (dist (- pnt begin))) (setq rest (cdr rest)) (if (and (<= 0 dist) (< dist closest-dist) (or (not end-point) - (= end-point (edebug-form-data-end entry))) - (<= pnt (edebug-form-data-end entry))) + (= end-point (edebug--form-data-end entry))) + (<= pnt (edebug--form-data-end entry))) (setq closest-dist dist closest-entry entry)))) closest-entry)) @@ -675,19 +662,19 @@ list of a symbol.") ;; and find an entry given a symbol, which should be just assq. (defun edebug-form-data-symbol () -;; Return the edebug data symbol of the form where point is in. -;; If point is not inside a edebuggable form, cause error. - (or (edebug-form-data-name (edebug-get-form-data-entry (point))) + "Return the edebug data symbol of the form where point is in. +If point is not inside a edebuggable form, cause error." + (or (edebug--form-data-name (edebug-get-form-data-entry (point))) (error "Not inside instrumented form"))) (defun edebug-make-top-form-data-entry (new-entry) ;; Make NEW-ENTRY the first element in the `edebug-form-data' list. (edebug-clear-form-data-entry new-entry) - (setq edebug-form-data (cons new-entry edebug-form-data))) + (push new-entry edebug-form-data)) (defun edebug-clear-form-data-entry (entry) -;; If non-nil, clear ENTRY out of the form data. -;; Maybe clear the markers and delete the symbol's edebug property? + "If non-nil, clear ENTRY out of the form data. +Maybe clear the markers and delete the symbol's edebug property?" (if entry (progn ;; Instead of this, we could just find all contained forms. @@ -1285,7 +1272,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; Set this marker before parsing. (edebug-form-begin-marker (if form-data-entry - (edebug-form-data-begin form-data-entry) + (edebug--form-data-begin form-data-entry) ;; Buffer must be current-buffer for this to work: (set-marker (make-marker) form-begin)))) @@ -1295,7 +1282,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; For definitions. ;; (edebug-containing-def-name edebug-def-name) ;; Get name from form-data, if any. - (edebug-old-def-name (edebug-form-data-name form-data-entry)) + (edebug-old-def-name (edebug--form-data-name form-data-entry)) edebug-def-name edebug-def-args edebug-def-interactive @@ -1325,7 +1312,7 @@ expressions; a `progn' form will be returned enclosing these forms." ;; In the latter case, pointers to the entry remain eq. (if (not form-data-entry) (setq form-data-entry - (edebug-make-form-data-entry + (edebug--make-form-data-entry edebug-def-name edebug-form-begin-marker ;; Buffer must be current-buffer. @@ -1522,7 +1509,7 @@ expressions; a `progn' form will be returned enclosing these forms." (if edebug-error-point (goto-char edebug-error-point)) (apply 'edebug-syntax-error args)) - (funcall 'throw 'no-match args))) + (throw 'no-match args))) (defun edebug-match (cursor specs) @@ -2012,11 +1999,6 @@ expressions; a `progn' form will be returned enclosing these forms." ;; (def-edebug-spec anonymous-form ((&or ["lambda" lambda] ["macro" macro]))) ;; Standard functions that take function-forms arguments. -(def-edebug-spec mapcar (function-form form)) -(def-edebug-spec mapconcat (function-form form form)) -(def-edebug-spec mapatoms (function-form &optional form)) -(def-edebug-spec apply (function-form &rest form)) -(def-edebug-spec funcall (function-form &rest form)) ;; FIXME? The manual uses this form (maybe that's just for illustration?): ;; (def-edebug-spec let @@ -2082,49 +2064,12 @@ expressions; a `progn' form will be returned enclosing these forms." &or ("quote" edebug-\`) def-form)) ;; New byte compiler. -(def-edebug-spec defsubst defun) -(def-edebug-spec dont-compile t) -(def-edebug-spec eval-when-compile t) -(def-edebug-spec eval-and-compile t) (def-edebug-spec save-selected-window t) (def-edebug-spec save-current-buffer t) -(def-edebug-spec delay-mode-hooks t) -(def-edebug-spec with-temp-file t) -(def-edebug-spec with-temp-message t) -(def-edebug-spec with-syntax-table t) -(def-edebug-spec push (form sexp)) -(def-edebug-spec pop (sexp)) - -(def-edebug-spec 1value (form)) -(def-edebug-spec noreturn (form)) - ;; Anything else? - -;; Some miscellaneous specs for macros in public packages. -;; Send me yours. - -;; advice.el by Hans Chalupsky (hans@cs.buffalo.edu) - -(def-edebug-spec ad-dolist ((symbolp form &optional form) body)) -(def-edebug-spec defadvice - (&define name ;; thing being advised. - (name ;; class is [&or "before" "around" "after" - ;; "activation" "deactivation"] - name ;; name of advice - &rest sexp ;; optional position and flags - ) - [&optional stringp] - [&optional ("interactive" interactive)] - def-body)) - -(def-edebug-spec easy-menu-define (symbolp body)) - -(def-edebug-spec with-custom-print body) - - ;;; The debugger itself (defvar edebug-active nil) ;; Non-nil when edebug is active @@ -2177,8 +2122,6 @@ expressions; a `progn' form will be returned enclosing these forms." (defvar edebug-outside-debug-on-error) ; the value of debug-on-error outside (defvar edebug-outside-debug-on-quit) ; the value of debug-on-quit outside -(defvar edebug-outside-overriding-local-map) -(defvar edebug-outside-overriding-terminal-local-map) (defvar edebug-outside-pre-command-hook) (defvar edebug-outside-post-command-hook) @@ -2339,7 +2282,7 @@ MSG is printed after `::::} '." (1+ (aref edebug-freq-count before-index))) (if (or (not (memq edebug-execution-mode '(Go-nonstop next))) - (edebug-input-pending-p)) + (input-pending-p)) (edebug-debugger before-index 'before nil))) before-index) @@ -2361,7 +2304,7 @@ MSG is printed after `::::} '." (if edebug-test-coverage (edebug--update-coverage after-index value)) (if (and (eq edebug-execution-mode 'Go-nonstop) - (not (edebug-input-pending-p))) + (not (input-pending-p))) ;; Just return result. value (edebug-debugger after-index 'after value) @@ -2445,7 +2388,7 @@ MSG is printed after `::::} '." ;; or break, or input is pending, (if (or (not (memq edebug-execution-mode '(go continue Continue-fast))) edebug-break - (edebug-input-pending-p)) + (input-pending-p)) (edebug--display value offset-index arg-mode)) ; <---------- display value))) @@ -2522,7 +2465,7 @@ MSG is printed after `::::} '." (let ((overlay-arrow-position overlay-arrow-position) (overlay-arrow-string overlay-arrow-string) (cursor-in-echo-area nil) - (unread-command-events unread-command-events) + (unread-command-events nil) ;; any others?? ) (setq-default cursor-in-non-selected-windows t) @@ -2577,7 +2520,7 @@ MSG is printed after `::::} '." (edebug-adjust-window (cdr edebug-window-data))) ;; Test if there is input, not including keyboard macros. - (if (edebug-input-pending-p) + (if (input-pending-p) (progn (setq edebug-execution-mode 'step edebug-stop t) @@ -2612,27 +2555,26 @@ MSG is printed after `::::} '." (t (message ""))) - (setq unread-command-events nil) (if (eq 'after arg-mode) (progn ;; Display result of previous evaluation. (if (and edebug-break (not (eq edebug-execution-mode 'Continue-fast))) - (edebug-sit-for edebug-sit-for-seconds)) ; Show message. + (sit-for edebug-sit-for-seconds)) ; Show message. (edebug-previous-result))) (cond (edebug-break (cond ((eq edebug-execution-mode 'continue) - (edebug-sit-for edebug-sit-for-seconds)) - ((eq edebug-execution-mode 'Continue-fast) (edebug-sit-for 0)) + (sit-for edebug-sit-for-seconds)) + ((eq edebug-execution-mode 'Continue-fast) (sit-for 0)) (t (setq edebug-stop t)))) ;; not edebug-break ((eq edebug-execution-mode 'trace) - (edebug-sit-for edebug-sit-for-seconds)) ; Force update and pause. + (sit-for edebug-sit-for-seconds)) ; Force update and pause. ((eq edebug-execution-mode 'Trace-fast) - (edebug-sit-for 0))) ; Force update and continue. + (sit-for 0))) ; Force update and continue. (unwind-protect (if (or edebug-stop @@ -2646,7 +2588,7 @@ MSG is printed after `::::} '." ;; Reset the edebug-window-data to whatever it is now. (let ((window (if (eq (window-buffer) edebug-buffer) (selected-window) - (edebug-get-buffer-window edebug-buffer)))) + (get-buffer-window edebug-buffer)))) ;; Remember window-start for edebug-buffer, if still displayed. (if window (progn @@ -2724,6 +2666,8 @@ MSG is printed after `::::} '." (goto-char edebug-buffer-outside-point)) ;; ... nothing more. ) + ;; Could be an option to keep eval display up. + (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) (with-timeout-unsuspend edebug-with-timeout-suspend) ;; Reset global variables to outside values in case they were changed. (setq @@ -2790,10 +2734,6 @@ MSG is printed after `::::} '." (edebug-outside-map (current-local-map)) - (edebug-outside-overriding-local-map overriding-local-map) - (edebug-outside-overriding-terminal-local-map - overriding-terminal-local-map) - ;; Save the outside value of executing macro. (here??) (edebug-outside-executing-macro executing-kbd-macro) (edebug-outside-pre-command-hook @@ -2832,6 +2772,9 @@ MSG is printed after `::::} '." (last-nonmenu-event nil) (track-mouse nil) + (standard-output t) + (standard-input t) + ;; Don't keep reading from an executing kbd macro ;; within edebug unless edebug-continue-kbd-macro is ;; non-nil. Again, local binding may not be best. @@ -2874,8 +2817,6 @@ MSG is printed after `::::} '." (setq signal-hook-function 'edebug-signal) (if edebug-backtrace-buffer (kill-buffer edebug-backtrace-buffer)) - ;; Could be an option to keep eval display up. - (if edebug-eval-buffer (kill-buffer edebug-eval-buffer)) ;; Remember selected-window after recursive-edit. ;; (setq edebug-inside-window (selected-window)) @@ -2923,8 +2864,8 @@ MSG is printed after `::::} '." (defun edebug-adjust-window (old-start) ;; If pos is not visible, adjust current window to fit following context. -;;; (message "window: %s old-start: %s window-start: %s pos: %s" -;;; (selected-window) old-start (window-start) (point)) (sit-for 5) + ;; (message "window: %s old-start: %s window-start: %s pos: %s" + ;; (selected-window) old-start (window-start) (point)) (sit-for 5) (if (not (pos-visible-in-window-p)) (progn ;; First try old-start @@ -2932,7 +2873,7 @@ MSG is printed after `::::} '." (set-window-start (selected-window) old-start)) (if (not (pos-visible-in-window-p)) (progn -;; (message "resetting window start") (sit-for 2) + ;; (message "resetting window start") (sit-for 2) (set-window-start (selected-window) (save-excursion @@ -3071,7 +3012,7 @@ before returning. The default is one second." (current-buffer) (point) (if (marker-buffer (edebug-mark-marker)) (marker-position (edebug-mark-marker)) "")) - (edebug-sit-for arg) + (sit-for arg) (edebug-pop-to-buffer edebug-buffer (car edebug-window-data))))) @@ -3398,7 +3339,7 @@ function or macro is called, Edebug will be called there as well." (save-excursion (down-list 1) (if (looking-at "\(") - (edebug-form-data-name + (edebug--form-data-name (edebug-get-form-data-entry (point))) (edebug-original-read (current-buffer)))))) (edebug-instrument-function func)))) @@ -3604,7 +3545,8 @@ Return the result of the last expression." (defun edebug-eval (expr) ;; Are there cl lexical variables active? - (eval (if (bound-and-true-p cl-debug-env) + (eval (if (and (bound-and-true-p cl-debug-env) + (fboundp 'cl-macroexpand-all)) (cl-macroexpand-all expr cl-debug-env) expr) lexical-binding)) @@ -4088,15 +4030,15 @@ Otherwise call `debug' normally." "In buffer BUF-NAME, display FMT and ARGS at the end and make it visible. The buffer is created if it does not exist. You must include newlines in FMT to break lines, but one newline is appended." -;; e.g. -;; (edebug-trace-display "*trace-point*" -;; "saving: point = %s window-start = %s" -;; (point) (window-start)) + ;; e.g. + ;; (edebug-trace-display "*trace-point*" + ;; "saving: point = %s window-start = %s" + ;; (point) (window-start)) (let* ((oldbuf (current-buffer)) (selected-window (selected-window)) (buffer (get-buffer-create buf-name)) buf-window) -;; (message "before pop-to-buffer") (sit-for 1) + ;; (message "before pop-to-buffer") (sit-for 1) (edebug-pop-to-buffer buffer) (setq truncate-lines t) (setq buf-window (selected-window)) @@ -4106,8 +4048,8 @@ You must include newlines in FMT to break lines, but one newline is appended." (vertical-motion (- 1 (window-height))) (set-window-start buf-window (point)) (goto-char (point-max)) -;; (set-window-point buf-window (point)) -;; (edebug-sit-for 0) + ;; (set-window-point buf-window (point)) + ;; (sit-for 0) (bury-buffer buffer) (select-window selected-window) (set-buffer oldbuf)) @@ -4170,8 +4112,8 @@ reinstrument it." ;; Insert all the indices for this line. (forward-line 1) (setq start-of-count-line (point) - first-index i ; really last index for line above this one. - last-count -1) ; cause first count to always appear. + first-index i ; Really, last index for line above this one. + last-count -1) ; Cause first count to always appear. (insert ";#") ;; i == first-index still (while (<= (setq i (1+ i)) last-index) @@ -4203,7 +4145,8 @@ It is removed when you hit any char." (let ((buffer-read-only nil)) (undo-boundary) (edebug-display-freq-count) - (setq unread-command-events (append unread-command-events (read-event))) + (setq unread-command-events + (append unread-command-events (list (read-event)))) ;; Yuck! This doesn't seem to work at all for me. (undo))) @@ -4314,80 +4257,6 @@ With prefix argument, make it a temporary breakpoint." (edebug-modify-breakpoint t condition arg)) (easy-menu-define edebug-menu edebug-mode-map "Edebug menus" edebug-mode-menus) - -;;; Byte-compiler - -;; Extension for bytecomp to resolve undefined function references. -;; Requires new byte compiler. - -(eval-when-compile - ;; The body of eval-when-compile seems to get evaluated with eval-defun. - ;; We only want to evaluate when actually byte compiling. - ;; But it is OK to evaluate as long as byte-compiler has been loaded. - (if (featurep 'byte-compile) (progn - - (defun byte-compile-resolve-functions (funcs) - "Say it is OK for the named functions to be unresolved." - (mapc - (function - (lambda (func) - (setq byte-compile-unresolved-functions - (delq (assq func byte-compile-unresolved-functions) - byte-compile-unresolved-functions)))) - funcs) - nil) - - '(defun byte-compile-resolve-free-references (vars) - "Say it is OK for the named variables to be referenced." - (mapcar - (function - (lambda (var) - (setq byte-compile-free-references - (delq var byte-compile-free-references)))) - vars) - nil) - - '(defun byte-compile-resolve-free-assignments (vars) - "Say it is OK for the named variables to be assigned." - (mapcar - (function - (lambda (var) - (setq byte-compile-free-assignments - (delq var byte-compile-free-assignments)))) - vars) - nil) - - (byte-compile-resolve-functions - '(reporter-submit-bug-report - edebug-gensym ;; also in cl.el - ;; Interfaces to standard functions. - edebug-original-eval-defun - edebug-original-read - edebug-get-buffer-window - edebug-mark - edebug-mark-marker - edebug-input-pending-p - edebug-sit-for - edebug-prin1-to-string - edebug-format - ;; lemacs - zmacs-deactivate-region - popup-menu - ;; CL - cl-macroexpand-all - ;; And believe it or not, the byte compiler doesn't know about: - byte-compile-resolve-functions - )) - - '(byte-compile-resolve-free-references - '(read-expression-history - read-expression-map)) - - '(byte-compile-resolve-free-assignments - '(read-expression-history)) - - ))) - ;;; Autoloading of Edebug accessories diff --git a/lisp/subr.el b/lisp/subr.el index aa1b10ce17d..e9b85ff1f38 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -80,6 +80,7 @@ For more information, see Info node `(elisp)Declaring Functions'." (defmacro noreturn (form) "Evaluate FORM, expecting it not to return. If FORM does return, signal an error." + (declare (debug t)) `(prog1 ,form (error "Form marked with `noreturn' did return"))) @@ -87,6 +88,7 @@ If FORM does return, signal an error." "Evaluate FORM, expecting a constant return value. This is the global do-nothing version. There is also `testcover-1value' that complains if FORM ever does return differing values." + (declare (debug t)) form) (defmacro def-edebug-spec (symbol spec) -- cgit v1.2.3 From 0fb3cb7c8921f6ad3ac59c24d608384be91d5baa Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 14 Sep 2012 09:44:31 -0400 Subject: * lisp/emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/advice.el | 16 ++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7163b4b4989..2b5b5f49b58 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-14 Stefan Monnier + * emacs-lisp/advice.el (ad-prognify): Remove, use macroexp-progn. + * emacs-lisp/edebug.el: Miscellaneous cleanup. Remove obsolete byte-compiler hack that tried to silence some warnings. (edebug-submit-bug-report): Remove. diff --git a/lisp/emacs-lisp/advice.el b/lisp/emacs-lisp/advice.el index f0d277a3f69..d96076d17a6 100644 --- a/lisp/emacs-lisp/advice.el +++ b/lisp/emacs-lisp/advice.el @@ -1746,6 +1746,7 @@ (provide 'advice-preload) ;; During a normal load this is a noop: (require 'advice-preload "advice.el") +(require 'macroexp) (eval-when-compile (require 'cl-lib)) ;; @@ Variable definitions: @@ -2538,11 +2539,6 @@ For that it has to be fbound with a non-autoload definition." (byte-compile symbol) (fset function (symbol-function symbol)))))) -(defun ad-prognify (forms) - (cond ((<= (length forms) 1) - (car forms)) - (t (cons 'progn forms)))) - ;; @@@ Accessing argument lists: ;; ============================= @@ -2954,7 +2950,7 @@ should be modified. The assembled function will be returned." before-forms) (setq before-forms `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,@(ad-body-forms (ad-advice-definition advice)))))) (t (setq before-forms @@ -2971,12 +2967,12 @@ should be modified. The assembled function will be returned." (ad-substitute-tree (function (lambda (form) (eq form 'ad-do-it))) (function (lambda (form) around-form)) - (ad-prognify (ad-body-forms (ad-advice-definition advice)))))) + (macroexp-progn (ad-body-forms (ad-advice-definition advice)))))) (setq after-forms (if (and around-form-protected before-forms) `((unwind-protect - ,(ad-prognify before-forms) + ,(macroexp-progn before-forms) ,around-form)) (append before-forms (list around-form)))) (dolist (advice afters) @@ -2984,7 +2980,7 @@ should be modified. The assembled function will be returned." after-forms) (setq after-forms `((unwind-protect - ,(ad-prognify after-forms) + ,(macroexp-progn after-forms) ,@(ad-body-forms (ad-advice-definition advice)))))) (t (setq after-forms @@ -3013,7 +3009,7 @@ should be modified. The assembled function will be returned." (ad-body-forms (ad-advice-definition advice)))) (ad-get-enabled-advices function hook-name)))) (if hook-forms - (ad-prognify (apply 'append hook-forms))))) + (macroexp-progn (apply 'append hook-forms))))) ;; @@ Caching: -- cgit v1.2.3 From 865fe16fd25fb066c3da1f71a2bb115aa807af8d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 17 Sep 2012 13:41:04 +0800 Subject: Update docstrings and comments to use "init file" terminology. * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. * comint.el (comint-prompt-read-only): * custom.el (defcustom): * hi-lock.el (hi-lock-mode): * ibuffer.el (ibuffer-formats): * ielm.el (ielm-prompt-read-only): * novice.el (disable-command): * saveplace.el (toggle-save-place): * speedbar.el (speedbar-supported-extension-expressions): * startup.el (auto-save-list-file-prefix, init-file-user) (after-init-hook, inhibit-startup-echo-area-message): * strokes.el (strokes-help): * time-stamp.el (time-stamp): * calendar/calendar.el (calendar, diary-file): * calendar/diary-lib.el (diary-mail-entries, diary) (diary-list-entries-hook): * calendar/holidays.el (holidays, calendar-holidays): * calendar/lunar.el (lunar-phases): * calendar/solar.el (sunrise-sunset): * emulation/edt.el (edt-load-keys): * emulation/viper.el (viper-mode): * eshell/em-alias.el (eshell-command-aliases-list): * eshell/esh-util.el (eshell-convert-numeric-arguments): * international/ogonek.el (ogonek-information): * net/tramp-cmds.el (tramp-bug): * net/quickurl.el (quickurl-reread-hook-postfix): * play/decipher.el (decipher-font-lock-keywords): * progmodes/cc-styles.el (c-set-style): * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): * progmodes/inf-lisp.el (inferior-lisp-prompt): * progmodes/octave-mod.el (octave-mode): * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): * progmodes/verilog-mode.el (verilog-read-defines): * textmodes/two-column.el (2C-mode): Likewise. --- lisp/ChangeLog | 35 +++++++++++++++++++++++++++++++ lisp/align.el | 2 +- lisp/autoinsert.el | 2 +- lisp/bookmark.el | 5 +---- lisp/calc/calc-ext.el | 2 +- lisp/calc/calc-forms.el | 2 +- lisp/calendar/calendar.el | 4 ++-- lisp/calendar/diary-lib.el | 24 +++++++++++---------- lisp/calendar/holidays.el | 6 +++--- lisp/calendar/lunar.el | 2 +- lisp/calendar/solar.el | 2 +- lisp/calendar/timeclock.el | 4 ++-- lisp/comint.el | 2 +- lisp/custom.el | 2 +- lisp/desktop.el | 2 +- lisp/emacs-lisp/byte-run.el | 2 +- lisp/emacs-lisp/cl-lib.el | 2 +- lisp/emulation/edt-mapper.el | 4 ++-- lisp/emulation/edt.el | 10 ++++----- lisp/emulation/tpu-edt.el | 6 +++--- lisp/emulation/tpu-extras.el | 2 +- lisp/emulation/tpu-mapper.el | 2 +- lisp/emulation/vi.el | 2 +- lisp/emulation/viper.el | 4 ++-- lisp/erc/ChangeLog | 6 ++++++ lisp/erc/erc-button.el | 2 +- lisp/erc/erc-capab.el | 2 +- lisp/erc/erc-match.el | 2 +- lisp/erc/erc-netsplit.el | 2 +- lisp/erc/erc-page.el | 2 +- lisp/erc/erc-replace.el | 2 +- lisp/erc/erc-stamp.el | 2 +- lisp/erc/erc-track.el | 2 +- lisp/eshell/em-alias.el | 8 +++---- lisp/eshell/esh-util.el | 2 +- lisp/ffap.el | 4 ++-- lisp/filesets.el | 2 +- lisp/flow-ctrl.el | 2 +- lisp/font-lock.el | 2 +- lisp/frame.el | 2 +- lisp/generic-x.el | 2 +- lisp/hi-lock.el | 6 +++--- lisp/ibuffer.el | 12 +++++------ lisp/ielm.el | 2 +- lisp/international/ogonek.el | 7 ++++--- lisp/locate.el | 2 +- lisp/mail/feedmail.el | 5 ++--- lisp/mail/mail-hist.el | 2 +- lisp/mail/uce.el | 2 +- lisp/mouse-copy.el | 2 +- lisp/mouse-drag.el | 2 +- lisp/net/ange-ftp.el | 14 ++++++------- lisp/net/browse-url.el | 3 +-- lisp/net/goto-addr.el | 2 +- lisp/net/newsticker.el | 2 +- lisp/net/quickurl.el | 2 +- lisp/net/tramp-cmds.el | 2 +- lisp/net/webjump.el | 2 +- lisp/novice.el | 4 ++-- lisp/pcomplete.el | 2 +- lisp/play/bubbles.el | 2 +- lisp/play/decipher.el | 14 +------------ lisp/play/handwrite.el | 2 +- lisp/printing.el | 10 ++++----- lisp/progmodes/antlr-mode.el | 2 +- lisp/progmodes/cc-styles.el | 4 ++-- lisp/progmodes/cmacexp.el | 2 +- lisp/progmodes/ebnf2ps.el | 4 ++-- lisp/progmodes/f90.el | 5 ++--- lisp/progmodes/hideshow.el | 2 +- lisp/progmodes/idlw-complete-structtag.el | 4 ++-- lisp/progmodes/idlw-shell.el | 6 ++---- lisp/progmodes/idlwave.el | 4 ++-- lisp/progmodes/inf-lisp.el | 4 +--- lisp/progmodes/mixal-mode.el | 2 +- lisp/progmodes/octave-mod.el | 4 ++-- lisp/progmodes/perl-mode.el | 4 ++-- lisp/progmodes/prolog.el | 4 +--- lisp/progmodes/sql.el | 15 +++++++------ lisp/progmodes/verilog-mode.el | 4 ++-- lisp/ps-print.el | 2 +- lisp/saveplace.el | 12 +++++------ lisp/shell.el | 2 +- lisp/speedbar.el | 2 +- lisp/startup.el | 27 ++++++++++++++---------- lisp/strokes.el | 9 +------- lisp/term/iris-ansi.el | 2 +- lisp/term/lk201.el | 2 +- lisp/term/rxvt.el | 2 +- lisp/term/tvi970.el | 2 +- lisp/term/wyse50.el | 2 +- lisp/term/xterm.el | 2 +- lisp/textmodes/flyspell.el | 6 +++--- lisp/textmodes/ispell.el | 5 +++-- lisp/textmodes/reftex.el | 4 ++-- lisp/textmodes/rst.el | 2 +- lisp/textmodes/sgml-mode.el | 2 +- lisp/textmodes/table.el | 10 ++++----- lisp/textmodes/two-column.el | 5 +++-- lisp/time-stamp.el | 4 ++-- lisp/url/url-methods.el | 2 +- lisp/vc/pcvs-defs.el | 4 ---- lisp/vc/vc-git.el | 2 +- lisp/windmove.el | 2 +- 104 files changed, 238 insertions(+), 225 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 217187c5e88..275f7908f5d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -4,6 +4,41 @@ (shell-dynamic-complete-functions): Convert to defcustom. (shell-prompt-pattern, shell-completion-fignore): Doc fix. + * bookmark.el (bookmark-bmenu-toggle-filenames): Doc fixes. + * comint.el (comint-prompt-read-only): + * custom.el (defcustom): + * hi-lock.el (hi-lock-mode): + * ibuffer.el (ibuffer-formats): + * ielm.el (ielm-prompt-read-only): + * novice.el (disable-command): + * saveplace.el (toggle-save-place): + * speedbar.el (speedbar-supported-extension-expressions): + * startup.el (auto-save-list-file-prefix, init-file-user) + (after-init-hook, inhibit-startup-echo-area-message): + * strokes.el (strokes-help): + * time-stamp.el (time-stamp): + * calendar/calendar.el (calendar, diary-file): + * calendar/diary-lib.el (diary-mail-entries, diary) + (diary-list-entries-hook): + * calendar/holidays.el (holidays, calendar-holidays): + * calendar/lunar.el (lunar-phases): + * calendar/solar.el (sunrise-sunset): + * emulation/edt.el (edt-load-keys): + * emulation/viper.el (viper-mode): + * eshell/em-alias.el (eshell-command-aliases-list): + * eshell/esh-util.el (eshell-convert-numeric-arguments): + * international/ogonek.el (ogonek-information): + * net/tramp-cmds.el (tramp-bug): + * net/quickurl.el (quickurl-reread-hook-postfix): + * play/decipher.el (decipher-font-lock-keywords): + * progmodes/cc-styles.el (c-set-style): + * progmodes/idlw-shell.el (idlwave-shell-prompt-pattern): + * progmodes/inf-lisp.el (inferior-lisp-prompt): + * progmodes/octave-mod.el (octave-mode): + * progmodes/sql.el (sql-mode, sql-interactive-mode, sql-password): + * progmodes/verilog-mode.el (verilog-read-defines): + * textmodes/two-column.el (2C-mode): Likewise. + 2012-09-16 Katsumi Yamaoka * mail/mailabbrev.el (mail-abbrev-expand-hook): Work for a mail aliasee diff --git a/lisp/align.el b/lisp/align.el index b5c4c442f24..0af5e56c668 100644 --- a/lisp/align.el +++ b/lisp/align.el @@ -74,7 +74,7 @@ ;; align-?-modes variables (for example, `align-dq-string-modes'), use ;; `add-to-list', or some similar function which checks first to see ;; if the value is already there. Since the user may customize that -;; mode list, and then write your mode name into their .emacs file, +;; mode list, and then write your mode name into their init file, ;; causing the symbol already to be present the next time they load ;; your package. diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index fbf8c466585..21c35811ac3 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -36,7 +36,7 @@ ;; setq auto-insert-directory to an appropriate slash-terminated value ;; ;; You can also customize the variable `auto-insert-mode' to load the -;; package. Alternatively, add the following to your .emacs file: +;; package. Alternatively, add the following to your init file: ;; (auto-insert-mode 1) ;; ;; Author: Charlie Martin diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 75a8d9f59dc..31bbc13acf9 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -144,10 +144,7 @@ You can toggle whether files are shown with \\\\[bookma (defcustom bookmark-bmenu-toggle-filenames t "Non-nil means show filenames when listing bookmarks. -This may result in truncated bookmark names. To disable this, put the -following in your `.emacs' file: - -\(setq bookmark-bmenu-toggle-filenames nil)" +A non-nil value may result in truncated bookmark names." :type 'boolean :group 'bookmark) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 2fd5ad6fd9c..c7d93530fd7 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -3483,7 +3483,7 @@ If X is not an error form, return 1." (substring str i)))) str)) -;;; Users can redefine this in their .emacs files. +;;; Users can redefine this in their init files. (defvar calc-keypad-user-menu nil "If non-nil, this describes an additional menu for calc-keypad. It should contain a list of three rows. diff --git a/lisp/calc/calc-forms.el b/lisp/calc/calc-forms.el index dfc5dfc6588..bd748158d66 100644 --- a/lisp/calc/calc-forms.el +++ b/lisp/calc/calc-forms.el @@ -494,7 +494,7 @@ (car res)))))))) -;;; It is safe to redefine these in your .emacs file to use a different +;;; It is safe to redefine these in your init file to use a different ;;; language. (defvar math-long-weekday-names '( "Sunday" "Monday" "Tuesday" "Wednesday" diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index d5514d14a32..cdbf8d7aa86 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -593,7 +593,7 @@ You can customize `diary-date-forms' to your preferred format. Three default styles are provided: `diary-american-date-forms', `diary-european-date-forms', and `diary-iso-date-forms'. You can choose between these by setting `calendar-date-style' in your -.emacs file, or by using `calendar-set-date-style' when in the calendar. +init file, or by using `calendar-set-date-style' when in the calendar. A diary entry can be preceded by the character `diary-nonmarking-symbol' \(ordinarily `&') to make that entry nonmarking--that is, it will not be @@ -1276,7 +1276,7 @@ Runs the following hooks: generating a calendar, if today's date is visible or not, respectively `calendar-initial-window-hook' - after first creating a calendar -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "P") ;; Avoid loading cal-x unless it will be used. (if (and (memq calendar-setup '(one-frame two-frames calendar-only)) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 8fa5b0ddb07..4bce8ec0927 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -200,19 +200,21 @@ holidays), or hard copy output." 'diary-list-entries-hook "23.1") (defcustom diary-list-entries-hook nil - "List of functions called after diary file is culled for relevant entries. -You might wish to add `diary-include-other-diary-files', in which case -you will probably also want to add `diary-mark-included-diary-files' to -`diary-mark-entries-hook'. For example, you could use + "Hook run after diary file is culled for relevant entries. + +If you add `diary-include-other-diary-files' to this hook, you +will probably also want to add `diary-mark-included-diary-files' +to `diary-mark-entries-hook'. For example, to cause the fancy +diary buffer to be displayed with diary entries from various +included files, each day's entries sorted into lexicographic +order, add the following to your init file: (setq diary-display-function 'diary-fancy-display) (add-hook 'diary-list-entries-hook 'diary-include-other-diary-files) (add-hook 'diary-list-entries-hook 'diary-sort-entries t) -in your `.emacs' file to cause the fancy diary buffer to be displayed with -diary entries from various included files, each day's entries sorted into -lexicographic order. Note how the sort function is placed last, -so that it can sort the entries included from other files. +Note how the sort function is placed last, so that it can sort +the entries included from other files. This hook runs after `diary-nongregorian-listing-hook'. These two hooks differ only if you are using included diary files. In that case, @@ -532,7 +534,7 @@ If so, return the expanded file name, otherwise signal an error." "Generate the diary window for ARG days starting with the current date. If no argument is provided, the number of days of diary entries is governed by the variable `diary-number-of-entries'. A value of ARG less than 1 -does nothing. This function is suitable for execution in a `.emacs' file." +does nothing. This function is suitable for execution in an init file." (interactive "P") (diary-check-diary-file) (diary-list-entries (calendar-current-date) @@ -1230,8 +1232,8 @@ Mail is sent to the address specified by `diary-mail-addr'. Here is an example of a script to call `diary-mail-entries', suitable for regular scheduling using cron (or at). Note that -since `emacs -script' does not load your `.emacs' file, you -should ensure that all relevant variables are set. +since `emacs -script' does not load your init file, you should +ensure that all relevant variables are set. #!/usr/bin/emacs -script ;; diary-rem.el - run the Emacs diary-reminder diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index 9643a1e2905..b94815f98ea 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -343,12 +343,12 @@ See the documentation for `calendar-holidays' for details." "List of notable days for the command \\[holidays]. Additional holidays are easy to add to the list, just put them in the -list `holiday-other-holidays' in your .emacs file. Similarly, by setting +list `holiday-other-holidays' in your init file. Similarly, by setting any of `holiday-general-holidays', `holiday-local-holidays', `holiday-christian-holidays', `holiday-hebrew-holidays', `holiday-islamic-holidays', `holiday-bahai-holidays', `holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your -.emacs file, you can eliminate unwanted categories of holidays. +init file, you can eliminate unwanted categories of holidays. The aforementioned variables control the holiday choices offered by the function `holiday-list' when it is called interactively. @@ -523,7 +523,7 @@ use instead of point." (defun holidays (&optional arg) "Display the holidays for last month, this month, and next month. If called with an optional prefix argument ARG, prompts for month and year. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in a init file." (interactive "P") (save-excursion (let* ((completion-ignore-case t) diff --git a/lisp/calendar/lunar.el b/lisp/calendar/lunar.el index 8f09d20f50e..2761df0bdb1 100644 --- a/lisp/calendar/lunar.el +++ b/lisp/calendar/lunar.el @@ -236,7 +236,7 @@ use instead of point." (defun lunar-phases (&optional arg) "Display the quarters of the moon for last month, this month, and next month. If called with an optional prefix argument ARG, prompts for month and year. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "P") (save-excursion (let* ((date (if arg (calendar-read-date t) diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index a8d7d44af3b..3ccdf135fb6 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -797,7 +797,7 @@ If called with an optional prefix argument ARG, prompt for date. If called with an optional double prefix argument, prompt for longitude, latitude, time zone, and date, and always use standard time. -This function is suitable for execution in a .emacs file." +This function is suitable for execution in an init file." (interactive "p") (or arg (setq arg 1)) (if (and (< arg 16) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 2ebb8c7c3ae..3151ce145de 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -49,7 +49,7 @@ ;; If you want Emacs to display the amount of time "left" to your ;; workday in the mode-line, you can either set the value of ;; `timeclock-mode-line-display' to t using M-x customize, or you can -;; add this code to your .emacs file: +;; add this code to your init file: ;; ;; (require 'timeclock) ;; (timeclock-mode-line-display) @@ -60,7 +60,7 @@ ;; You may also want Emacs to ask you before exiting, if you are ;; currently working on a project. This can be done either by setting ;; `timeclock-ask-before-exiting' to t using M-x customize (this is -;; the default), or by adding the following to your .emacs file: +;; the default), or by adding the following to your init file: ;; ;; (add-hook 'kill-emacs-query-functions 'timeclock-query-out) diff --git a/lisp/comint.el b/lisp/comint.el index 5b0eb3027e6..638ef73d53d 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -181,7 +181,7 @@ override the read-only-ness of comint prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may -wish to put something like the following in your `.emacs' file: +wish to put something like the following in your init file: \(add-hook 'comint-mode-hook (lambda () diff --git a/lisp/custom.el b/lisp/custom.el index 1f0729cfd97..01b0e6d1650 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -237,7 +237,7 @@ The following keywords are meaningful: is `default-value'. :require VALUE should be a feature symbol. If you save a value - for this option, then when your `.emacs' file loads the value, + for this option, then when your init file loads the value, it does (require VALUE) first. :set-after VARIABLES Specifies that SYMBOL should be set after the list of variables diff --git a/lisp/desktop.el b/lisp/desktop.el index a873a6b63bf..75deb58b4d8 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -34,7 +34,7 @@ ;; - some local variables ;; To use this, use customize to turn on desktop-save-mode or add the -;; following line somewhere in your .emacs file: +;; following line somewhere in your init file: ;; ;; (desktop-save-mode 1) ;; diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index d1382f42b19..93e890a20c9 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -312,7 +312,7 @@ This uses `defvaralias' and `make-obsolete-variable' (which see). See the Info node `(elisp)Variable Aliases' for more details. If CURRENT-NAME is a defcustom (more generally, any variable -where OBSOLETE-NAME may be set, e.g. in a .emacs file, before the +where OBSOLETE-NAME may be set, e.g. in an init file, before the alias is defined), then the define-obsolete-variable-alias statement should be evaluated before the defcustom, if user customizations are to be respected. The simplest way to achieve diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 532c81c502c..5749ff91b40 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -121,7 +121,7 @@ a future Emacs interpreter will be able to use it.") ;;; Generalized variables. ;; These macros are defined here so that they -;; can safely be used in .emacs files. +;; can safely be used in init files. (defmacro cl-incf (place &optional x) "Increment PLACE by X (1 by default). diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index 7fc24773b9e..87b6bcf0aa9 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -61,7 +61,7 @@ ;; emacs -q -l edt-mapper.el -;; The "-q" option prevents loading of your .emacs file (commands +;; The "-q" option prevents loading of your init file (commands ;; therein might confuse this program). ;; An instruction screen showing the typical LK-201 terminal @@ -74,7 +74,7 @@ ;; and loaded automatically when the EDT emulation is started. If ;; you specify a different file name, you will need to set the ;; variable "edt-keys-file" before starting the EDT emulation. -;; Here's how you might go about doing that in your .emacs file. +;; Here's how you might go about doing that in your init file: ;; (setq edt-keys-file (expand-file-name "~/.my-emacs-keys")) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index dbd13a01a8b..3810dcccbb3 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -48,7 +48,7 @@ ;; You can have the EDT Emulation start up automatically, each time ;; you initiate a GNU Emacs session, by adding the following line to -;; your .emacs file: +;; your init file: ;; ;; (add-hook term-setup-hook 'edt-emulation-on) @@ -75,7 +75,7 @@ ;; default, this feature is enabled, with the top margin set to ;; 10% of the window and the bottom margin set to 15% of the ;; window. To change these settings, you can invoke the function -;; edt-set-scroll-margins in your .emacs file. For example, the +;; edt-set-scroll-margins in your init file. For example, the ;; following line ;; ;; (edt-set-scroll-margins "20%" "25%") @@ -363,7 +363,7 @@ This means that an edt-user.el file was found in the user's `load-path'.") ;;; ;;; (setq edt-keep-current-page-delimiter t) ;;; -;;; in your .emacs file. +;;; in your init file. (defun edt-page-forward (num) "Move forward to just after next page delimiter. @@ -1961,14 +1961,14 @@ created." Ack!! You're running the Enhanced EDT Emulation without loading an EDT key mapping file. To create an EDT key mapping file, run the edt-mapper program. It is safest to run it from an Emacs loaded - without any of your own customizations found in your .emacs file, etc. + without any of your own customizations found in your init file, etc. The reason for this is that some user customizations confuse edt-mapper. You can do this by quitting Emacs and then invoking Emacs again as follows: emacs -q -l edt-mapper - [NOTE: If you do nothing out of the ordinary in your .emacs file, and + [NOTE: If you do nothing out of the ordinary in your init file, and the search for edt-mapper is successful, you can try running it now.] The library edt-mapper includes these same directions on how to diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index b8d07e8b744..d375725af56 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -163,8 +163,8 @@ ;; and type `tpu-edt' followed by a carriage return. ;; If you like TPU-edt and want to use it all the time, you can start -;; TPU-edt using the Emacs initialization file, .emacs. Simply create -;; a .emacs file in your home directory containing the line: +;; TPU-edt using the Emacs initialization file, .emacs. Simply add +;; the following line to your init file: ;; (tpu-edt) @@ -2440,7 +2440,7 @@ If FILE is nil, try to load a default file. The default file names are ;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins -;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "76f06905db4c5bfb3b86491a51512a0e") +;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "bf5e7322f9a2c324a3bb306415813374") ;;; Generated autoloads from tpu-extras.el (autoload 'tpu-cursor-free-mode "tpu-extras" "\ diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el index 521b189e3bc..4cf9eee037b 100644 --- a/lisp/emulation/tpu-extras.el +++ b/lisp/emulation/tpu-extras.el @@ -26,7 +26,7 @@ ;; Use the functions defined here to customize TPU-edt to your tastes by ;; setting scroll margins and/or turning on free cursor mode. Here's an -;; example for your .emacs file. +;; example for your init file. ;; (tpu-set-cursor-free) ; Set cursor free. ;; (tpu-set-scroll-margins "10%" "15%") ; Set scroll margins. diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el index ef4e9b305fc..9cced60816c 100644 --- a/lisp/emulation/tpu-mapper.el +++ b/lisp/emulation/tpu-mapper.el @@ -81,7 +81,7 @@ Finally, you will be prompted for the name of the file to store the key definitions. If you chose the default, TPU-edt will find it and load it automatically. If you specify a different file name, you will need to set the variable ``tpu-xkeys-file'' before starting TPU-edt. Here's how -you might go about doing that in your .emacs file. +you might go about doing that in your init file. (setq tpu-xkeys-file (expand-file-name \"~/.my-emacs-x-keys\")) (tpu-edt) diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index 9bf108c8c38..a59dd610c21 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el @@ -28,7 +28,7 @@ ;; (if (not (or (eq major-mode 'Info-mode) ;; (eq major-mode 'vi-mode))) ;; (vi-mode)))))) -;; 3) In your .emacs file you can define the command "vi-mode" to be "autoload" +;; 3) In your init file you can define the command "vi-mode" to be "autoload" ;; or you can execute the "load" command to load "vi" directly. ;; 4) Read the comments for command "vi-mode" before you start using it. diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 81fbfb0394c..8de253d19b0 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -351,7 +351,7 @@ user decide when to invoke Viper in a major mode." If t, viperize Emacs. If nil -- don't. If `ask', ask the user. This variable is used primarily when Viper is being loaded. -Must be set in `~/.emacs' before Viper is loaded. +Must be set in your init file before Viper is loaded. DO NOT set this variable interactively, unless you are using the customization widget." :type '(choice (const nil) (const t) (const ask)) @@ -1173,7 +1173,7 @@ If you wish to Viperize AND make this your way of life, please put (setq viper-mode t) (require 'viper) -in your .emacs file (preferably, close to the top). +in your init file (preferably, close to the top). These two lines must come in the order given. ** Viper users: diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 37e755e7655..674a6c97eec 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,9 @@ +2012-09-17 Chong Yidong + + * erc-page.el (erc-page-function): + + * erc-stamp.el (erc-stamp): Doc fix. + 2012-08-21 Josh Feinstein * erc-join.el (erc-autojoin-timing): Fix defcustom type. diff --git a/lisp/erc/erc-button.el b/lisp/erc/erc-button.el index c8a7fec32bd..a0593dcb743 100644 --- a/lisp/erc/erc-button.el +++ b/lisp/erc/erc-button.el @@ -25,7 +25,7 @@ ;; Heavily borrowed from gnus-art.el. Thanks to the original authors. ;; This buttonizes nicks and other stuff to make it all clickable. -;; To enable, add to your ~/.emacs: +;; To enable, add to your init file: ;; (require 'erc-button) ;; (erc-button-mode 1) ;; diff --git a/lisp/erc/erc-capab.el b/lisp/erc/erc-capab.el index 4f6361ee923..c7103d6dc61 100644 --- a/lisp/erc/erc-capab.el +++ b/lisp/erc/erc-capab.el @@ -48,7 +48,7 @@ ;;; Usage: -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; (require 'erc-capab) ;; (erc-capab-identify-mode 1) diff --git a/lisp/erc/erc-match.el b/lisp/erc/erc-match.el index cac042c0298..de7f2137197 100644 --- a/lisp/erc/erc-match.el +++ b/lisp/erc/erc-match.el @@ -29,7 +29,7 @@ ;; customizable variables. ;; Usage: -;; Put (erc-match-mode 1) into your ~/.emacs file. +;; Put (erc-match-mode 1) into your init file. ;;; Code: diff --git a/lisp/erc/erc-netsplit.el b/lisp/erc/erc-netsplit.el index 44fbc9563d6..355b345492c 100644 --- a/lisp/erc/erc-netsplit.el +++ b/lisp/erc/erc-netsplit.el @@ -23,7 +23,7 @@ ;;; Commentary: ;; This module hides quit/join messages if a netsplit occurs. -;; To enable, add the following to your ~/.emacs: +;; To enable, add the following to your init file: ;; (require 'erc-netsplit) ;; (erc-netsplit-mode 1) diff --git a/lisp/erc/erc-page.el b/lisp/erc/erc-page.el index e6b670c91ba..51ddc33e1c0 100644 --- a/lisp/erc/erc-page.el +++ b/lisp/erc/erc-page.el @@ -45,7 +45,7 @@ If nil, this prints the page message in the minibuffer and calls `beep'. If non-nil, it must be a function that takes two arguments: SENDER and MSG, both strings. -Example for your ~/.emacs file: +Example for your init file: \(setq erc-page-function (lambda (sender msg) diff --git a/lisp/erc/erc-replace.el b/lisp/erc/erc-replace.el index 04c5885bc3e..6c5804c62a4 100644 --- a/lisp/erc/erc-replace.el +++ b/lisp/erc/erc-replace.el @@ -25,7 +25,7 @@ ;; This module allows you to systematically replace text in incoming ;; messages. Load erc-replace, and customize `erc-replace-alist'. -;; Then add to your ~/.emacs: +;; Then add to your init file: ;; (require 'erc-replace) ;; (erc-replace-mode 1) diff --git a/lisp/erc/erc-stamp.el b/lisp/erc/erc-stamp.el index 5831233affe..4ce2f18e041 100644 --- a/lisp/erc/erc-stamp.el +++ b/lisp/erc/erc-stamp.el @@ -43,7 +43,7 @@ group provides settings related to the format and display of timestamp information in `erc-mode' buffer. For timestamping to be activated, you just need to load `erc-stamp' -in your .emacs file or interactively using `load-library'." +in your init file or interactively using `load-library'." :group 'erc) (defcustom erc-timestamp-format "[%H:%M]" diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index 9c56c724224..88a3285730d 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -24,7 +24,7 @@ ;;; Commentary: ;; Highlights keywords and pals (friends), and hides or highlights fools -;; (using a dark color). Add to your ~/.emacs: +;; (using a dark color). Add to your init file: ;; (require 'erc-track) ;; (erc-track-mode 1) diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 4b62fec95e6..940056b6438 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el @@ -133,10 +133,10 @@ Each element of this alias is a list of the form: Where NAME is the textual name of the alias, and DEFINITION is the command string to replace that command with. -Note: this list should not be modified in your '.emacs' file. Rather, -any desired alias definitions should be declared using the `alias' -command, which will automatically write them to the file named by -`eshell-aliases-file'.") +Note: this list should not be modified in your init file. +Rather, any desired alias definitions should be declared using +the `alias' command, which will automatically write them to the +file named by `eshell-aliases-file'.") (put 'eshell-command-aliases-list 'risky-local-variable t) diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index 8218e91ddc7..fa0336232f9 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -84,7 +84,7 @@ Numeric form is tested using the regular expression NOTE: If you find that numeric conversions are interfering with the specification of filenames (for example, in calling `find-file', or some other Lisp function that deals with files, not numbers), add the -following in your .emacs file: +following in your init file: (put 'find-file 'eshell-no-numeric-conversions t) diff --git a/lisp/ffap.el b/lisp/ffap.el index ebe8b6dee94..f3e8d4c194e 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -34,7 +34,7 @@ ;; README's, MANIFEST's, and so on. Submit bugs or suggestions with ;; M-x ffap-bug. ;; -;; For the default installation, add this line to your .emacs file: +;; For the default installation, add this line to your init file: ;; ;; (ffap-bindings) ; do default key bindings ;; @@ -206,7 +206,7 @@ Sensible values are nil, \"news\", or \"mailto\"." ;; those features interesting but not clear winners (a matter of ;; personal taste) I try to leave options to enable them. Read ;; through this section for features that you like, put an appropriate -;; enabler in your .emacs file. +;; enabler in your init file. (defcustom ffap-dired-wildcards "[*?][^/]*\\'" "A regexp matching filename wildcard characters, or nil. diff --git a/lisp/filesets.el b/lisp/filesets.el index 6c24a4f43d6..a91d8cf0fcb 100644 --- a/lisp/filesets.el +++ b/lisp/filesets.el @@ -35,7 +35,7 @@ ;; inclusion group (i.e. a base file including other files). ;; Usage: -;; 1. Put (require 'filesets) and (filesets-init) in your .emacs file. +;; 1. Put (require 'filesets) and (filesets-init) in your init file. ;; 2. Type ;; M-x filesets-edit or choose "Edit Filesets" from the menu. ;; 3. Save your customizations. diff --git a/lisp/flow-ctrl.el b/lisp/flow-ctrl.el index 747a4ca018c..b301886de5b 100644 --- a/lisp/flow-ctrl.el +++ b/lisp/flow-ctrl.el @@ -31,7 +31,7 @@ ;; ;; To invoke these adjustments, a user need only invoke the function ;; enable-flow-control-on with a list of terminal types in his/her own -;; .emacs file. As arguments, give it the names of one or more terminal +;; init file. As arguments, give it the names of one or more terminal ;; types in use by that user which require flow control adjustments. ;; Here's an example: ;; diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 77c21d26535..6404af7703a 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -37,7 +37,7 @@ ;; When this minor mode is on, the faces of the current line are updated with ;; every insertion or deletion. ;; -;; To turn Font Lock mode on automatically, add this to your ~/.emacs file: +;; To turn Font Lock mode on automatically, add this to your init file: ;; ;; (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) ;; diff --git a/lisp/frame.el b/lisp/frame.el index c182a964820..0bef358ecfb 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -301,7 +301,7 @@ there (in decreasing order of priority)." ;; existing frame. We need to explicitly include ;; default-frame-alist in the parameters of the screen we ;; create here, so that its new value, gleaned from the user's - ;; .emacs file, will be applied to the existing screen. + ;; init file, will be applied to the existing screen. (if (not (eq (cdr (or (assq 'minibuffer initial-frame-alist) (assq 'minibuffer window-system-frame-alist) (assq 'minibuffer default-frame-alist) diff --git a/lisp/generic-x.el b/lisp/generic-x.el index cc7963b1711..a97c5649c95 100644 --- a/lisp/generic-x.el +++ b/lisp/generic-x.el @@ -28,7 +28,7 @@ ;; ;; INSTALLATION: ;; -;; Add this line to your .emacs file: +;; Add this line to your init file: ;; ;; (require 'generic-x) ;; diff --git a/lisp/hi-lock.el b/lisp/hi-lock.el index 644024a4b86..f92e2ab0af2 100644 --- a/lisp/hi-lock.el +++ b/lisp/hi-lock.el @@ -52,14 +52,14 @@ ;; ;; Setup: ;; -;; Put the following code in your .emacs file. This turns on +;; Put the following code in your init file. This turns on ;; hi-lock mode and adds a "Regexp Highlighting" entry ;; to the edit menu. ;; ;; (global-hi-lock-mode 1) ;; ;; To enable the use of patterns found in files (presumably placed -;; there by hi-lock) include the following in your .emacs file: +;; there by hi-lock) include the following in your init file: ;; ;; (setq hi-lock-file-patterns-policy 'ask) ;; @@ -356,7 +356,7 @@ Hi-lock: end is found. A mode is excluded if it's in the list "Possible archaic use of (hi-lock-mode). Use (global-hi-lock-mode 1) in .emacs to enable hi-lock for all buffers, use (hi-lock-mode 1) for individual buffers. For compatibility with Emacs -versions before 22 use the following in your .emacs file: +versions before 22 use the following in your init file: (if (functionp 'global-hi-lock-mode) (global-hi-lock-mode 1) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index c6e799252a2..77461469044 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -123,13 +123,13 @@ own!): no upper limit on its size. The size will also be aligned to the right. -Thus, if you wanted to use these two formats, add +Thus, if you wanted to use these two formats, the appropriate +value for this variable would be - (setq ibuffer-formats '((mark \" \" name) - (mark modified read-only - (name 16 16 :left) (size 6 -1 :right)))) - -to your ~/.emacs file. + '((mark \" \" name) + (mark modified read-only + (name 16 16 :left) + (size 6 -1 :right))) Using \\[ibuffer-switch-format], you can rotate the display between the specified formats in the list." diff --git a/lisp/ielm.el b/lisp/ielm.el index c93f235d81f..ba05bbcfc0f 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -59,7 +59,7 @@ override the read-only-ness of IELM prompts is to call `comint-kill-whole-line' or `comint-kill-region' with no narrowing in effect. This way you will be certain that none of the remaining prompts will be accidentally messed up. You may -wish to put something like the following in your `.emacs' file: +wish to put something like the following in your init file: \(add-hook 'ielm-mode-hook (lambda () diff --git a/lisp/international/ogonek.el b/lisp/international/ogonek.el index 39a88001112..3c34e5d9a2a 100644 --- a/lisp/international/ogonek.el +++ b/lisp/international/ogonek.el @@ -224,13 +224,14 @@ The functions come in the following groups. ogonek-prefix-to-encoding iso8859-2 The above default values can be changed by placing appropriate settings - in the '~/.emacs' file: + in your init file: (setq ogonek-prefix-char ?/) (setq ogonek-prefix-to-encoding \"iso8859-2\") - Instead of loading the whole library `ogonek' it may be better to - autoload the needed functions, for example by placing in `~/.emacs': + Instead of loading the whole library `ogonek' it may be better + to autoload the needed functions, for example by adding the + following lines to your init file: (autoload 'ogonek-how \"ogonek\") (autoload 'ogonek-recode-region \"ogonek\") diff --git a/lisp/locate.el b/lisp/locate.el index 29d7c75cbb2..d172ce3d6c4 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -34,7 +34,7 @@ ;; ;; SHELLPROGRAM Name-to-find ;; -;; set the variable `locate-command' in your .emacs file. +;; set the variable `locate-command' in your init file. ;; ;; To use a more complicated expression, create a function which ;; takes a string (the name to find) as input and returns a list. diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 520271940f2..4305094611a 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -139,9 +139,8 @@ ;; feedmail-send-it. Hers's the best way to use the stuff in this ;; file: ;; -;; Save this file as feedmail.el somewhere on your elisp -;; loadpath; byte-compile it. Put the following lines somewhere in -;; your ~/.emacs stuff: +;; Save this file as feedmail.el somewhere on your elisp loadpath; +;; byte-compile it. Put the following lines in your init file: ;; ;; (setq send-mail-function 'feedmail-send-it) ;; (autoload 'feedmail-send-it "feedmail") diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el index dd489e3c6a9..40d67b4e904 100644 --- a/lisp/mail/mail-hist.el +++ b/lisp/mail/mail-hist.el @@ -28,7 +28,7 @@ ;; time. ;; ;; To use this package, put it in a directory in your load-path, and -;; put this in your .emacs file: +;; put this in your init file: ;; ;; (load "mail-hist" nil t) ;; diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el index fdfe17a1a07..3d7495ffd1a 100644 --- a/lisp/mail/uce.el +++ b/lisp/mail/uce.el @@ -63,7 +63,7 @@ ;; Usage: ;; Place uce.el in your load-path (and optionally byte-compile it). -;; Add the following line to your ~/.emacs: +;; Add the following line to your init file: ;; (autoload 'uce-reply-to-uce "uce" "Reply to UCEs" t nil) ;; If you want to use it with Gnus rather than Rmail: ;; (setq uce-mail-reader 'gnus) diff --git a/lisp/mouse-copy.el b/lisp/mouse-copy.el index 8d043b4495f..a8e32bec1ae 100644 --- a/lisp/mouse-copy.el +++ b/lisp/mouse-copy.el @@ -35,7 +35,7 @@ ;; If you like mouse-copy, you should also check out mouse-drag ;; for ``one-click scrolling''. ;; -;; To use mouse-copy, place the following in your .emacs file: +;; To use mouse-copy, place the following in your init file: ;; (require 'mouse-copy) ;; (global-set-key [M-down-mouse-1] 'mouse-drag-secondary-pasting) ;; (global-set-key [M-S-down-mouse-1] 'mouse-drag-secondary-moving) diff --git a/lisp/mouse-drag.el b/lisp/mouse-drag.el index 7fb10505355..acdad9a42cf 100644 --- a/lisp/mouse-drag.el +++ b/lisp/mouse-drag.el @@ -46,7 +46,7 @@ ;; If you like mouse-drag, you should also check out mouse-copy ;; for ``one-click text copy and move''. ;; -;; To use mouse-drag, place the following in your .emacs file: +;; To use mouse-drag, place the following in your init file: ;; -either- ;; (global-set-key [down-mouse-2] 'mouse-drag-throw) ;; -or- diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 1501fa41baa..265a855b842 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -79,7 +79,7 @@ ;; that this change will take effect for the current GNU Emacs session only. ;; See below for a discussion of non-UNIX hosts. If a large number of ;; machines with similar hostnames have this problem then it is easier to set -;; the value of ange-ftp-dumb-unix-host-regexp in your .emacs file. ange-ftp +;; the value of ange-ftp-dumb-unix-host-regexp in your init file. ange-ftp ;; is unable to automatically recognize dumb unix hosts. ;; File name completion: @@ -275,10 +275,10 @@ ;; VMS support: ;; -;; Ange-ftp has full support for VMS hosts. It -;; should be able to automatically recognize any VMS machine. However, if it -;; fails to do this, you can use the command ange-ftp-add-vms-host. As well, -;; you can set the variable ange-ftp-vms-host-regexp in your .emacs file. We +;; Ange-ftp has full support for VMS hosts. It should be able to +;; automatically recognize any VMS machine. However, if it fails to do +;; this, you can use the command ange-ftp-add-vms-host. Also, you can +;; set the variable ange-ftp-vms-host-regexp in your init file. We ;; would be grateful if you would report any failures to automatically ;; recognize a VMS host as a bug. ;; @@ -332,7 +332,7 @@ ;; the Michigan terminal system. It should be able to automatically ;; recognize any MTS machine. However, if it fails to do this, you can use ;; the command ange-ftp-add-mts-host. As well, you can set the variable -;; ange-ftp-mts-host-regexp in your .emacs file. We would be grateful if you +;; ange-ftp-mts-host-regexp in your init file. We would be grateful if you ;; would report any failures to automatically recognize a MTS host as a bug. ;; ;; Filename syntax: @@ -358,7 +358,7 @@ ;; CMS. It should be able to automatically recognize any CMS machine. ;; However, if it fails to do this, you can use the command ;; ange-ftp-add-cms-host. As well, you can set the variable -;; ange-ftp-cms-host-regexp in your .emacs file. We would be grateful if you +;; ange-ftp-cms-host-regexp in your init file. We would be grateful if you ;; would report any failures to automatically recognize a CMS host as a bug. ;; ;; Filename syntax: diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index d1d33bfe566..c1c83d2245e 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -122,8 +122,7 @@ ;; the buffer, use: ;; M-x browse-url -;; To display a URL by shift-clicking on it, put this in your ~/.emacs -;; file: +;; To display a URL by shift-clicking on it, put this in your init file: ;; (global-set-key [S-mouse-2] 'browse-url-at-mouse) ;; (Note that using Shift-mouse-1 is not desirable because ;; that event has a standard meaning in Emacs.) diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el index 6a9d80f9672..f9e31788527 100644 --- a/lisp/net/goto-addr.el +++ b/lisp/net/goto-addr.el @@ -33,7 +33,7 @@ ;; INSTALLATION ;; ;; To use goto-address in a particular mode (for example, while -;; reading mail in mh-e), add something like this in your .emacs file: +;; reading mail in mh-e), add this to your init file: ;; ;; (add-hook 'mh-show-mode-hook 'goto-address) ;; diff --git a/lisp/net/newsticker.el b/lisp/net/newsticker.el index 5d673faf0db..91eca84ce53 100644 --- a/lisp/net/newsticker.el +++ b/lisp/net/newsticker.el @@ -87,7 +87,7 @@ ;; If you are using Newsticker as part of GNU Emacs there is no need to ;; perform any installation steps in order to use Newsticker. Otherwise ;; place Newsticker in a directory where Emacs can find it. Add the -;; following line to your Emacs startup file (`~/.emacs'). +;; following line to your init file: ;; (add-to-list 'load-path "/path/to/newsticker/") ;; (autoload 'newsticker-start "newsticker" "Emacs Newsticker" t) ;; (autoload 'newsticker-show-news "newsticker" "Emacs Newsticker" t) diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index f3b0e372de4..f7d41fcd97a 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -164,7 +164,7 @@ To make use of this do something like: (setq quickurl-postfix quickurl-reread-hook-postfix) -in your ~/.emacs (after loading/requiring quickurl).") +in your init file (after loading/requiring quickurl).") ;; Non-customize variables. diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el index 06aae1f6af2..abca6b3ea01 100644 --- a/lisp/net/tramp-cmds.el +++ b/lisp/net/tramp-cmds.el @@ -204,7 +204,7 @@ useful thing to do is to put (setq tramp-verbose 9) -in the ~/.emacs file and to repeat the bug. Then, include the +in your init file and to repeat the bug. Then, include the contents of the *tramp/foo* buffer and the *debug tramp/foo* buffer in your bug report. diff --git a/lisp/net/webjump.el b/lisp/net/webjump.el index 232e5ca581a..d5de2f410c5 100644 --- a/lisp/net/webjump.el +++ b/lisp/net/webjump.el @@ -38,7 +38,7 @@ ;; example sites. You'll probably want to override it with your own favorite ;; sites. The documentation for the variable describes the syntax. -;; You may wish to add something like the following to your `.emacs' file: +;; You may wish to add something like the following to your init file: ;; ;; (require 'webjump) ;; (global-set-key "\C-cj" 'webjump) diff --git a/lisp/novice.el b/lisp/novice.el index bcc94c86c9d..c621ac4b692 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -159,8 +159,8 @@ to future sessions." (defun disable-command (command) "Require special confirmation to execute COMMAND from now on. COMMAND must be a symbol. -This command alters the user's .emacs file so that this will apply -to future sessions." +This command alters your init file so that this choice applies to +future sessions." (interactive "CDisable command: ") (en/disable-command command t)) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index d357da685e5..97d8b4652a9 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -28,7 +28,7 @@ ;; argument position. ;; ;; To use pcomplete with shell-mode, for example, you will need the -;; following in your .emacs file: +;; following in your init file: ;; ;; (add-hook 'shell-mode-hook 'pcomplete-shell-setup) ;; diff --git a/lisp/play/bubbles.el b/lisp/play/bubbles.el index 1f04099a6ae..3b6035473fd 100644 --- a/lisp/play/bubbles.el +++ b/lisp/play/bubbles.el @@ -33,7 +33,7 @@ ;; Installation ;; ------------ -;; Add the following lines to your Emacs startup file (`~/.emacs'). +;; Add the following lines to your init file: ;; (add-to-list 'load-path "/path/to/bubbles/") ;; (autoload 'bubbles "bubbles" "Play Bubbles" t) diff --git a/lisp/play/decipher.el b/lisp/play/decipher.el index 8d9506a1614..ade0d15006a 100644 --- a/lisp/play/decipher.el +++ b/lisp/play/decipher.el @@ -138,19 +138,7 @@ the tail of the list." ("^)\\([A-Z ]+\\)\\([a-z ]+\\)" (1 font-lock-keyword-face) (2 font-lock-string-face))) - "Expressions to fontify in Decipher mode. - -Ciphertext uses `font-lock-keyword-face', plaintext uses -`font-lock-string-face', comments use `font-lock-comment-face', and -checkpoints use `font-lock-constant-face'. You can customize the -display by changing these variables. For best results, I recommend -that all faces use the same background color. - -For example, to display ciphertext in the `bold' face, use - (add-hook 'decipher-mode-hook - (lambda () (set (make-local-variable 'font-lock-keyword-face) - 'bold))) -in your `.emacs' file.") + "Font Lock keywords for Decipher mode.") (defvar decipher-mode-map (let ((map (make-keymap))) diff --git a/lisp/play/handwrite.el b/lisp/play/handwrite.el index d2e307c0145..85c128b08e2 100644 --- a/lisp/play/handwrite.el +++ b/lisp/play/handwrite.el @@ -45,7 +45,7 @@ ;; Installation ;; ;; type at your prompt "emacs -l handwrite.el" or put this file on your -;; Emacs-Lisp load path, add the following into your ~/.emacs startup file +;; Emacs-Lisp load path, add the following into your init file: ;; ;; (require 'handwrite) ;; diff --git a/lisp/printing.el b/lisp/printing.el index 0152ed63dbb..02b2fb0139c 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -139,10 +139,9 @@ Please send all bug fixes and enhancements to ;; ;; One way to set variables is by calling `pr-customize', customize all ;; variables and save the customization by future sessions (see Options -;; section). Other way is by coding your settings on Emacs init file (that is, -;; ~/.emacs file), see below for a first setting template that it should be -;; inserted on your ~/.emacs file (or c:/_emacs, if you're using Windows 9x/NT -;; or MS-DOS): +;; section). Other way is by adding code to your init file; see below +;; for a first setting template that it should be inserted on your +;; init file: ;; ;; * Example of setting for Windows system: ;; @@ -297,8 +296,7 @@ Please send all bug fixes and enhancements to ;; Using `printing' ;; ---------------- ;; -;; To use `printing' insert in your ~/.emacs file (or c:/_emacs, if you're -;; using Windows 9x/NT or MS-DOS): +;; To use `printing' insert in your init file: ;; ;; (require 'printing) ;; ;; ...some user settings... diff --git a/lisp/progmodes/antlr-mode.el b/lisp/progmodes/antlr-mode.el index 4062646c967..5a054af9883 100644 --- a/lisp/progmodes/antlr-mode.el +++ b/lisp/progmodes/antlr-mode.el @@ -69,7 +69,7 @@ ;; This file requires Emacs-20.3, XEmacs-20.4 or higher and package cc-mode. ;; If antlr-mode is not part of your distribution, put this file into your -;; load-path and the following into your ~/.emacs: +;; load-path and the following into your init file: ;; (autoload 'antlr-mode "antlr-mode" nil t) ;; (setq auto-mode-alist (cons '("\\.g\\'" . antlr-mode) auto-mode-alist)) ;; (add-hook 'speedbar-load-hook ; would be too late in antlr-mode.el diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index cf628e44de0..20aa2bc2775 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -352,8 +352,8 @@ might get set too. If DONT-OVERRIDE is neither nil nor t, style variables whose default values have been set (more precisely, whose default values are not the symbol `set-from-style') will not be changed. This avoids overriding global settings -done in ~/.emacs. It is useful to call c-set-style from a mode hook in this -way. +done in your init file. It is useful to call c-set-style from a mode hook +in this way. If DONT-OVERRIDE is t, style variables that already have values (i.e., whose values are not the symbol `set-from-style') will not be overridden. CC Mode diff --git a/lisp/progmodes/cmacexp.el b/lisp/progmodes/cmacexp.el index 943b5c6a067..525b1c9671e 100644 --- a/lisp/progmodes/cmacexp.el +++ b/lisp/progmodes/cmacexp.el @@ -49,7 +49,7 @@ ;; INSTALLATION ====================================================== -;; Put the following in your ~/.emacs file. +;; Put the following in your init file. ;; If you want the *Macroexpansion* window to be not higher than ;; necessary: diff --git a/lisp/progmodes/ebnf2ps.el b/lisp/progmodes/ebnf2ps.el index cdbaf4708a7..0f18cffc3de 100644 --- a/lisp/progmodes/ebnf2ps.el +++ b/lisp/progmodes/ebnf2ps.el @@ -43,7 +43,7 @@ Please send all bug fixes and enhancements to ;; ;; This package translates an EBNF to a syntactic chart on PostScript. ;; -;; To use ebnf2ps, insert in your ~/.emacs: +;; To use ebnf2ps, insert in your init file: ;; ;; (require 'ebnf2ps) ;; @@ -772,7 +772,7 @@ Please send all bug fixes and enhancements to ;; ;; To set the above options you may: ;; -;; a) insert the code in your ~/.emacs, like: +;; a) insert the code in your init file, like: ;; ;; (setq ebnf-terminal-shape 'bevel) ;; diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index cc1251f6a75..f42952685d0 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -102,10 +102,9 @@ ;; (abbrev-mode 1) ; turn on abbreviation mode ;; (f90-add-imenu-menu) ; extra menu with functions etc. ;; (if f90-auto-keyword-case ; change case of all keywords on startup -;; (f90-change-keywords f90-auto-keyword-case)) -;; )) +;; (f90-change-keywords f90-auto-keyword-case)))) ;; -;; in your .emacs file. You can also customize the lists +;; in your init file. You can also customize the lists ;; f90-font-lock-keywords, etc. ;; ;; The auto-fill and abbreviation minor modes are accessible from the F90 menu, diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index 233b9a5212e..2a77ad013c7 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -52,7 +52,7 @@ ;; ;; First make sure hideshow.el is in a directory in your `load-path'. ;; You can optionally byte-compile it using `M-x byte-compile-file'. -;; Then, add the following to your ~/.emacs: +;; Then, add the following to your init file: ;; ;; (load-library "hideshow") ;; (add-hook 'X-mode-hook ; other modes similarly diff --git a/lisp/progmodes/idlw-complete-structtag.el b/lisp/progmodes/idlw-complete-structtag.el index 246ba8f29cd..24613d14634 100644 --- a/lisp/progmodes/idlw-complete-structtag.el +++ b/lisp/progmodes/idlw-complete-structtag.el @@ -53,8 +53,8 @@ ;; ;; INSTALLATION ;; ============ -;; Put this file on the emacs load path and load it with the following -;; line in your .emacs file: +;; Put this file on the emacs load path and load it with the following +;; line in your init file: ;; ;; (add-hook 'idlwave-load-hook ;; (lambda () (require 'idlw-complete-structtag))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index 4f9109284ae..08d1461c008 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -48,7 +48,7 @@ ;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following -;; lines to your .emacs file: +;; lines to your init file: ;; ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) ;; @@ -111,9 +111,7 @@ For example, \"^\r?IDL> \" or \"^\r?WAVE> \". The \"^\r?\" is needed, to indicate the beginning of the line, with optional return character (which IDL seems to output randomly). This variable is used to initialize `comint-prompt-regexp' in the -process buffer. - -This is a fine thing to set in your `.emacs' file." +process buffer." :group 'idlwave-shell-general-setup :type 'regexp) diff --git a/lisp/progmodes/idlwave.el b/lisp/progmodes/idlwave.el index a35ffd3e45d..9b634328fa7 100644 --- a/lisp/progmodes/idlwave.el +++ b/lisp/progmodes/idlwave.el @@ -51,7 +51,7 @@ ;; ;; Follow the instructions in the INSTALL file of the distribution. ;; In short, put this file on your load path and add the following -;; lines to your .emacs file: +;; lines to your init file: ;; ;; (autoload 'idlwave-mode "idlwave" "IDLWAVE Mode" t) ;; (autoload 'idlwave-shell "idlw-shell" "IDLWAVE Shell" t) @@ -746,7 +746,7 @@ or even '?'. '.' is not a good choice because it can make structure field names act like abbrevs in certain circumstances. Changes to this in `idlwave-mode-hook' will have no effect. Instead a user -must set it directly using `setq' in the .emacs file before idlwave.el +must set it directly using `setq' in the init file before idlwave.el is loaded." :group 'idlwave-abbrev-and-indent-action :type 'string) diff --git a/lisp/progmodes/inf-lisp.el b/lisp/progmodes/inf-lisp.el index cd6c8869d9f..401970b2ce8 100644 --- a/lisp/progmodes/inf-lisp.el +++ b/lisp/progmodes/inf-lisp.el @@ -168,9 +168,7 @@ This variable is only used if the variable More precise choices: Lucid Common Lisp: \"^\\\\(>\\\\|\\\\(->\\\\)+\\\\) *\" franz: \"^\\\\(->\\\\|<[0-9]*>:\\\\) *\" -kcl: \"^>+ *\" - -This is a fine thing to set in your .emacs file or through Custom." +kcl: \"^>+ *\"" :type 'regexp :group 'inferior-lisp) diff --git a/lisp/progmodes/mixal-mode.el b/lisp/progmodes/mixal-mode.el index 54d857dd4b1..a59176a5aa6 100644 --- a/lisp/progmodes/mixal-mode.el +++ b/lisp/progmodes/mixal-mode.el @@ -32,7 +32,7 @@ ;; GNU MDK from `https://savannah.gnu.org/projects/mdk/' and ;; `ftp://ftp.gnu.org/pub/gnu/mdk'. ;; -;; To use this mode, place the following in your .emacs file: +;; To use this mode, place the following in your init file: ;; `(load-file "/PATH-TO-FILE/mixal-mode.el")'. ;; When you load a file with the extension .mixal the mode will be started ;; automatic. If you want to start the mode manual, use `M-x mixal-mode'. diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el index 79b3fcee720..ab5a19f8a2f 100644 --- a/lisp/progmodes/octave-mod.el +++ b/lisp/progmodes/octave-mod.el @@ -585,12 +585,12 @@ Variables you can use to customize Octave mode Turning on Octave mode runs the hook `octave-mode-hook'. To begin using this mode for all `.m' files that you edit, add the -following lines to your `.emacs' file: +following lines to your init file: (add-to-list 'auto-mode-alist '(\"\\\\.m\\\\'\" . octave-mode)) To automatically turn on the abbrev and auto-fill features, -add the following lines to your `.emacs' file as well: +add the following lines to your init file as well: (add-hook 'octave-mode-hook (lambda () diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index e13b67e596d..3dd9a48bb33 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -28,14 +28,14 @@ ;;; Commentary: ;; To enter perl-mode automatically, add (autoload 'perl-mode "perl-mode") -;; to your .emacs file and change the first line of your perl script to: +;; to your init file and change the first line of your perl script to: ;; #!/usr/bin/perl -- # -*-Perl-*- ;; With arguments to perl: ;; #!/usr/bin/perl -P- # -*-Perl-*- ;; To handle files included with do 'filename.pl';, add something like ;; (setq auto-mode-alist (append (list (cons "\\.pl\\'" 'perl-mode)) ;; auto-mode-alist)) -;; to your .emacs file; otherwise the .pl suffix defaults to prolog-mode. +;; to your init file; otherwise the .pl suffix defaults to prolog-mode. ;; This code is based on the 18.53 version c-mode.el, with extensive ;; rewriting. Most of the features of c-mode survived intact. diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el index 16d85cb2d79..33d43cb3d5a 100644 --- a/lisp/progmodes/prolog.el +++ b/lisp/progmodes/prolog.el @@ -60,9 +60,7 @@ ;;; Installation: ;; -;; Insert the following lines in your init file--typically ~/.emacs -;; (GNU Emacs and XEmacs <21.4), or ~/.xemacs/init.el (XEmacs -;; 21.4)--to use this mode when editing Prolog files under Emacs: +;; Insert the following lines in your init file: ;; ;; (setq load-path (cons "/usr/lib/xemacs/site-lisp" load-path)) ;; (autoload 'run-prolog "prolog" "Start a Prolog sub-process." t) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index f3ecbe3fc3d..3d5abc4df62 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -268,9 +268,8 @@ (defcustom sql-password "" "Default password. - -Storing your password in a textfile such as ~/.emacs could be dangerous. -Customizing your password will store it in your ~/.emacs file." +If you customize this, the value will be stored in your init +file. Since that is a plaintext file, this could be dangerous." :type 'string :group 'SQL :risky t) @@ -1285,8 +1284,8 @@ Based on `comint-mode-map'.") ["List all objects" sql-list-all (sql-get-product-feature sql-product :list-all)] ["List table details" sql-list-table (sql-get-product-feature sql-product :list-table)])) -;; Abbreviations -- if you want more of them, define them in your -;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too. +;; Abbreviations -- if you want more of them, define them in your init +;; file. Abbrevs have to be enabled in your init file, too. (defvar sql-mode-abbrev-table nil "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") @@ -3715,8 +3714,8 @@ For information on how to create multiple SQLi buffers, see `sql-interactive-mode'. Note that SQL doesn't have an escape character unless you specify -one. If you specify backslash as escape character in SQL, -you must tell Emacs. Here's how to do that in your `~/.emacs' file: +one. If you specify backslash as escape character in SQL, you +must tell Emacs. Here's how to do that in your init file: \(add-hook 'sql-mode-hook (lambda () @@ -3806,7 +3805,7 @@ cause the window to scroll to the end of the buffer. If you want to make SQL buffers limited in length, add the function `comint-truncate-buffer' to `comint-output-filter-functions'. -Here is an example for your .emacs file. It keeps the SQLi buffer a +Here is an example for your init file. It keeps the SQLi buffer a certain length. \(add-hook 'sql-interactive-mode-hook diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index c072754e66d..835d548c19f 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -8790,7 +8790,7 @@ Note these are only read when the file is first visited, you must use \\[find-alternate-file] RET to have these take effect after editing them! If you want to disable the \"Process `eval' or hook local variables\" -warning message, you need to add to your .emacs file: +warning message, you need to add to your init file: (setq enable-local-eval t)" (let ((origbuf (current-buffer))) @@ -11756,7 +11756,7 @@ An example: // For this example we declare the function in the // module's file itself. Often you'd define it instead - // in a site-start.el or .emacs file. + // in a site-start.el or init file. /* Local Variables: eval: diff --git a/lisp/ps-print.el b/lisp/ps-print.el index addf2975c5f..930e750ab27 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -1042,7 +1042,7 @@ Please send all bug fixes and enhancements to ;; variables `ps-bold-faces', `ps-italic-faces' and `ps-underlined-faces'. ;; These variables contain lists of faces that ps-print should consider bold, ;; italic or underline; to set them, put code like the following into your -;; .emacs file: +;; init file: ;; ;; (setq ps-bold-faces '(my-blue-face)) ;; (setq ps-italic-faces '(my-red-face)) diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 43dad63a140..0c082169462 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -56,13 +56,12 @@ This means when you visit a file, point goes to the last place where it was when you previously visited the same file. This variable is automatically buffer-local. -If you wish your place in any file to always be automatically saved, -simply put this in your `~/.emacs' file: +If you wish your place in any file to always be automatically +saved, set this to t using the Customize facility, or put the +following code in your init file: \(setq-default save-place t) -\(require 'saveplace) - -or else use the Custom facility to set this option." +\(require 'saveplace)" :type 'boolean :require 'saveplace :group 'save-place) @@ -148,7 +147,8 @@ even in a later Emacs session. If called with a prefix arg, the mode is enabled if and only if the argument is positive. -To save places automatically in all files, put this in your `.emacs' file: +To save places automatically in all files, put this in your init +file: \(setq-default save-place t\)" (interactive "P") diff --git a/lisp/shell.el b/lisp/shell.el index 8c80712eed6..77a42389785 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -46,7 +46,7 @@ ;; YOUR .EMACS FILE ;;============================================================================= -;; Some suggestions for your .emacs file. +;; Some suggestions for your init file. ;; ;; ;; Define M-# to run some strange command: ;; (eval-after-load "shell" diff --git a/lisp/speedbar.el b/lisp/speedbar.el index 90cdea63e85..25a6fbfd998 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el @@ -706,7 +706,7 @@ will be stripped by a simplified optimizer when compiled into a singular expression. This variable will be turned into `speedbar-file-regexp' for use with speedbar. You should use the function `speedbar-add-supported-extension' to add a new extension at -runtime, or use the configuration dialog to set it in your .emacs file. +runtime, or use the configuration dialog to set it in your init file. If you add an extension to this list, and it does not appear, you may need to also modify `completion-ignored-extension' which will also help file completion." diff --git a/lisp/startup.el b/lisp/startup.el index 348e653dd28..db5efb89eed 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -71,12 +71,13 @@ once you are familiar with the contents of the startup screen." "Non-nil inhibits the initial startup echo area message. Setting this variable takes effect only if you do it with the customization buffer -or if your `.emacs' file contains a line of this form: +or if your init file contains a line of this form: (setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\") -If your `.emacs' file is byte-compiled, use the following form instead: +If your init file is byte-compiled, use the following form +instead: (eval '(setq inhibit-startup-echo-area-message \"YOUR-USER-NAME\")) -Thus, someone else using a copy of your `.emacs' file will see -the startup message unless he personally acts to inhibit it." +Thus, someone else using a copy of your init file will see the +startup message unless he personally acts to inhibit it." :type '(choice (const :tag "Don't inhibit") (string :tag "Enter your user name, to inhibit")) :group 'initialization) @@ -261,10 +262,14 @@ and VALUE is the value which is given to that frame parameter "Normal hook run after handling urgent options but before loading init files.") (defvar after-init-hook nil - "Normal hook run after loading the init files, `~/.emacs' and `default.el'. -There is no `condition-case' around the running of these functions; -therefore, if you set `debug-on-error' non-nil in `.emacs', -an error in one of these functions will invoke the debugger.") + "Normal hook run after initializing the Emacs session. +It is run after Emacs loads the init file, `default' library, the +abbrevs file, and additional Lisp packages (if any), and setting +the value of `after-init-time'. + +There is no `condition-case' around the running of this hook; +therefore, if `debug-on-error' is non-nil, an error in one of +these functions will invoke the debugger.") (defvar emacs-startup-hook nil "Normal hook run after loading init files and handling the command line.") @@ -296,7 +301,7 @@ the user's init file.") :group 'initialization) (defvar init-file-user nil - "Identity of user whose `.emacs' file is or was read. + "Identity of user whose init file is or was read. The value is nil if `-q' or `--no-init-file' was specified, meaning do not load any init file. @@ -306,7 +311,7 @@ or it may be a string containing a user's name meaning use that person's init file. In either of the latter cases, `(concat \"~\" init-file-user \"/\")' -evaluates to the name of the directory where the `.emacs' file was +evaluates to the name of the directory where the init file was looked for. Setting `init-file-user' does not prevent Emacs from loading @@ -365,7 +370,7 @@ init file is read, in case it sets `mail-host-address'." (t (concat user-emacs-directory "auto-save-list/.saves-"))) "Prefix for generating `auto-save-list-file-name'. -This is used after reading your `.emacs' file to initialize +This is used after reading your init file to initialize `auto-save-list-file-name', by appending Emacs's pid and the system name, if you have not already set `auto-save-list-file-name' yourself. Directories in the prefix will be created if necessary. diff --git a/lisp/strokes.el b/lisp/strokes.el index dfd0e95f61a..62a8528f25d 100644 --- a/lisp/strokes.el +++ b/lisp/strokes.el @@ -933,14 +933,7 @@ and then safely save them for later use, send letters to friends extracting the strokes for editing use once again, so the editing cycle can continue. -Strokes are easy to program and fun to use. To start strokes going, -you'll want to put the following line in your .emacs file as mentioned -in the commentary to strokes.el. - -This will load strokes when and only when you start Emacs on a window -system, with a mouse or other pointer device defined. - -To toggle strokes-mode, you just do +To toggle strokes-mode, invoke the command > M-x strokes-mode diff --git a/lisp/term/iris-ansi.el b/lisp/term/iris-ansi.el index 9a9a31f4253..aea2e8c1092 100644 --- a/lisp/term/iris-ansi.el +++ b/lisp/term/iris-ansi.el @@ -322,7 +322,7 @@ "Terminal initialization function for iris-ansi." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap iris-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m))) diff --git a/lisp/term/lk201.el b/lisp/term/lk201.el index 76a3a31cedc..6b9e1301003 100644 --- a/lisp/term/lk201.el +++ b/lisp/term/lk201.el @@ -75,7 +75,7 @@ (defun terminal-init-lk201 () ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap lk201-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m))) diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el index 481d6b498cf..98141563006 100644 --- a/lisp/term/rxvt.el +++ b/lisp/term/rxvt.el @@ -166,7 +166,7 @@ ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap rxvt-function-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/tvi970.el b/lisp/term/tvi970.el index b02d39c1e0f..f1b6eea8875 100644 --- a/lisp/term/tvi970.el +++ b/lisp/term/tvi970.el @@ -93,7 +93,7 @@ "Terminal initialization function for tvi970." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap tvi970-terminal-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/wyse50.el b/lisp/term/wyse50.el index d037962af19..ce148b62dba 100644 --- a/lisp/term/wyse50.el +++ b/lisp/term/wyse50.el @@ -109,7 +109,7 @@ "Terminal initialization function for wyse50." ;; Use inheritance to let the main keymap override these defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (let ((m (copy-keymap wyse50-terminal-map))) (set-keymap-parent m (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map m)) diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el index 28fb9da0b9d..e4871658b98 100644 --- a/lisp/term/xterm.el +++ b/lisp/term/xterm.el @@ -480,7 +480,7 @@ The relevant features are: ;; Use inheritance to let the main keymap override those defaults. ;; This way we don't override terminfo-derived settings or settings - ;; made in the .emacs file. + ;; made in the init file. (set-keymap-parent map (keymap-parent input-decode-map)) (set-keymap-parent input-decode-map map))) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index a9320d945ef..42f0418b690 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -290,9 +290,9 @@ If this variable is nil, all regions are treated as small." ;;* Mode specific options enable users to disable flyspell on */ ;;* certain word depending of the emacs mode. For instance, when */ ;;* using flyspell with mail-mode add the following expression */ -;;* in your .emacs file: */ +;;* in your init file: */ ;;* (add-hook 'mail-mode */ -;;* (lambda () (setq flyspell-generic-check-word-predicate */ +;;* (lambda () (setq flyspell-generic-check-word-predicate */ ;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ (defvar flyspell-generic-check-word-predicate nil @@ -488,7 +488,7 @@ invoking `ispell-change-dictionary'. Consider using the `ispell-parser' to check your text. For instance consider adding: \(add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex)))) -in your .emacs file. +in your init file. \\[flyspell-region] checks all words inside a region. \\[flyspell-buffer] checks the whole buffer." diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 0c7966f22d3..51a4800de52 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1127,7 +1127,8 @@ aspell is used along with Emacs).") ;; If Emacs flavor supports [:alpha:] use it for global dicts. If ;; spellchecker also supports UTF-8 via command-line option use it - ;; in communication. This does not affect definitions in ~/.emacs. + ;; in communication. This does not affect definitions in your + ;; init file. (if ispell-emacs-alpha-regexp (let (tmp-dicts-alist) (dolist (adict ispell-dictionary-alist) @@ -3680,7 +3681,7 @@ use the `x' command. (Any subsequent regions will be checked.) The `X' command aborts sending the message so that you can edit the buffer. To spell-check whenever a message is sent, include the appropriate lines -in your .emacs file: +in your init file: (add-hook 'message-send-hook 'ispell-message) ;; GNUS 5 (add-hook 'news-inews-hook 'ispell-message) ;; GNUS 4 (add-hook 'mail-send-hook 'ispell-message) diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index d8afb3e5544..8584c496a97 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -47,7 +47,7 @@ ;; To turn RefTeX Mode on and off in a buffer, use `M-x reftex-mode'. ;; ;; To turn on RefTeX Mode for all LaTeX files, add the following lines -;; to your .emacs file: +;; to your init file: ;; ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; AUCTeX LaTeX mode ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; Emacs latex mode @@ -99,7 +99,7 @@ ;; ;; To turn RefTeX Mode on and off in a particular buffer, use `M-x ;; reftex-mode'. To turn on RefTeX Mode for all LaTeX files, add the -;; following lines to your `.emacs' file: +;; following lines to your init file: ;; ;; (add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode ;; (add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode diff --git a/lisp/textmodes/rst.el b/lisp/textmodes/rst.el index 767f8f360bb..e2647a98770 100644 --- a/lisp/textmodes/rst.el +++ b/lisp/textmodes/rst.el @@ -81,7 +81,7 @@ ;;; INSTALLATION -;; Add the following lines to your `.emacs' file: +;; Add the following lines to your init file: ;; ;; (require 'rst) ;; diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index 5bcd87ede68..67d7f8c01f9 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -451,7 +451,7 @@ the next N words. In Transient Mark mode, when the mark is active, N defaults to -1, which means to wrap it around the current region. If you like upcased tags, put (setq sgml-transformation-function 'upcase) -in your `.emacs' file. +in your init file. Use \\[sgml-validate] to validate your document with an SGML parser. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 2664a89855f..459e884d45d 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -126,7 +126,7 @@ ;; again. ;; ;; To use the package regularly place this file in the site library -;; directory and add the next expression in your .emacs file. Make +;; directory and add the next expression in your init file. Make ;; sure that directory is included in the `load-path'. ;; ;; (require 'table) @@ -342,10 +342,10 @@ ;; (function (lambda () ;; (local-set-key [] ')))) ;; -;; Above code is well known ~/.emacs idiom for customizing a mode -;; specific keymap however it does not work for this package. This is -;; because there is no table mode in effect. This package does not -;; use a local map therefore you must modify `table-cell-map' +;; Adding the above to your init file is a common way to customize a +;; mode specific keymap. However it does not work for this package. +;; This is because there is no table mode in effect. This package +;; does not use a local map therefore you must modify `table-cell-map' ;; explicitly. The correct way of achieving above task is: ;; ;; (add-hook 'table-cell-map-hook diff --git a/lisp/textmodes/two-column.el b/lisp/textmodes/two-column.el index 8a4fe4f87fd..b21e72639fd 100644 --- a/lisp/textmodes/two-column.el +++ b/lisp/textmodes/two-column.el @@ -276,8 +276,9 @@ You have the following commands at your disposal: \\[2C-merge] Merge both buffers \\[2C-dissociate] Dissociate the two buffers -These keybindings can be customized in your ~/.emacs by `2C-mode-map', -`2C-minor-mode-map' and by binding `2C-command' to some prefix. +These keybindings can be customized in your init file by +`2C-mode-map', `2C-minor-mode-map' and by binding `2C-command' to +some prefix. The appearance of the screen can be customized by the variables `2C-window-width', `2C-beyond-fill-column', `2C-mode-line-format' and diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index 13963121e2b..c2ac1035dfe 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -29,7 +29,7 @@ ;; static char *ts = "sdmain.c Time-stamp: <2001-08-13 10:20:51 gildea>"; ;; See the top of `time-stamp.el' for another example. -;; To use time-stamping, add this line to your .emacs file: +;; To use time-stamping, add this line to your init file: ;; (add-hook 'before-save-hook 'time-stamp) ;; Now any time-stamp templates in your files will be updated automatically. @@ -254,7 +254,7 @@ time-stamped file itself.") (defun time-stamp () "Update the time stamp string(s) in the buffer. A template in a file can be automatically updated with a new time stamp -every time you save the file. Add this line to your .emacs file: +every time you save the file. Add this line to your init file: (add-hook 'before-save-hook 'time-stamp) or customize `before-save-hook' through Custom. Normally the template must appear in the first 8 lines of a file and diff --git a/lisp/url/url-methods.el b/lisp/url/url-methods.el index bd7d8e33922..26fe72014f7 100644 --- a/lisp/url/url-methods.el +++ b/lisp/url/url-methods.el @@ -79,7 +79,7 @@ ;; Store any proxying information - this will not overwrite an old ;; entry, so that people can still set this information in their - ;; .emacs file + ;; init file (cond (cur-proxy nil) ; Keep their old settings ((null env-proxy) nil) ; No proxy setup diff --git a/lisp/vc/pcvs-defs.el b/lisp/vc/pcvs-defs.el index 0f71b7b82e7..fc65d62c67d 100644 --- a/lisp/vc/pcvs-defs.el +++ b/lisp/vc/pcvs-defs.el @@ -57,11 +57,7 @@ versions, such as the one in SunOS-4.") ;;;; END OF THINGS TO CHECK WHEN INSTALLING ;;;; -------------------------------------------------------- -;;;; ;;;; User configuration variables: -;;;; -;;;; NOTE: these should be set in your ~/.emacs (or site-lisp/default.el) file. -;;;; (defgroup pcl-cvs nil "Special support for the CVS versioning system." diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index b48ea1afd95..ea9ce949ccb 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -31,7 +31,7 @@ ;; To install: put this file on the load-path and add Git to the list ;; of supported backends in `vc-handled-backends'; the following line, -;; placed in your ~/.emacs, will accomplish this: +;; placed in your init file, will accomplish this: ;; ;; (add-to-list 'vc-handled-backends 'Git) diff --git a/lisp/windmove.el b/lisp/windmove.el index 3a1afec38ee..1181e409dff 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -94,7 +94,7 @@ ;; Installation: ;; -;; Put the following line in your `.emacs' file: +;; Put the following line in your init file: ;; ;; (windmove-default-keybindings) ; shifted arrow keys ;; -- cgit v1.2.3 From 37ab5092e96c705aff371ca6203cdcb2d2fe3cd3 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Tue, 18 Sep 2012 09:07:13 +0200 Subject: Fix some recent changes in debug.el. * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization value. (debug): Don't remove debugger window when debugger is expected to be back. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/debug.el | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7ed5f6af14b..e8986acdd1f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2012-09-18 Martin Rudalics + + * emacs-lisp/debug.el (debugger-bury-or-kill): Fix customization + value. + (debug): Don't remove debugger window when debugger is expected + to be back. + 2012-09-18 Chong Yidong * custom.el (defface): Doc fix. diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index 774b4d3d600..e002dbabe49 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -75,9 +75,9 @@ window previously showing the debugger buffer. The value used here is passed to `quit-restore-window'." :type '(choice (const :tag "Keep alive" nil) - (const :tag "Append" 'append) - (const :tag "Bury" 'bury) - (const :tag "Kill" 'kill)) + (const :tag "Append" append) + (const :tag "Bury" bury) + (const :tag "Kill" kill)) :group 'debugger :version "24.2") @@ -265,7 +265,8 @@ first will be printed into the backtrace buffer." ;; Make sure we unbind buffer-read-only in the right buffer. (save-excursion (recursive-edit)))) - (when (and (window-live-p debugger-window) + (when (and (not debugger-will-be-back) + (window-live-p debugger-window) (eq (window-buffer debugger-window) debugger-buffer)) ;; Record height of debugger window. (setq debugger-previous-window-height -- cgit v1.2.3 From 35f5b19d7aa70f09c85478402ed0f7671882fdc4 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 19 Sep 2012 09:09:43 -0700 Subject: Partial fix for bug#12371 * emacs-lisp/macroexp.el (byte-compile-warn-obsolete) (byte-compile-log-warning): Autoload. --- lisp/ChangeLog | 3 +++ lisp/emacs-lisp/macroexp.el | 3 +++ 2 files changed, 6 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 93b25f21dc1..12356141e79 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2012-09-19 Glenn Morris + * emacs-lisp/macroexp.el (byte-compile-warn-obsolete) + (byte-compile-log-warning): Autoload. (Bug#12371) + * calendar/calendar.el (calendar-american-month-header) (calendar-european-month-header, calendar-iso-month-header) (calendar-month-header): New options. diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 394225d697e..13064800cd5 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -111,6 +111,9 @@ and also to avoid outputting the warning during normal execution." (mapc (lambda (x) (funcall (eval x))) (cdr form)) (byte-compile-constant nil))) +(autoload 'byte-compile-warn-obsolete "bytecomp") +(autoload 'byte-compile-log-warning "bytecomp") + (defun macroexp--expand-all (form) "Expand all macros in FORM. This is an internal version of `macroexpand-all'. -- cgit v1.2.3 From ce97595bd4604270075a0a7ff04bceaa97b42d9f Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 Sep 2012 15:59:52 -0400 Subject: * lisp/emacs-lisp/macroexp.el (macroexp--funcall-if-compiled): Rename from macroexp--eval-if-compile. (macroexp--funcall-and-return, macroexp--warn-and-return): New funs. (macroexp--expand-all): Use them. Fixes: debbugs:12371 --- lisp/ChangeLog | 9 ++++++-- lisp/emacs-lisp/macroexp.el | 50 +++++++++++++++++++++++++-------------------- 2 files changed, 35 insertions(+), 24 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8d90c818d22..d5e01ed08a2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,10 @@ 2012-09-19 Stefan Monnier + * emacs-lisp/macroexp.el (macroexp--funcall-if-compiled): Rename from + macroexp--eval-if-compile. + (macroexp--funcall-and-return, macroexp--warn-and-return): New funs. + (macroexp--expand-all): Use them (bug#12371). + * doc-view.el (doc-view-guess-paper-size) (doc-view-scale-bounding-box): Fix unbound `caddr'. @@ -174,8 +179,8 @@ (display-buffer-function): Mark as obsolete. * progmodes/compile.el (compilation-parse-errors): Accept list - values similar to font-lock-keywords (Bug#12136). Suggested by - Oleksandr Manzyuk. + values similar to font-lock-keywords (Bug#12136). + Suggested by Oleksandr Manzyuk. (compilation-error-regexp-alist): Doc fix. 2012-09-15 Glenn Morris diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 13064800cd5..6a84be06728 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -100,19 +100,34 @@ each clause." (error (message "Compiler-macro error for %S: %S" (car form) err) form))) -(defun macroexp--eval-if-compile (&rest _forms) +(defun macroexp--funcall-if-compiled (_form) "Pseudo function used internally by macroexp to delay warnings. The purpose is to delay warnings to bytecomp.el, so they can use things like `byte-compile-log-warning' to get better file-and-line-number data and also to avoid outputting the warning during normal execution." nil) -(put 'macroexp--eval-if-compile 'byte-compile +(put 'macroexp--funcall-if-compiled 'byte-compile (lambda (form) - (mapc (lambda (x) (funcall (eval x))) (cdr form)) + (funcall (eval (cadr form))) (byte-compile-constant nil))) -(autoload 'byte-compile-warn-obsolete "bytecomp") -(autoload 'byte-compile-log-warning "bytecomp") +(defun macroexp--funcall-and-return (when-compiled when-interpreted form) + ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this + ;; macro-expansion will be processed by the byte-compiler, we check + ;; circumstantial evidence. + (if (member '(declare-function . byte-compile-macroexpand-declare-function) + macroexpand-all-environment) + `(progn + (macroexp--funcall-if-compiled ',when-compiled) + ,form) + (funcall when-interpreted) + form)) + +(defun macroexp--warn-and-return (msg form) + (macroexp--funcall-and-return + (lambda () (byte-compile-log-warning msg t)) + (lambda () (message "%s" msg)) + form)) (defun macroexp--expand-all (form) "Expand all macros in FORM. @@ -133,9 +148,10 @@ Assumes the caller has bound `macroexpand-all-environment'." (car-safe form) (symbolp (car form)) (get (car form) 'byte-obsolete-info)) - `(progn (macroexp--eval-if-compile - (lambda () (byte-compile-warn-obsolete ',(car form)))) - ,new-form) + (macroexp--funcall-and-return + (lambda () (byte-compile-warn-obsolete ',(car form))) + #'ignore ;FIXME: We should `message' something. + new-form) new-form))) (pcase form (`(cond . ,clauses) @@ -178,26 +194,16 @@ Assumes the caller has bound `macroexpand-all-environment'." ;; First arg is a function: (`(,(and fun (or `funcall `apply `mapcar `mapatoms `mapconcat `mapc)) ',(and f `(lambda . ,_)) . ,args) - (byte-compile-log-warning + (macroexp--warn-and-return (format "%s quoted with ' rather than with #'" (list 'lambda (nth 1 f) '...)) - t) - ;; We don't use `macroexp--cons' since there's clearly a change. - (cons fun - (cons (macroexp--expand-all (list 'function f)) - (macroexp--all-forms args)))) + (macroexp--expand-all `(,fun ,f . ,args)))) ;; Second arg is a function: (`(,(and fun (or `sort)) ,arg1 ',(and f `(lambda . ,_)) . ,args) - (byte-compile-log-warning + (macroexp--warn-and-return (format "%s quoted with ' rather than with #'" (list 'lambda (nth 1 f) '...)) - t) - ;; We don't use `macroexp--cons' since there's clearly a change. - (cons fun - (cons (macroexp--expand-all arg1) - (cons (macroexp--expand-all - (list 'function f)) - (macroexp--all-forms args))))) + (macroexp--expand-all `(,fun ,arg1 ,f . ,args)))) (`(,func . ,_) ;; Macro expand compiler macros. This cannot be delayed to ;; byte-optimize-form because the output of the compiler-macro can -- cgit v1.2.3 From 7a04bee953b9b74c5ef24691e32c6b6d55ae1e4b Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 19 Sep 2012 23:29:41 -0400 Subject: * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Fix last change. --- lisp/ChangeLog | 4 ++++ lisp/emacs-lisp/macroexp.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d2266f9952f..9d9949c3999 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2012-09-20 Stefan Monnier + + * emacs-lisp/macroexp.el (macroexp--expand-all): Fix last change. + 2012-09-19 Juri Linkov * dired-aux.el (dired-diff): Add (require 'diff) because diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index 6a84be06728..f9be3e4fcc4 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -149,7 +149,7 @@ Assumes the caller has bound `macroexpand-all-environment'." (symbolp (car form)) (get (car form) 'byte-obsolete-info)) (macroexp--funcall-and-return - (lambda () (byte-compile-warn-obsolete ',(car form))) + (lambda () (byte-compile-warn-obsolete (car form))) #'ignore ;FIXME: We should `message' something. new-form) new-form))) -- cgit v1.2.3 From 96e8d4114dc9caa3ad6c03aca2129491a84b87db Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Thu, 20 Sep 2012 15:35:13 +0200 Subject: In debug restore assignment to debugger-old-buffer. * emacs-lisp/debug.el (debug): Restore assignment to debugger-old-buffer removed on 2012-09-08. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/debug.el | 1 + 2 files changed, 6 insertions(+) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b2e0e7b1d49..932bc4342c1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-20 Martin Rudalics + + * emacs-lisp/debug.el (debug): Restore assignment to + debugger-old-buffer removed on 2012-09-08. + 2012-09-20 Juri Linkov * dired-aux.el (dired-diff): Remove (require 'diff) since diff --git a/lisp/emacs-lisp/debug.el b/lisp/emacs-lisp/debug.el index e002dbabe49..6fd52d67b90 100644 --- a/lisp/emacs-lisp/debug.el +++ b/lisp/emacs-lisp/debug.el @@ -166,6 +166,7 @@ first will be printed into the backtrace buffer." (with-current-buffer (get-buffer "*Backtrace*") (list major-mode (buffer-string))))) (debugger-buffer (get-buffer-create "*Backtrace*")) + (debugger-old-buffer (current-buffer)) (debugger-window nil) (debugger-step-after-exit nil) (debugger-will-be-back nil) -- cgit v1.2.3 From 95b9712e9e3e8df09ad07423012bfbd978239014 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 20 Sep 2012 09:46:36 -0400 Subject: * lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function. (macroexp--expand-all): Use it. (macroexp--funcall-and-return): Remove by folding it into its sole caller (macroexp--warn-and-return). * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Use macroexp--obsolete-warning. --- lisp/ChangeLog | 7 +++++++ lisp/emacs-lisp/bytecomp.el | 16 +++++----------- lisp/emacs-lisp/macroexp.el | 46 ++++++++++++++++++++++++++------------------- 3 files changed, 39 insertions(+), 30 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7f9a15d9dfc..8b99fc29252 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2012-09-20 Stefan Monnier + * emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function. + (macroexp--expand-all): Use it. + (macroexp--funcall-and-return): Remove by folding it into its sole + caller (macroexp--warn-and-return). + * emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): + Use macroexp--obsolete-warning. + * calc/calc.el: Fix last change by removing the whole chunk, since it was only needed back when Calc was not bundled. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index c42ae21aae5..7a229750178 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1115,18 +1115,12 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." "Warn that SYMBOL (a variable or function) is obsolete." (when (byte-compile-warning-enabled-p 'obsolete) (let* ((funcp (get symbol 'byte-obsolete-info)) - (obsolete (or funcp (get symbol 'byte-obsolete-variable))) - (instead (car obsolete)) - (asof (nth 2 obsolete))) + (msg (macroexp--obsolete-warning + symbol + (or funcp (get symbol 'byte-obsolete-variable)) + (if funcp "function" "variable")))) (unless (and funcp (memq symbol byte-compile-not-obsolete-funcs)) - (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol - (if funcp "function" "variable") - (if asof (concat " (as of " asof ")") "") - (cond ((stringp instead) - (concat "; " instead)) - (instead - (format "; use `%s' instead." instead)) - (t "."))))))) + (byte-compile-warn "%s" msg))))) (defun byte-compile-report-error (error-info) "Report Lisp error in compilation. ERROR-INFO is the error data." diff --git a/lisp/emacs-lisp/macroexp.el b/lisp/emacs-lisp/macroexp.el index f9be3e4fcc4..cab693fecac 100644 --- a/lisp/emacs-lisp/macroexp.el +++ b/lisp/emacs-lisp/macroexp.el @@ -111,23 +111,30 @@ and also to avoid outputting the warning during normal execution." (funcall (eval (cadr form))) (byte-compile-constant nil))) -(defun macroexp--funcall-and-return (when-compiled when-interpreted form) - ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this - ;; macro-expansion will be processed by the byte-compiler, we check - ;; circumstantial evidence. - (if (member '(declare-function . byte-compile-macroexpand-declare-function) - macroexpand-all-environment) +(defun macroexp--warn-and-return (msg form) + (let ((when-compiled (lambda () (byte-compile-log-warning msg t)))) + (cond + ((null msg) form) + ;; FIXME: ¡¡Major Ugly Hack!! To determine whether the output of this + ;; macro-expansion will be processed by the byte-compiler, we check + ;; circumstantial evidence. + ((member '(declare-function . byte-compile-macroexpand-declare-function) + macroexpand-all-environment) `(progn (macroexp--funcall-if-compiled ',when-compiled) - ,form) - (funcall when-interpreted) - form)) - -(defun macroexp--warn-and-return (msg form) - (macroexp--funcall-and-return - (lambda () (byte-compile-log-warning msg t)) - (lambda () (message "%s" msg)) - form)) + ,form)) + (t + (message "%s" msg) + form)))) + +(defun macroexp--obsolete-warning (fun obsolescence-data type) + (let ((instead (car obsolescence-data)) + (asof (nth 2 obsolescence-data))) + (format "`%s' is an obsolete %s%s%s" fun type + (if asof (concat " (as of " asof ")") "") + (cond ((stringp instead) (concat "; " instead)) + (instead (format "; use `%s' instead." instead)) + (t "."))))) (defun macroexp--expand-all (form) "Expand all macros in FORM. @@ -148,10 +155,11 @@ Assumes the caller has bound `macroexpand-all-environment'." (car-safe form) (symbolp (car form)) (get (car form) 'byte-obsolete-info)) - (macroexp--funcall-and-return - (lambda () (byte-compile-warn-obsolete (car form))) - #'ignore ;FIXME: We should `message' something. - new-form) + (let* ((fun (car form)) + (obsolete (get fun 'byte-obsolete-info))) + (macroexp--warn-and-return + (macroexp--obsolete-warning fun obsolete "macro") + new-form)) new-form))) (pcase form (`(cond . ,clauses) -- cgit v1.2.3 From df9685f3961022245b9ab73b62023aa573862001 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 22 Sep 2012 16:16:03 +0300 Subject: Fix bugs #12447 and #12326 with infloop causes by idle timers, update docs. src/keyboard.c (timer_check_2): Move calculation of 'timers' and 'idle_timers' from here ... (timer_check): ... to here. Use Fcopy_sequence to copy the timer lists, to avoid infloops when the timer does something stupid, like reinvoke itself with the same or smaller time-out. lisp/emacs-lisp/timer.el (run-with-idle-timer) (timer-activate-when-idle): Warn against reinvoking an idle timer from within its own timer action. doc/lispref/os.texi (Idle Timers): Warn against reinvoking an idle timer from within its own timer action. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/os.texi | 7 +++++++ lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/timer.el | 15 ++++++++++++--- src/ChangeLog | 9 +++++++++ src/keyboard.c | 34 ++++++++++++++++++++++------------ 6 files changed, 61 insertions(+), 15 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index f1ae632267b..8acd12d82a8 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2012-09-22 Eli Zaretskii + + * os.texi (Idle Timers): Warn against reinvoking an idle timer + from within its own timer action. (Bug#12447) + 2012-09-22 Chong Yidong * frames.texi (Pop-Up Menus): Minor clarification (Bug#11148). diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 6431ac8bead..68e53c78972 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi @@ -1863,6 +1863,13 @@ only while waiting). It blocks out any idle timers that ought to run during that time. @end itemize +@noindent +For similar reasons, do not write an idle timer function that sets +up another idle time (including the same idle timer) with the +@var{secs} argument less or equal to the current idleness time. Such +a timer will run almost immediately, and continue running again and +again, instead of waiting for the next time Emacs becomes idle. + @noindent The correct approach is for the idle timer to reschedule itself after a brief pause, using the method in the @code{timer-function} example diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f18bfd73611..b0e91b675a3 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2012-09-22 Eli Zaretskii + + * emacs-lisp/timer.el (run-with-idle-timer) + (timer-activate-when-idle): Warn against reinvoking an idle timer + from within its own timer action. (Bug#12447) + 2012-09-22 Martin Rudalics * cus-start.el (window-combination-limit): Add new optional diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 2248dde8c03..bcd582a6f88 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -205,12 +205,19 @@ timers). If nil, allocate a new cell." "Insert TIMER into `timer-idle-list'. This arranges to activate TIMER whenever Emacs is next idle. If optional argument DONT-WAIT is non-nil, set TIMER to activate -immediately, or at the right time, if Emacs is already idle. +immediately \(see beloe\), or at the right time, if Emacs is +already idle. REUSE-CELL, if non-nil, is a cons cell to reuse when inserting TIMER into `timer-idle-list' (usually a cell removed from that list by `cancel-timer-internal'; using this reduces consing for -repeat timers). If nil, allocate a new cell." +repeat timers). If nil, allocate a new cell. + +Using non-nil DONT-WAIT is not recommended when activating an +idle timer from an idle timer handler, if the timer being +activated has an idleness time that is smaller or equal to +the time of the current timer. That's because the activated +timer will fire right away." (timer--activate timer (not dont-wait) reuse-cell 'idle)) (defalias 'disable-timeout 'cancel-timer) @@ -403,7 +410,9 @@ The action is to call FUNCTION with arguments ARGS. SECS may be an integer, a floating point number, or the internal time format returned by, e.g., `current-idle-time'. If Emacs is currently idle, and has been idle for N seconds (N < SECS), -then it will call FUNCTION in SECS - N seconds from now. +then it will call FUNCTION in SECS - N seconds from now. Using +SECS <= N is not recommended if this function is invoked from an idle +timer, because FUNCTION will then be called immediately. If REPEAT is non-nil, do the action each time Emacs has been idle for exactly SECS seconds (that is, only once for each time Emacs becomes idle). diff --git a/src/ChangeLog b/src/ChangeLog index 6ea40b3f122..b69d4bb7113 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-09-22 Eli Zaretskii + + * keyboard.c (timer_check_2): Move calculation of 'timers' and + 'idle_timers' from here ... + (timer_check): ... to here. Use Fcopy_sequence to copy the timer + lists, to avoid infloops when the timer does something stupid, + like reinvoke itself with the same or smaller time-out. + (Bug#12447) + 2012-09-22 Martin Rudalics * window.c (Fsplit_window_internal): Handle only Qt value of diff --git a/src/keyboard.c b/src/keyboard.c index 098d3530ef8..8b1113a026a 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -4333,25 +4333,18 @@ decode_timer (Lisp_Object timer, EMACS_TIME *result) should be done. */ static EMACS_TIME -timer_check_2 (void) +timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers) { EMACS_TIME nexttime; EMACS_TIME now; EMACS_TIME idleness_now; - Lisp_Object timers, idle_timers, chosen_timer; - struct gcpro gcpro1, gcpro2, gcpro3; + Lisp_Object chosen_timer; + struct gcpro gcpro1; nexttime = invalid_emacs_time (); - /* Always consider the ordinary timers. */ - timers = Vtimer_list; - /* Consider the idle timers only if Emacs is idle. */ - if (EMACS_TIME_VALID_P (timer_idleness_start_time)) - idle_timers = Vtimer_idle_list; - else - idle_timers = Qnil; chosen_timer = Qnil; - GCPRO3 (timers, idle_timers, chosen_timer); + GCPRO1 (chosen_timer); /* First run the code that was delayed. */ while (CONSP (pending_funcalls)) @@ -4500,13 +4493,30 @@ EMACS_TIME timer_check (void) { EMACS_TIME nexttime; + Lisp_Object timers, idle_timers; + struct gcpro gcpro1, gcpro2; + + /* We use copies of the timers' lists to allow a timer to add itself + again, without locking up Emacs if the newly added timer is + already ripe when added. */ + + /* Always consider the ordinary timers. */ + timers = Fcopy_sequence (Vtimer_list); + /* Consider the idle timers only if Emacs is idle. */ + if (EMACS_TIME_VALID_P (timer_idleness_start_time)) + idle_timers = Fcopy_sequence (Vtimer_idle_list); + else + idle_timers = Qnil; + + GCPRO2 (timers, idle_timers); do { - nexttime = timer_check_2 (); + nexttime = timer_check_2 (timers, idle_timers); } while (EMACS_SECS (nexttime) == 0 && EMACS_NSECS (nexttime) == 0); + UNGCPRO; return nexttime; } -- cgit v1.2.3 From c88b867fecbd50140b0b41f05599811a8f0e3dfe Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 22 Sep 2012 23:24:26 +0800 Subject: Misc doc fixes. * searching.texi (Replacing Match): Minor clarification. * lisp/repeat.el (repeat): Doc fix. * lisp/simple.el (shell-command-on-region): Doc fix. * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix. * cmds.c (Fforward_char, Fbackward_char): Doc fix. * editfns.c (Fline_beginning_position): Doc fix. (Fline_end_position): Doc fix. * minibuf.c (Finternal_complete_buffer): Doc fix. * search.c (Freplace_match): Doc fix. Fixes: debbugs:12325 debbugs:12391 debbugs:12416 debbugs:12414 debbugs:10909 debbugs:12348 --- doc/lispref/ChangeLog | 4 ++++ doc/lispref/searching.texi | 26 +++++++++++----------- lisp/ChangeLog | 9 ++++++++ lisp/emacs-lisp/easy-mmode.el | 17 +++++++++------ lisp/repeat.el | 6 +++--- lisp/simple.el | 50 +++++++++++++++++++++---------------------- src/ChangeLog | 11 ++++++++++ src/cmds.c | 2 ++ src/editfns.c | 18 +++++++++------- src/minibuf.c | 8 +++---- src/search.c | 29 +++++++++++-------------- 11 files changed, 103 insertions(+), 77 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index db545f8ec91..b813ac6bb1c 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,7 @@ +2012-09-22 Chong Yidong + + * searching.texi (Replacing Match): Minor clarification. + 2012-09-22 Eli Zaretskii * edebug.texi (Instrumenting): Improve indexing. diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi index edd1d30e28d..56c96363e81 100644 --- a/doc/lispref/searching.texi +++ b/doc/lispref/searching.texi @@ -1278,20 +1278,18 @@ search. It works by means of the match data. @cindex case in replacements @defun replace-match replacement &optional fixedcase literal string subexp -This function replaces the text in the buffer (or in @var{string}) that -was matched by the last search. It replaces that text with -@var{replacement}. - -If you did the last search in a buffer, you should specify @code{nil} -for @var{string} and make sure that the current buffer when you call -@code{replace-match} is the one in which you did the searching or -matching. Then @code{replace-match} does the replacement by editing -the buffer; it leaves point at the end of the replacement text, and -returns @code{t}. - -If you did the search in a string, pass the same string as @var{string}. -Then @code{replace-match} does the replacement by constructing and -returning a new string. +This function performs a replacement operation on a buffer or string. + +If you did the last search in a buffer, you should omit the +@var{string} argument or specify @code{nil} for it, and make sure that +the current buffer is the one in which you performed the last search. +Then this function edits the buffer, replacing the matched text with +@var{replacement}. It leaves point at the end of the replacement +text, and returns @code{t}. + +If you performed the last search on a string, pass the same string as +@var{string}. Then this function returns a new string, in which the +matched text is replaced by @var{replacement}. If @var{fixedcase} is non-@code{nil}, then @code{replace-match} uses the replacement text without case conversion; otherwise, it converts diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b0e91b675a3..813abd506d4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2012-09-22 Chong Yidong + + * repeat.el (repeat): Doc fix (Bug#12348). + + * emacs-lisp/easy-mmode.el (define-minor-mode): Doc fix + (Bug#10909). + + * simple.el (shell-command-on-region): Doc fix. + 2012-09-22 Eli Zaretskii * emacs-lisp/timer.el (run-with-idle-timer) diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el index ee4e36a9eba..4951368aebe 100644 --- a/lisp/emacs-lisp/easy-mmode.el +++ b/lisp/emacs-lisp/easy-mmode.el @@ -90,12 +90,17 @@ MODE (you can override this with the :variable keyword, see below). DOC is the documentation for the mode toggle command. The defined mode command takes one optional (prefix) argument. -Interactively with no prefix argument it toggles the mode. -With a prefix argument, it enables the mode if the argument is -positive and otherwise disables it. When called from Lisp, it -enables the mode if the argument is omitted or nil, and toggles -the mode if the argument is `toggle'. If DOC is nil this -function adds a basic doc-string stating these facts. +Interactively with no prefix argument, it toggles the mode. +A prefix argument enables the mode if the argument is positive, +and disables it otherwise. + +When called from Lisp, the mode command toggles the mode if the +argument is `toggle', disables the mode if the argument is a +non-positive integer, and enables the mode otherwise (including +if the argument is omitted or nil or a positive integer). + +If DOC is nil, give the mode command a basic doc-string +documenting what its argument does. Optional INIT-VALUE is the initial value of the mode's variable. Optional LIGHTER is displayed in the mode line when the mode is on. diff --git a/lisp/repeat.el b/lisp/repeat.el index e577c461bc5..e38442a434b 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -193,9 +193,9 @@ this function is always whether the value of `this-command' would've been ;;;###autoload (defun repeat (repeat-arg) "Repeat most recently executed command. -With prefix arg, apply new prefix arg to that command; otherwise, -use the prefix arg that was used before (if any). -This command is like the `.' command in the vi editor. +If REPEAT-ARG is non-nil (interactively, with a prefix argument), +supply a prefix argument to that command. Otherwise, give the +command the same prefix argument it was given before, if any. If this command is invoked by a multi-character key sequence, it can then be repeated by repeating the final character of that diff --git a/lisp/simple.el b/lisp/simple.el index 3e11e6838c7..8ddbac33d00 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2604,8 +2604,6 @@ is encoded using coding-system specified by `process-coding-system-alist', falling back to `default-process-coding-system' if no match for COMMAND is found in `process-coding-system-alist'. -The noninteractive arguments are START, END, COMMAND, -OUTPUT-BUFFER, REPLACE, ERROR-BUFFER, and DISPLAY-ERROR-BUFFER. Noninteractive callers can specify coding systems by binding `coding-system-for-read' and `coding-system-for-write'. @@ -2613,34 +2611,34 @@ If the command generates output, the output may be displayed in the echo area or in a buffer. If the output is short enough to display in the echo area \(determined by the variable `max-mini-window-height' if -`resize-mini-windows' is non-nil), it is shown there. Otherwise -it is displayed in the buffer `*Shell Command Output*'. The output -is available in that buffer in both cases. +`resize-mini-windows' is non-nil), it is shown there. +Otherwise it is displayed in the buffer `*Shell Command Output*'. +The output is available in that buffer in both cases. If there is output and an error, a message about the error -appears at the end of the output. - -If there is no output, or if output is inserted in the current buffer, -then `*Shell Command Output*' is deleted. - -If the optional fourth argument OUTPUT-BUFFER is non-nil, -that says to put the output in some other buffer. -If OUTPUT-BUFFER is a buffer or buffer name, put the output there. -If OUTPUT-BUFFER is not a buffer and not nil, -insert output in the current buffer. -In either case, the output is inserted after point (leaving mark after it). - -If REPLACE, the optional fifth argument, is non-nil, that means insert -the output in place of text from START to END, putting point and mark +appears at the end of the output. If there is no output, or if +output is inserted in the current buffer, the buffer `*Shell +Command Output*' is deleted. + +Optional fourth arg OUTPUT-BUFFER specifies where to put the +command's output. If the value is a buffer or buffer name, put +the output there. Any other value, including nil, means to +insert the output in the current buffer. In either case, the +output is inserted after point (leaving mark after it). + +Optional fifth arg REPLACE, if non-nil, means to insert the +output in place of text from START to END, putting point and mark around it. -If optional sixth argument ERROR-BUFFER is non-nil, it is a buffer -or buffer name to which to direct the command's standard error output. -If it is nil, error output is mingled with regular output. -If DISPLAY-ERROR-BUFFER is non-nil, display the error buffer if there -were any errors. (This is always t, interactively.) -In an interactive call, the variable `shell-command-default-error-buffer' -specifies the value of ERROR-BUFFER." +Optional sixth arg ERROR-BUFFER, if non-nil, specifies a buffer +or buffer name to which to direct the command's standard error +output. If nil, error output is mingled with regular output. +When called interactively, `shell-command-default-error-buffer' +is used for ERROR-BUFFER. + +Optional seventh arg DISPLAY-ERROR-BUFFER, if non-nil, means to +display the error buffer if there were any errors. When called +interactively, this is t." (interactive (let (string) (unless (mark) (error "The mark is not set now, so there is no region")) diff --git a/src/ChangeLog b/src/ChangeLog index b2f33494b7c..9d8bc3a7c00 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,14 @@ +2012-09-22 Chong Yidong + + * search.c (Freplace_match): Doc fix (Bug#12325). + + * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391). + + * editfns.c (Fline_beginning_position): Doc fix (Bug#12416). + (Fline_end_position): Doc fix. + + * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414). + 2012-09-22 Chong Yidong * dispextern.h (struct image_type): Add new slot, storing a type diff --git a/src/cmds.c b/src/cmds.c index 45f7df948ae..453a4b67e57 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -85,6 +85,7 @@ move_point (Lisp_Object n, bool forward) DEFUN ("forward-char", Fforward_char, Sforward_char, 0, 1, "^p", doc: /* Move point N characters forward (backward if N is negative). On reaching end or beginning of buffer, stop and signal error. +Interactively, N is the numeric prefix argument. Depending on the bidirectional context, the movement may be to the right or to the left on the screen. This is in contrast with @@ -97,6 +98,7 @@ right or to the left on the screen. This is in contrast with DEFUN ("backward-char", Fbackward_char, Sbackward_char, 0, 1, "^p", doc: /* Move point N characters backward (forward if N is negative). On attempt to pass beginning or end of buffer, stop and signal error. +Interactively, N is the numeric prefix argument. Depending on the bidirectional context, the movement may be to the right or to the left on the screen. This is in contrast with diff --git a/src/editfns.c b/src/editfns.c index c6744648bc5..acf9c48e7a0 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -738,17 +738,18 @@ Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil. */) DEFUN ("line-beginning-position", Fline_beginning_position, Sline_beginning_position, 0, 1, 0, doc: /* Return the character position of the first character on the current line. -With argument N not nil or 1, move forward N - 1 lines first. -If scan reaches end of buffer, return that position. +With optional argument N, scan forward N - 1 lines first. +If the scan reaches the end of the buffer, return that position. -The returned position is of the first character in the logical order, -i.e. the one that has the smallest character position. +This function ignores text display directionality; it returns the +position of the first character in logical order, i.e. the smallest +character position on the line. This function constrains the returned position to the current field -unless that would be on a different line than the original, +unless that position would be on a different line than the original, unconstrained result. If N is nil or 1, and a front-sticky field starts at point, the scan stops as soon as it starts. To ignore field -boundaries bind `inhibit-field-text-motion' to t. +boundaries, bind `inhibit-field-text-motion' to t. This function does not move point. */) (Lisp_Object n) @@ -782,8 +783,9 @@ DEFUN ("line-end-position", Fline_end_position, Sline_end_position, 0, 1, 0, With argument N not nil or 1, move forward N - 1 lines first. If scan reaches end of buffer, return that position. -The returned position is of the last character in the logical order, -i.e. the character whose buffer position is the largest one. +This function ignores text display directionality; it returns the +position of the last character in logical order, i.e. the largest +character position on the line. This function constrains the returned position to the current field unless that would be on a different line than the original, diff --git a/src/minibuf.c b/src/minibuf.c index 8a1e0ddde86..6f9c61dcfb1 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1862,11 +1862,11 @@ static Lisp_Object Qmetadata; DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0, doc: /* Perform completion on buffer names. -If the argument FLAG is nil, invoke `try-completion', if it's t, invoke -`all-completions', otherwise invoke `test-completion'. +STRING and PREDICATE have the same meanings as in `try-completion', +`all-completions', and `test-completion'. -The arguments STRING and PREDICATE are as in `try-completion', -`all-completions', and `test-completion'. */) +If FLAG is nil, invoke `try-completion'; if it is t, invoke +`all-completions'; otherwise invoke `test-completion'. */) (Lisp_Object string, Lisp_Object predicate, Lisp_Object flag) { if (NILP (flag)) diff --git a/src/search.c b/src/search.c index 1735ade5d8a..5224556fa17 100644 --- a/src/search.c +++ b/src/search.c @@ -2220,15 +2220,14 @@ DEFUN ("replace-match", Freplace_match, Sreplace_match, 1, 5, 0, doc: /* Replace text matched by last search with NEWTEXT. Leave point at the end of the replacement text. -If second arg FIXEDCASE is non-nil, do not alter case of replacement text. -Otherwise maybe capitalize the whole text, or maybe just word initials, -based on the replaced text. -If the replaced text has only capital letters -and has at least one multiletter word, convert NEWTEXT to all caps. -Otherwise if all words are capitalized in the replaced text, -capitalize each word in NEWTEXT. - -If third arg LITERAL is non-nil, insert NEWTEXT literally. +If optional second arg FIXEDCASE is non-nil, do not alter the case of +the replacement text. Otherwise, maybe capitalize the whole text, or +maybe just word initials, based on the replaced text. If the replaced +text has only capital letters and has at least one multiletter word, +convert NEWTEXT to all caps. Otherwise if all words are capitalized +in the replaced text, capitalize each word in NEWTEXT. + +If optional third arg LITERAL is non-nil, insert NEWTEXT literally. Otherwise treat `\\' as special: `\\&' in NEWTEXT means substitute original matched text. `\\N' means substitute what matched the Nth `\\(...\\)'. @@ -2239,13 +2238,11 @@ Otherwise treat `\\' as special: Any other character following `\\' signals an error. Case conversion does not apply to these substitutions. -FIXEDCASE and LITERAL are optional arguments. - -The optional fourth argument STRING can be a string to modify. -This is meaningful when the previous match was done against STRING, -using `string-match'. When used this way, `replace-match' -creates and returns a new string made by copying STRING and replacing -the part of STRING that was matched. +If optional fourth argument STRING is non-nil, it should be a string +to act on; this should be the string on which the previous match was +done via `string-match'. In this case, `replace-match' creates and +returns a new string, made by copying STRING and replacing the part of +STRING that was matched (the original STRING itself is not altered). The optional fifth argument SUBEXP specifies a subexpression; it says to replace just that subexpression with NEWTEXT, -- cgit v1.2.3 From 0c765e5f5776e09edc43e39d871a263083bf9ed1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 24 Sep 2012 20:31:24 +0800 Subject: Fix two references to deleted obsolete variables. Also, fix the copyright header for lisp/emacs-lisp/gv.el. * lisp/vc/log-edit.el (log-edit-require-final-newline) (log-edit-changelog-full-paragraphs): Default to t. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/gv.el | 11 +++++++---- lisp/vc/log-edit.el | 5 ++--- 3 files changed, 11 insertions(+), 7 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7d886bd144a..61bf7c7fe2c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -10,6 +10,8 @@ * vc/log-edit.el (cvs-changelog-full-paragraphs) (cvs-commit-buffer-require-final-newline): Remove. + (log-edit-require-final-newline) + (log-edit-changelog-full-paragraphs): Default to t. * vc/pcvs-defs.el (cvs-diff-buffer-name, cvs-diff-ignore-marks) * vc/vc-hooks.el (vc-ignore-vc-files, vc-master-templates) diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 4caa0a73866..3541c99f5fe 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -1,22 +1,25 @@ -;;; gv.el --- Generalized variables -*- lexical-binding: t -*- +;;; gv.el --- generalized variables -*- lexical-binding: t -*- ;; Copyright (C) 2012 Free Software Foundation, Inc. ;; Author: Stefan Monnier ;; Keywords: extensions +;; Package: emacs -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/vc/log-edit.el b/lisp/vc/log-edit.el index 3b4eb4dae02..2fc2e0ce46d 100644 --- a/lisp/vc/log-edit.el +++ b/lisp/vc/log-edit.el @@ -104,8 +104,7 @@ If 'changed, only request confirmation if the list of files has :group 'log-edit :type 'boolean) -(defcustom log-edit-require-final-newline - cvs-commit-buffer-require-final-newline +(defcustom log-edit-require-final-newline t "Enforce a newline at the end of commit log messages. Enforce it silently if t, query if non-nil and don't do anything if nil." :group 'log-edit @@ -149,7 +148,7 @@ can be obtained from `log-edit-files'." :group 'log-edit :version "24.1") -(defvar log-edit-changelog-full-paragraphs cvs-changelog-full-paragraphs +(defvar log-edit-changelog-full-paragraphs t "If non-nil, include full ChangeLog paragraphs in the log. This may be set in the ``local variables'' section of a ChangeLog, to indicate the policy for that ChangeLog. -- cgit v1.2.3 From 74bfe42a988843a45a5afe86fb1cc46b7b1b77a3 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 24 Sep 2012 08:58:20 -0700 Subject: Standardize some license notices --- lisp/emacs-lisp/ert-x.el | 22 +++++++++++----------- lisp/emacs-lisp/ert.el | 22 +++++++++++----------- lisp/org/ob-fortran.el | 18 +++++++++--------- 3 files changed, 31 insertions(+), 31 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/ert-x.el b/lisp/emacs-lisp/ert-x.el index a7916354c91..c3b8e5e10d4 100644 --- a/lisp/emacs-lisp/ert-x.el +++ b/lisp/emacs-lisp/ert-x.el @@ -7,18 +7,18 @@ ;; This file is part of GNU Emacs. -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see `http://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el index ad5e20cb8a4..ff00be7a237 100644 --- a/lisp/emacs-lisp/ert.el +++ b/lisp/emacs-lisp/ert.el @@ -7,18 +7,18 @@ ;; This file is part of GNU Emacs. -;; This program is free software: you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation, either version 3 of the -;; License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, but -;; WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;; General Public License for more details. -;; +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see `http://www.gnu.org/licenses/'. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/org/ob-fortran.el b/lisp/org/ob-fortran.el index 491dde3e070..fe38edbce1e 100644 --- a/lisp/org/ob-fortran.el +++ b/lisp/org/ob-fortran.el @@ -7,20 +7,20 @@ ;; Keywords: literate programming, reproducible research, fortran ;; Homepage: http://orgmode.org -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. -;; -;; This program is distributed in the hope that it will be useful, +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. -;; + ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: -- cgit v1.2.3 From 267b82ff2374a43cb38617a648c5bfa58ef2b039 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 24 Sep 2012 09:36:42 -0700 Subject: Standardize some more license notices --- lisp/emacs-lisp/package-x.el | 10 ++++------ lisp/emacs-lisp/package.el | 10 ++++------ lisp/emacs-lisp/tabulated-list.el | 6 +++--- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 761d27a2e28..0b6fd277ae2 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el @@ -10,10 +10,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -21,9 +21,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index b01cdbc7b8e..28d166271fb 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -9,10 +9,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,9 +20,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Change Log: diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index a56a7619ea9..8aa722521eb 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -7,10 +7,10 @@ ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of -- cgit v1.2.3 From 59f7af816e98a74abf42d724bcfdfa9bfe9964ce Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 25 Sep 2012 12:13:02 +0800 Subject: Use declare forms, where possible, to mark obsolete functions. * lisp/allout.el (allout-passphrase-hint-string): Likewise. (allout-init): Use a declare form to mark obsolete. * lisp/calendar/calendar.el (calendar-version): * lisp/calendar/icalendar.el (icalendar-extract-ical-from-buffer) (icalendar-convert-diary-to-ical): * lisp/cus-edit.el (custom-mode): * lisp/ansi-color.el (ansi-color-unfontify-region): * lisp/international/latin1-disp.el (latin1-char-displayable-p): * lisp/progmodes/cwarn.el (turn-on-cwarn-mode): * lisp/progmodes/which-func.el (which-func-update-1): Use define-obsolete-function-alias. * lisp/bookmark.el (bookmark-jump-noselect): Use a declare form to mark this function obsolete. * lisp/calendar/cal-x.el (calendar-two-frame-setup) (calendar-only-one-frame-setup, calendar-one-frame-setup): * lisp/calendar/calendar.el (american-calendar, european-calendar) (calendar-for-loop): * lisp/comint.el (comint-dynamic-simple-complete) (comint-dynamic-complete-as-filename, comint-unquote-filename): * lisp/desktop.el (desktop-load-default): * lisp/dired-x.el (dired-omit-here-always) (dired-hack-local-variables, dired-default-directory): * lisp/emacs-lisp/derived.el (derived-mode-class): * lisp/emacs-lisp/timer.el (timer-set-time-with-usecs): * lisp/emacs-lock.el (toggle-emacs-lock): * lisp/epa.el (epa-display-verify-result): * lisp/epg.el (epg-sign-keys, epg-start-sign-keys) (epg-passphrase-callback-function): * lisp/eshell/esh-util.el (eshell-for): * lisp/eshell/eshell.el (eshell-remove-from-window-buffer-names) (eshell-add-to-window-buffer-names): * lisp/files.el (locate-file-completion): * lisp/imenu.el (imenu-example--create-c-index) (imenu-example--create-lisp-index) (imenu-example--lisp-extract-index-name) (imenu-example--name-and-position): * lisp/international/mule-cmds.el (princ-list): * lisp/international/mule-diag.el (decode-codepage-char): * lisp/international/mule-util.el (detect-coding-with-priority): * lisp/iswitchb.el (iswitchb-read-buffer): * lisp/mail/mailalias.el (mail-complete): * lisp/mail/sendmail.el (mail-sent-via): * lisp/mouse.el (mouse-popup-menubar-stuff, mouse-popup-menubar) (mouse-major-mode-menu): * lisp/password-cache.el (password-read-and-add): * lisp/pcomplete.el (pcomplete-parse-comint-arguments): * lisp/progmodes/sh-script.el (sh-maybe-here-document): * lisp/replace.el (query-replace-regexp-eval): * lisp/savehist.el (savehist-load): * lisp/simple.el (choose-completion-delete-max-match): * lisp/term.el (term-dynamic-simple-complete): * lisp/vc/ediff-init.el (ediff-check-version): * lisp/vc/ediff-wind.el (ediff-choose-window-setup-function-automatically): * lisp/vc/vc.el (vc-diff-switches-list): * lisp/view.el (view-return-to-alist-update): Likewise. * lisp/iswitchb.el (iswitchb-read-buffer): Move code of iswitchb-define-mode-map here, and delete that obsolete function. * lisp/subr.el (eval-next-after-load, makehash, insert-string) (assoc-ignore-representation, assoc-ignore-case): Use declare to mark obsolete. (mode-line-inverse-video): Variable deleted. * lisp/emacs-lisp/byte-run.el (make-obsolete): Doc fix; emphasize that this applies to functions. * lisp/erc/erc.el (erc-send-command): Use define-obsolete-function-alias. * lisp/international/mule-util.el (string-to-sequence): Remove. * lisp/net/newst-backend.el (newsticker-cache-filename): * lisp/net/newst-treeview.el (newsticker-groups-filename): Fix incorrect obsolescence declaration. * lisp/net/snmp-mode.el (snmp-font-lock-keywords-3): Don't use obsolete font-lock-reference-face. * lisp/url/url-parse.el (url-recreate-url-attributes): * lisp/url/url-util.el (url-generate-unique-filename): Use declare to mark obsolete. * src/xdisp.c (mode_line_inverse_video): Delete obsolete variable. --- etc/NEWS | 4 +- lisp/ChangeLog | 85 +++++++++++++++++++++++++++++++++++++-- lisp/allout.el | 13 +++--- lisp/ansi-color.el | 4 +- lisp/bookmark.el | 3 +- lisp/calendar/cal-x.el | 12 ++---- lisp/calendar/calendar.el | 19 +++------ lisp/calendar/icalendar.el | 8 ++-- lisp/comint.el | 8 ++-- lisp/cus-edit.el | 9 +---- lisp/cus-start.el | 1 - lisp/desktop.el | 3 +- lisp/dired-x.el | 17 +++----- lisp/dired.el | 2 +- lisp/emacs-lisp/byte-run.el | 4 +- lisp/emacs-lisp/derived.el | 2 +- lisp/emacs-lisp/timer.el | 5 +-- lisp/emacs-lock.el | 2 +- lisp/epa.el | 2 +- lisp/epg.el | 8 ++-- lisp/erc/ChangeLog | 4 ++ lisp/erc/erc.el | 4 +- lisp/eshell/esh-util.el | 4 +- lisp/eshell/eshell.el | 6 +-- lisp/files.el | 2 +- lisp/htmlfontify.el | 2 - lisp/imenu.el | 9 ++--- lisp/international/latin1-disp.el | 4 +- lisp/international/mule-cmds.el | 2 +- lisp/international/mule-diag.el | 2 +- lisp/international/mule-util.el | 36 +---------------- lisp/iswitchb.el | 54 +++++++++---------------- lisp/mail/mailalias.el | 2 +- lisp/mail/sendmail.el | 4 +- lisp/mouse.el | 6 +-- lisp/net/newst-backend.el | 2 +- lisp/net/newst-treeview.el | 2 +- lisp/net/snmp-mode.el | 4 +- lisp/password-cache.el | 3 +- lisp/pcomplete.el | 3 +- lisp/progmodes/cwarn.el | 8 +--- lisp/progmodes/sh-script.el | 3 +- lisp/progmodes/vera-mode.el | 6 --- lisp/progmodes/which-func.el | 4 +- lisp/replace.el | 46 ++++++++++----------- lisp/savehist.el | 2 +- lisp/simple.el | 3 +- lisp/subr.el | 18 ++++----- lisp/term.el | 3 +- lisp/url/ChangeLog | 6 +++ lisp/url/url-parse.el | 2 +- lisp/url/url-util.el | 2 +- lisp/vc/ediff-init.el | 4 +- lisp/vc/ediff-wind.el | 4 +- lisp/vc/vc.el | 5 ++- lisp/view.el | 2 +- src/ChangeLog | 4 ++ src/xdisp.c | 14 ------- 58 files changed, 231 insertions(+), 271 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/etc/NEWS b/etc/NEWS index 8dd419dd73f..8c206f049d3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -655,7 +655,7 @@ are deprecated and will be removed eventually. **** inactivate-current-input-method-function -> deactivate-current-input-method-function -** Some obsolete variables and variable aliases were removed: +** Some obsolete functions and variables were removed: *** `facemenu-unlisted-faces' *** `rmail-decode-mime-charset' @@ -663,7 +663,9 @@ are deprecated and will be removed eventually. *** `iswitchb-read-buffer' *** `sc-version', `sc-submit-bug-report' *** `set-char-table-default' +*** `string-to-sequence' (use `string-to-list' or `string-to-vector'). *** `compile-internal' +*** `mode-line-inverse-video' *** `cvs-commit-buffer-require-final-newline' (use `'log-edit-require-final-newline'instead) *** `cvs-changelog-full-paragraphs' diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e5449d97720..375fea957c0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,84 @@ +2012-09-25 Chong Yidong + + * bookmark.el (bookmark-jump-noselect): Use a declare form to mark + this function obsolete. + + * calendar/cal-x.el (calendar-two-frame-setup) + (calendar-only-one-frame-setup, calendar-one-frame-setup): + * calendar/calendar.el (american-calendar, european-calendar) + (calendar-for-loop): + * comint.el (comint-dynamic-simple-complete) + (comint-dynamic-complete-as-filename, comint-unquote-filename): + * desktop.el (desktop-load-default): + * dired-x.el (dired-omit-here-always) + (dired-hack-local-variables, dired-default-directory): + * emacs-lisp/derived.el (derived-mode-class): + * emacs-lisp/timer.el (timer-set-time-with-usecs): + * emacs-lock.el (toggle-emacs-lock): + * epa.el (epa-display-verify-result): + * epg.el (epg-sign-keys, epg-start-sign-keys) + (epg-passphrase-callback-function): + * eshell/esh-util.el (eshell-for): + * eshell/eshell.el (eshell-remove-from-window-buffer-names) + (eshell-add-to-window-buffer-names): + * files.el (locate-file-completion): + * imenu.el (imenu-example--create-c-index) + (imenu-example--create-lisp-index) + (imenu-example--lisp-extract-index-name) + (imenu-example--name-and-position): + * international/mule-cmds.el (princ-list): + * international/mule-diag.el (decode-codepage-char): + * international/mule-util.el (detect-coding-with-priority): + * iswitchb.el (iswitchb-read-buffer): + * mail/mailalias.el (mail-complete): + * mail/sendmail.el (mail-sent-via): + * mouse.el (mouse-popup-menubar-stuff, mouse-popup-menubar) + (mouse-major-mode-menu): + * password-cache.el (password-read-and-add): + * pcomplete.el (pcomplete-parse-comint-arguments): + * progmodes/sh-script.el (sh-maybe-here-document): + * replace.el (query-replace-regexp-eval): + * savehist.el (savehist-load): + * simple.el (choose-completion-delete-max-match): + * term.el (term-dynamic-simple-complete): + * vc/ediff-init.el (ediff-check-version): + * vc/ediff-wind.el (ediff-choose-window-setup-function-automatically): + * vc/vc.el (vc-diff-switches-list): + * view.el (view-return-to-alist-update): Likewise. + + * subr.el (eval-next-after-load, makehash, insert-string) + (assoc-ignore-representation, assoc-ignore-case): Use declare to + mark obsolete. + (mode-line-inverse-video): Variable deleted. + + * international/mule-util.el (string-to-sequence): Remove. + + * calendar/calendar.el (calendar-version): + * calendar/icalendar.el (icalendar-extract-ical-from-buffer) + (icalendar-convert-diary-to-ical): + * cus-edit.el (custom-mode): + * ansi-color.el (ansi-color-unfontify-region): + * international/latin1-disp.el (latin1-char-displayable-p): + * progmodes/cwarn.el (turn-on-cwarn-mode): + * progmodes/which-func.el (which-func-update-1): Use + define-obsolete-function-alias. + + * net/newst-backend.el (newsticker-cache-filename): + * net/newst-treeview.el (newsticker-groups-filename): Fix + incorrect obsolescence declaration. + + * allout.el (allout-passphrase-hint-string): Likewise. + (allout-init): Use a declare form to mark obsolete. + + * emacs-lisp/byte-run.el (make-obsolete): Doc fix; emphasize that + this applies to functions. + + * iswitchb.el (iswitchb-read-buffer): Move code of + iswitchb-define-mode-map here, and delete that obsolete function. + + * net/snmp-mode.el (snmp-font-lock-keywords-3): Don't use obsolete + font-lock-reference-face. + 2012-09-25 Glenn Morris * buff-menu.el (Buffer-menu-name-width, Buffer-menu-size-width): @@ -26,10 +107,6 @@ 2012-09-24 Chong Yidong - * iswitchb.el (iswitchb-read-buffer): Move - iswitchb-define-mode-map code here, and delete that obsolete - function. - * mail/supercite.el (sc-version): Remove obsolete function. (sc-describe): Don't mark as obsolete, since it is bound. (sc-submit-bug-report): Remove. diff --git a/lisp/allout.el b/lisp/allout.el index acf0b7d75b6..04de853ebe0 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1522,8 +1522,8 @@ The verifier string is retained as an Emacs file variable, as well as in the Emacs buffer state, if file variable adjustments are enabled. See `allout-enable-file-variable-adjustment' for details about that.") (make-variable-buffer-local 'allout-passphrase-verifier-string) -(make-obsolete 'allout-passphrase-verifier-string - 'allout-passphrase-verifier-string "23.3") +(make-obsolete-variable 'allout-passphrase-verifier-string + 'allout-passphrase-verifier-string "23.3") ;;;###autoload (put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp) ;;;_ = allout-passphrase-hint-string @@ -1538,8 +1538,8 @@ state, if file variable adjustments are enabled. See `allout-enable-file-variable-adjustment' for details about that.") (make-variable-buffer-local 'allout-passphrase-hint-string) (setq-default allout-passphrase-hint-string "") -(make-obsolete 'allout-passphrase-hint-string - 'allout-passphrase-hint-string "23.3") +(make-obsolete-variable 'allout-passphrase-hint-string + 'allout-passphrase-hint-string "23.3") ;;;###autoload (put 'allout-passphrase-hint-string 'safe-local-variable 'stringp) ;;;_ = allout-after-save-decrypt @@ -1688,11 +1688,10 @@ from what it did before, for backwards compatibility. MODE is the activation mode - see `allout-auto-activation' for valid values." - + (declare (obsolete allout-auto-activation "23.3")) (custom-set-variables (list 'allout-auto-activation (format "%s" mode))) (format "%s" mode)) -(make-obsolete 'allout-init - "customize 'allout-auto-activation' instead." "23.3") + ;;;_ > allout-setup-menubar () (defun allout-setup-menubar () "Populate the current buffer's menubar with `allout-mode' stuff." diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 8305aaf1199..047b4b944b9 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -230,8 +230,8 @@ This is a good function to put in `comint-output-filter-functions'." (t (ansi-color-apply-on-region start-marker end-marker))))) -(defalias 'ansi-color-unfontify-region 'font-lock-default-unfontify-region) -(make-obsolete 'ansi-color-unfontify-region "not needed any more" "24.1") +(define-obsolete-function-alias 'ansi-color-unfontify-region + 'font-lock-default-unfontify-region "24.1") ;; Working with strings (defvar ansi-color-context nil diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 31bbc13acf9..26ba1dec00f 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -1048,12 +1048,11 @@ The return value has the form (BUFFER . POINT). Note: this function is deprecated and is present for Emacs 22 compatibility only." + (declare (obsolete bookmark-handle-bookmark "23.1")) (save-excursion (bookmark-handle-bookmark bookmark) (cons (current-buffer) (point)))) -(make-obsolete 'bookmark-jump-noselect 'bookmark-handle-bookmark "23.1") - (defun bookmark-handle-bookmark (bookmark-name-or-record) "Call BOOKMARK-NAME-OR-RECORD's handler or `bookmark-default-handler' if it has none. This changes current buffer and point and returns nil, diff --git a/lisp/calendar/cal-x.el b/lisp/calendar/cal-x.el index 0f2d43b2237..6fba7fb7423 100644 --- a/lisp/calendar/cal-x.el +++ b/lisp/calendar/cal-x.el @@ -155,29 +155,23 @@ If PROMPT is non-nil, prompt for the month and year to use." (defun calendar-one-frame-setup (&optional prompt) "Display calendar and diary in a single dedicated frame. See `calendar-frame-setup' for more information." + (declare (obsolete calendar-frame-setup "23.1")) (calendar-frame-setup 'one-frame prompt)) -(make-obsolete 'calendar-one-frame-setup 'calendar-frame-setup "23.1") - - ;;;###cal-autoload (defun calendar-only-one-frame-setup (&optional prompt) "Display calendar in a dedicated frame. See `calendar-frame-setup' for more information." + (declare (obsolete calendar-frame-setup "23.1")) (calendar-frame-setup 'calendar-only prompt)) -(make-obsolete 'calendar-only-one-frame-setup 'calendar-frame-setup "23.1") - - ;;;###cal-autoload (defun calendar-two-frame-setup (&optional prompt) "Display calendar and diary in separate, dedicated frames. See `calendar-frame-setup' for more information." + (declare (obsolete calendar-frame-setup "23.1")) (calendar-frame-setup 'two-frames prompt)) -(make-obsolete 'calendar-two-frame-setup 'calendar-frame-setup "23.1") - - ;; Undocumented and probably useless. (defvar cal-x-load-hook nil "Hook run on loading of the `cal-x' package.") diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index c85b775d9d3..6f8311f4c55 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -1001,18 +1001,16 @@ The valid styles are described in the documentation of `calendar-date-style'." (defun european-calendar () "Set the interpretation and display of dates to the European style." + (declare (obsolete calendar-set-date-style "23.1")) (interactive) (calendar-set-date-style 'european)) -(make-obsolete 'european-calendar 'calendar-set-date-style "23.1") - (defun american-calendar () "Set the interpretation and display of dates to the American style." + (declare (obsolete calendar-set-date-style "23.1")) (interactive) (calendar-set-date-style 'american)) -(make-obsolete 'american-calendar 'calendar-set-date-style "23.1") - (define-obsolete-variable-alias 'holidays-in-diary-buffer 'diary-show-holidays-flag "23.1") @@ -1148,14 +1146,13 @@ MON defaults to `displayed-month'. YR defaults to `displayed-year'." "Execute a for loop. Evaluate BODY with VAR bound to successive integers from INIT to FINAL, inclusive. The standard macro `dotimes' is preferable in most cases." - (declare (debug (symbolp "from" form "to" form "do" body)) + (declare (obsolete "use `dotimes' or `while' instead." "23.1") + (debug (symbolp "from" form "to" form "do" body)) (indent defun)) `(let ((,var (1- ,init))) (while (>= ,final (setq ,var (1+ ,var))) ,@body))) -(make-obsolete 'calendar-for-loop "use `dotimes' or `while' instead." "23.1") - (defmacro calendar-sum (index initial condition expression) "For INDEX = INITIAL, +1, ... (as long as CONDITION holds), sum EXPRESSION." (declare (debug (symbolp form form form))) @@ -2655,13 +2652,7 @@ If called by a mouse-event, pops up a menu with the result." "---") (calendar-string-spread (list str) ?- width))))) -(defun calendar-version () - "Display the Calendar version." - (interactive) - (message "GNU Emacs %s" emacs-version)) - -(make-obsolete 'calendar-version 'emacs-version "23.1") - +(define-obsolete-function-alias 'calendar-version 'emacs-version "23.1") (run-hooks 'calendar-load-hook) diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el index 7326aa530ad..39b83d4c831 100644 --- a/lisp/calendar/icalendar.el +++ b/lisp/calendar/icalendar.el @@ -931,8 +931,8 @@ Finto iCalendar file: ") (set-buffer (find-file diary-filename)) (icalendar-export-region (point-min) (point-max) ical-filename))) -(defalias 'icalendar-convert-diary-to-ical 'icalendar-export-file) -(make-obsolete 'icalendar-convert-diary-to-ical 'icalendar-export-file "22.1") +(define-obsolete-function-alias 'icalendar-convert-diary-to-ical + 'icalendar-export-file "22.1") (defvar icalendar--uid-count 0 "Auxiliary counter for creating unique ids.") @@ -1881,8 +1881,8 @@ buffer `*icalendar-errors*'." ;; return nil, i.e. import did not work nil))) -(defalias 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer) -(make-obsolete 'icalendar-extract-ical-from-buffer 'icalendar-import-buffer "22.1") +(define-obsolete-function-alias 'icalendar-extract-ical-from-buffer + 'icalendar-import-buffer "22.1") (defun icalendar--format-ical-event (event) "Create a string representation of an iCalendar EVENT." diff --git a/lisp/comint.el b/lisp/comint.el index 994d81a375a..fea9cecfa03 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -3069,11 +3069,11 @@ Magic characters are those in `comint-file-name-quote-list'." (defun comint-unquote-filename (filename) "Return FILENAME with quoted characters unquoted." + (declare (obsolete nil "24.3")) (if (null comint-file-name-quote-list) filename (save-match-data (replace-regexp-in-string "\\\\\\(.\\)" "\\1" filename t)))) -(make-obsolete 'comint-unquote-filename nil "24.3") (defun comint--requote-argument (upos qstr) ;; See `completion-table-with-quoting'. @@ -3170,10 +3170,9 @@ See `completion-table-with-quoting' and `comint-unquote-function'.") (defun comint-dynamic-complete-as-filename () "Dynamically complete at point as a filename. See `comint-dynamic-complete-filename'. Returns t if successful." + (declare (obsolete comint-filename-completion "24.1")) (let ((data (comint--complete-file-name-data))) (completion-in-region (nth 0 data) (nth 1 data) (nth 2 data)))) -(make-obsolete 'comint-dynamic-complete-as-filename - 'comint-filename-completion "24.1") (defun comint-replace-by-expanded-filename () "Dynamically expand and complete the filename at point. @@ -3204,6 +3203,7 @@ Return `partial' if completed as far as possible. Return `listed' if a completion listing was shown. See also `comint-dynamic-complete-filename'." + (declare (obsolete completion-in-region "24.1")) (let* ((completion-ignore-case (memq system-type '(ms-dos windows-nt cygwin))) (minibuffer-p (window-minibuffer-p (selected-window))) (suffix (cond ((not comint-completion-addsuffix) "") @@ -3246,8 +3246,6 @@ See also `comint-dynamic-complete-filename'." (unless minibuffer-p (message "Partially completed")) 'partial))))))) -(make-obsolete 'comint-dynamic-simple-complete 'completion-in-region "24.1") - (defun comint-dynamic-list-filename-completions () "Display a list of possible completions for the filename at point." diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 2e6f2b14625..8e06b16bd12 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2228,9 +2228,9 @@ and `face'." (setq widget nil))))) (widget-setup)) -(make-obsolete 'custom-show "this widget type is no longer supported." "24.1") (defun custom-show (widget value) "Non-nil if WIDGET should be shown with VALUE by default." + (declare (obsolete "this widget type is no longer supported." "24.1")) (let ((show (widget-get widget :custom-show))) (if (functionp show) (funcall show widget value) @@ -4823,12 +4823,7 @@ if that value is non-nil." (put 'Custom-mode 'mode-class 'special) -;; backward-compatibility -(defun custom-mode () - "Non-interactive variant of `Custom-mode'." - (Custom-mode)) -(make-obsolete 'custom-mode 'Custom-mode "23.1") -(put 'custom-mode 'mode-class 'special) +(define-obsolete-function-alias 'custom-mode 'Custom-mode "23.1") (add-to-list 'debug-ignored-errors "^Invalid face:? ") diff --git a/lisp/cus-start.el b/lisp/cus-start.el index a91a479b054..28c1d3e3026 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -443,7 +443,6 @@ since it could result in memory overflow and make Emacs crash." (hscroll-step windows number "22.1") (truncate-partial-width-windows display boolean "23.1") (make-cursor-line-fully-visible windows boolean) - (mode-line-inverse-video mode-line boolean) (mode-line-in-non-selected-windows mode-line boolean "22.1") (line-number-display-limit display (choice integer diff --git a/lisp/desktop.el b/lisp/desktop.el index 75deb58b4d8..c8023bb43ed 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1045,11 +1045,10 @@ Using it may cause conflicts. Use it anyway? " owner))))) (defun desktop-load-default () "Load the `default' start-up library manually. Also inhibit further loading of it." + (declare (obsolete desktop-save-mode "22.1")) (unless inhibit-default-init ; safety check (load "default" t t) (setq inhibit-default-init t))) -(make-obsolete 'desktop-load-default - 'desktop-save-mode "22.1") ;; ---------------------------------------------------------------------------- ;;;###autoload diff --git a/lisp/dired-x.el b/lisp/dired-x.el index f176cf7dbe0..1237eef86cf 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -723,15 +723,13 @@ determine a default directory.") (defun dired-default-directory () "Return the `dired-default-directory-alist' entry for the current major-mode. If none, return `default-directory'." + ;; It looks like this was intended to be something of a "general" + ;; feature, but it only ever seems to have been used in + ;; dired-smart-shell-command, and doesn't seem worth keeping around. + (declare (obsolete nil "24.1")) (or (eval (cdr (assq major-mode dired-default-directory-alist))) default-directory)) -;; It looks like this was intended to be something of a "general" feature, -;; but it only ever seems to have been used in dired-smart-shell-command, -;; and does not seem worth keeping around (?). -(make-obsolete 'dired-default-directory - "this feature is due to be removed." "24.1") - (defun dired-smart-shell-command (command &optional output-buffer error-buffer) "Like function `shell-command', but in the current Virtual Dired directory." (interactive @@ -782,6 +780,7 @@ See also `dired-enable-local-variables'." (defun dired-hack-local-variables () "Evaluate local variables in `dired-local-variables-file' for dired buffer." + (declare (obsolete hack-dir-local-variables-non-file-buffer "24.1")) (and (stringp dired-local-variables-file) (file-exists-p dired-local-variables-file) (let ((opoint (point-max)) @@ -803,14 +802,12 @@ See also `dired-enable-local-variables'." ;; Make sure that the mode line shows the proper information. (dired-sort-set-mode-line)))) -(make-obsolete 'dired-hack-local-variables - 'hack-dir-local-variables-non-file-buffer "24.1") - ;; Does not seem worth a dedicated command. ;; See the more general features in files-x.el. (defun dired-omit-here-always () "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'. If in a Dired buffer, reverts it." + (declare (obsolete add-dir-local-variable "24.1")) (interactive) (if (file-exists-p dired-local-variables-file) (error "Old-style dired-local-variables-file `./%s' found; @@ -830,8 +827,6 @@ replace it with a dir-locals-file `./%s'" (dired-extra-startup) (dired-revert)))) -(make-obsolete 'dired-omit-here-always 'add-dir-local-variable "24.1") - ;;; GUESS SHELL COMMAND. diff --git a/lisp/dired.el b/lisp/dired.el index ed7e6b0ddc8..e0f90b321aa 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -4268,7 +4268,7 @@ instead. ;;;*** ;;;### (autoloads (dired-do-relsymlink dired-jump-other-window dired-jump) -;;;;;; "dired-x" "dired-x.el" "d2461aa6efb8c1d7de8f245728ab448e") +;;;;;; "dired-x" "dired-x.el" "a4e6844421c2c5e6fde90e959fbcc26f") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 93e890a20c9..d740574f1e4 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -253,7 +253,9 @@ convention was modified." advertised-signature-table)) (defun make-obsolete (obsolete-name current-name &optional when) - "Make the byte-compiler warn that OBSOLETE-NAME is obsolete. + "Make the byte-compiler warn that function OBSOLETE-NAME is obsolete. +OBSOLETE-NAME should be a function name or macro name (a symbol). + The warning will say that CURRENT-NAME should be used instead. If CURRENT-NAME is a string, that is the `use instead' message \(it should end with a period, and not start with a capital). diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index ea72e9492f0..8c8d37b2194 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el @@ -276,10 +276,10 @@ A mode's class is the first ancestor which is NOT a derived mode. Use the `derived-mode-parent' property of the symbol to trace backwards. Since major-modes might all derive from `fundamental-mode', this function is not very useful." + (declare (obsolete derived-mode-p "22.1")) (while (get mode 'derived-mode-parent) (setq mode (get mode 'derived-mode-parent))) mode) -(make-obsolete 'derived-mode-class 'derived-mode-p "22.1") ;;; PRIVATE diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index bcd582a6f88..494d8a87e0e 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -146,14 +146,13 @@ TIME must be in the internal format returned by, e.g., `current-time'. The microsecond count from TIME is ignored, and USECS is used instead. If optional fourth argument DELTA is a positive number, make the timer fire repeatedly that many seconds apart." + (declare (obsolete "use `timer-set-time' and `timer-inc-time' instead." + "22.1")) (setf (timer--time timer) time) (setf (timer--usecs timer) usecs) (setf (timer--psecs timer) 0) (setf (timer--repeat-delay timer) (and (numberp delta) (> delta 0) delta)) timer) -(make-obsolete 'timer-set-time-with-usecs - "use `timer-set-time' and `timer-inc-time' instead." - "22.1") (defun timer-set-function (timer function &optional args) "Make TIMER call FUNCTION with optional ARGS when triggering." diff --git a/lisp/emacs-lock.el b/lisp/emacs-lock.el index 5343d499efb..b20ec13fa81 100644 --- a/lisp/emacs-lock.el +++ b/lisp/emacs-lock.el @@ -249,9 +249,9 @@ Other values are interpreted as usual." (defun toggle-emacs-lock () "Toggle `emacs-lock-from-exiting' for the current buffer." + (declare (obsolete emacs-lock-mode "24.1")) (interactive) (call-interactively 'emacs-lock-mode)) -(make-obsolete 'toggle-emacs-lock 'emacs-lock-mode "24.1") (provide 'emacs-lock) diff --git a/lisp/epa.el b/lisp/epa.el index b796f5fa77c..ecc27c4d299 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -585,8 +585,8 @@ If SECRET is non-nil, list secret keys instead of public keys." (message "%s" info))) (defun epa-display-verify-result (verify-result) + (declare (obsolete epa-display-info "23.1")) (epa-display-info (epg-verify-result-to-string verify-result))) -(make-obsolete 'epa-display-verify-result 'epa-display-info "23.1") (defun epa-passphrase-callback-function (context key-id handback) (if (eq key-id 'SYM) diff --git a/lisp/epg.el b/lisp/epg.el index 6529afb2d3c..b0e01bc3721 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -1779,6 +1779,7 @@ This function is for internal use only." (epg-context-set-result-for context 'import-status nil))) (defun epg-passphrase-callback-function (context key-id _handback) + (declare (obsolete epa-passphrase-callback-function "23.1")) (if (eq key-id 'SYM) (read-passwd "Passphrase for symmetric encryption: " (eq (epg-context-operation context) 'encrypt)) @@ -1790,9 +1791,6 @@ This function is for internal use only." (format "Passphrase for %s %s: " key-id (cdr entry)) (format "Passphrase for %s: " key-id))))))) -(make-obsolete 'epg-passphrase-callback-function - 'epa-passphrase-callback-function "23.1") - (defun epg--list-keys-1 (context name mode) (let ((args (append (if epg-gpg-home-directory (list "--homedir" epg-gpg-home-directory)) @@ -2562,6 +2560,7 @@ If you use this function, you will need to wait for the completion of `epg-reset' to clear a temporary output file. If you are unsure, use synchronous version of this function `epg-sign-keys' instead." + (declare (obsolete nil "23.1")) (epg-context-set-operation context 'sign-keys) (epg-context-set-result context nil) (epg--start context (cons (if local @@ -2572,10 +2571,10 @@ If you are unsure, use synchronous version of this function (epg-sub-key-id (car (epg-key-sub-key-list key)))) keys)))) -(make-obsolete 'epg-start-sign-keys "do not use." "23.1") (defun epg-sign-keys (context keys &optional local) "Sign KEYS from the key ring." + (declare (obsolete nil "23.1")) (unwind-protect (progn (epg-start-sign-keys context keys local) @@ -2586,7 +2585,6 @@ If you are unsure, use synchronous version of this function (list "Sign keys failed" (epg-errors-to-string errors)))))) (epg-reset context))) -(make-obsolete 'epg-sign-keys "do not use." "23.1") (defun epg-start-generate-key (context parameters) "Initiate a key generation. diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 674a6c97eec..348765036ea 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,7 @@ +2012-09-25 Chong Yidong + + * erc.el (erc-send-command): Use define-obsolete-function-alias. + 2012-09-17 Chong Yidong * erc-page.el (erc-page-function): diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index feef75940f3..7feadc50aca 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -139,8 +139,8 @@ (message (concat "ERC: The function `defvaralias' is not bound. See the " "NEWS file for variable name changes since ERC 5.0.4."))) -(defalias 'erc-send-command 'erc-server-send) -(erc-make-obsolete 'erc-send-command 'erc-server-send "ERC 5.1") +(define-obsolete-function-alias 'erc-send-command + 'erc-server-send "ERC 5.1") ;; tunable connection and authentication parameters diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el index fa0336232f9..01df5fced62 100644 --- a/lisp/eshell/esh-util.el +++ b/lisp/eshell/esh-util.el @@ -275,6 +275,7 @@ Prepend remote identification of `default-directory', if any." (defmacro eshell-for (for-var for-list &rest forms) "Iterate through a list." + (declare (obsolete dolist "24.1")) (declare (indent 2)) `(let ((list-iter ,for-list)) (while list-iter @@ -282,9 +283,6 @@ Prepend remote identification of `default-directory', if any." ,@forms) (setq list-iter (cdr list-iter))))) - -(make-obsolete 'eshell-for 'dolist "24.1") - (defun eshell-flatten-list (args) "Flatten any lists within ARGS, so that there are no sublists." (let ((new-list (list t))) diff --git a/lisp/eshell/eshell.el b/lisp/eshell/eshell.el index c663de3f40d..a9a854221a4 100644 --- a/lisp/eshell/eshell.el +++ b/lisp/eshell/eshell.el @@ -243,16 +243,14 @@ shells such as bash, zsh, rc, 4dos." (defun eshell-add-to-window-buffer-names () "Add `eshell-buffer-name' to `same-window-buffer-names'." + (declare (obsolete nil "24.3")) (add-to-list 'same-window-buffer-names eshell-buffer-name)) -(make-obsolete 'eshell-add-to-window-buffer-names - "no longer needed." "24.3") (defun eshell-remove-from-window-buffer-names () "Remove `eshell-buffer-name' from `same-window-buffer-names'." + (declare (obsolete nil "24.3")) (setq same-window-buffer-names (delete eshell-buffer-name same-window-buffer-names))) -(make-obsolete 'eshell-remove-from-window-buffer-names - "no longer needed." "24.3") (defcustom eshell-load-hook nil "A hook run once Eshell has been loaded." diff --git a/lisp/files.el b/lisp/files.el index 66c526266e6..76a13f6cefd 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -821,10 +821,10 @@ one or more of those symbols." (defun locate-file-completion (string path-and-suffixes action) "Do completion for file names passed to `locate-file'. PATH-AND-SUFFIXES is a pair of lists, (DIRECTORIES . SUFFIXES)." + (declare (obsolete locate-file-completion-table "23.1")) (locate-file-completion-table (car path-and-suffixes) (cdr path-and-suffixes) string nil action)) -(make-obsolete 'locate-file-completion 'locate-file-completion-table "23.1") (defvar locate-dominating-stop-dir-regexp (purecopy "\\`\\(?:[\\/][\\/][^\\/]+[\\/]\\|/\\(?:net\\|afs\\|\\.\\.\\.\\)/\\)\\'") diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el index fbf7a672ff6..b0bc5b6b3b3 100644 --- a/lisp/htmlfontify.el +++ b/lisp/htmlfontify.el @@ -1052,8 +1052,6 @@ haven't encountered them yet. Returns a `hfy-style-assoc'." (hfy-face-attr-for-class fn hfy-display-class)) ((and (symbolp fn) (facep (symbol-value fn))) - ;; Obsolete faces like `font-lock-reference-face' are defined as - ;; aliases for another face. (hfy-face-attr-for-class (symbol-value fn) hfy-display-class)) (t nil))) diff --git a/lisp/imenu.el b/lisp/imenu.el index c2a80d69675..47a2f1e3b40 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -326,6 +326,7 @@ PREVPOS is the variable in which we store the last position displayed." (defun imenu-example--name-and-position () "Return the current/previous sexp and its (beginning) location. Don't move point." + (declare (obsolete "use your own function instead." "23.2")) (save-excursion (forward-sexp -1) ;; [ydi] modified for imenu-use-markers @@ -333,8 +334,6 @@ Don't move point." (end (progn (forward-sexp) (point)))) (cons (buffer-substring beg end) beg)))) -(make-obsolete 'imenu-example--name-and-position - "use your own function instead." "23.2") ;;; ;;; Lisp @@ -343,6 +342,7 @@ Don't move point." (defun imenu-example--lisp-extract-index-name () ;; Example of a candidate for `imenu-extract-index-name-function'. ;; This will generate a flat index of definitions in a lisp file. + (declare (obsolete nil "23.2")) (save-match-data (and (looking-at "(def") (condition-case nil @@ -353,11 +353,11 @@ Don't move point." (end (progn (forward-sexp -1) (point)))) (buffer-substring beg end))) (error nil))))) -(make-obsolete 'imenu-example--lisp-extract-index-name "your own" "23.2") (defun imenu-example--create-lisp-index () ;; Example of a candidate for `imenu-create-index-function'. ;; It will generate a nested index of definitions. + (declare (obsolete nil "23.2")) (let ((index-alist '()) (index-var-alist '()) (index-type-alist '()) @@ -401,7 +401,6 @@ Don't move point." (push (cons "Syntax-unknown" index-unknown-alist) index-alist)) index-alist)) -(make-obsolete 'imenu-example--create-lisp-index "your own" "23.2") ;; Regular expression to find C functions (defvar imenu-example--function-name-regexp-c @@ -414,6 +413,7 @@ Don't move point." )) (defun imenu-example--create-c-index (&optional regexp) + (declare (obsolete nil "23.2")) (let ((index-alist '()) char) (goto-char (point-min)) @@ -430,7 +430,6 @@ Don't move point." (if (not (eq char ?\;)) (push (imenu-example--name-and-position) index-alist)))) (nreverse index-alist))) -(make-obsolete 'imenu-example--create-c-index "your own" "23.2") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; diff --git a/lisp/international/latin1-disp.el b/lisp/international/latin1-disp.el index 964f01c982c..5041f45ba97 100644 --- a/lisp/international/latin1-disp.el +++ b/lisp/international/latin1-disp.el @@ -202,8 +202,8 @@ character set: `latin-2', `hebrew' etc." (and char (char-displayable-p char)))) ;; Backwards compatibility. -(defalias 'latin1-char-displayable-p 'char-displayable-p) -(make-obsolete 'latin1-char-displayable-p 'char-displayable-p "22.1") +(define-obsolete-function-alias 'latin1-char-displayable-p + 'char-displayable-p "22.1") (defun latin1-display-setup (set &optional force) "Set up Latin-1 display for characters in the given SET. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 2fc9759972e..a32c69a691e 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2058,9 +2058,9 @@ See `set-language-info-alist' for use in programs." (defun princ-list (&rest args) "Print all arguments with `princ', then print \"\\n\"." + (declare (obsolete "use mapc and princ instead." "23.3")) (mapc #'princ args) (princ "\n")) -(make-obsolete 'princ-list "use mapc and princ instead" "23.3") (put 'describe-specified-language-support 'apropos-inhibit t) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index bd7257bbc0f..43af785cc2f 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -208,8 +208,8 @@ Character sets for defining other charsets, or for backward compatibility "Decode a character that has code CODE in CODEPAGE. Return a decoded character string. Each CODEPAGE corresponds to a coding system cpCODEPAGE." + (declare (obsolete decode-char "23.1")) (decode-char (intern (format "cp%d" codepage)) code)) -(make-obsolete 'decode-codepage-char 'decode-char "23.1") ;; A variable to hold charset input history. (defvar charset-history nil) diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 7b152a47727..3dc0b54421a 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -33,39 +33,6 @@ ;;; String manipulations while paying attention to multibyte ;;; characters. -;;;###autoload -(defun string-to-sequence (string type) - "Convert STRING to a sequence of TYPE which contains characters in STRING. -TYPE should be `list' or `vector'." -;;; (let ((len (length string)) -;;; (i 0) -;;; val) - (cond ((eq type 'list) - ;; Applicable post-Emacs 20.2 and asymptotically ~10 times - ;; faster than the code below: - (append string nil)) -;;; (setq val (make-list len 0)) -;;; (let ((l val)) -;;; (while (< i len) -;;; (setcar l (aref string i)) -;;; (setq l (cdr l) i (1+ i)))))) - ((eq type 'vector) - ;; As above. - (vconcat string)) -;;; (setq val (make-vector len 0)) -;;; (while (< i len) -;;; (aset val i (aref string i)) -;;; (setq i (1+ i)))) - (t - (error "Invalid type: %s" type))) -;;; val) -) - -;;;###autoload -(make-obsolete 'string-to-sequence - "use `string-to-list' or `string-to-vector'." - "22.1") - ;;;###autoload (defsubst string-to-list (string) "Return a list of characters in STRING." @@ -330,10 +297,9 @@ operations such as `find-coding-systems-region'." "Detect a coding system of the text between FROM and TO with PRIORITY-LIST. PRIORITY-LIST is an alist of coding categories vs the corresponding coding systems ordered by priority." + (declare (obsolete with-coding-priority "23.1")) `(with-coding-priority (mapcar #'cdr ,priority-list) (detect-coding-region ,from ,to))) -(make-obsolete 'detect-coding-with-priority - "use `with-coding-priority' and `detect-coding-region'." "23.1") ;;;###autoload (defun detect-coding-with-language-environment (from to lang-env) diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 624c3500939..13ab41cf83a 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -527,33 +527,6 @@ selected.") ;;; FUNCTIONS -;;; ISWITCHB KEYMAP -(defun iswitchb-define-mode-map () - "Set up the keymap for `iswitchb-buffer'." - (interactive) - (let (map) - ;; generated every time so that it can inherit new functions. - ;;(or iswitchb-mode-map - - (setq map (copy-keymap minibuffer-local-map)) - (define-key map "?" 'iswitchb-completion-help) - (define-key map "\C-s" 'iswitchb-next-match) - (define-key map "\C-r" 'iswitchb-prev-match) - (define-key map "\t" 'iswitchb-complete) - (define-key map "\C-j" 'iswitchb-select-buffer-text) - (define-key map "\C-t" 'iswitchb-toggle-regexp) - (define-key map "\C-x\C-f" 'iswitchb-find-file) - (define-key map "\C-n" 'iswitchb-toggle-ignore) - (define-key map "\C-c" 'iswitchb-toggle-case) - (define-key map "\C-k" 'iswitchb-kill-buffer) - (define-key map "\C-m" 'iswitchb-exit-minibuffer) - (setq iswitchb-mode-map map) - (run-hooks 'iswitchb-define-mode-map-hook))) - -(make-obsolete 'iswitchb-define-mode-map - "use M-x iswitchb-mode or customize the variable `iswitchb-mode'." - "21.1") - ;;; MAIN FUNCTION (defun iswitchb () "Switch to buffer matching a substring. @@ -619,14 +592,25 @@ If START is a string, the selection process is started with that string. If MATCHES-SET is non-nil, the buflist is not updated before the selection process begins. Used by isearchb.el." - (let - ( - buf-sel - iswitchb-final-text - (icomplete-mode nil) ;; prevent icomplete starting up - ) - - (iswitchb-define-mode-map) + ;; The map is generated every time so that it can inherit new + ;; functions. + (let ((map (copy-keymap minibuffer-local-map)) + buf-sel iswitchb-final-text map + icomplete-mode) ; prevent icomplete starting up + (define-key map "?" 'iswitchb-completion-help) + (define-key map "\C-s" 'iswitchb-next-match) + (define-key map "\C-r" 'iswitchb-prev-match) + (define-key map "\t" 'iswitchb-complete) + (define-key map "\C-j" 'iswitchb-select-buffer-text) + (define-key map "\C-t" 'iswitchb-toggle-regexp) + (define-key map "\C-x\C-f" 'iswitchb-find-file) + (define-key map "\C-n" 'iswitchb-toggle-ignore) + (define-key map "\C-c" 'iswitchb-toggle-case) + (define-key map "\C-k" 'iswitchb-kill-buffer) + (define-key map "\C-m" 'iswitchb-exit-minibuffer) + (setq iswitchb-mode-map map) + (run-hooks 'iswitchb-define-mode-map-hook) + (setq iswitchb-exit nil) (setq iswitchb-default (if (bufferp default) diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el index 0b55fe42e42..c7943fe40c8 100644 --- a/lisp/mail/mailalias.el +++ b/lisp/mail/mailalias.el @@ -427,6 +427,7 @@ For use on `completion-at-point-functions'." "Perform completion on header field or word preceding point. Completable headers are according to `mail-complete-alist'. If none matches current header, calls `mail-complete-function' and passes prefix ARG if any." + (declare (obsolete mail-completion-at-point-function "24.1")) (interactive "P") ;; Read the defaults first, if we have not done so. (sendmail-sync-aliases) @@ -439,7 +440,6 @@ current header, calls `mail-complete-function' and passes prefix ARG if any." (if data (apply #'completion-in-region data) (funcall mail-complete-function arg)))) -(make-obsolete 'mail-complete 'mail-completion-at-point-function "24.1") (defun mail-completion-expand (table) "Build new completion table that expands aliases. diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index b75841489c9..331754fb1b5 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -1414,6 +1414,7 @@ just append to the file, in Babyl format if necessary." (defun mail-sent-via () "Make a Sent-via header line from each To or CC header line." + (declare (obsolete "nobody can remember what it is for." "24.1")) (interactive) (save-excursion ;; put a marker at the end of the header @@ -1433,9 +1434,6 @@ just append to the file, in Babyl format if necessary." (point))))) ;; Insert a copy, with altered header field name. (insert-before-markers "Sent-via:" to-line)))))) - -(make-obsolete 'mail-sent-via "nobody can remember what it is for." "24.1") - (defun mail-to () "Move point to end of To field, creating it if necessary." diff --git a/lisp/mouse.el b/lisp/mouse.el index 4ea84288f69..74bb97b3086 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -284,23 +284,24 @@ not it is actually displayed." (defun mouse-major-mode-menu (event &optional prefix) "Pop up a mode-specific menu of mouse commands. Default to the Edit menu if the major mode doesn't define a menu." + (declare (obsolete mouse-menu-major-mode-map "23.1")) (interactive "@e\nP") (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) (popup-menu (mouse-menu-major-mode-map) event prefix)) -(make-obsolete 'mouse-major-mode-menu 'mouse-menu-major-mode-map "23.1") (defun mouse-popup-menubar (event prefix) "Pop up a menu equivalent to the menu bar for keyboard EVENT with PREFIX. The contents are the items that would be in the menu bar whether or not it is actually displayed." + (declare (obsolete mouse-menu-bar-map "23.1")) (interactive "@e \nP") (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) (popup-menu (mouse-menu-bar-map) (unless (integerp event) event) prefix)) -(make-obsolete 'mouse-popup-menubar 'mouse-menu-bar-map "23.1") (defun mouse-popup-menubar-stuff (event prefix) "Popup a menu like either `mouse-major-mode-menu' or `mouse-popup-menubar'. Use the former if the menu bar is showing, otherwise the latter." + (declare (obsolete nil "23.1")) (interactive "@e\nP") (run-hooks 'activate-menubar-hook 'menu-bar-update-hook) (popup-menu @@ -308,7 +309,6 @@ Use the former if the menu bar is showing, otherwise the latter." (mouse-menu-bar-map) (mouse-menu-major-mode-map)) event prefix)) -(make-obsolete 'mouse-popup-menubar-stuff nil "23.1") ;; Commands that operate on windows. diff --git a/lisp/net/newst-backend.el b/lisp/net/newst-backend.el index c78249ced0f..bc6fd38f713 100644 --- a/lisp/net/newst-backend.el +++ b/lisp/net/newst-backend.el @@ -421,7 +421,7 @@ headline after it has been retrieved for the first time." "Name of the newsticker cache file." :type 'string :group 'newsticker-miscellaneous) -(make-obsolete 'newsticker-cache-filename 'newsticker-dir "23.1") +(make-obsolete-variable 'newsticker-cache-filename 'newsticker-dir "23.1") (defcustom newsticker-dir (locate-user-emacs-file "newsticker/" ".newsticker/") diff --git a/lisp/net/newst-treeview.el b/lisp/net/newst-treeview.el index b44f1f9c86d..fc356a303e2 100644 --- a/lisp/net/newst-treeview.el +++ b/lisp/net/newst-treeview.el @@ -128,7 +128,7 @@ Example: (\"Topmost group\" \"feed1\" (\"subgroup1\" \"feed 2\") "Name of the newsticker groups settings file." :type 'string :group 'newsticker-treeview) -(make-obsolete 'newsticker-groups-filename 'newsticker-dir "23.1") +(make-obsolete-variable 'newsticker-groups-filename 'newsticker-dir "23.1") ;; ====================================================================== ;;; internal variables diff --git a/lisp/net/snmp-mode.el b/lisp/net/snmp-mode.el index c155d53b6d0..217f9dc8b30 100644 --- a/lisp/net/snmp-mode.el +++ b/lisp/net/snmp-mode.el @@ -175,9 +175,9 @@ This is used during Tempo template completion." (defvar snmp-font-lock-keywords-3 (append '(("\\([^\n]+\\)[ \t]+::=[ \t]+\\(SEQUENCE\\)[ \t]+{" - (1 font-lock-reference-face) (2 font-lock-keyword-face)) + (1 font-lock-constant-face) (2 font-lock-keyword-face)) ("::=[ \t]*{[ \t]*\\([a-z0-9].*[ \t]+\\)?\\([0-9]+\\)[ \t]*}" - (1 font-lock-reference-face nil t) (2 font-lock-variable-name-face))) + (1 font-lock-constant-face nil t) (2 font-lock-variable-name-face))) snmp-font-lock-keywords-2) "Gaudy SNMP MIB mode expression highlighting.") diff --git a/lisp/password-cache.el b/lisp/password-cache.el index 9f5c18f3415..83815a6a270 100644 --- a/lisp/password-cache.el +++ b/lisp/password-cache.el @@ -102,13 +102,12 @@ Warning: the password is cached without checking that it is correct. It is better to check the password before caching. If you must use this function, take care to check passwords and remove incorrect ones from the cache." + (declare (obsolete password-read "23.1")) (let ((password (password-read prompt key))) (when (and password key) (password-cache-add key password)) password)) -(make-obsolete 'password-read-and-add 'password-read "23.1") - (defun password-cache-remove (key) "Remove password indexed by KEY from password cache. This is typically run by a timer setup from `password-cache-add', diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 3f120961486..fc05af8c7f5 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -724,6 +724,7 @@ this is `comint-dynamic-complete-functions'." (defun pcomplete-parse-comint-arguments () "Parse whitespace separated arguments in the current region." + (declare (obsolete comint-parse-pcomplete-arguments "24.1")) (let ((begin (save-excursion (comint-bol nil) (point))) (end (point)) begins args) @@ -743,8 +744,6 @@ this is `comint-dynamic-complete-functions'." (push (buffer-substring-no-properties (car begins) (point)) args)) (cons (nreverse args) (nreverse begins))))) -(make-obsolete 'pcomplete-parse-comint-arguments - 'comint-parse-pcomplete-arguments "24.1") (defun pcomplete-parse-arguments (&optional expand-p) "Parse the command line arguments. Most completions need this info." diff --git a/lisp/progmodes/cwarn.el b/lisp/progmodes/cwarn.el index 9ea71ad36f5..becbcb7a3de 100644 --- a/lisp/progmodes/cwarn.el +++ b/lisp/progmodes/cwarn.el @@ -191,13 +191,7 @@ if ARG is omitted or nil." (if font-lock-mode (font-lock-fontify-buffer))) ;;;###autoload -(defun turn-on-cwarn-mode () - "Turn on CWarn mode. - -This function is designed to be added to hooks, for example: - (add-hook 'c-mode-hook 'turn-on-cwarn-mode)" - (cwarn-mode 1)) -(make-obsolete 'turn-on-cwarn-mode 'cwarn-mode "24.1") +(define-obsolete-function-alias 'turn-on-cwarn-mode 'cwarn-mode "24.1") ;;}}} ;;{{{ Help functions diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index b4d550bcee0..e94919ee2a9 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -4079,11 +4079,10 @@ option followed by a colon `:' if the option accepts an argument." (defun sh-maybe-here-document (arg) "Insert self. Without prefix, following unquoted `<' inserts here document. The document is bounded by `sh-here-document-word'." + (declare (obsolete sh-electric-here-document-mode "24.3")) (interactive "*P") (self-insert-command (prefix-numeric-value arg)) (or arg (sh--maybe-here-document))) -(make-obsolete 'sh--maybe-here-document - 'sh-electric-here-document-mode "24.3") (defun sh--maybe-here-document () (or (not (looking-back "[^<]<<")) diff --git a/lisp/progmodes/vera-mode.el b/lisp/progmodes/vera-mode.el index 31f2fc1fe31..a2f71ff2ab8 100644 --- a/lisp/progmodes/vera-mode.el +++ b/lisp/progmodes/vera-mode.el @@ -587,12 +587,6 @@ Key bindings: ;;; Font locking ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; XEmacs compatibility -(when (featurep 'xemacs) - (require 'font-lock) - (copy-face 'font-lock-reference-face 'font-lock-constant-face) - (copy-face 'font-lock-preprocessor-face 'font-lock-builtin-face)) - (defun vera-font-lock-match-item (limit) "Match, and move over, any declaration item after point. Adapted from `font-lock-match-c-style-declaration-item-and-skip-to-next'." diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el index 02340425dfa..4819149bdf6 100644 --- a/lisp/progmodes/which-func.el +++ b/lisp/progmodes/which-func.el @@ -234,9 +234,7 @@ It creates the Imenu index for the buffer, if necessary." (error "Error in which-func-update: %S" info)))))) ;;;###autoload -(defun which-func-mode (&optional arg) - (which-function-mode arg)) -(make-obsolete 'which-func-mode 'which-function-mode "24.1") +(define-obsolete-function-alias 'which-func-mode 'which-function-mode "24.1") (defvar which-func-update-timer nil) diff --git a/lisp/replace.el b/lisp/replace.el index f192574a7e2..82edb0037fb 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -378,35 +378,33 @@ regexp in `search-whitespace-regexp'. Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace only matches that are surrounded by word boundaries. Fourth and fifth arg START and END specify the region to operate on." + (declare (obsolete "use the `\\,' feature of `query-replace-regexp' +for interactive calls, and `search-forward-regexp'/`replace-match' +for Lisp calls." "22.1")) (interactive (progn - (barf-if-buffer-read-only) - (let* ((from - ;; Let-bind the history var to disable the "foo -> bar" default. - ;; Maybe we shouldn't disable this default, but for now I'll - ;; leave it off. --Stef - (let ((query-replace-to-history-variable nil)) - (query-replace-read-from "Query replace regexp" t))) - (to (list (read-from-minibuffer - (format "Query replace regexp %s with eval: " - (query-replace-descr from)) - nil nil t query-replace-to-history-variable from t)))) - ;; We make TO a list because replace-match-string-symbols requires one, - ;; and the user might enter a single token. - (replace-match-string-symbols to) - (list from (car to) current-prefix-arg - (if (and transient-mark-mode mark-active) - (region-beginning)) - (if (and transient-mark-mode mark-active) - (region-end)))))) + (barf-if-buffer-read-only) + (let* ((from + ;; Let-bind the history var to disable the "foo -> bar" + ;; default. Maybe we shouldn't disable this default, but + ;; for now I'll leave it off. --Stef + (let ((query-replace-to-history-variable nil)) + (query-replace-read-from "Query replace regexp" t))) + (to (list (read-from-minibuffer + (format "Query replace regexp %s with eval: " + (query-replace-descr from)) + nil nil t query-replace-to-history-variable from t)))) + ;; We make TO a list because replace-match-string-symbols requires one, + ;; and the user might enter a single token. + (replace-match-string-symbols to) + (list from (car to) current-prefix-arg + (if (and transient-mark-mode mark-active) + (region-beginning)) + (if (and transient-mark-mode mark-active) + (region-end)))))) (perform-replace regexp (cons 'replace-eval-replacement to-expr) t 'literal delimited nil nil start end)) -(make-obsolete 'query-replace-regexp-eval - "for interactive use, use the special `\\,' feature of -`query-replace-regexp' instead. Non-interactively, a loop -using `search-forward-regexp' and `replace-match' is preferred." "22.1") - (defun map-query-replace-regexp (regexp to-strings &optional n start end) "Replace some matches for REGEXP with various strings, in rotation. The second argument TO-STRINGS contains the replacement strings, separated diff --git a/lisp/savehist.el b/lisp/savehist.el index 215314d7053..cca958ff0a1 100644 --- a/lisp/savehist.el +++ b/lisp/savehist.el @@ -209,6 +209,7 @@ histories, which is probably undesirable." If `savehist-file' is in the old format that doesn't record the value of `savehist-minibuffer-history-variables', that value is deducted from the contents of the file." + (declare (obsolete savehist-mode "22.1")) (savehist-mode 1) ;; Old versions of savehist distributed with XEmacs didn't save ;; savehist-minibuffer-history-variables. If that variable is nil @@ -225,7 +226,6 @@ value is deducted from the contents of the file." ;; Collect VAR, i.e. (nth form 1). (push (nth 1 form) vars)) vars))))) -(make-obsolete 'savehist-load 'savehist-mode "22.1") (defun savehist-install () "Hook savehist into Emacs. diff --git a/lisp/simple.el b/lisp/simple.el index e1b8f37e46c..417dedb43db 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -6380,9 +6380,8 @@ With prefix argument N, move N items (negative N means move backward)." (point)))) (defun choose-completion-delete-max-match (string) + (declare (obsolete choose-completion-guess-base-position "23.2")) (delete-region (choose-completion-guess-base-position string) (point))) -(make-obsolete 'choose-completion-delete-max-match - 'choose-completion-guess-base-position "23.2") (defvar choose-completion-string-functions nil "Functions that may override the normal insertion of a completion choice. diff --git a/lisp/subr.el b/lisp/subr.el index b9b8e627672..e5725b3b3fa 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -461,18 +461,18 @@ If TEST is omitted or nil, `equal' is used." (setq tail (cdr tail))) value)) -(make-obsolete 'assoc-ignore-case 'assoc-string "22.1") (defun assoc-ignore-case (key alist) "Like `assoc', but ignores differences in case and text representation. KEY must be a string. Upper-case and lower-case letters are treated as equal. Unibyte strings are converted to multibyte for comparison." + (declare (obsolete assoc-string "22.1")) (assoc-string key alist t)) -(make-obsolete 'assoc-ignore-representation 'assoc-string "22.1") (defun assoc-ignore-representation (key alist) "Like `assoc', but ignores differences in text representation. KEY must be a string. Unibyte strings are converted to multibyte for comparison." + (declare (obsolete assoc-string "22.1")) (assoc-string key alist nil)) (defun member-ignore-case (elt list) @@ -1179,12 +1179,13 @@ be a list of the form returned by `event-start' and `event-end'." "Mocklisp-compatibility insert function. Like the function `insert' except that any argument that is a number is converted into a string by expressing it in decimal." + (declare (obsolete insert "22.1")) (dolist (el args) (insert (if (integerp el) (number-to-string el) el)))) -(make-obsolete 'insert-string 'insert "22.1") -(defun makehash (&optional test) (make-hash-table :test (or test 'eql))) -(make-obsolete 'makehash 'make-hash-table "22.1") +(defun makehash (&optional test) + (declare (obsolete make-hash-table "22.1")) + (make-hash-table :test (or test 'eql))) ;; These are used by VM and some old programs (defalias 'focus-frame 'ignore "") @@ -1250,11 +1251,6 @@ is converted into a string by expressing it in decimal." (make-obsolete 'process-filter-multibyte-p nil "23.1") (make-obsolete 'set-process-filter-multibyte nil "23.1") -(make-obsolete-variable - 'mode-line-inverse-video - "use the appropriate faces instead." - "21.1") - ;; Lisp manual only updated in 22.1. (define-obsolete-variable-alias 'executing-macro 'executing-kbd-macro "before 19.34") @@ -1911,8 +1907,8 @@ This function is called directly from the C code." "Read the following input sexp, and run it whenever FILE is loaded. This makes or adds to an entry on `after-load-alist'. FILE should be the name of a library, with no directory name." + (declare (obsolete eval-after-load "23.2")) (eval-after-load file (read))) -(make-obsolete 'eval-next-after-load `eval-after-load "23.2") (defun display-delayed-warnings () "Display delayed warnings from `delayed-warnings-list'. diff --git a/lisp/term.el b/lisp/term.el index d5f35006357..60e59768786 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -4048,6 +4048,7 @@ Returns `partial' if completed as far as possible with the completion matches. Returns `listed' if a completion listing was shown. See also `term-dynamic-complete-filename'." + (declare (obsolete completion-in-region "23.2")) (let* ((completion-ignore-case nil) (candidates (mapcar (function (lambda (x) (list x))) candidates)) (completions (all-completions stub candidates))) @@ -4081,8 +4082,6 @@ See also `term-dynamic-complete-filename'." (t (message "Partially completed") 'partial))))))) -(make-obsolete 'term-dynamic-simple-complete 'completion-in-region "23.2") - (defun term-dynamic-list-filename-completions () "List in help buffer possible completions of the filename at point." diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index a72f12ccb9b..62665654654 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,9 @@ +2012-09-25 Chong Yidong + + * url-parse.el (url-recreate-url-attributes): + * url-util.el (url-generate-unique-filename): Use declare to mark + obsolete. + 2012-08-14 Stefan Monnier * url-http.el (url-http-parse-headers): Re-enable file-name-handlers diff --git a/lisp/url/url-parse.el b/lisp/url/url-parse.el index 4007d1f35b3..cb61a021251 100644 --- a/lisp/url/url-parse.el +++ b/lisp/url/url-parse.el @@ -98,6 +98,7 @@ If the specified port number is the default, return nil." (defun url-recreate-url-attributes (urlobj) "Recreate the attributes of an URL string from the parsed URLOBJ." + (declare (obsolete nil "24.3")) (when (url-attributes urlobj) (concat ";" (mapconcat (lambda (x) @@ -105,7 +106,6 @@ If the specified port number is the default, return nil." (concat (car x) "=" (cdr x)) (car x))) (url-attributes urlobj) ";")))) -(make-obsolete 'url-recreate-url-attributes nil "24.3") ;;;###autoload (defun url-generic-parse-url (url) diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el index f654830e387..4761f71ad8f 100644 --- a/lisp/url/url-util.el +++ b/lisp/url/url-util.el @@ -593,6 +593,7 @@ Has a preference for looking backward when not directly on a symbol." (defun url-generate-unique-filename (&optional fmt) "Generate a unique filename in `url-temporary-directory'." + (declare (obsolete make-temp-file "23.1")) ;; This variable is obsolete, but so is this function. (let ((tempdir (with-no-warnings url-temporary-directory))) (if (not fmt) @@ -614,7 +615,6 @@ Has a preference for looking backward when not directly on a symbol." (setq x (1+ x) fname (format fmt (concat base (int-to-string x))))) (expand-file-name fname tempdir))))) -(make-obsolete 'url-generate-unique-filename 'make-temp-file "23.1") (defun url-extract-mime-headers () "Set `url-current-mime-headers' in current buffer." diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index 674688df1c2..2c41ce8c457 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -753,6 +753,7 @@ to temp files in buffer jobs and when Ediff needs to find fine differences." "Check the current version against MAJOR and MINOR version numbers. The comparison uses operator OP, which may be any of: =, >, >=, <, <=. TYPE-OF-EMACS is either 'xemacs or 'emacs." + (declare (obsolete version< "23.1")) (and (cond ((eq type-of-emacs 'xemacs) (featurep 'xemacs)) ((eq type-of-emacs 'emacs) (featurep 'emacs)) (t)) @@ -767,9 +768,6 @@ TYPE-OF-EMACS is either 'xemacs or 'emacs." (t (error "%S: Invalid op in ediff-check-version" op))))) -;; ediff-check-version seems to be totally unused anyway. -(make-obsolete 'ediff-check-version 'version< "23.1") - (defun ediff-color-display-p () (condition-case nil (if (featurep 'xemacs) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index eee3f40fd96..d7118ad7970 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -63,13 +63,11 @@ ;; Determine which window setup function to use based on current window system. (defun ediff-choose-window-setup-function-automatically () + (declare (obsolete ediff-setup-windows-default "24.3")) (if (ediff-window-display-p) 'ediff-setup-windows-multiframe 'ediff-setup-windows-plain)) -(make-obsolete 'ediff-choose-window-setup-function-automatically - 'ediff-setup-windows-default "24.3") - (defcustom ediff-window-setup-function 'ediff-setup-windows-default "Function called to set up windows. Ediff provides a choice of three functions: diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 3657e221e6a..89e0d0c3ecd 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1506,8 +1506,9 @@ to override the value of `vc-diff-switches' and `diff-switches'." (when (listp switches) switches)))) ;; Old def for compatibility with Emacs-21.[123]. -(defmacro vc-diff-switches-list (backend) `(vc-switches ',backend 'diff)) -(make-obsolete 'vc-diff-switches-list 'vc-switches "22.1") +(defmacro vc-diff-switches-list (backend) + (declare (obsolete vc-switches "22.1")) + `(vc-switches ',backend 'diff)) (defun vc-diff-finish (buffer messages) ;; The empty sync output case has already been handled, so the only diff --git a/lisp/view.el b/lisp/view.el index 41cb9752288..7ed42bf7ddc 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -513,6 +513,7 @@ that can be added see the RETURN-TO-ALIST argument of the function `view-mode-exit'. If `view-return-to-alist' contains an entry for the selected window, purge that entry from `view-return-to-alist' before adding ITEM." + (declare (obsolete "this function has no effect." "24.1")) (with-current-buffer buffer (when view-return-to-alist (let* ((list view-return-to-alist) @@ -535,7 +536,6 @@ entry for the selected window, purge that entry from (when item (setq view-return-to-alist (cons item view-return-to-alist))))) -(make-obsolete 'view-return-to-alist-update "this function has no effect." "24.1") ;;;###autoload (defun view-mode-enter (&optional quit-restore exit-action) diff --git a/src/ChangeLog b/src/ChangeLog index f90445045ae..0f59d6088a5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-25 Chong Yidong + + * xdisp.c (mode_line_inverse_video): Delete obsolete variable. + 2012-09-24 Stefan Monnier * bytecode.c (exec_byte_code): Signal an error instead of aborting, diff --git a/src/xdisp.c b/src/xdisp.c index 423ecab8dc7..0f02997be22 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -20162,10 +20162,6 @@ display_menu_bar (struct window *w) this. */ it.paragraph_embedding = L2R; - if (! mode_line_inverse_video) - /* Force the menu-bar to be displayed in the default face. */ - it.base_face_id = it.face_id = DEFAULT_FACE_ID; - /* Clear all rows of the menu bar. */ for (i = 0; i < FRAME_MENU_BAR_LINES (f); ++i) { @@ -20335,10 +20331,6 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format) it.glyph_row->mode_line_p = 1; - if (! mode_line_inverse_video) - /* Force the mode-line to be displayed in the default face. */ - it.base_face_id = it.face_id = DEFAULT_FACE_ID; - /* FIXME: This should be controlled by a user option. But supporting such an option is not trivial, since the mode line is made up of many separate strings. */ @@ -28930,12 +28922,6 @@ A value of nil means to respect the value of `truncate-lines'. If `word-wrap' is enabled, you might want to reduce this. */); Vtruncate_partial_width_windows = make_number (50); - DEFVAR_BOOL ("mode-line-inverse-video", mode_line_inverse_video, - doc: /* When nil, display the mode-line/header-line/menu-bar in the default face. -Any other value means to use the appropriate face, `mode-line', -`header-line', or `menu' respectively. */); - mode_line_inverse_video = 1; - DEFVAR_LISP ("line-number-display-limit", Vline_number_display_limit, doc: /* Maximum buffer size for which line number should be displayed. If the buffer is bigger than this, the line number does not appear -- cgit v1.2.3 From 07b1a5fbc37e91003f3c76886b9e0be78b7dbc6d Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 26 Sep 2012 10:41:05 -0400 Subject: * lisp/emacs-lisp/testcover.el (testcover-after): Add gv-expander. (testcover-reinstrument): Simplify with CSE. --- lisp/ChangeLog | 35 ++++++++++++++++++++--------------- lisp/emacs-lisp/gv.el | 2 +- lisp/emacs-lisp/testcover.el | 24 +++++++++++++++--------- 3 files changed, 36 insertions(+), 25 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c69f8bc870b..4599855e28d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-26 Stefan Monnier + + * emacs-lisp/testcover.el (testcover-after): Add gv-expander. + (testcover-reinstrument): Simplify with CSE. + 2012-09-26 Juanma Barranquero * window.el (temp-buffer-window-setup): Fix typo in docstring. @@ -13,9 +18,9 @@ newline. Reported by Andrew Jones. (verilog-auto-inst) Support expanding $clog2 in AUTOINST. Reported by Brad Dobbie. - (verilog-batch-delete-trailing-whitespace): Create - verilog-batch-delete-trailing-whitespace. Reported by Brad - Dobbie. + (verilog-batch-delete-trailing-whitespace): + Create verilog-batch-delete-trailing-whitespace. + Reported by Brad Dobbie. (verilog-auto-inout-param): Support AUTOINOUTPARAM for copying parameters from another module. Reported by Dan Katz. (verilog-auto, verilog-auto-assign-modport) @@ -105,12 +110,12 @@ * ansi-color.el (ansi-color-unfontify-region): * international/latin1-disp.el (latin1-char-displayable-p): * progmodes/cwarn.el (turn-on-cwarn-mode): - * progmodes/which-func.el (which-func-update-1): Use - define-obsolete-function-alias. + * progmodes/which-func.el (which-func-update-1): + Use define-obsolete-function-alias. * net/newst-backend.el (newsticker-cache-filename): - * net/newst-treeview.el (newsticker-groups-filename): Fix - incorrect obsolescence declaration. + * net/newst-treeview.el (newsticker-groups-filename): + Fix incorrect obsolescence declaration. * allout.el (allout-passphrase-hint-string): Likewise. (allout-init): Use a declare form to mark obsolete. @@ -147,8 +152,8 @@ Enhancements for triple-quote string syntax. * progmodes/python.el (python-quote-syntax): Remove. (python-syntax-propertize-function): New value. - (python-syntax-count-quotes, python-syntax-stringify): New - functions. + (python-syntax-count-quotes, python-syntax-stringify): + New functions. 2012-09-24 Chong Yidong @@ -181,8 +186,8 @@ * vc/vc-hooks.el (vc-default-registered): Don't use vc-master-templates. - * font-lock.el (font-lock-reference-face): Use - define-obsolete-variable-alias. + * font-lock.el (font-lock-reference-face): + Use define-obsolete-variable-alias. * generic-x.el (rul-generic-mode): Use font-lock-constant-face. * calendar/calendar.el (calendar-font-lock-keywords): @@ -213,8 +218,8 @@ 2012-09-23 Roland Winkler - * textmodes/bibtex.el (bibtex-autokey-transcriptions): Transcribe - also LaTeX hyphenation. + * textmodes/bibtex.el (bibtex-autokey-transcriptions): + Transcribe also LaTeX hyphenation. (bibtex-reformat): Bug fix. Do not quote twice the elements of bibtex-reformat-previous-options. @@ -374,8 +379,8 @@ (rst-section-tree, rst-section-tree-rec) (rst-section-tree-point): Refactor and document properly. (rst-imenu-find-adornments-for-position) - (rst-imenu-convert-cell, rst-imenu-create-index): New - function. + (rst-imenu-convert-cell, rst-imenu-create-index): + New function. 2012-09-20 Stefan Monnier diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 3541c99f5fe..7858c183e4b 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -269,7 +269,7 @@ The return value is the last VAL in the list. ;;;###autoload (put 'gv-place 'edebug-form-spec 'edebug-match-form) ;; CL did the equivalent of: -;;(gv-define-expand edebug-after (lambda (before index place) place)) +;;(gv-define-macroexpand edebug-after (lambda (before index place) place)) (put 'edebug-after 'gv-expander (lambda (do before index place) diff --git a/lisp/emacs-lisp/testcover.el b/lisp/emacs-lisp/testcover.el index 3999529f7ac..5fdc8c55a85 100644 --- a/lisp/emacs-lisp/testcover.el +++ b/lisp/emacs-lisp/testcover.el @@ -270,9 +270,9 @@ value, 'maybe if either is acceptable." (setq id (nth 2 form)) (setcdr form (nthcdr 2 form)) (setq val (testcover-reinstrument (nth 2 form))) - (if (eq val t) - (setcar form 'testcover-1value) - (setcar form 'testcover-after)) + (setcar form (if (eq val t) + 'testcover-1value + 'testcover-after)) (when val ;;1-valued or potentially 1-valued (aset testcover-vector id '1value)) @@ -359,9 +359,9 @@ value, 'maybe if either is acceptable." ,(nth 3 (cadr form)))) t) (t - (if (eq (car (cadr form)) 'edebug-after) - (setq id (car (nth 3 (cadr form)))) - (setq id (car (cadr form)))) + (setq id (car (if (eq (car (cadr form)) 'edebug-after) + (nth 3 (cadr form)) + (cadr form)))) (let ((testcover-1value-functions (cons id testcover-1value-functions))) (testcover-reinstrument (cadr form)))))) @@ -379,9 +379,9 @@ value, 'maybe if either is acceptable." ,(nth 3 (cadr form)))) 'maybe) (t - (if (eq (car (cadr form)) 'edebug-after) - (setq id (car (nth 3 (cadr form)))) - (setq id (car (cadr form)))) + (setq id (car (if (eq (car (cadr form)) 'edebug-after) + (nth 3 (cadr form)) + (cadr form)))) (let ((testcover-noreturn-functions (cons id testcover-noreturn-functions))) (testcover-reinstrument (cadr form)))))) @@ -447,6 +447,12 @@ binding `testcover-vector' to the code-coverage vector for TESTCOVER-SYM (defun testcover-after (idx val) "Internal function for coverage testing. Returns VAL after installing it in `testcover-vector' at offset IDX." + (declare (gv-expander (lambda (do) + (gv-letplace (getter setter) val + (funcall do getter + (lambda (store) + `(progn (testcover-after ,idx ,getter) + ,(funcall setter store)))))))) (cond ((eq (aref testcover-vector idx) 'unknown) (aset testcover-vector idx val)) -- cgit v1.2.3 From 7f457c067de84a0973883ef7889e648fbb17b055 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 28 Sep 2012 08:18:38 -0400 Subject: * lisp/emacs-lisp/pcase.el (pcase--mark-used): New. (pcase--u1): Use it. * lisp/custom.el (load-theme): Set buffer-file-name so the load is recorded in load-history with the right file name. Fixes: debbugs:12512 --- lisp/ChangeLog | 8 ++++++++ lisp/custom.el | 3 ++- lisp/emacs-lisp/pcase.el | 14 +++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cc884e9b1b5..21a412f7424 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-09-28 Stefan Monnier + + * emacs-lisp/pcase.el (pcase--mark-used): New. + (pcase--u1): Use it (bug#12512). + + * custom.el (load-theme): Set buffer-file-name so the load is recorded + in load-history with the right file name. + 2012-09-28 Tassilo Horn * doc-view.el (doc-view-current-cache-doc-pdf): New function. diff --git a/lisp/custom.el b/lisp/custom.el index dfc8e631152..dc810e3c97d 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -1193,7 +1193,8 @@ Return t if THEME was successfully loaded, nil otherwise." (expand-file-name "themes/" data-directory))) (member hash custom-safe-themes) (custom-theme-load-confirm hash)) - (let ((custom--inhibit-theme-enable t)) + (let ((custom--inhibit-theme-enable t) + (buffer-file-name fn)) ;For load-history. (eval-buffer)) ;; Optimization: if the theme changes the `default' face, put that ;; entry first. This avoids some `frame-set-background-mode' rigmarole diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 09e47b69b91..1312fc3731d 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -517,6 +517,10 @@ MATCH is the pattern that needs to be matched, of the form: (defun pcase--self-quoting-p (upat) (or (keywordp upat) (numberp upat) (stringp upat))) +(defsubst pcase--mark-used (sym) + ;; Exceptionally, `sym' may be a constant expression rather than a symbol. + (if (symbolp sym) (put sym 'pcase-used t))) + ;; It's very tempting to use `pcase' below, tho obviously, it'd create ;; bootstrapping problems. (defun pcase--u1 (matches code vars rest) @@ -581,7 +585,7 @@ Otherwise, it defers to REST which is a list of branches of the form ((memq upat '(t _)) (pcase--u1 matches code vars rest)) ((eq upat 'pcase--dontcare) :pcase--dontcare) ((memq (car-safe upat) '(guard pred)) - (if (eq (car upat) 'pred) (put sym 'pcase-used t)) + (if (eq (car upat) 'pred) (pcase--mark-used sym)) (let* ((splitrest (pcase--split-rest sym (lambda (pat) (pcase--split-pred upat pat)) rest)) @@ -614,10 +618,10 @@ Otherwise, it defers to REST which is a list of branches of the form (pcase--u1 matches code vars then-rest) (pcase--u else-rest)))) ((pcase--self-quoting-p upat) - (put sym 'pcase-used t) + (pcase--mark-used sym) (pcase--q1 sym upat matches code vars rest)) ((symbolp upat) - (put sym 'pcase-used t) + (pcase--mark-used sym) (if (not (assq upat vars)) (pcase--u1 matches code (cons (cons upat sym) vars) rest) ;; Non-linear pattern. Turn it into an `eq' test. @@ -640,7 +644,7 @@ Otherwise, it defers to REST which is a list of branches of the form (pcase--u1 (cons `(match ,sym . ,(nth 1 upat)) matches) code vars rest))) ((eq (car-safe upat) '\`) - (put sym 'pcase-used t) + (pcase--mark-used sym) (pcase--q1 sym (cadr upat) matches code vars rest)) ((eq (car-safe upat) 'or) (let ((all (> (length (cdr upat)) 1)) @@ -662,7 +666,7 @@ Otherwise, it defers to REST which is a list of branches of the form sym (lambda (pat) (pcase--split-member elems pat)) rest)) (then-rest (car splitrest)) (else-rest (cdr splitrest))) - (put sym 'pcase-used t) + (pcase--mark-used sym) (pcase--if `(,(if memq-fine #'memq #'member) ,sym ',elems) (pcase--u1 matches code vars then-rest) (pcase--u else-rest))) -- cgit v1.2.3 From e60b51abaa74fa15cc97de18f90b1ee967ae62ab Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 28 Sep 2012 19:30:52 -0400 Subject: * bytecomp.el (byte-compile-cl-file-p): Only "cl.el" counts as cl these days. Remove no longer appropriate file-local suppression of CL warnings in lisp/emacs-lisp/cl-*.el files. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/bytecomp.el | 2 +- lisp/emacs-lisp/cl-extra.el | 1 - lisp/emacs-lisp/cl-lib.el | 1 - lisp/emacs-lisp/cl-macs.el | 1 - lisp/emacs-lisp/cl-seq.el | 1 - 6 files changed, 6 insertions(+), 5 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b923b6aac58..3ed9069acf2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-09-28 Glenn Morris + + * emacs-lisp/bytecomp.el (byte-compile-cl-file-p): + Only "cl.el" counts as cl these days. + 2012-09-28 Juri Linkov Display archive errors in the echo area instead of inserting diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 7a229750178..d49e56bd2ba 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -846,7 +846,7 @@ CONST2 may be evaluated multiple times." (defun byte-compile-cl-file-p (file) "Return non-nil if FILE is one of the CL files." (and (stringp file) - (string-match "^cl\\>" (file-name-nondirectory file)))) + (string-match "^cl\\.el" (file-name-nondirectory file)))) (defun byte-compile-eval (form) "Eval FORM and mark the functions defined therein. diff --git a/lisp/emacs-lisp/cl-extra.el b/lisp/emacs-lisp/cl-extra.el index ea5e1cf9beb..913ebf2015f 100644 --- a/lisp/emacs-lisp/cl-extra.el +++ b/lisp/emacs-lisp/cl-extra.el @@ -689,7 +689,6 @@ PROPLIST is a list of the sort returned by `symbol-plist'. ;; Local variables: ;; byte-compile-dynamic: t -;; byte-compile-warnings: (not cl-functions) ;; generated-autoload-file: "cl-loaddefs.el" ;; End: diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 5749ff91b40..2eda628e262 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -745,7 +745,6 @@ If ALIST is non-nil, the new pairs are prepended to it." ;; Local variables: ;; byte-compile-dynamic: t -;; byte-compile-warnings: (not cl-functions) ;; End: ;;; cl-lib.el ends here diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 16ac14f8fe9..56e698bec0a 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2686,7 +2686,6 @@ surrounded by (cl-block NAME ...). ;; Local variables: ;; byte-compile-dynamic: t -;; byte-compile-warnings: (not cl-functions) ;; generated-autoload-file: "cl-loaddefs.el" ;; End: diff --git a/lisp/emacs-lisp/cl-seq.el b/lisp/emacs-lisp/cl-seq.el index b55f1df5ba5..1fa562e328a 100644 --- a/lisp/emacs-lisp/cl-seq.el +++ b/lisp/emacs-lisp/cl-seq.el @@ -1010,7 +1010,6 @@ Atoms are compared by `eql'; cons cells are compared recursively. ;; Local variables: ;; byte-compile-dynamic: t -;; byte-compile-warnings: (not cl-functions) ;; generated-autoload-file: "cl-loaddefs.el" ;; End: -- cgit v1.2.3 From 277f0cfa8b7dde109913f52c40eb8447b71eaffc Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 28 Sep 2012 19:51:20 -0400 Subject: * lisp/emacs-lisp/cl.el (flet): Fix case of obsolescence message. --- lisp/ChangeLog | 2 ++ lisp/emacs-lisp/cl.el | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3ed9069acf2..455cf684757 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,7 @@ 2012-09-28 Glenn Morris + * emacs-lisp/cl.el (flet): Fix case of obsolescence message. + * emacs-lisp/bytecomp.el (byte-compile-cl-file-p): Only "cl.el" counts as cl these days. diff --git a/lisp/emacs-lisp/cl.el b/lisp/emacs-lisp/cl.el index ae0852d6c87..34beed0d9ef 100644 --- a/lisp/emacs-lisp/cl.el +++ b/lisp/emacs-lisp/cl.el @@ -452,7 +452,7 @@ definitions, or lack thereof). \(fn ((FUNC ARGLIST BODY...) ...) FORM...)" (declare (indent 1) (debug cl-flet) - (obsolete "Use either `cl-flet' or `cl-letf'." "24.3")) + (obsolete "use either `cl-flet' or `cl-letf'." "24.3")) `(letf ,(mapcar (lambda (x) (if (or (and (fboundp (car x)) -- cgit v1.2.3 From e7c1b6ef850e7b4d021fabf4a922010781ed05bd Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 28 Sep 2012 22:02:34 -0400 Subject: * src/lisp.h (struct backtrace): Remove indirection for `function' field. * src/xdisp.c (redisplay_internal): * src/profiler.c (record_backtrace, sigprof_handler_1): * src/alloc.c (Fgarbage_collect): * src/eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace) (Fbacktrace_frame): Adjust accordingly. --- lisp/emacs-lisp/cl-loaddefs.el | 6 +++--- src/ChangeLog | 9 +++++++++ src/alloc.c | 4 ++-- src/eval.c | 28 ++++++++++++++-------------- src/lisp.h | 2 +- src/profiler.c | 4 ++-- src/xdisp.c | 4 ++-- 7 files changed, 33 insertions(+), 24 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el index c12e8ccacb1..922c9856208 100644 --- a/lisp/emacs-lisp/cl-loaddefs.el +++ b/lisp/emacs-lisp/cl-loaddefs.el @@ -11,7 +11,7 @@ ;;;;;; cl--map-overlays cl--map-intervals cl--map-keymap-recursively ;;;;;; cl-notevery cl-notany cl-every cl-some cl-mapcon cl-mapcan ;;;;;; cl-mapl cl-maplist cl-map cl--mapcar-many cl-equalp cl-coerce) -;;;;;; "cl-extra" "cl-extra.el" "535a24c1cff55a16e3d51219498a7858") +;;;;;; "cl-extra" "cl-extra.el" "1572ae52fa4fbd9c4bf89b49a068a865") ;;; Generated autoloads from cl-extra.el (autoload 'cl-coerce "cl-extra" "\ @@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value. ;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when ;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp ;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) -;;;;;; "cl-macs" "cl-macs.el" "6d0676869af66e5b5a671f95ee069461") +;;;;;; "cl-macs" "cl-macs.el" "da92f58f688ff6fb4d0098eb0f3acf0b") ;;; Generated autoloads from cl-macs.el (autoload 'cl--compiler-macro-list* "cl-macs" "\ @@ -748,7 +748,7 @@ surrounded by (cl-block NAME ...). ;;;;;; cl-nsubstitute-if cl-nsubstitute cl-substitute-if-not cl-substitute-if ;;;;;; cl-substitute cl-delete-duplicates cl-remove-duplicates cl-delete-if-not ;;;;;; cl-delete-if cl-delete cl-remove-if-not cl-remove-if cl-remove -;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "b444601641dcbd14a23ca5182bc80ffa") +;;;;;; cl-replace cl-fill cl-reduce) "cl-seq" "cl-seq.el" "4c1e1191e82dc8d5449a5ec4d59efc10") ;;; Generated autoloads from cl-seq.el (autoload 'cl-reduce "cl-seq" "\ diff --git a/src/ChangeLog b/src/ChangeLog index c30c4ed955b..500522a2feb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2012-09-29 Stefan Monnier + + * lisp.h (struct backtrace): Remove indirection for `function' field. + * xdisp.c (redisplay_internal): + * profiler.c (record_backtrace, sigprof_handler_1): + * alloc.c (Fgarbage_collect): + * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace) + (Fbacktrace_frame): Adjust accordingly. + 2012-09-28 Glenn Morris * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success) diff --git a/src/alloc.c b/src/alloc.c index 46c9a10c725..df166b4924a 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5112,8 +5112,8 @@ See Info node `(elisp)Garbage Collection'. */) /* Record this function, so it appears on the profiler's backtraces. */ backtrace.next = backtrace_list; - backtrace.function = &Qautomatic_gc; - backtrace.args = &Qautomatic_gc; + backtrace.function = Qautomatic_gc; + backtrace.args = &Qnil; backtrace.nargs = 0; backtrace.debug_on_exit = 0; backtrace_list = &backtrace; diff --git a/src/eval.c b/src/eval.c index 851b2bb1129..561ba922482 100644 --- a/src/eval.c +++ b/src/eval.c @@ -552,7 +552,7 @@ interactive_p (void) /* If this isn't a byte-compiled function, there may be a frame at the top for Finteractive_p. If so, skip it. */ - fun = Findirect_function (*btp->function, Qnil); + fun = Findirect_function (btp->function, Qnil); if (SUBRP (fun) && (XSUBR (fun) == &Sinteractive_p || XSUBR (fun) == &Scalled_interactively_p)) btp = btp->next; @@ -565,7 +565,7 @@ interactive_p (void) If this isn't a byte-compiled function, then we may now be looking at several frames for special forms. Skip past them. */ while (btp - && (EQ (*btp->function, Qbytecode) + && (EQ (btp->function, Qbytecode) || btp->nargs == UNEVALLED)) btp = btp->next; @@ -573,13 +573,13 @@ interactive_p (void) a special form, ignoring frames for Finteractive_p and/or Fbytecode at the top. If this frame is for a built-in function (such as load or eval-region) return false. */ - fun = Findirect_function (*btp->function, Qnil); + fun = Findirect_function (btp->function, Qnil); if (SUBRP (fun)) return 0; /* `btp' points to the frame of a Lisp function that called interactive-p. Return t if that function was called interactively. */ - if (btp && btp->next && EQ (*btp->next->function, Qcall_interactively)) + if (btp && btp->next && EQ (btp->next->function, Qcall_interactively)) return 1; return 0; } @@ -1496,10 +1496,10 @@ See also the function `condition-case'. */) if (backtrace_list && !NILP (error_symbol)) { bp = backtrace_list->next; - if (bp && bp->function && EQ (*bp->function, Qerror)) + if (bp && EQ (bp->function, Qerror)) bp = bp->next; - if (bp && bp->function) - Vsignaling_function = *bp->function; + if (bp) + Vsignaling_function = bp->function; } for (h = handlerlist; h; h = h->next) @@ -1510,7 +1510,7 @@ See also the function `condition-case'. */) } if (/* Don't run the debugger for a memory-full error. - (There is no room in memory to do that!) */ + (There is no room in memory to do that!) */ !NILP (error_symbol) && (!NILP (Vdebug_on_signal) /* If no handler is present now, try to run the debugger. */ @@ -2045,7 +2045,7 @@ eval_sub (Lisp_Object form) original_args = XCDR (form); backtrace.next = backtrace_list; - backtrace.function = &original_fun; /* This also protects them from gc. */ + backtrace.function = original_fun; /* This also protects them from gc. */ backtrace.args = &original_args; backtrace.nargs = UNEVALLED; backtrace.debug_on_exit = 0; @@ -2713,7 +2713,7 @@ usage: (funcall FUNCTION &rest ARGUMENTS) */) } backtrace.next = backtrace_list; - backtrace.function = &args[0]; + backtrace.function = args[0]; backtrace.args = &args[1]; /* This also GCPROs them. */ backtrace.nargs = nargs - 1; backtrace.debug_on_exit = 0; @@ -3289,12 +3289,12 @@ Output stream used is value of `standard-output'. */) write_string (backlist->debug_on_exit ? "* " : " ", 2); if (backlist->nargs == UNEVALLED) { - Fprin1 (Fcons (*backlist->function, *backlist->args), Qnil); + Fprin1 (Fcons (backlist->function, *backlist->args), Qnil); write_string ("\n", -1); } else { - tem = *backlist->function; + tem = backlist->function; Fprin1 (tem, Qnil); /* This can QUIT. */ write_string ("(", -1); if (backlist->nargs == MANY) @@ -3352,7 +3352,7 @@ If NFRAMES is more than the number of frames, the value is nil. */) if (!backlist) return Qnil; if (backlist->nargs == UNEVALLED) - return Fcons (Qnil, Fcons (*backlist->function, *backlist->args)); + return Fcons (Qnil, Fcons (backlist->function, *backlist->args)); else { if (backlist->nargs == MANY) /* FIXME: Can this happen? */ @@ -3360,7 +3360,7 @@ If NFRAMES is more than the number of frames, the value is nil. */) else tem = Flist (backlist->nargs, backlist->args); - return Fcons (Qt, Fcons (*backlist->function, tem)); + return Fcons (Qt, Fcons (backlist->function, tem)); } } diff --git a/src/lisp.h b/src/lisp.h index 21ac55c1063..c3cabe0af29 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2034,7 +2034,7 @@ extern ptrdiff_t specpdl_size; struct backtrace { struct backtrace *next; - Lisp_Object *function; + Lisp_Object function; Lisp_Object *args; /* Points to vector of args. */ ptrdiff_t nargs; /* Length of vector. */ /* Nonzero means call value of debugger when done with this operation. */ diff --git a/src/profiler.c b/src/profiler.c index 4d748b547f5..44a12fc159c 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -149,7 +149,7 @@ record_backtrace (log_t *log, size_t count) /* Copy the backtrace contents into working memory. */ for (; i < asize && backlist; i++, backlist = backlist->next) /* FIXME: For closures we should ignore the environment. */ - ASET (backtrace, i, *backlist->function); + ASET (backtrace, i, backlist->function); /* Make sure that unused space of working memory is filled with nil. */ for (; i < asize; i++) @@ -218,7 +218,7 @@ static void sigprof_handler_1 (int signal) { eassert (HASH_TABLE_P (cpu_log)); - if (backtrace_list && EQ (*backtrace_list->function, Qautomatic_gc)) + if (backtrace_list && EQ (backtrace_list->function, Qautomatic_gc)) /* Special case the time-count inside GC because the hash-table code is not prepared to be used while the GC is running. More specifically it uses ASIZE at many places where it does diff --git a/src/xdisp.c b/src/xdisp.c index 701ae22cd06..b23a06ff3d1 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -12975,8 +12975,8 @@ redisplay_internal (void) /* Record this function, so it appears on the profiler's backtraces. */ backtrace.next = backtrace_list; - backtrace.function = &Qredisplay_internal; - backtrace.args = &Qredisplay_internal; + backtrace.function = Qredisplay_internal; + backtrace.args = &Qnil; backtrace.nargs = 0; backtrace.debug_on_exit = 0; backtrace_list = &backtrace; -- cgit v1.2.3 From 375e49d4d18ff9e5d6d523618aee043768c8ac90 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 1 Oct 2012 00:45:32 -0400 Subject: * lisp/emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. (byte-compile-warning-prefix, byte-compile-file): Use it. Fixes: debbugs:12508 --- lisp/ChangeLog | 81 ++++++++++++++++++++++++--------------------- lisp/emacs-lisp/bytecomp.el | 16 ++++++--- 2 files changed, 55 insertions(+), 42 deletions(-) (limited to 'lisp/emacs-lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0e515c2a7b4..b5ccfcfcc7c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-01 Stefan Monnier + + * emacs-lisp/bytecomp.el (byte-compiler-abbreviate-file): New function. + (byte-compile-warning-prefix, byte-compile-file): Use it (bug#12508). + 2012-10-01 Karl Fogel * bookmark.el (bookmark-version-control): Give tags in the @@ -19,8 +24,8 @@ Shell output catching a la gud-gdb. * progmodes/python.el (python-shell-fetch-lines-in-progress) - (python-shell-fetch-lines-string, python-shell-fetched-lines): New - Vars. + (python-shell-fetch-lines-string, python-shell-fetched-lines): + New Vars. (python-shell-fetch-lines-filter): New function. (python-shell-send-string-no-output): Use them. @@ -51,12 +56,12 @@ version of the original ChangeLog can be found in the commit log. * textmodes/reftex-auc.el: Move `provide' call to bottom of file. - (reftex-arg-cite): Use `reftex-cite-key-separator'. Correctly - handle new value type returned by `reftex-citation'. + (reftex-arg-cite): Use `reftex-cite-key-separator'. + Correctly handle new value type returned by `reftex-citation'. * textmodes/reftex-cite.el (reftex-create-bibtex-file): Make sure - that entries with whitespace at various places are found. Doc - fix. Include entries that are cross-referenced from cited entries. + that entries with whitespace at various places are found. + Doc fix. Include entries that are cross-referenced from cited entries. Include @String definitions in the resulting bib file. Add header and footer defined in `reftex-create-bibtex-header' and `reftex-create-bibtex-footer'. @@ -75,10 +80,10 @@ (reftex-extract-bib-entries-from-thebibliography): Match \bibitem entries with spaces or tabs in front of arguments. (reftex-pop-to-bibtex-entry, reftex-extract-bib-entries) - (reftex-parse-bibtex-entry, reftex-create-bibtex-file): Match - entries containing numbers and symbol constituents. - (reftex-do-citation, reftex-figure-out-cite-format): Use - `reftex-cite-key-separator'. + (reftex-parse-bibtex-entry, reftex-create-bibtex-file): + Match entries containing numbers and symbol constituents. + (reftex-do-citation, reftex-figure-out-cite-format): + Use `reftex-cite-key-separator'. * textmodes/reftex-dcr.el: Move provide statement to end of file. (reftex-mouse-view-crossref): Explain why point is set. @@ -98,21 +103,21 @@ prevents fontification of quoted content. (reftex-index-phrases-mode): Use it. - * textmodes/reftex-parse.el (reftex-parse-from-file): Move - backward one char if a `\' was matched after a section macro. + * textmodes/reftex-parse.el (reftex-parse-from-file): + Move backward one char if a `\' was matched after a section macro. (reftex-parse-from-file): Use beginning of match instead of end as bound. * textmodes/reftex-ref.el: Adapt creation of `reftex--' functions to new structure of `reftex-ref-style-alist'. - (reftex-reference): Use `reftex-ref-style-list' function. Adapt - to new structure of `reftex-ref-style-alist'. Prompt for a + (reftex-reference): Use `reftex-ref-style-list' function. + Adapt to new structure of `reftex-ref-style-alist'. Prompt for a reference macro if `reftex-ref-macro-prompt' is non-nil. (reftex-reference): Pass refstyle to `reftex-format-special'. Determine reference macro by looking at - `reftex-ref-style-default-list' and `reftex-ref-style-alist'. Use - only one special format function. + `reftex-ref-style-default-list' and `reftex-ref-style-alist'. + Use only one special format function. (reftex-varioref-vref, reftex-fancyref-fref) (reftex-fancyref-Fref): Remove definitions. The functions are now generated from `reftex-ref-style-alist'. @@ -132,8 +137,8 @@ through reference styles. Add `p' for switching between number and page reference types. - * textmodes/reftex-toc.el (reftex-re-enlarge): Call - `enlarge-window' only if there is something to do because in Emacs + * textmodes/reftex-toc.el (reftex-re-enlarge): + Call `enlarge-window' only if there is something to do because in Emacs the horizontal version throws an error even if the parameter is 0. * textmodes/reftex-vars.el (reftex-label-alist): Doc fix. @@ -142,21 +147,21 @@ string. Adapt to new name. (reftex-ref-style-alist): Change structure so that it is not possible to use multiple different package names within a style. - Remove the symbols for symbols for macro type distinction. Add - characters for macro selection. + Remove the symbols for symbols for macro type distinction. + Add characters for macro selection. (reftex-ref-macro-prompt, reftex-create-bibtex-header) (reftex-create-bibtex-footer): New variables. (reftex-format-ref-function): Mention third argument of special format function. - (reftex-ref-style-alist, reftex-ref-style-default-list): New - variables. + (reftex-ref-style-alist, reftex-ref-style-default-list): + New variables. (reftex-vref-is-default, reftex-fref-is-default): Adapt doc string to new implementation. Mark as obsolete. Add compatibility code for honoring the variable values in case they are set. - (reftex-cite-format-builtin, reftex-bibliography-commands): Add - support for ConTeXt. - (reftex-format-ref-function, reftex-format-cite-function): Fix - custom type. + (reftex-cite-format-builtin, reftex-bibliography-commands): + Add support for ConTeXt. + (reftex-format-ref-function, reftex-format-cite-function): + Fix custom type. (reftex-cite-key-separator): New variable. * textmodes/reftex.el (reftex-syntax-table-for-bib) @@ -166,8 +171,8 @@ work. (reftex-in-comment): Do not error out if `comment-start-skip' is not set. Deal correctly with escaped comment characters. - (reftex-tie-multifile-symbols): Add doc string. Initialize - `reftex-ref-style-list'. + (reftex-tie-multifile-symbols): Add doc string. + Initialize `reftex-ref-style-list'. (reftex-untie-multifile-symbols): Add doc string. (reftex-add-index-macros): Doc fix. (reftex-ref-style-activate, reftex-ref-style-toggle) @@ -188,8 +193,8 @@ 2012-09-30 Fabián Ezequiel Gallina Enhancements for triple-quote string syntax. - * progmodes/python.el (python-syntax-propertize-function): Match - both quote cases in one regexp. + * progmodes/python.el (python-syntax-propertize-function): + Match both quote cases in one regexp. (python-syntax-stringify): Handle matches properly. 2012-09-30 Juri Linkov @@ -223,10 +228,10 @@ In buffer display functions handle window-height/window-width alist entries. Suggested by Juri Linkov as fix for Bug#1806. - * window.el (window--display-buffer): New argument ALIST. Obey - window-height and window-width alist entries. - (window--try-to-split-window): New argument ALIST. Bind - window-combination-limit to t when the window's size shall be + * window.el (window--display-buffer): New argument ALIST. + Obey window-height and window-width alist entries. + (window--try-to-split-window): New argument ALIST. + Bind window-combination-limit to t when the window's size shall be changed and window-combination-limit equals `window-size'. (display-buffer-in-atom-window) (display-buffer-in-major-side-window) @@ -249,8 +254,8 @@ temp-buffer-resize-regexps. Use fit-frame-to-buffer instead of temp-buffer-resize-frames. - * dired.el (dired-mark-pop-up): Call - display-buffer-below-selected with a fit-window-to-buffer alist + * dired.el (dired-mark-pop-up): + Call display-buffer-below-selected with a fit-window-to-buffer alist entry. 2012-09-30 Chong Yidong @@ -348,8 +353,8 @@ 2012-09-28 Leo Liu - * pcomplete.el (pcomplete-show-completions): Use - minibuffer-message to make pcomplete usable in minibuffer. + * pcomplete.el (pcomplete-show-completions): + Use minibuffer-message to make pcomplete usable in minibuffer. * ido.el (ido-set-matches-1): Fix 2012-09-11 change. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index d49e56bd2ba..4dd44bb6f22 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1005,13 +1005,20 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (defvar byte-compile-root-dir nil "Directory relative to which file names in error messages are written.") +;; FIXME: We should maybe extend abbreviate-file-name with an optional DIR +;; argument to try and use a relative file-name. +(defun byte-compile-abbreviate-file (file &optional dir) + (let ((f1 (abbreviate-file-name file)) + (f2 (file-relative-name file dir))) + (if (< (length f2) (length f1)) f2 f1))) + ;; This is used as warning-prefix for the compiler. ;; It is always called with the warnings buffer current. (defun byte-compile-warning-prefix (level entry) (let* ((inhibit-read-only t) (dir (or byte-compile-root-dir default-directory)) (file (cond ((stringp byte-compile-current-file) - (format "%s:" (file-relative-name + (format "%s:" (byte-compile-abbreviate-file byte-compile-current-file dir))) ((bufferp byte-compile-current-file) (format "Buffer %s:" @@ -1019,7 +1026,8 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; We might be simply loading a file that ;; contains explicit calls to byte-compile functions. ((stringp load-file-name) - (format "%s:" (file-relative-name load-file-name dir))) + (format "%s:" (byte-compile-abbreviate-file + load-file-name dir))) (t ""))) (pos (if (and byte-compile-current-file (integerp byte-compile-read-position)) @@ -1746,11 +1754,11 @@ The value is non-nil if there were no errors, nil if errors." (if (with-current-buffer input-buffer no-byte-compile) (progn ;; (message "%s not compiled because of `no-byte-compile: %s'" - ;; (file-relative-name filename) + ;; (byte-compile-abbreviate-file filename) ;; (with-current-buffer input-buffer no-byte-compile)) (when (file-exists-p target-file) (message "%s deleted because of `no-byte-compile: %s'" - (file-relative-name target-file) + (byte-compile-abbreviate-file target-file) (buffer-local-value 'no-byte-compile input-buffer)) (condition-case nil (delete-file target-file) (error nil))) ;; We successfully didn't compile this file. -- cgit v1.2.3 From 62a81506f802e4824b718cc30321ee3a0057cdf7 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Tue, 2 Oct 2012 02:10:29 +0800 Subject: Update CEDET from upstream. --- admin/ChangeLog | 15 + admin/grammars/bovine-grammar.el | 36 +- admin/grammars/c.by | 15 +- admin/grammars/grammar.wy | 12 +- admin/grammars/java-tags.wy | 12 +- admin/grammars/js.wy | 1 + admin/grammars/make.by | 1 + admin/grammars/python.wy | 64 ++- admin/grammars/scheme.by | 1 + admin/grammars/srecode-template.wy | 67 ++- admin/grammars/wisent-grammar.el | 61 +-- doc/misc/ChangeLog | 12 + doc/misc/ede.texi | 845 +++++++++++++++++++++++++++---- doc/misc/eieio.texi | 139 +++-- etc/ChangeLog | 12 + etc/srecode/c.srt | 164 ++++++ etc/srecode/cpp.srt | 123 ----- etc/srecode/ede-autoconf.srt | 54 ++ etc/srecode/ede-make.srt | 32 ++ etc/srecode/el.srt | 2 +- lisp/ChangeLog | 42 ++ lisp/cedet/ChangeLog | 494 ++++++++++++++++++ lisp/cedet/cedet-cscope.el | 2 +- lisp/cedet/cedet-global.el | 2 +- lisp/cedet/cedet-idutils.el | 5 +- lisp/cedet/cedet.el | 21 +- lisp/cedet/data-debug.el | 53 +- lisp/cedet/ede.el | 210 +++++--- lisp/cedet/ede/auto.el | 198 +++++++- lisp/cedet/ede/autoconf-edit.el | 50 +- lisp/cedet/ede/base.el | 7 +- lisp/cedet/ede/cpp-root.el | 40 +- lisp/cedet/ede/dired.el | 2 +- lisp/cedet/ede/emacs.el | 52 +- lisp/cedet/ede/files.el | 26 +- lisp/cedet/ede/generic.el | 80 ++- lisp/cedet/ede/linux.el | 95 +++- lisp/cedet/ede/makefile-edit.el | 3 +- lisp/cedet/ede/pmake.el | 13 +- lisp/cedet/ede/proj-comp.el | 21 +- lisp/cedet/ede/proj-elisp.el | 92 +++- lisp/cedet/ede/proj.el | 87 ++-- lisp/cedet/ede/project-am.el | 2 +- lisp/cedet/ede/util.el | 2 +- lisp/cedet/inversion.el | 62 ++- lisp/cedet/semantic.el | 71 ++- lisp/cedet/semantic/analyze/debug.el | 2 +- lisp/cedet/semantic/analyze/fcn.el | 22 +- lisp/cedet/semantic/analyze/refs.el | 19 +- lisp/cedet/semantic/bovine/c-by.el | 31 +- lisp/cedet/semantic/bovine/c.el | 515 ++++++++++++++++--- lisp/cedet/semantic/bovine/el.el | 4 +- lisp/cedet/semantic/bovine/gcc.el | 52 +- lisp/cedet/semantic/bovine/make-by.el | 10 +- lisp/cedet/semantic/bovine/make.el | 1 + lisp/cedet/semantic/bovine/scm-by.el | 12 +- lisp/cedet/semantic/bovine/scm.el | 5 +- lisp/cedet/semantic/complete.el | 337 +++++++----- lisp/cedet/semantic/db-el.el | 55 +- lisp/cedet/semantic/db-file.el | 7 +- lisp/cedet/semantic/db-find.el | 15 +- lisp/cedet/semantic/db-global.el | 41 +- lisp/cedet/semantic/db-typecache.el | 11 +- lisp/cedet/semantic/db.el | 57 ++- lisp/cedet/semantic/debug.el | 4 +- lisp/cedet/semantic/decorate/include.el | 126 ++++- lisp/cedet/semantic/decorate/mode.el | 2 + lisp/cedet/semantic/doc.el | 5 +- lisp/cedet/semantic/ede-grammar.el | 115 +++-- lisp/cedet/semantic/find.el | 14 +- lisp/cedet/semantic/fw.el | 195 +++++-- lisp/cedet/semantic/grammar-wy.el | 66 ++- lisp/cedet/semantic/grammar.el | 53 +- lisp/cedet/semantic/ia.el | 44 +- lisp/cedet/semantic/idle.el | 78 +-- lisp/cedet/semantic/java.el | 26 +- lisp/cedet/semantic/lex-spp.el | 46 +- lisp/cedet/semantic/lex.el | 40 +- lisp/cedet/semantic/mru-bookmark.el | 1 + lisp/cedet/semantic/scope.el | 13 +- lisp/cedet/semantic/symref.el | 10 +- lisp/cedet/semantic/symref/filter.el | 21 + lisp/cedet/semantic/symref/list.el | 1 + lisp/cedet/semantic/tag-ls.el | 268 ++++++++-- lisp/cedet/semantic/tag-write.el | 6 +- lisp/cedet/semantic/tag.el | 110 ++-- lisp/cedet/semantic/texi.el | 6 + lisp/cedet/semantic/util.el | 1 + lisp/cedet/semantic/wisent/comp.el | 15 +- lisp/cedet/semantic/wisent/java-tags.el | 28 + lisp/cedet/semantic/wisent/javascript.el | 52 +- lisp/cedet/semantic/wisent/javat-wy.el | Bin 19144 -> 19301 bytes lisp/cedet/semantic/wisent/js-wy.el | 47 +- lisp/cedet/semantic/wisent/python-wy.el | 83 ++- lisp/cedet/semantic/wisent/python.el | 325 ++++++++++-- lisp/cedet/srecode.el | 1 - lisp/cedet/srecode/compile.el | 13 +- lisp/cedet/srecode/cpp.el | 55 +- lisp/cedet/srecode/dictionary.el | 43 +- lisp/cedet/srecode/find.el | 45 +- lisp/cedet/srecode/getset.el | 8 +- lisp/cedet/srecode/insert.el | 179 ++++--- lisp/cedet/srecode/java.el | 20 +- lisp/cedet/srecode/map.el | 2 +- lisp/cedet/srecode/mode.el | 20 +- lisp/cedet/srecode/semantic.el | 6 + lisp/cedet/srecode/srt-mode.el | 8 +- lisp/cedet/srecode/srt-wy.el | 64 ++- lisp/cedet/srecode/table.el | 59 ++- lisp/emacs-lisp/eieio-base.el | 177 ++++++- lisp/emacs-lisp/eieio-custom.el | 16 +- lisp/emacs-lisp/eieio-datadebug.el | 7 +- lisp/emacs-lisp/eieio-opt.el | 139 ++++- lisp/emacs-lisp/eieio-speedbar.el | 18 +- lisp/emacs-lisp/eieio.el | 75 ++- 115 files changed, 5698 insertions(+), 1654 deletions(-) create mode 100644 etc/srecode/c.srt create mode 100644 etc/srecode/ede-autoconf.srt (limited to 'lisp/emacs-lisp') diff --git a/admin/ChangeLog b/admin/ChangeLog index b5b1b75c55c..2da65523116 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,18 @@ +2012-10-01 David Engster + + * grammars/bovine-grammar.el (bovine--grammar-newstyle-unquote): + Remove. + (bovine-grammar-expand-form): Test for emacs-major-version. + + * grammars/c.by: Add EXPLICIT to keyword tokens. + + * grammars/f90.by: Add %provide token. + + * grammar/grammar.wy (semantic-grammar-lexer): Remove, since it + was copied to grammar.el. New %provide token to generate prefix + which conforms with Emacs conventions. Remove lexer definition, + which is now in grammar.el. + 2012-09-27 Glenn Morris * admin.el (set-version): Set msdos.c's Vwindow_system_version. diff --git a/admin/grammars/bovine-grammar.el b/admin/grammars/bovine-grammar.el index efe4db039c4..a7289f6bafe 100644 --- a/admin/grammars/bovine-grammar.el +++ b/admin/grammars/bovine-grammar.el @@ -109,14 +109,6 @@ NAME, ALIASCLASS, DEFINITION and ATTRIBUTES." ;; Cache of macro definitions currently in use. (defvar bovine--grammar-macros nil) -;; Detect if we have an Emacs with newstyle unquotes allowed outside -;; of backquote. -;; This should probably be changed to a test to (= emacs-major-version 24) -;; when it is released, but at the moment it might be possible that people -;; are using an older snapshot. -(defvar bovine--grammar-newstyle-unquote - (equal '(\, test) (read ",test"))) - (defun bovine-grammar-expand-form (form quotemode &optional inplace) "Expand FORM into a new one suitable to the bovine parser. FORM is a list in which we are substituting. @@ -152,7 +144,7 @@ expanded from elsewhere." form (cdr form)) ;; Hack for dealing with new reading of unquotes outside of ;; backquote (introduced in rev. 102591 in emacs-bzr). - (when (and bovine--grammar-newstyle-unquote + (when (and (>= emacs-major-version 24) (listp first) (or (equal (car first) '\,) (equal (car first) '\,@))) @@ -456,6 +448,7 @@ Menu items are appended to the common grammar menu.") (defun bovine-make-parsers () "Generate Emacs' built-in Bovine-based parser files." + (interactive) (semantic-mode 1) ;; Loop through each .by file in current directory, and run ;; `semantic-grammar-batch-build-one-package' to build the grammar. @@ -465,13 +458,14 @@ Menu items are appended to the common grammar menu.") (with-current-buffer (find-file-noselect f) (semantic-grammar-create-package)) (error (message "%s" (error-message-string err)) nil))) - lang) + lang filename) (when (and packagename - (string-match "^semantic-\\(.*\\)-by\\.el\\'" packagename)) + (string-match "^.*/\\(.*\\)-by\\.el\\'" packagename)) (setq lang (match-string 1 packagename)) + (setq filename (concat lang "-by.el")) (with-temp-buffer - (insert-file-contents packagename) - (setq buffer-file-name (expand-file-name packagename)) + (insert-file-contents filename) + (setq buffer-file-name (expand-file-name filename)) ;; Fix copyright header: (goto-char (point-min)) (re-search-forward "^;; Author:") @@ -500,20 +494,14 @@ Menu items are appended to the common grammar menu.") lang ".by. ;;; Code: - -\(require 'semantic/lex) -\(eval-when-compile (require 'semantic/bovine))\n") +") (goto-char (point-min)) (delete-region (point-min) (line-end-position)) - (insert ";;; semantic/bovine/" lang - "-by.el --- Generated parser support file") + (insert ";;; " packagename + " --- Generated parser support file") (delete-trailing-whitespace) - ;; Fix footer: - (goto-char (point-max)) - (re-search-backward ".\n;;; Analyzers") - (delete-region (point) (point-max)) - (insert "(provide 'semantic/bovine/" lang "-by)\n\n") - (insert ";;; semantic/bovine/" lang "-by.el ends here\n") + (re-search-forward ";;; \\(.*\\) ends here") + (replace-match packagename nil nil nil 1) (save-buffer)))))) ;;; bovine-grammar.el ends here diff --git a/admin/grammars/c.by b/admin/grammars/c.by index 1bdaf8f447b..dfced9813d1 100644 --- a/admin/grammars/c.by +++ b/admin/grammars/c.by @@ -1,5 +1,4 @@ ;;; c.by -- LL grammar for C/C++ language specification - ;; Copyright (C) 1999-2012 Free Software Foundation, Inc. ;; ;; Author: Eric M. Ludlam @@ -39,6 +38,13 @@ ;; > * Can't parse signature element: "RmcBucStatus* rftBucStatus" %package semantic-c-by +%provide semantic/bovine/c-by + +%{ +(declare-function semantic-c-reconstitute-token "semantic/bovine/c") +(declare-function semantic-c-reconstitute-template "semantic/bovine/c") +(declare-function semantic-expand-c-tag "semantic/bovine/c") +} %languagemode c-mode c++-mode %start declaration @@ -98,6 +104,8 @@ %put VIRTUAL summary "Method Modifier: virtual (...) ..." %token MUTABLE "mutable" %put MUTABLE summary "Member Declaration Modifier: mutable ..." +%token EXPLICIT "explicit" +%put EXPLICIT summary "Forbids implicit type conversion: explicit " %token STRUCT "struct" %put STRUCT summary "Structure Type Declaration: struct [name] { ... };" @@ -370,6 +378,9 @@ namespacesubparts ;; PUBLIC or PRIVATE bits. Ignore them for now. | template | using + ;; Includes inside namespaces + | spp-include + (TAG $1 'include :inside-ns t) | ;;EMPTY ; @@ -1098,6 +1109,8 @@ functionname function-pointer : LPAREN STAR symbol RPAREN ( (concat "*" $3) ) + | LPAREN symbol RPAREN + ( $2 ) ; fun-or-proto-end diff --git a/admin/grammars/grammar.wy b/admin/grammars/grammar.wy index 1189d6b0886..f89fe6220ff 100644 --- a/admin/grammars/grammar.wy +++ b/admin/grammars/grammar.wy @@ -23,6 +23,9 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . +%package semantic-grammar-wy +%provide semantic/grammar-wy + %{ (defvar semantic-grammar-lex-c-char-re) @@ -32,8 +35,6 @@ (defvar semantic-grammar-wy--rindx nil) } -%package semantic-grammar-wy - %languagemode wy-mode ;; Main @@ -52,6 +53,7 @@ %keyword LEFT "%left" %keyword NONASSOC "%nonassoc" %keyword PACKAGE "%package" +%keyword PROVIDE "%provide" %keyword PREC "%prec" %keyword PUT "%put" %keyword QUOTEMODE "%quotemode" @@ -134,6 +136,7 @@ decl: | no_default_prec_decl | languagemode_decl | package_decl + | provide_decl | precedence_decl | put_decl | quotemode_decl @@ -165,6 +168,11 @@ package_decl: `(PACKAGE-TAG ',$2 nil) ; +provide_decl: + PROVIDE SYMBOL + `(TAG ',$2 'provide) + ; + precedence_decl: associativity token_type_opt items `(TAG ',$1 'assoc :type ',$2 :value ',$3) diff --git a/admin/grammars/java-tags.wy b/admin/grammars/java-tags.wy index b58b96c6bfb..708715533ff 100644 --- a/admin/grammars/java-tags.wy +++ b/admin/grammars/java-tags.wy @@ -23,6 +23,7 @@ ;; along with GNU Emacs. If not, see . %package wisent-java-tags-wy +%provide semantic/wisent/javat-wy %languagemode java-mode @@ -444,7 +445,7 @@ class_member_declaration ;;; Type Declaration token ;; ("NAME" type "TYPE" ( PART-LIST ) ( PARENTS ) EXTRA-SPEC "DOCSTRING") interface_declaration - : modifiers_opt INTERFACE IDENTIFIER extends_interfaces_opt interface_body + : modifiers_opt INTERFACE qualified_name extends_interfaces_opt interface_body (TYPE-TAG $3 $2 $5 (if $4 (cons nil $4)) :typemodifiers $1) ; @@ -547,7 +548,7 @@ formal_parameters ;;; Variable token ;; ("NAME" variable "TYPE" DEFAULT-VALUE EXTRA-SPEC "DOCSTRING") formal_parameter - : formal_parameter_modifier_opt type variable_declarator_id + : formal_parameter_modifier_opt type opt_variable_declarator_id (VARIABLE-TAG $3 $2 nil :typemodifiers $1) ; @@ -582,6 +583,13 @@ variable_declarator (cons $1 $region) ; +opt_variable_declarator_id + : ;; EMPTY + (identity "") + | variable_declarator_id + (identity $1) + ; + variable_declarator_id : IDENTIFIER dims_opt (concat $1 $2) diff --git a/admin/grammars/js.wy b/admin/grammars/js.wy index c6b3a58aac3..7b55f5c3834 100644 --- a/admin/grammars/js.wy +++ b/admin/grammars/js.wy @@ -58,6 +58,7 @@ ;; DAMAGE. %package wisent-javascript-jv-wy +%provide semantic/wisent/js-wy ;; JAVE I prefere ecmascript-mode %languagemode ecmascript-mode javascript-mode diff --git a/admin/grammars/make.by b/admin/grammars/make.by index ee933805cf6..6cff4716f82 100644 --- a/admin/grammars/make.by +++ b/admin/grammars/make.by @@ -22,6 +22,7 @@ ;; along with GNU Emacs. If not, see . %package semantic-make-by +%provide semantic/bovine/make-by %languagemode makefile-mode %start Makefile diff --git a/admin/grammars/python.wy b/admin/grammars/python.wy index f7808fd20b8..f17f41c9b1b 100644 --- a/admin/grammars/python.wy +++ b/admin/grammars/python.wy @@ -88,6 +88,12 @@ ;; -------- %package wisent-python-wy +%provide semantic/wisent/python-wy + +%{ +(declare-function wisent-python-reconstitute-function-tag "semantic/wisent/python") +(declare-function wisent-python-reconstitute-class-tag "semantic/wisent/python") +} %languagemode python-mode @@ -173,6 +179,7 @@ %token COMMA "," %token ASSIGN "=" %token BACKQUOTE "`" +%token AT "@" ;; ----------------- @@ -307,6 +314,10 @@ %put WHILE summary "Start a 'while' loop" +%keyword WITH "with" +%put WITH summary +"Start statement with an associated context object" + %keyword YIELD "yield" %put YIELD summary "Create a generator function" @@ -545,8 +556,10 @@ import_stmt ;; dotted_as_name (',' dotted_as_name)* dotted_as_name_list - : dotted_as_name - | dotted_as_name_list COMMA dotted_as_name + : dotted_as_name_list COMMA dotted_as_name + (cons $3 $1) + | dotted_as_name + (list $1) ; ;; ('*' | import_as_name (',' import_as_name)*) @@ -649,6 +662,7 @@ compound_stmt | while_stmt | for_stmt | try_stmt + | with_stmt | funcdef | class_declaration ; @@ -755,14 +769,47 @@ zero_one_or_two_test () ; +;;;============================================================================ +;;@@ with_stmt +;;;============================================================================ + +;; with_stmt: 'with' test [ with_var ] ':' suite +with_stmt + : WITH test COLON suite + (CODE-TAG $1 nil) + | WITH test with_var COLON suite + (CODE-TAG $1 nil) ;; TODO capture variable + ; + +with_var + : AS expr + () ;; TODO capture + ; + ;;;============================================================================ ;;;@@ funcdef ;;;============================================================================ -;; funcdef: 'def' NAME parameters ':' suite +decorator + : AT dotted_name varargslist_opt NEWLINE + (FUNCTION-TAG $2 "decorator" $3) + ; + +decorators + : decorator + (list $1) + | decorator decorators + (cons $1 $2) + ; + +;; funcdef: [decorators] 'def' NAME parameters ':' suite funcdef : DEF NAME function_parameter_list COLON suite - (FUNCTION-TAG $2 nil $3) + (wisent-python-reconstitute-function-tag + (FUNCTION-TAG $2 nil $3) $5) + | decorators DEF NAME function_parameter_list COLON suite + (wisent-python-reconstitute-function-tag + (FUNCTION-TAG $3 nil $4 :decorators $1) $6) ; function_parameter_list @@ -798,10 +845,11 @@ function_parameter ;; classdef: 'class' NAME ['(' testlist ')'] ':' suite class_declaration : CLASS NAME paren_class_list_opt COLON suite - (TYPE-TAG $2 $1 ;; Name "class" - $5 ;; Members - (cons $3 nil) ;; (SUPERCLASSES . INTERFACES) - ) + (wisent-python-reconstitute-class-tag + (TYPE-TAG $2 $1 ;; Name "class" + $5 ;; Members + (cons $3 nil) ;; (SUPERCLASSES . INTERFACES) + )) ; ;; ['(' testlist ')'] diff --git a/admin/grammars/scheme.by b/admin/grammars/scheme.by index 3925f03c28b..98e75901a71 100644 --- a/admin/grammars/scheme.by +++ b/admin/grammars/scheme.by @@ -18,6 +18,7 @@ ;; along with GNU Emacs. If not, see . %package semantic-scm-by +%provide semantic/bovine/scm-by %languagemode scheme-mode %start scheme diff --git a/admin/grammars/srecode-template.wy b/admin/grammars/srecode-template.wy index f38d7eaa2a1..95ac8a07307 100644 --- a/admin/grammars/srecode-template.wy +++ b/admin/grammars/srecode-template.wy @@ -28,6 +28,9 @@ ;; Semantic Recoder templates are based on Google Templates ;; and are at the bottom of the Semantic Recoder API. +%package srecode-template-wy +%provide srecode/srt-wy + %languagemode srecode-mode %start template_file @@ -46,6 +49,15 @@ %put TEMPLATE summary "template \\n