commit 910f9a0a936aacbffe9b9b790d7f698dfd287aac (HEAD, refs/remotes/origin/master) Author: Michael Albinus Date: Sun May 1 10:14:05 2016 +0200 tramp.texi: Revert last change due to backward compatibility diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 3bc8356..08e5de2 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3132,9 +3132,11 @@ Since @file{filecache} remembers visited places, add the remote directory to the cache: @lisp -(with-eval-after-load "filecache" - (file-cache-add-directory - "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")) +@c `with-eval-after-load' has been introduced with Emacs 24.4. Shall +@c be used when appropriate. +(eval-after-load "filecache" + '(file-cache-add-directory + "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")) @end lisp Then use directory completion in the minibuffer with @kbd{C-x C-f commit 4d9e34e02c11b05b075ada241ef93f458f486fe5 Author: Paul Eggert Date: Sat Apr 30 17:50:17 2016 -0700 Fix the buffer-count patch (Bug#23394) * src/buffer.c (Fgenerate_new_buffer_name): Increment count just once each time through the loop. Reported by Lars Ingebrigtsen in: http://lists.gnu.org/archive/html/emacs-devel/2016-04/msg00918.html diff --git a/src/buffer.c b/src/buffer.c index 06467d2..55a16b2 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1073,11 +1073,11 @@ is first appended to NAME, to speed up finding a non-existent buffer. */) return genbase; } - for (ptrdiff_t count = 1; ; count++) + for (ptrdiff_t count = 2; ; count++) { char number[INT_BUFSIZE_BOUND (ptrdiff_t) + sizeof "<>"]; AUTO_STRING_WITH_LEN (lnumber, number, - sprintf (number, "<%"pD"d>", ++count)); + sprintf (number, "<%"pD"d>", count)); Lisp_Object gentemp = concat2 (genbase, lnumber); if (!NILP (Fstring_equal (gentemp, ignore)) || NILP (Fget_buffer (gentemp))) commit 2b4c099822811ede787fc6e575bfbb17b3cc0681 Author: Lars Ingebrigtsen Date: Sun May 1 01:53:58 2016 +0200 cua-prefix-override-inhibit-delay doc fix * lisp/emulation/cua-base.el (cua-prefix-override-inhibit-delay): Typo fix in doc string (bug#23401). diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 9351fcc..542dbcc 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -302,7 +302,7 @@ is not turned on." If there is additional input within this time, the prefix key is used as a normal prefix key. So typing a key sequence quickly will inhibit overriding the prefix key. -As a special case, if the prefix keys repeated within this time, the +As a special case, if the prefix key is repeated within this time, the first prefix key is discarded, so typing a prefix key twice in quick succession will also inhibit overriding the prefix key. If the value is nil, use a shifted prefix key to inhibit the override." commit 4b488a297a34b748649109d3c2d3c14632d4abe6 Author: Paul Eggert Date: Sat Apr 30 16:36:36 2016 -0700 Fix generate-new-buffer-name increment typo Problem reported by Chaitanya Koparkar (Bug#23394). * src/buffer.c (Fgenerate_new_buffer_name): Increment count when generating a new buffer. This fixes a typo I introduced in 2014-04-05T00:04:58Z!eggert@cs.ucla.edu. diff --git a/src/buffer.c b/src/buffer.c index e0fbab6..06467d2 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -1077,7 +1077,7 @@ is first appended to NAME, to speed up finding a non-existent buffer. */) { char number[INT_BUFSIZE_BOUND (ptrdiff_t) + sizeof "<>"]; AUTO_STRING_WITH_LEN (lnumber, number, - sprintf (number, "<%"pD"d>", count)); + sprintf (number, "<%"pD"d>", ++count)); Lisp_Object gentemp = concat2 (genbase, lnumber); if (!NILP (Fstring_equal (gentemp, ignore)) || NILP (Fget_buffer (gentemp))) commit 25e95b5dd8cd92e03788e589bf99a4b399f03114 Author: Lars Ingebrigtsen Date: Sun May 1 01:08:23 2016 +0200 global-eldoc-mode doc fix * lisp/emacs-lisp/eldoc.el (global-eldoc-mode): Be more specific about what "applicable" means (bug#23071). diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index bc5a78b..6c2f869 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -204,8 +204,16 @@ expression point is on." ;;;###autoload (define-minor-mode global-eldoc-mode - "Enable `eldoc-mode' in all buffers where it's applicable." - :group 'eldoc :global t + "Toggle Global Eldoc mode on or off. +With a prefix argument ARG, enable Global Eldoc mode if ARG is +positive, and disable it otherwise. If called from Lisp, enable +the mode if ARG is omitted or nil, and toggle it if ARG is ‘toggle’. + +If Global Eldoc mode is on, `eldoc-mode' will be enabled in all +buffers where it's applicable. These are buffers that have modes +that have enabled eldoc support. See `eldoc-documentation-function'." + :group 'eldoc + :global t :initialize 'custom-initialize-delay :init-value t (setq eldoc-last-message nil) commit d0b0cd667129c3ea8ea834f1a28a994453144cb2 Author: Lars Ingebrigtsen Date: Sun May 1 00:45:39 2016 +0200 Make the legend in describe-categories a link * lisp/help-fns.el (describe-categories): Make the "see bottom" text a link (bug#22227). diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e17586c..040152a 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1109,7 +1109,13 @@ BUFFER should be a buffer or a buffer name." (if (or (not (vectorp docs)) (/= (length docs) 95)) (error "Invalid first extra slot in this category table\n")) (with-current-buffer standard-output - (insert "Legend of category mnemonics (see the tail for the longer description)\n") + (setq-default help-button-cache (make-marker)) + (insert "Legend of category mnemonics ") + (insert-button "(longer descriptions at the bottom)" + 'action help-button-cache + 'follow-link t + 'help-echo "mouse-2, RET: show full legend") + (insert "\n") (let ((pos (point)) (items 0) lines n) (dotimes (i 95) (if (aref docs i) (setq items (1+ items)))) @@ -1136,6 +1142,7 @@ BUFFER should be a buffer or a buffer name." "character(s)\tcategory mnemonics\n" "------------\t------------------") (describe-vector table 'help-describe-category-set) + (set-marker help-button-cache (point)) (insert "Legend of category mnemonics:\n") (dotimes (i 95) (let ((elt (aref docs i))) commit 28aaa6d20586e3330a23b017a65e56dd6461c003 Author: Lars Ingebrigtsen Date: Sun May 1 00:26:00 2016 +0200 normal-top-level-add-subdirs-to-load-path doc fix * lisp/startup.el (normal-top-level-add-subdirs-to-load-path): Doc fix (bug#21962). diff --git a/lisp/startup.el b/lisp/startup.el index 536289c..761e69e 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -439,7 +439,7 @@ Warning Warning!!! Pure space overflow !!!Warning Warning :initialize #'custom-initialize-delay) (defun normal-top-level-add-subdirs-to-load-path () - "Add all subdirectories of `default-directory' to `load-path'. + "Recursively add all subdirectories of `default-directory' to `load-path'. More precisely, this uses only the subdirectories whose names start with letters or digits; it excludes any subdirectory named `RCS' or `CVS', and any subdirectory that contains a file named `.nosearch'." commit cafc2a5940cdc523cfea6dcf1cf540f48367c62a Author: Lars Ingebrigtsen Date: Sun May 1 00:16:42 2016 +0200 isearch-search-fun-function doc tweak * lisp/isearch.el (isearch-search-fun-function): Mention what the STRING parameter is (bug#21552). diff --git a/lisp/isearch.el b/lisp/isearch.el index 48354d3..5257a23 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -2665,8 +2665,9 @@ the word mode." "Non-default value overrides the behavior of `isearch-search-fun-default'. This variable's value should be a function, which will be called with no arguments, and should return a function that takes three -arguments: STRING, BOUND, and NOERROR. See `re-search-forward' -for the meaning of BOUND and NOERROR arguments. +arguments: STRING, BOUND, and NOERROR. STRING is the string to +be searched for. See `re-search-forward' for the meaning of +BOUND and NOERROR arguments. This returned function will be used by `isearch-search-string' to search for the first occurrence of STRING.") commit 4b7bb8f596550628eaa83b82c0f7eabe59a84964 Author: Lars Ingebrigtsen Date: Sun May 1 00:10:57 2016 +0200 Fill some imenu--index-alist doc lines * lisp/imenu.el (imenu--index-alist): Fill some doc lines (bug#21269). diff --git a/lisp/imenu.el b/lisp/imenu.el index 44bae2d..48257b8 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -462,12 +462,15 @@ Don't move point." Simple elements in the alist look like (INDEX-NAME . POSITION). POSITION is the buffer position of the item; to go to the item is simply to move point to that position. -POSITION is passed to `imenu-default-goto-function', so it can be a non-number -if that variable has been changed (e.g. Semantic uses overlays for POSITIONs). -Special elements look like (INDEX-NAME POSITION FUNCTION ARGUMENTS...). -To \"go to\" a special element means applying FUNCTION -to INDEX-NAME, POSITION, and the ARGUMENTS. +POSITION is passed to `imenu-default-goto-function', so it can be +a non-number if that variable has been changed (e.g. Semantic +uses overlays for POSITIONs). + +Special elements look like +\(INDEX-NAME POSITION FUNCTION ARGUMENTS...). +To \"go to\" a special element means applying FUNCTION to +INDEX-NAME, POSITION, and the ARGUMENTS. A nested sub-alist element looks like (INDEX-NAME . SUB-ALIST). The function `imenu--subalist-p' tests an element and returns t commit 032b05103136e6aa0a9640a3e3fa56fefebf7119 Author: Lars Ingebrigtsen Date: Sun May 1 00:08:52 2016 +0200 Make describe-variable look up the variable in the current buffer * lisp/help-fns.el (describe-variable): Get the variable definition in the buffer we were called from (in case it only exists there) (bug#21252). diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e2cb9f8..e17586c 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -699,17 +699,23 @@ it is displayed along with the global value." (interactive (let ((v (variable-at-point)) (enable-recursive-minibuffers t) + (orig-buffer (current-buffer)) val) - (setq val (completing-read (if (symbolp v) - (format - "Describe variable (default %s): " v) - "Describe variable: ") - obarray - (lambda (vv) - (or (get vv 'variable-documentation) - (and (boundp vv) (not (keywordp vv))))) - t nil nil - (if (symbolp v) (symbol-name v)))) + (setq val (completing-read + (if (symbolp v) + (format + "Describe variable (default %s): " v) + "Describe variable: ") + obarray + (lambda (vv) + ;; In case the variable only exists in the buffer + ;; the command we switch back to that buffer before + ;; we examine the variable. + (with-current-buffer orig-buffer + (or (get vv 'variable-documentation) + (and (boundp vv) (not (keywordp vv)))))) + t nil nil + (if (symbolp v) (symbol-name v)))) (list (if (equal val "") v (intern val))))) (let (file-name) commit eeac7c57273cec3f9408b18392dd2bafe3be4450 Author: Lars Ingebrigtsen Date: Sun May 1 00:03:15 2016 +0200 Fmarker_position doc string clarification * src/marker.c (Fmarker_position): Clarify the doc string (bug#21231). diff --git a/src/marker.c b/src/marker.c index 0300830..febdb17 100644 --- a/src/marker.c +++ b/src/marker.c @@ -412,8 +412,7 @@ Returns nil if MARKER points into a dead buffer. */) } DEFUN ("marker-position", Fmarker_position, Smarker_position, 1, 1, 0, - doc: /* Return the position MARKER points at, as a character number. -Returns nil if MARKER points nowhere. */) + doc: /* Return the position of MARKER, or nil if it points nowhere. */) (Lisp_Object marker) { CHECK_MARKER (marker); commit 28e9f4390d8391c2c36be4ef515cf3a2c679a5a5 Author: Lars Ingebrigtsen Date: Sat Apr 30 23:54:16 2016 +0200 Further define-obsolete-* doc fixups * lisp/emacs-lisp/byte-run.el (define-obsolete-face-alias): Fix up last change. (define-obsolete-variable-alias): Ditto. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index ed457d9..818c268 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -407,7 +407,7 @@ dumped with Emacs). This is so that any user customizations are applied before the defcustom tries to initialize the variable (this is due to the way `defvaralias' works). -If provided, WHEN should be a string indicating when the function +If provided, WHEN should be a string indicating when the variable was first made obsolete, for example a date or a release number. For the benefit of `custom-set-variables', if OBSOLETE-NAME has @@ -434,7 +434,7 @@ CURRENT-NAME, if it does not already have them: ;; It only really affects M-x describe-face output. (defmacro define-obsolete-face-alias (obsolete-face current-face when) "Make OBSOLETE-FACE a face alias for CURRENT-FACE and mark it obsolete. -If provided, WHEN should be a string indicating when the function +If provided, WHEN should be a string indicating when the face was first made obsolete, for example a date or a release number." `(progn (put ,obsolete-face 'face-alias ,current-face) commit 247c388f160581d207e41ca5926990bbf69d4a0f Author: Lars Ingebrigtsen Date: Sat Apr 30 23:52:19 2016 +0200 Describe WHEN in all the define-obsolete- macros * lisp/emacs-lisp/byte-run.el (define-obsolete-face-alias): Say more verbosely what WHEN is (bug#21225). (define-obsolete-function-alias): Describe the WHEN parameter. (define-obsolete-variable-alias): Ditto. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 83cb7e7..ed457d9 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -362,6 +362,9 @@ is equivalent to the following two lines of code: \(defalias \\='old-fun \\='new-fun \"old-fun's doc.\") \(make-obsolete \\='old-fun \\='new-fun \"22.1\") +If provided, WHEN should be a string indicating when the function +was first made obsolete, for example a date or a release number. + See the docstrings of `defalias' and `make-obsolete' for more details." (declare (doc-string 4) (advertised-calling-convention @@ -404,6 +407,9 @@ dumped with Emacs). This is so that any user customizations are applied before the defcustom tries to initialize the variable (this is due to the way `defvaralias' works). +If provided, WHEN should be a string indicating when the function +was first made obsolete, for example a date or a release number. + For the benefit of `custom-set-variables', if OBSOLETE-NAME has any of the following properties, they are copied to CURRENT-NAME, if it does not already have them: @@ -428,8 +434,8 @@ CURRENT-NAME, if it does not already have them: ;; It only really affects M-x describe-face output. (defmacro define-obsolete-face-alias (obsolete-face current-face when) "Make OBSOLETE-FACE a face alias for CURRENT-FACE and mark it obsolete. -The string WHEN gives the Emacs version where OBSOLETE-FACE became -obsolete." +If provided, WHEN should be a string indicating when the function +was first made obsolete, for example a date or a release number." `(progn (put ,obsolete-face 'face-alias ,current-face) ;; Used by M-x describe-face. commit fcd0d854eef6e439d51e8f07cf734d5e34e502b3 Author: Lars Ingebrigtsen Date: Sat Apr 30 23:40:42 2016 +0200 Mention with-silent-modifications in the lispref manual * doc/lispref/text.texi (Changing Properties): Document with-silent-modifications (bug#21171). diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 0323678..0b77593 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -3040,6 +3040,11 @@ construct each part with @code{propertize} and then combine them with @code{buffer-substring-no-properties}, which copies text from the buffer but does not copy its properties. +@findex with-silent-modifications + If you wish to add or remove text properties to a buffer without +marking the buffer as modified, you can wrap the calls above in the +@code{with-silent-modifications} macro. + @node Property Search @subsection Text Property Search Functions @cindex searching text properties commit e0e70f030e69d9696a963a86f5f7caaff4df06eb Author: Lars Ingebrigtsen Date: Sat Apr 30 23:34:29 2016 +0200 with-silent-modifications doc clarification * lisp/subr.el (with-silent-modifications): Rearrange the doc string a bit so that the most pertinent information is at the top (bug#21171). diff --git a/lisp/subr.el b/lisp/subr.el index a2af642..5f8d830 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -3457,6 +3457,8 @@ See also `with-temp-file' and `with-output-to-string'." (defmacro with-silent-modifications (&rest body) "Execute BODY, pretending it does not modify the buffer. +This macro is Typically used around modifications of +text-properties which do not really affect the buffer's content. If BODY performs real modifications to the buffer's text, other than cosmetic ones, undo data may become corrupted. @@ -3464,10 +3466,7 @@ This macro will run BODY normally, but doesn't count its buffer modifications as being buffer modifications. This affects things like `buffer-modified-p', checking whether the file is locked by someone else, running buffer modification hooks, and other things -of that nature. - -Typically used around modifications of text-properties which do -not really affect the buffer's content." +of that nature." (declare (debug t) (indent 0)) (let ((modified (make-symbol "modified"))) `(let* ((,modified (buffer-modified-p)) commit 1aaeaf1450756a71c9254a2a5b174c72084ca67a Author: Lars Ingebrigtsen Date: Sat Apr 30 23:30:40 2016 +0200 clear-visited-file-modtime doc string fix * lisp/files.el (clear-visited-file-modtime): Fix possibly confusing doc string wording (bug#21169). diff --git a/lisp/files.el b/lisp/files.el index a252be6..132ebce 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -5123,7 +5123,7 @@ change the additional actions you can take on files." (defun clear-visited-file-modtime () "Clear out records of last mod time of visited file. -Next attempt to save will certainly not complain of a discrepancy." +Next attempt to save will not complain of a discrepancy." (set-visited-file-modtime 0)) (defun not-modified (&optional arg) commit bf7a630b0a5d3900f2afb0e7a881ce62e2b9f935 Author: Lars Ingebrigtsen Date: Sat Apr 30 22:48:08 2016 +0200 Document mode mode line variables * doc/lispref/modes.texi (Mode Line Variables): Document `mode-line-front-space, `mode-line-misc-info', `mode-line-end-spaces' (bug#21014). diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index d2eebb7..ae79128 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1994,6 +1994,21 @@ with the major mode as: @samp{(Shell:run)}. Normally this variable is @code{nil}. @end defvar +@defvar mode-line-front-space +This variable is displayed at the front of the mode line. By default, +this construct is displayed right at the beginning of the mode line, +except that if there is a memory-full message, it is displayed first. +@end defvar + +@defvar mode-line-end-spaces +This variable is displayed at the end of the mode line. +@end defvar + +@defvar mode-line-misc-info +Mode line construct for miscellaneous information. By default, this +shows the information specified by @code{global-mode-string}. +@end defvar + @defvar minor-mode-alist @anchor{Definition of minor-mode-alist} This variable holds an association list whose elements specify how the commit a3151a28789f413af73b14fbba557b2a587fca53 Author: Lars Ingebrigtsen Date: Sat Apr 30 22:42:46 2016 +0200 Add a cross ref to Optional Mode Line * doc/lispref/modes.texi (Mode Line Variables): Add a cross reference to the Emacs mode line node that explains things like `display-time-string' (bug#21002). diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 52cc8f8..d2eebb7 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1912,7 +1912,8 @@ could have the same effects on the mode line if the value of @code{mode-line-format} is changed to use them. However, various parts of Emacs set these variables on the understanding that they will control parts of the mode line; therefore, practically speaking, it is essential -for the mode line to use them. +for the mode line to use them. Also see +@ref{Optional Mode Line,,, emacs, The GNU Emacs Manual}. @defvar mode-line-mule-info This variable holds the value of the mode line construct that displays commit 45559c584e5a4ddeed1539b028b50b95baa372f8 Author: Lars Ingebrigtsen Date: Sat Apr 30 22:41:41 2016 +0200 Add a doc string to display-time-string * lisp/time.el: Add a doc string to `display-time-string', because it's referred to in the manual, and is too mysterious otherwise (bug#21002). diff --git a/lisp/time.el b/lisp/time.el index e0d39b1..ba57924 100644 --- a/lisp/time.el +++ b/lisp/time.el @@ -108,7 +108,10 @@ A value of nil means 1 <= hh <= 12, and an AM/PM suffix is used." :type 'boolean :group 'display-time) -(defvar display-time-string nil) +(defvar display-time-string nil + "String used in mode lines to display a time string. +It should not be set directly, but is instead updated by the +`display-time' function.") ;;;###autoload(put 'display-time-string 'risky-local-variable t) (defcustom display-time-hook nil commit bcf0291d0cd02095b0809b1eb91f1e5c5c2ac5e3 Author: Lars Ingebrigtsen Date: Sat Apr 30 21:43:18 2016 +0200 custom-buffer-style doc fix * lisp/cus-edit.el (custom-buffer-style): Document the `tree' value (bug#20724). diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index ee0f14f..a1eb1d2 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1499,11 +1499,12 @@ Return non-nil if user chooses to customize, for use in (defcustom custom-buffer-style 'links "Control the presentation style for customization buffers. The value should be a symbol, one of: - -brackets: groups nest within each other with big horizontal brackets. -links: groups have links to subgroups." +`brackets': groups nest within each other with big horizontal brackets. +`links': groups have links to subgroups. +`tree': display groups as trees." :type '(radio (const brackets) - (const links)) + (const links) + (const tree)) :group 'custom-buffer) (defcustom custom-buffer-done-kill nil commit faf07d646575c78d6d956ce91820ebbf38308553 Author: Lars Ingebrigtsen Date: Sat Apr 30 21:39:21 2016 +0200 Document how to check for ImageMagick support * doc/lispref/display.texi (ImageMagick Images): Say how to check for ImageMagick support, which isn't quite obvious (bug#20702). diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 28d0064..3673d11 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -5145,6 +5145,12 @@ Conveniences,,, emacs, The GNU Emacs Manual}). The image type symbol for images loaded via ImageMagick is @code{imagemagick}, regardless of the actual underlying image format. +To check for ImageMagick support, use the following: + +@lisp +(image-type-available-p 'imagemagick) +@end lisp + @defun imagemagick-types This function returns a list of image file extensions supported by the current ImageMagick installation. Each list element is a symbol commit 970b82b2b2f3b880f3925cf0983cb2dd9efce015 Author: Lars Ingebrigtsen Date: Sat Apr 30 21:36:58 2016 +0200 Minor doc fix for ImageMagick/SVG builds * doc/lispref/display.texi (SVG Images): Don't imply that you have to build Emacs yourself (bug#20702). (ImageMagick Images): Ditto. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 2607788..28d0064 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -5139,7 +5139,7 @@ specifying the bounding box of the PostScript image, analogous to the @cindex ImageMagick images @cindex images, support for more formats - If you build Emacs with ImageMagick support, you can use the + If your Emacs build has ImageMagick support, you can use the ImageMagick library to load many image formats (@pxref{File Conveniences,,, emacs, The GNU Emacs Manual}). The image type symbol for images loaded via ImageMagick is @code{imagemagick}, regardless of @@ -5233,7 +5233,7 @@ Specifies a rotation angle in degrees. @cindex SVG images SVG (Scalable Vector Graphics) is an XML format for specifying images. -If you build Emacs with SVG support, you can create and manipulate +If your Emacs build has with SVG support, you can create and manipulate these images with the following commands. @defun svg-create width height &rest args commit bcc10761c3b968fa4534718116a0a601ed7da389 Author: Lars Ingebrigtsen Date: Sat Apr 30 21:28:51 2016 +0200 Rearrange the doc of query-replace slightly * lisp/replace.el (query-replace): Move the mention of the interactive prefix arg earlier so that users can find it (bug#20654). diff --git a/lisp/replace.el b/lisp/replace.el index c44d1f0..169fc3f 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -301,6 +301,10 @@ In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer's accessible portion. +In interactive use, the prefix arg (non-nil DELIMITED in +non-interactive use), means replace only matches surrounded by +word boundaries. A negative prefix arg means replace backward. + Use \\\\[next-history-element] \ to pull the last incremental search string to the minibuffer that reads FROM-STRING, or invoke replacements from @@ -327,10 +331,6 @@ If `replace-character-fold' is non-nil, matching uses character folding, i.e. it ignores diacritics and other differences between equivalent character strings. -Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace -only matches surrounded by word boundaries. A negative prefix arg means -replace backward. - Fourth and fifth arg START and END specify the region to operate on. To customize possible responses, change the bindings in `query-replace-map'." commit 0714d7387812a151f59993ac77c7321724ef79b1 Author: Lars Ingebrigtsen Date: Sat Apr 30 21:13:48 2016 +0200 apropos-print doc fix * lisp/apropos.el (apropos-print): Document the undocumented parameters (bug#20520). diff --git a/lisp/apropos.el b/lisp/apropos.el index 6009f30..caeb7ca 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el @@ -1044,9 +1044,12 @@ Each element should have the format The return value is the list that was in `apropos-accumulator', sorted alphabetically by symbol name; but this function also sets `apropos-accumulator' to nil before returning. - -If SPACING is non-nil, it should be a string; separate items with that string. -If non-nil, TEXT is a string that will be printed as a heading." +If DO-KEYS is non-nil, output the key bindings. If NOSUBST is +nil, substitute \"ASCII quotes\" (i.e., grace accent and +apostrophe) with curly quotes), and if non-nil, leave them alone. +If SPACING is non-nil, it should be a string; separate items with +that string. If non-nil, TEXT is a string that will be printed +as a heading." (if (null apropos-accumulator) (message "No apropos matches for `%s'" apropos-pattern) (setq apropos-accumulator commit b6a4d162208f239bc7804696d611ae52c686f138 Author: Lars Ingebrigtsen Date: Sat Apr 30 20:31:39 2016 +0200 completion-table-with-predicate doc string fix * lisp/minibuffer.el (completion-table-with-predicate): t -> non-nil in the doc string (bug#20460). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 714ca85..1ee05d3 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -374,10 +374,10 @@ only if the argument is an element of TABLE which should be considered for completion. STRING, PRED2, and ACTION are the usual arguments to completion tables, as described in `try-completion', `all-completions', and `test-completion'. If -STRICT is t, the predicate always applies; if nil it only applies -if it does not reduce the set of possible completions to nothing. -Note: TABLE needs to be a proper completion table which obeys -predicates." +STRICT is non-nil, the predicate always applies; if nil it only +applies if it does not reduce the set of possible completions to +nothing. Note: TABLE needs to be a proper completion table which +obeys predicates." (cond ((and (not strict) (eq action 'lambda)) ;; Ignore pred1 since it doesn't really have to apply anyway. commit 207a31432c1ed8b548003a3e4af32c49aa3441e9 Author: Lars Ingebrigtsen Date: Sat Apr 30 20:30:15 2016 +0200 Fill the completion-table-with-predicate doc string * lisp/minibuffer.el (completion-table-with-predicate): Fill the doc string (bug#20460). diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 6540059..714ca85 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -369,13 +369,15 @@ instead of a string, a function that takes the completion and returns the (defun completion-table-with-predicate (table pred1 strict string pred2 action) "Make a completion table equivalent to TABLE but filtered through PRED1. -PRED1 is a function of one argument which returns non-nil if and only if the -argument is an element of TABLE which should be considered for completion. -STRING, PRED2, and ACTION are the usual arguments to completion tables, -as described in `try-completion', `all-completions', and `test-completion'. -If STRICT is t, the predicate always applies; if nil it only applies if -it does not reduce the set of possible completions to nothing. -Note: TABLE needs to be a proper completion table which obeys predicates." +PRED1 is a function of one argument which returns non-nil if and +only if the argument is an element of TABLE which should be +considered for completion. STRING, PRED2, and ACTION are the +usual arguments to completion tables, as described in +`try-completion', `all-completions', and `test-completion'. If +STRICT is t, the predicate always applies; if nil it only applies +if it does not reduce the set of possible completions to nothing. +Note: TABLE needs to be a proper completion table which obeys +predicates." (cond ((and (not strict) (eq action 'lambda)) ;; Ignore pred1 since it doesn't really have to apply anyway. commit 139874ba53c2e2de9868f8e5234d6ea2bcb97af8 Author: Lars Ingebrigtsen Date: Sat Apr 30 20:21:11 2016 +0200 replace-match-maybe-edit doc clarification * lisp/replace.el (replace-match-maybe-edit): Say what MATCH-DATA is (bug#20304). diff --git a/lisp/replace.el b/lisp/replace.el index 91e5db8..c44d1f0 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2001,7 +2001,9 @@ but coerced to the correct value of INTEGERS." FIXEDCASE, LITERAL are passed to `replace-match' (which see). After possibly editing it (if `\\?' is present), NEWTEXT is also passed to `replace-match'. If NOEDIT is true, no check for `\\?' -is made (to save time). MATCH-DATA is used for the replacement. +is made (to save time). +MATCH-DATA is used for the replacement, and is a data structure +as returned from the `match-data' function. In case editing is done, it is changed to use markers. BACKWARD is used to reverse the replacement direction. commit 921b40476f597c84d7c34aa289cd43caeb389c4a Author: Lars Ingebrigtsen Date: Sat Apr 30 20:16:25 2016 +0200 add-timeout doc fix * lisp/emacs-lisp/timer.el (add-timeout): Mention the return value (bug#20181). diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 3f2e2fb..c01ea49 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -424,6 +424,8 @@ This function returns a timer object which you can use in `cancel-timer'." (defun add-timeout (secs function object &optional repeat) "Add a timer to run SECS seconds from now, to call FUNCTION on OBJECT. If REPEAT is non-nil, repeat the timer every REPEAT seconds. + +This function returns a timer object which you can use in `cancel-timer'. This function is for compatibility; see also `run-with-timer'." (run-with-timer secs repeat function object)) commit 6c7e7f421d02d9290d6d1d85320737371160aef7 Author: Lars Ingebrigtsen Date: Sat Apr 30 20:13:24 2016 +0200 Extremely minor doc fix in Choosing Window * doc/lispref/windows.texi (Choosing Window): There's only one action alist, I think (bug#20158). diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 74837ac..9a09b35 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2271,7 +2271,7 @@ display in. These steps are described by means of @dfn{display actions}, which have the form @code{(@var{function} . @var{alist})}. Here, @var{function} is either a function or a list of functions, which we refer to as @dfn{action functions}; @var{alist} is an -association list, which we refer to as @dfn{action alists}. +association list, which we refer to as an @dfn{action alist}. An action function accepts two arguments: the buffer to display and an action alist. It attempts to display the buffer in some window, commit 8e4595a438fe85dd109756886cdeaeea2e665afb Author: Alan Mackenzie Date: Sat Apr 30 17:28:24 2016 +0000 * .dir-locals: Amend for correct fontification of *.[ch] containing "IF_LINT" diff --git a/.dir-locals.el b/.dir-locals.el index 9853d7b..1aa71ff 100644 --- a/.dir-locals.el +++ b/.dir-locals.el @@ -1,7 +1,10 @@ ((nil . ((tab-width . 8) (sentence-end-double-space . t) (fill-column . 70))) - (c-mode . ((c-file-style . "GNU"))) + (c-mode . ((c-file-style . "GNU") + (c-noise-macro-with-parens-names . ("IF_LINT")) + (eval . (c-make-noise-macro-regexps)) + )) (objc-mode . ((c-file-style . "GNU"))) (log-edit-mode . ((log-edit-font-lock-gnu-style . t) (log-edit-setup-add-author . t))) commit 9392193be56eebdfac702a0bbb5e954088371c7a Author: Lars Ingebrigtsen Date: Sat Apr 30 19:20:12 2016 +0200 Transform mentions of `eval-after-load' to `with-eval-after-load' * doc/lispref/loading.texi (Hooks for Loading): Update text to not mention `eval-after-load' (bug#20038). diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi index e199250..66f01b4 100644 --- a/doc/emacs/text.texi +++ b/doc/emacs/text.texi @@ -1302,7 +1302,8 @@ it in order for this to take effect. automatically by putting the following in your init file: @example -(eval-after-load "outline" '(require 'foldout)) +(with-eval-after-load "outline" + (require 'foldout)) @end example @node Org Mode diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index bd347b0..f4e3393 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -1362,7 +1362,7 @@ Appendix, elisp, Emacs Lisp Reference}. @end ifclear @item -Avoid using @code{defadvice} or @code{eval-after-load} for Lisp code +Avoid using @code{defadvice} or @code{with-eval-after-load} for Lisp code to be included in Emacs. @item diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 06900a4..d2d38d7 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -1089,11 +1089,12 @@ execution of the rest of @var{body}. @end defmac Normally, well-designed Lisp programs should not use -@code{eval-after-load}. If you need to examine and set the variables -defined in another library (those meant for outside use), you can do -it immediately---there is no need to wait until the library is loaded. -If you need to call functions defined by that library, you should load -the library, preferably with @code{require} (@pxref{Named Features}). +@code{with-eval-after-load}. If you need to examine and set the +variables defined in another library (those meant for outside use), +you can do it immediately---there is no need to wait until the library +is loaded. If you need to call functions defined by that library, you +should load the library, preferably with @code{require} (@pxref{Named +Features}). @node Dynamic Modules @section Emacs Dynamic Modules diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 0a3d244..d12de7a 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -200,12 +200,12 @@ It is likewise a bad idea for one Lisp package to advise a function in another Lisp package (@pxref{Advising Functions}). @item -Avoid using @code{eval-after-load} in libraries and packages -(@pxref{Hooks for Loading}). This feature is meant for personal -customizations; using it in a Lisp program is unclean, because it -modifies the behavior of another Lisp file in a way that's not visible -in that file. This is an obstacle for debugging, much like advising a -function in the other package. +Avoid using @code{eval-after-load} and @code{with-eval-after-load} in +libraries and packages (@pxref{Hooks for Loading}). This feature is +meant for personal customizations; using it in a Lisp program is +unclean, because it modifies the behavior of another Lisp file in a +way that's not visible in that file. This is an obstacle for +debugging, much like advising a function in the other package. @item If a file does replace any of the standard functions or library diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index da63975..53f1beb 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -177,12 +177,10 @@ initialization file to add a shortcut for email address expansion in email composition buffers (@pxref{Inline Query Expansion}) @lisp -(eval-after-load - "message" - '(define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) -(eval-after-load - "sendmail" - '(define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) +(with-eval-after-load "message" + (define-key message-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) +(with-eval-after-load "sendmail" + (define-key mail-mode-map [(control ?c) (tab)] 'eudc-expand-inline)) @end lisp @menu @@ -271,8 +269,8 @@ LDAP: @vindex eudc-server-hotlist @vindex ldap-host-parameters-alist @lisp -(eval-after-load "message" - '(define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) +(with-eval-after-load "message" + (define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) (customize-set-variable 'eudc-server-hotlist '(("" . bbdb) ("ldaps://ldap.gnu.org" . ldap))) @@ -327,8 +325,8 @@ configure EUDC for LDAP: @vindex eudc-server-hotlist @vindex ldap-host-parameters-alist @lisp -(eval-after-load "message" - '(define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) +(with-eval-after-load "message" + (define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) (customize-set-variable 'eudc-server-hotlist '(("" . bbdb) ("ldaps://ldap.gnu.org" . ldap))) @@ -356,8 +354,8 @@ and the @file{.emacs} expressions become: @vindex eudc-server-hotlist @vindex ldap-host-parameters-alist @lisp -(eval-after-load "message" - '(define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) +(with-eval-after-load "message" + (define-key message-mode-map (kbd "TAB") 'eudc-expand-inline)) (customize-set-variable 'eudc-server-hotlist '(("" . bbdb) ("" . ldap))) (customize-set-variable 'ldap-host-parameters-alist diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi index 90bb10f..5a49f4a 100644 --- a/doc/misc/gnus-faq.texi +++ b/doc/misc/gnus-faq.texi @@ -584,10 +584,10 @@ Now we need to tell Gnus, where to get its mail from. If it's a POP3 server, then you need something like this: @example -(eval-after-load "mail-source" - '(add-to-list 'mail-sources '(pop :server "pop.YourProvider.net" - :user "yourUserName" - :password "yourPassword"))) +(with-eval-after-load "mail-source" + (add-to-list 'mail-sources '(pop :server "pop.YourProvider.net" + :user "yourUserName" + :password "yourPassword"))) @end example @noindent @@ -596,8 +596,8 @@ your password there. If you want to read your mail from a traditional spool file on your local machine, it's @example -(eval-after-load "mail-source" - '(add-to-list 'mail-sources '(file :path "/path/to/spool/file")) +(with-eval-after-load "mail-source" + (add-to-list 'mail-sources '(file :path "/path/to/spool/file")) @end example @noindent @@ -605,9 +605,9 @@ If it's a Maildir, with one file per message as used by postfix, Qmail and (optionally) fetchmail it's @example -(eval-after-load "mail-source" - '(add-to-list 'mail-sources '(maildir :path "/path/to/Maildir/" - :subdirs ("cur" "new"))) +(with-eval-after-load "mail-source" + (add-to-list 'mail-sources '(maildir :path "/path/to/Maildir/" + :subdirs ("cur" "new"))) @end example @noindent @@ -616,10 +616,10 @@ in one directory, for example because procmail already split your mail, it's @example -(eval-after-load "mail-source" - '(add-to-list 'mail-sources - '(directory :path "/path/to/procmail-dir/" - :suffix ".prcml"))) +(with-eval-after-load "mail-source" + (add-to-list 'mail-sources + '(directory :path "/path/to/procmail-dir/" + :suffix ".prcml"))) @end example @noindent @@ -850,10 +850,9 @@ text part if it's available. How to do it? Say @example -(eval-after-load "mm-decode" - '(progn - (add-to-list 'mm-discouraged-alternatives "text/html") - (add-to-list 'mm-discouraged-alternatives "text/richtext"))) +(with-eval-after-load "mm-decode" + (add-to-list 'mm-discouraged-alternatives "text/html") + (add-to-list 'mm-discouraged-alternatives "text/richtext")) @end example @noindent @@ -1577,14 +1576,14 @@ if you already use Gnus 5.10, if you still use 5.8.8 or 5.9 try this instead: @example -(eval-after-load "gnus-msg" - '(unless (boundp 'gnus-confirm-mail-reply-to-news) - (defadvice gnus-summary-reply (around reply-in-news activate) - "Request confirmation when replying to news." - (interactive) - (when (or (not (gnus-news-group-p gnus-newsgroup-name)) - (y-or-n-p "Really reply by mail to article author? ")) - ad-do-it)))) +(with-eval-after-load "gnus-msg" + (unless (boundp 'gnus-confirm-mail-reply-to-news) + (defadvice gnus-summary-reply (around reply-in-news activate) + "Request confirmation when replying to news." + (interactive) + (when (or (not (gnus-news-group-p gnus-newsgroup-name)) + (y-or-n-p "Really reply by mail to article author? ")) + ad-do-it)))) @end example @noindent @@ -1599,8 +1598,8 @@ Since 5.10 Gnus doesn't generate a sender header by default. For older Gnus' try this in @file{~/.gnus.el}: @example -(eval-after-load "message" - '(add-to-list 'message-syntax-checks '(sender . disabled))) +(with-eval-after-load "message" + (add-to-list 'message-syntax-checks '(sender . disabled))) @end example @noindent @@ -1665,14 +1664,14 @@ in @file{~/.gnus.el}. If you use Gnus 5.9 or earlier, you can use this instead (works for newer versions as well): @example -(eval-after-load "message" - '(let ((fqdn "yourmachine.yourdomain.tld"));; <-- Edit this! - (if (boundp 'message-user-fqdn) - (setq message-user-fqdn fqdn) - (gnus-message 1 "Redefining `message-make-fqdn'.") - (defun message-make-fqdn () - "Return user's fully qualified domain name." - fqdn)))) +(with-eval-after-load "message" + (let ((fqdn "yourmachine.yourdomain.tld"));; <-- Edit this! + (if (boundp 'message-user-fqdn) + (setq message-user-fqdn fqdn) + (gnus-message 1 "Redefining `message-make-fqdn'.") + (defun message-make-fqdn () + "Return user's fully qualified domain name." + fqdn)))) @end example @noindent @@ -2195,7 +2194,7 @@ An other idea would be to byte compile your @file{~/.gnus.el} (say @samp{M-x byte-compile-file RET ~/.gnus.el RET} to do it). Finally, if you have require statements in your .gnus, you could replace them with -eval-after-load, which loads the stuff not at startup +@code{with-eval-after-load}, which loads the stuff not at startup time, but when it's needed. Say you've got this in your @file{~/.gnus.el}: @@ -2209,8 +2208,8 @@ then as soon as you start Gnus, message.el is loaded. If you replace it with @example -(eval-after-load "message" - '(add-to-list 'message-syntax-checks '(sender . disabled))) +(with-eval-after-load "message" + (add-to-list 'message-syntax-checks '(sender . disabled))) @end example @noindent diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index f8b6125..df673fc 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -17148,9 +17148,9 @@ summary buffer. (gnus-summary-mark-as-read-forward 1)) (gnus-summary-scroll-up arg)))) -(eval-after-load "gnus" - #'(define-key gnus-summary-mode-map - (kbd "") 'browse-nnrss-url)) +(with-eval-after-load "gnus" + (define-key gnus-summary-mode-map + (kbd "") 'browse-nnrss-url)) (add-to-list 'nnmail-extra-headers nnrss-url-field) @end lisp @@ -17166,11 +17166,11 @@ Parameters}) in order to display @samp{text/html} parts only in @lisp ;; @r{Set the default value of @code{mm-discouraged-alternatives}.} -(eval-after-load "gnus-sum" - '(add-to-list - 'gnus-newsgroup-variables - '(mm-discouraged-alternatives - . '("text/html" "image/.*")))) +(with-eval-after-load "gnus-sum" + (add-to-list + 'gnus-newsgroup-variables + '(mm-discouraged-alternatives + . '("text/html" "image/.*")))) ;; @r{Display @samp{text/html} parts in @code{nnrss} groups.} (add-to-list diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi index 0098e20..cdead72 100644 --- a/doc/misc/rcirc.texi +++ b/doc/misc/rcirc.texi @@ -880,11 +880,11 @@ because @code{defun-rcirc-command} is not yet available, and without @code{rcirc} loaded, the command wouldn't do us much good anyway. @smallexample -(eval-after-load 'rcirc - '(defun-rcirc-command sv (arg) - "Boast about rcirc." - (interactive "i") - (rcirc-send-message process target +(with-eval-after-load 'rcirc + (defun-rcirc-command sv (arg) + "Boast about rcirc." + (interactive "i") + (rcirc-send-message process target (concat "I use " rcirc-id-string)))) @end smallexample @@ -904,29 +904,29 @@ copies of every channel buffer, one dead and one live. The real answer, therefore, is a @code{/reconnect} command: @smallexample -(eval-after-load 'rcirc - '(defun-rcirc-command reconnect (arg) - "Reconnect the server process." - (interactive "i") - (unless process - (error "There's no process for this target")) - (let* ((server (car (process-contact process))) - (port (process-contact process :service)) - (nick (rcirc-nick process)) - channels query-buffers) - (dolist (buf (buffer-list)) - (with-current-buffer buf - (when (eq process (rcirc-buffer-process)) - (remove-hook 'change-major-mode-hook - 'rcirc-change-major-mode-hook) - (if (rcirc-channel-p rcirc-target) - (setq channels (cons rcirc-target channels)) - (setq query-buffers (cons buf query-buffers)))))) - (delete-process process) - (rcirc-connect server port nick - rcirc-default-user-name - rcirc-default-full-name - channels)))) +(with-eval-after-load 'rcirc + (defun-rcirc-command reconnect (arg) + "Reconnect the server process." + (interactive "i") + (unless process + (error "There's no process for this target")) + (let* ((server (car (process-contact process))) + (port (process-contact process :service)) + (nick (rcirc-nick process)) + channels query-buffers) + (dolist (buf (buffer-list)) + (with-current-buffer buf + (when (eq process (rcirc-buffer-process)) + (remove-hook 'change-major-mode-hook + 'rcirc-change-major-mode-hook) + (if (rcirc-channel-p rcirc-target) + (setq channels (cons rcirc-target channels)) + (setq query-buffers (cons buf query-buffers)))))) + (delete-process process) + (rcirc-connect server port nick + rcirc-default-user-name + rcirc-default-full-name + channels)))) @end smallexample @node GNU Free Documentation License diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 45518b2..3bc8356 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -3132,9 +3132,9 @@ Since @file{filecache} remembers visited places, add the remote directory to the cache: @lisp -(eval-after-load "filecache" - '(file-cache-add-directory - "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")) +(with-eval-after-load "filecache" + (file-cache-add-directory + "@trampfn{ssh,news@@news.my.domain,/opt/news/etc/}")) @end lisp Then use directory completion in the minibuffer with @kbd{C-x C-f commit 77c5f4554ebb3b7c7d49bc881e45a550f6c93987 Author: Lars Ingebrigtsen Date: Sat Apr 30 18:48:05 2016 +0200 cursor-type doc fix * src/buffer.c (syms_of_buffer): Mention that cursor-type's WIDHT/HEIGHT can't exceed the frame char size (bug#19215). diff --git a/src/buffer.c b/src/buffer.c index 0e5e64f..e0fbab6 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -6225,6 +6225,8 @@ Values are interpreted as follows: (hbar . HEIGHT) display a horizontal bar cursor with height HEIGHT ANYTHING ELSE display a hollow box cursor +WIDTH and HEIGHT can't exceed the frame's canonical character size. + When the buffer is displayed in a non-selected window, the cursor's appearance is instead controlled by the variable `cursor-in-non-selected-windows'. */); commit da5d0786163a91400eced4fddba4a92b652458d1 Author: Lars Ingebrigtsen Date: Sat Apr 30 18:46:58 2016 +0200 Add a link from Tool Bar to Images * doc/lispref/keymaps.texi (Tool Bar): Add a link to the Images node (bug#19722). diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 0ea3028..61ac80c 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -2605,8 +2605,8 @@ this is how you specify the image to display in the tool bar: @table @code @item :image @var{image} -@var{images} is either a single image specification or a vector of four -image specifications. If you use a vector of four, +@var{image} is either a single image specification (@pxref{Images}) or +a vector of four image specifications. If you use a vector of four, one of them is used, depending on circumstances: @table @asis commit 01cdbcf8347f5c4a48b231abd497c9e6060e4545 Author: Alan Mackenzie Date: Sat Apr 30 16:37:41 2016 +0000 CC Mode: Recognize a noise macro with parens after a declarator's identifier * lisp/progmodes/cc-engine (c-forward-decl-or-cast-1): In the while loop following comment "Skip over type decl suffix operators." insert code also to check for noise macros with parentheses. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index f7a850f..c6aa56e 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -7433,36 +7433,42 @@ comment at the start of cc-engine.el for more info." (setq got-identifier (c-forward-name)) (setq name-start pos))) - ;; Skip over type decl suffix operators. - (while (if (looking-at c-type-decl-suffix-key) + ;; Skip over type decl suffix operators and trailing noise macros. + (while + (cond + ((and c-opt-cpp-prefix + (looking-at c-noise-macro-with-parens-name-re)) + (c-forward-noise-clause)) - (if (eq (char-after) ?\)) - (when (> paren-depth 0) - (setq paren-depth (1- paren-depth)) - (forward-char) - t) - (when (if (save-match-data (looking-at "\\s(")) - (c-safe (c-forward-sexp 1) t) - (goto-char (match-end 1)) - t) - (when (and (not got-suffix-after-parens) - (= paren-depth 0)) - (setq got-suffix-after-parens (match-beginning 0))) - (setq got-suffix t))) - - ;; No suffix matched. We might have matched the - ;; identifier as a type and the open paren of a - ;; function arglist as a type decl prefix. In that - ;; case we should "backtrack": Reinterpret the last - ;; type as the identifier, move out of the arglist and - ;; continue searching for suffix operators. - ;; - ;; Do this even if there's no preceding type, to cope - ;; with old style function declarations in K&R C, - ;; (con|de)structors in C++ and `c-typeless-decl-kwds' - ;; style declarations. That isn't applicable in an - ;; arglist context, though. - (when (and (= paren-depth 1) + ((looking-at c-type-decl-suffix-key) + (if (eq (char-after) ?\)) + (when (> paren-depth 0) + (setq paren-depth (1- paren-depth)) + (forward-char) + t) + (when (if (save-match-data (looking-at "\\s(")) + (c-safe (c-forward-sexp 1) t) + (goto-char (match-end 1)) + t) + (when (and (not got-suffix-after-parens) + (= paren-depth 0)) + (setq got-suffix-after-parens (match-beginning 0))) + (setq got-suffix t)))) + + (t + ;; No suffix matched. We might have matched the + ;; identifier as a type and the open paren of a + ;; function arglist as a type decl prefix. In that + ;; case we should "backtrack": Reinterpret the last + ;; type as the identifier, move out of the arglist and + ;; continue searching for suffix operators. + ;; + ;; Do this even if there's no preceding type, to cope + ;; with old style function declarations in K&R C, + ;; (con|de)structors in C++ and `c-typeless-decl-kwds' + ;; style declarations. That isn't applicable in an + ;; arglist context, though. + (when (and (= paren-depth 1) (not got-prefix-before-parens) (not (eq at-type t)) (or backup-at-type @@ -7474,7 +7480,7 @@ comment at the start of cc-engine.el for more info." (eq (char-before pos) ?\))) (c-fdoc-shift-type-backward) (goto-char pos) - t)) + t))) (c-forward-syntactic-ws)) commit 9dc5f6d830e72420dc4d41c8f6ca1ca6b28609c0 Author: Lars Ingebrigtsen Date: Sat Apr 30 18:31:05 2016 +0200 (default-mode-line-format): More explicit obsolete info * lisp/subr.el (default-mode-line-format): Be more explicit in how default values are now handled (bug#19424). diff --git a/lisp/subr.el b/lisp/subr.el index 5477500..a2af642 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1323,7 +1323,9 @@ is converted into a string by expressing it in decimal." ;; buffer-local. ;; Not used at all in Emacs, last time I checked: -(make-obsolete-variable 'default-mode-line-format 'mode-line-format "23.2") +(make-obsolete-variable 'default-mode-line-format + "use (setq-default mode-line-format) or (default-value mode-line-format) instead" + "23.2") (make-obsolete-variable 'default-header-line-format 'header-line-format "23.2") (make-obsolete-variable 'default-line-spacing 'line-spacing "23.2") (make-obsolete-variable 'default-abbrev-mode 'abbrev-mode "23.2") commit aa692acbb598a1cc8219ed7a87dde25fd7626ba5 Author: Lars Ingebrigtsen Date: Sat Apr 30 18:20:29 2016 +0200 Fcompare_buffer_substrings doc string clarification * src/editfns.c (Fcompare_buffer_substrings): Extremely minor doc string clarification (bug#19255). diff --git a/src/editfns.c b/src/editfns.c index 48f2a8d..e267c2f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -2933,10 +2933,9 @@ DEFUN ("compare-buffer-substrings", Fcompare_buffer_substrings, Scompare_buffer_ 6, 6, 0, doc: /* Compare two substrings of two buffers; return result as number. Return -N if first string is less after N-1 chars, +N if first string is -greater after N-1 chars, or 0 if strings match. Each substring is -represented as three arguments: BUFFER, START and END. That makes six -args in all, three for each substring. - +greater after N-1 chars, or 0 if strings match. +The first substring is in BUFFER1 from START1 to END1 and the second +is in BUFFER2 from START2 to END2. The value of `case-fold-search' in the current buffer determines whether case is significant or ignored. */) (Lisp_Object buffer1, Lisp_Object start1, Lisp_Object end1, Lisp_Object buffer2, Lisp_Object start2, Lisp_Object end2) commit b6481b19bc9592492b1f70dfecb4de6256f537fe Author: Lars Ingebrigtsen Date: Sat Apr 30 18:07:15 2016 +0200 insert-file-contents-literally doc fix * lisp/files.el (insert-file-contents-literally): Say that the parameters are explained in the other function (bug#18317). diff --git a/lisp/files.el b/lisp/files.el index 2857f6d..a252be6 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2143,6 +2143,7 @@ Do you want to revisit the file normally now? ") (defun insert-file-contents-literally (filename &optional visit beg end replace) "Like `insert-file-contents', but only reads in the file literally. +See `insert-file-contents' for an explanation of the parameters. A buffer may be modified in several ways after reading into the buffer, due to Emacs features such as format decoding, character code conversion, `find-file-hook', automatic uncompression, etc. commit b66bc0cced786e0320e1c3b0758bd3c434d4e8b5 Author: Lars Ingebrigtsen Date: Sat Apr 30 17:57:57 2016 +0200 Fix custom types for cursor-in-non-selected-windows * lisp/cus-start.el (standard): Use the same custom types for cursor-in-non-selected-windows as for cursor-type (bug#19214). diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 1c10bf7..c830ed8 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -54,7 +54,8 @@ ;; :risky - risky-local-variable property ;; :safe - safe-local-variable property ;; :tag - custom-tag property -(let (standard native-p prop propval +(let (standard + native-p prop propval ;; This function turns a value ;; into an expression which produces that value. (quoter (lambda (sexp) @@ -67,27 +68,27 @@ (stringp sexp) (numberp sexp)) sexp - (list 'quote sexp))))) + (list 'quote sexp)))) + (cursor-type-types + '(choice + (const :tag "Frame default" t) + (const :tag "Filled box" box) + (const :tag "Hollow cursor" hollow) + (const :tag "Vertical bar" bar) + (cons :tag "Vertical bar with specified width" + (const bar) integer) + (const :tag "Horizontal bar" hbar) + (cons :tag "Horizontal bar with specified width" + (const hbar) integer) + (const :tag "None "nil)))) (pcase-dolist (`(,symbol ,group ,type ,version . ,rest) - '(;; alloc.c + `(;; alloc.c (gc-cons-threshold alloc integer) (gc-cons-percentage alloc float) (garbage-collection-messages alloc boolean) ;; buffer.c - (cursor-type - display - (choice - (const :tag "Frame default" t) - (const :tag "Filled box" box) - (const :tag "Hollow cursor" hollow) - (const :tag "Vertical bar" bar) - (cons :tag "Vertical bar with specified width" - (const bar) integer) - (const :tag "Horizontal bar" hbar) - (cons :tag "Horizontal bar with specified width" - (const hbar) integer) - (const :tag "None "nil))) + (cursor-type display ,cursor-type-types) (mode-line-format mode-line sexp) ;Hard to do right. (major-mode internal function) (case-fold-search matching boolean) @@ -147,7 +148,7 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (line-spacing display (choice (const :tag "none" nil) number) "22.1") (cursor-in-non-selected-windows - cursor boolean nil + cursor ,cursor-type-types nil :tag "Cursor In Non-selected Windows" :set (lambda (symbol value) (set-default symbol value) commit 696052b5fdfbc5c25dff3c6b081aebe70f6d06c7 Author: Lars Ingebrigtsen Date: Sat Apr 30 17:50:09 2016 +0200 Doc clarification to mwheel-scroll * lisp/mwheel.el (mwheel-scroll): Mention that the restriction does not apply to Windows (bug#19209). diff --git a/lisp/mwheel.el b/lisp/mwheel.el index f1450d4..9e03854 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -187,7 +187,8 @@ This can be slightly disconcerting, but some people prefer it." (defun mwheel-scroll (event) "Scroll up or down according to the EVENT. -This should only be bound to mouse buttons 4 and 5." +This should be bound only to mouse buttons 4 and 5 on non-Windows +systems." (interactive (list last-input-event)) (let* ((curwin (if mouse-wheel-follow-mouse (prog1 commit cd193a871f5a8e1c81ba86fc398ac382fa814383 Author: Lars Ingebrigtsen Date: Sat Apr 30 17:39:05 2016 +0200 Clarify the doc of eval-expression-print-format * lisp/simple.el (eval-expression-print-format): Doc clarification (bug#19114). diff --git a/lisp/simple.el b/lisp/simple.el index da6deea..1247cb2 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1420,10 +1420,11 @@ If nil, don't change the value of `debug-on-error'." :version "21.1") (defun eval-expression-print-format (value) - "Format VALUE as a result of evaluated expression. -Return a formatted string which is displayed in the echo area -in addition to the value printed by prin1 in functions which -display the result of expression evaluation." + "If VALUE in an integer, return a specially formatted string. +This string will typically look like \" (#o1, #x1, ?\\C-a)\". +If VALUE is not an integer, nil is returned. +This function is used by functions like `prin1' that display the +result of expression evaluation." (if (and (integerp value) (or (eq standard-output t) (zerop (prefix-numeric-value current-prefix-arg)))) commit 66379a737d0ab09d05f9d770cf715247db5eacae Author: Lars Ingebrigtsen Date: Sat Apr 30 17:30:59 2016 +0200 (extended-command-suggest-shorter): Add a version string * lisp/simple.el (extended-command-suggest-shorter): Add a version string. diff --git a/lisp/simple.el b/lisp/simple.el index fca7396..da6deea 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1635,9 +1635,10 @@ If the value is non-nil and not a number, we wait 2 seconds." (other :tag "on"))) (defcustom extended-command-suggest-shorter t - "Non-nil means show a shorter M-x invocation when there is one." + "If non-nil, show a shorter M-x invocation when there is one." :group 'keyboard - :type 'boolean) + :type 'boolean + :version "25.2") (defun execute-extended-command--shorter-1 (name length) (cond commit 12515d890f3c545186e023863e4ee6ba2cc65333 Author: Lars Ingebrigtsen Date: Sat Apr 30 17:29:46 2016 +0200 Document extended-command-suggest-shorter * doc/emacs/m-x.texi (M-x): Mention extended-command-suggest-shorter (bug#19152). diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi index 9e5f50b..4b1165a 100644 --- a/doc/emacs/m-x.texi +++ b/doc/emacs/m-x.texi @@ -69,11 +69,13 @@ number, in which case Emacs will show the binding for that many seconds before removing it from display. The default behavior is to display the binding for 2 seconds. +@vindex extended-command-suggest-shorter Commands that don't have key bindings, can still be invoked after typing less than their full name at the @samp{M-x} prompt. Emacs mentions such shorthands in the echo area if they are significantly -shorter than the full command name. The setting of -@code{suggest-key-bindings} affects these hints as well. +shorter than the full command name, and +@code{extended-command-suggest-shorter} is non-@code{nil}. The +setting of @code{suggest-key-bindings} affects these hints as well. In this manual, when we speak of running a command by name, we often omit the @key{RET} that terminates the name. Thus we might say diff --git a/etc/NEWS b/etc/NEWS index 543b3ba..ed4810b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -56,6 +56,10 @@ affected by this, as SGI stopped supporting IRIX in December 2013. * Changes in Emacs 25.2 ++++ +** The new variable `extended-command-suggest-shorter' has been added +to control whether to suggest shorter `M-x' commands or not. + --- ** icomplete now respects `completion-ignored-extensions'. commit 6f86ec8050c12b131b5a8d54a42fef04445f9482 Author: Ivan Shmakov Date: Sat Apr 30 17:24:57 2016 +0200 Add a variable to control "shorter command" suggestions * lisp/simple.el (extended-command-suggest-shorter): New variable (bug#19152). (execute-extended-command): Use it. diff --git a/lisp/simple.el b/lisp/simple.el index 849cbd6..fca7396 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1634,6 +1634,11 @@ If the value is non-nil and not a number, we wait 2 seconds." (integer :tag "time" 2) (other :tag "on"))) +(defcustom extended-command-suggest-shorter t + "Non-nil means show a shorter M-x invocation when there is one." + :group 'keyboard + :type 'boolean) + (defun execute-extended-command--shorter-1 (name length) (cond ((zerop length) (list "")) @@ -1716,7 +1721,8 @@ invoking, give a prefix argument to `execute-extended-command'." ((numberp suggest-key-bindings) suggest-key-bindings) (t 2)))))) (when (and waited (not (consp unread-command-events))) - (unless (or binding executing-kbd-macro (not (symbolp function)) + (unless (or (not extended-command-suggest-shorter) + binding executing-kbd-macro (not (symbolp function)) (<= (length (symbol-name function)) 2)) ;; There's no binding for CMD. Let's try and find the shortest ;; string to use in M-x. commit 619e0aedb2f3dbfe6821ac34e2d25b4e5c181117 Author: Lars Ingebrigtsen Date: Sat Apr 30 16:48:50 2016 +0200 Explictly explain that package-initialize loads the packages * lisp/emacs-lisp/package.el (package-initialize): Be explicit in saying that `package-initialize' obviates adjusting the path or requiring the packages, as this is a question that apparently comes up now and then (bug#18829). diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index d5d35d7..c05bb53 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1430,7 +1430,10 @@ If `user-init-file' does not mention `(package-initialize)', add it to the file. If called as part of loading `user-init-file', set `package-enable-at-startup' to nil, to prevent accidentally -loading packages twice." +loading packages twice. +It is not necessary to adjust `load-path' or `require' the +individual packages after calling `package-initialize' -- this is +taken care of by `package-initialize'." (interactive) (setq package-alist nil) (if (equal user-init-file load-file-name) commit 3eca9a03816f95da0030665223c0b5262f223ba7 Author: Lars Ingebrigtsen Date: Sat Apr 30 16:44:06 2016 +0200 Have the doc strings of `load-path' and `require' mention each other * src/fns.c (Frequire): Mention `load-path' and fill the doc string (bug#18829). * src/lread.c (syms_of_lread): Mention that `require' uses `load-path'. diff --git a/src/fns.c b/src/fns.c index 617a8e8..b21e93d 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2808,17 +2808,24 @@ require_unwind (Lisp_Object old_value) DEFUN ("require", Frequire, Srequire, 1, 3, 0, doc: /* If feature FEATURE is not loaded, load it from FILENAME. -If FEATURE is not a member of the list `features', then the feature -is not loaded; so load the file FILENAME. -If FILENAME is omitted, the printname of FEATURE is used as the file name, -and `load' will try to load this name appended with the suffix `.elc', -`.el', or the system-dependent suffix for dynamic module files, in that -order. The name without appended suffix will not be used. -See `get-load-suffixes' for the complete list of suffixes. -If the optional third argument NOERROR is non-nil, -then return nil if the file is not found instead of signaling an error. -Normally the return value is FEATURE. -The normal messages at start and end of loading FILENAME are suppressed. */) +If FEATURE is not a member of the list `features', then the feature is +not loaded; so load the file FILENAME. + +If FILENAME is omitted, the printname of FEATURE is used as the file +name, and `load' will try to load this name appended with the suffix +`.elc', `.el', or the system-dependent suffix for dynamic module +files, in that order. The name without appended suffix will not be +used. See `get-load-suffixes' for the complete list of suffixes. + +The directories in `load-path' are searched when trying to find the +file name. + +If the optional third argument NOERROR is non-nil, then return nil if +the file is not found instead of signaling an error. Normally the +return value is FEATURE. + +The normal messages at start and end of loading FILENAME are +suppressed. */) (Lisp_Object feature, Lisp_Object filename, Lisp_Object noerror) { Lisp_Object tem; diff --git a/src/lread.c b/src/lread.c index 6e97e07..4450728 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4576,6 +4576,7 @@ were read in. */); doc: /* List of directories to search for files to load. Each element is a string (directory file name) or nil (meaning `default-directory'). +This list is consulted by the `require' function. Initialized during startup as described in Info node `(elisp)Library Search'. Use `directory-file-name' when adding items to this path. However, Lisp programs that process this list should tolerate directories both with commit 2824c587e9749a8f350f1d3dddd65176b4561dcb Author: Lars Ingebrigtsen Date: Sat Apr 30 16:28:52 2016 +0200 Doc fix for insert-pair-alist * lisp/emacs-lisp/lisp.el (insert-pair-alist): Say what COMMAND-CHAR is (bug#18809). diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 764d01c..ea7cce6 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -587,7 +587,11 @@ Interactively, the behavior depends on `narrow-to-defun-include-comments'." Each element looks like (OPEN-CHAR CLOSE-CHAR) or (COMMAND-CHAR OPEN-CHAR CLOSE-CHAR). The characters OPEN-CHAR and CLOSE-CHAR of the pair whose key is equal to the last input character with -or without modifiers, are inserted by `insert-pair'.") +or without modifiers, are inserted by `insert-pair'. + +If COMMAND-CHAR is specified, it is a character that triggers the +insertion of the open/close pair, and COMMAND-CHAR itself isn't +inserted.") (defun insert-pair (&optional arg open close) "Enclose following ARG sexps in a pair of OPEN and CLOSE characters. commit e77b8d84b4161f2cf8720dec2bf44a3e50134398 Author: Lars Ingebrigtsen Date: Sat Apr 30 16:21:54 2016 +0200 Move doc of backup-directory-alist to the Backup node * doc/emacs/files.texi (Backup): Move the documentation of `backup-directory-alist' here from the "Single or Numbered Backups" node, because it doesn't seem to have much to do with numbering (bug#18692). diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index bbb6070..af9d4d5 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -522,6 +522,18 @@ a new backup file. @kbd{C-u C-u C-u C-x C-s} does both things: it makes a backup from the previous contents, and arranges to make another from the newly saved contents if you save again. +@vindex backup-directory-alist + You can customize the variable @code{backup-directory-alist} to +specify that files matching certain patterns should be backed up in +specific directories. A typical use is to add an element @code{("." +. @var{dir})} to make all backups in the directory with absolute name +@var{dir}. Emacs modifies the backup file names to avoid clashes +between files with the same names originating in different +directories. Alternatively, adding, @code{("." . ".~")} would make +backups in the invisible subdirectory @file{.~} of the original file's +directory. Emacs creates the directory, if necessary, to make the +backup. + @menu * Names: Backup Names. How backup files are named. * Deletion: Backup Deletion. Emacs deletes excess numbered backups. @@ -585,19 +597,6 @@ value is @samp{nil} or @samp{existing}, then @code{version-control} becomes @code{nil}; if it is @samp{never} or @samp{simple}, then @code{version-control} becomes @code{never}. -@vindex backup-directory-alist - You can customize the variable @code{backup-directory-alist} to -specify that files matching certain patterns should be backed up in -specific directories. This variable applies to both single and -numbered backups. A typical use is to add an element @code{("." -. @var{dir})} to make all backups in the directory with absolute name -@var{dir}; Emacs modifies the backup file names to avoid clashes -between files with the same names originating in different -directories. Alternatively, adding, @code{("." . ".~")} would make -backups in the invisible subdirectory @file{.~} of the original file's -directory. Emacs creates the directory, if necessary, to make the -backup. - @vindex make-backup-file-name-function If you set the variable @code{make-backup-file-name-function} to a suitable Lisp function, you can override the usual way Emacs commit c05d186455ce9907eeb6b21ea4227e453996c681 Author: Lars Ingebrigtsen Date: Sat Apr 30 16:15:46 2016 +0200 Tiny doc clarification for create-fontset-from-fontset-spec * lisp/international/fontset.el (create-fontset-from-fontset-spec): Clarify what the optional part is (bug#18686). diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el index 90905a2..612c0a0 100644 --- a/lisp/international/fontset.el +++ b/lisp/international/fontset.el @@ -1259,7 +1259,7 @@ to map charsets to scripts.") &optional _style-variant _noerror) "Create a fontset from fontset specification string FONTSET-SPEC. FONTSET-SPEC is a string of the format: - FONTSET-NAME,SCRIPT-NAME0:FONT-NAME0,SCRIPT-NAME1:FONT-NAME1, ... + FONTSET-NAME[,SCRIPT-NAME0:FONT-NAME0,SCRIPT-NAME1:FONT-NAME1] ... Any number of SPACE, TAB, and NEWLINE can be put before and after commas. When a frame uses the fontset as the `font' parameter, the frame's commit c05716d3a26ea7518b89eacfccaf70c9d0731df7 Author: Lars Ingebrigtsen Date: Sat Apr 30 16:08:07 2016 +0200 Fill the doc string of font-lock-keywords * lisp/font-lock.el (font-lock-keywords): Fill the lines and reorganise some explanations (bug#21427). diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 48a96f2..b5ff5cf 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -364,105 +364,125 @@ Each element in a user-level keywords list should have one of these forms: (MATCHER HIGHLIGHT ...) (eval . FORM) -where MATCHER can be either the regexp to search for, or the function name to -call to make the search (called with one argument, the limit of the search; -it should return non-nil, move point, and set `match-data' appropriately if -it succeeds; like `re-search-forward' would). -MATCHER regexps can be generated via the function `regexp-opt'. - -FORM is an expression, whose value should be a keyword element, evaluated when -the keyword is (first) used in a buffer. This feature can be used to provide a -keyword that can only be generated when Font Lock mode is actually turned on. +where MATCHER can be either the regexp to search for, or the +function name to call to make the search (called with one +argument, the limit of the search; it should return non-nil, move +point, and set `match-data' appropriately if it succeeds; like +`re-search-forward' would). MATCHER regexps can be generated via +the function `regexp-opt'. + +FORM is an expression, whose value should be a keyword element, +evaluated when the keyword is (first) used in a buffer. This +feature can be used to provide a keyword that can only be +generated when Font Lock mode is actually turned on. HIGHLIGHT should be either MATCH-HIGHLIGHT or MATCH-ANCHORED. -For highlighting single items, for example each instance of the word \"foo\", -typically only MATCH-HIGHLIGHT is required. -However, if an item or (typically) items are to be highlighted following the -instance of another item (the anchor), for example each instance of the -word \"bar\" following the word \"anchor\" then MATCH-ANCHORED may be required. +For highlighting single items, for example each instance of the +word \"foo\", typically only MATCH-HIGHLIGHT is required. +However, if an item or (typically) items are to be highlighted +following the instance of another item (the anchor), for example +each instance of the word \"bar\" following the word \"anchor\" +then MATCH-ANCHORED may be required. MATCH-HIGHLIGHT should be of the form: (SUBEXP FACENAME [OVERRIDE [LAXMATCH]]) -SUBEXP is the number of the subexpression of MATCHER to be highlighted. +SUBEXP is the number of the subexpression of MATCHER to be +highlighted. FACENAME is an expression whose value is the face name to use. -Instead of a face, FACENAME can evaluate to a property list -of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) -in which case all the listed text-properties will be set rather than -just FACE. In such a case, you will most likely want to put those -properties in `font-lock-extra-managed-props' or to override +Instead of a face, FACENAME can evaluate to a property list of +the form (face FACE PROP1 VAL1 PROP2 VAL2 ...) in which case all +the listed text-properties will be set rather than just FACE. In +such a case, you will most likely want to put those properties in +`font-lock-extra-managed-props' or to override `font-lock-unfontify-region-function'. -OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing fontification can -be overwritten. If `keep', only parts not already fontified are highlighted. -If `prepend' or `append', existing fontification is merged with the new, in -which the new or existing fontification, respectively, takes precedence. -If LAXMATCH is non-nil, that means don't signal an error if there is +OVERRIDE and LAXMATCH are flags. If OVERRIDE is t, existing +fontification can be overwritten. If `keep', only parts not +already fontified are highlighted. If `prepend' or `append', +existing fontification is merged with the new, in which the new +or existing fontification, respectively, takes precedence. If +LAXMATCH is non-nil, that means don't signal an error if there is no match for SUBEXP in MATCHER. -For example, an element of the form highlights (if not already highlighted): +For example, an element of the form highlights (if not already +highlighted): + + \"\\\\\\=\" + Discrete occurrences of \"foo\" in the value of the variable + `font-lock-keyword-face'. + + (\"fu\\\\(bar\\\\)\" . 1) + Substring \"bar\" within all occurrences of \"fubar\" in the + value of `font-lock-keyword-face'. + + (\"fubar\" . fubar-face) + Occurrences of \"fubar\" in the value of `fubar-face'. - \"\\\\\\=\" discrete occurrences of \"foo\" in the value of the - variable `font-lock-keyword-face'. - (\"fu\\\\(bar\\\\)\" . 1) substring \"bar\" within all occurrences of \"fubar\" in - the value of `font-lock-keyword-face'. - (\"fubar\" . fubar-face) Occurrences of \"fubar\" in the value of `fubar-face'. (\"foo\\\\|bar\" 0 foo-bar-face t) - occurrences of either \"foo\" or \"bar\" in the value - of `foo-bar-face', even if already highlighted. + Occurrences of either \"foo\" or \"bar\" in the value of + `foo-bar-face', even if already highlighted. + (fubar-match 1 fubar-face) - the first subexpression within all occurrences of - whatever the function `fubar-match' finds and matches - in the value of `fubar-face'. + The first subexpression within all occurrences of whatever the + function `fubar-match' finds and matches in the value of + `fubar-face'. MATCH-ANCHORED should be of the form: (MATCHER PRE-MATCH-FORM POST-MATCH-FORM MATCH-HIGHLIGHT ...) -where MATCHER is a regexp to search for or the function name to call to make -the search, as for MATCH-HIGHLIGHT above, but with one exception; see below. -PRE-MATCH-FORM and POST-MATCH-FORM are evaluated before the first, and after -the last, instance MATCH-ANCHORED's MATCHER is used. Therefore they can be -used to initialize before, and cleanup after, MATCHER is used. Typically, -PRE-MATCH-FORM is used to move to some position relative to the original -MATCHER, before starting with MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might -be used to move back, before resuming with MATCH-ANCHORED's parent's MATCHER. - -For example, an element of the form highlights (if not already highlighted): - - (\"\\\\\\=\" (0 anchor-face) (\"\\\\\\=\" nil nil (0 item-face))) - - discrete occurrences of \"anchor\" in the value of `anchor-face', and subsequent - discrete occurrences of \"item\" (on the same line) in the value of `item-face'. - (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. Therefore \"item\" is - initially searched for starting from the end of the match of \"anchor\", and - searching for subsequent instances of \"anchor\" resumes from where searching - for \"item\" concluded.) - -The above-mentioned exception is as follows. The limit of the MATCHER search -defaults to the end of the line after PRE-MATCH-FORM is evaluated. -However, if PRE-MATCH-FORM returns a position greater than the position after -PRE-MATCH-FORM is evaluated, that position is used as the limit of the search. -It is generally a bad idea to return a position greater than the end of the -line, i.e., cause the MATCHER search to span lines. - -These regular expressions can match text which spans lines, although -it is better to avoid it if possible since updating them while editing -text is slower, and it is not guaranteed to be always correct when using -support modes like jit-lock or lazy-lock. - -This variable is set by major modes via the variable `font-lock-defaults'. -Be careful when composing regexps for this list; a poorly written pattern can -dramatically slow things down! - -A compiled keywords list starts with t. It is produced internally -by `font-lock-compile-keywords' from a user-level keywords list. -Its second element is the user-level keywords list that was -compiled. The remaining elements have the same form as -user-level keywords, but normally their values have been +where MATCHER is a regexp to search for or the function name to +call to make the search, as for MATCH-HIGHLIGHT above, but with +one exception; see below. PRE-MATCH-FORM and POST-MATCH-FORM are +evaluated before the first, and after the last, instance +MATCH-ANCHORED's MATCHER is used. Therefore they can be used to +initialize before, and cleanup after, MATCHER is used. +Typically, PRE-MATCH-FORM is used to move to some position +relative to the original MATCHER, before starting with +MATCH-ANCHORED's MATCHER. POST-MATCH-FORM might be used to move +back, before resuming with MATCH-ANCHORED's parent's MATCHER. + +For example, an element of the form highlights (if not already +highlighted): + + (\"\\\\\\=\" (0 anchor-face) + (\"\\\\\\=\" nil nil (0 item-face))) + + Discrete occurrences of \"anchor\" in the value of + `anchor-face', and subsequent discrete occurrences of + \"item\" (on the same line) in the value of `item-face'. + (Here PRE-MATCH-FORM and POST-MATCH-FORM are nil. Therefore + \"item\" is initially searched for starting from the end of the + match of \"anchor\", and searching for subsequent instances of + \"anchor\" resumes from where searching for \"item\" concluded.) + +The above-mentioned exception is as follows. The limit of the +MATCHER search defaults to the end of the line after +PRE-MATCH-FORM is evaluated. However, if PRE-MATCH-FORM returns +a position greater than the position after PRE-MATCH-FORM is +evaluated, that position is used as the limit of the search. It +is generally a bad idea to return a position greater than the end +of the line, i.e., cause the MATCHER search to span lines. + +These regular expressions can match text which spans lines, +although it is better to avoid it if possible since updating them +while editing text is slower, and it is not guaranteed to be +always correct when using support modes like jit-lock or +lazy-lock. + +This variable is set by major modes via the variable +`font-lock-defaults'. Be careful when composing regexps for this +list; a poorly written pattern can dramatically slow things down! + +A compiled keywords list starts with t. It is produced +internally by `font-lock-compile-keywords' from a user-level +keywords list. Its second element is the user-level keywords +list that was compiled. The remaining elements have the same +form as user-level keywords, but normally their values have been optimized.") (defvar font-lock-keywords-alist nil commit bc00dcf12983cd399127d0eea39647f29778eb02 Author: Lars Ingebrigtsen Date: Sat Apr 30 15:55:44 2016 +0200 Doc fix for font-lock-remove-keywords * lisp/font-lock.el (font-lock-remove-keywords): Add a link to `font-lock-add-keywords' to describe KEYWORDS (bug#18634). diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 471db6b..48a96f2 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -785,8 +785,11 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types', (defun font-lock-remove-keywords (mode keywords) "Remove highlighting KEYWORDS for MODE. -MODE should be a symbol, the major mode command name, such as `c-mode' -or nil. If nil, highlighting keywords are removed for the current buffer. +MODE should be a symbol, the major mode command name, such as +`c-mode' or nil. If nil, highlighting keywords are removed for +the current buffer. + +For a description of KEYWORDS, see `font-lock-add-keywords'. To make the removal apply to modes derived from MODE as well, pass nil for MODE and add the call to MODE-hook. This may fail commit d96c720d0cca7c9ffbb4c712ad315bb707d6625c Author: Lars Ingebrigtsen Date: Sat Apr 30 15:27:09 2016 +0200 Clarify whitespace-style doc string * lisp/whitespace.el (whitespace-style): Doc clarification (bug#18296). diff --git a/lisp/whitespace.el b/lisp/whitespace.el index 53bf363..af906ba 100644 --- a/lisp/whitespace.el +++ b/lisp/whitespace.el @@ -528,14 +528,14 @@ these values is: 2. space-before-tab::tab 3. space-before-tab::space -So, for example, if indentation and indentation::space are -included in `whitespace-style' list, the indentation value is -evaluated instead of indentation::space value. - -One reason for not visualize spaces via faces (if `face' is not -included in `whitespace-style') is to use exclusively for -cleaning up a buffer. See `whitespace-cleanup' and -`whitespace-cleanup-region' for documentation. +For example, if `indentation' and `indentation::space' are +included in `whitespace-style', the `indentation' value is used +instead of the `indentation::space' value. + +One reason to not use faces to visualize spaces (i.e., not +include `face' in `whitespace-style') is to use `whitespace-mode' +only for cleaning up a buffer. See `whitespace-cleanup' and +`whitespace-cleanup-region'. See also `whitespace-display-mappings' for documentation." :type '(set :tag "Kind of Blank"