commit 66cd9187e396abfa7220d6a8f8d1a7064ef20b1e (HEAD, refs/remotes/origin/master) Author: Paul Eggert Date: Fri May 27 18:16:24 2016 -0700 Don’t document declare-function internals Suggested by Stefan Monnier in: http://lists.gnu.org/archive/html/emacs-devel/2016-05/msg00618.html * doc/lispref/functions.texi (Declaring Functions): * lisp/subr.el (declare-function): * lisp/emacs-lisp/bytecomp.el: (byte-compile-macroexpand-declare-function): Document as (fn file &optional arglist fileonly) even though it is really (fn file &rest args). diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 7513adf..fff4ac0 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2204,17 +2204,16 @@ cases, this might be something like @code{(file &optional overwrite)}. You don't have to specify the argument list, but if you do the byte compiler can check that the calls match the declaration. -@defmac declare-function function file &rest args +@defmac declare-function function file &optional arglist fileonly Tell the byte compiler to assume that @var{function} is defined in the -file @var{file}. The trailing arguments @var{args} can contain one or -two optional arguments. The first optional argument @var{arglist} is -either @code{t}, meaning the argument list is unspecified, or a list -of formal parameters in the same style as @code{defun}.@footnote{An -omitted @var{arglist} defaults to @code{t}, not @code{nil}; this -atypical behavior is why @code{declare-function} is defined to have -the formal parameters @code{(function file &rest args)}, not -@code{(function file &optional arglist fileonly)}.} The second -optional argument @var{fileonly} non-@code{nil} means only check that +file @var{file}. The optional third argument @var{arglist} is either +@code{t}, meaning the argument list is unspecified, or a list of +formal parameters in the same style as @code{defun}. An omitted +@var{arglist} defaults to @code{t}, not @code{nil}; this is atypical +behavior for omitted arguments, and it means that to supply a fourth +but not third argument one must specify @code{t} for the third-argument +placeholder instead of the usual @code{nil}. The optional fourth +argument @var{fileonly} non-@code{nil} means check only that @var{file} exists, not that it actually defines @var{function}. @end defmac diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 11eb44c..dc7574e 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -2959,6 +2959,8 @@ for symbols generated by the byte compiler itself." ;; Special macro-expander used during byte-compilation. (defun byte-compile-macroexpand-declare-function (fn file &rest args) + (declare (advertised-calling-convention + (fn file &optional arglist fileonly) nil)) (let ((gotargs (and (consp args) (listp (car args)))) (unresolved (assq fn byte-compile-unresolved-functions))) (when unresolved ; function was called before declaration diff --git a/lisp/subr.el b/lisp/subr.el index 97cde68..6e679e7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -33,8 +33,7 @@ "Tell the byte-compiler that function FN is defined, in FILE. The FILE argument is not used by the byte-compiler, but by the `check-declare' package, which checks that FILE contains a -definition for FN. Remaining ARGS are used by both the -byte-compiler and `check-declare' to check for consistency. +definition for FN. FILE can be either a Lisp file (in which case the \".el\" extension is optional), or a C file. C files are expanded @@ -45,20 +44,22 @@ declaration. A FILE with an \"ext:\" prefix is an external file. `check-declare' will check such files if they are found, and skip them without error if they are not. -ARGS can contain one or two optional args. First optional arg -ARGLIST specifies FN's arguments, or is t to not specify FN's -arguments. An omitted ARGLIST defaults to t, not nil: a nil +Optional ARGLIST specifies FN's arguments, or is t to not specify +FN's arguments. An omitted ARGLIST defaults to t, not nil: a nil ARGLIST specifies an empty argument list, and an explicit t ARGLIST is a placeholder that allows supplying a later arg. -Second optional arg FILEONLY non-nil means that `check-declare' -will check only that FILE exists, not that it defines FN. This -is intended for function definitions that `check-declare' does -not recognize, e.g., `defstruct'. + +Optional FILEONLY non-nil means that `check-declare' will check +only that FILE exists, not that it defines FN. This is intended +for function definitions that `check-declare' does not recognize, +e.g., `defstruct'. Note that for the purposes of `check-declare', this statement must be the first non-whitespace on a line. For more information, see Info node `(elisp)Declaring Functions'." + (declare (advertised-calling-convention + (fn file &optional arglist fileonly) nil)) ;; Does nothing - byte-compile-declare-function does the work. nil) commit 4ce68f8f0f1dd1aa518e6e682b2c2cef1f49d953 Author: Paul Eggert Date: Fri May 27 18:11:44 2016 -0700 * src/puresize.h (BASE_PURESIZE): Increase it some more. diff --git a/src/puresize.h b/src/puresize.h index 5b884d3..da827ed 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -47,7 +47,7 @@ INLINE_HEADER_BEGIN #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (1801000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (1900000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ commit 5cdebe7d8b692113c3577a6ded81cb149fe6f042 Author: Glenn Morris Date: Fri May 27 19:41:07 2016 -0400 * src/puresize.h (BASE_PURESIZE): Increase it by a little bit. diff --git a/src/puresize.h b/src/puresize.h index fb9d934..5b884d3 100644 --- a/src/puresize.h +++ b/src/puresize.h @@ -47,7 +47,7 @@ INLINE_HEADER_BEGIN #endif #ifndef BASE_PURESIZE -#define BASE_PURESIZE (1800000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) +#define BASE_PURESIZE (1801000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) #endif /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ commit 1ca6dea08380a6daccc5b01b32fce714875d44f7 Author: Glenn Morris Date: Fri May 27 19:22:29 2016 -0400 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Tweak previous to avoid build failure. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 809e922..121738d 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2672,17 +2672,19 @@ non-nil value, that slot cannot be set via `setf'. (let ((accessor (intern (format "%s%s" conc-name slot)))) (push slot slots) (push (nth 1 desc) defaults) - (push `(cl-defsubst ,accessor (x) - ,(format "Access slot \"%s\" of `%s' struct X." + ;; The arg "cl-x" is referenced by name in eg pred-form + ;; and pred-check, so changing it is not straightforward. + (push `(cl-defsubst ,accessor (cl-x) + ,(format "Access slot \"%s\" of `%s' struct CL-X." slot struct) (declare (side-effect-free t)) ,@(and pred-check (list `(or ,pred-check (signal 'wrong-type-argument - (list ',name x))))) - ,(if (memq type '(nil vector)) `(aref x ,pos) - (if (= pos 0) '(car x) - `(nth ,pos x)))) + (list ',name cl-x))))) + ,(if (memq type '(nil vector)) `(aref cl-x ,pos) + (if (= pos 0) '(car cl-x) + `(nth ,pos cl-x)))) forms) (if (cadr (memq :read-only (cddr desc))) (push `(gv-define-expander ,accessor commit 4e182dce20bd09e38a69bdf637a3bf2a8bbfdc58 Author: Paul Eggert Date: Fri May 27 13:55:07 2016 -0700 Port to platforms where rlim_max < 0 * src/emacs.c (main): Do not treat a negative rlim_max as a limit; this can happen if a special value like RLIM_INFINITY is negative. diff --git a/src/emacs.c b/src/emacs.c index bdcebbe..b8ba86f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -851,11 +851,14 @@ main (int argc, char **argv) /* Round the new limit to a page boundary; this is needed for Darwin kernel 15.4.0 (see Bug#23622) and perhaps other systems. Do not shrink the stack and do not exceed - rlim_max. Don't worry about values like RLIM_INFINITY - since in practice they are so large that the code does - the right thing anyway. */ + rlim_max. Don't worry about exact values of + RLIM_INFINITY etc. since in practice when they are + nonnegative they are so large that the code does the + right thing anyway. */ long pagesize = getpagesize (); - newlim = min (newlim + pagesize - 1, rlim.rlim_max); + newlim += pagesize - 1; + if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) + newlim = rlim.rlim_max; newlim -= newlim % pagesize; if (pagesize <= newlim - lim) commit 9d356f62b3c24d9f2b2bc3831cf19e8351860a86 Author: Paul Eggert Date: Fri May 27 13:39:34 2016 -0700 Robustify stack-size calculation * src/emacs.c: Include getpagesize.h. (main): Check for integer overflow when computing stack size. Round new rlim_cur to pagesize boundary on all platforms, as this is easy and would have prevented Bug#23622. If setrlimit fails, use current limit to determine re_max_failures. diff --git a/src/emacs.c b/src/emacs.c index 3e0cf59..bdcebbe 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -91,6 +91,7 @@ along with GNU Emacs. If not, see . */ #include "systime.h" #include "puresize.h" +#include "getpagesize.h" #include "gnutls.h" #if (defined PROFILING \ @@ -672,9 +673,6 @@ main (int argc, char **argv) bool do_initial_setlocale; bool dumping; int skip_args = 0; -#ifdef HAVE_SETRLIMIT - struct rlimit rlim; -#endif bool no_loadup = 0; char *junk = 0; char *dname_arg = 0; @@ -825,38 +823,51 @@ main (int argc, char **argv) is built with an 8MB stack. Moreover, the setrlimit call can cause problems on Cygwin (https://www.cygwin.com/ml/cygwin/2015-07/msg00096.html). */ - if (1 -#ifndef CANNOT_DUMP - && (!noninteractive || initialized) -#endif - && !getrlimit (RLIMIT_STACK, &rlim)) + struct rlimit rlim; + if (getrlimit (RLIMIT_STACK, &rlim) == 0 + && 0 <= rlim.rlim_cur && rlim.rlim_cur <= LONG_MAX) { - long newlim; - /* Approximate the amount regex.c needs per unit of re_max_failures. */ + long lim = rlim.rlim_cur; + + /* Approximate the amount regex.c needs per unit of + re_max_failures, then add 33% to cover the size of the + smaller stacks that regex.c successively allocates and + discards on its way to the maximum. */ int ratio = 20 * sizeof (char *); - /* Then add 33% to cover the size of the smaller stacks that regex.c - successively allocates and discards, on its way to the maximum. */ ratio += ratio / 3; - /* Add in some extra to cover - what we're likely to use for other reasons. */ - newlim = re_max_failures * ratio + 200000; -#ifdef __NetBSD__ - /* NetBSD (at least NetBSD 1.2G and former) has a bug in its - stack allocation routine for new process that the allocation - fails if stack limit is not on page boundary. So, round up the - new limit to page boundary. */ - newlim = (newlim + getpagesize () - 1) / getpagesize () * getpagesize (); -#endif - if (newlim > rlim.rlim_max) + + /* Extra space to cover what we're likely to use for other reasons. */ + int extra = 200000; + + bool try_to_grow_stack = true; +#ifndef CANNOT_DUMP + try_to_grow_stack = !noninteractive || initialized; +#endif + + if (try_to_grow_stack) { - newlim = rlim.rlim_max; - /* Don't let regex.c overflow the stack we have. */ - re_max_failures = (newlim - 200000) / ratio; + long newlim = re_max_failures * ratio + extra; + + /* Round the new limit to a page boundary; this is needed + for Darwin kernel 15.4.0 (see Bug#23622) and perhaps + other systems. Do not shrink the stack and do not exceed + rlim_max. Don't worry about values like RLIM_INFINITY + since in practice they are so large that the code does + the right thing anyway. */ + long pagesize = getpagesize (); + newlim = min (newlim + pagesize - 1, rlim.rlim_max); + newlim -= newlim % pagesize; + + if (pagesize <= newlim - lim) + { + rlim.rlim_cur = newlim; + if (setrlimit (RLIMIT_STACK, &rlim) == 0) + lim = newlim; + } } - if (rlim.rlim_cur < newlim) - rlim.rlim_cur = newlim; - setrlimit (RLIMIT_STACK, &rlim); + /* Don't let regex.c overflow the stack. */ + re_max_failures = lim < extra ? 0 : min (lim - extra, SIZE_MAX) / ratio; } #endif /* HAVE_SETRLIMIT and RLIMIT_STACK and not CYGWIN */ commit 168163434678dcc030d1e2844765ddae7b555721 Author: Paul Eggert Date: Fri May 27 12:45:21 2016 -0700 ; Add comment for declare-function diff --git a/lisp/subr.el b/lisp/subr.el index 239bdc0..97cde68 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -22,13 +22,13 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs. If not, see . -;;; Commentary: - -;;; Code: - ;; Beware: while this file has tag `utf-8', before it's compiled, it gets ;; loaded as "raw-text", so non-ASCII chars won't work right during bootstrap. + +;; declare-function's args use &rest, not &optional, for compatibility +;; with byte-compile-macroexpand-declare-function. + (defmacro declare-function (_fn _file &rest _args) "Tell the byte-compiler that function FN is defined, in FILE. The FILE argument is not used by the byte-compiler, but by the commit 61926ccd673f5d1f9bd505f414d370357c686f4e Author: Ken Brown Date: Fri May 27 14:55:34 2016 -0400 Adjust filenotify-tests on Cygwin * test/lisp/filenotify-tests.el (file-notify--test-timeout): Remove special case for Cygwin. (file-notify-test07-backup): Update expected results on Cygwin. diff --git a/test/lisp/filenotify-tests.el b/test/lisp/filenotify-tests.el index 9c19e63..402b774 100644 --- a/test/lisp/filenotify-tests.el +++ b/test/lisp/filenotify-tests.el @@ -73,7 +73,6 @@ It is different for local and remote file notification libraries.") (cond ((file-remote-p temporary-file-directory) 6) ((string-equal (file-notify--test-library) "w32notify") 4) - ((eq system-type 'cygwin) 10) (t 3))) (defun file-notify--test-cleanup () @@ -861,6 +860,9 @@ longer than timeout seconds for the events to be delivered." (should (file-notify-valid-p file-notify--test-desc)) (file-notify--test-with-events (cond + ;; On Cygwin there is one `changed' event in both the + ;; local and remote cases. + ((eq system-type 'cygwin) '(changed)) ;; For w32notify and in the remote case, there are two ;; `changed' events. ((or (string-equal (file-notify--test-library) "w32notify") @@ -902,7 +904,11 @@ longer than timeout seconds for the events to be delivered." file-notify--test-tmpfile '(change) #'file-notify--test-event-handler))) (should (file-notify-valid-p file-notify--test-desc)) - (file-notify--test-with-events '(renamed created changed) + (file-notify--test-with-events + (cond + ;; On Cygwin we only get the `changed' event. + ((eq system-type 'cygwin) '(changed)) + (t '(renamed created changed))) ;; The file is renamed when creating a backup. It shall ;; still be watched. (with-temp-buffer commit b342815c0a9af8d94d4290d17882de73f6fd9373 Author: Paul Eggert Date: Fri May 27 09:46:44 2016 -0700 Improve define-function omitted-arg documentation * doc/lispref/functions.texi (Declaring Functions): * lisp/subr.el (declare-function): Be clearer when documenting omitted args for define-function. diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index ff21abb..7513adf 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -2172,44 +2172,49 @@ Byte-compiling a file often produces warnings about functions that the compiler doesn't know about (@pxref{Compiler Errors}). Sometimes this indicates a real problem, but usually the functions in question are defined in other files which would be loaded if that code is run. For -example, byte-compiling @file{fortran.el} used to warn: +example, byte-compiling @file{simple.el} used to warn: @example -In end of data: -fortran.el:2152:1:Warning: the function ‘gud-find-c-expr’ is not - known to be defined. +simple.el:8727:1:Warning: the function ‘shell-mode’ is not known to be + defined. @end example -In fact, @code{gud-find-c-expr} is only used in the function that -Fortran mode uses for the local value of -@code{gud-find-expr-function}, which is a callback from GUD; if it is -called, the GUD functions will be loaded. When you know that such a -warning does not indicate a real problem, it is good to suppress the -warning. That makes new warnings which might mean real problems more -visible. You do that with @code{declare-function}. +In fact, @code{shell-mode} is used only in a function that executes +@code{(require 'shell)} before calling @code{shell-mode}, so +@code{shell-mode} will be defined properly at run-time. When you know +that such a warning does not indicate a real problem, it is good to +suppress the warning. That makes new warnings which might mean real +problems more visible. You do that with @code{declare-function}. All you need to do is add a @code{declare-function} statement before the first use of the function in question: @example -(declare-function gud-find-c-expr "gud.el" nil) +(declare-function shell-mode "shell" ()) @end example -This says that @code{gud-find-c-expr} is defined in @file{gud.el} (the +This says that @code{shell-mode} is defined in @file{shell.el} (the @samp{.el} can be omitted). The compiler takes for granted that that file really defines the function, and does not check. The optional third argument specifies the argument list of -@code{gud-find-c-expr}. In this case, it takes no arguments +@code{shell-mode}. In this case, it takes no arguments (@code{nil} is different from not specifying a value). In other cases, this might be something like @code{(file &optional overwrite)}. You don't have to specify the argument list, but if you do the byte compiler can check that the calls match the declaration. -@defmac declare-function function file &optional arglist fileonly -Tell the byte compiler to assume that @var{function} is defined, with -arguments @var{arglist}, and that the definition should come from the -file @var{file}. @var{fileonly} non-@code{nil} means only check that +@defmac declare-function function file &rest args +Tell the byte compiler to assume that @var{function} is defined in the +file @var{file}. The trailing arguments @var{args} can contain one or +two optional arguments. The first optional argument @var{arglist} is +either @code{t}, meaning the argument list is unspecified, or a list +of formal parameters in the same style as @code{defun}.@footnote{An +omitted @var{arglist} defaults to @code{t}, not @code{nil}; this +atypical behavior is why @code{declare-function} is defined to have +the formal parameters @code{(function file &rest args)}, not +@code{(function file &optional arglist fileonly)}.} The second +optional argument @var{fileonly} non-@code{nil} means only check that @var{file} exists, not that it actually defines @var{function}. @end defmac diff --git a/lisp/subr.el b/lisp/subr.el index 44d7eac..239bdc0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -31,7 +31,6 @@ (defmacro declare-function (_fn _file &rest _args) "Tell the byte-compiler that function FN is defined, in FILE. -Optional ARGLIST is the argument list used by the function. The FILE argument is not used by the byte-compiler, but by the `check-declare' package, which checks that FILE contains a definition for FN. Remaining ARGS are used by both the @@ -47,15 +46,14 @@ declaration. A FILE with an \"ext:\" prefix is an external file. them without error if they are not. ARGS can contain one or two optional args. First optional arg -ARGLIST specifies the function arguments. Second optional arg -FILEONLY non-nil means that `check-declare' will only check that -FILE exists, not that it defines FN. This is intended for -function-definitions that `check-declare' does not recognize, e.g. -`defstruct'. - -To specify a value for FILEONLY without passing an argument list, -set ARGLIST to t. This is necessary because nil means an -empty argument list, rather than an unspecified one. +ARGLIST specifies FN's arguments, or is t to not specify FN's +arguments. An omitted ARGLIST defaults to t, not nil: a nil +ARGLIST specifies an empty argument list, and an explicit t +ARGLIST is a placeholder that allows supplying a later arg. +Second optional arg FILEONLY non-nil means that `check-declare' +will check only that FILE exists, not that it defines FN. This +is intended for function definitions that `check-declare' does +not recognize, e.g., `defstruct'. Note that for the purposes of `check-declare', this statement must be the first non-whitespace on a line. commit 09b72fc38aee1032b6d2c8476bcc22a2e7ec5642 Author: Stefan Monnier Date: Fri May 27 12:34:33 2016 -0400 * lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add docstring to accessors. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 68abe67..809e922 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2672,15 +2672,17 @@ non-nil value, that slot cannot be set via `setf'. (let ((accessor (intern (format "%s%s" conc-name slot)))) (push slot slots) (push (nth 1 desc) defaults) - (push `(cl-defsubst ,accessor (cl-x) + (push `(cl-defsubst ,accessor (x) + ,(format "Access slot \"%s\" of `%s' struct X." + slot struct) (declare (side-effect-free t)) ,@(and pred-check (list `(or ,pred-check (signal 'wrong-type-argument - (list ',name cl-x))))) - ,(if (memq type '(nil vector)) `(aref cl-x ,pos) - (if (= pos 0) '(car cl-x) - `(nth ,pos cl-x)))) + (list ',name x))))) + ,(if (memq type '(nil vector)) `(aref x ,pos) + (if (= pos 0) '(car x) + `(nth ,pos x)))) forms) (if (cadr (memq :read-only (cddr desc))) (push `(gv-define-expander ,accessor commit 84f431224cdc1ee65b4662f3eb55f4da46066e3e Author: Stefan Monnier Date: Fri May 27 12:33:57 2016 -0400 * lisp/subr.el (definition-prefixes): Expand docstring * lisp/emacs-lisp/autoload.el (autoload--split-prefixes): Remove unused function. diff --git a/etc/NEWS b/etc/NEWS index 56f0ef8..b2e42e3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -385,6 +385,10 @@ function 'check-declare-errmsg' has been removed. * Lisp Changes in Emacs 25.2 +** New var `definition-prefixes' is a hashtable mapping prefixes to the +files where corresponding definitions can be found. This can be used +to fetch definitions that are not yet loaded, for example for `C-h f'. + ** New var syntax-ppss-table to control the syntax-table used in syntax-ppss. +++ diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 80f5c28..11316f1 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -513,15 +513,6 @@ Return non-nil in the case where no autoloads were added at point." (t (setcdr cell (cons tail (cdr cell))))))) prefixes)) -(defun autoload--split-prefixes (prefixes) - (apply #'nconc - (mapcar (lambda (cell) - (let ((prefix (car cell))) - (mapcar (lambda (cell) - (cons (concat prefix (car cell)) (cdr cell))) - (autoload--split-prefixes-1 (cdr cell))))) - prefixes))) - (defvar autoload-compute-prefixes t "If non-nil, autoload will add code to register the prefixes used in a file. Standard prefixes won't be registered anyway. I.e. if a file \"foo.el\" defines @@ -538,6 +529,13 @@ cost more memory use).") (defvar autoload-popular-prefixes nil) (defun autoload--make-defs-autoload (defs file) + ;; FIXME: avoid redundant entries. E.g. opascal currently has + ;; "opascal-" "opascal--literal-start-re" "opascal--syntax-propertize" + ;; where only the first one should be kept. + ;; FIXME: Avoid keeping too-long-prefixes. E.g. ob-scheme currently has + ;; "org-babel-scheme-" "org-babel-default-header-args:scheme" + ;; "org-babel-expand-body:scheme" "org-babel-execute:scheme". + ;; Remove the defs that obey the rule that file foo.el (or ;; foo-mode.el) uses "foo-" as prefix. ;; FIXME: help--symbol-completion-table still doesn't know how to use diff --git a/lisp/subr.el b/lisp/subr.el index 7cbf006..44d7eac 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -5155,7 +5155,16 @@ as a list.") (defvar definition-prefixes (make-hash-table :test 'equal) "Hash table mapping prefixes to the files in which they're used. -This can be used to automatically fetch not-yet-loaded definitions.") +This can be used to automatically fetch not-yet-loaded definitions. +More specifically, if there is a value of the form (FILES...) for a string PREFIX +it means that the FILES define variables or functions with names that start +with PREFIX. + +Note that it does not imply that all definitions starting with PREFIX can +be found in those files. E.g. if prefix is \"gnus-article-\" there might +still be definitions of the form \"gnus-article-toto-titi\" in other files, which would +presumably appear in this table under another prefix such as \"gnus-\" +or \"gnus-article-toto-\".") (defun register-definition-prefixes (file prefixes) "Register that FILE uses PREFIXES." commit 01f375386d74af896d427e2c6899df20c78b3850 Author: Phillip Lord Date: Fri May 27 16:49:12 2016 +0100 Fix broken viper deactivation * lisp/emulation/viper.el (viper--deactivate-advice-list): Destructure args to advice-remove. (viper--advice-add): Use cons not list. Addresses bug#23625 diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index a0bba9a..1ee1464 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -647,10 +647,14 @@ This startup message appears whenever you load Viper, unless you type `y' now." (defun viper--advice-add (function where advice) (advice-add function where advice) - (push (list function advice) viper--advice-list)) + (push (cons function advice) viper--advice-list)) (defun viper--deactivate-advice-list () - (mapc #'advice-remove viper--advice-list) + (mapc (lambda (n) + (advice-remove + (car n) + (cdr n))) + viper--advice-list) (setq viper--advice-list nil)) (defun viper-go-away () commit ee297210cffb9e8d05912686a39fa158414ba050 Author: Mark Oteiza Date: Thu May 26 21:47:18 2016 -0400 Preserve buffer point in windows by default (Bug#4041). * doc/lispref/windows.texi: Mention new default. * etc/NEWS: Mention new default. * lisp/window.el (switch-to-buffer-preserve-window-point): Default to t. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 9a09b35..015c557 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2171,8 +2171,9 @@ This option does not affect non-interactive calls of @code{switch-to-buffer}. @end defopt -By default, @code{switch-to-buffer} shows the buffer at its position of -@code{point}. This behavior can be tuned using the following option. +By default, @code{switch-to-buffer} tries to preserve +@code{window-point}. This behavior can be tuned using the following +option. @defopt switch-to-buffer-preserve-window-point If this variable is @code{nil}, @code{switch-to-buffer} displays the diff --git a/etc/NEWS b/etc/NEWS index d1eadd5..56f0ef8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -176,6 +176,9 @@ where you can cancel them with the 'c' command. ** The new function 'read-multiple-choice' prompts for multiple-choice questions, with a handy way to display help texts. ++++ +** 'switch-to-buffer-preserve-window-point' now defaults to t. + * Editing Changes in Emacs 25.2 diff --git a/lisp/window.el b/lisp/window.el index bd5275b..f699e21 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7147,7 +7147,7 @@ buffer with the name BUFFER-OR-NAME and return that buffer." buffer)) (other-buffer))) -(defcustom switch-to-buffer-preserve-window-point nil +(defcustom switch-to-buffer-preserve-window-point t "If non-nil, `switch-to-buffer' tries to preserve `window-point'. If this is nil, `switch-to-buffer' displays the buffer at that buffer's `point'. If this is `already-displayed', it tries to