commit 372cc9e88c9dad94a29082269d2424723b28eaee (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Sat Oct 1 09:24:04 2022 +0300 Fix 'C-a' and 'C-e' under 'visual-line-mode' * src/xdisp.c (move_it_vertically_backward): Fix last change. (Bug#58210) diff --git a/src/xdisp.c b/src/xdisp.c index 55e74a3603..95e97a0bb8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10776,7 +10776,9 @@ move_it_vertically_backward (struct it *it, int dy) if (dy == 0) { /* Adjust nlines for increasing it at the beginning. */ - nlines -= !!it->bidi_p; + if (it2.bidi_p + && !(it2.line_wrap == WORD_WRAP && it2.continuation_lines_width)) + nlines--; /* DY == 0 means move to the start of the screen line. The value of nlines is > 0 if continuation lines were involved, or if the original IT position was at start of a line. */ commit 2ceb09315c0d590d6f50ff8649066f260e35e7fb Author: Paul Eggert Date: Fri Sep 30 17:49:07 2022 -0700 Update from Gnulib by running admin/merge-gnulib diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index c411a34aa7..c1306daef4 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -18,6 +18,7 @@ AC_DEFUN([gl_ASSERT_H], [AC_LANG_PROGRAM( [[#if defined __clang__ && __STDC_VERSION__ < 202311 #pragma clang diagnostic error "-Wc2x-extensions" + #pragma clang diagnostic error "-Wc++17-extensions" #endif #ifdef INCLUDE_ASSERT_H #include commit cd4208f6d8e4bcbfa326a2b70489ee3c0643e53f Author: Miha Rihtaršič Date: Fri Sep 30 20:28:15 2022 +0200 Rename comint-fl-* to comint-fontify-input-* and mention it in NEWS * lisp/comint.el (comint-fontify-input-mode): (comint--fontify-input-saved-jit-lock-contextually): (comint--fontify-input-on): (comint--fontify-input-off): (comint--fontify-input-ppss-flush-indirect): (comint--fontify-input-fontify-region): Replace comint-fl-* with comint-fontify-input-*. * lisp/ielm.el (ielm-fontify-input-enable): (ielm-fontify-input-enable): (ielm-indirect-setup-hook): (inferior-emacs-lisp-mode): Replace comint-fl-* with comint-fontify-input-*. * lisp/shell.el (shell-comint-fl-enable): (shell-mode): Replace comint-fl-* with comint-fontify-input-*. * etc/NEWS: Mention the new modes and how to disable or enable them (bug#58169). diff --git a/etc/NEWS b/etc/NEWS index d5aad9afc2..b9c4ef62ce 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1214,6 +1214,14 @@ When nil, this prevents comint from deleting the current input when inserting previous input using ''. The default is t, to preserve past behavior. +--- +*** New minor mode 'comint-fontify-input-mode'. +This minor mode is enabled by default in "*shell*" and "*ielm*" +buffers. It fontifies input text according to 'shell-mode' or +'emacs-lisp-mode' font-lock rules. Customize the user options +'shell-fontify-input-enable' and 'ielm-fontify-input-enable' to nil if +you don't want to enable input fontification by default. + ** Mwheel --- @@ -2520,6 +2528,12 @@ behavior, customize the new 'eshell-lisp-form-nil-is-failure' option. Enabling this will automatically kill a "*shell*" buffer as soon as the shell session terminates. +--- +*** New minor mode 'shell-highlight-undef-mode' +Customize 'shell-highlight-undef-enable' to t if you want to enable +this minor mode in "*shell*" buffers. It will highlight undefined +commands with a warning face as you type. + ** Calc +++ diff --git a/lisp/comint.el b/lisp/comint.el index 15c9388ea4..a70a75c648 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -1945,7 +1945,7 @@ Similarly for Soar, Scheme, etc." (when comint-highlight-input (add-text-properties beg end '( font-lock-face comint-highlight-input - comint--fl-inhibit-fontification t + comint--fontify-input-inhibit-fontification t front-sticky t ))) (unless comint-use-prompt-regexp ;; Give old user input a field property of `input', to @@ -3976,9 +3976,9 @@ fontification and other behavior of the indirect buffer." (defvar-local comint--indirect-buffer nil "Indirect buffer used for input fontification.") -(defvar-local comint--fl-saved-jit-lock-contextually nil) +(defvar-local comint--fontify-input-saved-jit-lock-contextually nil) -(define-minor-mode comint-fl-mode +(define-minor-mode comint-fontify-input-mode "Enable input fontification in the current comint buffer. This minor mode is useful if the current major mode derives from `comint-mode' and if `comint-indirect-setup-function' is set. @@ -3993,71 +3993,71 @@ This function signals an error if `comint-use-prompt-regexp' is non-nil. Input fontification isn't compatible with this setting." :lighter nil - (if comint-fl-mode + (if comint-fontify-input-mode (let ((success nil)) (unwind-protect (progn - (comint--fl-on) + (comint--fontify-input-on) (setq success t)) (unless success - (setq comint-fl-mode nil) - (comint--fl-off)))) - (comint--fl-off))) + (setq comint-fontify-input-mode nil) + (comint--fontify-input-off)))) + (comint--fontify-input-off))) -(defun comint--fl-on () +(defun comint--fontify-input-on () "Enable input fontification in the current comint buffer." - (comint--fl-off) + (comint--fontify-input-off) (when comint-use-prompt-regexp (error "Input fontification is incompatible with `comint-use-prompt-regexp'")) (add-function :around (local 'font-lock-fontify-region-function) - #'comint--fl-fontify-region) + #'comint--fontify-input-fontify-region) ;; `before-change-functions' are only run in the current buffer and ;; not in its indirect buffers, which means that we must manually ;; flush ppss cache (add-hook 'before-change-functions - #'comint--fl-ppss-flush-indirect 99 t) + #'comint--fontify-input-ppss-flush-indirect 99 t) ;; Set up contextual fontification (unless (booleanp jit-lock-contextually) - (setq comint--fl-saved-jit-lock-contextually + (setq comint--fontify-input-saved-jit-lock-contextually jit-lock-contextually) (setq-local jit-lock-contextually t) (when jit-lock-mode (jit-lock-mode t)))) -(defun comint--fl-off () +(defun comint--fontify-input-off () "Disable input fontification in the current comint buffer." (remove-function (local 'font-lock-fontify-region-function) - #'comint--fl-fontify-region) + #'comint--fontify-input-fontify-region) (remove-hook 'before-change-functions - #'comint--fl-ppss-flush-indirect t) + #'comint--fontify-input-ppss-flush-indirect t) ;; Reset contextual fontification - (when comint--fl-saved-jit-lock-contextually + (when comint--fontify-input-saved-jit-lock-contextually (setq-local jit-lock-contextually - comint--fl-saved-jit-lock-contextually) - (setq comint--fl-saved-jit-lock-contextually nil) + comint--fontify-input-saved-jit-lock-contextually) + (setq comint--fontify-input-saved-jit-lock-contextually nil) (when jit-lock-mode (jit-lock-mode t))) (font-lock-flush)) -(defun comint--fl-ppss-flush-indirect (beg &rest rest) +(defun comint--fontify-input-ppss-flush-indirect (beg &rest rest) (when-let ((buf (comint-indirect-buffer t))) (with-current-buffer buf (when (memq #'syntax-ppss-flush-cache before-change-functions) (apply #'syntax-ppss-flush-cache beg rest))))) -(defun comint--fl-fontify-region (fun beg end verbose) +(defun comint--fontify-input-fontify-region (fun beg end verbose) "Fontify process output and user input in the current comint buffer. First, fontify the region between BEG and END using FUN. Then fontify only the input text in the region with the help of an indirect buffer. VERBOSE is passed to the fontify-region functions. Skip fontification of input regions with non-nil -`comint--fl-inhibit-fontification' text property." +`comint--fontify-input-inhibit-fontification' text property." (pcase (funcall fun beg end verbose) (`(jit-lock-bounds ,beg1 . ,end1) (setq beg beg1 end end1))) @@ -4069,7 +4069,7 @@ functions. Skip fontification of input regions with non-nil (comint--intersect-regions nil (lambda (beg end) (unless (get-text-property - beg 'comint--fl-inhibit-fontification) + beg 'comint--fontify-input-inhibit-fontification) (font-lock-fontify-region beg end verbose))) beg end))) (`((jit-lock-bounds ,beg1 . ,_) . (jit-lock-bounds ,_ . ,end1)) diff --git a/lisp/ielm.el b/lisp/ielm.el index ad41cb1f6b..fd41afa243 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -474,11 +474,11 @@ nonempty, then flushes the buffer." ;;; Input fontification -(defcustom ielm-comint-fl-enable t +(defcustom ielm-fontify-input-enable t "Enable fontification of input in ielm buffers. This variable only has effect when creating an ielm buffer. Use -the command `comint-fl-mode' to toggle fontification of input in -an already existing ielm buffer." +the command `comint-fontify-input-mode' to toggle fontification +of input in an already existing ielm buffer." :type 'boolean :safe 'booleanp :version "29.1") @@ -556,8 +556,8 @@ Customized bindings may be defined in `ielm-map', which currently contains: :syntax-table emacs-lisp-mode-syntax-table :after-hook (and (null comint-use-prompt-regexp) - ielm-comint-fl-enable - (comint-fl-mode)) + ielm-fontify-input-enable + (comint-fontify-input-mode)) (setq comint-prompt-regexp (concat "^" (regexp-quote ielm-prompt))) (setq-local paragraph-separate "\\'") diff --git a/lisp/shell.el b/lisp/shell.el index 18bb372242..641f274045 100644 --- a/lisp/shell.el +++ b/lisp/shell.el @@ -308,10 +308,11 @@ for Shell mode only." (const :tag "on" t)) :group 'shell) -(defcustom shell-comint-fl-enable t +(defcustom shell-fontify-input-enable t "Enable fontification of input in shell buffers. This variable only has effect when the shell is started. Use the -command `comint-fl-mode' to toggle fontification of input." +command `comint-fontify-input-mode' to toggle fontification of +input." :type 'boolean :group 'shell :safe 'booleanp @@ -623,8 +624,8 @@ command." :interactive nil :after-hook (unless comint-use-prompt-regexp - (if shell-comint-fl-enable - (comint-fl-mode)) + (if shell-fontify-input-enable + (comint-fontify-input-mode)) (if shell-highlight-undef-enable (shell-highlight-undef-mode))) @@ -1664,8 +1665,8 @@ Similar to `executable-find', but use cache stored in (if buf (buffer-local-value 'default-directory buf) default-directory))) (cond - ;; Don't highlight command output. Mostly useful if - ;; `comint-fl-mode' is disabled. + ;; Don't fontify command output. Mostly useful if + ;; `comint-fontify-input-mode' is disabled. ((text-property-any beg (point) 'field 'output) nil) ((member cmd shell-highlight-undef-aliases) @@ -1696,7 +1697,7 @@ Similar to `executable-find', but use cache stored in (define-minor-mode shell-highlight-undef-mode "Highlight undefined shell commands and aliases. This minor mode is mostly useful in `shell-mode' buffers and -works better if `comint-fl-mode' is enabled." +works better if `comint-fontify-input-mode' is enabled." :init-value nil (if shell--highlight-undef-indirect (progn @@ -1706,7 +1707,7 @@ works better if `comint-fl-mode' is enabled." (with-current-buffer buf (font-lock-remove-keywords nil shell-highlight-undef-keywords)))) (font-lock-remove-keywords nil shell-highlight-undef-keywords)) - (remove-hook 'comint-fl-mode-hook + (remove-hook 'comint-fontify-input-mode-hook #'shell-highlight-undef-mode-restart t) (when shell-highlight-undef-mode @@ -1722,9 +1723,9 @@ works better if `comint-fl-mode' is enabled." (concat "\\(" "[;(){}`|&]" - (if comint-fl-mode - ;; `comint-fl-mode' already puts point-min on end of - ;; prompt + (if comint-fontify-input-mode + ;; `comint-fontify-input-mode' already puts + ;; point-min on end of prompt "" (concat "\\|" comint-prompt-regexp)) "\\|^" @@ -1740,7 +1741,7 @@ works better if `comint-fl-mode' is enabled." (lambda () (setq shell-highlight-undef-regexp regexp) (font-lock-add-keywords nil shell-highlight-undef-keywords t)))) - (cond (comint-fl-mode + (cond (comint-fontify-input-mode (setq shell--highlight-undef-indirect setup) (if-let ((buf (comint-indirect-buffer t))) (with-current-buffer buf @@ -1748,7 +1749,7 @@ works better if `comint-fl-mode' is enabled." (add-hook 'comint-indirect-setup-hook setup nil t))) (t (funcall setup)))) - (add-hook 'comint-fl-mode-hook + (add-hook 'comint-fontify-input-mode-hook #'shell-highlight-undef-mode-restart nil t)) (font-lock-flush)) @@ -1756,9 +1757,9 @@ works better if `comint-fl-mode' is enabled." (defun shell-highlight-undef-mode-restart () "If `shell-highlight-undef-mode' is on, restart it. `shell-highlight-undef-mode' performs its setup differently -depending on `comint-fl-mode'. It's useful to call this function -when switching `comint-fl-mode' in order to make -`shell-highlight-undef-mode' redo its setup." +depending on `comint-fontify-input-mode'. It's useful to call +this function when switching `comint-fontify-input-mode' in order +to make `shell-highlight-undef-mode' redo its setup." (when shell-highlight-undef-mode (shell-highlight-undef-mode 1))) commit 90744ff0be581b69cedea1194b7e78265bdb67a4 Author: Miha Rihtaršič Date: Fri Sep 30 20:07:03 2022 +0200 comint-fl: Prevent fontification of output as input * lisp/comint.el (comint-output-filter): Inhibit jit-lock fontification of inserted process output before marking it with the 'output' filed property (bug#58169). diff --git a/lisp/comint.el b/lisp/comint.el index e7d2136c84..15c9388ea4 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -2150,24 +2150,26 @@ Make backspaces delete the previous character." ;; insert-before-markers is a bad thing. XXX ;; Luckily we don't have to use it any more, we use ;; window-point-insertion-type instead. - (insert string) + (make-local-variable 'jit-lock-mode) + (let ((jit-lock-mode nil)) + (insert string) - ;; Advance process-mark - (set-marker (process-mark process) (point)) + ;; Advance process-mark + (set-marker (process-mark process) (point)) - (unless comint-inhibit-carriage-motion + (unless comint-inhibit-carriage-motion ;; Interpret any carriage motion characters (newline, backspace) (comint-carriage-motion comint-last-output-start (point))) - ;; Run these hooks with point where the user had it. - (goto-char saved-point) - (run-hook-with-args 'comint-output-filter-functions string) - (set-marker saved-point (point)) + ;; Run these hooks with point where the user had it. + (goto-char saved-point) + (run-hook-with-args 'comint-output-filter-functions string) + (set-marker saved-point (point)) - (goto-char (process-mark process)) ; In case a filter moved it. + (goto-char (process-mark process)) ; In case a filter moved it. - (unless comint-use-prompt-regexp - (comint--mark-as-output comint-last-output-start (point))) + (unless comint-use-prompt-regexp + (comint--mark-as-output comint-last-output-start (point)))) ;; Highlight the prompt, where we define `prompt' to mean ;; the most recent output that doesn't end with a newline. commit 22f0e777f3e91a9ad51bc901646804f629832c64 Author: Eli Zaretskii Date: Fri Sep 30 22:05:53 2022 +0300 ; * lisp/international/mule.el (set-terminal-coding-system): Doc fix. diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 7aa6e68103..6a794a8410 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1372,12 +1372,12 @@ For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. The default is determined by the selected language environment or by the previous use of this command. -TERMINAL may be a terminal object, a frame, or nil for the -selected frame's terminal. The setting has no effect on -graphical terminals. +Optional argument TERMINAL may be a terminal object or a frame, +and defaults to the selected frame's terminal. The setting has no +effect on graphical terminals. -By default, this function will redraw the current frame. If -INHIBIT-REFRESH is non-nil, this isn't done." +By default, this function will redraw the current frame; +optional argument INHIBIT-REFRESH, if non-nil, prevents that." (interactive (list (let ((default (if (and (not (terminal-coding-system)) default-terminal-coding-system) commit 83b9e03444e9701d2997415b79e8402145195a7d Author: Eli Zaretskii Date: Fri Sep 30 21:57:21 2022 +0300 ; * doc/emacs/emacs.texi (Top): Add new menu entry. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 6206dee485..727f5f93bf 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -853,6 +853,7 @@ Miscellaneous Commands and Features of VC * VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. * Version Headers:: Inserting version control headers into working files. +* Editing VC Commands:: Editing the VC shell commands that Emacs will run. Customizing VC commit f7b84345f8e646d7c1ac26551d7f8363ccf78222 Author: Eli Zaretskii Date: Fri Sep 30 21:55:38 2022 +0300 ; * doc/emacs/vc1-xtra.texi (Editing VC Commands): Fix wording. diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index a8ceb1b790..05d2144380 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -270,16 +270,17 @@ with the file's version control type. @findex vc-edit-next-command @kindex C-x v ! You can use the @kbd{C-x v !} (@code{vc-edit-next-command}) prefix -command to request an opportunity to edit the VC shell commands that -Emacs will run. This is primarily intended to make it possible to -access version control system-specific functionality without -complexifying either the VC command set or the backend API. +command to edit the shell command line that VC is about to run. This +is primarily intended to make it possible to add optional command-line +arguments to VCS commands without unnecessary complications of the VC +command set and its interfaces with the backend. For example, Git can produce logs of more than one branch, but @kbd{C-x v b l} (@code{vc-print-branch-log}) prompts for the name of just one branch. To obtain a log of more than one branch, you can -type @kbd{C-x v ! C-x v b l} and then append the names of additional -branches to the end of the @code{git log} command that VC prepares. +type @w{@kbd{C-x v ! C-x v b l}} and then append the names of +additional branches to the end of the @samp{git log} command that VC +is about to run. @node Customizing VC @subsection Customizing VC commit 63f033c2214db4baabf9f85b2a44cd3a9118b709 Author: Lars Ingebrigtsen Date: Fri Sep 30 19:38:25 2022 +0200 Further with-locale-environment refresh fixes * lisp/international/mule-cmds.el (set-display-table-and-terminal-coding-system): Allow inhibiting refresh. (set-locale-environment): Inhibit refresh in more paths (bug#58193). diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index 51147943dc..8bece9a3ee 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1909,8 +1909,11 @@ The default status is as follows: (reset-language-environment) -(defun set-display-table-and-terminal-coding-system (language-name &optional coding-system display) - "Set up the display table and terminal coding system for LANGUAGE-NAME." +(defun set-display-table-and-terminal-coding-system (language-name + &optional coding-system + display inhibit-refresh) + "Set up the display table and terminal coding system for LANGUAGE-NAME. +If INHIBIT-REFRESH, don't redraw the current frame." (let ((coding (get-language-info language-name 'unibyte-display))) (if (and coding (or (not coding-system) @@ -1923,7 +1926,8 @@ The default status is as follows: (when standard-display-table (dotimes (i 128) (aset standard-display-table (+ i 128) nil)))) - (set-terminal-coding-system (or coding-system coding) display))) + (set-terminal-coding-system (or coding-system coding) display + inhibit-refresh))) (defun set-language-environment (language-name) "Set up multilingual environment for using LANGUAGE-NAME. @@ -2811,7 +2815,7 @@ See also `locale-charset-language-names', `locale-language-names', (set-language-environment language-name)) (set-display-table-and-terminal-coding-system - language-name coding-system frame) + language-name coding-system frame inhibit-refresh) ;; Set the `keyboard-coding-system' if appropriate (tty ;; only). At least X and MS Windows can generate commit f270a9859d66078953dfeb2cbb064770e9a0749b Author: Sean Whitton Date: Fri Sep 30 09:20:26 2022 -0700 ; Fix some texinfo in last change diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index facc03dd66..a8ceb1b790 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -279,7 +279,7 @@ For example, Git can produce logs of more than one branch, but @kbd{C-x v b l} (@code{vc-print-branch-log}) prompts for the name of just one branch. To obtain a log of more than one branch, you can type @kbd{C-x v ! C-x v b l} and then append the names of additional -branches to the end of the 'git log' command that VC prepares. +branches to the end of the @code{git log} command that VC prepares. @node Customizing VC @subsection Customizing VC commit fdea378015caa202f2b08f6770f6bb915ccf20be Author: Sean Whitton Date: Sat Sep 24 16:17:56 2022 -0700 Add vc-edit-next-command * lisp/vc/vc.el (vc-read-revision): Override vc-filter-command-function back to its default value. (vc-print-branch-log): Remove recently-added prefix argument. (vc-edit-next-command): New command. * lisp/vc/vc-hooks.el (vc-prefix-map): Bind it to 'C-x v !'. * etc/NEWS: * doc/emacs/vc1-xtra.texi (Editing Shell Commands): Document it. diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi index 3ccad50715..facc03dd66 100644 --- a/doc/emacs/vc1-xtra.texi +++ b/doc/emacs/vc1-xtra.texi @@ -15,6 +15,7 @@ * VC Delete/Rename:: Deleting and renaming version-controlled files. * Revision Tags:: Symbolic names for revisions. * Version Headers:: Inserting version control headers into working files. +* Editing VC Commands:: Editing the VC shell commands that Emacs will run. @end menu @node Change Logs and VC @@ -263,6 +264,23 @@ elements of the form @code{(@var{regexp} . @var{format})}. Whenever part of the version header. A @samp{%s} in @var{format} is replaced with the file's version control type. +@node Editing VC Commands +@subsubsection Editing VC Commands + +@findex vc-edit-next-command +@kindex C-x v ! +You can use the @kbd{C-x v !} (@code{vc-edit-next-command}) prefix +command to request an opportunity to edit the VC shell commands that +Emacs will run. This is primarily intended to make it possible to +access version control system-specific functionality without +complexifying either the VC command set or the backend API. + +For example, Git can produce logs of more than one branch, but +@kbd{C-x v b l} (@code{vc-print-branch-log}) prompts for the name of +just one branch. To obtain a log of more than one branch, you can +type @kbd{C-x v ! C-x v b l} and then append the names of additional +branches to the end of the 'git log' command that VC prepares. + @node Customizing VC @subsection Customizing VC diff --git a/etc/NEWS b/etc/NEWS index aad1a17ae7..d5aad9afc2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1754,6 +1754,13 @@ commands. This command marks files based on a regexp. If given a prefix argument, unmark instead. ++++ +*** New command 'C-x v !' ('vc-edit-next-command') +This prefix command requests editing of the next VC shell command +before execution. For example, in a Git repository, you can produce a +log of more than one branch by typing 'C-x v ! C-x v b l' and then +appending additional branch names to the 'git log' command. + --- *** 'C-x v v' in a diffs buffer allows to commit only some of the changes. This command is intended to allow you to commit only some of the diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el index 7f0d9e4d86..6ad26cfe67 100644 --- a/lisp/vc/vc-hooks.el +++ b/lisp/vc/vc-hooks.el @@ -882,7 +882,8 @@ In the latter case, VC mode is deactivated for this buffer." "=" #'vc-diff "D" #'vc-root-diff "~" #'vc-revision-other-window - "x" #'vc-delete-file) + "x" #'vc-delete-file + "!" #'vc-edit-next-command) (fset 'vc-prefix-map vc-prefix-map) (define-key ctl-x-map "v" 'vc-prefix-map) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 24300e014a..25bb0c848d 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1917,8 +1917,11 @@ Return t if the buffer had changes, nil otherwise." (setq files (cadr vc-fileset)) (setq backend (car vc-fileset)))) ((null backend) (setq backend (vc-backend (car files))))) - (let ((completion-table - (vc-call-backend backend 'revision-completion-table files))) + ;; Override any `vc-filter-command-function' value, as user probably + ;; doesn't want to edit the command to get the completions. + (let* ((vc-filter-command-function #'list) + (completion-table + (vc-call-backend backend 'revision-completion-table files))) (if completion-table (completing-read prompt completion-table nil nil initial-input 'vc-revision-history default) @@ -2744,28 +2747,17 @@ with its diffs (if the underlying VCS supports that)." (setq vc-parent-buffer-name nil))) ;;;###autoload -(defun vc-print-branch-log (branch &optional arg) - "Show the change log for BRANCH root in a window. -Optional prefix ARG non-nil requests an opportunity for the user -to edit the VC shell command that will be run to generate the -log." - ;; The original motivation for ARG was to make it possible to - ;; produce a log of more than one Git branch without modifying the - ;; print-log VC API. The user can append the other branches to the - ;; command line arguments to 'git log'. See bug#57807. +(defun vc-print-branch-log (branch) + "Show the change log for BRANCH root in a window." (interactive (let* ((backend (vc-responsible-backend default-directory)) (rootdir (vc-call-backend backend 'root default-directory))) (list - (vc-read-revision "Branch to log: " (list rootdir) backend) - current-prefix-arg))) + (vc-read-revision "Branch to log: " (list rootdir) backend)))) (when (equal branch "") (error "No branch specified")) (let* ((backend (vc-responsible-backend default-directory)) - (rootdir (vc-call-backend backend 'root default-directory)) - (vc-filter-command-function (if arg - #'vc-user-edit-command - vc-filter-command-function))) + (rootdir (vc-call-backend backend 'root default-directory))) (vc-print-log-internal backend (list rootdir) branch t (when (> vc-log-show-limit 0) vc-log-show-limit)))) @@ -3243,6 +3235,33 @@ log entries should be gathered." (vc-call-backend (vc-responsible-backend default-directory) 'update-changelog args)) +(defvar vc-filter-command-function) + +;;;###autoload +(defun vc-edit-next-command () + "Request editing the next VC shell command before execution. +This is a prefix command. It affects only a VC command executed +immediately after this one." + (interactive) + (letrec ((minibuffer-depth (minibuffer-depth)) + (command this-command) + (keys (key-description (this-command-keys))) + (old vc-filter-command-function) + (echofun (lambda () keys)) + (postfun + (lambda () + (unless (or (eq this-command command) + (> (minibuffer-depth) minibuffer-depth)) + (remove-hook 'post-command-hook postfun) + (remove-hook 'prefix-command-echo-keystrokes-functions + echofun) + (setq vc-filter-command-function old))))) + (add-hook 'post-command-hook postfun) + (add-hook 'prefix-command-echo-keystrokes-functions echofun) + (setq vc-filter-command-function + (lambda (&rest args) + (apply #'vc-user-edit-command (apply old args)))))) + (defun vc-default-responsible-p (_backend _file) "Indicate whether BACKEND is responsible for FILE. The default is to return nil always." commit 16015288e1d89d6c8e9fd98ac19f32c1290759b7 Author: Mattias Engdegård Date: Fri Sep 30 14:09:47 2022 +0200 Rectify string= documentation * doc/lispref/strings.texi (Text Comparison): Describe the current behaviour since about 20 years back. diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index ba247a3eda..cf961e9e7c 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -539,21 +539,10 @@ string or symbol, @code{string=} signals an error. @result{} nil @end example -For technical reasons, a unibyte and a multibyte string are -@code{equal} if and only if they contain the same sequence of -character codes and all these codes are either in the range 0 through -127 (@acronym{ASCII}) or 160 through 255 (@code{eight-bit-graphic}). -However, when a unibyte string is converted to a multibyte string, all -characters with codes in the range 160 through 255 are converted to -characters with higher codes, whereas @acronym{ASCII} characters -remain unchanged. Thus, a unibyte string and its conversion to -multibyte are only @code{equal} if the string is all @acronym{ASCII}. -Character codes 160 through 255 are not entirely proper in multibyte -text, even though they can occur. As a consequence, the situation -where a unibyte and a multibyte string are @code{equal} without both -being all @acronym{ASCII} is a technical oddity that very few Emacs -Lisp programmers ever get confronted with. @xref{Text -Representations}. +A unibyte and a multibyte string are equal in the sense of +@code{string=} if and only if they contain the same sequence of +character codes all being in the range 0--127 (@acronym{ASCII}). +@xref{Text Representations}. @end defun @defun string-equal string1 string2 commit ec5af48a180f732d04537ef0d5632a50d29e3ce0 Author: Mattias Engdegård Date: Fri Sep 30 15:50:59 2022 +0200 Strengthen string-lessp tests * test/src/fns-tests.el (fns-tests--string-lessp-cases) (fns-tests-string-lessp): Check more cases, and in a more robust way. diff --git a/test/src/fns-tests.el b/test/src/fns-tests.el index 3f3d9a0285..9a2bd5cef3 100644 --- a/test/src/fns-tests.el +++ b/test/src/fns-tests.el @@ -131,47 +131,54 @@ (should (equal [t t t t t nil nil nil nil nil] (vconcat (nreverse A)))))) (defconst fns-tests--string-lessp-cases - '((a 97 error) - (97 "a" error) - ("abc" "abd" t) - ("abd" "abc" nil) - (abc "abd" t) - ("abd" abc nil) - (abc abd t) - (abd abc nil) - ("" "" nil) - ("" " " t) - (" " "" nil) - ("abc" "abcd" t) - ("abcd" "abc" nil) - ("abc" "abc" nil) - (abc abc nil) - ("\0" "" nil) - ("" "\0" t) - ("~" "\x80" t) - ("\x80" "\x80" nil) - ("\xfe" "\xff" t) - ("Munchen" "München" t) - ("München" "Munchen" nil) - ("München" "München" nil) - ("Ré" "Réunion" t))) - + `(("abc" < "abd") + (abc < "abd") + (abc < abd) + ("" = "") + ("" < " ") + ("abc" < "abcd") + ("abc" = "abc") + (abc = abc) + ("" < "\0") + ("~" < "\x80") + ("\x80" = "\x80") + ("\xfe" < "\xff") + ("Munchen" < "München") + ("München" = "München") + ("Ré" < "Réunion") + ("abc" = ,(string-to-multibyte "abc")) + (,(string-to-multibyte "abc") = ,(string-to-multibyte "abc")) + ("abc" < ,(string-to-multibyte "abd")) + (,(string-to-multibyte "abc") < "abd") + (,(string-to-multibyte "abc") < ,(string-to-multibyte "abd")) + (,(string-to-multibyte "\x80") = ,(string-to-multibyte "\x80")) + + ;; Cases concerning the ordering of raw bytes: these are + ;; troublesome because the current `string<' order is not very useful as + ;; it equates unibyte 80..FF with multibyte U+0080..00FF, and is also + ;; inconsistent with `string=' (see bug#58168). + ;;("\x80" < ,(string-to-multibyte "\x80")) + ;;("\xff" < ,(string-to-multibyte "\x80")) + ;;("ü" < "\xfc") + ;;("ü" < ,(string-to-multibyte "\xfc")) + ) + "List of (A REL B) where REL is the relation (`<' or `=') between A and B.") (ert-deftest fns-tests-string-lessp () ;; Exercise both `string-lessp' and its alias `string<', both directly ;; and in a function (exercising its bytecode). - (dolist (lessp (list #'string-lessp #'string< - (lambda (a b) (string-lessp a b)) - (lambda (a b) (string< a b)))) - (ert-info ((prin1-to-string lessp) :prefix "function: ") + (dolist (fun (list #'string-lessp #'string< + (lambda (a b) (string-lessp a b)) + (lambda (a b) (string< a b)))) + (ert-info ((prin1-to-string fun) :prefix "function: ") + (should-error (funcall fun 'a 97)) + (should-error (funcall fun 97 "a")) (dolist (case fns-tests--string-lessp-cases) (ert-info ((prin1-to-string case) :prefix "case: ") - (pcase case - (`(,x ,y error) - (should-error (funcall lessp x y))) - (`(,x ,y ,expected) - (should (equal (funcall lessp x y) expected))))))))) - + (pcase-let ((`(,x ,rel ,y) case)) + (cl-assert (memq rel '(< =))) + (should (equal (funcall fun x y) (eq rel '<))) + (should (equal (funcall fun y x) nil)))))))) (ert-deftest fns-tests-compare-strings () (should-error (compare-strings)) commit 123506f9ca33bbca57baeac74ebe7aaf462eddc5 Author: Mattias Engdegård Date: Fri Sep 30 13:59:45 2022 +0200 Speed up string-lessp further * src/fns.c (Fstring_lessp): Use the memcmp fast path for ASCII-only multibyte strings as well. Specialise loops on argument multibyteness. diff --git a/src/fns.c b/src/fns.c index 3e5a83d03d..22e66d3653 100644 --- a/src/fns.c +++ b/src/fns.c @@ -449,25 +449,55 @@ Symbols are also allowed; their print names are used instead. */) CHECK_STRING (string2); ptrdiff_t n = min (SCHARS (string1), SCHARS (string2)); - if (!STRING_MULTIBYTE (string1) && !STRING_MULTIBYTE (string2)) + + if ((!STRING_MULTIBYTE (string1) || SCHARS (string1) == SBYTES (string1)) + && (!STRING_MULTIBYTE (string2) || SCHARS (string2) == SBYTES (string2))) { - /* Both arguments are unibyte (hot path). */ + /* Each argument is either unibyte or all-ASCII multibyte: + we can compare bytewise. + (Arbitrary multibyte strings cannot be compared bytewise because + that would give a different order for raw bytes 80..FF.) */ int d = memcmp (SSDATA (string1), SSDATA (string2), n); return d < 0 || (d == 0 && n < SCHARS (string2)) ? Qt : Qnil; } - - ptrdiff_t i1 = 0, i1_byte = 0, i2 = 0, i2_byte = 0; - - while (i1 < n) + else if (STRING_MULTIBYTE (string1) && STRING_MULTIBYTE (string2)) { - /* When we find a mismatch, we must compare the - characters, not just the bytes. */ - int c1 = fetch_string_char_advance (string1, &i1, &i1_byte); - int c2 = fetch_string_char_advance (string2, &i2, &i2_byte); - if (c1 != c2) - return c1 < c2 ? Qt : Qnil; + ptrdiff_t i1 = 0, i1_byte = 0, i2 = 0, i2_byte = 0; + while (i1 < n) + { + int c1 = fetch_string_char_advance_no_check (string1, &i1, &i1_byte); + int c2 = fetch_string_char_advance_no_check (string2, &i2, &i2_byte); + if (c1 != c2) + return c1 < c2 ? Qt : Qnil; + } + return i1 < SCHARS (string2) ? Qt : Qnil; + } + else if (STRING_MULTIBYTE (string1)) + { + /* string1 multibyte, string2 unibyte */ + ptrdiff_t i1 = 0, i1_byte = 0, i2 = 0; + while (i1 < n) + { + int c1 = fetch_string_char_advance_no_check (string1, &i1, &i1_byte); + int c2 = SREF (string2, i2++); + if (c1 != c2) + return c1 < c2 ? Qt : Qnil; + } + return i1 < SCHARS (string2) ? Qt : Qnil; + } + else + { + /* string1 unibyte, string2 multibyte */ + ptrdiff_t i1 = 0, i2 = 0, i2_byte = 0; + while (i1 < n) + { + int c1 = SREF (string1, i1++); + int c2 = fetch_string_char_advance_no_check (string2, &i2, &i2_byte); + if (c1 != c2) + return c1 < c2 ? Qt : Qnil; + } + return i1 < SCHARS (string2) ? Qt : Qnil; } - return i1 < SCHARS (string2) ? Qt : Qnil; } DEFUN ("string-version-lessp", Fstring_version_lessp, commit b858acde25160631ce7e0e13adc579ca1a4135fb Author: Lars Ingebrigtsen Date: Fri Sep 30 16:14:20 2022 +0200 Don't refresh the frame in with-locale-environment * lisp/international/mule-cmds.el (with-locale-environment): Inhibit refresh so that there's no flickering (bug#58193). (set-locale-environment): Allow inhibiting the refresh. * lisp/international/mule.el (set-terminal-coding-system): Ditto. diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index e1d0df6e3e..51147943dc 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -2666,11 +2666,11 @@ For example, translate \"swedish\" into \"sv_SE.ISO8859-1\"." `(let ((,current current-locale-environment)) (unwind-protect (progn - (set-locale-environment ,locale-name) + (set-locale-environment ,locale-name nil t) ,@body) - (set-locale-environment ,current))))) + (set-locale-environment ,current nil t))))) -(defun set-locale-environment (&optional locale-name frame) +(defun set-locale-environment (&optional locale-name frame inhibit-refresh) "Set up multilingual environment for using LOCALE-NAME. This sets the language environment, the coding system priority, the default input method and sometimes other things. @@ -2699,6 +2699,9 @@ This function sets the `current-locale-environment' variable. To change the locale temporarily, `with-locale-environment' can be used. +By default, this function will redraw the current frame. If +INHIBIT-REFRESH is non-nil, this isn't done. + See also `locale-charset-language-names', `locale-language-names', `locale-preferred-coding-systems' and `locale-coding-system'." (interactive (list (completing-read "Set environment for locale: " @@ -2865,7 +2868,7 @@ See also `locale-charset-language-names', `locale-language-names', (or output-coding (setq output-coding code-page-coding)) (unless frame (setq locale-coding-system locale-coding)) (set-keyboard-coding-system code-page-coding frame) - (set-terminal-coding-system output-coding frame) + (set-terminal-coding-system output-coding frame inhibit-refresh) (setq default-file-name-coding-system ansi-code-page-coding)))) (when (eq system-type 'darwin) @@ -2876,7 +2879,7 @@ See also `locale-charset-language-names', `locale-language-names', ;; the locale. (when (and (null window-system) (equal (getenv "TERM_PROGRAM" frame) "Apple_Terminal")) - (set-terminal-coding-system 'utf-8) + (set-terminal-coding-system 'utf-8 nil inhibit-refresh) (set-keyboard-coding-system 'utf-8))) ;; Default to A4 paper if we're not in a C, POSIX or US locale. diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 5cca5bf707..7aa6e68103 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1362,7 +1362,8 @@ to CODING-SYSTEM." This is normally set according to the selected language environment. See also the command `set-terminal-coding-system'.") -(defun set-terminal-coding-system (coding-system &optional terminal) +(defun set-terminal-coding-system (coding-system &optional terminal + inhibit-refresh) "Set coding system of terminal output to CODING-SYSTEM. All text output to TERMINAL will be encoded with the specified coding system. @@ -1373,7 +1374,10 @@ or by the previous use of this command. TERMINAL may be a terminal object, a frame, or nil for the selected frame's terminal. The setting has no effect on -graphical terminals." +graphical terminals. + +By default, this function will redraw the current frame. If +INHIBIT-REFRESH is non-nil, this isn't done." (interactive (list (let ((default (if (and (not (terminal-coding-system)) default-terminal-coding-system) @@ -1387,7 +1391,8 @@ graphical terminals." (if coding-system (setq default-terminal-coding-system coding-system)) (set-terminal-coding-system-internal coding-system terminal) - (redraw-frame)) + (unless inhibit-refresh + (redraw-frame))) (defvar default-keyboard-coding-system nil "Default value of the keyboard coding system. commit a80cfb74730da99b776c2ee7342d522840dd3456 Author: Lars Ingebrigtsen Date: Fri Sep 30 16:02:11 2022 +0200 Make gnus-user-agent less verbose * lisp/gnus/gnus.el (gnus-user-agent): Don't include the Emacs/OS version for privacy reasons (bug#58171). diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el index 64fc91ccff..778a46dab3 100644 --- a/lisp/gnus/gnus.el +++ b/lisp/gnus/gnus.el @@ -2235,7 +2235,7 @@ Disabling the agent may result in noticeable loss of performance." (symbol :tag "Parameter") (sexp :tag "Value")))) -(defcustom gnus-user-agent '(emacs gnus type) +(defcustom gnus-user-agent '(gnus) "Which information should be exposed in the User-Agent header. Can be a list of symbols or a string. Valid symbols are `gnus' @@ -2243,7 +2243,7 @@ Can be a list of symbols or a string. Valid symbols are `gnus' addition to the Emacs version, you can add `config' (show system configuration) or `type' (show system type). If you set it to a string, be sure to use a valid format, see RFC 2616." - :version "22.1" + :version "29.1" :group 'gnus-message :type '(choice (list (set :inline t (const :value gnus :tag "Gnus version") commit b51a06f24d1b239cf6cec824f3a4c967642a7598 Author: Lars Ingebrigtsen Date: Fri Sep 30 15:12:21 2022 +0200 Fix the `dictionary' parent defgroup * lisp/net/dictionary.el (dictionary): The `hypermedia' group doesn't exist, so put it in the same parent group that `ispell' uses (bug#58178). diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 43dd28ff6d..4c52382c67 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -59,7 +59,7 @@ the existing connection." (defgroup dictionary nil "Client for accessing the dictd server based dictionaries." - :group 'hypermedia) + :group 'applications) (defgroup dictionary-proxy nil "Proxy configuration options for the dictionary client." commit b23e062d7463b76d25dfd9ba4a80c1848a448e42 Author: Jose A. Ortega Ruiz Date: Fri Sep 30 15:08:40 2022 +0200 docview: fixes for imenu generation * lisp/doc-view.el: (doc-view--pdf-outline): (doc-view-imenu-index): (doc-view-imenu-setup): Fix multiple empty index generation for documents without an outline, caching the result (see discussion in bug#58103). (doc-view--imenu-subtree): Fix for nested imenus (bug introduced in commit fe002cc8ce) (bug#58180). diff --git a/lisp/doc-view.el b/lisp/doc-view.el index 80c4fd21de..b1ea90c212 100644 --- a/lisp/doc-view.el +++ b/lisp/doc-view.el @@ -1900,6 +1900,9 @@ If BACKWARD is non-nil, jump to the previous match." (defconst doc-view--outline-rx "[^\t]+\\(\t+\\)\"\\(.+\\)\"\t#\\(?:page=\\)?\\([0-9]+\\)") +(defvar-local doc-view--outline nil + "Cached PDF outline, so that it is only computed once per document.") + (defun doc-view--pdf-outline (&optional file-name) "Return a list describing the outline of FILE-NAME. Return a list describing the current file if FILE-NAME is nil. @@ -1907,19 +1910,20 @@ Return a list describing the current file if FILE-NAME is nil. Each element in the returned list contains information about a section's title, nesting level and page number. The list is flat: its tree structure is extracted by `doc-view--imenu-subtree'." - (let* ((outline nil) - (fn (or file-name (buffer-file-name))) - (fn (shell-quote-argument (expand-file-name fn)))) - (with-temp-buffer - (insert (shell-command-to-string (format "mutool show %s outline" fn))) - (goto-char (point-min)) - (while (re-search-forward doc-view--outline-rx nil t) - (push `((level . ,(length (match-string 1))) - (title . ,(replace-regexp-in-string "\\\\[rt]" " " - (match-string 2))) - (page . ,(string-to-number (match-string 3)))) - outline))) - (nreverse outline))) + (let ((fn (or file-name (buffer-file-name)))) + (when fn + (let ((outline nil) + (fn (shell-quote-argument (expand-file-name fn)))) + (with-temp-buffer + (insert (shell-command-to-string (format "mutool show %s outline" fn))) + (goto-char (point-min)) + (while (re-search-forward doc-view--outline-rx nil t) + (push `((level . ,(length (match-string 1))) + (title . ,(replace-regexp-in-string "\\\\[rt]" " " + (match-string 2))) + (page . ,(string-to-number (match-string 3)))) + outline))) + (nreverse outline))))) (defun doc-view--imenu-subtree (outline act) "Construct a tree of imenu items for the given outline list and action. @@ -1932,7 +1936,8 @@ entries at an upper level." (nested (not doc-view-imenu-flatten)) (index nil)) (while (and (car outline) - (or nested (<= level (alist-get 'level (car outline))))) + (or (not nested) + (<= level (alist-get 'level (car outline))))) (let-alist (car outline) (let ((title (format-spec doc-view-imenu-title-format `((?t . ,.title) (?p . ,.page))))) @@ -1953,16 +1958,18 @@ For extensibility, callers can specify a FILE-NAME to indicate the buffer other than the current buffer, and a jumping function GOTO-PAGE-FN other than `doc-view-goto-page'." (let* ((goto (or goto-page-fn 'doc-view-goto-page)) - (act (lambda (_name _pos page) (funcall goto page)))) - (car (doc-view--imenu-subtree (doc-view--pdf-outline file-name) act)))) + (act (lambda (_name _pos page) (funcall goto page))) + (outline (or doc-view--outline (doc-view--pdf-outline file-name)))) + (car (doc-view--imenu-subtree outline act)))) (defun doc-view-imenu-setup () "Set up local state in the current buffer for imenu, if needed." (when (and doc-view-imenu-enabled (executable-find "mutool")) (setq-local imenu-create-index-function #'doc-view-imenu-index imenu-submenus-on-top nil - imenu-sort-function nil) - (imenu-add-to-menubar "Outline"))) + imenu-sort-function nil + doc-view--outline (doc-view--pdf-outline)) + (when doc-view--outline (imenu-add-to-menubar "Outline")))) ;;;; User interface commands and the mode commit 0332142e8e78b49b4f98438be21d2868e738986b Author: Lars Ingebrigtsen Date: Fri Sep 30 15:07:31 2022 +0200 Fix rename-visited-file when renaming to a directory name * lisp/files.el (rename-visited-file): Allow renaming to a directory file name (bug#58182). diff --git a/lisp/files.el b/lisp/files.el index 5463f3b5ec..10b156fb30 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4866,6 +4866,14 @@ Interactively, this prompts for NEW-LOCATION." (expand-file-name (file-name-nondirectory (buffer-name)) default-directory))))) + ;; If the user has given a directory name, the file should be moved + ;; there (under the same file name). + (when (file-directory-p new-location) + (unless buffer-file-name + (user-error "Can't rename buffer to a directory file name")) + (setq new-location (expand-file-name + (file-name-nondirectory buffer-file-name) + new-location))) (when (and buffer-file-name (file-exists-p buffer-file-name)) (rename-file buffer-file-name new-location)) commit a42dd0c87d27b706574923c89b50519b8893934d Author: Lars Ingebrigtsen Date: Fri Sep 30 14:48:51 2022 +0200 Improve message-sendmail-f-is-evil documentation * lisp/gnus/message.el (message-sendmail-f-is-evil): Move some of the explanation here. * lisp/mail/feedmail.el (feedmail-sendmail-f-doesnt-sell-me-out): Refer to message-sendmail-f-is-evil (bug#58185). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index e19ac76869..084dce65f0 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -888,9 +888,22 @@ symbol `never', the posting is not allowed. If it is the symbol ;; FIXME: This is related to `mail-specify-envelope-from' but works ;; differently (bug#36937). nil - "Non-nil means don't add \"-f username\" to the sendmail command line. -See `feedmail-sendmail-f-doesnt-sell-me-out' for an explanation -of what the \"-f\" parameter does." + "Non-nil means don't add \"-f username\" to the \"sendmail\" command line. +The \"sendmail\" program has a useful feature to let you set the +envelope FROM address via a command line option, \"-f\". +Unfortunately, it also has a widely disliked default behavior of +disclosing your actual user name anyway by inserting an +unattractive warning in the headers. It looks something like +this: + + X-Authentication-Warning: u1.example.com: niceguy set + sender to niceguy@example.com using -f + +It is possible to configure \"sendmail\" to not do this, but such a +reconfiguration is not an option for some users. + +Note that this user option is mostly useful for actual \"sendmail\" +installations, which are rare these days." :group 'message-sending :link '(custom-manual "(message)Mail Variables") :type 'boolean) diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el index 989a8b3cd6..2ae916e3ac 100644 --- a/lisp/mail/feedmail.el +++ b/lisp/mail/feedmail.el @@ -614,29 +614,12 @@ to arrange for the message to get a From: line." (defcustom feedmail-sendmail-f-doesnt-sell-me-out nil - "Whether sendmail should issue a warning header if called with \"-f\". -The sendmail program has a useful feature to let you set the envelope FROM -address via a command line option, \"-f\". Unfortunately, it also has a widely -disliked default behavior of selling you out if you do that by inserting -an unattractive warning in the headers. It looks something like this: - - X-Authentication-Warning: u1.example.com: niceguy set - sender to niceguy@example.com using -f - -It is possible to configure sendmail to not do this, but such a -reconfiguration is not an option for many users. As this is the -default behavior of most sendmail installations, one can mostly -only wish it were otherwise. If feedmail believes the sendmail -program will sell you out this way, it won't use the \"-f\" -option when calling sendmail. If it doesn't think sendmail will -sell you out, it will use the \"-f\" \(since it is a handy -feature). You control what feedmail thinks with this variable. -The default is nil, meaning that feedmail will believe that -sendmail will sell you out." + "If non-nil, call \"sendmail\" with \"-f\". +See `message-sendmail-f-is-evil' for an explanation of what the +\"-f\" parameter does." :version "24.1" :group 'feedmail-headers - :type 'boolean -) + :type 'boolean) (defcustom feedmail-deduce-envelope-from t commit 3553904a90a242b7ee7b48607ac02cf57e2ab753 Author: Eli Zaretskii Date: Fri Sep 30 15:38:22 2022 +0300 Fix some issues with vertical-motion in bidi-reordered text This fixes some uses of vertical-motion when a screen line starts withcharacters of directionality that is opposite to the current paragraph's base direction. * src/xdisp.c (move_it_vertically_backward): Adjust NLINES to compensate for its increasing when DY == 0. diff --git a/src/xdisp.c b/src/xdisp.c index 1f6f35e6c0..55e74a3603 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10709,6 +10709,11 @@ move_it_vertically_backward (struct it *it, int dy) /* Estimate how many newlines we must move back. */ nlines = max (1, dy / default_line_pixel_height (it->w)); + /* Move one line more back, for the (rare) situation where we have + bidi-reordered continued lines, and we start from the top-most + screen line, which is the last in logical order. */ + if (it->bidi_p && dy == 0) + nlines++; if (it->line_wrap == TRUNCATE || nchars_per_row == 0) pos_limit = BEGV; else @@ -10720,11 +10725,6 @@ move_it_vertically_backward (struct it *it, int dy) while (nlines-- && IT_CHARPOS (*it) > pos_limit) back_to_previous_visible_line_start (it); - /* Move one line more back, for the (rare) situation where we have - bidi-reordered continued lines, and we start from the top-most - screen line, which is the last in logical order. */ - if (it->bidi_p && dy == 0) - back_to_previous_visible_line_start (it); /* Reseat the iterator here. When moving backward, we don't want reseat to skip forward over invisible text, set up the iterator to deliver from overlay strings at the new position etc. So, @@ -10775,6 +10775,8 @@ move_it_vertically_backward (struct it *it, int dy) if (dy == 0) { + /* Adjust nlines for increasing it at the beginning. */ + nlines -= !!it->bidi_p; /* DY == 0 means move to the start of the screen line. The value of nlines is > 0 if continuation lines were involved, or if the original IT position was at start of a line. */