From 9034dd6c703975e9da3a269b84d8b756b997a4d8 Mon Sep 17 00:00:00 2001 From: Trevor Spiteri Date: Mon, 14 Jan 2019 23:10:34 +0100 Subject: [PATCH 01/11] Fix cursor column positioning on Grep hits * lisp/progmodes/grep.el (grep-match-face): Move before first use, to avoid byte-compilation warning. (grep-regexp-alist): Don't quote grep-match-face. (Bug#34068) Copyright-paperwork-exempt: yes --- lisp/progmodes/grep.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index df8cb3da7ef..8b9a2d86c75 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -366,6 +366,9 @@ A grep buffer becomes most recent when you select Grep mode in it. Notice that using \\[next-error] or \\[compile-goto-error] modifies `compilation-last-buffer' rather than `grep-last-buffer'.") +(defvar grep-match-face 'match + "Face name to use for grep matches.") + ;;;###autoload (defconst grep-regexp-alist `((,(concat "^\\(?:" @@ -389,7 +392,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) - (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face))) + (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) . @@ -397,7 +400,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) - (mbeg (text-property-any beg end 'font-lock-face 'grep-match-face)) + (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) @@ -421,9 +424,6 @@ See `compilation-error-regexp-alist' for format details.") (defvar grep-error-face 'compilation-error "Face name to use for grep error messages.") -(defvar grep-match-face 'match - "Face name to use for grep matches.") - (defvar grep-context-face 'shadow "Face name to use for grep context lines.") From 928d342c81c4d442e3125ddc463d141029d6898f Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 21 Jan 2019 18:20:33 +0200 Subject: [PATCH 02/11] Improve documentation of 'isearch-filter-predicate' * lisp/isearch.el (isearch-filter-predicate) (isearch-filter-visible): Doc fixes. (Bug#34150) --- lisp/isearch.el | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/lisp/isearch.el b/lisp/isearch.el index 7ee71b4979d..25d6ad591eb 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -188,11 +188,14 @@ or to the end of the buffer for a backward search.") to the search status stack.") (defvar isearch-filter-predicate #'isearch-filter-visible - "Predicate that filters the search hits that would normally be available. -Search hits that dissatisfy the predicate are skipped. The function -has two arguments: the positions of start and end of text matched by -the search. If this function returns nil, continue searching without -stopping at this match. + "Predicate to filter hits of Isearch and replace commands. +Isearch hits that don't satisfy the predicate will be skipped. +The value should be a function of two arguments; it will be +called with the the positions of the start and the end of the +text matched by Isearch and replace commands. If this function +returns nil, Isearch and replace commands will continue searching +without stopping at resp. replacing this match. + If you use `add-function' to modify this variable, you can use the `isearch-message-prefix' advice property to specify the prefix string displayed in the search message.") @@ -3009,10 +3012,13 @@ Optional third argument, if t, means if fail just return nil (no error). (setq isearch-hidden t))))))) (defun isearch-filter-visible (beg end) - "Test whether the current search hit is visible at least partially. -Return non-nil if the text from BEG to END is visible to Isearch as -determined by `isearch-range-invisible' unless invisible text can be -searched too when `search-invisible' is t." + "Return non-nil if text between BEG and END is deemed visible by Isearch. +This function is intended to be used as `isearch-filter-predicate'. +It returns non-nil if the text between BEG and END is visible to +Isearch, at least partially, as determined by `isearch-range-invisible'. +If `search-invisible' is t, which allows Isearch matches inside +invisible text, this function will always return non-nil, regardless +of what `isearch-range-invisible' says." (or (eq search-invisible t) (not (isearch-range-invisible beg end)))) From b6c762a520c041d8c69a8557b9ee5ffdd3004b1f Mon Sep 17 00:00:00 2001 From: Benjamin Riefenstahl Date: Tue, 15 Jan 2019 17:00:04 +0100 Subject: [PATCH 03/11] create-image: Expand documentation (bug#33990) * lisp/image.el (create-image): Discuss default for :scale in the doc string. --- lisp/image.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/image.el b/lisp/image.el index b49f1b3aa5a..3019da556b3 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -413,13 +413,20 @@ must be available." (defun create-image (file-or-data &optional type data-p &rest props) "Create an image. FILE-OR-DATA is an image file name or image data. + Optional TYPE is a symbol describing the image type. If TYPE is omitted or nil, try to determine the image type from its first few bytes of image data. If that doesn't work, and FILE-OR-DATA is a file name, use its file extension as image type. + Optional DATA-P non-nil means FILE-OR-DATA is a string containing image data. + Optional PROPS are additional image attributes to assign to the image, -like, e.g. `:mask MASK'. +like, e.g. `:mask MASK'. If the property `:scale' is not given and the +display has a high resolution (more exactly, when the average width of a +character in the default font is more than 10 pixels), the image is +automatically scaled up in proportion to the default font. + Value is the image created, or nil if images of type TYPE are not supported. Images should not be larger than specified by `max-image-size'. From 68e55a0bfc15d6b39ae7aa5650f375ff6784246d Mon Sep 17 00:00:00 2001 From: Benjamin Riefenstahl Date: Mon, 14 Jan 2019 23:37:03 +0100 Subject: [PATCH 04/11] image-mode: Do not use default scaling (bug#33990) * lisp/image-mode.el (image-toggle-display-image): Set :scale == 1 so that create-image does not apply additional scaling. --- lisp/image-mode.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index 7dfa691065c..3666009c7e0 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -761,9 +761,11 @@ was inserted." (type (if (fboundp 'imagemagick-types) 'imagemagick (image-type file-or-data nil data-p))) + ;; :scale 1: If we do not set this, create-image will apply + ;; default scaling based on font size. (image (if (not edges) - (create-image file-or-data type data-p) - (create-image file-or-data type data-p + (create-image file-or-data type data-p :scale 1) + (create-image file-or-data type data-p :scale 1 :max-width (- (nth 2 edges) (nth 0 edges)) :max-height (- (nth 3 edges) (nth 1 edges))))) (inhibit-read-only t) From 90177d7f12d25e403abc6f1bdf242aed308a7bb8 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Fri, 18 Jan 2019 03:12:07 -0500 Subject: [PATCH 05/11] Avoid elisp crash for OpenPGP User IDs with no e-mail address * lisp/gnus/mml-sec.el (mml-secure-check-user-id): Verify that there is an e-mail address in the current User ID before trying to downcase it. (Bug#34121) Copyright-paperwork-exempt: yes --- lisp/gnus/mml-sec.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el index 8c485fec376..4fca4ce67b7 100644 --- a/lisp/gnus/mml-sec.el +++ b/lisp/gnus/mml-sec.el @@ -658,6 +658,8 @@ 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))) (equal (downcase (car (mail-header-parse-address (epg-user-id-string uid)))) (downcase (car (mail-header-parse-address From a177fe754db3919c1515bdfcd1c2ea28543da8e8 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 25 Jan 2019 10:45:25 +0200 Subject: [PATCH 06/11] Fix LaTeX output of month and day from cal-tex.el * lisp/calendar/cal-tex.el (cal-tex-cursor-week-iso) (cal-tex-week-hours): Escape a lone blank, to make it through LaTeX. (Bug#34148) --- lisp/calendar/cal-tex.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/calendar/cal-tex.el b/lisp/calendar/cal-tex.el index 469430b2a48..30429b6d592 100644 --- a/lisp/calendar/cal-tex.el +++ b/lisp/calendar/cal-tex.el @@ -927,7 +927,7 @@ argument EVENT specifies a different buffer position." (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date))) (insert ", ") (cal-tex-large-bf (cal-tex-month-name month)) - (insert " ") + (insert "\\ ") (cal-tex-large-bf (number-to-string day)) (unless (string-equal "" (setq s (cal-tex-latexify-list holidays date "; "))) @@ -978,7 +978,7 @@ shown are hard-coded to 8-12, 13-17." (cal-tex-large-bf (cal-tex-LaTeXify-string (calendar-day-name date))) (insert ", ") (cal-tex-large-bf (cal-tex-month-name month)) - (insert " ") + (insert "\\ ") (cal-tex-large-bf (number-to-string day)) (unless (string-equal "" (setq s (cal-tex-latexify-list holidays date "; "))) From 9078f34e84178553cd59bc03ac1b58cb56038436 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 25 Jan 2019 16:14:00 +0000 Subject: [PATCH 07/11] Fix a loop in c-fl-decl-start. This fixes bug #34186. * lisp/progmodes/cc-mode.el (c-fl-decl-start) In the pair of operations c-syntactic-skip-backward and c-forward-syntactic-ws, ensure the latter doesn't come back to the position before the former, and break out of the enclosing loop if it does. --- lisp/progmodes/cc-mode.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 8cbb4e86123..5283cfea6eb 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1487,6 +1487,7 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") ;; lock context (etc.) fontification. (goto-char pos) (let ((lit-start (c-literal-start)) + old-pos (new-pos pos) capture-opener bod-lim bo-decl) @@ -1509,12 +1510,14 @@ Note that this is a strict tail, so won't match, e.g. \"0x....\".") (while ;; Go to a less nested declaration each time round this loop. (and + (setq old-pos (point)) (c-syntactic-skip-backward "^;{}" bod-lim t) (> (point) bod-lim) (progn (c-forward-syntactic-ws) ;; Have we got stuck in a comment at EOB? (not (and (eobp) (c-literal-start)))) + (< (point) old-pos) (progn (setq bo-decl (point)) (or (not (looking-at c-protection-key)) (c-forward-keyword-clause 1))) From ceccb3c8c4461cfb69b64d94a57709393b8c39fd Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 26 Jan 2019 16:46:54 +0100 Subject: [PATCH 08/11] New node Authentication in the Emacs manual * doc/emacs/custom.texi (Customization): * doc/emacs/emacs.texi (Top): Add node Authentication. --- doc/emacs/custom.texi | 38 ++++++++++++++++++++++++++++++++++++++ doc/emacs/emacs.texi | 1 + 2 files changed, 39 insertions(+) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 4aaf58cc264..32706f3868d 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -32,6 +32,8 @@ Reference Manual}. By changing them, you can redefine keys. * Init File:: How to write common customizations in the initialization file. +* Authentication:: Keeping persistent authentication information. + @end menu @node Easy Customization @@ -2609,3 +2611,39 @@ instance: @noindent Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}. + +@node Authentication +@section Keeping Persistent Authentication Information +@cindex ~/.authinfo file +@cindex ~/.authinfo.gpg file +@cindex ~/.netrc file + + Some Emacs packages, which connect to other services, require +authentication (@pxref{Passwords}), e.g., @ref{Top, Gnus,, gnus, The +Gnus Manual}, or @ref{Top, Tramp,, tramp, The Tramp Manual}. Because +it might be annoying to provide the same user name and password again +and again, Emacs offers to keep this information persistent via the +auth-source library. + + Per default, this information is taken from the file +@file{~/.authinfo} or @file{~/.authinfo.gpg} or @file{~/.netrc}. +These files have a syntax similar to netrc files as known from the ftp +program, like + +@example +machine @var{mymachine} login @var{myloginname} password @var{mypassword} port @var{myport} +@end example + + Similarly, the auth-source library supports multiple storage +backend, currently either the classic netrc backend, JSON files, the +Secret Service API, and pass, the standard unix password manager. + +@vindex auth-sources + All these alternatives are customized via the user option +@code{auth-sources}, @ref{Top, Emacs auth-source,, auth, Emacs auth-source}. + +@vindex auth-source-save-behavior + When a password is entered interactively, which is not found via the +configured backend, some of the backends offer to save it +persistently. This can be changed by the customizing user option +@code{auth-source-save-behavior}. diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index d501db71914..5b16d5034f1 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi @@ -1114,6 +1114,7 @@ Customization By changing them, you can redefine keys. * Init File:: How to write common customizations in the initialization file. +* Authentication:: Keeping persistent authentication information. Easy Customization Interface From bf235ce339bbeabfd183f06857dbb4eb4a0119db Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 27 Jan 2019 18:14:44 +0100 Subject: [PATCH 09/11] * doc/emacs/custom.texi (Authentication): Refer to the "Help for users" node. --- doc/emacs/custom.texi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 32706f3868d..b4623fbef84 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2640,7 +2640,8 @@ Secret Service API, and pass, the standard unix password manager. @vindex auth-sources All these alternatives are customized via the user option -@code{auth-sources}, @ref{Top, Emacs auth-source,, auth, Emacs auth-source}. +@code{auth-sources}, @ref{Help for users, Emacs auth-source,, auth, +Emacs auth-source}. @vindex auth-source-save-behavior When a password is entered interactively, which is not found via the From 73508e62459113be4c7c101648afbe541dd18558 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 29 Jan 2019 18:28:13 +0200 Subject: [PATCH 10/11] Improve documentation of face numbers * doc/lispref/display.texi (Face Functions): Mention where the face number is used and that it depends on the 'face' property of the face symbol. Improve indexing. --- doc/lispref/display.texi | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index b3ce7fbf6af..921d58a1f3a 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3038,10 +3038,17 @@ value, which inherits from @var{face}'s global definition. This function returns a list of all defined face names. @end defun +@cindex face number +@cindex face property of face symbols @defun face-id face This function returns the @dfn{face number} of face @var{face}. This is a number that uniquely identifies a face at low levels within Emacs. It is seldom necessary to refer to a face by its face number. +However, functions that manipulate glyphs, such as +@code{make-glyph-code} and @code{glyph-face} (@pxref{Glyphs}) access +the face numbers internally. Note that the face number is stored as +the value of the @code{face} property of the face symbol, so we +recommend not to set that property of a face to any value of your own. @end defun @defun face-documentation face From b94d76752776cca4d1652cfe715a60f4a36f14a3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 29 Jan 2019 18:49:50 +0200 Subject: [PATCH 11/11] Minor copyedits in last manual change * doc/emacs/custom.texi (Authentication): Improve markup, indexing, and wording. --- doc/emacs/custom.texi | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index b4623fbef84..3f660fe9a28 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -2614,37 +2614,37 @@ Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}. @node Authentication @section Keeping Persistent Authentication Information -@cindex ~/.authinfo file -@cindex ~/.authinfo.gpg file -@cindex ~/.netrc file Some Emacs packages, which connect to other services, require -authentication (@pxref{Passwords}), e.g., @ref{Top, Gnus,, gnus, The +authentication (@pxref{Passwords}), e.g., see @ref{Top, Gnus,, gnus, The Gnus Manual}, or @ref{Top, Tramp,, tramp, The Tramp Manual}. Because it might be annoying to provide the same user name and password again and again, Emacs offers to keep this information persistent via the -auth-source library. +@file{auth-source} library. - Per default, this information is taken from the file +@cindex @file{~/.authinfo} file +@cindex @file{~/.authinfo.gpg} file +@cindex ~/.netrc file + By default, the authentication information is taken from the file @file{~/.authinfo} or @file{~/.authinfo.gpg} or @file{~/.netrc}. -These files have a syntax similar to netrc files as known from the ftp -program, like +These files have a syntax similar to netrc files as known from the +@command{ftp} program, like this: @example machine @var{mymachine} login @var{myloginname} password @var{mypassword} port @var{myport} @end example - Similarly, the auth-source library supports multiple storage + Similarly, the @file{auth-source} library supports multiple storage backend, currently either the classic netrc backend, JSON files, the Secret Service API, and pass, the standard unix password manager. @vindex auth-sources - All these alternatives are customized via the user option -@code{auth-sources}, @ref{Help for users, Emacs auth-source,, auth, -Emacs auth-source}. + All these alternatives can be customized via the user option +@code{auth-sources}, see @ref{Help for users, Emacs auth-source,, +auth, Emacs auth-source}. @vindex auth-source-save-behavior When a password is entered interactively, which is not found via the configured backend, some of the backends offer to save it -persistently. This can be changed by the customizing user option +persistently. This can be changed by customizing the user option @code{auth-source-save-behavior}.