commit a573d6bd88afe9a60728f0b63a45f44a6ff98ce2 (HEAD, refs/remotes/origin/master) Author: Juri Linkov Date: Fri Aug 27 09:24:07 2021 +0300 Replace flyspell-use-mouse-3-for-menu with context-menu-mode (bug#50067) * doc/emacs/fixit.texi (Spelling): Replace mentions of flyspell-use-mouse-3-for-menu with context-menu-mode. * lisp/mouse.el (context-menu-map): Use the function from the text property context-menu-function at mouse click event. * lisp/textmodes/flyspell.el (flyspell--set-use-mouse-3-for-menu): Remove function. (flyspell-use-mouse-3-for-menu): Remove defcustom added recently in 28.1. (flyspell-context-menu): New function. (flyspell-mode): Don't call flyspell--set-use-mouse-3-for-menu. (flyspell-mode-on): Replace flyspell-use-mouse-3-for-menu with context-menu-mode. (make-flyspell-overlay): When context-menu-mode is non-nil, put overlay context-menu-function with flyspell-context-menu instead of using keymap flyspell-mouse-map. diff --git a/doc/emacs/fixit.texi b/doc/emacs/fixit.texi index b558ebc3fd..85cdbff5fa 100644 --- a/doc/emacs/fixit.texi +++ b/doc/emacs/fixit.texi @@ -462,10 +462,9 @@ use @code{flyspell-region} or @code{flyspell-buffer} for that. When Flyspell mode highlights a word as misspelled, you can click on it with @kbd{mouse-2} (@code{flyspell-correct-word}) to display a menu of possible corrections and actions. If you want this menu on -@kbd{mouse-3} instead, customize the variable -@code{flyspell-use-mouse-3-for-menu}. In addition, @kbd{C-.} or -@kbd{@key{ESC}-@key{TAB}} (@code{flyspell-auto-correct-word}) will -propose various successive corrections for the word at point, and +@kbd{mouse-3} instead, enable @code{context-menu-mode}. In addition, +@kbd{C-.} or @kbd{@key{ESC}-@key{TAB}} (@code{flyspell-auto-correct-word}) +will propose various successive corrections for the word at point, and @w{@kbd{C-c $}} (@code{flyspell-correct-word-before-point}) will pop up a menu of possible corrections. Of course, you can always correct the misspelled word by editing it manually in any way you like. diff --git a/etc/NEWS b/etc/NEWS index 78aca8cd54..246c89759f 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2875,8 +2875,7 @@ like 'flymake-mode-line-error-counter', When Flyspell mode highlights a word as misspelled, you can click on it to display a menu of possible corrections and actions. You can now easily bind this menu to 'down-mouse-3' (usually the right mouse button) -instead of 'mouse-2' (the default) by customizing the new user option -'flyspell-use-mouse-3-for-menu'. +instead of 'mouse-2' (the default) by enabling 'context-menu-mode'. --- *** The current dictionary is now displayed in the minor mode lighter. diff --git a/lisp/mouse.el b/lisp/mouse.el index 8b20963842..7d3ed9a0e4 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -307,10 +307,15 @@ the same menu with changes such as added new menu items." (defun context-menu-map () "Return composite menu map." (let ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t)))) - (run-hook-wrapped 'context-menu-functions - (lambda (fun) - (setq menu (funcall fun menu)) - nil)) + (let ((fun (mouse-posn-property (event-start last-input-event) + 'context-menu-function))) + (if (functionp fun) + (setq menu (funcall fun menu)) + (run-hook-wrapped 'context-menu-functions + (lambda (fun) + (setq menu (funcall fun menu)) + nil)))) + ;; TODO: remove double separators (when (functionp context-menu-filter-function) (setq menu (funcall context-menu-filter-function menu))) menu)) diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 836d889a1c..975f540936 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -442,22 +442,6 @@ like \"Some." map) "Minor mode keymap for Flyspell mode--for the whole buffer.") -;; correct on mouse 3 -(defun flyspell--set-use-mouse-3-for-menu (var value) - (set-default var value) - (if value - (progn (define-key flyspell-mouse-map [mouse-2] nil) - (define-key flyspell-mouse-map [down-mouse-3] 'flyspell-correct-word)) - (define-key flyspell-mouse-map [mouse-2] 'flyspell-correct-word) - (define-key flyspell-mouse-map [down-mouse-3] nil))) - -(defcustom flyspell-use-mouse-3-for-menu nil - "Non-nil means to bind `mouse-3' to `flyspell-correct-word'. -If this is set, also unbind `mouse-2'." - :type 'boolean - :set 'flyspell--set-use-mouse-3-for-menu - :version "28.1") - ;; dash character machinery (defvar-local flyspell-consider-dash-as-word-delimiter-flag nil "Non-nil means that the `-' char is considered as a word delimiter.") @@ -486,6 +470,13 @@ See also `flyspell-duplicate-distance'." (defvar flyspell-overlay nil) +(defun flyspell-context-menu (_menu) + "Context menu for `context-menu-mode'." + ;; TODO: refactor `flyspell-correct-word' and related functions to return + ;; a keymap menu where every menu item is bound to a lambda that calls + ;; `flyspell-do-correct' with an argument that is a correct word. + 'flyspell-correct-word) + ;;*---------------------------------------------------------------------*/ ;;* flyspell-mode ... */ ;;*---------------------------------------------------------------------*/ @@ -537,10 +528,7 @@ in your init file. :group 'flyspell (if flyspell-mode (condition-case err - (progn - (when flyspell-use-mouse-3-for-menu - (flyspell--set-use-mouse-3-for-menu 'flyspell-use-mouse-3-for-menu t)) - (flyspell-mode-on (called-interactively-p 'interactive))) + (flyspell-mode-on (called-interactively-p 'interactive)) (error (message "Error enabling Flyspell mode:\n%s" (cdr err)) (flyspell-mode -1))) (flyspell-mode-off))) @@ -656,8 +644,7 @@ are both non-nil." show-msg) (let* ((binding (where-is-internal 'flyspell-auto-correct-word nil 'non-ascii)) - (mouse-button (if flyspell-use-mouse-3-for-menu - "Mouse-3" "Mouse-2"))) + (mouse-button (if context-menu-mode "Mouse-3" "Mouse-2"))) (message (format-message "Welcome to Flyspell. Use %s to correct words." (if binding @@ -1820,13 +1807,15 @@ for the overlay." (overlay-put overlay 'mouse-face mouse-face) (overlay-put overlay 'flyspell-overlay t) (overlay-put overlay 'evaporate t) - (overlay-put overlay 'help-echo (concat (if flyspell-use-mouse-3-for-menu - "mouse-3" - "mouse-2") ": correct word at point")) - ;; If misspelled text has a 'keymap' property, let that remain in - ;; effect for the bindings that flyspell-mouse-map doesn't override. - (set-keymap-parent flyspell-mouse-map (get-char-property beg 'keymap)) - (overlay-put overlay 'keymap flyspell-mouse-map) + (overlay-put overlay 'help-echo + (concat (if context-menu-mode "mouse-3" "mouse-2") + ": correct word at point")) + (if context-menu-mode + (overlay-put overlay 'context-menu-function 'flyspell-context-menu) + ;; If misspelled text has a 'keymap' property, let that remain in + ;; effect for the bindings that flyspell-mouse-map doesn't override. + (set-keymap-parent flyspell-mouse-map (get-char-property beg 'keymap)) + (overlay-put overlay 'keymap flyspell-mouse-map)) (when (eq face 'flyspell-incorrect) (and (stringp flyspell-before-incorrect-word-string) (overlay-put overlay 'before-string commit 9c1bbad907575987054b8d81ac2d09bfabe6214b Author: Lars Ingebrigtsen Date: Fri Aug 27 04:49:57 2021 +0200 python-shell-interpreter doc string clarification * lisp/progmodes/python.el (python-shell-interpreter): Note what to do when using ipython3 (bug#44732). diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 20299c20d2..d5209d8d2f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2022,7 +2022,12 @@ position, else returns nil." (cond ((executable-find "python3") "python3") ((executable-find "python") "python") (t "python3")) - "Default Python interpreter for shell." + "Default Python interpreter for shell. + +Some Python interpreters also require changes to +`python-shell-interpreter-args'. In particular, setting +`python-shell-interpreter' to \"ipython3\" requires setting +`python-shell-interpreter-args' to \"--simple-prompt\"." :version "28.1" :type 'string :group 'python) commit cc5b6cb6bcc63d447663e1e98b05b7a16bd27f99 Author: Lars Ingebrigtsen Date: Fri Aug 27 04:00:58 2021 +0200 Fix backtrace when query-about-changed-file nil and file has changed * lisp/userlock.el (userlock--check-content-unchanged): Make the assertion more robust -- we may be called here from a different contexts if `query-about-changed-file' is nil. diff --git a/lisp/userlock.el b/lisp/userlock.el index 38aaf6aec2..a38f6ac422 100644 --- a/lisp/userlock.el +++ b/lisp/userlock.el @@ -125,7 +125,8 @@ You can <%s>uit; don't modify this file." (with-demoted-errors "Unchanged content check: %S" ;; Even tho we receive `filename', we know that `filename' refers to the current ;; buffer's file. - (cl-assert (equal filename (expand-file-name buffer-file-truename))) + (cl-assert (equal (expand-file-name filename) + (expand-file-name buffer-file-truename))) ;; Note: rather than read the file and compare to the buffer, we could save ;; the buffer and compare to the file, but for encrypted data this ;; wouldn't work well (and would risk exposing the data). commit 8567ec8bcfce39d4678ac016b00176ae9d5f3bd2 Author: Noah Evans Date: Fri Aug 27 03:43:19 2021 +0200 Fix recentering issue in `follow-mode' * lisp/follow.el (follow-recenter): Make `C-c . C-l' work in windows before the middle one, too (bug#50220). Copyright-paperwork-exempt: yes diff --git a/lisp/follow.el b/lisp/follow.el index dde140d0fd..b64f4cb734 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -858,8 +858,11 @@ from the bottom." (windows (follow-all-followers)) (win (nth (/ (- (length windows) 1) 2) windows))) (select-window win) - (goto-char dest) - (recenter)))) + (let ((win-s (window-start))) + (goto-char dest) + (recenter) + (when (< dest win-s) + (setq follow-internal-force-redisplay t)))))) (defun follow-redraw () commit 602419bbca9ae92e10c634b13bec6df3622d2714 Author: Lars Ingebrigtsen Date: Fri Aug 27 03:10:46 2021 +0200 Enable setting timeclock-workday after switching mode on * lisp/calendar/timeclock.el (timeclock--previous-workday): New variable. (timeclock-find-discrep): Use it to flush values when timeclock-workday changes (bug#50216). (timeclock-mode-line-display): Mention `timeclock-workday' setting in doc string. diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 1aea1b5e63..0b94bcb77f 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -88,6 +88,8 @@ "The length of a work period in seconds." :type 'integer) +(defvar timeclock--previous-workday nil) + (defcustom timeclock-relative t "Whether to make reported time relative to `timeclock-workday'. For example, if the length of a normal workday is eight hours, and you @@ -269,7 +271,10 @@ will be updated whenever the time display is updated. Otherwise, the timeclock will use its own sixty second timer to do its updating. With prefix ARG, turn mode line display on if and only if ARG is positive. Returns the new status of timeclock mode line -display (non-nil means on)." +display (non-nil means on). + +If using a customized `timeclock-workday' value, this should be +set before switching this mode on." :global t ;; cf display-time-mode. (setq timeclock-mode-string "") @@ -1058,7 +1063,9 @@ discrepancy, today's discrepancy, and the time worked today." (first t) (accum 0) (elapsed 0) event beg last-date last-date-limited last-date-seconds) - (unless timeclock-discrepancy + (when (or (not timeclock-discrepancy) + ;; The length of the workday has changed, so recompute. + (not (equal timeclock-workday timeclock--previous-workday))) (when (file-readable-p timeclock-file) (setq timeclock-project-list nil timeclock-last-project nil @@ -1114,7 +1121,8 @@ discrepancy, today's discrepancy, and the time worked today." last-date-seconds timeclock-workday)) (forward-line)) - (setq timeclock-discrepancy accum)))) + (setq timeclock-discrepancy accum + timeclock--previous-workday timeclock-workday)))) (unless timeclock-last-event-workday (setq timeclock-last-event-workday timeclock-workday)) (setq accum (or timeclock-discrepancy 0) commit ee2ffd9c9eb33a17307f36ff58caec1ba79878d2 Author: Lars Ingebrigtsen Date: Thu Aug 26 19:28:34 2021 +0200 Fix problem with symlinks in compile buffers * lisp/progmodes/compile.el (compilation-find-file): Avoid `expand-file-name' when computing the file names, because that will reliably give the wrong result when there's symlinks and ".." involved (bug#8035). diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 1fb6124ab5..af7b8292b7 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -2951,7 +2951,8 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." fmts formats) ;; For each directory, try each format string. (while (and fmts (null buffer)) - (setq name (expand-file-name (format (car fmts) filename) thisdir) + (setq name (file-truename + (file-name-concat thisdir (format (car fmts) filename))) buffer (and (file-exists-p name) (find-file-noselect name)) fmts (cdr fmts))) @@ -2973,7 +2974,8 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." (setq thisdir (car dirs) fmts formats) (while (and fmts (null buffer)) - (setq name (expand-file-name (format (car fmts) filename) thisdir) + (setq name (file-truename + (file-name-concat thisdir (format (car fmts) filename))) buffer (and (file-exists-p name) (find-file-noselect name)) fmts (cdr fmts))) @@ -3016,7 +3018,8 @@ attempts to find a file whose name is produced by (format FMT FILENAME)." (ding) (sit-for 2)) ((and (file-directory-p name) (not (file-exists-p - (setq name (expand-file-name filename name))))) + (setq name (file-truename + (file-name-concat name filename)))))) (message "No `%s' in directory %s" filename origname) (ding) (sit-for 2)) (t commit 869579170b87b06dd802b563417a69564c82f559 Author: Philip Kaludercic Date: Thu Aug 26 16:23:29 2021 +0200 timeclock.el: Update example configuration * lisp/calendar/timeclock.el: Update comments that were no longer correct (bug#50211). diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 4a4b65d374..1aea1b5e63 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -35,14 +35,14 @@ ;; working day), and `timeclock-when-to-leave' to calculate when you're free. ;; You'll probably want to bind the timeclock commands to some handy -;; keystrokes. At the moment, C-x t is unused: +;; keystrokes. Assuming C-c t is unbound, you might use: ;; -;; (define-key ctl-x-map "ti" 'timeclock-in) -;; (define-key ctl-x-map "to" 'timeclock-out) -;; (define-key ctl-x-map "tc" 'timeclock-change) -;; (define-key ctl-x-map "tr" 'timeclock-reread-log) -;; (define-key ctl-x-map "tu" 'timeclock-update-mode-line) -;; (define-key ctl-x-map "tw" 'timeclock-when-to-leave-string) +;; (define-key (kbd "C-c t i") 'timeclock-in) +;; (define-key (kbd "C-c t o") 'timeclock-out) +;; (define-key (kbd "C-c t c") 'timeclock-change) +;; (define-key (kbd "C-c t r") 'timeclock-reread-log) +;; (define-key (kbd "C-c t u") 'timeclock-update-mode-line) +;; (define-key (kbd "C-c t w") 'timeclock-when-to-leave-string) ;; If you want Emacs to display the amount of time "left" to your ;; workday in the mode-line, you can either set the value of commit e4ec39e52d5fb42b777a07e2c6a55397b5916458 Author: Lars Ingebrigtsen Date: Thu Aug 26 16:12:17 2021 +0200 Make dired-chmod-program obsolete * lisp/dired.el (dired-chmod-program): Make into a defvar and make obsolete (bug#50190). * lisp/net/ange-ftp.el (ange-ftp-process-file): Remove usage of dired-chmod-program. diff --git a/lisp/dired.el b/lisp/dired.el index 950323f366..958677cd0c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -137,10 +137,9 @@ For more details, see Info node `(emacs)ls in Lisp'." (const :tag "Do not use --dired" nil) (other :tag "Always use --dired" t))) -(defcustom dired-chmod-program "chmod" - "Name of chmod command (usually `chmod')." - :group 'dired - :type 'file) +(defvar dired-chmod-program "chmod" + "Name of chmod command (usually `chmod').") +(make-obsolete-variable 'dired-chmod-program nil "28.1") (defcustom dired-touch-program "touch" "Name of touch command (usually `touch')." diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index e302aa89f3..c51766d168 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4704,8 +4704,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") ;; Can't use ange-ftp-dired-host-type here because the current ;; buffer is *dired-check-process output* (condition-case oops - (cond ((equal (or (bound-and-true-p dired-chmod-program) "chmod") - program) + (cond ((equal "chmod" program) (ange-ftp-call-chmod arguments)) ;; ((equal "chgrp" program)) ;; ((equal dired-chown-program program)) commit fc4d3eea5ad675fe87d03cb0d16f8a33c3177e95 Author: Lars Ingebrigtsen Date: Thu Aug 26 15:22:28 2021 +0200 Revert "Add support for "bright" ANSI colors in ansi-color" This reverts commit c8e3347ec01a9ed6dc8d88c2dbbb3a08497e8eb2. Jim Porter's paperwork isn't finalised yet. diff --git a/etc/NEWS b/etc/NEWS index 785fd68d4e..78aca8cd54 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -375,13 +375,6 @@ emulators by using the new input-meta-mode with the special value This parameter, similar to 'drag-with-header-line', allows moving frames by dragging the tab lines of their topmost windows with the mouse. ---- -** 'ansi-color' now supports "bright" color codes. -"Bright" ANSI color codes are now displayed when applying ANSI color -filters using the color values defined in 'ansi-bright-color-names-vector'. -In addition, bold text with regular ANSI colors can be displayed as -"bright" if 'ansi-color-bold-is-bright' is non-nil. - * Editing Changes in Emacs 28.1 diff --git a/lisp/ansi-color.el b/lisp/ansi-color.el index 0dc9a52388..79dc821ea1 100644 --- a/lisp/ansi-color.el +++ b/lisp/ansi-color.el @@ -150,48 +150,6 @@ foreground and background colors, respectively." :version "24.4" ; default colors copied from `xterm-standard-colors' :group 'ansi-colors) -(defcustom ansi-bright-color-names-vector - ["gray30" "red2" "green2" "yellow2" "blue1" "magenta2" "cyan2" "white"] - "Colors used for SGR control sequences determining a \"bright\" color. -This vector holds the colors used for SGR control sequences parameters -90 to 97 (bright foreground colors) and 100 to 107 (brightbackground -colors). - -Parameter Color - 90 100 bright black - 91 101 bright red - 92 102 bright green - 93 103 bright yellow - 94 104 bright blue - 95 105 bright magenta - 96 106 bright cyan - 97 107 bright white - -This vector is used by `ansi-color-make-color-map' to create a color -map. This color map is stored in the variable `ansi-color-map'. - -Each element may also be a cons cell where the car and cdr specify the -foreground and background colors, respectively." - :type '(vector (choice color (cons color color)) - (choice color (cons color color)) - (choice color (cons color color)) - (choice color (cons color color)) - (choice color (cons color color)) - (choice color (cons color color)) - (choice color (cons color color)) - (choice color (cons color color))) - :set 'ansi-color-map-update - :initialize 'custom-initialize-default - :version "28.1" - :group 'ansi-colors) - -(defcustom ansi-color-bold-is-bright nil - "If set to non-nil, combining ANSI bold and a color produces the bright -version of that color." - :type 'boolean - :version "28.1" - :group 'ansi-colors) - (defconst ansi-color-control-seq-regexp ;; See ECMA 48, section 5.4 "Control Sequences". "\e\\[[\x30-\x3F]*[\x20-\x2F]*[\x40-\x7E]" @@ -346,14 +304,9 @@ This function can be added to `comint-preoutput-filter-functions'." (defun ansi-color--find-face (codes) "Return the face corresponding to CODES." - ;; Sort the codes in ascending order to guarantee that "bold" comes before - ;; any of the colors. This ensures that `ansi-color-bold-is-bright' is - ;; applied correctly. - (let (faces bright (codes (sort (copy-sequence codes) #'<))) + (let (faces) (while codes - (let ((face (ansi-color-get-face-1 (pop codes) bright))) - (when (and ansi-color-bold-is-bright (eq face 'bold)) - (setq bright t)) + (let ((face (ansi-color-get-face-1 (pop codes)))) ;; In the (default underline) face, say, the value of the ;; "underline" attribute of the `default' face wins. (unless (eq face 'default) @@ -617,11 +570,11 @@ ESCAPE-SEQUENCE is an escape sequence parsed by For each new code, the following happens: if it is 1-7, add it to the list of codes; if it is 21-25 or 27, delete appropriate -parameters from the list of codes; if it is 30-37 (or 90-97) resp. 39, -the foreground color code is replaced or added resp. deleted; if it -is 40-47 (or 100-107) resp. 49, the background color code is replaced -or added resp. deleted; any other code is discarded together with the -old codes. Finally, the so changed list of codes is returned." +parameters from the list of codes; if it is 30-37 resp. 39, the +foreground color code is replaced or added resp. deleted; if it +is 40-47 resp. 49, the background color code is replaced or added +resp. deleted; any other code is discarded together with the old +codes. Finally, the so changed list of codes is returned." (let ((new-codes (ansi-color-parse-sequence escape-sequence))) (while new-codes (let* ((new (pop new-codes)) @@ -638,7 +591,7 @@ old codes. Finally, the so changed list of codes is returned." (22 (remq 1 codes)) (25 (remq 6 codes)) (_ codes))))) - ((or 3 4 9 10) (let ((r (mod new 10))) + ((or 3 4) (let ((r (mod new 10))) (unless (= r 8) (let (beg) (while (and codes (/= q (/ (car codes) 10))) @@ -650,19 +603,6 @@ old codes. Finally, the so changed list of codes is returned." (_ nil))))) codes)) -(defun ansi-color--fill-color-map (map map-index property vector get-color) - "Fill a range of color values from VECTOR and store in MAP. - -Start filling MAP from MAP-INDEX, and make faces for PROPERTY (`foreground' -or `background'). GET-COLOR is a function taking an element of VECTOR and -returning the color value to use." - (mapc - (lambda (e) - (aset map map-index - (ansi-color-make-face property (funcall get-color e))) - (setq map-index (1+ map-index)) ) - vector)) - (defun ansi-color-make-color-map () "Creates a vector of face definitions and returns it. @@ -671,7 +611,7 @@ The index into the vector is an ANSI code. See the documentation of The face definitions are based upon the variables `ansi-color-faces-vector' and `ansi-color-names-vector'." - (let ((map (make-vector 110 nil)) + (let ((map (make-vector 50 nil)) (index 0)) ;; miscellaneous attributes (mapc @@ -680,21 +620,23 @@ The face definitions are based upon the variables (setq index (1+ index)) ) ansi-color-faces-vector) ;; foreground attributes - (ansi-color--fill-color-map - map 30 'foreground ansi-color-names-vector - (lambda (e) (if (consp e) (car e) e))) + (setq index 30) + (mapc + (lambda (e) + (aset map index + (ansi-color-make-face 'foreground + (if (consp e) (car e) e))) + (setq index (1+ index)) ) + ansi-color-names-vector) ;; background attributes - (ansi-color--fill-color-map - map 40 'background ansi-color-names-vector - (lambda (e) (if (consp e) (cdr e) e))) - ;; bright foreground attributes - (ansi-color--fill-color-map - map 90 'foreground ansi-bright-color-names-vector - (lambda (e) (if (consp e) (car e) e))) - ;; bright background attributes - (ansi-color--fill-color-map - map 100 'background ansi-bright-color-names-vector - (lambda (e) (if (consp e) (cdr e) e))) + (setq index 40) + (mapc + (lambda (e) + (aset map index + (ansi-color-make-face 'background + (if (consp e) (cdr e) e))) + (setq index (1+ index)) ) + ansi-color-names-vector) map)) (defvar ansi-color-map (ansi-color-make-color-map) @@ -718,13 +660,9 @@ property of `ansi-color-faces-vector' and `ansi-color-names-vector'." (set-default symbol value) (setq ansi-color-map (ansi-color-make-color-map))) -(defun ansi-color-get-face-1 (ansi-code &optional bright) +(defun ansi-color-get-face-1 (ansi-code) "Get face definition from `ansi-color-map'. -ANSI-CODE is used as an index into the vector. BRIGHT, if non-nil, -requests \"bright\" ANSI colors, even if ANSI-CODE is a normal-intensity -color." - (when (and bright (<= 30 ansi-code 49)) - (setq ansi-code (+ ansi-code 60))) +ANSI-CODE is used as an index into the vector." (condition-case nil (aref ansi-color-map ansi-code) (args-out-of-range nil))) diff --git a/test/lisp/ansi-color-tests.el b/test/lisp/ansi-color-tests.el index c94561bda1..107dc8e400 100644 --- a/test/lisp/ansi-color-tests.el +++ b/test/lisp/ansi-color-tests.el @@ -25,54 +25,17 @@ ;;; Code: (require 'ansi-color) -(eval-when-compile (require 'cl-lib)) -(defvar yellow (aref ansi-color-names-vector 3)) -(defvar bright-yellow (aref ansi-bright-color-names-vector 3)) - -(defvar test-strings - `(("\e[33mHello World\e[0m" "Hello World" - (foreground-color . ,yellow)) - ("\e[43mHello World\e[0m" "Hello World" - (background-color . ,yellow)) - ("\e[93mHello World\e[0m" "Hello World" - (foreground-color . ,bright-yellow)) - ("\e[103mHello World\e[0m" "Hello World" - (background-color . ,bright-yellow)) - ("\e[1;33mHello World\e[0m" "Hello World" - (bold (foreground-color . ,yellow)) - (bold (foreground-color . ,bright-yellow))) - ("\e[33;1mHello World\e[0m" "Hello World" - (bold (foreground-color . ,yellow)) - (bold (foreground-color . ,bright-yellow))) - ("\e[1m\e[33mHello World\e[0m" "Hello World" - (bold (foreground-color . ,yellow)) - (bold (foreground-color . ,bright-yellow))) - ("\e[33m\e[1mHello World\e[0m" "Hello World" - (bold (foreground-color . ,yellow)) - (bold (foreground-color . ,bright-yellow))) - ("\e[1m\e[3m\e[5mbold italics blink\e[0m" "bold italics blink" - (bold italic success)))) +(defvar test-strings '(("\e[33mHello World\e[0m" . "Hello World") + ("\e[1m\e[3m\e[5mbold italics blink\e[0m" . "bold italics blink"))) (ert-deftest ansi-color-apply-on-region-test () - (pcase-dolist (`(,input ,text ,face) test-strings) - (with-temp-buffer - (insert input) - (ansi-color-apply-on-region (point-min) (point-max)) - (should (equal (buffer-string) text)) - (should (equal (get-char-property (point-min) 'face) face)) - (should (not (equal (overlays-at (point-min)) nil)))))) - -(ert-deftest ansi-color-apply-on-region-bold-is-bright-test () - (pcase-dolist (`(,input ,text ,face ,bright-face) test-strings) - (with-temp-buffer - (let ((ansi-color-bold-is-bright t)) - (insert input) + (dolist (pair test-strings) + (with-temp-buffer + (insert (car pair)) (ansi-color-apply-on-region (point-min) (point-max)) - (should (equal (buffer-string) text)) - (should (equal (get-char-property (point-min) 'face) - (or bright-face face))) - (should (not (equal (overlays-at (point-min)) nil))))))) + (should (equal (buffer-string) (cdr pair))) + (should (not (equal (overlays-at (point-min)) nil)))))) (ert-deftest ansi-color-apply-on-region-preserving-test () (dolist (pair test-strings) commit 2e2400a13f3146ca790bf5c59a95389b1ac45e91 Author: Lars Ingebrigtsen Date: Thu Aug 26 15:21:52 2021 +0200 Revert "Add support for "bright" ANSI colors in term-mode" This reverts commit 2b2a103db0c3597c7685d3ffff4bca7f2e4d094e. Jim Porter's paperwork isn't finalized yet. diff --git a/etc/NEWS b/etc/NEWS index 04e482364a..785fd68d4e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2370,13 +2370,6 @@ based on the current window size. In previous versions of Emacs, this was always done (and that could lead to odd displays when resizing the window after starting). This variable defaults to nil. ---- -*** 'term-mode' now supports "bright" color codes. -"Bright" ANSI color codes are now displayed using the color values -defined in 'term-color-bright-*'. In addition, bold text with regular -ANSI colors can be displayed as "bright" if 'ansi-color-bold-is-bright' -is non-nil. - ** Widget +++ diff --git a/lisp/term.el b/lisp/term.el index ef2532182c..b3870a814d 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -727,15 +727,7 @@ Buffer local variable.") term-color-blue term-color-magenta term-color-cyan - term-color-white - term-color-bright-black - term-color-bright-red - term-color-bright-green - term-color-bright-yellow - term-color-bright-blue - term-color-bright-magenta - term-color-bright-cyan - term-color-bright-white]) + term-color-white]) (defcustom term-default-fg-color nil "If non-nil, default color for foreground in Term mode." @@ -805,48 +797,8 @@ Buffer local variable.") :group 'term) (defface term-color-white - '((t :foreground "grey90" :background "gray90")) - "Face used to render white color code." - :group 'term) - -(defface term-color-bright-black - '((t :foreground "gray30" :background "gray30")) - "Face used to render bright black color code." - :group 'term) - -(defface term-color-bright-red - '((t :foreground "red2" :background "red2")) - "Face used to render bright red color code." - :group 'term) - -(defface term-color-bright-green - '((t :foreground "green2" :background "green2")) - "Face used to render bright green color code." - :group 'term) - -(defface term-color-bright-yellow - '((t :foreground "yellow2" :background "yellow2")) - "Face used to render bright yellow color code." - :group 'term) - -(defface term-color-bright-blue - '((t :foreground "blue1" :background "blue1")) - "Face used to render bright blue color code." - :group 'term) - -(defface term-color-bright-magenta - '((t :foreground "magenta2" :background "magenta2")) - "Face used to render bright magenta color code." - :group 'term) - -(defface term-color-bright-cyan - '((t :foreground "cyan2" :background "cyan2")) - "Face used to render bright cyan color code." - :group 'term) - -(defface term-color-bright-white '((t :foreground "white" :background "white")) - "Face used to render bright white color code." + "Face used to render white color code." :group 'term) (defcustom term-buffer-maximum-size 8192 @@ -3273,15 +3225,6 @@ option is enabled. See `term-set-goto-process-mark'." ;; FIXME: No idea why this is here, it looks wrong. --Stef (setq term-ansi-face-already-done nil)) -(defun term--maybe-brighten-color (color bold) - "Possibly convert COLOR to its bright variant. -COLOR is an index into `ansi-term-color-vector'. If BOLD and -`ansi-color-bold-is-bright' are non-nil and COLOR is a regular color, -return the bright version of COLOR; otherwise, return COLOR." - (if (and ansi-color-bold-is-bright bold (<= 1 color 8)) - (+ color 8) - color)) - ;; New function to deal with ansi colorized output, as you can see you can ;; have any bold/underline/fg/bg/reverse combination. -mm @@ -3321,10 +3264,6 @@ return the bright version of COLOR; otherwise, return COLOR." ((and (>= parameter 30) (<= parameter 37)) (setq term-ansi-current-color (- parameter 29))) - ;; Bright foreground - ((and (>= parameter 90) (<= parameter 97)) - (setq term-ansi-current-color (- parameter 81))) - ;; Reset foreground ((eq parameter 39) (setq term-ansi-current-color 0)) @@ -3333,10 +3272,6 @@ return the bright version of COLOR; otherwise, return COLOR." ((and (>= parameter 40) (<= parameter 47)) (setq term-ansi-current-bg-color (- parameter 39))) - ;; Bright foreground - ((and (>= parameter 100) (<= parameter 107)) - (setq term-ansi-current-bg-color (- parameter 91))) - ;; Reset background ((eq parameter 49) (setq term-ansi-current-bg-color 0)) @@ -3355,43 +3290,37 @@ return the bright version of COLOR; otherwise, return COLOR." ;; term-ansi-current-bg-color) (unless term-ansi-face-already-done - (let ((current-color (term--maybe-brighten-color - term-ansi-current-color - term-ansi-current-bold)) - (current-bg-color (term--maybe-brighten-color - term-ansi-current-bg-color - term-ansi-current-bold))) - (if term-ansi-current-invisible - (let ((color - (if term-ansi-current-reverse - (face-foreground - (elt ansi-term-color-vector current-color) - nil 'default) - (face-background - (elt ansi-term-color-vector current-bg-color) - nil 'default)))) - (setq term-current-face - (list :background color - :foreground color)) - ) ;; No need to bother with anything else if it's invisible. - (setq term-current-face - (list :foreground - (face-foreground - (elt ansi-term-color-vector current-color) - nil 'default) - :background - (face-background - (elt ansi-term-color-vector current-bg-color) - nil 'default) - :inverse-video term-ansi-current-reverse)) - - (when term-ansi-current-bold + (if term-ansi-current-invisible + (let ((color + (if term-ansi-current-reverse + (face-foreground + (elt ansi-term-color-vector term-ansi-current-color) + nil 'default) + (face-background + (elt ansi-term-color-vector term-ansi-current-bg-color) + nil 'default)))) (setq term-current-face - `(,term-current-face :inherit term-bold))) + (list :background color + :foreground color)) + ) ;; No need to bother with anything else if it's invisible. + (setq term-current-face + (list :foreground + (face-foreground + (elt ansi-term-color-vector term-ansi-current-color) + nil 'default) + :background + (face-background + (elt ansi-term-color-vector term-ansi-current-bg-color) + nil 'default) + :inverse-video term-ansi-current-reverse)) + + (when term-ansi-current-bold + (setq term-current-face + `(,term-current-face :inherit term-bold))) - (when term-ansi-current-underline - (setq term-current-face - `(,term-current-face :inherit term-underline)))))) + (when term-ansi-current-underline + (setq term-current-face + `(,term-current-face :inherit term-underline))))) ;; (message "Debug %S" term-current-face) ;; FIXME: shouldn't we set term-ansi-face-already-done to t here? --Stef diff --git a/test/lisp/term-tests.el b/test/lisp/term-tests.el index a61d0939ea..50ac370b5b 100644 --- a/test/lisp/term-tests.el +++ b/test/lisp/term-tests.el @@ -28,45 +28,6 @@ (defvar term-height) ; Number of lines in window. (defvar term-width) ; Number of columns in window. -(defvar yellow-fg-props - '(:foreground "yellow3" :background "unspecified-bg" :inverse-video nil)) -(defvar yellow-bg-props - '(:foreground "unspecified-fg" :background "yellow3" :inverse-video nil)) -(defvar bright-yellow-fg-props - '(:foreground "yellow2" :background "unspecified-bg" :inverse-video nil)) -(defvar bright-yellow-bg-props - '(:foreground "unspecified-fg" :background "yellow2" :inverse-video nil)) - -(defvar ansi-test-strings - `(("\e[33mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face yellow-fg-props)) - ("\e[43mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face yellow-bg-props)) - ("\e[93mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face bright-yellow-fg-props)) - ("\e[103mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face bright-yellow-bg-props)) - ("\e[1;33mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face - `(,yellow-fg-props :inherit term-bold)) - ,(propertize "Hello World" 'font-lock-face - `(,bright-yellow-fg-props :inherit term-bold))) - ("\e[33;1mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face - `(,yellow-fg-props :inherit term-bold)) - ,(propertize "Hello World" 'font-lock-face - `(,bright-yellow-fg-props :inherit term-bold))) - ("\e[1m\e[33mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face - `(,yellow-fg-props :inherit term-bold)) - ,(propertize "Hello World" 'font-lock-face - `(,bright-yellow-fg-props :inherit term-bold))) - ("\e[33m\e[1mHello World\e[0m" - ,(propertize "Hello World" 'font-lock-face - `(,yellow-fg-props :inherit term-bold)) - ,(propertize "Hello World" 'font-lock-face - `(,bright-yellow-fg-props :inherit term-bold))))) - (defun term-test-screen-from-input (width height input &optional return-var) (with-temp-buffer (term-mode) @@ -87,7 +48,7 @@ (mapc (lambda (input) (term-emulate-terminal proc input)) input) (term-emulate-terminal proc input)) (if return-var (buffer-local-value return-var (current-buffer)) - (buffer-substring (point-min) (point-max)))))) + (buffer-substring-no-properties (point-min) (point-max)))))) (ert-deftest term-simple-lines () (skip-unless (not (memq system-type '(windows-nt ms-dos)))) @@ -116,24 +77,6 @@ first line\r_next line\r\n")) (term-test-screen-from-input 40 12 (let ((str (make-string 30 ?a))) (list str str)))))) -(ert-deftest term-colors () - (skip-unless (not (memq system-type '(windows-nt ms-dos)))) - (pcase-dolist (`(,str ,expected) ansi-test-strings) - (let ((result (term-test-screen-from-input 40 12 str))) - (should (equal result expected)) - (should (equal (text-properties-at 0 result) - (text-properties-at 0 expected)))))) - -(ert-deftest term-colors-bold-is-bright () - (skip-unless (not (memq system-type '(windows-nt ms-dos)))) - (let ((term-color-bold-is-bright t)) - (pcase-dolist (`(,str ,expected ,bright-expected) ansi-test-strings) - (let ((expected (or bright-expected expected)) - (result (term-test-screen-from-input 40 12 str))) - (should (equal result expected)) - (should (equal (text-properties-at 0 result) - (text-properties-at 0 expected))))))) - (ert-deftest term-cursor-movement () (skip-unless (not (memq system-type '(windows-nt ms-dos)))) ;; Absolute positioning. commit e1ca0ba7d43d4ab68019c86dcc8234afd189b91e Author: Lars Ingebrigtsen Date: Thu Aug 26 15:21:10 2021 +0200 Revert "Add missing :version tags to new faces" This reverts commit 9759fb596b634db2faf7edcd4fd557a11abe9903. Jim Porter's paperwork isn't finalized yet. diff --git a/lisp/term.el b/lisp/term.el index c4e6c528e4..ef2532182c 100644 --- a/lisp/term.el +++ b/lisp/term.el @@ -812,50 +812,42 @@ Buffer local variable.") (defface term-color-bright-black '((t :foreground "gray30" :background "gray30")) "Face used to render bright black color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-red '((t :foreground "red2" :background "red2")) "Face used to render bright red color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-green '((t :foreground "green2" :background "green2")) "Face used to render bright green color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-yellow '((t :foreground "yellow2" :background "yellow2")) "Face used to render bright yellow color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-blue '((t :foreground "blue1" :background "blue1")) "Face used to render bright blue color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-magenta '((t :foreground "magenta2" :background "magenta2")) "Face used to render bright magenta color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-cyan '((t :foreground "cyan2" :background "cyan2")) "Face used to render bright cyan color code." - :group 'term - :version "28.1") + :group 'term) (defface term-color-bright-white '((t :foreground "white" :background "white")) "Face used to render bright white color code." - :group 'term - :version "28.1") + :group 'term) (defcustom term-buffer-maximum-size 8192 "The maximum size in lines for term buffers. commit e5f82c130599c977adb65c40daab15c7c9a3dc26 Author: Michael Albinus Date: Thu Aug 26 13:14:19 2021 +0200 Improve robustness of shadowfile.el * lisp/shadowfile.el (shadow-site-help): New defconst. (shadow-read-site): Use it. (shadow-make-fullname, shadow-contract-file-name) (shadow-define-literal-group): Handle errors more robust. (Bug#49596) * test/lisp/shadowfile-tests.el (shadow-test06-literal-groups): Extend test. diff --git a/lisp/shadowfile.el b/lisp/shadowfile.el index f67b0b9b39..63e9bd655c 100644 --- a/lisp/shadowfile.el +++ b/lisp/shadowfile.el @@ -213,6 +213,14 @@ information defining the cluster. For interactive use, call ;;; SITES +;; This simplifies it a little bit. "system-name" is also accepted. +;; But we don't want to make the help echo too long. +(defconst shadow-site-help "\ +A cluster identification \"/name:\", a remote identification +\"/method:user@host:\", or \"/system-name:\" (the value of +`shadow-system-name')" + "The help string describing a valid site.") + (defun shadow-site-name (site) "Return name if SITE has the form \"/name:\", otherwise SITE." (if (string-match "\\`/\\([-.[:word:]]+\\):\\'" site) @@ -239,9 +247,10 @@ information defining the cluster. For interactive use, call shadow-clusters))) (defun shadow-read-site () - "Read a cluster name or host identification from the minibuffer." - (let ((ans (completing-read "Host identification or cluster name: " - shadow-clusters))) + "Read a site name from the minibuffer." + (let ((ans (completing-read + (propertize "Site name: " 'help-echo shadow-site-help) + shadow-clusters))) (when (or (shadow-get-cluster (shadow-site-name ans)) (string-equal ans shadow-system-name) (string-equal ans (shadow-site-name shadow-system-name)) @@ -285,7 +294,7 @@ Argument can be a simple name, remote file name, or already a (defsubst shadow-make-fullname (hup &optional host name) "Make a Tramp style fullname out of HUP, a `tramp-file-name' structure. Replace HOST, and NAME when non-nil. HOST can also be a remote file name." - (let ((hup (copy-tramp-file-name hup))) + (when-let ((hup (copy-tramp-file-name hup))) (when host (if (file-remote-p host) (setq name (or name (and hup (tramp-file-name-localname hup))) @@ -355,23 +364,23 @@ Will return the name bare if it is a local file." Do so by replacing (when possible) home directory with ~/, and hostname with cluster name that includes it. Filename should be absolute and true." - (let* ((hup (shadow-parse-name file)) - (homedir (if (shadow-local-file hup) - shadow-homedir - (file-name-as-directory - (file-local-name - (expand-file-name - (shadow-make-fullname hup nil shadow-homedir)))))) - (suffix (shadow-suffix homedir (tramp-file-name-localname hup))) - (cluster (shadow-site-cluster (shadow-make-fullname hup nil "")))) - (when cluster - (setf (tramp-file-name-method hup) nil - (tramp-file-name-host hup) (shadow-cluster-name cluster))) - (shadow-make-fullname - hup nil - (if suffix - (concat shadow-homedir suffix) - (tramp-file-name-localname hup))))) + (when-let ((hup (shadow-parse-name file))) + (let* ((homedir (if (shadow-local-file hup) + shadow-homedir + (file-name-as-directory + (file-local-name + (expand-file-name + (shadow-make-fullname hup nil shadow-homedir)))))) + (suffix (shadow-suffix homedir (tramp-file-name-localname hup))) + (cluster (shadow-site-cluster (shadow-make-fullname hup nil "")))) + (when cluster + (setf (tramp-file-name-method hup) nil + (tramp-file-name-host hup) (shadow-cluster-name cluster))) + (shadow-make-fullname + hup nil + (if suffix + (concat shadow-homedir suffix) + (tramp-file-name-localname hup)))))) (defun shadow-same-site (pattern file) "True if the site of PATTERN and of FILE are on the same site. @@ -455,16 +464,17 @@ It may have different filenames on each site. When this file is edited, the new version will be copied to each of the other locations. Sites can be specific hostnames, or names of clusters (see `shadow-define-cluster')." (interactive) - (let* ((hup (shadow-parse-name - (shadow-contract-file-name (buffer-file-name)))) - (name (tramp-file-name-localname hup)) - site group) - (while (setq site (shadow-read-site)) - (setq name (read-string "Filename: " name) - hup (shadow-parse-name (shadow-contract-file-name name)) - group (cons (shadow-make-fullname hup site) group))) - (setq shadow-literal-groups (cons group shadow-literal-groups))) - (shadow-write-info-file)) + (when-let ((hup (shadow-parse-name + (shadow-contract-file-name (buffer-file-name))))) + (let* ((name (tramp-file-name-localname hup)) + site group) + (while (setq site (shadow-read-site)) + (setq name (read-string "Filename: " name) + hup (shadow-parse-name (shadow-contract-file-name name)) + group (cons (shadow-make-fullname hup site) group))) + (when group + (setq shadow-literal-groups (cons group shadow-literal-groups)))) + (shadow-write-info-file))) ;;;###autoload (defun shadow-define-regexp-group () diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index c571dc3e14..1ab539f3e4 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -664,7 +664,29 @@ guaranteed by the originator of a cluster definition." (should (member (format "/%s:%s" cluster2 (file-local-name file2)) (car shadow-literal-groups))) ;; Bug#49596. - (should (member (concat primary file1) (car shadow-literal-groups)))) + (should (member (concat primary file1) (car shadow-literal-groups))) + + ;; Error handling. + (setq shadow-literal-groups nil) + ;; There's no `buffer-file-name'. + (with-temp-buffer + (call-interactively #'shadow-define-literal-group) + (set-buffer-modified-p nil)) + (should-not shadow-literal-groups) + ;; Define an empty literal group. + (setq mocked-input `(,(kbd "RET"))) + (with-temp-buffer + (set-visited-file-name file1) + (call-interactively #'shadow-define-literal-group) + (set-buffer-modified-p nil)) + (should-not shadow-literal-groups) + ;; Use a non-existing site name. + (setq mocked-input `("foo" ,(kbd "RET"))) + (with-temp-buffer + (set-visited-file-name file1) + (call-interactively #'shadow-define-literal-group) + (set-buffer-modified-p nil)) + (should-not shadow-literal-groups)) ;; Cleanup. (shadow--tests-cleanup)))) commit fbf2933e6907c1344c0b543c3f05cb3cfcc0ebc3 Author: Tassilo Horn Date: Thu Aug 26 12:51:08 2021 +0200 Fix docs about the meaning of the Re: in the subject * doc/misc/message.texi (Message Headers): Clarify that it comes from the Latin "res" meaning "in the matter of" rather than "in response to" as claimed previously (see RFC-2822). diff --git a/doc/misc/message.texi b/doc/misc/message.texi index c0e3dfae12..4136ad859f 100644 --- a/doc/misc/message.texi +++ b/doc/misc/message.texi @@ -1699,14 +1699,15 @@ result is inserted. @cindex Sv @cindex Re Responses to messages have subjects that start with @samp{Re: }. This -is @emph{not} an abbreviation of the English word ``response'', but is -Latin, and means ``in response to''. Some illiterate nincompoops have -failed to grasp this fact, and have ``internationalized'' their software -to use abominations like @samp{Aw: } (``antwort'') or @samp{Sv: } -(``svar'') instead, which is meaningless and evil. However, you may -have to deal with users that use these evil tools, in which case you may -set this variable to a regexp that matches these prefixes. Myself, I -just throw away non-compliant mail. +is @emph{not} an abbreviation of the English word ``response'', but it +comes from the Latin ``res'', and means ``in the matter of''. Some +illiterate nincompoops have failed to grasp this fact, and have +``internationalized'' their software to use abominations like +@samp{Aw: } (``antwort'') or @samp{Sv: } (``svar'') instead, which is +meaningless and evil. However, you may have to deal with users that +use these evil tools, in which case you may set this variable to a +regexp that matches these prefixes. Myself, I just throw away +non-compliant mail. Here's an example of a value to deal with these headers when responding to a message: