commit 1007800a5994ac49b6bc9cd7528edb2d709d2031 (HEAD, refs/remotes/origin/master) Author: Stefan Kangas Date: Wed Aug 24 06:38:36 2022 +0200 Make mh-colors-available-p obsolete * lisp/mh-e/mh-utils.el (mh-colors-available-p): Redefine as obsolete function alias for 'display-color-p'. diff --git a/lisp/mh-e/mh-folder.el b/lisp/mh-e/mh-folder.el index 5b90290237..308660431a 100644 --- a/lisp/mh-e/mh-folder.el +++ b/lisp/mh-e/mh-folder.el @@ -583,7 +583,7 @@ perform the operation on all messages in that region. (make-local-variable 'desktop-save-buffer) (setq desktop-save-buffer t) (setq-local - mh-colors-available-flag (mh-colors-available-p) + mh-colors-available-flag (display-color-p) ; Do we have colors available mh-current-folder (buffer-name) ; Name of folder, a string mh-show-buffer (format "show-%s" (buffer-name)) ; Buffer that displays msgs diff --git a/lisp/mh-e/mh-utils.el b/lisp/mh-e/mh-utils.el index dd662f3552..b2c79350c4 100644 --- a/lisp/mh-e/mh-utils.el +++ b/lisp/mh-e/mh-utils.el @@ -59,13 +59,6 @@ used in lieu of `search' in the CL package." (point)) (set-syntax-table syntax-table)))) -;;;###mh-autoload -(defun mh-colors-available-p () - "Check if colors are available in the Emacs being used." - ;; FIXME: Can this be replaced with `display-color-p'? - (let ((color-cells (display-color-cells))) - (and (numberp color-cells) (>= color-cells 8)))) - ;;;###mh-autoload (defun mh-colors-in-use-p () "Check if colors are being used in the folder buffer." @@ -1005,6 +998,9 @@ If the current line is too long truncate a part of it as well." (goto-char (point-min)) (re-search-forward mh-signature-separator-regexp nil t))) +;;;###mh-autoload +(define-obsolete-function-alias 'mh-colors-available-p #'display-color-p "29.1") + (provide 'mh-utils) ;; Local Variables: commit 10a31c6a29ec08b76cd079470979e87704af3858 Author: Stefan Kangas Date: Wed Aug 24 06:06:39 2022 +0200 Prefer saying "init file" to ".emacs" in FAQ * doc/misc/efaq.texi: Prefer saying "init file" to ".emacs". (Bug#49424) diff --git a/doc/misc/efaq.texi b/doc/misc/efaq.texi index c29e4fe487..1361551602 100644 --- a/doc/misc/efaq.texi +++ b/doc/misc/efaq.texi @@ -698,7 +698,7 @@ You can create your own Info directory. You can tell Emacs where that Info directory is by adding its pathname to the value of the variable @code{Info-default-directory-list}. For example, to use a private Info directory which is a subdirectory of your home directory named @file{Info}, -you could put this in your @file{.emacs} file: +you could put this in your init file: @lisp (add-to-list 'Info-default-directory-list "~/Info/") @@ -1607,15 +1607,16 @@ is better to write ``Emacs and XEmacs.'' @end menu @node Setting up a customization file -@section How do I set up a @file{.emacs} file properly? +@section How do I set up an init file properly? @cindex @file{.emacs} file, setting up -@cindex @file{.emacs} file, locating +@cindex @file{.emacs.d/init.el} file, setting up @cindex Init file, setting up +@cindex Init file, locating @cindex Customization file, setting up @xref{Init File,,, emacs, The GNU Emacs Manual}. -In general, new Emacs users should not be provided with @file{.emacs} +In general, new Emacs users should not be provided with init files, because this can cause confusing non-standard behavior. Then they send questions to @url{https://lists.gnu.org/mailman/listinfo/help-gnu-emacs, @@ -1624,18 +1625,18 @@ isn't behaving as documented. Emacs includes the Customize facility (@pxref{Using Customize}). This allows users who are unfamiliar with Emacs Lisp to modify their -@file{.emacs} files in a relatively straightforward way, using menus +init files in a relatively straightforward way, using menus rather than Lisp code. While Customize might indeed make it easier to configure Emacs, consider taking a bit of time to learn Emacs Lisp and modifying your -@file{.emacs} directly. Simple configuration options are described +init file directly. Simple configuration options are described rather completely in @ref{Init File,,, emacs, The GNU Emacs Manual}, for users interested in performing frequently requested, basic tasks. -Sometimes users are unsure as to where their @file{.emacs} file should -be found. Visiting the file as @file{~/.emacs} from Emacs will find -the correct file. +Sometimes users are unsure as to where their init file is found. +Visiting the file as @file{~/.emacs.el}, @file{~/.emacs}, or +@file{~/.emacs.d/init.el} from Emacs will find the correct file. @node Using Customize @section How do I start using Customize? @@ -1743,21 +1744,22 @@ always use custom terminal definition with @samp{setb24} and @samp{setf24}. @node Debugging a customization file -@section How do I debug a @file{.emacs} file? -@cindex Debugging @file{.emacs} file -@cindex @file{.emacs} debugging +@section How do I debug an init file? +@cindex Debugging @file{.emacs.d/init.el} file +@cindex Debugging init file +@cindex @file{.emacs.d/init.el} debugging @cindex Init file debugging @cindex @samp{-debug-init} option Start Emacs with the @samp{-debug-init} command-line option. This -enables the Emacs Lisp debugger before evaluating your @file{.emacs} +enables the Emacs Lisp debugger before evaluating your init file, and places you in the debugger if something goes wrong. The top line in the @file{trace-back} buffer will be the error message, and the second or third line of that buffer will display the Lisp code from your -@file{.emacs} file that caused the problem. +init file that caused the problem. You can also evaluate an individual function or argument to a function -in your @file{.emacs} file by moving the cursor to the end of the +in your init file by moving the cursor to the end of the function or argument and typing @kbd{C-x C-e} (@kbd{M-x eval-last-sexp}). @@ -1787,7 +1789,7 @@ You can similarly display the current column with @end lisp @noindent -in your @file{.emacs} file. This feature is off by default. +in your init file. This feature is off by default. The @code{"%c"} format specifier in the variable @code{mode-line-format} will insert the current column's value into the mode line. See the @@ -1834,7 +1836,7 @@ machine at which Emacs was invoked. This is done by setting To modify the behavior such that frame titlebars contain the buffer's name regardless of the number of existing frames, include the following -in your @file{.emacs}: +in your init file: @lisp (setq frame-title-format "%b") @@ -1846,7 +1848,7 @@ in your @file{.emacs}: Abbrev mode expands abbreviations as you type them. To turn it on in a specific buffer, use @kbd{M-x abbrev-mode}. To turn it on in every -buffer by default, put this in your @file{.emacs} file: +buffer by default, put this in your init file: @lisp (setq-default abbrev-mode t) @@ -1896,7 +1898,7 @@ the script. Use @kbd{C-h v} (or @kbd{M-x describe-variable}) on @cindex Highlighting and replacing text Use @code{delete-selection-mode}, which you can start automatically by -placing the following Lisp form in your @file{.emacs} file: +placing the following Lisp form in your init file: @lisp (delete-selection-mode 1) @@ -2036,7 +2038,7 @@ auto-fill-mode}. To turn it on for every buffer in a certain mode, you must use the hook for that mode. For example, to turn on @code{auto-fill} mode for all -text buffers, including the following in your @file{.emacs} file: +text buffers, including the following in your init file: @lisp (add-hook 'text-mode-hook 'turn-on-auto-fill) @@ -2091,7 +2093,7 @@ option: emacs -f server-start @end example -or by invoking @code{server-start} from @file{.emacs}: +or by invoking @code{server-start} from init file: @lisp (if (@var{some conditions are met}) (server-start)) @@ -2162,7 +2164,7 @@ f() @} @end example -@noindent To achieve this, add the following line to your @file{.emacs}: +@noindent To achieve this, add the following line to your init file: @lisp (c-set-offset 'case-label '+) @@ -2213,7 +2215,7 @@ the line or the block according to what you just specified. @item If you don't like the result, go back to step 1. Otherwise, add the -following line to your @file{.emacs}: +following line to your init file: @lisp (c-set-offset '@var{syntactic-symbol} @var{offset}) @@ -2243,7 +2245,7 @@ customizations inside a C mode hook, like this: @noindent Using @code{c-mode-hook} avoids the need to put a @w{@code{(require -'cc-mode)}} into your @file{.emacs} file, because @code{c-set-offset} +'cc-mode)}} into your init file, because @code{c-set-offset} might be unavailable when @code{cc-mode} is not loaded. Note that @code{c-mode-hook} runs for C source files only; use @@ -2355,7 +2357,7 @@ new paragraph. There are many packages available to deal with this @cindex Pairs of parentheses, highlighting @cindex Matching parentheses -Call @code{show-paren-mode} in your @file{.emacs} file: +Call @code{show-paren-mode} in your init file: @lisp (show-paren-mode 1) @@ -2460,8 +2462,9 @@ Emacs Lisp @dfn{form}: @item If you want it evaluated every time you run Emacs, put it in a file -named @file{.emacs} in your home directory. This is known as ``your -@file{.emacs} file,'' and contains all of your personal customizations. +named @file{.emacs.d/init.el} in your home directory. This is known +as ``your init file,'' and contains all of your personal +customizations. @item You can type the form in the @file{*scratch*} buffer, and then type @@ -2499,7 +2502,7 @@ about them. Set the default value of the variable @code{tab-width}. For example, to set @key{TAB} stops every 10 characters, insert the following in your -@file{.emacs} file: +init file: @lisp (setq-default tab-width 10) @@ -2642,7 +2645,7 @@ You probably don't want to do this, since backups are useful, especially when something goes wrong. To avoid seeing backup files (and other ``uninteresting'' files) in Dired, -load @code{dired-x} by adding the following to your @file{.emacs} file: +load @code{dired-x} by adding the following to your init file: @lisp (with-eval-after-load 'dired @@ -2651,7 +2654,7 @@ load @code{dired-x} by adding the following to your @file{.emacs} file: With @code{dired-x} loaded, @kbd{C-x M-o} toggles omitting in each dired buffer. You can make omitting the default for new dired buffers by putting the -following in your @file{.emacs}: +following in your init file: @lisp (add-hook 'dired-mode-hook 'dired-omit-mode) @@ -2905,7 +2908,7 @@ Different levels of decoration are available, from slight to gaudy. More decoration means you need to wait more time for a buffer to be fontified (or a faster machine). To control how decorated your buffers should become, set the value of -@code{font-lock-maximum-decoration} in your @file{.emacs} file, with a +@code{font-lock-maximum-decoration} in your init file, with a @code{nil} value indicating default (usually minimum) decoration, and a @code{t} value indicating the maximum decoration. For the gaudiest possible look, then, include the line @@ -2915,7 +2918,7 @@ possible look, then, include the line @end lisp @noindent -in your @file{.emacs} file. You can also set this variable such that +in your init file. You can also set this variable such that different modes are highlighted in a different ways; for more information, see the documentation for @code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x @@ -2942,7 +2945,7 @@ customize-variable @key{RET} scroll-conservatively @key{RET}} and set it to a large value like, say, 10000. For an explanation of what this means, @pxref{Auto Scrolling,,, emacs, The GNU Emacs Manual}. -Alternatively, use the following Lisp form in your @file{.emacs}: +Alternatively, use the following Lisp form in your init file: @lisp (setq scroll-conservatively most-positive-fixnum) @@ -2971,7 +2974,7 @@ default, a backslash (@samp{\}) will appear in the mode line. @cindex Single space following periods @cindex Periods, one space following -Add the following line to your @file{.emacs} file: +Add the following line to your init file: @lisp (setq sentence-end-double-space nil) @@ -2993,15 +2996,14 @@ escape sequences. It is enabled by default. @cindex Fullscreen mode Beginning with Emacs 24.4 either run Emacs with the @samp{--maximized} -command-line option or put the following form in your @file{.emacs} -file: +command-line option or put the following form in your init file: @lisp (add-hook 'emacs-startup-hook 'toggle-frame-maximized) @end lisp With older versions use the function @code{w32-send-sys-command}. For -example, you can put the following in your @file{.emacs} file: +example, you can put the following in your init file: @lisp (add-hook 'emacs-startup-hook @@ -3126,8 +3128,7 @@ with the following Lisp form, The above solutions try to prevent the shell from producing the @samp{^M} characters in the first place. If this is not possible (e.g., if you use a Windows shell), you can get Emacs to remove these -characters from the buffer by adding this to your @file{.emacs} init -file: +characters from the buffer by adding this to your init file: @smalllisp (add-hook 'comint-output-filter-functions #'comint-strip-ctrl-m) @@ -3149,7 +3150,7 @@ stty -icrnl -onlcr -echo susp ^Z @cindex @code{explicit-shell-file-name} This might happen because Emacs tries to look for the shell in a wrong place. If you know where your shell executable is, set the variable -@code{explicit-shell-file-name} in your @file{.emacs} file to point to +@code{explicit-shell-file-name} in your init file to point to its full file name. @cindex Antivirus programs, and Shell Mode @@ -3192,18 +3193,18 @@ if ("$term" == emacs) set term=dumb @node Errors with init files @section Why does Emacs say @samp{Error in init file}? -@cindex Error in @file{.emacs} +@cindex Error in @file{.emacs.d/init.el} @cindex Error in init file @cindex Init file, errors in -@cindex @file{.emacs} file, errors in -@cindex Debugging @file{.emacs} file +@cindex @file{.emacs.d/init.el} file, errors in +@cindex Debugging init file -An error occurred while loading either your @file{.emacs} file or the +An error occurred while loading either your init file or the system-wide file @file{site-lisp/default.el}. Emacs pops the @file{*Messages*} buffer, and puts there some additional information about the error, to provide some hints for debugging. -For information on how to debug your @file{.emacs} file, see +For information on how to debug your init file, see @ref{Debugging a customization file}. It may be the case that you need to load some package first, or use a @@ -3717,7 +3718,7 @@ information is available from @cindex Commands, binding keys to Keys can be bound to commands either interactively or in your -@file{.emacs} file. To interactively bind keys for all modes, type +init file. To interactively bind keys for all modes, type @kbd{M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET}}. To bind a key just in the current major mode, type @kbd{M-x @@ -3729,7 +3730,7 @@ To make the process of binding keys interactively easier, use the following ``trick'': First bind the key interactively, then immediately type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed to bind the key is in the kill ring, and can be yanked into your -@file{.emacs} file. If the key binding is global, no changes to the +init file. If the key binding is global, no changes to the command are required. For example, @lisp @@ -3737,7 +3738,7 @@ command are required. For example, @end lisp @noindent -can be placed directly into the @file{.emacs} file. If the key binding is +can be placed directly into the init file. If the key binding is local, the command is used in conjunction with the @samp{add-hook} function. For example, in TeX mode, a local binding might be @@ -3797,11 +3798,11 @@ of these forms before attempting to bind the key sequence: @end lisp @node Terminal setup code works after Emacs has begun -@section Why doesn't this [terminal or window-system setup] code work in my @file{.emacs} file, but it works just fine after Emacs starts up? -@cindex Terminal setup code in @file{.emacs} +@section Why doesn't this [terminal or window-system setup] code work in my init file, but it works just fine after Emacs starts up? +@cindex Terminal setup code in init file During startup, Emacs initializes itself according to a given code/file -order. If some of the code executed in your @file{.emacs} file needs to +order. If some of the code executed in your init file needs to be postponed until the initial terminal or window-system setup code has been executed but is not, then you will experience this problem (this code/file execution order is not enforced after startup). @@ -4254,7 +4255,7 @@ arrange for these two commands to run whenever you log in, e.g., by adding them to your window-system startup file, such as @file{~/.xsessionrc} or @file{~/.gnomerc}. -Now, add the following line to your @file{~/.emacs} init file: +Now, add the following line to your init file: @lisp (add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf") @@ -4264,15 +4265,15 @@ Now, add the following line to your @file{~/.emacs} init file: (Again, modify the file name if you installed the fonts elsewhere.) Finally, if you wish to use the installed fonts with @code{ps-print}, -add the following line to your @file{~/.emacs}: +add the following line to your init file: @lisp (setq ps-multibyte-buffer 'bdf-font-except-latin) @end lisp -You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium} -fontset, or you can select it by setting the default font in your -@file{~/.emacs}: +You can now use the Emacs font menu to select the @samp{bdf: 16-dot +medium} fontset, or you can select it by setting the default font in +your init file: @lisp (set-frame-font "fontset-bdf") @@ -4334,9 +4335,8 @@ yourself by putting @end lisp @noindent -in your @file{.emacs} file. You can automatically include an @samp{FCC} -field by putting something like the following in your @file{.emacs} -file: +in your init file. You can automatically include an @samp{FCC} field +by putting something like the following in your init file: @lisp (setq mail-archive-file-name (expand-file-name "~/outgoing")) @@ -4467,7 +4467,7 @@ gnus @end example It is probably unwise to automatically start your mail or news reader -from your @file{.emacs} file. This would cause problems if you needed to run +from your init file. This would cause problems if you needed to run two copies of Emacs at the same time. Also, this would make it difficult for you to start Emacs quickly when you needed to. commit 2d307a0205db126ad51fc8b600121849c1af1fa9 Author: Stefan Kangas Date: Wed Aug 24 05:26:18 2022 +0200 ; Sort list of generalized variables * doc/lispref/variables.texi (Setting Generalized Variables): Sort list of generalized variables alphabetically. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index aa30834805..9d45c6c52e 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2679,21 +2679,21 @@ cdar nthcdr A call to any of the following Emacs-specific functions: @smallexample -alist-get overlay-get -face-background overlay-start -face-font overlay-end -face-foreground process-buffer -face-stipple process-filter -face-underline-p process-get -file-modes process-sentinel +alist-get overlay-end +default-value overlay-start +face-background overlay-get +face-font process-buffer +face-foreground process-filter +face-stipple process-get +face-underline-p process-sentinel +file-modes terminal-parameter frame-parameter window-buffer -frame-parameters window-display-table -frame-width window-dedicated-p +frame-parameters window-dedicated-p +frame-width window-display-table get-register window-hscroll getenv window-parameter -terminal-parameter window-point -keymap-parent window-start -match-data default-value +keymap-parent window-point +match-data window-start @end smallexample @item commit 67a15ce1564ce35ece24a19f00e03a36e0575746 Author: Stefan Kangas Date: Tue Oct 5 19:52:23 2021 +0200 Use substitute-command-keys in a few more places * lisp/indent.el (edit-tab-stops): * lisp/printing.el (pr-help-message, pr-show-setup): * lisp/progmodes/cperl-mode.el (cperl-narrow-to-here-doc): Use substitute-command-keys. diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index f11d9741ec..127f6340a1 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -1447,7 +1447,8 @@ Redefine the corresponding command." (let ((calc-kbd-push-level 0)) (execute-kbd-macro (substring body 0 -2)))) (let ((calc-kbd-push-level (1+ calc-kbd-push-level))) - (message "%s" "Saving modes; type Z' to restore") + ;; Avoid substituting the "'" character: + (message "%s" "Saving modes; type Z' to restore") (recursive-edit)))))) (defun calc-kbd-pop () diff --git a/lisp/indent.el b/lisp/indent.el index f52b729051..b0c1a021da 100644 --- a/lisp/indent.el +++ b/lisp/indent.el @@ -734,7 +734,9 @@ You can add or remove colons and then do \\\\[edit-tab-stops (while (> count 0) (insert "0123456789") (setq count (1- count)))) - (insert "\nTo install changes, type C-c C-c") + (insert (substitute-command-keys + (concat "\nTo install changes, type \\" + "\\[edit-tab-stops-note-changes]"))) (goto-char (point-min))) (defun edit-tab-stops-note-changes () diff --git a/lisp/printing.el b/lisp/printing.el index 534b45c772..d10de24e03 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -3040,7 +3040,7 @@ A. Interface: I. PostScript printing: - 1. You can generate a PostScript file (if you type C-u before activating + 1. You can generate a PostScript file (if you type \\[universal-argument] before activating menu) or PostScript temporary file for a directory, a buffer, a region or a major mode, choosing 1-up, 2-up, 4-up or any other n-up printing; after file generation, ghostview is activated using the file generated @@ -3080,7 +3080,7 @@ I. PostScript printing: `pr-ps-utility-alist'. 2. Operate the same way as option 1, but it sends directly the PostScript - code (or put in a file, if you've typed C-u) or it uses ghostscript to + code (or put in a file, if you've typed \\[universal-argument]) or it uses ghostscript to print the PostScript file generated. It depends on option 18, if it's turned on, it uses ghostscript; otherwise, it sends directly to printer. If spooling is on (option 16), the PostScript code is saved @@ -3089,7 +3089,7 @@ I. PostScript printing: Instead of printing each buffer, region or major mode at once, you can save temporarily the PostScript code generated in a buffer and print it later. The option `Despool...' despools the PostScript spooling buffer - directly on a printer. If you type C-u before choosing this option, + directly on a printer. If you type \\[universal-argument] before choosing this option, the PostScript code generated is saved in a file instead of sending it to the printer. To spool the PostScript code generated you need to turn on option 16. This option is enabled if spooling is on (option 16). @@ -4183,7 +4183,8 @@ bottom." (defun pr-help (&rest _ignore) "Help for the printing package." (interactive) - (pr-show-setup pr-help-message "*Printing Help*")) + (pr-show-setup (substitute-command-keys pr-help-message) + "*Printing Help*")) ;;;###autoload @@ -5036,7 +5037,8 @@ If menu binding was not done, calls `pr-menu-bind'." (defun pr-show-setup (settings buffer-name) (with-output-to-temp-buffer buffer-name - (princ settings) + (with-current-buffer buffer-name + (insert settings)) (help-print-return-message))) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index ba0adcc913..a3995e2969 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -8535,8 +8535,8 @@ POS defaults to the point." (let ((p (cperl-get-here-doc-region pos))) (or p (error "Not inside a HERE document")) (narrow-to-region (car p) (cdr p)) - (message - "When you are finished with narrow editing, type C-x n w"))) + (message (substitute-command-keys + "When you are finished with narrow editing, type \\[widen]")))) (defun cperl-select-this-pod-or-here-doc (&optional pos) "Select the HERE-DOC (or POD section) at POS. commit 42496e64707905531c88dfdbab4c65c6a3c53707 Author: Stefan Kangas Date: Tue Aug 23 20:27:56 2022 +0200 Move generalized variable `substring' doc to elisp manual * doc/misc/cl.texi (Setf Extensions): Move documentation on 'substring' generalized variable from here... * doc/lispref/variables.texi (Setting Generalized Variables): ...to here. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index b7b4f56212..aa30834805 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2695,6 +2695,30 @@ terminal-parameter window-point keymap-parent window-start match-data default-value @end smallexample + +@item +A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, +where @var{subplace} is itself a valid generalized variable whose +current value is a string, and where the value stored is also a +string. The new string is spliced into the specified part of the +destination string. For example: + +@example +(setq a (list "hello" "world")) + @result{} ("hello" "world") +(cadr a) + @result{} "world" +(substring (cadr a) 2 4) + @result{} "rl" +(setf (substring (cadr a) 2 4) "o") + @result{} "o" +(cadr a) + @result{} "wood" +a + @result{} ("hello" "wood") +@end example + +@c FIXME? Also 'eq'? (see gv.el) @end itemize @noindent diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index be286bbabc..a6747b1096 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -920,30 +920,6 @@ cl-caaar@dots{}cl-cddddr cl-first@dots{}cl-tenth Note that for @code{cl-getf} (as for @code{nthcdr}), the list argument of the function must itself be a valid @var{place} form. -@item -A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, -where @var{subplace} is itself a valid generalized variable whose -current value is a string, and where the value stored is also a -string. The new string is spliced into the specified part of the -destination string. For example: - -@example -(setq a (list "hello" "world")) - @result{} ("hello" "world") -(cadr a) - @result{} "world" -(substring (cadr a) 2 4) - @result{} "rl" -(setf (substring (cadr a) 2 4) "o") - @result{} "o" -(cadr a) - @result{} "wood" -a - @result{} ("hello" "wood") -@end example - -@c FIXME? Also 'eq'? (see cl-lib.el) - @c Currently commented out in cl.el. @ignore @item commit 83b6da31f3cc0ea5bdcd8332596f5f42e4a6296b Author: Stefan Kangas Date: Tue Aug 23 20:15:49 2022 +0200 Move generalized variable docs to elisp manual * doc/misc/cl.texi (Setf Extensions): Delete documentation on obsolete generalized variable 'buffer-substring'. Move documentation on generalized variables from here... * doc/lispref/variables.texi (Setting Generalized Variables): ...to here. These variables have already been moved to gv.el. diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index ed119a709c..b7b4f56212 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi @@ -2679,16 +2679,21 @@ cdar nthcdr A call to any of the following Emacs-specific functions: @smallexample -alist-get process-get -frame-parameter process-sentinel -terminal-parameter window-buffer -keymap-parent window-display-table -match-data window-dedicated-p -overlay-get window-hscroll -overlay-start window-parameter -overlay-end window-point -process-buffer window-start -process-filter default-value +alist-get overlay-get +face-background overlay-start +face-font overlay-end +face-foreground process-buffer +face-stipple process-filter +face-underline-p process-get +file-modes process-sentinel +frame-parameter window-buffer +frame-parameters window-display-table +frame-width window-dedicated-p +get-register window-hscroll +getenv window-parameter +terminal-parameter window-point +keymap-parent window-start +match-data default-value @end smallexample @end itemize diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 847f5a35f9..be286bbabc 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -920,21 +920,6 @@ cl-caaar@dots{}cl-cddddr cl-first@dots{}cl-tenth Note that for @code{cl-getf} (as for @code{nthcdr}), the list argument of the function must itself be a valid @var{place} form. -@item -General Emacs Lisp functions: -@example -current-case-table file-modes -face-background getenv -face-font frame-parameters -face-foreground frame-width -face-stipple get-register -face-underline-p x-get-selection -@end example - -Most of these have directly corresponding ``set'' functions, like -@code{set-face-foreground} for @code{face-foreground}, or -@code{set-case-table} for @code{current-case-table}. - @item A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, where @var{subplace} is itself a valid generalized variable whose @@ -957,9 +942,6 @@ a @result{} ("hello" "wood") @end example -The generalized variable @code{buffer-substring}, listed above, -also works in this way by replacing a portion of the current buffer. - @c FIXME? Also 'eq'? (see cl-lib.el) @c Currently commented out in cl.el. commit b48bf42fc208281ba549f28d7a26d44713b34863 Author: Eli Zaretskii Date: Tue Aug 23 19:30:18 2022 +0300 ; * src/buffer.h (struct buffer_text): Improve commentary. diff --git a/src/buffer.h b/src/buffer.h index 77f9ea20af..cbdbae798b 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -274,7 +274,9 @@ struct buffer_text end_unchanged contain no useful information. */ modiff_count overlay_unchanged_modified; - /* CHARS_MODIFF as of last redisplay that finished. */ + /* CHARS_MODIFF as of last redisplay that finished. It's used + when we only care about changes in actual buffer text, not in + any other kind of changes, like properties etc. */ modiff_count chars_unchanged_modified; /* Properties of this buffer's text. */ commit 10585c4f30abba0b63f9b8eb4971e814ce910140 Author: Stefan Kangas Date: Tue Aug 23 18:16:01 2022 +0200 Update documentation for obsolete generalized variables * doc/misc/cl.texi (Setf Extensions): Delete obsolete generalized variables from list. * etc/NEWS: Fix sorting of obsolete generalized variables. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index b2f43ad051..847f5a35f9 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -923,38 +923,17 @@ of the function must itself be a valid @var{place} form. @item General Emacs Lisp functions: @example -buffer-file-name getenv -buffer-modified-p global-key-binding -buffer-name local-key-binding -buffer-string mark -buffer-substring mark-marker -current-buffer marker-position -current-case-table mouse-position -current-column point -current-global-map point-marker -current-input-mode point-max -current-local-map point-min -current-window-configuration read-mouse-position -default-file-modes screen-height -documentation-property screen-width -face-background selected-window -face-font selected-screen -face-foreground selected-frame -face-stipple standard-case-table -face-underline-p syntax-table -file-modes visited-file-modtime -frame-height window-height -frame-parameters window-width -frame-visible-p x-get-secondary-selection -frame-width x-get-selection -get-register +current-case-table file-modes +face-background getenv +face-font frame-parameters +face-foreground frame-width +face-stipple get-register +face-underline-p x-get-selection @end example Most of these have directly corresponding ``set'' functions, like -@code{use-local-map} for @code{current-local-map}, or @code{goto-char} -for @code{point}. A few, like @code{point-min}, expand to longer -sequences of code when they are used with @code{setf} -(@code{(narrow-to-region x (point-max))} in this case). +@code{set-face-foreground} for @code{face-foreground}, or +@code{set-case-table} for @code{current-case-table}. @item A call of the form @code{(substring @var{subplace} @var{n} [@var{m}])}, diff --git a/etc/NEWS b/etc/NEWS index a5b5e9053d..44ee9b8fc7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2581,7 +2581,7 @@ abbrevlist.el, assoc.el, complete.el, cust-print.el, erc-hecomplete.el, mailpost.el, mouse-sel.el, old-emacs-lock.el, patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el. ---- ++++ ** Many seldom-used generalized variables have been made obsolete. Emacs has a number of rather obscure generalized variables defined, that, for instance, allowed you to say things like: @@ -2594,7 +2594,7 @@ for instance, is the same as saying (narrow-to-region 4 (point-max)) The following generalized variables have been made obsolete: -'buffer-local-value', 'visited-file-name', 'buffer-modified-p', +'buffer-file-name', 'buffer-local-value', 'buffer-modified-p', 'buffer-name', 'buffer-string', 'buffer-substring', 'current-buffer', 'current-column', 'current-global-map', 'current-input-mode', 'current-local-map', 'current-window-configuration', @@ -2602,9 +2602,9 @@ The following generalized variables have been made obsolete: 'frame-visible-p', 'global-key-binding', 'local-key-binding', 'mark', 'mark-marker', 'marker-position', 'mouse-position', 'point', 'point-marker', 'point-max', 'point-min', 'read-mouse-position', -'screen-height', 'screen-width', 'selected-window', 'selected-screen', -'selected-frame', 'standard-case-table', 'syntax-table', -'visited-file-modtime', 'window-height', 'window-width' and +'screen-height', 'screen-width', 'selected-frame', 'selected-screen', +'selected-window', 'standard-case-table', 'syntax-table', +'visited-file-modtime', 'window-height', 'window-width', and 'x-get-secondary-selection'. commit 1c837c42c22181e5fe998c7ea1c6e12c4e711872 Author: Gregory Heytings Date: Tue Aug 23 15:41:05 2022 +0000 Improve detection of long lines. * src/buffer.h (struct buffer_text): New field. (BUF_CHARS_UNCHANGED_MODIFIED, CHARS_UNCHANGED_MODIFIED): New macros. * src/buffer.c (Fget_buffer_create): Initialize the new field. * src/xdisp.c (mark_window_display_accurate_1): Set the new field. (redisplay_window): Use it, together with CHARS_MODIFF, instead of MODIFF and UNCHANGED_MODIFIED to decide whether to check for long lines. * src/pdumper.c (dump_buffer): Dump the new field. diff --git a/src/buffer.c b/src/buffer.c index 4fd5b2be3e..d4a0c37bed 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -597,6 +597,7 @@ even if it is dead. The return value is never nil. */) set_buffer_intervals (b, NULL); BUF_UNCHANGED_MODIFIED (b) = 1; BUF_OVERLAY_UNCHANGED_MODIFIED (b) = 1; + BUF_CHARS_UNCHANGED_MODIFIED (b) = 1; BUF_END_UNCHANGED (b) = 0; BUF_BEG_UNCHANGED (b) = 0; *(BUF_GPT_ADDR (b)) = *(BUF_Z_ADDR (b)) = 0; /* Put an anchor '\0'. */ diff --git a/src/buffer.h b/src/buffer.h index 47b4bdf749..77f9ea20af 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -149,12 +149,18 @@ enum { BEG = 1, BEG_BYTE = BEG }; #define BUF_BEG_UNCHANGED(buf) ((buf)->text->beg_unchanged) #define BUF_END_UNCHANGED(buf) ((buf)->text->end_unchanged) +#define BUF_CHARS_UNCHANGED_MODIFIED(buf) \ + ((buf)->text->chars_unchanged_modified) + #define UNCHANGED_MODIFIED \ BUF_UNCHANGED_MODIFIED (current_buffer) #define OVERLAY_UNCHANGED_MODIFIED \ BUF_OVERLAY_UNCHANGED_MODIFIED (current_buffer) #define BEG_UNCHANGED BUF_BEG_UNCHANGED (current_buffer) #define END_UNCHANGED BUF_END_UNCHANGED (current_buffer) + +#define CHARS_UNCHANGED_MODIFIED \ + BUF_CHARS_UNCHANGED_MODIFIED (current_buffer) /* Functions to set PT in the current buffer, or another buffer. */ @@ -268,6 +274,9 @@ struct buffer_text end_unchanged contain no useful information. */ modiff_count overlay_unchanged_modified; + /* CHARS_MODIFF as of last redisplay that finished. */ + modiff_count chars_unchanged_modified; + /* Properties of this buffer's text. */ INTERVAL intervals; diff --git a/src/pdumper.c b/src/pdumper.c index 11cbc7d0ae..903298f17d 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -2764,6 +2764,7 @@ dump_buffer (struct dump_context *ctx, const struct buffer *in_buffer) DUMP_FIELD_COPY (out, buffer, own_text.end_unchanged); DUMP_FIELD_COPY (out, buffer, own_text.unchanged_modified); DUMP_FIELD_COPY (out, buffer, own_text.overlay_unchanged_modified); + DUMP_FIELD_COPY (out, buffer, own_text.chars_unchanged_modified); if (buffer->own_text.intervals) dump_field_fixup_later (ctx, out, buffer, &buffer->own_text.intervals); dump_field_lv_rawptr (ctx, out, buffer, &buffer->own_text.markers, diff --git a/src/xdisp.c b/src/xdisp.c index 03c43be5bc..86a119c0f6 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17323,6 +17323,7 @@ mark_window_display_accurate_1 (struct window *w, bool accurate_p) BUF_UNCHANGED_MODIFIED (b) = BUF_MODIFF (b); BUF_OVERLAY_UNCHANGED_MODIFIED (b) = BUF_OVERLAY_MODIFF (b); + BUF_CHARS_UNCHANGED_MODIFIED (b) = BUF_CHARS_MODIFF (b); BUF_BEG_UNCHANGED (b) = BUF_GPT (b) - BUF_BEG (b); BUF_END_UNCHANGED (b) = BUF_Z (b) - BUF_GPT (b); @@ -19585,7 +19586,7 @@ redisplay_window (Lisp_Object window, bool just_this_one_p) /* Check whether the buffer to be displayed contains long lines. */ if (!NILP (Vlong_line_threshold) && !current_buffer->long_line_optimizations_p - && MODIFF - UNCHANGED_MODIFIED > 8) + && CHARS_MODIFF - CHARS_UNCHANGED_MODIFIED > 8) { ptrdiff_t cur, next, found, max = 0, threshold; threshold = XFIXNUM (Vlong_line_threshold); commit 5d3a99602f15372b305d04c6a732e5c69bbe0c5d Author: Stefan Kangas Date: Tue Aug 23 17:41:47 2022 +0200 ; * etc/NEWS: Remove redundant headlines. This is all about the new Haiku support, so it can be under the same headline. diff --git a/etc/NEWS b/etc/NEWS index 5cf3ea53f7..a5b5e9053d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -39,16 +39,12 @@ C++ compiler to be present on your system. If Emacs is not built with the option '--with-be-app', the resulting Emacs will only run in text-mode terminals. -+++ -** Cairo drawing support has been enabled for Haiku builds. To enable Cairo support, ensure that the Cairo and FreeType development files are present on your system, and configure Emacs with '--with-be-cairo'. ---- -** Double buffering is now enabled on the Haiku operating system. Unlike X, there is no compile-time option to enable or disable -double-buffering. If you wish to disable double-buffering, change the +double-buffering; it is always enabled. To disable it, change the frame parameter 'inhibit-double-buffering' instead. --- commit de3efaa683804cf60ea86cf119e57c226c949447 Author: Lars Ingebrigtsen Date: Tue Aug 23 17:04:43 2022 +0200 Add NEWS entry about obsoleted generalized variables diff --git a/etc/NEWS b/etc/NEWS index 2f68472163..5cf3ea53f7 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2585,6 +2585,32 @@ abbrevlist.el, assoc.el, complete.el, cust-print.el, erc-hecomplete.el, mailpost.el, mouse-sel.el, old-emacs-lock.el, patcomp.el, pc-mode.el, pc-select.el, s-region.el, and sregex.el. +--- +** Many seldom-used generalized variables have been made obsolete. +Emacs has a number of rather obscure generalized variables defined, +that, for instance, allowed you to say things like: + + (setf (point-min) 4) + +These never caught on and have been made obsolete. The form above, +for instance, is the same as saying + + (narrow-to-region 4 (point-max)) + +The following generalized variables have been made obsolete: +'buffer-local-value', 'visited-file-name', 'buffer-modified-p', +'buffer-name', 'buffer-string', 'buffer-substring', 'current-buffer', +'current-column', 'current-global-map', 'current-input-mode', +'current-local-map', 'current-window-configuration', +'default-file-modes', 'documentation-property', 'frame-height', +'frame-visible-p', 'global-key-binding', 'local-key-binding', 'mark', +'mark-marker', 'marker-position', 'mouse-position', 'point', +'point-marker', 'point-max', 'point-min', 'read-mouse-position', +'screen-height', 'screen-width', 'selected-window', 'selected-screen', +'selected-frame', 'standard-case-table', 'syntax-table', +'visited-file-modtime', 'window-height', 'window-width' and +'x-get-secondary-selection'. + * Lisp Changes in Emacs 29.1 diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index abb20b8434..770cdb3d4f 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -764,7 +764,8 @@ REF must have been previously obtained with `gv-ref'." (make-obsolete-generalized-variable 'selected-frame 'select-frame "29.1") (gv-define-simple-setter standard-case-table set-standard-case-table) -(make-obsolete-generalized-variable 'standard-case-table 'set-standard-case-table "29.1") +(make-obsolete-generalized-variable + 'standard-case-table 'set-standard-case-table "29.1") (gv-define-simple-setter syntax-table set-syntax-table) (make-obsolete-generalized-variable 'syntax-table 'set-syntax-table "29.1") commit 8673c0e256c3bf75b20a3a7a221b9240e7dc874a Author: Stefan Kangas Date: Tue Aug 23 16:34:01 2022 +0200 Make XEmacs compat alias face-background-pixmap obsolete * lisp/faces.el (face-background-pixmap) (set-face-background-pixmap): Make XEmacs compat aliases obsolete in favor of 'face-stipple' and 'set-face-stipple'. Update callers. * lisp/emacs-lisp/gv.el (face-background-pixmap): Make XEmacs alias obsolete as a generalized variable. (face-stipple): New generalized variable. * doc/misc/cl.texi (Setf Extensions): Refer to above new generalized variable instead of the obsolete one. diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index a7548bb1f8..b2f43ad051 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -938,9 +938,9 @@ current-window-configuration read-mouse-position default-file-modes screen-height documentation-property screen-width face-background selected-window -face-background-pixmap selected-screen -face-font selected-frame -face-foreground standard-case-table +face-font selected-screen +face-foreground selected-frame +face-stipple standard-case-table face-underline-p syntax-table file-modes visited-file-modtime frame-height window-height diff --git a/lisp/emacs-lisp/chart.el b/lisp/emacs-lisp/chart.el index 6d1821504c..9ff893b75b 100644 --- a/lisp/emacs-lisp/chart.el +++ b/lisp/emacs-lisp/chart.el @@ -112,7 +112,7 @@ too much in text characters anyways.") (set-face-foreground nf "black") (if (and chart-face-use-pixmaps pl) (condition-case nil - (set-face-background-pixmap nf (car pl)) + (set-face-stipple nf (car pl)) (error (message "Cannot set background pixmap %s" (car pl))))) (push nf faces) (setq cl (cdr cl) diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 6ed3b7f85a..abb20b8434 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -685,7 +685,10 @@ REF must have been previously obtained with `gv-ref'." (gv-define-setter face-background (x f &optional s) `(set-face-background ,f ,x ,s)) (gv-define-setter face-background-pixmap (x f &optional s) - `(set-face-background-pixmap ,f ,x ,s)) + `(set-face-stipple ,f ,x ,s)) +(make-obsolete-generalized-variable 'face-background-pixmap 'face-stipple "29.1") +(gv-define-setter face-stipple (x f &optional s) + `(set-face-stipple ,f ,x ,s)) (gv-define-setter face-font (x f &optional s) `(set-face-font ,f ,x ,s)) (gv-define-setter face-foreground (x f &optional s) `(set-face-foreground ,f ,x ,s)) diff --git a/lisp/faces.el b/lisp/faces.el index 390ddbf606..0246e038dd 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1,6 +1,6 @@ ;;; faces.el --- Lisp faces -*- lexical-binding: t -*- -;; Copyright (C) 1992-1996, 1998-2022 Free Software Foundation, Inc. +;; Copyright (C) 1992-2022 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: internal @@ -583,9 +583,6 @@ with the `default' face (which is always completely specified)." nil)) -(defalias 'face-background-pixmap 'face-stipple) - - (defun face-underline-p (face &optional frame inherit) "Return non-nil if FACE specifies a non-nil underlining. If the optional argument FRAME is given, report on face FACE in that frame. @@ -1053,9 +1050,6 @@ Use `set-face-attribute' to \"unspecify\" underlining." (set-face-attribute face frame :extend extend-p)) -(defalias 'set-face-background-pixmap 'set-face-stipple) - - (defun invert-face (face &optional frame) "Swap the foreground and background colors of FACE. If FRAME is omitted or nil, it means change face on all frames. @@ -3179,6 +3173,9 @@ also the same size as FACE on FRAME, or fail." :group 'display) (make-obsolete-variable 'font-list-limit nil "24.3") +(define-obsolete-function-alias 'face-background-pixmap #'face-stipple "29.1") +(define-obsolete-function-alias 'set-face-background-pixmap #'set-face-stipple "29.1") + (provide 'faces) ;;; faces.el ends here diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el index bdc056e1dd..8da4205af5 100644 --- a/lisp/play/gamegrid.el +++ b/lisp/play/gamegrid.el @@ -1,6 +1,6 @@ ;;; gamegrid.el --- library for implementing grid-based games on Emacs -*- lexical-binding:t -*- -;; Copyright (C) 1997-1998, 2001-2022 Free Software Foundation, Inc. +;; Copyright (C) 1997-2022 Free Software Foundation, Inc. ;; Author: Glynn Clements ;; Old-Version: 1.02 @@ -263,7 +263,7 @@ format." (set-face-foreground face color) (set-face-background face color) (gamegrid-set-font face) - (set-face-background-pixmap face nil)) + (set-face-stipple face nil)) (defun gamegrid-make-mono-tty-face () (let ((face (make-face 'gamegrid-mono-tty-face))) diff --git a/lisp/vc/ediff-init.el b/lisp/vc/ediff-init.el index a3e77200dd..c956cdd2ee 100644 --- a/lisp/vc/ediff-init.el +++ b/lisp/vc/ediff-init.el @@ -765,7 +765,7 @@ Ediff needs to find fine differences." "Set stipple pixmap of FACE to PIXMAP on a monochrome display." (if (and (display-graphic-p) (not (display-color-p))) (condition-case nil - (set-face-background-pixmap face pixmap) + (set-face-stipple face pixmap) (error (message "Pixmap not found for %S: %s" (face-name face) pixmap) (sit-for 1))))) commit 4ee8a6c124a15f0da45b5de83af12cbbf0343815 Author: Stefan Kangas Date: Tue Aug 23 16:20:25 2022 +0200 ; Minor doc fix in easy-menu-{add,remove} * lisp/emacs-lisp/easymenu.el (easy-menu-remove, easy-menu-add): Minor doc fix: don't explain what this does in XEmacs. diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 43ce1872f9..41e3a197af 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -492,25 +492,11 @@ To implement dynamic menus, either call this from `menu-bar-update-hook' or use a menu filter." (easy-menu-add-item map path (easy-menu-create-menu name items) before)) -(defalias 'easy-menu-remove #'ignore - "Remove MENU from the current menu bar. -Contrary to XEmacs, this is a nop on Emacs since menus are automatically -\(de)activated when the corresponding keymap is (de)activated. - -\(fn MENU)") +(defalias 'easy-menu-remove #'ignore) (make-obsolete 'easy-menu-remove "this was always a no-op in Emacs \ and can be safely removed." "28.1") -(defalias 'easy-menu-add #'ignore - "Add the menu to the menubar. -On Emacs this is a nop, because menus are already automatically -activated when the corresponding keymap is activated. On XEmacs -this is needed to actually add the menu to the current menubar. - -You should call this once the menu and keybindings are set up -completely and menu filter functions can be expected to work. - -\(fn MENU &optional MAP)") +(defalias 'easy-menu-add #'ignore) (make-obsolete 'easy-menu-add "this was always a no-op in Emacs \ and can be safely removed." "28.1") commit 3b72b47cbd3e1a4b575d5ecc886e506d22a50a0c Author: Stefan Monnier Date: Tue Aug 23 10:15:48 2022 -0400 * lisp/progmodes/elisp-mode.el (elisp--local-variables-1): Fix bug#50034 Don't burp if the arg list of a function is not actually a list. diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 4617a01947..9dc67010aa 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -383,7 +383,9 @@ be used instead. (setq sexp nil)) (`(lambda ,args . ,body) (elisp--local-variables-1 - (append (remq '&optional (remq '&rest args)) vars) + (let ((args (if (listp args) args))) + ;; FIXME: Exit the loop if witness is in args. + (append (remq '&optional (remq '&rest args)) vars)) (car (last body)))) (`(condition-case ,_ ,e) (elisp--local-variables-1 vars e)) (`(condition-case ,v ,_ . ,catches) commit 1a4a12a2a8dbc45bf64fbbd6e19385424d06437d Author: Stefan Kangas Date: Tue Aug 23 15:56:32 2022 +0200 Make Emacs 20 compat alias obsolete in eudcb-ldap.el * lisp/net/eudcb-ldap.el (eudc-ldap-get-host-parameter): Make Emacs 20 compat alias obsolete. diff --git a/lisp/net/eudcb-ldap.el b/lisp/net/eudcb-ldap.el index 1201c84f2d..86fe99f9e7 100644 --- a/lisp/net/eudcb-ldap.el +++ b/lisp/net/eudcb-ldap.el @@ -38,14 +38,6 @@ ;;{{{ Internal cooking -(defalias 'eudc-ldap-get-host-parameter - (if (fboundp 'ldap-get-host-parameter) - #'ldap-get-host-parameter - (lambda (host parameter) - "Get the value of PARAMETER for HOST in `ldap-host-parameters-alist'." - (plist-get (cdr (assoc host ldap-host-parameters-alist)) - parameter)))) - (defvar eudc-ldap-attributes-translation-alist '((name . sn) (firstname . givenname) @@ -209,7 +201,7 @@ attribute names are returned. Default to `person'." (defun eudc-ldap-check-base () "Check if the current LDAP server has a configured search base." - (unless (or (eudc-ldap-get-host-parameter eudc-server 'base) + (unless (or (ldap-get-host-parameter eudc-server 'base) ldap-default-base (null (y-or-n-p "No search base defined. Configure it now?"))) ;; If the server is not in ldap-host-parameters-alist we add it for the @@ -224,6 +216,8 @@ attribute names are returned. Default to `person'." (eudc-register-protocol 'ldap) +(define-obsolete-function-alias 'eudc-ldap-get-host-parameter #'ldap-get-host-parameter "29.1") + (provide 'eudcb-ldap) ;;; eudcb-ldap.el ends here commit 1f990d1cf95930a584a7f70f002f284e273b6fd6 Author: Gerd Möllmann Date: Tue Aug 23 15:50:25 2022 +0200 Fix pixel-scroll-precision in a corner case * lisp/pixel-scroll.el (pixel-scroll-precision-scroll-up-page): Handle case that point cannot be found. (pixel-scroll-precision-scroll-up): Handle case that window is one line high (bug#57349) diff --git a/lisp/pixel-scroll.el b/lisp/pixel-scroll.el index 6dba733b9c..167cb4fabe 100644 --- a/lisp/pixel-scroll.el +++ b/lisp/pixel-scroll.el @@ -570,11 +570,12 @@ the height of the current window." (window-header-line-height) (- max-y delta)))) (point (posn-point posn)) - (up-point (save-excursion - (goto-char point) - (vertical-motion (- (1+ scroll-margin))) - (point)))) - (when (> (point) up-point) + (up-point (and point + (save-excursion + (goto-char point) + (vertical-motion (- (1+ scroll-margin))) + (point))))) + (when (and point (> (point) up-point)) (when (let ((pos-visible (pos-visible-in-window-p up-point nil t))) (or (eq (length pos-visible) 2) (when-let* ((posn (posn-at-point up-point)) @@ -665,10 +666,11 @@ window being scrolled by DELTA pixels with an animation." "Scroll the current window up by DELTA pixels." (let ((max-height (- (window-text-height nil t) (frame-char-height)))) - (while (> delta max-height) - (pixel-scroll-precision-scroll-up-page max-height) - (setq delta (- delta max-height))) - (pixel-scroll-precision-scroll-up-page delta))) + (when (> max-height 0) + (while (> delta max-height) + (pixel-scroll-precision-scroll-up-page max-height) + (setq delta (- delta max-height))) + (pixel-scroll-precision-scroll-up-page delta)))) ;; FIXME: This doesn't _always_ work when there's an image above the ;; current line that is taller than the window, and scrolling can commit 76982f08683643a0e087a69c5d8c3eea1d36715e Author: Po Lu Date: Tue Aug 23 20:56:12 2022 +0800 ; * src/xterm.c (x_free_frame_resources): Fix typo. diff --git a/src/xterm.c b/src/xterm.c index 26c512d80a..3dfa908f1e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -27024,7 +27024,7 @@ x_free_frame_resources (struct frame *f) XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->bottom_left_corner_cursor); /* Free sync fences. */ -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK && defined CLOCK_GETTIME +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK && defined HAVE_CLOCK_GETTIME x_sync_free_fences (f); #endif } commit a328bf65ef31d0134fc3d522f28b2da000a5e742 Author: Po Lu Date: Tue Aug 23 20:52:41 2022 +0800 Make frame synchronization conditional on clock_gettime * src/xfns.c (x_set_parent_frame) (x_set_use_frame_synchronization): * src/xterm.c (x_update_begin, show_back_buffer, x_update_end) (x_display_set_last_user_time, handle_one_xevent): * src/xterm.h (struct x_output): Define out vsync code when !HAVE_CLOCK_GETTIME. (bug#57346) diff --git a/src/xfns.c b/src/xfns.c index 7eecda6dbd..0b1f707e9f 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5156,7 +5156,8 @@ This function is an internal primitive--use `make-frame' instead. */) ((STRINGP (value) && !strcmp (SSDATA (value), "extended")) ? 2 : 1)); -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \ + && defined HAVE_CLOCK_GETTIME x_sync_init_fences (f); #endif #endif diff --git a/src/xterm.c b/src/xterm.c index 8de273cb8f..26c512d80a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -7600,7 +7600,7 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, #ifndef USE_GTK struct frame *focus_frame; Time old_time; -#if defined HAVE_XSYNC +#if defined HAVE_XSYNC && defined HAVE_CLOCK_GETTIME uint64_t monotonic_time; #endif @@ -27024,7 +27024,7 @@ x_free_frame_resources (struct frame *f) XFreeCursor (FRAME_X_DISPLAY (f), f->output_data.x->bottom_left_corner_cursor); /* Free sync fences. */ -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK && defined CLOCK_GETTIME x_sync_free_fences (f); #endif } diff --git a/src/xterm.h b/src/xterm.h index 75277c166e..8500ec2771 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1577,7 +1577,8 @@ extern void x_make_frame_invisible (struct frame *); extern void x_iconify_frame (struct frame *); extern void x_free_frame_resources (struct frame *); extern void x_wm_set_size_hint (struct frame *, long, bool); -#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK +#if defined HAVE_XSYNCTRIGGERFENCE && !defined USE_GTK \ + && defined HAVE_CLOCK_GETTIME extern void x_sync_init_fences (struct frame *); #endif commit 3b7fb723e6a02e760e18942f577f21a88ad852a8 Author: Po Lu Date: Tue Aug 23 20:42:28 2022 +0800 Make frame synchronization conditional on clock_gettime * src/xfns.c (x_set_parent_frame) (x_set_use_frame_synchronization): * src/xterm.c (x_update_begin, show_back_buffer, x_update_end) (x_display_set_last_user_time, handle_one_xevent): * src/xterm.h (struct x_output): Define out vsync code when !HAVE_CLOCK_GETTIME. diff --git a/src/xfns.c b/src/xfns.c index a275e3e11a..7eecda6dbd 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -965,7 +965,7 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu } #endif -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* Frame synchronization can't be used in child frames since they are not directly managed by the compositing manager. Re-enabling vsync in former child frames also leads to @@ -2421,7 +2421,7 @@ static void x_set_use_frame_synchronization (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { -#if !defined USE_GTK && defined HAVE_XSYNC +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME struct x_display_info *dpyinfo; dpyinfo = FRAME_DISPLAY_INFO (f); diff --git a/src/xterm.c b/src/xterm.c index 8f0a7ffaaa..8de273cb8f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6655,7 +6655,7 @@ x_set_frame_alpha (struct frame *f) Starting and ending an update ***********************************************************************/ -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* Wait for an event matching PREDICATE to show up in the event queue, or TIMEOUT to elapse. @@ -7029,7 +7029,7 @@ x_sync_handle_frame_drawn (struct x_display_info *dpyinfo, static void x_update_begin (struct frame *f) { -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* If F is double-buffered, we can make the entire frame center around XdbeSwapBuffers. */ #ifdef HAVE_XDBE @@ -7138,7 +7138,7 @@ show_back_buffer (struct frame *f) if (FRAME_X_DOUBLE_BUFFERED_P (f)) { -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* Wait for drawing of the previous frame to complete before displaying this new frame. */ x_sync_wait_for_frame_drawn_event (f); @@ -7157,7 +7157,7 @@ show_back_buffer (struct frame *f) swap_info.swap_action = XdbeCopied; XdbeSwapBuffers (FRAME_X_DISPLAY (f), &swap_info, 1); -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* Finish the frame here. */ x_sync_update_finish (f); #endif @@ -7211,7 +7211,7 @@ x_update_end (struct frame *f) /* If double buffering is disabled, finish the update here. Otherwise, finish the update when the back buffer is next displayed. */ -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME #ifdef HAVE_XDBE if (!FRAME_X_DOUBLE_BUFFERED_P (f)) #endif @@ -7615,7 +7615,7 @@ x_display_set_last_user_time (struct x_display_info *dpyinfo, Time time, if (!send_event || time > dpyinfo->last_user_time) dpyinfo->last_user_time = time; -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME if (!send_event) { /* See if the current CLOCK_MONOTONIC time is reasonably close @@ -17995,7 +17995,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, goto done; } -#if defined HAVE_XSYNC && !defined USE_GTK +#if defined HAVE_XSYNC && !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* These messages are sent by the compositing manager after a frame is drawn under extended synchronization. */ if (event->xclient.message_type diff --git a/src/xterm.h b/src/xterm.h index e97f3d4c83..75277c166e 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1119,7 +1119,7 @@ struct x_output frame. */ bool_bf waiting_for_frame_p : 1; -#ifndef USE_GTK +#if !defined USE_GTK && defined HAVE_CLOCK_GETTIME /* Whether or not Emacs should wait for the compositing manager to draw frames before starting a new frame. */ bool_bf use_vsync_p : 1; commit b448fbec4b78c193b9f4b3cce94e491fe5719339 Author: Lars Ingebrigtsen Date: Tue Aug 23 12:49:13 2022 +0200 Disable a lisp-mode test that now fails * test/lisp/emacs-lisp/lisp-mode-tests.el (test-lisp-current-defun-name): Comment-out now-failing tests. diff --git a/test/lisp/emacs-lisp/lisp-mode-tests.el b/test/lisp/emacs-lisp/lisp-mode-tests.el index d3e78aa1d7..996ea201fb 100644 --- a/test/lisp/emacs-lisp/lisp-mode-tests.el +++ b/test/lisp/emacs-lisp/lisp-mode-tests.el @@ -342,16 +342,18 @@ Expected initialization file: `%s'\" (insert "(define-flabbergast-test zot ()\n'bar)\n") (goto-char 5) (should (equal (lisp-current-defun-name) "zot"))) - (with-temp-buffer - (emacs-lisp-mode) - (insert "(progn\n ;; comment\n ;; about that\n (define-key ...)\n )") - (goto-char 5) - (should (equal (lisp-current-defun-name) "progn"))) - (with-temp-buffer - (emacs-lisp-mode) - (insert "(defblarg \"a\" 'b)") - (goto-char 5) - (should (equal (lisp-current-defun-name) "defblarg")))) + ;; These tests should probably work after bug#49592 has been fixed. + ;; (with-temp-buffer + ;; (emacs-lisp-mode) + ;; (insert "(progn\n ;; comment\n ;; about that\n (define-key ...)\n )") + ;; (goto-char 5) + ;; (should (equal (lisp-current-defun-name) "progn"))) + ;; (with-temp-buffer + ;; (emacs-lisp-mode) + ;; (insert "(defblarg \"a\" 'b)") + ;; (goto-char 5) + ;; (should (equal (lisp-current-defun-name) "defblarg"))) + ) (provide 'lisp-mode-tests) ;;; lisp-mode-tests.el ends here commit 48b0f2606b91dd2a063bef992a2beb13e0f6281b Author: Lars Ingebrigtsen Date: Tue Aug 23 12:26:24 2022 +0200 Revert the changes to lisp-current-defun-name * lisp/emacs-lisp/lisp-mode.el (lisp-current-defun-name): Revert back to the old version before bug#49592. The new approach just doesn't work well enough -- we don't really have the data to know that, say, `make-obsolete-variable' is about the second symbol and not the first. diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index c56a9660e7..c906ee6e31 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -728,67 +728,30 @@ font-lock keywords will not be case sensitive." len)))) (defun lisp-current-defun-name () - "Return the name of the defun at point. -If there is no defun at point, return the first symbol from the -top-level form. If there is no top-level form, return nil. - -(\"defun\" here means \"form that defines something\", and is -decided heuristically.)" + "Return the name of the defun at point, or nil." (save-excursion - (let ((location (point)) - name) + (let ((location (point))) ;; If we are now precisely at the beginning of a defun, make sure ;; beginning-of-defun finds that one rather than the previous one. - (unless (eobp) - (forward-char 1)) + (or (eobp) (forward-char 1)) (beginning-of-defun) ;; Make sure we are really inside the defun found, not after it. - (when (and (looking-at "(") - (progn - (end-of-defun) - (< location (point))) - (progn - (forward-sexp -1) - (>= location (point)))) - (when (looking-at "(") - (forward-char 1)) - ;; Read the defining construct name, typically "defun" or + (when (and (looking-at "\\s(") + (progn (end-of-defun) + (< location (point))) + (progn (forward-sexp -1) + (>= location (point)))) + (if (looking-at "\\s(") + (forward-char 1)) + ;; Skip the defining construct name, typically "defun" or ;; "defvar". - (let ((symbol (ignore-errors (read (current-buffer))))) - (when (and symbol (not (symbolp symbol))) - (setq symbol nil)) - ;; If there's an edebug spec, use that to determine what the - ;; name is. - (when symbol - (let ((spec (or (get symbol 'edebug-form-spec) - (and (eq (get symbol 'lisp-indent-function) 'defun) - (get 'defun 'edebug-form-spec))))) - (save-excursion - (when (and (eq (car-safe spec) '&define) - (memq 'name spec)) - (pop spec) - (while (and spec (not name)) - (let ((candidate (ignore-errors (read (current-buffer))))) - (when (eq (pop spec) 'name) - (when (and (consp candidate) - (symbolp (car (delete 'quote candidate)))) - (setq candidate (car (delete 'quote candidate)))) - (setq name candidate - spec nil)))))))) - ;; We didn't have an edebug spec (or couldn't find the - ;; name). If the symbol starts with \"def\", then it's - ;; likely that the next symbol is the name. - (when (and (not name) - (string-match-p "\\(\\`\\|-\\)def" (symbol-name symbol))) - (when-let ((candidate (ignore-errors (read (current-buffer))))) - (cond - ((symbolp candidate) - (setq name candidate)) - ((and (consp candidate) - (symbolp (car (delete 'quote candidate)))) - (setq name (car (delete 'quote candidate))))))) - (when-let ((result (or name symbol))) - (and (symbolp result) (symbol-name result)))))))) + (forward-sexp 1) + ;; The second element is usually a symbol being defined. If it + ;; is not, use the first symbol in it. + (skip-chars-forward " \t\n'(") + (buffer-substring-no-properties (point) + (progn (forward-sexp 1) + (point))))))) (defvar-keymap lisp-mode-shared-map :doc "Keymap for commands shared by all sorts of Lisp modes." commit 9d9798521e3457506c08ff9cb6c0d3069c30af00 Author: Lars Ingebrigtsen Date: Tue Aug 23 12:23:09 2022 +0200 Don't mention obsolete generalized variables in *Help* * lisp/help-fns.el (help-fns--generalized-variable): Don't mention obsolete ones. diff --git a/lisp/help-fns.el b/lisp/help-fns.el index e06f2dec5c..1ccf9bb428 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1156,7 +1156,9 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro 100) (defun help-fns--generalized-variable (function) - (when (get function 'gv-expander) + (when (and (get function 'gv-expander) + ;; Don't mention obsolete generalized variables. + (not (get function 'byte-obsolete-generalized-variable))) (insert (format-message " `%s' is also a " function) (buttonize "generalized variable" (lambda (_) (info "(elisp)Generalized Variables"))) commit 915efbff9833ea36aeb364e032a639391516912d Author: Lars Ingebrigtsen Date: Tue Aug 23 12:22:42 2022 +0200 Make buffer-local-value obsolete as a generalized variable * lisp/electric.el (electric-indent-local-mode) (electric-layout-local-mode, electric-quote-local-mode): * lisp/elec-pair.el (electric-pair-local-mode): Adjust usage. * lisp/emacs-lisp/gv.el (make-obsolete-generalized-variable): Move since we're using it earlier in the file. (buffer-local-value): Make obsolete as a generalized variable since the semantics are unclear (bug#26624). diff --git a/lisp/elec-pair.el b/lisp/elec-pair.el index e5adb0dda7..e4d6461505 100644 --- a/lisp/elec-pair.el +++ b/lisp/elec-pair.el @@ -666,7 +666,8 @@ To toggle the mode in a single buffer, use `electric-pair-local-mode'." ;;;###autoload (define-minor-mode electric-pair-local-mode "Toggle `electric-pair-mode' only in this buffer." - :variable (buffer-local-value 'electric-pair-mode (current-buffer)) + :variable ( electric-pair-mode . + (lambda (val) (setq-local electric-pair-mode val))) (cond ((eq electric-pair-mode (default-value 'electric-pair-mode)) (kill-local-variable 'electric-pair-mode)) diff --git a/lisp/electric.el b/lisp/electric.el index f2ff837333..bd7ea527ba 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -340,7 +340,8 @@ use `electric-indent-local-mode'." ;;;###autoload (define-minor-mode electric-indent-local-mode "Toggle `electric-indent-mode' only in this buffer." - :variable (buffer-local-value 'electric-indent-mode (current-buffer)) + :variable ( electric-indent-mode . + (lambda (val) (setq-local electric-indent-mode val))) (cond ((eq electric-indent-mode (default-value 'electric-indent-mode)) (kill-local-variable 'electric-indent-mode)) @@ -484,7 +485,8 @@ The variable `electric-layout-rules' says when and how to insert newlines." ;;;###autoload (define-minor-mode electric-layout-local-mode "Toggle `electric-layout-mode' only in this buffer." - :variable (buffer-local-value 'electric-layout-mode (current-buffer)) + :variable ( electric-layout-mode . + (lambda (val) (setq-local electric-layout-mode val))) (cond ((eq electric-layout-mode (default-value 'electric-layout-mode)) (kill-local-variable 'electric-layout-mode)) @@ -661,7 +663,8 @@ use `electric-quote-local-mode'." ;;;###autoload (define-minor-mode electric-quote-local-mode "Toggle `electric-quote-mode' only in this buffer." - :variable (buffer-local-value 'electric-quote-mode (current-buffer)) + :variable ( electric-quote-mode . + (lambda (val) (setq-local electric-quote-mode val))) (cond ((eq electric-quote-mode (default-value 'electric-quote-mode)) (kill-local-variable 'electric-quote-mode)) diff --git a/lisp/emacs-lisp/gv.el b/lisp/emacs-lisp/gv.el index 0c374ec5e3..6ed3b7f85a 100644 --- a/lisp/emacs-lisp/gv.el +++ b/lisp/emacs-lisp/gv.el @@ -169,6 +169,18 @@ arguments as NAME. DO is a function as defined in `gv-get'." ;; (`(expand ,expander) `(gv-define-expand ,name ,expander)) (_ (message "Unknown %s declaration %S" symbol handler) nil)))) +(defun make-obsolete-generalized-variable (obsolete-name current-name when) + "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. +The warning will say that CURRENT-NAME should be used instead. + +If CURRENT-NAME is a string, that is the `use instead' message. + +WHEN should be a string indicating when the variable was first +made obsolete, for example a date or a release number." + (put obsolete-name 'byte-obsolete-generalized-variable + (purecopy (list current-name when))) + obsolete-name) + ;; Additions for `declare'. We specify the values as named aliases so ;; that `describe-variable' prints something useful; cf. Bug#40491. @@ -395,6 +407,7 @@ The return value is the last VAL in the list. (gv-define-setter buffer-local-value (val var buf) (macroexp-let2 nil v val `(with-current-buffer ,buf (set (make-local-variable ,var) ,v)))) +(make-obsolete-generalized-variable 'buffer-local-value nil "29.1") (gv-define-expander alist-get (lambda (do key alist &optional default remove testfn) @@ -619,18 +632,6 @@ REF must have been previously obtained with `gv-ref'." ;;; Generalized variables. -(defun make-obsolete-generalized-variable (obsolete-name current-name when) - "Make byte-compiler warn that generalized variable OBSOLETE-NAME is obsolete. -The warning will say that CURRENT-NAME should be used instead. - -If CURRENT-NAME is a string, that is the `use instead' message. - -WHEN should be a string indicating when the variable was first -made obsolete, for example a date or a release number." - (put obsolete-name 'byte-obsolete-generalized-variable - (purecopy (list current-name when))) - obsolete-name) - ;; Some Emacs-related place types. (gv-define-simple-setter buffer-file-name set-visited-file-name t) (make-obsolete-generalized-variable diff --git a/lisp/paren.el b/lisp/paren.el index 4c268dbf77..d7580de9a9 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -149,7 +149,8 @@ use `show-paren-local-mode'." ;;;###autoload (define-minor-mode show-paren-local-mode "Toggle `show-paren-mode' only in this buffer." - :variable (buffer-local-value 'show-paren-mode (current-buffer)) + :variable ( show-paren-mode . + (lambda (val) (setq-local show-paren-mode val))) (cond ((eq show-paren-mode (default-value 'show-paren-mode)) (unless show-paren-mode commit 66040fbeed284ade8577b8da1e5bf7fde3a958cc Author: Thierry Volpiatto Date: Tue Aug 23 12:03:22 2022 +0200 Fix wdired with (dired '(dir f1 f2 ...)) * lisp/wdired.el (wdired-finish-edit): Fix wdired with (dired '(dir f1 f2 ...)) (bug#57334). diff --git a/lisp/wdired.el b/lisp/wdired.el index 106d57174d..09f5b069f4 100644 --- a/lisp/wdired.el +++ b/lisp/wdired.el @@ -537,15 +537,28 @@ non-nil means return old filename." (wdired-change-to-dired-mode) (if changes (progn - ;; If we are displaying a single file (rather than the - ;; contents of a directory), change dired-directory if that - ;; file was renamed. (This ought to be generalized to - ;; handle the multiple files case, but that's less trivial). - (when (and (stringp dired-directory) - (not (file-directory-p dired-directory)) - (null some-file-names-unchanged) - (= (length files-renamed) 1)) - (setq dired-directory (cdr (car files-renamed)))) + (cond + ((and (stringp dired-directory) + (not (file-directory-p dired-directory)) + (null some-file-names-unchanged) + (= (length files-renamed) 1)) + ;; If we are displaying a single file (rather than the + ;; contents of a directory), change dired-directory if that + ;; file was renamed. + (setq dired-directory (cdr (car files-renamed)))) + ((and (consp dired-directory) + (cdr dired-directory) + files-renamed) + ;; Fix dired buffers created with + ;; (dired '(foo f1 f2 f3)). + (setq dired-directory + (cons (car dired-directory) + ;; Replace in `dired-directory' files that have + ;; been modified with their new name keeping + ;; the ones that are unmodified at the same place. + (cl-loop for f in (cdr dired-directory) + collect (or (assoc-default f files-renamed) + f)))))) ;; Re-sort the buffer. (revert-buffer) (let ((inhibit-read-only t))