commit 5efd5515031ca65357732092f3f40e097ef52876 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Fri Sep 27 11:08:26 2019 +0300 Fix display of box around images * src/xdisp.c (face_before_or_after_it_pos): Handle correctly when we are called with it->bidi_it.first_elt set. (Bug#17114) diff --git a/src/xdisp.c b/src/xdisp.c index 6626fbcf63..95895ec3ac 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -4359,6 +4359,11 @@ face_before_or_after_it_pos (struct it *it, bool before_p) int n = (it->what == IT_COMPOSITION ? it->cmp_it.nchars : 1); it_copy = *it; + /* If this is the first display element, + bidi_move_to_visually_next will deliver character at + current position without moving, so we need to enlarge N. */ + if (it->bidi_it.first_elt) + n++; while (n--) bidi_move_to_visually_next (&it_copy.bidi_it); @@ -4461,6 +4466,11 @@ face_before_or_after_it_pos (struct it *it, bool before_p) int n = (it->what == IT_COMPOSITION ? it->cmp_it.nchars : 1); it_copy = *it; + /* If this is the first display element, + bidi_move_to_visually_next will deliver character at + current position without moving, so we need to enlarge N. */ + if (it->bidi_it.first_elt) + n++; while (n--) bidi_move_to_visually_next (&it_copy.bidi_it); commit 60d121e87d532682cb1be7c48015dcd5e30db20a Author: Basil L. Contovounesios Date: Fri Sep 27 01:26:03 2019 +0100 ; * etc/NEWS (Gnus): Fix outline levels. diff --git a/etc/NEWS b/etc/NEWS index 9735a5512e..97b96d1e4e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1044,10 +1044,10 @@ Of course it will still find it if you have it in '~/.ecompleterc'. ** Gnus +++ -** The Gnus user variable 'nnimap-expunge' supports three new values: +*** The Gnus user variable 'nnimap-expunge' supports three new values: 'never' for never expunging messages, 'immediately' for immediately expunging deleted messages, and 'on-exit' to expunge deleted articles -when exiting the group's summary buffer. Setting 'nnimap-expunge' to +when exiting the group's summary buffer. Setting 'nnimap-expunge' to 'nil' or 't' is still supported but not recommended, since it may result in Gnus expunging all messages that have been flagged as deleted by any IMAP client (rather than just those that have been @@ -1114,7 +1114,7 @@ This option controls whether and how to use Gnus search groups as 'path:' search terms to 'notmuch'. --- -+++ The buttons in the Gnus article buffer were formerly widgets +*** The buttons in the Gnus article buffer were formerly widgets (i.e., buttons from widget.el). This has now changed, and they are now buttons (from button.el), and commands like 'TAB' now search for buttons instead of widgets. There should be no user-visible changes, commit 2712187032d73d6a8b6f8d6a501467a7dc1d0778 Author: Lars Ingebrigtsen Date: Fri Sep 27 02:17:14 2019 +0200 Fix problem with changing to correct NNTP server * lisp/gnus/nntp.el (nntp-close-server): * lisp/gnus/nnimap.el (nnimap-close-server): * lisp/gnus/gnus-int.el (gnus-close-server): Take an optional DEFS parameter to enable switching to the correct nnoo server (bug#20319) when there's two servers with the same address. diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el index b27a8a18eb..0abbfe6720 100644 --- a/lisp/gnus/gnus-int.el +++ b/lisp/gnus/gnus-int.el @@ -352,7 +352,8 @@ If it is down, start it up (again)." (when (stringp gnus-command-method) (setq gnus-command-method (gnus-server-to-method gnus-command-method))) (funcall (gnus-get-function gnus-command-method 'close-server) - (nth 1 gnus-command-method))) + (nth 1 gnus-command-method) + (nthcdr 2 gnus-command-method))) (defun gnus-request-list (gnus-command-method) "Request the active file from GNUS-COMMAND-METHOD." diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el index 0f4f4303cd..46d5244607 100644 --- a/lisp/gnus/nnbabyl.el +++ b/lisp/gnus/nnbabyl.el @@ -130,7 +130,7 @@ nnbabyl-mbox-file) t))) -(deffoo nnbabyl-close-server (&optional server) +(deffoo nnbabyl-close-server (&optional server _defs) ;; Restore buffer mode. (when (and (nnbabyl-server-opened) nnbabyl-previous-buffer-mode) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 345667b927..2c91ba0bf5 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -627,8 +627,8 @@ textual parts.") (setq result (cdr (cadr elem)))))) result)) -(deffoo nnimap-close-server (&optional server) - (when (nnoo-change-server 'nnimap server nil) +(deffoo nnimap-close-server (&optional server defs) + (when (nnoo-change-server 'nnimap server defs) (ignore-errors (delete-process (get-buffer-process (nnimap-buffer)))) (nnoo-close-server 'nnimap server) diff --git a/lisp/gnus/nnmbox.el b/lisp/gnus/nnmbox.el index 110f39a867..3b704961f0 100644 --- a/lisp/gnus/nnmbox.el +++ b/lisp/gnus/nnmbox.el @@ -130,7 +130,7 @@ nnmbox-mbox-file) t))) -(deffoo nnmbox-close-server (&optional server) +(deffoo nnmbox-close-server (&optional server _defs) (when (buffer-live-p nnmbox-mbox-buffer) (kill-buffer nnmbox-mbox-buffer)) (nnoo-close-server 'nnmbox server) diff --git a/lisp/gnus/nnregistry.el b/lisp/gnus/nnregistry.el index 6dcdac5462..ab9a8a97f8 100644 --- a/lisp/gnus/nnregistry.el +++ b/lisp/gnus/nnregistry.el @@ -39,7 +39,7 @@ (deffoo nnregistry-server-opened (server) gnus-registry-enabled) -(deffoo nnregistry-close-server (server) +(deffoo nnregistry-close-server (server &optional defs) t) (deffoo nnregistry-status-message (server) diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el index 49aa6ab144..24084a3fe0 100644 --- a/lisp/gnus/nntp.el +++ b/lisp/gnus/nntp.el @@ -1062,7 +1062,8 @@ command whose response triggered the error." (or (nntp-find-connection nntp-server-buffer) (nntp-open-connection nntp-server-buffer))))) -(deffoo nntp-close-server (&optional server) +(deffoo nntp-close-server (&optional server defs) + (nnoo-change-server 'nntp server defs) (nntp-possibly-change-group nil server t) (let ((process (nntp-find-connection nntp-server-buffer))) (while process diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index b08b27dd1e..e25f373bdf 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -170,7 +170,7 @@ Valid types include `google', `dejanews', and `gmane'.") (nnheader-report 'nnweb "Fetched article %s" article) (cons group (and (numberp article) article)))))) -(deffoo nnweb-close-server (&optional server) +(deffoo nnweb-close-server (&optional server _defs) (when (and (nnweb-server-opened server) (gnus-buffer-live-p nnweb-buffer)) (with-current-buffer nnweb-buffer commit fd6f4bf648c5a4417eb591a8c54b87c7c60de154 Author: Nikolaus Rath Date: Fri Sep 27 01:39:13 2019 +0200 nnimap.el: support additional expunge options * lisp/gnus/nnimap.el (nnimap-close-group) (nnimap-request-expire-articles, nnimap-delete-article) (nnimap-request-scan): Add new 'never, 'immediate, and 'on-exit settings for nnimap-expunge (bug#20670). diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index d8a257b00b..15b108541c 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -14305,9 +14305,19 @@ specific login method to be used, you can set this variable to either @code{plain} or @code{cram-md5}. @item nnimap-expunge -If non-@code{nil}, expunge articles after deleting them. This is always done -if the server supports UID EXPUNGE, but it's not done by default on -servers that doesn't support that command. +When to expunge deleted messages. If @code{never}, deleted articles +are marked with the IMAP @code{\\Delete} flag but not automatically +expunged. If @code{immediately}, deleted articles are immediately expunged +(this requires the server to support the UID EXPUNGE command). If +@code{on-exit}, deleted articles are flagged, and all flagged articles are +expunged when the group is closed. + +For backwards compatibility, this variable may also be set to t +or nil. If the server supports UID EXPUNGE, both t and nil are +equivalent to @code{immediately}. If the server does not support UID +EXPUNGE nil is equivalent to @code{never}, while t will immediately +expunge ALL articles that are currently flagged as deleted +(i.e., potentially not only the article that was just deleted). @item nnimap-streaming Virtually all @acronym{IMAP} server support fast streaming of data. diff --git a/etc/NEWS b/etc/NEWS index afeb387773..9735a5512e 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1043,6 +1043,16 @@ Of course it will still find it if you have it in '~/.ecompleterc'. ** Gnus ++++ +** The Gnus user variable 'nnimap-expunge' supports three new values: +'never' for never expunging messages, 'immediately' for immediately +expunging deleted messages, and 'on-exit' to expunge deleted articles +when exiting the group's summary buffer. Setting 'nnimap-expunge' to +'nil' or 't' is still supported but not recommended, since it may +result in Gnus expunging all messages that have been flagged as +deleted by any IMAP client (rather than just those that have been +deleted by Gnus). + +++ *** New option 'gnus-use-atomic-windows' makes Gnus window layouts atomic. See the "Atomic Windows" section of the Elisp manual for diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 363e4186cb..345667b927 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -102,10 +102,21 @@ Uses the same syntax as `nnmail-split-methods'.") Possible choices are nil (use default methods), `anonymous', `login', `plain' and `cram-md5'.") -(defvoo nnimap-expunge t - "If non-nil, expunge articles after deleting them. -This is always done if the server supports UID EXPUNGE, but it's -not done by default on servers that doesn't support that command.") +(defvoo nnimap-expunge 'on-exit + "When to expunge deleted messages. +If 'never, deleted articles are marked with the IMAP \\Delete +flag but not automatically expunged. If 'immediately, deleted +articles are immediately expunged (this requires the server to +support the UID EXPUNGE command). If 'on-exit, deleted articles +are flagged, and all flagged articles are expunged when the +group is closed. + +For backwards compatibility, this variable may also be set to t +or nil. If the server supports UID EXPUNGE, both t and nil are +equivalent to 'immediately. If the server does not support UID +EXPUNGE nil is equivalent to 'never, while t will immediately +expunge ALL articles that are currently flagged as deleted +(i.e., potentially not only the article that was just deleted).") (defvoo nnimap-streaming t "If non-nil, try to use streaming commands with IMAP servers. @@ -944,8 +955,11 @@ textual parts.") articles))) (nreverse articles))) -(deffoo nnimap-close-group (_group &optional _server) - t) +(deffoo nnimap-close-group (_group &optional server) + (when (eq nnimap-expunge 'on-exit) + (nnoo-change-server 'nnimap server nil) + (with-current-buffer (nnimap-buffer) + (nnimap-command "EXPUNGE")))) (deffoo nnimap-request-move-article (article group server accept-form &optional _last @@ -990,8 +1004,7 @@ textual parts.") articles) ((and force (eq nnmail-expiry-target 'delete)) - (unless (nnimap-delete-article (gnus-compress-sequence articles)) - (nnheader-message 7 "Article marked for deletion, but not expunged.")) + (nnimap-delete-article (gnus-compress-sequence articles)) nil) (t (let ((deletable-articles @@ -1111,20 +1124,33 @@ If LIMIT, first try to limit the search to the N last articles." (nnimap-find-article-by-message-id group server message-id)))))))) (defun nnimap-delete-article (articles) + "Delete ARTICLES." (with-current-buffer (nnimap-buffer) (nnimap-command "UID STORE %s +FLAGS.SILENT (\\Deleted)" (nnimap-article-ranges articles)) (cond + ((eq nnimap-expunge 'immediately) + (if (nnimap-capability "UIDPLUS") + (nnimap-command "UID EXPUNGE %s" + (nnimap-article-ranges articles)) + (nnheader-message + 3 (concat "nnimap-expunge set to 'immediately, but " + "server doesn't support UIDPLUS")) + nil)) + + ((memq nnimap-expunge '(on-exit never)) nil) + ((nnimap-capability "UIDPLUS") (nnimap-command "UID EXPUNGE %s" - (nnimap-article-ranges articles)) - t) + (nnimap-article-ranges articles))) + (nnimap-expunge - (nnimap-command "EXPUNGE") - t) - (t (gnus-message 7 (concat "nnimap: nnimap-expunge is not set and the " - "server doesn't support UIDPLUS, so we won't " - "delete this article now")))))) + (nnimap-command "EXPUNGE")) + + (t + (nnheader-message + 7 "Article marked for deletion, but not expunged.") + nil)))) (deffoo nnimap-request-scan (&optional group server) (when (and (nnimap-change-group nil server) @@ -2149,27 +2175,9 @@ Return the server's response to the SELECT or EXAMINE command." (nnimap-wait-for-response (caar sequences)) ;; And then mark the successful copy actions as deleted, ;; and possibly expunge them. - (nnimap-mark-and-expunge-incoming - (nnimap-parse-copied-articles sequences))) - (nnimap-mark-and-expunge-incoming junk-articles))))))) - -(defun nnimap-mark-and-expunge-incoming (range) - (when range - (setq range (nnimap-article-ranges range)) - (erase-buffer) - (let ((sequence - (nnimap-send-command - "UID STORE %s +FLAGS.SILENT (\\Deleted)" range))) - (cond - ;; If the server supports it, we now delete the message we have - ;; just copied over. - ((nnimap-capability "UIDPLUS") - (setq sequence (nnimap-send-command "UID EXPUNGE %s" range))) - ;; If it doesn't support UID EXPUNGE, then we only expunge if the - ;; user has configured it. - (nnimap-expunge - (setq sequence (nnimap-send-command "EXPUNGE")))) - (nnimap-wait-for-response sequence)))) + (nnimap-delete-article + (nnimap-parse-copied-articles sequences))) + (nnimap-delete-article junk-articles))))))) (defun nnimap-parse-copied-articles (sequences) (let (sequence copied range) commit ff8a72fbe0f6e168e2871a53bbdaded4d0cc5612 Author: Lars Ingebrigtsen Date: Fri Sep 27 01:14:01 2019 +0200 Tweak updating of readedness marks on the IMAP server * lisp/gnus/nnimap.el (nnimap-request-set-mark): Ensure that ticking/unticking also toggles readedness on the IMAP server (bug#22590). diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 6f2ebfb7fe..363e4186cb 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1163,6 +1163,12 @@ If LIMIT, first try to limit the search to the N last articles." ;; response. If they're successful, they're successful. (dolist (action actions) (cl-destructuring-bind (range action marks) action + ;; If we add/remove a tick mark, then do the same with the + ;; readedness mark on the IMAP server. Other IMAP clients + ;; can have marked messages without having them read, but + ;; Gnus can't. + (when (memq 'tick marks) + (push 'read marks)) (let ((flags (nnimap-marks-to-flags marks))) (when flags (setq sequence (nnimap-send-command @@ -1492,8 +1498,9 @@ If LIMIT, first try to limit the search to the N last articles." (defun nnimap-update-info (info marks) (cl-destructuring-bind (existing flags high low uidnext start-article - permanent-flags uidvalidity - vanished highestmodseq) marks + permanent-flags uidvalidity + vanished highestmodseq) + marks (cond ;; Ignore groups with no UIDNEXT/marks. This happens for ;; completely empty groups. commit 7e6fc3842e54dadbc4b570ab138d831a7f988947 Author: Juanma Barranquero Date: Fri Sep 27 01:08:09 2019 +0200 * src/w32fns.c (Fw32_register_hot_key): Fix typo in docstring diff --git a/src/w32fns.c b/src/w32fns.c index bb28c01795..8bc5707bfa 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -8535,7 +8535,8 @@ On Windows 98 and ME, KEY must be a one element key definition in vector form that would be acceptable to `define-key' (e.g. [A-tab] for Alt-Tab). The meta modifier is interpreted as Alt if `w32-alt-is-meta' is t, and hyper is always interpreted as the Windows -modifier keys. The return value is the hotkey-id if registered, otherwise nil. +modifier keys. The return value is the hotkey-id if registered, +otherwise nil. On Windows versions since NT, KEY can also be specified as [M-], [s-] or [h-] to indicate that all combinations of that key should be processed @@ -8543,7 +8544,7 @@ by Emacs instead of the operating system. The super and hyper modifiers are interpreted according to the current values of `w32-lwindow-modifier' and `w32-rwindow-modifier'. For instance, setting `w32-lwindow-modifier' to `super' and then calling -`(register-hot-key [s-])' grabs all combinations of the left Windows +`(w32-register-hot-key [s-])' grabs all combinations of the left Windows key to Emacs, but leaves the right Windows key free for the operating system keyboard shortcuts. The return value is t if the call affected any key combinations, otherwise nil. */) commit 1a63e922e80edbcf09c00fd67b32dcb7e46e172f Author: Lars Ingebrigtsen Date: Fri Sep 27 00:43:43 2019 +0200 Fix nnir searching on nested Gnus topics * lisp/gnus/nnir.el (gnus-group-make-nnir-group): On a topic line, search all the groups, even in sub-topics (bug#28090). diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el index b695cfa4f6..3625302841 100644 --- a/lisp/gnus/nnir.el +++ b/lisp/gnus/nnir.el @@ -593,6 +593,8 @@ Add an entry here when adding a new search engine.") ;; Gnus glue. (declare-function gnus-group-topic-name "gnus-topic" ()) +(declare-function gnus-topic-find-groups "gnus-topic" + (topic &optional level all lowest recursive)) (defun gnus-group-make-nnir-group (nnir-extra-parms &optional specs) "Create an nnir group. Prompt for a search query and determine @@ -613,7 +615,9 @@ skips all prompting." (or gnus-group-marked (if (gnus-group-group-name) (list (gnus-group-group-name)) - (cdr (assoc (gnus-group-topic-name) gnus-topic-alist)))) + (mapcar (lambda (entry) + (gnus-info-group (cadr entry))) + (gnus-topic-find-groups (gnus-group-topic-name))))) gnus-group-server)))) (query-spec (or (cdr (assq 'nnir-query-spec specs)) commit 8e36ddfd44488e5194d26b34ad7405f92f838767 Author: Lars Ingebrigtsen Date: Fri Sep 27 00:33:40 2019 +0200 Don't hard-code the RSS structure so much in nnrss * lisp/gnus/nnrss.el (nnrss-get-namespace-prefix): Find the URL in any section in the RSS (bug#34685). diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el index 955432764e..1eca46220f 100644 --- a/lisp/gnus/nnrss.el +++ b/lisp/gnus/nnrss.el @@ -39,6 +39,7 @@ (require 'iso8601) (require 'mml) (require 'xml) +(require 'dom) (defgroup nnrss nil "RSS access for Gnus." @@ -1008,7 +1009,11 @@ Simply ensures that the first element is rss or rdf." "Given EL (containing a parsed element) and URI (containing a string that gives the URI for which you want to retrieve the namespace prefix), return the prefix." - (let* ((prefix (car (rassoc uri (cadar el)))) + (let* ((prefix (car (rassoc uri (dom-attributes + (dom-search + el + (lambda (node) + (rassoc uri (dom-attributes node)))))))) (nslist (if prefix (split-string (symbol-name prefix) ":"))) (ns (cond ((eq (length nslist) 1) ; no prefix given commit 45727c4e6de7f6f6f61a4ae3589d5dd271ea8803 Author: Lars Ingebrigtsen Date: Fri Sep 27 00:32:37 2019 +0200 Add a new `dom-search' function * doc/lispref/text.texi (Document Object Model): Document it. * lisp/dom.el (dom-search): New function. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index d7b04d2934..8d78a9b24f 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -5162,6 +5162,11 @@ which is a regular expression. Return all nodes in @var{dom} that have IDs that match @var{match}, which is a regular expression. +@item dom-search @var{dom} @var{predicate} +Return all nodes in @var{dom} where @var{predicate} returns a +non-@code{nil} value. @var{predicate} is called with the node to be +tested as its parameter. + @item dom-strings @var{dom} Return all strings in @var{dom}. diff --git a/etc/NEWS b/etc/NEWS index 0a4ada3cc6..afeb387773 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -275,6 +275,12 @@ obsolete, and the new utility function 'xml-remove-comments' can be used to remove comments before calling the libxml functions to parse the data. ++++ +** A new DOM (the XML/HTML document structure returned by functions +such as 'libxml-parse-html-region') traversal function has been added: +'dom-search', which takes a DOM and a predicate and returns all nodes +that match. + +++ ** The Network Security Manager now allows more fine-grained control of what checks to run via the 'network-security-protocol-checks' diff --git a/lisp/dom.el b/lisp/dom.el index d8c4433998..f01da5221b 100644 --- a/lisp/dom.el +++ b/lisp/dom.el @@ -108,6 +108,18 @@ A name is a symbol like `td'." (cons dom matches) matches))) +(defun dom-search (dom predicate) + "Return elements in DOM where PREDICATE is non-nil. +PREDICATE is called with the node as its only parameter." + (let ((matches (cl-loop for child in (dom-children dom) + for matches = (and (not (stringp child)) + (dom-search child predicate)) + when matches + append matches))) + (if (funcall predicate dom) + (cons dom matches) + matches))) + (defun dom-strings (dom) "Return elements in DOM that are strings." (cl-loop for child in (dom-children dom) commit ed9402f81907f5810d70fc421b456791d624ba1a Author: Katsumi Yamaoka Date: Thu Sep 26 21:43:48 2019 +0000 Make forward-button support help-echo function (bug#37515) * lisp/button.el (forward-button): Support help-echo function. diff --git a/lisp/button.el b/lisp/button.el index ca6f0d3b6e..9112e518b0 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -513,6 +513,9 @@ Returns the button found." nil (user-error (if wrap "No buttons!" "No more buttons"))) (let ((msg (and display-message (button-get button 'help-echo)))) + (when (functionp msg) + (setq msg (funcall msg (selected-window) (current-buffer) + (button-start button)))) (when msg (message "%s" msg))) button))) commit 648a6b7e912c97f9f4190cfd401274a2a33f31da Author: Juri Linkov Date: Thu Sep 26 21:26:27 2019 +0200 Include ImageMagick file name regexps in image-file-name-regexp * lisp/image-file.el (image-file-name-regexp): If compiled with ImageMagick, include file name extensions it can handle (bug#9516). diff --git a/lisp/image-file.el b/lisp/image-file.el index c1d44a7d6d..6f4ee7a953 100644 --- a/lisp/image-file.el +++ b/lisp/image-file.el @@ -85,13 +85,12 @@ the variable is set using \\[customize]." image-file-name-extensions) t) "\\'")))) - (if image-file-name-regexps - (mapconcat 'identity - (if exts-regexp - (cons exts-regexp image-file-name-regexps) - image-file-name-regexps) - "\\|") - exts-regexp))) + (mapconcat + 'identity + (delq nil (list exts-regexp + image-file-name-regexps + (car (rassq 'imagemagick image-type-file-name-regexps)))) + "\\|"))) ;;;###autoload commit ce89cb760f35a7769769966fc3505604ba2b2f4d Author: Michael Albinus Date: Thu Sep 26 20:55:49 2019 +0200 ; Add traces to shadowfile-tests.el diff --git a/test/lisp/shadowfile-tests.el b/test/lisp/shadowfile-tests.el index cee51b20d8..c60767c27c 100644 --- a/test/lisp/shadowfile-tests.el +++ b/test/lisp/shadowfile-tests.el @@ -63,6 +63,9 @@ (format "/mock::%s" temporary-file-directory))) "Temporary directory for Tramp tests.") +(message + "%s %s" temporary-file-directory shadow-test-remote-temporary-file-directory) + (setq password-cache-expiry nil shadow-debug (getenv "EMACS_HYDRA_CI") tramp-verbose 0 @@ -73,6 +76,11 @@ (ignore-errors (file-truename shadow-test-remote-temporary-file-directory))) +(when shadow-debug + (message + "%s %s" + temporary-file-directory shadow-test-remote-temporary-file-directory)) + ;; This should happen on hydra only. (when (getenv "EMACS_HYDRA_CI") (add-to-list 'tramp-remote-path 'tramp-own-remote-path)) commit c4e0ccd151a29f87bd674a5987f731a0da491692 Author: Lars Ingebrigtsen Date: Thu Sep 26 19:51:23 2019 +0200 mm-possibly-verify-or-decrypt should only issue errors when decrypting * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Only do the warning about failed decryption when we're handing encrypted parts, not when doing verification. diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 42bf5f8081..d9c14120c2 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1745,6 +1745,7 @@ If RECURSIVE, search recursively." (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) (if (or (not info) (equal info "") + (equal subtype "encrypted") (member "OK" (split-string info "\n"))) parts ;; We had an error during decryption. Report what it is. commit 9d002e5049e3c28450d80bc0c98b820e4abfcfb7 Author: Stefan Kangas Date: Sun Aug 4 19:34:01 2019 +0200 Add key bindings for ibuffer filter commands * lisp/ibuffer.el (ibuffer--filter-map): Add keybinding for 'ibuffer-filter-chosen-by-completion' and 'ibuffer-filter-by-directory'. (Bug#6847) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 23f7a2a8e4..3af06eba97 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -424,12 +424,14 @@ directory, like `default-directory'." (defvar ibuffer--filter-map (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") 'ibuffer-filter-by-mode) + (define-key map (kbd "SPC") 'ibuffer-filter-chosen-by-completion) (define-key map (kbd "m") 'ibuffer-filter-by-used-mode) (define-key map (kbd "M") 'ibuffer-filter-by-derived-mode) (define-key map (kbd "n") 'ibuffer-filter-by-name) (define-key map (kbd "E") 'ibuffer-filter-by-process) (define-key map (kbd "*") 'ibuffer-filter-by-starred-name) (define-key map (kbd "f") 'ibuffer-filter-by-filename) + (define-key map (kbd "F") 'ibuffer-filter-by-directory) (define-key map (kbd "b") 'ibuffer-filter-by-basename) (define-key map (kbd ".") 'ibuffer-filter-by-file-extension) (define-key map (kbd "<") 'ibuffer-filter-by-size-lt) commit 3cf8f9b1ec1a079f6cd1a127259414dcb0cf8672 Author: Stefan Kangas Date: Sat Sep 14 01:49:23 2019 +0200 Remove support for destructive splicing in elisp * src/lread.c (read1): Don't handle destructive splicing in backquote expressions (e.g. ",."). (Bug#19790) (syms_of_lread): Remove Qcomma_dot. * src/print.c (print_object): Don't check for Qcomma_dot. * test/src/eval-tests.el (eval-tests-19790-backquote-comma-dot-substitution): New test. * etc/NEWS: Announce it. diff --git a/etc/NEWS b/etc/NEWS index 09394432aa..0a4ada3cc6 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2005,6 +2005,19 @@ immediately. Type 'M-x so-long-commentary' for full documentation. * Incompatible Lisp Changes in Emacs 27.1 +--- +** Incomplete destructive splicing support has been removed. +Support for Common Lisp style destructive splicing (",.") was +incomplete and broken for a long time. It has now been removed. + +This means that backquote substitution now works for identifiers +starting with a period ("."). Consider the following example: + + (let ((.foo 42)) `,.foo) + +In the past, this would have incorrectly evaluated to '(\,\. foo)', +but will now instead evaluate to '42'. + --- ** The REGEXP in 'magic-mode-alist' is now matched case-sensitively. Likewise for 'magic-fallback-mode-alist'. diff --git a/src/lread.c b/src/lread.c index 151731a81d..5000b38a01 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3310,8 +3310,6 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) if (ch == '@') comma_type = Qcomma_at; - else if (ch == '.') - comma_type = Qcomma_dot; else { if (ch >= 0) UNREAD (ch); @@ -5080,7 +5078,6 @@ this variable will become obsolete. */); DEFSYM (Qbackquote, "`"); DEFSYM (Qcomma, ","); DEFSYM (Qcomma_at, ",@"); - DEFSYM (Qcomma_dot, ",."); DEFSYM (Qinhibit_file_name_operation, "inhibit-file-name-operation"); DEFSYM (Qascii_character, "ascii-character"); diff --git a/src/print.c b/src/print.c index 7e5aed8287..77ddd93efb 100644 --- a/src/print.c +++ b/src/print.c @@ -2076,8 +2076,7 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) else if (print_quoted && CONSP (XCDR (obj)) && NILP (XCDR (XCDR (obj))) && new_backquote_output && (EQ (XCAR (obj), Qcomma) - || EQ (XCAR (obj), Qcomma_at) - || EQ (XCAR (obj), Qcomma_dot))) + || EQ (XCAR (obj), Qcomma_at))) { print_object (XCAR (obj), printcharfun, false); new_backquote_output--; diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index 48295b81fa..7a8eae82cf 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -169,4 +169,11 @@ are found on the stack and therefore not garbage collected." "Remove the Lisp reference to the byte-compiled object." (setf (symbol-function #'eval-tests-33014-func) nil)) +(defun eval-tests-19790-backquote-comma-dot-substitution () + "Regression test for Bug#19790. +Don't handle destructive splicing in backquote expressions (like +in Common Lisp). Instead, make sure substitution in backquote +expressions works for identifiers starting with period." + (should (equal (let ((.x 'identity)) (eval `(,.x 'ok))) 'ok))) + ;;; eval-tests.el ends here commit b94f01a6165908d9f8b0d48653fdc8d75be4dd08 Author: Lars Ingebrigtsen Date: Thu Sep 26 18:27:03 2019 +0200 Fix error in display-startup-screen * lisp/startup.el (use-fancy-splash-screens-p): Fix error in display-startup-screen if create-image fails (bug#22072). diff --git a/lisp/startup.el b/lisp/startup.el index 4078f23f3a..6e2094d678 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1974,16 +1974,16 @@ we put it on this frame." (image-type-available-p 'pbm))) (let ((frame (fancy-splash-frame))) (when frame - (let* ((img (create-image (fancy-splash-image-file))) - (image-height (and img (cdr (image-size img nil frame)))) - ;; We test frame-height and not window-height so that, - ;; if the frame is split by displaying a warning, that - ;; doesn't cause the normal splash screen to be used. - ;; We subtract 2 from frame-height to account for the - ;; echo area and the mode line. - (frame-height (- (frame-height frame) 2))) - (> frame-height (+ image-height 19))))))) - + (let ((img (create-image (fancy-splash-image-file)))) + (when img + (let ((image-height (cdr (image-size img nil frame))) + ;; We test frame-height and not window-height so that, + ;; if the frame is split by displaying a warning, that + ;; doesn't cause the normal splash screen to be used. + ;; We subtract 2 from frame-height to account for the + ;; echo area and the mode line. + (frame-height (- (frame-height frame) 2))) + (> frame-height (+ image-height 19))))))))) (defun normal-splash-screen (&optional startup concise) "Display non-graphic splash screen. commit 814cab3b4d89066dbd9a7aaad7d98c382a5a3485 Author: Stefan Kangas Date: Mon Sep 16 03:48:47 2019 +0200 Add new function to clear tags in tabulated list * lisp/emacs-lisp/tabulated-list.el (tabulated-list-clear-all-tags): New function to clear all tags from padding area in current buffer. * doc/lispref/modes.texi (Tabulated List Mode): Document it. * etc/NEWS: Announce it. diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 7185c243e2..2e0c9e4655 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1201,6 +1201,11 @@ width of which is governed by @code{tabulated-list-padding}. function advances point by one line. @end defun +@defun tabulated-list-clear-all-tags +This function clears all tags from the padding area in the current +buffer. +@end defun + @defun tabulated-list-set-col col desc &optional change-entry-data This function changes the tabulated list entry at point, setting @var{col} to @var{desc}. @var{col} is the column number to change, or diff --git a/etc/NEWS b/etc/NEWS index 4b693aaaa1..09394432aa 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1766,6 +1766,11 @@ near the current column in Tabulated Lists (see variables list mode: 'w' (which widens the current column) and 'c' which makes the current column contract. ++++ +*** New function 'tabulated-list-clear-all-tags'. +This function clears all tags from the padding area in the current +buffer. Tags are typically added by calling 'tabulated-list-put-tag'. + ** Text mode +++ diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index f30e2c0ec8..ade6028588 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -192,6 +192,19 @@ If ADVANCE is non-nil, move forward by one line afterwards." (if advance (forward-line))) +(defun tabulated-list-clear-all-tags () + "Clear all tags from the padding area in the current buffer." + (unless (> tabulated-list-padding 0) + (error "There can be no tags in current buffer")) + (save-excursion + (goto-char (point-min)) + (let ((inhibit-read-only t) + ;; Match non-space in the first n characters. + (re (format "^ \\{0,%d\\}[^ ]" (1- tabulated-list-padding))) + (empty (make-string tabulated-list-padding ? ))) + (while (re-search-forward re nil 'noerror) + (tabulated-list-put-tag empty))))) + (defvar tabulated-list-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map (make-composed-keymap commit 45524b9702b4a6face2cf453eb02ddf10a496b45 Author: Mauro Aranda Date: Thu Sep 26 17:16:28 2019 +0200 Don't indent unrelated widgets following widget of type 'other * lisp/wid-edit.el (widget 'other): Use \n instead of the %n escape in the :format property of this widget. If %n is used at the end of the format string, unrelated widgets get indented. (Bug#12533) * test/wid-edit-tests.el (widget-test-indentation-after-%n) (widget-test-indentation-after-newline) (widget-test-newline-and-indent-same-widget): New tests. diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 52b7532567..916d41af25 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -3063,7 +3063,7 @@ as in (other DEFAULT) or (other :tag \"NAME\" DEFAULT). If the user selects this alternative, that specifies DEFAULT as the value." :tag "Other" - :format "%t%n" + :format "%t\n" :value 'other) (defvar widget-string-prompt-value-history nil diff --git a/test/lisp/wid-edit-tests.el b/test/lisp/wid-edit-tests.el index a4350e715e..679a29af8f 100644 --- a/test/lisp/wid-edit-tests.el +++ b/test/lisp/wid-edit-tests.el @@ -36,4 +36,81 @@ (insert-button "overlay button") (should-not (widget-at (1- (point)))))) +;; The following three tests compare the effect of using either %n or \n at the +;; end of a format string, as well as using %n at the end or in the middle of +;; the format string. (Bug#12533) + +(ert-deftest widget-test-indentation-after-%n () + "Fail when %n is used at the end of a format string." + :expected-result :failed + (with-temp-buffer + (let (wid indented) + (widget-insert "Testing indentation.\n") + ;; If we use %n at the end of the format string of the widget `other', we + ;; screw up indentation of the following widgets. + (setq wid (widget-create + '(repeat :indent 4 + (cons + string (choice (other :tag "Other" :format "%t%n" c)))))) + (goto-char (widget-get wid :value-pos)) + ;; Since we indent the `repeat' widget, we skip the space characters + ;; inserted. + (skip-chars-forward " ") + (setq indented (current-column)) ; Save the column to which we indented. + (should (eq indented (or (widget-get wid :indent) 0))) + ;; Insert an entry. This simulates a click or RET at the INS button. + (widget-apply (widget-at) :action) + (goto-char (widget-get wid :value-pos)) + (skip-chars-forward " ") + ;; This fails, because the button is not at the right column. + (should (eq (current-column) indented))))) + +(ert-deftest widget-test-indentation-after-newline () + "Pass when the newline is used at the end of a format string." + (with-temp-buffer + (let (wid indented) + (widget-insert "Testing indentation.\n") + (setq wid (widget-create + '(repeat :indent 4 + (cons + string + (choice (other :tag "Other" :format "%t\n" c)))))) + (goto-char (widget-get wid :value-pos)) + (skip-chars-forward " ") + (setq indented (current-column)) + (should (eq (current-column) (or (widget-get wid :indent) 0))) + (widget-apply (widget-at) :action) + (goto-char (widget-get wid :value-pos)) + (skip-chars-forward " ") + ;; Because we used \n in the format string, this pass. + (should (eq (current-column) indented))))) + +(ert-deftest widget-test-newline-and-indent-same-widget () + "It's OK to use the %n escape sequence in the middle of the format string." + (with-temp-buffer + (let (wid indented) + (widget-insert "Testing indentation.\n") + (setq wid (widget-create + '(repeat :indent 4 + :format "%{%t%}:%n%v%i\n" + (cons + string + (choice (other :tag "Other" :format "%t\n" c)))))) + (goto-char (widget-get wid :value-pos)) + (skip-chars-forward " ") + (setq indented (current-column)) + (should (eq indented (or (widget-get wid :indent) 0))) + (widget-apply (widget-at) :action) + (goto-char (widget-get wid :value-pos)) + (skip-chars-forward " ") + (should (eq (current-column) indented)) + + ;; Also, the children are indented correctly. + (let ((grandchild + ;; This gets the `string' widget. + (car (widget-get (car (widget-get wid :children)) :children)))) + (goto-char (widget-get grandchild :from)) + (should (eq (current-column) + (widget-get grandchild :indent))))))) + ;;; wid-edit-tests.el ends here commit 08fbe91dfebf023bb45f1485fb432e9118ef5abb Author: Lars Ingebrigtsen Date: Thu Sep 26 16:32:13 2019 +0200 Make mm-view-pkcs7-verify use epg if requested * lisp/gnus/mm-view.el (mm-view-pkcs7-verify): Respect mml-smime-use (bug#18393). diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index b66d152fa6..559ec7a669 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -583,15 +583,23 @@ If MODE is not set, try to find mode automatically." (defun mm-view-pkcs7-verify (handle) (let ((verified nil)) - (with-temp-buffer - (insert "MIME-Version: 1.0\n") - (mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m") - (insert-buffer-substring (mm-handle-buffer handle)) - (setq verified (smime-verify-region (point-min) (point-max)))) - (if verified - (insert verified) - (insert-buffer-substring smime-details-buffer))) - t) + (if (eq mml-smime-use 'epg) + ;; Use EPG/gpgsm + (insert + (with-temp-buffer + (insert-buffer-substring (mm-handle-buffer handle)) + (goto-char (point-min)) + (let ((part (base64-decode-string (buffer-string)))) + (epg-verify-string (epg-make-context 'CMS) part)))) + (with-temp-buffer + (insert "MIME-Version: 1.0\n") + (mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m") + (insert-buffer-substring (mm-handle-buffer handle)) + (setq verified (smime-verify-region (point-min) (point-max)))) + (if verified + (insert verified) + (insert-buffer-substring smime-details-buffer))) + t)) (autoload 'epg-decrypt-string "epg") commit 84ef1ea8b524f8998fc8674b99cf8069e38dce4f Author: Lars Ingebrigtsen Date: Thu Sep 26 16:24:29 2019 +0200 Make it possible to view S/MIME verified emails * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): When dissecting the result, we need a header (bug#18393). * lisp/gnus/mm-view.el (mm-view-pkcs7-verify): Insert the verified string. * lisp/gnus/smime.el (smime-verify-region): Return the verified string. diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 673098bcb6..42bf5f8081 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1672,6 +1672,8 @@ If RECURSIVE, search recursively." (t (y-or-n-p (format "Decrypt (S/MIME) part? ")))) (mm-view-pkcs7 parts from)) + (goto-char (point-min)) + (insert "Content-type: text/plain\n\n") (setq parts (mm-dissect-buffer t))))) ((equal subtype "signed") (unless (and (setq protocol @@ -1739,6 +1741,7 @@ If RECURSIVE, search recursively." (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details (format "Unknown encrypt protocol (%s)" protocol))))))) + ;; Check the results (which are now in `parts'). (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) (if (or (not info) (equal info "") diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index 02d99200a3..b66d152fa6 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -588,18 +588,9 @@ If MODE is not set, try to find mode automatically." (mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m") (insert-buffer-substring (mm-handle-buffer handle)) (setq verified (smime-verify-region (point-min) (point-max)))) - (goto-char (point-min)) - (mm-insert-part handle) - (if (search-forward "Content-Type: " nil t) - (delete-region (point-min) (match-beginning 0))) - (goto-char (point-max)) - (if (re-search-backward "--\r?\n?" nil t) - (delete-region (match-end 0) (point-max))) - (unless verified + (if verified + (insert verified) (insert-buffer-substring smime-details-buffer))) - (goto-char (point-min)) - (while (search-forward "\r\n" nil t) - (replace-match "\n")) t) (autoload 'epg-decrypt-string "epg") diff --git a/lisp/gnus/smime.el b/lisp/gnus/smime.el index b7ec033603..d8131c60db 100644 --- a/lisp/gnus/smime.el +++ b/lisp/gnus/smime.el @@ -371,16 +371,21 @@ Any details (stdout and stderr) are left in the buffer specified by (expand-file-name smime-CA-file))) (if smime-CA-directory (list "-CApath" - (expand-file-name smime-CA-directory)))))) + (expand-file-name smime-CA-directory))))) + (input-buffer (current-buffer))) (unless CAs (error "No CA configured")) (if smime-crl-check (cl-pushnew smime-crl-check CAs :test #'equal)) - (if (apply 'smime-call-openssl-region b e (list smime-details-buffer t) - "smime" "-verify" "-out" "/dev/null" CAs) - t - (insert-buffer-substring smime-details-buffer) - nil))) + (with-temp-buffer + (let ((result-buffer (current-buffer))) + (with-current-buffer input-buffer + (if (apply 'smime-call-openssl-region b e (list result-buffer + smime-details-buffer) + "smime" "-verify" "-out" "-" CAs) + (with-current-buffer result-buffer + (buffer-string)) + nil)))))) (defun smime-noverify-region (b e) "Verify integrity of S/MIME message in region between B and E. commit 8e46cf4ba8c1992f52059cf530f5919f9fc33305 Author: Lars Ingebrigtsen Date: Thu Sep 26 15:47:06 2019 +0200 Fix recent gnus-rescale-image change * lisp/gnus/gnus-util.el (gnus-rescale-image): Don't bug out on non-graphical Emacs versions. diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el index dc779d0487..3cf364fff8 100644 --- a/lisp/gnus/gnus-util.el +++ b/lisp/gnus/gnus-util.el @@ -1610,15 +1610,17 @@ empty directories from OLD-PATH." "Rescale IMAGE to SIZE if possible. SIZE is in format (WIDTH . HEIGHT). Return a new image. Sizes are in pixels." - (let ((new-width (car size)) - (new-height (cdr size))) - (when (> (cdr (image-size image t)) new-height) - (setq image (create-image (plist-get (cdr image) :data) nil t - :max-height new-height))) - (when (> (car (image-size image t)) new-width) - (setq image (create-image (plist-get (cdr image) :data) nil t - :max-width new-width))) - image)) + (if (not (display-graphic-p)) + image + (let ((new-width (car size)) + (new-height (cdr size))) + (when (> (cdr (image-size image t)) new-height) + (setq image (create-image (plist-get (cdr image) :data) nil t + :max-height new-height))) + (when (> (car (image-size image t)) new-width) + (setq image (create-image (plist-get (cdr image) :data) nil t + :max-width new-width))) + image))) (defun gnus-recursive-directory-files (dir) "Return all regular files below DIR. commit 74abba27fd8cba91a10ada8b7949a3df3dfce546 Author: Mattias EngdegÄrd Date: Thu Sep 26 14:40:48 2019 +0200 ; Fix typo and improve phrasing of last commit diff --git a/etc/NEWS b/etc/NEWS index 271cc6e044..4b693aaaa1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2142,10 +2142,9 @@ For example, '(rx (any "@z-a" (?9 . ?0)))' would match '@' only. Now, such 'rx' expressions generate an error. --- -** Internal 'rx' functions and variables have been removed. -As a consequence of an improved implementation of the 'rx' package, -internal functions and variables have been removed. Packages using -theses should use the public 'rx' and 'rx-to-string' instead. +** Internal 'rx' functions and variables have been removed, +as a consequence of an improved implementation. Packages using +these should use the public 'rx' and 'rx-to-string' instead. 'rx-constituents' is still available for compatibility, but the new extension mechanism is preferred: 'rx-define', 'rx-let' and 'rx-let-eval'. commit e98e8549b0261ae8bd305a2473c73eab7328409b Author: Mattias EngdegÄrd Date: Thu Sep 26 13:15:03 2019 +0200 * etc/NEWS: Note removal of internal rx symbols (bug#37517) diff --git a/etc/NEWS b/etc/NEWS index 79e9655350..271cc6e044 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2141,6 +2141,15 @@ ending character were silently omitted. For example, '(rx (any "@z-a" (?9 . ?0)))' would match '@' only. Now, such 'rx' expressions generate an error. +--- +** Internal 'rx' functions and variables have been removed. +As a consequence of an improved implementation of the 'rx' package, +internal functions and variables have been removed. Packages using +theses should use the public 'rx' and 'rx-to-string' instead. +'rx-constituents' is still available for compatibility, but the new +extension mechanism is preferred: 'rx-define', 'rx-let' and +'rx-let-eval'. + +++ ** 'text-mode' no longer sets the value of 'indent-line-function'. The global value of 'indent-line-function', which defaults to commit 13a15a3a5a123e0e3377f41974ce12af69c8d5e0 Author: Juanma Barranquero Date: Thu Sep 26 12:15:36 2019 +0200 * lisp/desktop.el (desktop-read): With argument, ask the user for DIRNAME. * etc/NEWS: Document it. diff --git a/etc/NEWS b/etc/NEWS index 9a0b6333e4..79e9655350 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -542,6 +542,11 @@ network connection information (in addition to the host name). ** The 'cl' package is now officially deprecated in favor of 'cl-lib'. +--- +** desktop +*** When called interactively with a prefix arg 'C-u', 'desktop-read' +now prompts the user for the directory containing the desktop file. + +++ ** winner *** A new variable, 'winner-boring-buffers-regexp', has been added. diff --git a/lisp/desktop.el b/lisp/desktop.el index 59610a128a..498f769bd3 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1191,17 +1191,18 @@ being set (usually, by reading it from the desktop)." (defvar desktop-buffer-ok-count) (defvar desktop-buffer-fail-count) -;; FIXME Interactively, this should have the option to prompt for dirname. ;;;###autoload -(defun desktop-read (&optional dirname) +(defun desktop-read (&optional dirname ask) "Read and process the desktop file in directory DIRNAME. Look for a desktop file in DIRNAME, or if DIRNAME is omitted, look in directories listed in `desktop-path'. If a desktop file is found, it is processed and `desktop-after-read-hook' is run. If no desktop file is found, clear the desktop and run `desktop-no-desktop-file-hook'. +Interactively, with prefix arg \\[universal-argument], ask for DIRNAME. This function is a no-op when Emacs is running in batch mode. -It returns t if a desktop file was loaded, nil otherwise." - (interactive) +It returns t if a desktop file was loaded, nil otherwise. +\n(fn DIRNAME)" + (interactive "i\nP") (unless noninteractive (setq desktop-dirname (file-name-as-directory @@ -1209,6 +1210,8 @@ It returns t if a desktop file was loaded, nil otherwise." (or ;; If DIRNAME is specified, use it. (and (< 0 (length dirname)) dirname) + ;; Else, with a prefix arg, ask for a directory name. + (and ask (read-directory-name "Directory for desktop file: " nil nil t)) ;; Otherwise search desktop file in desktop-path. (let ((dirs desktop-path)) (while (and dirs