commit 68e2a9cd92996dd55ff9599dc1bf99c70070cddb (HEAD, refs/remotes/origin/master) Author: Thomas Fitzsimmons Date: Mon Nov 7 19:34:33 2022 -0500 EUDC: Add eudc-ignore-options-file customization * etc/NEWS (EUDC): Document eudc-ignore-options-file. * doc/misc/eudc.texi (The Server Hotlist): Likewise * lisp/net/eudc-vars.el (eudc-ignore-options-file): New variable. (eudc-options-file): Mention new variable. * lisp/net/eudc.el: Warn on load if eudc-ignore-options-file is set but the options file exists. (eudc-set-server): Support eudc-ignore-options-file. (eudc-bookmark-server): Likewise. (eudc-save-options): Likewise. (Bug#56154) diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 0037ba78d3..50e483057d 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -916,13 +916,23 @@ in other places, like for example the body of the message. @section The Server Hotlist EUDC lets you maintain a list of frequently used servers so that you -can easily switch from one to another. This hotlist appears in the -@samp{Server} submenu. You select a server in this list by clicking on -its name. You can add the current server to the list with the command -@kbd{M-x eudc-bookmark-current-server}. The list is contained in the variable -@code{eudc-server-hotlist} which is stored in and retrieved from the file -designated by @code{eudc-options-file}. EUDC also provides a facility to -edit the hotlist interactively (@pxref{The Hotlist Edit Buffer}). +can easily switch from one to another. Most users should configure +the hotlist via Customize, and store the configuration in the main +Emacs initialization file. Configuring it dynamically can be +confusing, particularly if the hotlist settings are saved to +@code{eudc-options-file} automatically. @code{eudc-options-file} is +historical and support for it is still maintained, but new EUDC users +should set @code{eudc-ignore-options-file} to @code{t}. + +However, this hotlist also appears in the @samp{Server} submenu. You +select a server in this list by clicking on its name. You can add the +current server to the list with the command @kbd{M-x +eudc-bookmark-current-server}. The list is contained in the variable +@code{eudc-server-hotlist} which is stored in and retrieved from the +file designated by @code{eudc-options-file}, or normal Emacs +initialization if @code{eudc-ignore-options-file} is non-nil. EUDC +also provides a facility to edit the hotlist interactively (@pxref{The +Hotlist Edit Buffer}). The hotlist is also used to make queries on multiple servers successively (@pxref{Multi-server Queries}). The order in which the @@ -937,6 +947,14 @@ Add @var{server} to the hotlist of servers Add the current server to the hotlist of servers @end deffn +@defvar eudc-ignore-options-file +If non-nil, then EUDC ignores @code{eudc-options-file} and warns or +issues an error when an attempt is made to use it. Most users should +set this, and keep their EUDC configuration in the main Emacs +initialization file instead. The separate eudc-options file has +created confusion for users in the past. +@end defvar + @defvar eudc-options-file The name of a file where EUDC stores its internal variables (the hotlist and the current server). EUDC will try to load that file upon diff --git a/etc/NEWS b/etc/NEWS index 538e165fee..60b2caccc8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1964,6 +1964,13 @@ It narrows to the current node. ** EUDC ++++ +*** New user option 'eudc-ignore-options-file' that defaults to 'nil' +The 'eudc-ignore-options-file' user option can be configured to ignore +the 'eudc-options-file' (typically "~/.emacs.d/eudc-options"). Most +users should configure this to 't' and put EUDC configuration in the +main Emacs initialization file (".emacs" or "~/.emacs.d/init.el"). + +++ *** 'eudc-expansion-overwrites-query' to 'eudc-expansion-save-query-as-kill'. 'eudc-expansion-overwrites-query' is renamed to diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el index dea17f3424..bb1f9d9f0f 100644 --- a/lisp/net/eudc-vars.el +++ b/lisp/net/eudc-vars.el @@ -343,9 +343,15 @@ arguments that should be passed to the program." :inline t (string :tag "Argument"))))) +(defcustom eudc-ignore-options-file nil + "Ignore configuration in `eudc-options-file', if non-nil." + :type 'boolean + :version "29.1") + (defcustom eudc-options-file (locate-user-emacs-file "eudc-options" ".eudc-options") - "A file where the `servers' hotlist is stored." + "A file where the `servers' hotlist is stored. +See `eudc-ignore-options-file'." :type '(file :Tag "File Name:") :version "25.1") diff --git a/lisp/net/eudc.el b/lisp/net/eudc.el index 5f9e78fc7f..8319c048e2 100644 --- a/lisp/net/eudc.el +++ b/lisp/net/eudc.el @@ -726,7 +726,8 @@ server for future sessions." (if (called-interactively-p 'interactive) (message "Current directory server is now %s (%s)" eudc-server eudc-protocol)) (if (null no-save) - (eudc-save-options))) + (when (not eudc-ignore-options-file) + (eudc-save-options)))) ;;;###autoload (defun eudc-get-email (name &optional error) @@ -1107,7 +1108,11 @@ queries the server for the existing fields and displays a corresponding form." (error "%s:%s is already in the hotlist" protocol server) (setq eudc-server-hotlist (cons (cons server protocol) eudc-server-hotlist)) (eudc-install-menu) - (eudc-save-options))) + (if eudc-ignore-options-file + (warn "Not saving bookmark due to `eudc-ignore-options-file'\ + customization. Instead, customize `eudc-server-hotlist' to include %s:%s" + protocol server) + (eudc-save-options)))) (defun eudc-bookmark-current-server () "Add current server to the EUDC `servers' hotlist." @@ -1117,6 +1122,9 @@ queries the server for the existing fields and displays a corresponding form." (defun eudc-save-options () "Save options to `eudc-options-file'." (interactive) + (when eudc-ignore-options-file + (error "EUDC is configured to ignore the deprecated options file;\ + see `eudc-ignore-options-file'")) (with-current-buffer (find-file-noselect eudc-options-file t) (goto-char (point-min)) ;; delete the previous setq @@ -1278,11 +1286,13 @@ queries the server for the existing fields and displays a corresponding form." ;;{{{ Load time initializations ;; Load the options file -(if (and (not noninteractive) - (and (locate-library eudc-options-file) - (progn (message "") t)) ; Remove mode line message - (not (featurep 'eudc-options-file))) - (load eudc-options-file)) +(let ((library-file-path (locate-library eudc-options-file))) + (if (and (not noninteractive) + (and library-file-path + (progn (message "") t)) ; Remove mode line message + (not (featurep 'eudc-options-file)) + (not eudc-ignore-options-file)) + (load eudc-options-file))) ;; Install the full menu (unless (featurep 'infodock) commit 80c3fadfd57ee797404c80b8e88371c53edecfe5 Author: Juri Linkov Date: Mon Nov 7 20:05:38 2022 +0200 ; * lisp/tab-bar.el (tab-bar-auto-width): Remaining renaming in docstring. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index d3735c6d77..cdea856ac2 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -980,9 +980,9 @@ when the frame's dimensions change. This also avoids as much as possible wrapping a long tab bar to a second tab-bar line. The automatic resizing of tabs takes place as long as tabs are no -wider than allowed by the value of `tab-bar-fixed-width-max', and +wider than allowed by the value of `tab-bar-auto-width-max', and at least as wide as specified by the value of -`tab-bar-fixed-width-min'. +`tab-bar-auto-width-min'. When this variable is nil, the width of each tab is determined by the length of the tab's name." commit d04433b96215d7d3387573f19cc315de86f2341a Author: Eli Zaretskii Date: Mon Nov 7 15:40:33 2022 +0200 ; Improve documentation of automatic tab-bar tab resizing * etc/NEWS: * lisp/tab-bar.el (tab-bar-auto-width): Rename from tab-bar-fixed-width. All similar variables changed accordingly; all users changed. (tab-bar-auto-width, tab-bar-auto-width-max) (tab-bar-auto-width-min): Doc fixes. * etc/NEWS: Resurrect the lost Local variables section. diff --git a/etc/NEWS b/etc/NEWS index 89da8aa63f..538e165fee 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1082,9 +1082,11 @@ the corresponding deleted frame. ** Tab Bars and Tab Lines --- -*** New user option 'tab-bar-fixed-width' to automatically resize tabs. -Another option 'tab-bar-fixed-width-max' defines the maximum tab width -that by default is 220 pixels on GUI and 20 characters on a tty. +*** New user option 'tab-bar-auto-width' to automatically determine tab width. +This option is non-nil by default, which resizes tab-bar tabs so that +their width is evenly distributed across the tab bar. A companion +option 'tab-bar-auto-width-max' controls the maximum width of a tab +before its name on display is truncated. --- *** 'C-x t RET' creates a new tab when the provided tab name doesn't exist. @@ -4284,3 +4286,11 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Emacs. If not, see . + + +Local variables: +coding: utf-8 +mode: outline +mode: emacs-news +paragraph-separate: "[ ]" +end: diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 16763132fe..d3735c6d77 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -964,34 +964,42 @@ on the tab bar instead." (defun tab-bar-make-keymap-1 () "Generate an actual keymap from `tab-bar-map', without caching." (let ((items (tab-bar-format-list tab-bar-format))) - (when tab-bar-fixed-width - (setq items (tab-bar-fixed-width items))) + (when tab-bar-auto-width + (setq items (tab-bar-auto-width items))) (append tab-bar-map items))) -(defcustom tab-bar-fixed-width t - "Automatically resize tabs on the tab bar to the fixed width. -This variable is intended to solve two problems. When switching buffers -on the current tab, the tab changes its name to buffer names of -various lengths, thus resizing the tab and shifting the tab positions -on the tab bar. But with the fixed width, the size of the tab name -doesn't change when the tab name changes, thus keeping the fixed -tab bar layout. The second problem solved by this variable is to prevent -wrapping the long tab bar to the second line, thus keeping the height of -the tab bar always fixed to one line. - -The maximum tab width is defined by the variable `tab-bar-fixed-width-max'." +(defcustom tab-bar-auto-width t + "Automatically resize width of tabs on tab bar to fill available tab-bar space. +When non-nil, the widths of the tabs on the tab bar are +automatically resized so that their width is evenly distributed +across the tab bar. This keeps the widths of the tabs +independent of the length of the buffer names shown on each tab; +the tab widths change only when tabs are added or deleted, or +when the frame's dimensions change. This also avoids as much as +possible wrapping a long tab bar to a second tab-bar line. + +The automatic resizing of tabs takes place as long as tabs are no +wider than allowed by the value of `tab-bar-fixed-width-max', and +at least as wide as specified by the value of +`tab-bar-fixed-width-min'. + +When this variable is nil, the width of each tab is determined by the +length of the tab's name." :type 'boolean :group 'tab-bar :version "29.1") -(defcustom tab-bar-fixed-width-max '(220 20) - "Maximum number of pixels or characters allowed for the tab name width. -The first element of the list is the maximum number of pixels when used on -a GUI session. The second element of the list defines the maximum number -of characters when used on a tty. When set to nil, there is no limit -on maximum width, and tabs are resized evenly to the whole width -of the tab bar when `tab-bar-fixed-width' is non-nil." +(defcustom tab-bar-auto-width-max '(220 20) + "Maximum width for automatic resizing of width of tab-bar tabs. +This determines the maximum width of tabs before their names will be +truncated on display. +The value should be a list of two numbers: the first is the maximum +width of tabs in pixels for GUI frames, the second is the maximum +width of tabs in characters on TTY frames. +If the value of this variable is nil, there is no limit on maximum +width. +This variable has effect only when `tab-bar-auto-width' is non-nil." :type '(choice (const :tag "No limit" nil) (list (integer :tag "Max width (pixels)" :value 220) @@ -1003,21 +1011,25 @@ of the tab bar when `tab-bar-fixed-width' is non-nil." :group 'tab-bar :version "29.1") -(defvar tab-bar-fixed-width-min '(20 2) - "Minimum number of pixels or characters allowed for the tab name width. -It's not recommended to change this value since with a bigger value, the -tab bar might wrap to the second line.") +(defvar tab-bar-auto-width-min '(20 2) + "Minimum width of tabs for automatic resizing under `tab-bar-auto-width'. +The value should be a list of two numbers, giving the minimum width +as the number of pixels for GUI frames and the number of characters +for text-mode frames. Tabs whose width is smaller than this will not +be narrowed. +It's not recommended to change this value since with larger values, the +tab bar might wrap to the second line when it shouldn't.") -(defvar tab-bar-fixed-width-faces +(defvar tab-bar-auto-width-faces '( tab-bar-tab tab-bar-tab-inactive tab-bar-tab-ungrouped tab-bar-tab-group-inactive) "Resize tabs only with these faces.") (defvar tab-bar--fixed-width-hash nil - "Memoization table for `tab-bar-fixed-width'.") + "Memoization table for `tab-bar-auto-width'.") -(defun tab-bar-fixed-width (items) +(defun tab-bar-auto-width (items) "Return tab-bar items with resized tab names." (unless tab-bar--fixed-width-hash (define-hash-table-test 'tab-bar--fixed-width-hash-test @@ -1031,7 +1043,7 @@ tab bar might wrap to the second line.") (dolist (item items) (when (and (eq (nth 1 item) 'menu-item) (stringp (nth 2 item))) (if (memq (get-text-property 0 'face (nth 2 item)) - tab-bar-fixed-width-faces) + tab-bar-auto-width-faces) (push item tabs) (unless (eq (nth 0 item) 'align-right) (setq non-tabs (concat non-tabs (nth 2 item))))))) @@ -1040,14 +1052,14 @@ tab bar might wrap to the second line.") (string-pixel-width (propertize non-tabs 'face 'tab-bar))) (length tabs))) - (when tab-bar-fixed-width-min + (when tab-bar-auto-width-min (setq width (max width (if window-system - (nth 0 tab-bar-fixed-width-min) - (nth 1 tab-bar-fixed-width-min))))) - (when tab-bar-fixed-width-max + (nth 0 tab-bar-auto-width-min) + (nth 1 tab-bar-auto-width-min))))) + (when tab-bar-auto-width-max (setq width (min width (if window-system - (nth 0 tab-bar-fixed-width-max) - (nth 1 tab-bar-fixed-width-max))))) + (nth 0 tab-bar-auto-width-max) + (nth 1 tab-bar-auto-width-max))))) (dolist (item tabs) (setf (nth 2 item) (with-memoization (gethash (cons width (nth 2 item)) commit d30a7c142df2c35f165bad34cc8f778a7389e032 Author: Po Lu Date: Mon Nov 7 20:33:28 2022 +0800 Add missing SAFE_FREE on XI 2.0 servers * src/xterm.c (xi_populate_device_from_info): Add missing SAFE_FREE. diff --git a/src/xterm.c b/src/xterm.c index 1f14daa39f..84438e8590 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5400,6 +5400,7 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, xi_device->valuators = NULL; xi_device->scroll_valuator_count = 0; + SAFE_FREE (); return; } commit c19ca5eb7f27344ca03fa300a65ec9b33dc7253e Author: Alan Mackenzie Date: Mon Nov 7 12:20:07 2022 +0000 CC Mode: Fix infinite loop in c-brace-stack-at. This fixes bug #59038. The infinite loop occurred with a buffer containing Base-64 encoded text rather than appropriate C Mode text. * lisp/progmodes/cc-engine.el (c-update-brace-stack): Don't execute c-beginning-of-current-token unless the previous c-syntactic-re-search-forward has succeeded at least once. diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index d730fddeb0..8cf882d569 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -6158,9 +6158,10 @@ comment at the start of cc-engine.el for more info." (setq s (cdr s)))) ((c-keyword-member kwd-sym 'c-flat-decl-block-kwds) (push 0 s)))) - ;; The failing `c-syntactic-re-search-forward' may have left us in the - ;; middle of a token, which might be a significant token. Fix this! - (c-beginning-of-current-token) + (when (> prev-match-pos 1) ; Has the search matched at least once? + ;; The failing `c-syntactic-re-search-forward' may have left us in the + ;; middle of a token, which might be a significant token. Fix this! + (c-beginning-of-current-token)) (cons (point) (cons bound-<> s))))) commit 802671493d7c18569dac47ca91a4b7d6e693aff6 Author: Po Lu Date: Mon Nov 7 18:05:54 2022 +0800 Avoid invalid values showing up in scroll valuators * src/xterm.c (xi_populate_device_from_info): Reset emacs_value when invalid_p is cleared. diff --git a/src/xterm.c b/src/xterm.c index abe9c7304e..1f14daa39f 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -5472,7 +5472,9 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, if (xi_device->valuators[c].number == tem->number) { xi_device->valuators[c].invalid_p = false; - xi_device->valuators[c].current_value = tem->current_value; + xi_device->valuators[c].current_value + = tem->current_value; + xi_device->valuators[c].emacs_value = 0.0; } } } commit 236703ca05382c9cdf4ce6a2dd2b3244c20d564d Author: Juri Linkov Date: Mon Nov 7 10:14:45 2022 +0200 * lisp/outline.el (outline-minor-mode): Ensure margins are either 0 or 1. This check is necessary to make it idempotent to multiple calls. diff --git a/lisp/outline.el b/lisp/outline.el index ef5249a146..a646f71db8 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -507,7 +507,9 @@ See the command `outline-mode' for more information on this mode." (when (eq (current-bidi-paragraph-direction) 'right-to-left) (setq-local outline--use-rtl t)) (setq-local outline--button-icons (outline--create-button-icons)) - (when (eq outline-minor-mode-use-buttons 'in-margins) + (when (and (eq outline-minor-mode-use-buttons 'in-margins) + (> 1 (if outline--use-rtl right-margin-width + left-margin-width))) (if outline--use-rtl (setq-local right-margin-width (1+ right-margin-width)) (setq-local left-margin-width (1+ left-margin-width))) @@ -542,7 +544,9 @@ See the command `outline-mode' for more information on this mode." (remove-overlays nil nil 'outline-highlight t)) (when outline-minor-mode-use-buttons (remove-overlays nil nil 'outline-button t) - (when (eq outline-minor-mode-use-buttons 'in-margins) + (when (and (eq outline-minor-mode-use-buttons 'in-margins) + (< 0 (if outline--use-rtl right-margin-width + left-margin-width))) (if outline--use-rtl (setq-local right-margin-width (1- right-margin-width)) (setq-local left-margin-width (1- left-margin-width)))