commit 47e94f864fe158406959f8e3598e46d3328e7e35 (HEAD, refs/remotes/origin/master) Author: Robert Pluim Date: Tue Sep 24 10:23:05 2019 +0200 ; Fix previous make-network-process doc change * src/process.c (Fmake_network_process): Correct typo. diff --git a/src/process.c b/src/process.c index f3daf37636..b7ab0b9fe0 100644 --- a/src/process.c +++ b/src/process.c @@ -3760,7 +3760,7 @@ for a server process, it must be a valid name or address for the local host, and only clients connecting to that address will be accepted. If all interfaces should be bound, an address of \"0.0.0.0\" (for ipv4) or \"::\" (for ipv6) can be used. (On some operating systems, -using \"::\" list on both ipv4 and ipv5.) `local' will use IPv4 by +using \"::\" listens on both ipv4 and ipv6.) `local' will use IPv4 by default, use a FAMILY of 'ipv6 to override this. :service SERVICE -- SERVICE is name of the service desired, or an commit 1f137133ed6683f4ef9e37ac6a32d4545f59506d Author: Lars Ingebrigtsen Date: Tue Sep 24 09:57:57 2019 +0200 Fix old problem with HTTPS HTTP 0.9 sentinels * lisp/url/url-http.el (url-http-end-of-document-sentinel): Pass on the tls parameter if we have HTTPS (bug#14983). diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index bfc106c2a5..a6963cef70 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -1024,7 +1024,9 @@ should be shown to the user." (setq url-using-proxy (url-generic-parse-url url-using-proxy))) (url-http url-current-object url-callback-function - url-callback-arguments (current-buffer))))) + url-callback-arguments (current-buffer) + (and (string= "https" (url-type url-current-object)) + 'tls))))) ((url-http-parse-headers) (url-http-activate-callback)))))) commit d32d9373b5348db87c85fd2717f1b5a524bc207f Author: Eli Zaretskii Date: Tue Sep 24 10:28:44 2019 +0300 Resurrect support for negative frame geometry parameters on MS-Windows * src/w32fns.c (my_create_window): Avoid assertion violations in XFIXNUM when the 'top' or 'left' frame parameters are neither fixnums nor 'unbound', in which case f->size_hint_flags are set by gui_figure_window_size. (Bug#37415) diff --git a/src/w32fns.c b/src/w32fns.c index 34abd026f9..bb28c01795 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -5413,6 +5413,11 @@ w32_wnd_proc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; } +/* This function is called from the main (a.k.a. "Lisp") thread, and + prepares the coordinates to be used by w32_createwindow (which runs + in the input thread), when necessary. The calls to + gui_display_get_arg must be done here, because they can cons Lisp + objects, and that can only be done in the Lisp thread. */ static void my_create_window (struct frame * f) { @@ -5421,20 +5426,33 @@ my_create_window (struct frame * f) Lisp_Object left, top; struct w32_display_info *dpyinfo = &one_w32_display_info; - /* When called with RES_TYPE_NUMBER, gui_display_get_arg will return - zero for anything that is not a number and is not Qunbound. */ - left = gui_display_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", - RES_TYPE_NUMBER); - top = gui_display_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", - RES_TYPE_NUMBER); - if (EQ (left, Qunbound)) - coords[0] = CW_USEDEFAULT; - else - coords[0] = XFIXNUM (left); - if (EQ (top, Qunbound)) - coords[1] = CW_USEDEFAULT; - else - coords[1] = XFIXNUM (top); + /* If f->size_hint_flags is set, it means gui_figure_window_size + already processed the 'top' and 'left' frame parameters and set + f->top_pos and f->left_pos accordingly. w32_createwindow will + then use those value disregarding coords[]. So we don't need to + compute coords[] in that case. */ + if (!(f->size_hint_flags & USPosition || f->size_hint_flags & PPosition)) + { + /* When called with RES_TYPE_NUMBER, and there's no 'top' or + 'left' parameters in the frame's parameter alist, + gui_display_get_arg will return zero for anything that is + neither a number nor Qunbound. If frame parameter alist does + have 'left' or 'top', they are interpreted by + gui_figure_window_size, which was already called, and which + sets f->size_hint_flags. */ + left = gui_display_get_arg (dpyinfo, Qnil, Qleft, "left", "Left", + RES_TYPE_NUMBER); + top = gui_display_get_arg (dpyinfo, Qnil, Qtop, "top", "Top", + RES_TYPE_NUMBER); + if (EQ (left, Qunbound)) + coords[0] = CW_USEDEFAULT; + else + coords[0] = XFIXNUM (left); + if (EQ (top, Qunbound)) + coords[1] = CW_USEDEFAULT; + else + coords[1] = XFIXNUM (top); + } if (!PostThreadMessage (dwWindowsThreadId, WM_EMACS_CREATEWINDOW, (WPARAM)f, (LPARAM)coords)) commit 61a2b3ca7d4afe3e3f77b77f59de3ad2f7159bfd Author: Lars Ingebrigtsen Date: Tue Sep 24 08:33:39 2019 +0200 Allow scrolling the NSM window * lisp/net/nsm.el (nsm-query-user): Allow moving backwards/forwards in the NSM buffer if the window is too small to show all the details (bug#28069). diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index 11535a5a5a..b8c84d5fde 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -815,84 +815,110 @@ protocol." (defun nsm-query-user (message status) (let ((buffer (get-buffer-create "*Network Security Manager*")) (cert-buffer (get-buffer-create "*Certificate Details*")) - (certs (plist-get status :certificates))) + (certs (plist-get status :certificates)) + (accept-choices + '((?a "always" "Accept this certificate this session and for all future sessions.") + (?s "session only" "Accept this certificate this session only.") + (?n "no" "Refuse to use this certificate, and close the connection.") + (?d "details" "See certificate details"))) + (details-choices + '((?b "backward page" "See previous page") + (?f "forward page" "See next page") + (?n "next" "Next certificate") + (?p "previous" "Previous certificate") + (?q "quit" "Quit details view"))) + (done nil)) (save-window-excursion ;; First format the certificate and warnings. - (with-current-buffer-window - buffer nil nil - (when status (insert (nsm-format-certificate status))) - (insert message) - (goto-char (point-min)) - ;; Fill the first line of the message, which usually - ;; contains lots of explanatory text. - (fill-region (point) (line-end-position))) + (pop-to-buffer buffer) + (erase-buffer) + (let ((inhibit-read-only t)) + (when status + (insert (nsm-format-certificate status))) + (insert message) + (goto-char (point-min)) + ;; Fill the first line of the message, which usually + ;; contains lots of explanatory text. + (fill-region (point) (line-end-position)) + ;; If the window is too small, add navigation options. + (when (> (line-number-at-pos (point-max)) (window-height)) + (setq accept-choices + (append accept-choices + '((?b "backward page" "See previous page") + (?f "forward page" "See next page")))))) ;; Then ask the user what to do about it. (unwind-protect - (let* ((accept-choices '((?a "always" "Accept this certificate this session and for all future sessions.") - (?s "session only" "Accept this certificate this session only.") - (?n "no" "Refuse to use this certificate, and close the connection.") - (?d "details" "See certificate details"))) - (details-choices '((?b "backward page" "See previous page") - (?f "forward page" "See next page") - (?n "next" "Next certificate") - (?p "previous" "Previous certificate") - (?q "quit" "Quit details view"))) - (answer (read-multiple-choice "Continue connecting?" - accept-choices)) - (show-details (char-equal (car answer) ?d)) - (pems (cl-loop for cert in certs + (let* ((pems (cl-loop for cert in certs collect (gnutls-format-certificate (plist-get cert :pem)))) - (cert-index 0)) - (while show-details - (unless (get-buffer-window cert-buffer) - (set-window-buffer (get-buffer-window buffer) cert-buffer) - (with-current-buffer cert-buffer - (read-only-mode -1) - (insert (nth cert-index pems)) - (goto-char (point-min)) - (read-only-mode))) - - (setq answer (read-multiple-choice "Viewing certificate:" details-choices)) - - (cond - ((char-equal (car answer) ?q) - (setq show-details (not show-details)) - (set-window-buffer (get-buffer-window cert-buffer) buffer) - (setq show-details (char-equal - (car (setq answer - (read-multiple-choice - "Continue connecting?" - accept-choices))) - ?d))) - - ((char-equal (car answer) ?b) - (with-selected-window (get-buffer-window cert-buffer) - (with-current-buffer cert-buffer - (ignore-errors (scroll-down))))) - - ((char-equal (car answer) ?f) - (with-selected-window (get-buffer-window cert-buffer) - (with-current-buffer cert-buffer - (ignore-errors (scroll-up))))) - - ((char-equal (car answer) ?n) - (with-current-buffer cert-buffer - (read-only-mode -1) - (erase-buffer) - (setq cert-index (mod (1+ cert-index) (length pems))) - (insert (nth cert-index pems)) - (goto-char (point-min)) - (read-only-mode))) - - ((char-equal (car answer) ?p) - (with-current-buffer cert-buffer - (read-only-mode -1) - (erase-buffer) - (setq cert-index (mod (1- cert-index) (length pems))) - (insert (nth cert-index pems)) - (goto-char (point-min)) - (read-only-mode))))) + (cert-index 0) + show-details answer buf) + (while (not done) + (setq answer (if show-details + (read-multiple-choice "Viewing certificate:" + details-choices) + (read-multiple-choice "Continue connecting?" + accept-choices))) + (setq buf (if show-details cert-buffer buffer)) + + (cl-case (car answer) + (?q + ;; Exit the details window. + (set-window-buffer (get-buffer-window cert-buffer) buffer) + (setq show-details nil)) + + (?d + ;; Enter the details window. + (set-window-buffer (get-buffer-window buffer) cert-buffer) + (with-current-buffer cert-buffer + (read-only-mode -1) + (insert (nth cert-index pems)) + (goto-char (point-min)) + (read-only-mode)) + (setq show-details t)) + + (?b + ;; Scroll down. + (with-selected-window (get-buffer-window buf) + (with-current-buffer buf + (ignore-errors (scroll-down))))) + + (?f + ;; Scroll up. + (with-selected-window (get-buffer-window buf) + (with-current-buffer buf + (ignore-errors (scroll-up))))) + + (?n + ;; "No" or "next certificate". + (if show-details + (with-current-buffer cert-buffer + (read-only-mode -1) + (erase-buffer) + (setq cert-index (mod (1+ cert-index) (length pems))) + (insert (nth cert-index pems)) + (goto-char (point-min)) + (read-only-mode)) + (setq done t))) + + (?a + ;; "Always" + (setq done t)) + + (?s + ;; "Session only" + (setq done t)) + + (?p + ;; Previous certificate. + (with-current-buffer cert-buffer + (read-only-mode -1) + (erase-buffer) + (setq cert-index (mod (1- cert-index) (length pems))) + (insert (nth cert-index pems)) + (goto-char (point-min)) + (read-only-mode))))) + ;; Return the answer. (cadr answer)) (kill-buffer cert-buffer) (kill-buffer buffer))))) commit d3f8279422f12cff8e90254d872d2afcb9da021d Author: Wilson Snyder Date: Mon Sep 23 18:49:25 2019 -0400 Verilog-Mode collected updates. * lisp/progmodes/verilog-mode.el (verilog-auto-inst-param): Add regexp paramter to AUTOINSTPARAM to select which parameters to export. Reported by Vish S. (verilog-build-defun-re): Fix `verilog-goto-defun' to find automatic function/tasks, bug1492. Reported by Enze Chi. (verilog-preprocessor): Update default. diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 15bb25f25b..baeaf8b95d 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -4,12 +4,12 @@ ;; Author: Michael McNamara ;; Wilson Snyder -;; X-URL: http://www.veripool.org +;; X-URL: https://www.veripool.org ;; Created: 3 Jan 1996 ;; Keywords: languages ;; The "Version" is the date followed by the decimal rendition of the Git ;; commit hex. -;; Version: 2019.06.21.103209889 +;; Version: 2019.09.23.004801067 ;; Yoni Rabkin contacted the maintainer of this ;; file on 19/3/2008, and the maintainer agreed that when a bug is @@ -55,7 +55,7 @@ ;; under continuous development. Please report any issues to the issue ;; tracker at ;; -;; http://www.veripool.org/verilog-mode +;; https://www.veripool.org/verilog-mode ;; ;; Please use verilog-submit-bug-report to submit a report; type C-c ;; C-b to invoke this and as a result we will have a much easier time @@ -72,7 +72,7 @@ ;; default. ;; You can get step by step help in installing this file by going to -;; +;; ;; The short list of installation instructions are: To set up ;; automatic Verilog mode, put this file in your load path, and put @@ -117,14 +117,14 @@ ;;; History: ;; -;; See commit history at http://www.veripool.org/verilog-mode.html +;; See commit history at https://www.veripool.org/verilog-mode ;; (This section is required to appease checkdoc.) ;;; Code: ;; ;; This variable will always hold the version number of the mode -(defconst verilog-mode-version "2019-06-21-626dba1-vpo-GNU" +(defconst verilog-mode-version "2019-09-23-049422b-vpo-GNU" "Version of this Verilog mode.") (defconst verilog-mode-release-emacs t "If non-nil, this version of Verilog mode was released with Emacs itself.") @@ -530,8 +530,7 @@ you to the next lint error." ;; We don't mark it safe, as it's used as a shell command (defcustom verilog-preprocessor - ;; Very few tools give preprocessed output, so we'll default to Verilog-Perl - "vppreproc __FLAGS__ __FILE__" + "verilator -E __FLAGS__ __FILE__" "Program and arguments to use to preprocess Verilog source. This is invoked with `verilog-preprocess', and depending on the `verilog-set-compile-command', may also be invoked when you type @@ -2983,7 +2982,7 @@ find the errors." "\\)\\|\\(?:" ;; `define and `if can span multiple lines if line ends in '\'. ;; NOTE: `if is not IEEE 1800-2012. - ;; from http://www.emacswiki.org/emacs/MultilineRegexp + ;; from https://www.emacswiki.org/emacs/MultilineRegexp (concat "\\<\\(`define\\|`if\\)\\>" ; directive "\\s-+" ; separator "\\(?:.*?\\(?:\n.*\\)*?\\)" ; definition: to end of line, then maybe more lines (excludes any trailing \n) @@ -3830,7 +3829,7 @@ Variables controlling indentation/edit style: Variables controlling other actions: - `verilog-linter' (default `surelint') + `verilog-linter' (default `none') Unix program to call to run the lint checker. This is the default command for \\[compile-command] and \\[verilog-auto-save-compile]. @@ -7628,9 +7627,9 @@ and `verilog-separator-keywords'.)" (defun verilog-build-defun-re (str &optional arg) "Return function/task/module starting with STR as regular expression. With optional second ARG non-nil, STR is the complete name of the instruction." - (if arg - (concat "^\\(function\\|task\\|module\\)[ \t]+\\(" str "\\)\\>") - (concat "^\\(function\\|task\\|module\\)[ \t]+\\(" str "[a-zA-Z0-9_]*\\)\\>"))) + (unless arg + (setq str (concat str "[a-zA-Z0-9_]*"))) + (concat "^\\s-*\\(function\\|task\\|module\\)[ \t]+\\(?:\\(?:static\\|automatic\\)\\s-+\\)?\\(" str "\\)\\>")) (defun verilog-comp-defun (verilog-str verilog-pred verilog-flag) "Function passed to `completing-read', `try-completion' or `all-completions'. @@ -8996,7 +8995,7 @@ Outputs comments above subcell signals, for example: ;; below 3 modified by verilog-read-sub-decls-line sigs-out sigs-inout sigs-in sigs-intf sigs-intfd) (verilog-beg-of-defun-quick) - (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-mod-point t) + (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-mod-point t) (save-excursion (goto-char (match-beginning 0)) (setq par-values (and verilog-auto-inst-param-value @@ -10811,6 +10810,7 @@ Intended for internal use inside a `verilog-save-font-no-change-functions' block (verilog-regexp-words '("AS" "AUTOARG" "AUTOCONCATWIDTH" "AUTOINST" "AUTOINSTPARAM" "AUTOSENSE"))) + "\\((.*?)\\)?" "\\*/") 'verilog-delete-to-paren) ;; Do .* instantiations, but avoid removing any user pins by looking for our magic comments @@ -10941,7 +10941,7 @@ shown) will make this into: (forward-char 1) (let ((indent-pt (+ (current-column))) (end-pt (save-excursion (verilog-forward-close-paren) (point)))) - (cond ((verilog-re-search-forward-quick "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-pt t) + (cond ((verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-pt t) (goto-char end-pt)) ; Already there, continue search with next instance (t ;; Delete identical interconnect @@ -11596,7 +11596,7 @@ Exceptions: Unless you are instantiating a module multiple times, or the module is something trivial like an adder, DO NOT CHANGE SIGNAL NAMES ACROSS HIERARCHY. It just makes for unmaintainable code. To sanitize signal names, try - vrename from URL `http://www.veripool.org'. + vrename from URL `https://www.veripool.org'. When you need to violate this suggestion there are two ways to list exceptions, placing them before the AUTOINST, or using templates. @@ -11679,7 +11679,7 @@ Templates: InstModule ms2m (/*AUTOINST*/ // Outputs .NotInTemplate (NotInTemplate), - .ptl_bus (ptl_busnew[3:0]), // Templated + .ptl_bus (ptl_busnew[3:0]), .... @@ -11831,11 +11831,11 @@ Lisp Templates: occur. For more information see the \\[verilog-faq] and forums at URL -`http://www.veripool.org'." +`https://www.veripool.org'." (save-excursion ;; Find beginning (let* ((pt (point)) - (for-star (save-excursion (backward-char 2) (looking-at "\\.\\*"))) + (for-star (save-excursion (backward-char 2) (looking-at "\\.\\*"))) (indent-pt (save-excursion (verilog-backward-open-paren) (1+ (current-column)))) (verilog-auto-inst-column (max verilog-auto-inst-column @@ -11940,6 +11940,10 @@ For more information see the \\[verilog-faq] and forums at URL Replace the parameter connections to an instantiation with ones automatically derived from the module header of the instantiated netlist. +You may also provide an optional regular expression, in which +case only parameters matching the regular expression will be +included. + See \\[verilog-auto-inst] for limitations, and templates to customize the output. @@ -11975,7 +11979,9 @@ Templates: just as you would with \\[verilog-auto-inst]." (save-excursion ;; Find beginning - (let* ((pt (point)) + (let* ((params (verilog-read-auto-params 0 1)) + (regexp (nth 0 params)) + (pt (point)) (indent-pt (save-excursion (verilog-backward-open-paren) (1+ (current-column)))) (verilog-auto-inst-column (max verilog-auto-inst-column @@ -12017,6 +12023,8 @@ Templates: (verilog-decls-get-gparams submoddecls) skip-pins)) (vl-dir "parameter")) + (when regexp + (setq sig-list (verilog-signals-matching-regexp sig-list regexp))) (when sig-list (when (not did-first) (verilog-auto-inst-first) (setq did-first t)) ;; Note these are searched for in verilog-read-sub-decls. @@ -12390,7 +12398,7 @@ isn't declared elsewhere inside the module. This is useful for modules which only instantiate other modules. Limitations: - This ONLY detects outputs of AUTOINSTants (see `verilog-read-sub-decls'). + This ONLY detects inputs of AUTOINSTants (see `verilog-read-sub-decls'). If placed inside the parenthesis of a module declaration, it creates Verilog 2001 style, else uses Verilog 1995 style. @@ -12474,7 +12482,7 @@ Make inout statements for any inout signal in an /*AUTOINST*/ that isn't declared elsewhere inside the module. Limitations: - This ONLY detects outputs of AUTOINSTants (see `verilog-read-sub-decls'). + This ONLY detects inouts of AUTOINSTants (see `verilog-read-sub-decls'). If placed inside the parenthesis of a module declaration, it creates Verilog 2001 style, else uses Verilog 1995 style. @@ -13832,7 +13840,7 @@ Using \\[describe-function], see also: `verilog-read-includes' for reading \\=`includes If you have bugs with these autos, please file an issue at -URL `http://www.veripool.org/verilog-mode' or contact the AUTOAUTHOR +URL `https://www.veripool.org/verilog-mode' or contact the AUTOAUTHOR Wilson Snyder (wsnyder@wsnyder.org)." (interactive) (unless noninteractive (message "Updating AUTOs...")) @@ -13890,8 +13898,8 @@ Wilson Snyder (wsnyder@wsnyder.org)." (verilog-auto-re-search-do "/\\*AUTOINSERTLISP(.*?)\\*/" 'verilog-auto-insert-lisp) ;; Expand instances before need the signals the instances input/output - (verilog-auto-re-search-do "/\\*AUTOINSTPARAM\\*/" 'verilog-auto-inst-param) - (verilog-auto-re-search-do "/\\*AUTOINST\\*/" 'verilog-auto-inst) + (verilog-auto-re-search-do "/\\*AUTOINSTPARAM\\((.*?)\\)?\\*/" 'verilog-auto-inst-param) + (verilog-auto-re-search-do "/\\*AUTOINST\\((.*?)\\)?\\*/" 'verilog-auto-inst) (verilog-auto-re-search-do "\\.\\*" 'verilog-auto-star) ;; Must be done before autoin/out as creates a reg (verilog-auto-re-search-do "/\\*AUTOASCIIENUM(.*?)\\*/" 'verilog-auto-ascii-enum) @@ -14427,7 +14435,7 @@ Clicking on the middle-mouse button loads them in a buffer (as in dired)." ;; This scanner is syntax-fragile, so don't get bent (when verilog-highlight-modules (condition-case nil - (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\*/\\|\\.\\*\\)" end-point t) + (while (verilog-re-search-forward-quick "\\(/\\*AUTOINST\\((.*?)\\)?\\*/\\|\\.\\*\\)" end-point t) (save-excursion (goto-char (match-beginning 0)) (unless (verilog-inside-comment-or-string-p) @@ -14513,9 +14521,9 @@ Files are checked based on `verilog-library-flags'." (with-output-to-temp-buffer "*verilog-mode help*" (princ (format "You are using verilog-mode %s\n" verilog-mode-version)) (princ "\n") - (princ "For new releases, see http://www.veripool.com/verilog-mode\n") + (princ "For new releases, see https://www.veripool.org/verilog-mode\n") (princ "\n") - (princ "For frequently asked questions, see http://www.veripool.org/verilog-mode-faq.html\n") + (princ "For frequently asked questions, see https://www.veripool.org/verilog-mode-faq.html\n") (princ "\n") (princ "To submit a bug, use M-x verilog-submit-bug-report\n") (princ "\n"))) @@ -14617,11 +14625,11 @@ I save so much time, my files are colored nicely, my co workers respect my coding ability... until now. I'd really appreciate anything you could do to help me out with this minor deficiency in the product. -I've taken a look at the Verilog-Mode FAQ at: -https://www.veripool.org/wiki/verilog-mode/Faq +I've taken a look at the Verilog-Mode FAQ at +https://www.veripool.org/verilog-mode-faq.html. And, I've considered filing the bug on the issue tracker at -https://www.veripool.org/projects/verilog-mode/issues +https://www.veripool.org/verilog-mode-bugs since I realize that public bugs are easier for you to track, and for others to search, but would prefer to email. commit fc64a0c0e2ea88abfaff6416ce20173484548154 Author: Lars Ingebrigtsen Date: Tue Sep 24 00:42:47 2019 +0200 Rename "dumbquotes" to "smartquotes" in Gnus * doc/misc/gnus.texi (Article Washing): Adjust documentation. * etc/refcards/gnus-refcard.tex (subsection*{Notes}): Ditto * lisp/gnus/gnus-art.el (gnus-article-smartquotes-map): Rename from gnus-article-dumbquotes-map and add obsolete alias. (article-treat-smartquotes): Ditto. * lisp/gnus/gnus-sum.el (gnus-summary-make-menu-bar): Adjust menus. diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index afa45d10f0..d8a257b00b 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -9006,18 +9006,18 @@ Treat overstrike (@code{gnus-article-treat-overstrike}). @item W d @kindex W d @r{(Summary)} -@findex gnus-article-treat-dumbquotes -@vindex gnus-article-dumbquotes-map +@findex gnus-article-treat-smartquotes +@vindex gnus-article-smartquotes-map @cindex Smartquotes @cindex M****s*** sm*rtq**t*s @cindex Latin 1 -Treat M****s*** sm*rtq**t*s according to -@code{gnus-article-dumbquotes-map} -(@code{gnus-article-treat-dumbquotes}). Note that this function guesses -whether a character is a sm*rtq**t* or not, so it should only be used +Treat ``Microsoft smartquotes'' according to +@code{gnus-article-smartquotes-map} +(@code{gnus-article-treat-smartquotes}). Note that this function guesses +whether a character is a smartquote or not, so it should only be used interactively. -Sm*rtq**t*s are M****s***'s unilateral extension to the character map in +Smartquotes are Microsoft's unilateral extension to the character map in an attempt to provide more quoting characters. If you see something like @code{\222} or @code{\264} where you're expecting some kind of apostrophe or quotation mark, then try this wash. @@ -9037,9 +9037,9 @@ like. For instance, @samp{ยป} is translated into @samp{>>}, and so on. @kindex W Y f @r{(Summary)} @findex gnus-article-outlook-deuglify-article @cindex Outlook Express -Full deuglify of broken Outlook (Express) articles: Treat dumbquotes, -unwrap lines, repair attribution and rearrange citation. -(@code{gnus-article-outlook-deuglify-article}). +Full deuglify of broken Outlook (Express) articles: Treat +\"smartquotes\", unwrap lines, repair attribution and rearrange +citation (@code{gnus-article-outlook-deuglify-article}). @item W Y u @kindex W Y u @r{(Summary)} diff --git a/etc/refcards/gnus-refcard.tex b/etc/refcards/gnus-refcard.tex index a16f48dde0..7ecfc8217e 100644 --- a/etc/refcards/gnus-refcard.tex +++ b/etc/refcards/gnus-refcard.tex @@ -670,7 +670,7 @@ W b & Make Message-IDs and URLs in the article mouse-clickable {\bf buttons}.\\ W c & Translate CRLF-pairs to LF and then remaining CR's to LF's.\\ - W d & Treat {\bf dumbquotes}.\\ + W d & Treat {\bf smartquotes}.\\ W e & Treat {\bf emphasized} text.\\ W h & Treat {\bf HTML}.\\ W l & (w) Remove page breaks ({\bf\^{}L}) from the article.\\ diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el index 2fdc34e3e1..3bf6a3aa2a 100644 --- a/lisp/gnus/deuglify.el +++ b/lisp/gnus/deuglify.el @@ -456,11 +456,12 @@ If NODISPLAY is non-nil, don't redisplay the article buffer." ;;;###autoload (defun gnus-outlook-deuglify-article (&optional nodisplay) "Full deuglify of broken Outlook (Express) articles. -Treat dumbquotes, unwrap lines, repair attribution and rearrange citation. If -NODISPLAY is non-nil, don't redisplay the article buffer." +Treat \"smartquotes\", unwrap lines, repair attribution and +rearrange citation. If NODISPLAY is non-nil, don't redisplay the +article buffer." (interactive "P") ;; apply treatment of dumb quotes - (gnus-article-treat-dumbquotes) + (gnus-article-treat-smartquotes) ;; repair wrapped cited lines (gnus-article-outlook-unwrap-lines 'nodisplay) ;; repair attribution line and rearrange citation. diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 07ec269646..922bb99d70 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -894,7 +894,7 @@ images in Emacs." (defvar gnus-decode-address-function 'mail-decode-encoded-address-region "Function used to decode addresses.") -(defvar gnus-article-dumbquotes-map +(defvar gnus-article-smartquotes-map '((?\200 "EUR") (?\202 ",") (?\203 "f") @@ -915,6 +915,8 @@ images in Emacs." (?\234 "oe") (?\264 "'")) "Table for MS-to-Latin1 translation.") +(make-obsolete-variable 'gnus-article-dumbquotes-map + 'gnus-article-smartquotes-map "27.1") (defcustom gnus-ignored-mime-types nil "List of MIME types that should be ignored by Gnus." @@ -2074,18 +2076,20 @@ always hide." )) (forward-line 1)))))) -(defun article-treat-dumbquotes () - "Translate M****s*** sm*rtq**t*s and other symbols into proper text. -Note that this function guesses whether a character is a sm*rtq**t* or +(defun article-treat-smartquotes () + "Translate \"Microsoft smartquotes\" and other symbols into proper text. +Note that this function guesses whether a character is a smartquote or not, so it should only be used interactively. -Sm*rtq**t*s are M****s***'s unilateral extension to the +Smartquotes are Microsoft's unilateral extension to the iso-8859-1 character map in an attempt to provide more quoting characters. If you see something like \\222 or \\264 where you're expecting some kind of apostrophe or quotation mark, then try this wash." (interactive) - (article-translate-strings gnus-article-dumbquotes-map)) + (article-translate-strings gnus-article-smartquotes-map)) +(define-obsolete-function-alias 'article-treat-dumquotes + #'article-treat-smartquotes "27.1") (defvar org-entities) @@ -4371,11 +4375,13 @@ If variable `gnus-use-long-file-name' is non-nil, it is article-date-lapsed article-date-combined-lapsed article-emphasize + article-treat-smartquotes + ;; Obsolete alias. article-treat-dumbquotes article-treat-non-ascii - article-normalize-headers - ;;(article-show-all . gnus-article-show-all-headers) - ))) + article-normalize-headers))) +(define-obsolete-function-alias 'gnus-article-treat-dumbquotes + 'gnus-article-treat-smartquotes "27.1") ;;; ;;; Gnus article mode diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index d175106550..9d6f456827 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -2184,7 +2184,7 @@ increase the score of each group you read." "v" gnus-summary-verbose-headers "a" gnus-article-strip-headers-in-body ;; mnemonic: wash archive "p" gnus-article-verify-x-pgp-sig - "d" gnus-article-treat-dumbquotes + "d" gnus-article-treat-smartquotes "U" gnus-article-treat-non-ascii "i" gnus-summary-idna-message) @@ -2509,7 +2509,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs)))) ["Leading space in headers" gnus-article-remove-leading-whitespace t]) ["Overstrike" gnus-article-treat-overstrike t] - ["Dumb quotes" gnus-article-treat-dumbquotes t] + ["Smartquotes" gnus-article-treat-smartquotes t] ["Non-ASCII" gnus-article-treat-non-ascii t] ["Emphasis" gnus-article-emphasize t] ["Word wrap" gnus-article-fill-cited-article t] commit ac1507a8b6af8755b1bbc88cb0e8a760baaec028 Author: Jan Beich Date: Mon Sep 23 22:11:33 2019 +0200 mml-smime-openssl-sign): Use all the keys * lisp/gnus/mml-smime.el (mml-smime-openssl-sign): Use all the keys in `smime-keys' for this identifier (bug#17780). diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 3bc44df2c8..b2e9b78352 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -133,7 +133,7 @@ Whether the passphrase is cached at all is controlled by (when (null smime-keys) (customize-variable 'smime-keys) (error "No S/MIME keys configured, use customize to add your key")) - (smime-sign-buffer (cdr (assq 'keyfile cont))) + (smime-sign-buffer (cdar smime-keys)) (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n" t t)) commit 0faf3496aba6a664b353fa48ab214ccdb4f62ef4 Author: Lars Ingebrigtsen Date: Mon Sep 23 22:02:58 2019 +0200 Adjust exif-tests.el to new interface diff --git a/test/lisp/image/exif-tests.el b/test/lisp/image/exif-tests.el index d6b46980d7..f85d7c0187 100644 --- a/test/lisp/image/exif-tests.el +++ b/test/lisp/image/exif-tests.el @@ -36,7 +36,7 @@ :value)) (ert-deftest test-exif-parse () - (let ((exif (exif-parse (test-image-file "black.jpg")))) + (let ((exif (exif-parse-file (test-image-file "black.jpg")))) (should (equal (exif-elem exif 'make) "Panasonic")) (should (equal (exif-elem exif 'orientation) 1)) (should (equal (exif-elem exif 'x-resolution) '(180 . 1))))) commit 131b91c7b9344557bfa79b5087a5271c17331f73 Author: Lars Ingebrigtsen Date: Mon Sep 23 21:56:10 2019 +0200 Fix regression in mm-possibly-verify-or-decrypt by previous patch * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Remove debugging diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index f386f62f7e..673098bcb6 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1744,7 +1744,6 @@ If RECURSIVE, search recursively." (equal info "") (member "OK" (split-string info "\n"))) parts - (debug mm-security-handle) ;; We had an error during decryption. Report what it is. (list (mm-make-handle commit 825fd4d34165e5edc718a9df93838a410d25ea81 Author: Lars Ingebrigtsen Date: Mon Sep 23 21:55:27 2019 +0200 Fix regression in mm-possibly-verify-or-decrypt by previous patch * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Be less strict about what's considered a success. diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index b6e2a68d55..f386f62f7e 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1741,16 +1741,19 @@ If RECURSIVE, search recursively." (format "Unknown encrypt protocol (%s)" protocol))))))) (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) (if (or (not info) + (equal info "") (member "OK" (split-string info "\n"))) parts + (debug mm-security-handle) ;; We had an error during decryption. Report what it is. (list (mm-make-handle (with-current-buffer (generate-new-buffer " *mm*") (insert "Error! Result from decryption:\n\n" info "\n\n" - (get-text-property 0 'gnus-details - (car mm-security-handle))) + (or (get-text-property 0 'gnus-details + (car mm-security-handle)) + "")) (current-buffer)) '("text/plain"))))))) commit 8b8942da0b3f76f40ae58e3e81a07e7452d7ca48 Author: Lars Ingebrigtsen Date: Mon Sep 23 21:51:28 2019 +0200 Fix S/MIME continuation header when sending * lisp/gnus/mml-smime.el (mml-smime-epg-sign): Fix continuation header. diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index 78fac8ac30..3bc44df2c8 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -363,7 +363,7 @@ Whether the passphrase is cached at all is controlled by (downcase (cdr (assq micalg epg-digest-algorithm-alist)))))) - (insert "protocol=\"application/pkcs7-signature\"\n") + (insert " protocol=\"application/pkcs7-signature\"\n") (insert (format "\n--%s\n" boundary)) (goto-char (point-max)) (insert (format "\n--%s\n" boundary)) commit 8c1e0ed717e41789024fe3a9b067b4759b5bb102 Author: Lars Ingebrigtsen Date: Mon Sep 23 20:06:03 2019 +0200 make-network-process doc clarification * src/process.c (Fmake_network_process): Further doc clarification for listening on "::". diff --git a/src/process.c b/src/process.c index e53d5d8894..f3daf37636 100644 --- a/src/process.c +++ b/src/process.c @@ -3759,7 +3759,8 @@ address. The symbol `local' specifies the local host. If specified for a server process, it must be a valid name or address for the local host, and only clients connecting to that address will be accepted. If all interfaces should be bound, an address of \"0.0.0.0\" (for -ipv4) or \"::\" (for ipv6) can be used. `local' will use IPv4 by +ipv4) or \"::\" (for ipv6) can be used. (On some operating systems, +using \"::\" list on both ipv4 and ipv5.) `local' will use IPv4 by default, use a FAMILY of 'ipv6 to override this. :service SERVICE -- SERVICE is name of the service desired, or an commit d56f9c2b16b083ccebb271ecb4c5e4271c5d9c56 Author: Paul Eggert Date: Mon Sep 23 11:40:51 2019 -0700 Bring back mention of NNTP gmane Problem reported by Michael Albinus at: https://lists.gnu.org/r/emacs-devel/2019-09/msg00519.html * admin/notes/emba: Reintroduce mention of nttp+news.gmane.org, since that still works. diff --git a/admin/notes/emba b/admin/notes/emba index 40fc88b88a..cb0dbc4809 100644 --- a/admin/notes/emba +++ b/admin/notes/emba @@ -19,6 +19,9 @@ when a job fails. It sends notifications about test status to If you want to receive these notifications, please subscribe at . +Alternatively, these notifications can be read via gmane at +. + The messages contain a URL to the log file of the failed job, like . commit 64f9d6d4537638e2ba710dbadcabc51d37d92c8c Author: Alan Third Date: Mon Sep 23 19:17:38 2019 +0100 Fix GNUstep build * src/nsfont.m (nsfont_draw): Change type to match. Co-authored-by: martin rudalics diff --git a/src/nsfont.m b/src/nsfont.m index dc609cc5d0..437776e7df 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -1010,7 +1010,7 @@ is false when (FROM > 0 || TO < S->nchars). */ NSRect r; struct nsfont_info *font; NSColor *col, *bgCol; - unsigned short *t = s->char2b; + unsigned *t = s->char2b; int i, len, flags; char isComposite = s->first_glyph->type == COMPOSITE_GLYPH; commit 83864ac7afcd1ce9345c9b4390a66d55aa7135a5 Author: Lars Ingebrigtsen Date: Mon Sep 23 19:20:54 2019 +0200 Fix cedet compilation warning * lisp/cedet/semantic/db.el (semanticdb-dirty-p): Fix compilation warning by moving to after definition. diff --git a/lisp/cedet/semantic/db.el b/lisp/cedet/semantic/db.el index 5c7f842383..8847fcc755 100644 --- a/lisp/cedet/semantic/db.el +++ b/lisp/cedet/semantic/db.el @@ -295,11 +295,6 @@ If the buffer is not in memory, load it with `find-file-noselect'." If OBJ's file is not loaded, read it in first." (set-buffer (semanticdb-get-buffer obj))) -(cl-defmethod semanticdb-full-filename ((obj semanticdb-table)) - "Fetch the full filename that OBJ refers to." - (expand-file-name (oref obj file) - (oref (oref obj parent-db) reference-directory))) - (cl-defmethod semanticdb-dirty-p ((obj semanticdb-table)) "Return non-nil if OBJ is dirty." (oref obj dirty)) @@ -357,6 +352,11 @@ Note: This index will not be saved in a persistent file.") :documentation "List of `semantic-db-table' objects.")) "Database of file tables.") +(cl-defmethod semanticdb-full-filename ((obj semanticdb-table)) + "Fetch the full filename that OBJ refers to." + (expand-file-name (oref obj file) + (oref (oref obj parent-db) reference-directory))) + (cl-defmethod semanticdb-full-filename ((obj semanticdb-project-database)) "Fetch the full filename that OBJ refers to. Abstract tables do not have file names associated with them." commit b234fb763076c3a37864d7ded87cf5328f13880d Author: Lars Ingebrigtsen Date: Mon Sep 23 18:37:31 2019 +0200 Update example in the Mail Aliases node of lispintro * doc/lispintro/emacs-lisp-intro.texi (Mail Aliases): Change example to use Message mode, since that's the default for `C-x m' now (bug#13855). diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index c97f6b7a52..22ea655d59 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -17076,8 +17076,8 @@ reminders. @smallexample @group -;;; Mail mode -; To enter mail mode, type 'C-x m' +;;; Message mode +; To enter message mode, type 'C-x m' ; To enter RMAIL (for reading mail), ; type 'M-x rmail' (setq mail-aliases t) commit 4ce81556b7ad7f7f8c8bb07a7a935114bbe850d0 Author: Lars Ingebrigtsen Date: Mon Sep 23 18:23:22 2019 +0200 Make mm-possibly-verify-or-decrypt pass decryption error * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): If there's an error, report the error back in a new part (bug#25649). diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 5636b8eca4..b6e2a68d55 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1738,9 +1738,21 @@ If RECURSIVE, search recursively." (setq parts (funcall func parts ctl)) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details - (format "Unknown encrypt protocol (%s)" protocol)))))) - (t nil)) - parts)) + (format "Unknown encrypt protocol (%s)" protocol))))))) + (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) + (if (or (not info) + (member "OK" (split-string info "\n"))) + parts + ;; We had an error during decryption. Report what it is. + (list + (mm-make-handle + (with-current-buffer (generate-new-buffer " *mm*") + (insert "Error! Result from decryption:\n\n" + info "\n\n" + (get-text-property 0 'gnus-details + (car mm-security-handle))) + (current-buffer)) + '("text/plain"))))))) (defun mm-multiple-handles (handles) (and (listp handles) commit babc595909922201ca92f1bbcc03ae6b7964c1a9 Author: Lars Ingebrigtsen Date: Mon Sep 23 17:35:03 2019 +0200 * lisp/dired-aux.el (dired-copy-file-recursive): Make prompt clearer. diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index a321247b0b..bfc37c5cde 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1609,7 +1609,7 @@ If `ask', ask for user confirmation." (if (and recursive (eq t (file-attribute-type attrs)) (or (eq recursive 'always) - (yes-or-no-p (format "Recursive copies of %s? " from)))) + (yes-or-no-p (format "Copy %s recursively? " from)))) (copy-directory from to preserve-time) (or top (dired-handle-overwrite to)) (condition-case err commit 3f45c14035ea194e44cf06bf5a416b731fd420a9 Author: Lars Ingebrigtsen Date: Mon Sep 23 17:34:41 2019 +0200 Don't bug out on invalid addresses in mml-secure-check-user-id * lisp/gnus/mml-sec.el (mml-secure-check-user-id): Don't bug out on invalid addresses (bug#33613). diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 716e4b778e..51578a753d 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -660,8 +660,9 @@ The passphrase is read and cached." (catch 'break (dolist (uid uids nil) (if (and (stringp (epg-user-id-string uid)) - (car (mail-header-parse-address - (epg-user-id-string uid))) + (car (ignore-errors + (mail-header-parse-address + (epg-user-id-string uid)))) (equal (downcase (car (mail-header-parse-address (epg-user-id-string uid)))) (downcase (car (mail-header-parse-address commit bdc222b26843cfc49bc1b73369acf27fed3aa133 Author: Lars Ingebrigtsen Date: Mon Sep 23 16:05:16 2019 +0200 Tweak how much / raises/lowers text in shr * lisp/net/shr.el (shr-tag-sup, shr-tag-sub): Raising by 0.5 gives very ugly displays. 0.2 seems sufficient for legibility. diff --git a/lisp/net/shr.el b/lisp/net/shr.el index cd5aa3980a..2e4f7fa5c6 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -1376,12 +1376,12 @@ ones, in case fg and bg are nil." (defun shr-tag-sup (dom) (let ((start (point))) (shr-generic dom) - (put-text-property start (point) 'display '(raise 0.5)))) + (put-text-property start (point) 'display '(raise 0.2)))) (defun shr-tag-sub (dom) (let ((start (point))) (shr-generic dom) - (put-text-property start (point) 'display '(raise -0.5)))) + (put-text-property start (point) 'display '(raise -0.2)))) (defun shr-tag-p (dom) (shr-ensure-paragraph) commit ce49efd4c602d5bed7c5ef03237b08df09809591 Author: Lars Ingebrigtsen Date: Mon Sep 23 14:09:48 2019 +0200 Signal errors if EPA can't verify data * lisp/epa.el (epa-verify-region): Signal an error if the region couldn't be verified (bug#14720). (epa-verify-file): Say that the file couldn't be verified instead of just "...done". diff --git a/lisp/epa.el b/lisp/epa.el index b55a55fbb9..5943348960 100644 --- a/lisp/epa.el +++ b/lisp/epa.el @@ -701,7 +701,8 @@ If you do not specify PLAIN-FILE, this functions prompts for the value to use." (message "Verifying %s...done" (file-name-nondirectory file)) (if (epg-context-result-for context 'verify) (epa-display-info (epg-verify-result-to-string - (epg-context-result-for context 'verify)))))) + (epg-context-result-for context 'verify))) + (message "Verification not successful")))) (defun epa--read-signature-type () (let (type c) @@ -945,6 +946,8 @@ For example: (or coding-system-for-read (get-text-property start 'epa-coding-system-used) 'undecided))) + (unless (epg-context-result-for context 'verify) + (error "Unable to verify region")) (if (or (eq epa-replace-original-text t) (and epa-replace-original-text (y-or-n-p "Replace the original text? "))) commit abdc82c08fa57e1ba66b8c7efb44a7874ba221f7 Author: Lars Ingebrigtsen Date: Mon Sep 23 13:24:44 2019 +0200 Make "Show Hidden Headers" in Message buffers more obvious * lisp/gnus/message.el (message-widen-and-recenter): New command to ensure that we show most of the headers (bug#23252). (message-mode-field-menu): Use it. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 35baae01f9..9de35bd44c 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2890,7 +2890,7 @@ systematically send encrypted emails when possible." ["Sort Headers" message-sort-headers t] ["Encode non-ASCII domain names" message-idna-to-ascii-rhs t] ;; We hide `message-hidden-headers' by narrowing the buffer. - ["Show Hidden Headers" widen t] + ["Show Hidden Headers" message-widen-and-recenter t] ["Goto Body" message-goto-body t] ["Goto Signature" message-goto-signature t])) @@ -3369,6 +3369,12 @@ or in the synonym headers, defined by `message-header-synonyms'." ;;; Various commands +(defun message-widen-and-recenter () + "Widen the buffer and go to the start." + (interactive) + (widen) + (goto-char (point-min))) + (defun message-delete-not-region (beg end) "Delete everything in the body of the current message outside of the region." (interactive "r") commit a90c5684a3dbb7f90bd96b45027100f9f7ffd80a Author: Lars Ingebrigtsen Date: Mon Sep 23 13:15:53 2019 +0200 Add a NEWS entry for message citation levels diff --git a/etc/NEWS b/etc/NEWS index e28bb2c0bd..3f38f9f4a1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1576,6 +1576,10 @@ GnuTLS manual) is recommended instead. ** Message +*** 'message-mode' now supports highlighting citations of different +depths. This can be customized via 'message-cite-level-function' and +the new 'message-cited-text-*' faces. + +++ *** Messages can now be systematically encrypted when the PGP keyring contains a public key for every recipient. To commit 4c1edb0228721c54dff4db6a1df303be3b39aa39 Author: Hong Xu Date: Mon Sep 23 13:09:36 2019 +0200 Add different faces for different citation levels in Message mode * message.el (message-font-lock-keywords) (message-font-lock-make-cited-text-matcher): Add support for different faces for different citation levels. The faces are defined in the faces named `message-cited-text-N': N of the Mth citation level will be M mod 4. (message-cited-text-1, message-cited-text-2) (message-cited-text-3, message-cited-text-4): Add customization for the faces of 4 different citation level. In the future, the number of faces may increase, as the code is flexible enough to automatically deal with that. (message-cite-level-function): Add a function to customize the determination of cite levels given the prefix of the cited text (bug#25022). diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index c211bcc265..35baae01f9 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -660,6 +660,12 @@ variable should be a regexp or a list of regexps." (setq gnus-message-cite-prefix-regexp (concat "^\\(?:" value "\\)")))))) +(defcustom message-cite-level-function (lambda (s) (cl-count ?> s)) + "A function to determine the level of cited text. +The function accepts 1 parameter which is the matched prefix." + :type 'function + :version "27.1") + (defcustom message-cancel-message "I am canceling my own article.\n" "Message to be inserted in the cancel message." :group 'message-interface @@ -1540,18 +1546,58 @@ starting with `not' and followed by regexps." "Face used for displaying the separator." :group 'message-faces) -(defface message-cited-text +(defface message-cited-text-1 '((((class color) (background dark)) - :foreground "LightPink1") + (:foreground "LightPink1")) (((class color) (background light)) - :foreground "red") + (:foreground "red1")) (t - :bold t)) - "Face used for displaying cited text names." + (:bold t))) + "Face used for displaying 1st-level cited text." + :group 'message-faces) + +(defface message-cited-text-2 + '((((class color) + (background dark)) + (:foreground "forest green")) + (((class color) + (background light)) + (:foreground "red4")) + (t + (:bold t))) + "Face used for displaying 2nd-level cited text." :group 'message-faces) +(defface message-cited-text-3 + '((((class color) + (background dark)) + (:foreground "goldenrod3")) + (((class color) + (background light)) + (:foreground "OliveDrab4")) + (t + (:bold t))) + "Face used for displaying 3rd-level cited text." + :group 'message-faces) + +(defface message-cited-text-4 + '((((class color) + (background dark)) + (:foreground "chocolate3")) + (((class color) + (background light)) + (:foreground "SteelBlue4")) + (t + (:bold t))) + "Face used for displaying 4th-level cited text." + :group 'message-faces) + +;; backward-compatibility alias +(put 'message-cited-text 'face-alias 'message-cited-text-1) +(put 'message-cited-text 'obsolete-face "26.1") + (defface message-mml '((((class color) (background dark)) @@ -1580,48 +1626,84 @@ starting with `not' and followed by regexps." (set-match-data (list start (point))) (point)))) +(defun message-font-lock-make-cited-text-matcher (level maxlevel) + "Generate the matcher for cited text. +LEVEL is the citation level to be matched and MAXLEVEL is the +number of levels specified in the faces `message-cited-text-*'." + (lambda (limit) + (let (matched) + ;; Keep search until `message-cite-level-function' returns the level + ;; we want to match. + (while (and (re-search-forward (concat "^\\(" + message-cite-prefix-regexp + "\\).*") + limit t) + (not (setq matched + (save-match-data + (= (1- level) + (mod + (1- (funcall message-cite-level-function + (match-string 1))) + maxlevel))))))) + matched))) + (defvar message-font-lock-keywords - (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?")) - `((message-match-to-eoh - (,(concat "^\\([Tt]o:\\)" content) - (progn (goto-char (match-beginning 0)) (match-end 0)) nil - (1 'message-header-name) - (2 'message-header-to nil t)) - (,(concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content) - (progn (goto-char (match-beginning 0)) (match-end 0)) nil - (1 'message-header-name) - (2 'message-header-cc nil t)) - (,(concat "^\\([Ss]ubject:\\)" content) - (progn (goto-char (match-beginning 0)) (match-end 0)) nil - (1 'message-header-name) - (2 'message-header-subject nil t)) - (,(concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content) - (progn (goto-char (match-beginning 0)) (match-end 0)) nil - (1 'message-header-name) - (2 'message-header-newsgroups nil t)) - (,(concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content) - (progn (goto-char (match-beginning 0)) (match-end 0)) nil - (1 'message-header-name) - (2 'message-header-xheader)) - (,(concat "^\\([A-Z][^: \n\t]+:\\)" content) - (progn (goto-char (match-beginning 0)) (match-end 0)) nil - (1 'message-header-name) - (2 'message-header-other nil t))) - (,(lambda (limit) - (and mail-header-separator - (not (equal mail-header-separator "")) - (re-search-forward - (concat "^" (regexp-quote mail-header-separator) "$") - limit t))) - 0 'message-separator) - (,(lambda (limit) - (re-search-forward (concat "^\\(?:" - message-cite-prefix-regexp - "\\).*") - limit t)) - 0 'message-cited-text) - ("<#/?\\(?:multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>" - 0 'message-mml))) + (nconc + (let ((content "[ \t]*\\(.+\\(\n[ \t].*\\)*\\)\n?")) + `((message-match-to-eoh + (,(concat "^\\([Tt]o:\\)" content) + (progn (goto-char (match-beginning 0)) (match-end 0)) nil + (1 'message-header-name) + (2 'message-header-to nil t)) + (,(concat "^\\(^[GBF]?[Cc][Cc]:\\|^[Rr]eply-[Tt]o:\\)" content) + (progn (goto-char (match-beginning 0)) (match-end 0)) nil + (1 'message-header-name) + (2 'message-header-cc nil t)) + (,(concat "^\\([Ss]ubject:\\)" content) + (progn (goto-char (match-beginning 0)) (match-end 0)) nil + (1 'message-header-name) + (2 'message-header-subject nil t)) + (,(concat "^\\([Nn]ewsgroups:\\|Followup-[Tt]o:\\)" content) + (progn (goto-char (match-beginning 0)) (match-end 0)) nil + (1 'message-header-name) + (2 'message-header-newsgroups nil t)) + (,(concat "^\\(X-[A-Za-z0-9-]+:\\|In-Reply-To:\\)" content) + (progn (goto-char (match-beginning 0)) (match-end 0)) nil + (1 'message-header-name) + (2 'message-header-xheader)) + (,(concat "^\\([A-Z][^: \n\t]+:\\)" content) + (progn (goto-char (match-beginning 0)) (match-end 0)) nil + (1 'message-header-name) + (2 'message-header-other nil t))) + (,(lambda (limit) + (and mail-header-separator + (not (equal mail-header-separator "")) + (re-search-forward + (concat "^" (regexp-quote mail-header-separator) "$") + limit t))) + 0 'message-separator) + ("<#/?\\(?:multipart\\|part\\|external\\|mml\\|secure\\)[^>]*>" + 0 'message-mml))) + ;; Additional font locks to highlight different levels of cited text + (let ((maxlevel 1) + (level 1) + cited-text-face + keywords) + ;; Compute the max level. + (while (setq cited-text-face + (intern-soft (format "message-cited-text-%d" maxlevel))) + (setq maxlevel (1+ maxlevel))) + (setq maxlevel (1- maxlevel)) + ;; Generate the keywords. + (while (setq cited-text-face + (intern-soft (format "message-cited-text-%d" level))) + (setq keywords + (cons + `(,(message-font-lock-make-cited-text-matcher level maxlevel) + (0 ',cited-text-face)) + keywords)) + (setq level (1+ level))) + keywords)) "Additional expressions to highlight in Message mode.") (defvar message-face-alist commit a877e2217a4ee74f030b1b69b802e9d7c81a6349 Author: Michael Albinus Date: Mon Sep 23 13:08:02 2019 +0200 ; Enable traces for shadowfile-tests on hydra diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index 7caddc53d7..cee51b20d8 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -64,7 +64,7 @@ "Temporary directory for Tramp tests.") (setq password-cache-expiry nil - shadow-debug nil + shadow-debug (getenv "EMACS_HYDRA_CI") tramp-verbose 0 tramp-message-show-message nil ;; On macOS, `temporary-file-directory' is a symlinked directory. commit 87b685f4365f663ef1258cd60616034cd2cc89c9 Author: Lars Ingebrigtsen Date: Mon Sep 23 12:27:42 2019 +0200 Add an `authinfo-hidden' variable * lisp/auth-source.el (authinfo-hidden): New variable. (authinfo--hide-passwords): Use it to allow users to decide what to hide. diff --git a/etc/NEWS b/etc/NEWS index 73f0ca2497..e28bb2c0bd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1497,7 +1497,8 @@ To recover the previous behavior, set new user option *** .authinfo and .netrc files now use a new mode: 'authinfo-mode'. This is just like 'fundamental-mode', except that it hides passwords under a "****" display property. When the cursor moves to this text, -the real password is revealed (via 'reveal-mode'). +the real password is revealed (via 'reveal-mode'). The +'authinfo-hidden' variable can be used to control what to hide. ** Tramp diff --git a/lisp/auth-source.el b/lisp/auth-source.el index 6d53a222e9..9061d41556 100644 --- a/lisp/auth-source.el +++ b/lisp/auth-source.el @@ -2400,6 +2400,11 @@ MODE can be \"login\" or \"password\"." ;;; Tiny mode for editing .netrc/.authinfo modes (that basically just ;;; hides passwords). +(defcustom authinfo-hidden "password" + "Regexp matching elements in .authinfo/.netrc files that should be hidden." + :type 'regexp + :version "27.1") + ;;;###autoload (define-derived-mode authinfo-mode fundamental-mode "Authinfo" "Mode for editing .authinfo/.netrc files. @@ -2416,13 +2421,15 @@ passwords are revealed when point moved into the password. (save-restriction (narrow-to-region start end) (goto-char start) - (while (re-search-forward "\\(\\s-\\|^\\)password\\s-+\\([^\n\t ]+\\)" + (while (re-search-forward (format "\\(\\s-\\|^\\)\\(%s\\)\\s-+" + authinfo-hidden) nil t) - (let ((overlay (make-overlay (match-beginning 2) (match-end 2)))) - (overlay-put overlay 'display (propertize "****" - 'face 'warning)) - (overlay-put overlay 'reveal-toggle-invisible - #'authinfo--toggle-display)))))) + (when (looking-at "[^\n\t ]+") + (let ((overlay (make-overlay (match-beginning 0) (match-end 0)))) + (overlay-put overlay 'display (propertize "****" + 'face 'warning)) + (overlay-put overlay 'reveal-toggle-invisible + #'authinfo--toggle-display))))))) (defun authinfo--toggle-display (overlay hide) (if hide commit 0f45f383b9e66e90f092a6095b2f0faa19e55af3 Author: nitishch Date: Mon Sep 23 12:02:08 2019 +0200 "]" is not a standard citation prefix character * lisp/mail/sendmail.el (mail-citation-prefix-regexp): Don't regard "]" as a citation prefix character (bug#25150). This allows some motion commands (like forward-sexp) to behave more as expected in Message mode buffers. Copyright-paperwork-exempt: yes diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 1da33a43eb..e71f98282a 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -249,7 +249,7 @@ regardless of what part of it (if any) is included in the cited text.") ;;;###autoload (defcustom mail-citation-prefix-regexp - (purecopy "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[]>|]\\)+") + (purecopy "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[>|]\\)+") "Regular expression to match a citation prefix plus whitespace. It should match whatever sort of citation prefixes you want to handle, with whitespace before and after; it should also match just whitespace. commit 72b2b4a5dbac0199ae50430cf956ec85651f38b3 Author: Lars Ingebrigtsen Date: Mon Sep 23 11:46:11 2019 +0200 Keep a cache of encoded Message contents to avoid re-GPG-in data * lisp/gnus/gnus-msg.el (gnus-inews-do-gcc): Use it to avoid re-encoding. * lisp/gnus/message.el (message-encoded-mail-cache): New variable. * lisp/gnus/message.el (message-send-mail): Store encoded. (message--cache-encoded): New function. (message-do-fcc): Store encoded (bug#25155). diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el index 25efb8afda..10793455a5 100644 --- a/lisp/gnus/gnus-msg.el +++ b/lisp/gnus/gnus-msg.el @@ -1587,6 +1587,7 @@ this is a reply." (message-narrow-to-headers) (let ((gcc (or gcc (mail-fetch-field "gcc" nil t))) (cur (current-buffer)) + (encoded-cache message-encoded-mail-cache) groups group method group-art options mml-externalize-attachments) (when gcc @@ -1614,7 +1615,12 @@ this is a reply." (setq message-options (with-current-buffer cur message-options)) (insert-buffer-substring cur) (run-hooks 'gnus-gcc-pre-body-encode-hook) - (message-encode-message-body) + ;; Avoid re-doing things like GPG-encoding secret parts. + (if (not encoded-cache) + (message-encode-message-body) + (erase-buffer) + (insert encoded-cache)) + (message-remove-header "gcc") (run-hooks 'gnus-gcc-post-body-encode-hook) (save-restriction (message-narrow-to-headers) diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 58b25f9144..c211bcc265 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -1891,6 +1891,9 @@ You must have the \"hashcash\" binary installed, see `hashcash-path'." (defvar message-bogus-system-names "\\`localhost\\.\\|\\.local\\'" "The regexp of bogus system names.") +(defvar message-encoded-mail-cache nil + "After sending a message, the encoded version is cached in this variable.") + (autoload 'gnus-alive-p "gnus-util") (autoload 'gnus-delay-article "gnus-delay") (autoload 'gnus-extract-address-components "gnus-util") @@ -2974,7 +2977,8 @@ Like `text-mode', but with these additional commands: ;; excluding citations and other artifacts. ;; (set (make-local-variable 'syntax-propertize-function) 'message--syntax-propertize) - (set (make-local-variable 'parse-sexp-ignore-comments) t)) + (set (make-local-variable 'parse-sexp-ignore-comments) t) + (setq-local message-encoded-mail-cache nil)) (defun message-setup-fill-variables () "Setup message fill variables." @@ -4598,6 +4602,7 @@ If you always want Gnus to send messages in one piece, set (mml-buffer-substring-no-properties-except-some (point-min) (point-max)))) (message-encode-message-body) + (message--cache-encoded mailbuf) (save-restriction (message-narrow-to-headers) ;; We (re)generate the Lines header. @@ -4653,6 +4658,14 @@ If you always want Gnus to send messages in one piece, set (setq message-options options) (push 'mail message-sent-message-via))) +(defun message--cache-encoded (mailbuf) + ;; Store the encoded buffer data for possible reuse later + ;; when doing Fcc/Gcc handling. This avoids having to do + ;; things like re-GPG-encoding secure parts. + (let ((encoded (buffer-string))) + (with-current-buffer mailbuf + (setq message-encoded-mail-cache encoded)))) + (defun message--fold-long-headers () "Fold too-long header lines. Each line should be no more than 79 characters long." @@ -4946,6 +4959,7 @@ Otherwise, generate and save a value for `canlock-password' first." (mml-buffer-substring-no-properties-except-some (point-min) (point-max)))) (message-encode-message-body) + (message--cache-encoded messbuf) ;; Remove some headers. (save-restriction (message-narrow-to-headers) @@ -5408,6 +5422,7 @@ The result is a fixnum." "Process Fcc headers in the current buffer." (let ((case-fold-search t) (buf (current-buffer)) + (encoded-cache message-encoded-mail-cache) (mml-externalize-attachments message-fcc-externalize-attachments) (file (message-field-value "fcc" t)) list) @@ -5415,7 +5430,11 @@ The result is a fixnum." (with-temp-buffer (insert-buffer-substring buf) (message-clone-locals buf) - (message-encode-message-body) + ;; Avoid re-doing things like GPG-encoding secret parts. + (if (not encoded-cache) + (message-encode-message-body) + (erase-buffer) + (insert encoded-cache)) (save-restriction (message-narrow-to-headers) (while (setq file (message-fetch-field "fcc" t)) commit 65ee105d8064bce24ff33643e913a06ad7464f77 Author: Lars Ingebrigtsen Date: Mon Sep 23 11:27:26 2019 +0200 * lisp/gnus/message.el (message-send-mail): Remove misleading comment. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 4ea8f7b02e..58b25f9144 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4597,7 +4597,6 @@ If you always want Gnus to send messages in one piece, set (insert (with-current-buffer mailbuf (mml-buffer-substring-no-properties-except-some (point-min) (point-max)))) - ;; Remove some headers. (message-encode-message-body) (save-restriction (message-narrow-to-headers)