commit f660f360908a81a01336af3e0e57f2c921726430 (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Tue Apr 28 00:09:19 2015 -0700 * lisp/mail/rmail.el (rmail-copy-headers): Handle rmail-nonignored-headers being nil. (Bug#18878) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 43abc12..a76c31d 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -2942,7 +2942,8 @@ buffer to the end of the headers." (1+ (match-beginning 0)) (point-max)))) (if (and (looking-at ignored-headers) - (not (looking-at rmail-nonignored-headers))) + (not (and rmail-nonignored-headers + (looking-at rmail-nonignored-headers)))) (goto-char lim) (append-to-buffer rmail-view-buffer (point) lim) (goto-char lim)))) commit e82fd952f1548e3873ee78a748078ebc2eeb5119 Author: Glenn Morris Date: Mon Apr 27 23:46:09 2015 -0700 ; Comments. diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el index 15d27a0..0b49782 100644 --- a/lisp/mail/rmailedit.el +++ b/lisp/mail/rmailedit.el @@ -44,6 +44,8 @@ (declare-function rmail-summary-disable "rmailsum" ()) +;; We can't straightforwardly make this derive from text-mode, because +;; we need to bind (rmail-buffer-swapped) around the text-mode call. :( (defun rmail-edit-mode () "Major mode for editing the contents of an Rmail message. The editing commands are the same as in Text mode, together with diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 7effa6a..1466556 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -149,7 +149,8 @@ Turning on Paragraph-Indent minor mode runs the normal hook (defalias 'indented-text-mode 'text-mode) ;; This can be made a no-op once all modes that use text-mode-hook -;; are "derived" from text-mode. +;; are "derived" from text-mode. (As of 2015/04, and probably well before, +;; the only one I can find that doesn't so derive is rmail-edit-mode.) (defun text-mode-hook-identify () "Mark that this mode has run `text-mode-hook'. This is how `toggle-text-mode-auto-fill' knows which buffers to operate on." commit 9eca163f170ad2633bd8656d8a649f4144b56a1b Author: Glenn Morris Date: Mon Apr 27 22:59:10 2015 -0700 * lisp/subr.el (delay-mode-hooks): Fix doc typo. diff --git a/lisp/subr.el b/lisp/subr.el index 0343edb..0fec29c 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1733,7 +1733,7 @@ this instead of `run-hooks' when running their FOO-mode-hook." (defmacro delay-mode-hooks (&rest body) "Execute BODY, but delay any `run-mode-hooks'. These hooks will be executed by the first following call to -`run-mode-hooks' that occurs outside any `delayed-mode-hooks' form. +`run-mode-hooks' that occurs outside any `delay-mode-hooks' form. Only affects hooks run in the current buffer." (declare (debug t) (indent 0)) `(progn commit 704ce9aeb61a85d9a5e29e2fad9067c51fca095f Author: Glenn Morris Date: Mon Apr 27 22:15:12 2015 -0700 * lisp/vc/vc-bzr.el (vc-bzr-after-dir-status): Don't get confused by a bzrlib version mismatch warning. diff --git a/lisp/vc/vc-bzr.el b/lisp/vc/vc-bzr.el index 811f9e8..9c52106 100644 --- a/lisp/vc/vc-bzr.el +++ b/lisp/vc/vc-bzr.el @@ -954,6 +954,12 @@ stream. Standard error output is discarded." (translated nil) (result nil)) (goto-char (point-min)) + ;; Skip a warning message that can occur in some bzr installations. + ;; vc-bzr-dir-extra-headers already reports it. + ;; Perhaps we should just discard stderr? + (and (looking-at "bzr: WARNING: bzrlib version doesn't match") + (re-search-forward "^bzr is version" nil t) + (forward-line 1)) (while (not (eobp)) ;; Bzr 2.3.0 added this if there are shelves. (Bug#8170) (unless (looking-at "[0-9]+ shel\\(f\\|ves\\) exists?\\.") commit 7d947e84f335e351aa5b959934e584aeecda4008 Author: Thomas Fitzsimmons Date: Mon Apr 27 22:26:56 2015 -0400 Change default location of EUDC options file * NEWS: Document change to EUDC options file's default location. * lisp/net/eudc-vars.el (eudc-options-file): Use `locate-user-emacs-file' to change default options file location. diff --git a/etc/NEWS b/etc/NEWS index 1a1492b..5046d30 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -633,6 +633,9 @@ to avoid interfering with the kill ring. *** Custom variable `eudc-inline-expansion-format' defaults to "Firstname Surname ". +*** Custom variable `eudc-options-file' defaults to +"~/.emacs.d/eudc-options". + *** New custom variable `ldap-ldapsearch-password-prompt-regexp' to allow overriding the regular expression that recognizes the ldapsearch command line's password prompt. diff --git a/lisp/net/eudc-vars.el b/lisp/net/eudc-vars.el index 36a583d..5e994a3 100644 --- a/lisp/net/eudc-vars.el +++ b/lisp/net/eudc-vars.el @@ -312,9 +312,11 @@ arguments that should be passed to the program." :inline t (string :tag "Argument"))))) -(defcustom eudc-options-file "~/.eudc-options" +(defcustom eudc-options-file + (locate-user-emacs-file "eudc-options" ".eudc-options") "A file where the `servers' hotlist is stored." - :type '(file :Tag "File Name:")) + :type '(file :Tag "File Name:") + :version "25.1") (defcustom eudc-mode-hook nil "Normal hook run on entry to EUDC mode." commit b09deaa5a9d54658f6432b0a5aa45c834e162c43 Author: Glenn Morris Date: Mon Apr 27 21:33:01 2015 -0400 * test/automated/package-test.el (package-test-update-archives-async): Try to handle the test server script dying. diff --git a/test/automated/package-test.el b/test/automated/package-test.el index 4385ee0..1f8f8ac 100644 --- a/test/automated/package-test.el +++ b/test/automated/package-test.el @@ -361,10 +361,13 @@ Must called from within a `tar-mode' buffer." (while package--downloads-in-progress (accept-process-output nil 1)) nil)) + ;; If the server process died, there's some non-Emacs problem. + ;; Eg maybe the port was already in use. + (skip-unless (process-live-p process)) (goto-char (point-min)) (should (search-forward-regexp "^ +simple-single" nil t))) - (kill-process process))))) + (if (process-live-p process) (kill-process process)))))) (ert-deftest package-test-describe-package () "Test displaying help for a package." commit 9c3e1e4e5bc230c4b4fd6649b6afb5d4792592c2 Author: Stefan Monnier Date: Mon Apr 27 19:12:11 2015 -0400 * lisp/saveplace.el (save-place-mode): New minor mode. (save-place): Redefine as an obsolete alias. diff --git a/etc/NEWS b/etc/NEWS index a505cf2..1a1492b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -237,6 +237,9 @@ Unicode standards. * Changes in Specialized Modes and Packages in Emacs 25.1 + +** The `save-place' variable is replaced by a `save-place-mode'. + ** Midnight-mode *** `midnight-mode' is a proper minor mode. *** clean-buffer-*-regexps can now specify buffers via predicate functions. diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 4c53632..fe54743 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -50,28 +50,10 @@ visiting file FILENAME goes automatically to position POSITION rather than the beginning of the buffer. This alist is saved between Emacs sessions.") -(defcustom save-place nil - "Non-nil means automatically save place in each file. -This means when you visit a file, point goes to the last place -where it was when you previously visited the same file. - -If you wish your place in any file to always be automatically -saved, set this to t using the Customize facility, or put the -following code in your init file: - -\(setq-default save-place t) -\(require 'saveplace)" - :type 'boolean - :require 'saveplace - :group 'save-place) - -(make-variable-buffer-local 'save-place) - (defcustom save-place-file (locate-user-emacs-file "places" ".emacs-places") "Name of the file that records `save-place-alist' value." :version "24.4" ; added locate-user-emacs-file - :type 'file - :group 'save-place) + :type 'file) (defcustom save-place-version-control nil "Controls whether to make numbered backups of master save-place file. @@ -82,8 +64,7 @@ value of `version-control'." :type '(radio (const :tag "Unconditionally" t) (const :tag "For VC Files" nil) (const never) - (const :tag "Use value of `version-control'" nospecial)) - :group 'save-place) + (const :tag "Use value of `version-control'" nospecial))) (defvar save-place-loaded nil "Non-nil means that the `save-place-file' has been loaded.") @@ -92,8 +73,7 @@ value of `version-control'." "Maximum number of entries to retain in the list; nil means no limit." :version "24.1" ; nil -> 400 :type '(choice (integer :tag "Entries" :value 1) - (const :tag "No Limit" nil)) - :group 'save-place) + (const :tag "No Limit" nil))) (defcustom save-place-forget-unreadable-files t "Non-nil means forget place in unreadable files. @@ -106,7 +86,7 @@ You may do this anytime by calling the complementary function, `save-place-forget-unreadable-files'. When this option is turned on, this happens automatically before saving `save-place-alist' to `save-place-file'." - :type 'boolean :group 'save-place) + :type 'boolean) (defcustom save-place-save-skipped t "If non-nil, remember files matching `save-place-skip-check-regexp'. @@ -114,7 +94,7 @@ this happens automatically before saving `save-place-alist' to When filtering `save-place-alist' for unreadable files, some will not be checked, based on said regexp, and instead saved or forgotten based on this flag." - :type 'boolean :group 'save-place) + :type 'boolean) (defcustom save-place-skip-check-regexp ;; thanks to ange-ftp-name-format @@ -127,7 +107,7 @@ subject to `save-place-save-skipped'. Files for which such a check may be inconvenient include those on removable and network volumes." - :type 'regexp :group 'save-place) + :type 'regexp) (defcustom save-place-ignore-files-regexp "\\(?:COMMIT_EDITMSG\\|hg-editor-[[:alnum:]]+\\.txt\\|svn-commit\\.tmp\\|bzr_log\\.[[:alnum:]]+\\)$" @@ -136,11 +116,34 @@ Useful for temporary file such as commit message files that are automatically created by the VCS. If set to nil, this feature is disabled, i.e., the position is recorded for all files." :version "24.1" - :type 'regexp :group 'save-place) + :type 'regexp) (declare-function dired-current-directory "dired" (&optional localp)) -(defun toggle-save-place (&optional parg) +(define-obsolete-variable-alias 'save-place 'save-place-mode "25.1") +;;;###autoload +(define-minor-mode save-place-mode + "Non-nil means automatically save place in each file. +This means when you visit a file, point goes to the last place +where it was when you previously visited the same file." + :global t + :group 'save-place + (cond + (save-place-mode + (add-hook 'find-file-hook 'save-place-find-file-hook t) + (add-hook 'dired-initial-position-hook 'save-place-dired-hook) + (unless noninteractive + (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)) + (add-hook 'kill-buffer-hook 'save-place-to-alist)) + (t + (remove-hook 'find-file-hook 'save-place-find-file-hook t) + (remove-hook 'dired-initial-position-hook 'save-place-dired-hook) + (remove-hook 'kill-emacs-hook 'save-place-kill-emacs-hook) + (remove-hook 'kill-buffer-hook 'save-place-to-alist)))) + +(make-variable-buffer-local 'save-place-mode) ; Hysterical raisins. + +(defun toggle-save-place (&optional parg) ;FIXME: save-place-local-mode! "Toggle whether to save your place in this file between sessions. If this mode is enabled, point is recorded when you kill the buffer or exit Emacs. Visiting this file again will go to that position, @@ -353,15 +356,5 @@ may have changed) back to `save-place-alist'." (if save-place-loaded (save-place-alist-to-file))) -(add-hook 'find-file-hook 'save-place-find-file-hook t) - -(add-hook 'dired-initial-position-hook 'save-place-dired-hook) - -(unless noninteractive - (add-hook 'kill-emacs-hook 'save-place-kill-emacs-hook)) - -(add-hook 'kill-buffer-hook 'save-place-to-alist) - -(provide 'saveplace) ; why not... - +(provide 'saveplace) ;;; saveplace.el ends here commit c603274f264d550bbae6b0b5c906dfebb78c7eb3 Author: Stefan Monnier Date: Mon Apr 27 19:07:51 2015 -0400 * lisp/midnight.el: Make it a minor mode. Allow predicates. * lisp/midnight.el: Use lexical-binding. (midnight-mode): Make it a proper minor mode. (midnight-buffer-display-time): Make arg non-optional. (midnight-find): Remove. (clean-buffer-list-kill-never-regexps) (clean-buffer-list-kill-regexps): Tweak type for new function choice. (clean-buffer-list-delay): Allow clean-buffer-list-kill-regexps to contain functions. (clean-buffer-list): Use cl-find. Allow clean-buffer-list-kill-never-regexps to contain functions. diff --git a/etc/NEWS b/etc/NEWS index b408b51..a505cf2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -237,6 +237,10 @@ Unicode standards. * Changes in Specialized Modes and Packages in Emacs 25.1 +** Midnight-mode +*** `midnight-mode' is a proper minor mode. +*** clean-buffer-*-regexps can now specify buffers via predicate functions. + ** In xterms, killing text now also sets the CLIPBOARD/PRIMARY selection in the surrounding GUI (using the OSC-52 escape sequence). This only works if your xterm supports it and enables the `allowWindowOps' options (disabled diff --git a/lisp/midnight.el b/lisp/midnight.el index dbf0c02..256ab9c 100644 --- a/lisp/midnight.el +++ b/lisp/midnight.el @@ -1,4 +1,4 @@ -;;; midnight.el --- run something every midnight, e.g., kill old buffers +;;; midnight.el --- run something every midnight, e.g., kill old buffers -*- lexical-binding:t -*- ;; Copyright (C) 1998, 2001-2015 Free Software Foundation, Inc. @@ -36,7 +36,7 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (defgroup midnight nil "Run something every day at midnight." @@ -48,24 +48,19 @@ Use `cancel-timer' to stop it and `midnight-delay-set' to change the time when it is run.") -(defcustom midnight-mode nil - "Non-nil means run `midnight-hook' at midnight. -Setting this variable outside customize has no effect; -call `cancel-timer' or `timer-activate' on `midnight-timer' instead." - :type 'boolean - :group 'midnight - :require 'midnight - :initialize 'custom-initialize-default - :set (lambda (symb val) - (set symb val) (require 'midnight) - (if val (timer-activate midnight-timer) - (cancel-timer midnight-timer)))) +;;;###autoload +(define-minor-mode midnight-mode + "Non-nil means run `midnight-hook' at midnight." + :global t + :initialize #'custom-initialize-default + (if midnight-mode (timer-activate midnight-timer) + (cancel-timer midnight-timer))) ;;; time conversion -(defun midnight-buffer-display-time (&optional buffer) +(defun midnight-buffer-display-time (buffer) "Return the time-stamp of BUFFER, or current buffer, as float." - (with-current-buffer (or buffer (current-buffer)) + (with-current-buffer buffer (when buffer-display-time (float-time buffer-display-time)))) ;;; clean-buffer-list stuff @@ -76,18 +71,16 @@ The autokilling is done by `clean-buffer-list' when is it in `midnight-hook'. Currently displayed and/or modified (unsaved) buffers, as well as buffers matching `clean-buffer-list-kill-never-buffer-names' and `clean-buffer-list-kill-never-regexps' are excluded." - :type 'integer - :group 'midnight) + :type 'integer) (defcustom clean-buffer-list-delay-special 3600 "The number of seconds before some buffers become eligible for autokilling. Buffers matched by `clean-buffer-list-kill-regexps' and `clean-buffer-list-kill-buffer-names' are killed if they were last displayed more than this many seconds ago." - :type 'integer - :group 'midnight) + :type 'integer) -(defcustom clean-buffer-list-kill-regexps '("^\\*Man ") +(defcustom clean-buffer-list-kill-regexps '("\\`\\*Man ") "List of regexps saying which buffers will be killed at midnight. If buffer name matches a regexp in the list and the buffer was not displayed in the last `clean-buffer-list-delay-special' seconds, it is killed by @@ -96,9 +89,14 @@ If a member of the list is a cons, its `car' is the regexp and its `cdr' is the number of seconds to use instead of `clean-buffer-list-delay-special'. See also `clean-buffer-list-kill-buffer-names', `clean-buffer-list-kill-never-regexps' and -`clean-buffer-list-kill-never-buffer-names'." - :type '(repeat (regexp :tag "Regexp matching Buffer Name")) - :group 'midnight) +`clean-buffer-list-kill-never-buffer-names'. + +Each element can also be a function instead of a regexp, in which case +it takes a single argument (a buffer name) and should return non-nil +if the buffer should be killed by `clean-buffer-list'." + :type '(repeat + (choice (regexp :tag "Regexp matching Buffer Name") + (function :tag "Predicate function")))) (defcustom clean-buffer-list-kill-buffer-names '("*Help*" "*Apropos*" "*Buffer List*" "*Compile-Log*" "*info*" @@ -112,8 +110,7 @@ the number of seconds to use instead of `clean-buffer-list-delay-special'. See also `clean-buffer-list-kill-regexps', `clean-buffer-list-kill-never-regexps' and `clean-buffer-list-kill-never-buffer-names'." - :type '(repeat (string :tag "Buffer Name")) - :group 'midnight) + :type '(repeat (string :tag "Buffer Name"))) (defcustom clean-buffer-list-kill-never-buffer-names '("*scratch*" "*Messages*") @@ -122,33 +119,34 @@ See also `clean-buffer-list-kill-never-regexps'. Note that this does override `clean-buffer-list-kill-regexps' and `clean-buffer-list-kill-buffer-names' so a buffer matching any of these two lists will NOT be killed if it is also present in this list." - :type '(repeat (string :tag "Buffer Name")) - :group 'midnight) + :type '(repeat (string :tag "Buffer Name"))) -(defcustom clean-buffer-list-kill-never-regexps '("^ \\*Minibuf-.*\\*$") +(defcustom clean-buffer-list-kill-never-regexps '("\\` \\*Minibuf-.*\\*\\'") "List of regexp saying which buffers will never be killed at midnight. See also `clean-buffer-list-kill-never-buffer-names'. Killing is done by `clean-buffer-list'. Note that this does override `clean-buffer-list-kill-regexps' and `clean-buffer-list-kill-buffer-names' so a buffer matching any of these -two lists will NOT be killed if it also matches anything in this list." - :type '(repeat (regexp :tag "Regexp matching Buffer Name")) - :group 'midnight) +two lists will NOT be killed if it also matches anything in this list. -(defun midnight-find (el ls test &optional key) - "A stopgap solution to the absence of `find' in ELisp." - (cl-dolist (rr ls) - (when (funcall test (if key (funcall key rr) rr) el) - (cl-return rr)))) +Each element can also be a function instead of a regexp, in which case +it takes a single argument (a buffer name) and should return non-nil +if the buffer should never be killed by `clean-buffer-list'." + :type '(repeat + (choice (regexp :tag "Regexp matching Buffer Name") + (function :tag "Predicate function")))) (defun clean-buffer-list-delay (name) "Return the delay, in seconds, before killing a buffer named NAME. Uses `clean-buffer-list-kill-buffer-names', `clean-buffer-list-kill-regexps' `clean-buffer-list-delay-general' and `clean-buffer-list-delay-special'. Autokilling is done by `clean-buffer-list'." - (or (assoc-default name clean-buffer-list-kill-buffer-names 'string= + (or (assoc-default name clean-buffer-list-kill-buffer-names #'string= clean-buffer-list-delay-special) - (assoc-default name clean-buffer-list-kill-regexps 'string-match + (assoc-default name clean-buffer-list-kill-regexps + (lambda (re str) + (if (functionp re) + (funcall re str) (string-match re str))) clean-buffer-list-delay-special) (* clean-buffer-list-delay-general 24 60 60))) @@ -172,10 +170,13 @@ lifetime, i.e., its \"age\" when it will be purged." (setq bts (midnight-buffer-display-time buf) bn (buffer-name buf) delay (if bts (- tm bts) 0) cbld (clean-buffer-list-delay bn)) (message "[%s] `%s' [%s %d]" ts bn (if bts (round delay)) cbld) - (unless (or (midnight-find bn clean-buffer-list-kill-never-regexps - 'string-match) - (midnight-find bn clean-buffer-list-kill-never-buffer-names - 'string-equal) + (unless (or (cl-find bn clean-buffer-list-kill-never-regexps + :test (lambda (bn re) + (if (functionp re) + (funcall re bn) + (string-match re bn)))) + (cl-find bn clean-buffer-list-kill-never-buffer-names + :test #'string-equal) (get-buffer-process buf) (and (buffer-file-name buf) (buffer-modified-p buf)) (get-buffer-window buf 'visible) (< delay cbld)) @@ -190,8 +191,7 @@ lifetime, i.e., its \"age\" when it will be purged." (defcustom midnight-hook '(clean-buffer-list) "The hook run `midnight-delay' seconds after midnight every day. The default value is `clean-buffer-list'." - :type 'hook - :group 'midnight) + :type 'hook) (defun midnight-next () "Return the number of seconds till the next midnight." @@ -209,7 +209,7 @@ to its second argument TM." (when (timerp midnight-timer) (cancel-timer midnight-timer)) (setq midnight-timer (run-at-time (if (numberp tm) (+ (midnight-next) tm) tm) - midnight-period 'run-hooks 'midnight-hook))) + midnight-period #'run-hooks 'midnight-hook))) (defcustom midnight-delay 3600 "The number of seconds after the midnight when the `midnight-timer' is run. @@ -218,8 +218,7 @@ set it by calling `midnight-delay-set', or use `custom'. If you wish, you can use a string instead, it will be passed as the first argument to `run-at-time'." :type 'sexp - :set 'midnight-delay-set - :group 'midnight) + :set #'midnight-delay-set) (provide 'midnight) commit 66fec8bec4a7333b3d1c6d58b046a62b50bde3d2 Author: Nicolas Petton Date: Mon Apr 27 23:24:01 2015 +0200 Bump version of seq.el to 1.5 * lisp/emacs-lisp/seq.el (seq-doseq): Remove undocumented return value from seq-doseq. Bump version number of seq.el. diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el index 0050ff0..2f3f519 100644 --- a/lisp/emacs-lisp/seq.el +++ b/lisp/emacs-lisp/seq.el @@ -4,7 +4,7 @@ ;; Author: Nicolas Petton ;; Keywords: sequences -;; Version: 1.4 +;; Version: 1.5 ;; Package: seq ;; Maintainer: emacs-devel@gnu.org @@ -63,9 +63,7 @@ Evaluate BODY with VAR bound to each element of SEQ, in turn. (prog1 (seq-elt ,seq ,index) (setq ,index (+ ,index 1))) (pop ,index)))) - ,@body)) - ;; FIXME: Do we really want to support this? - ,@(cddr spec)))) + ,@body))))) (defun seq-drop (seq n) "Return a subsequence of SEQ without its first N elements. commit 579db5085ba2ad48160bf5243c2cd477dce4242e Author: Glenn Morris Date: Mon Apr 27 17:18:39 2015 -0400 * lisp/mail/rmail.el (rmail-reply): Decode subject before matching "Re:" prefix. (Bug#20396) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 7efcf69..43abc12 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -3830,7 +3830,8 @@ use \\[mail-yank-original] to yank the original message into it." ;;; (setq cc resent-cc))) ;; Add `Re: ' to subject if not there already. (and (stringp subject) - (setq subject + (setq subject (rfc2047-decode-string subject) + subject (concat rmail-reply-prefix (if (let ((case-fold-search t)) (string-match rmail-reply-regexp subject)) commit f3b43fca47f797fa348f57de220035e6fcecc5c7 Author: Artur Malabarba Date: Mon Apr 27 22:04:38 2015 +0100 * lisp/emacs-lisp/package.el: Small improvements (package--with-work-buffer-async): More informative error. (package-install-user-selected-packages): Rename to `package-install-selected-packages'. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 0392f61..81e0ee9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1135,7 +1135,8 @@ arguments see `package--with-work-buffer'." (signal (cdar status) (cddr status))) (goto-char (point-min)) (unless (search-forward "\n\n" nil 'noerror) - (error "Invalid url response")) + (error "Invalid url response in buffer %s" + (current-buffer))) (delete-region (point-min) (point)) ,@body) (kill-buffer (current-buffer))) @@ -1949,7 +1950,7 @@ The file can either be a tar file or an Emacs Lisp file." (package-install-from-buffer))) ;;;###autoload -(defun package-install-user-selected-packages () +(defun package-install-selected-packages () "Ensure packages in `package-selected-packages' are installed. If some packages are not installed propose to install them." (interactive) commit d320ec576d4a90c31e69afcd2bbc5353d5a3bc90 Author: Stefan Monnier Date: Mon Apr 27 16:01:39 2015 -0400 * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Fix last * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Fix last change. (eieio--class-make): Remove leftover `tag'. diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 582ac8a..92d7234 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -88,7 +88,7 @@ Currently under control of this var: (cl-defstruct (eieio--class (:constructor nil) - (:constructor eieio--class-make (name &aux (tag 'defclass))) + (:constructor eieio--class-make (name)) (:include cl--class) (:copier nil)) children @@ -292,7 +292,13 @@ See `defclass' for more information." ;; method table breakage, particularly when the users is only ;; byte compiling an EIEIO file. (if oldc - (setf (eieio--class-children newc) (eieio--class-children oldc)) + (progn + (cl-assert (eq newc oldc)) + ;; Reset the fields. + (setf (eieio--class-parents newc) nil) + (setf (eieio--class-slots newc) nil) + (setf (eieio--class-initarg-tuples newc) nil) + (setf (eieio--class-class-slots newc) nil)) ;; If the old class did not exist, but did exist in the autoload map, ;; then adopt those children. This is like the above, but deals with ;; autoloads nicely. commit 009e380e0523e1b071a7e949e3760a8957aa6284 Author: Glenn Morris Date: Mon Apr 27 15:48:29 2015 -0400 * lisp/gnus/message.el (gnus-extract-address-components): Remove bogus declaration that was masking previous problem. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 01f2523..8bb0a78 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3997,8 +3997,6 @@ This function uses `mail-citation-hook' if that is non-nil." "Cite function in the standard Message manner." (message-cite-original-1 nil)) -(defvar gnus-extract-address-components) - (autoload 'format-spec "format-spec") (autoload 'gnus-date-get-time "gnus-util") commit e9036b1d8403f6af2306fa1b8fda8bb22fc02f21 Author: Nicolas Graner Date: Mon Apr 27 15:45:04 2015 -0400 * lisp/gnus/message.el (message-insert-formatted-citation-line): Fix typo. (Bug#20318) Copyright-paperwork-exempt: yes diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 1371e70..01f2523 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -4020,7 +4020,7 @@ See `message-citation-line-format'." (unless from (setq from (mail-header-from message-reply-headers))) (let* ((data (condition-case () - (funcall (if (boundp gnus-extract-address-components) + (funcall (if (boundp 'gnus-extract-address-components) gnus-extract-address-components 'mail-extract-address-components) from) commit d92e0c58e859592eba21176a09797e083ff9c541 Author: Stefan Monnier Date: Mon Apr 27 15:33:43 2015 -0400 * lisp/emacs-lisp/eieio-core.el (eieio-defclass-internal): Reuse oldc. diff --git a/lisp/emacs-lisp/eieio-core.el b/lisp/emacs-lisp/eieio-core.el index 59d8348..582ac8a 100644 --- a/lisp/emacs-lisp/eieio-core.el +++ b/lisp/emacs-lisp/eieio-core.el @@ -277,12 +277,12 @@ See `defclass' for more information." (setq eieio-hook nil) (let* ((oldc (let ((c (eieio--class-v cname))) (if (eieio--class-p c) c))) - (newc (if (and oldc (not (eieio--class-default-object-cache oldc))) - ;; The oldc class is a stub setup by eieio-defclass-autoload. - ;; Reuse it instead of creating a new one, so that existing - ;; references stay valid. - oldc - (eieio--class-make cname))) + (newc (or oldc + ;; Reuse `oldc' instead of creating a new one, so that + ;; existing references stay valid. E.g. when + ;; reloading the file that does the `defclass', we don't + ;; want to create a new class object. + (eieio--class-make cname))) (groups nil) ;; list of groups id'd from slots (clearparent nil)) commit 1c7f0cdc4c1f8479fcf929cfb2446432b1cc19de Author: Stefan Monnier Date: Mon Apr 27 12:59:11 2015 -0400 * lisp/textmodes/reftex-toc.el: Improve multi-frame behavior * lisp/textmodes/reftex-toc.el (reftex-toc-revert): Avoid displaying the buffer in yet another frame. (reftex-toc-visit-location): Make sure toc-window has focus at the end when `final' is nil. (reftex--rebuilding-toc): Defvar to avoid `boundp' and silence warnings. Use `--' to clarify that it's internal. (reftex-toc-next, reftex-toc-previous, reftex-toc-demote) (reftex-toc-promote): Clarify unused argument. (reftex--pro-or-de, reftex--start-line, reftex--mark-line): Add `reftex--' prefix. Fix all users. (reftex-toc-promote-prepare): Use _ for dummy variable. (reftex-toc-restore-region): Rename `m diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index 085f2d7..d51fb9b 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -190,8 +190,11 @@ M-% Global search and replace to rename label at point. x Switch to TOC of external document (with LaTeX package `xr'). z Jump to a specific section (e.g. '3 z' goes to section 3).") +(defvar reftex--rebuilding-toc nil) + ;;;###autoload -(defun reftex-toc (&optional rebuild reuse) +(defun reftex-toc (&optional _rebuild reuse) + ;; FIXME: Get rid of the `rebuild' argument. "Show the table of contents for the current document. When called with a raw C-u prefix, rescan the document first." @@ -201,6 +204,9 @@ When called with a raw C-u prefix, rescan the document first." (interactive) (if (or (not (string= reftex-last-toc-master (reftex-TeX-master-file))) + ;; FIXME: use (interactive "P") to receive current-prefix-arg as + ;; an argument instead of using the var here, which forces us to set + ;; current-prefix-arg in the callers. current-prefix-arg) (reftex-erase-buffer "*toc*")) @@ -225,7 +231,7 @@ When called with a raw C-u prefix, rescan the document first." (docstruct-symbol reftex-docstruct-symbol) (xr-data (assq 'xr (symbol-value reftex-docstruct-symbol))) (xr-alist (cons (cons "" (buffer-file-name)) (nth 1 xr-data))) - (here-I-am (if (boundp 'reftex-rebuilding-toc) + (here-I-am (if reftex--rebuilding-toc (get 'reftex-toc :reftex-data) (car (reftex-where-am-I)))) (unsplittable (if (fboundp 'frame-property) @@ -414,17 +420,17 @@ SPC=view TAB=goto RET=goto+hide [q]uit [r]escan [l]abels [f]ollow [x]r [?]Help (if reftex-toc-follow-mode (setq reftex-toc-follow-mode 1))) -(defun reftex-toc-next (&optional arg) +(defun reftex-toc-next (&optional _arg) "Move to next selectable item." - (interactive "p") + (interactive) (when (featurep 'xemacs) (setq zmacs-region-stays t)) (setq reftex-callback-fwd t) (or (eobp) (forward-char 1)) (goto-char (or (next-single-property-change (point) :data) (point)))) -(defun reftex-toc-previous (&optional arg) +(defun reftex-toc-previous (&optional _arg) "Move to previous selectable item." - (interactive "p") + (interactive) (when (featurep 'xemacs) (setq zmacs-region-stays t)) (setq reftex-callback-fwd nil) (goto-char (or (previous-single-property-change (point) :data) @@ -558,7 +564,7 @@ With prefix arg 1, restrict index to the section at point." (reftex-display-index (if restr nil arg) restr))) ;; Rescanning the document and rebuilding the TOC buffer. -(defun reftex-toc-rescan (&rest ignore) +(defun reftex-toc-rescan (&rest _) "Regenerate the *toc* buffer by reparsing file of section at point." (interactive) (if (and reftex-enable-partial-scans @@ -576,12 +582,12 @@ With prefix arg 1, restrict index to the section at point." (switch-to-buffer-other-window (reftex-get-file-buffer-force file)) (setq current-prefix-arg '(4)) - (let ((reftex-rebuilding-toc t)) + (let ((reftex--rebuilding-toc t)) (reftex-toc)))) (reftex-toc-Rescan)) (reftex-kill-temporary-buffers)) -(defun reftex-toc-Rescan (&rest ignore) +(defun reftex-toc-Rescan (&rest _) "Regenerate the *toc* buffer by reparsing the entire document." (interactive) (let* ((line (+ (count-lines (point-min) (point)) (if (bolp) 1 0)))) @@ -589,17 +595,17 @@ With prefix arg 1, restrict index to the section at point." (switch-to-buffer-other-window (reftex-get-file-buffer-force reftex-last-toc-file)) (setq current-prefix-arg '(16)) - (let ((reftex-rebuilding-toc t)) + (let ((reftex--rebuilding-toc t)) (reftex-toc))) -(defun reftex-toc-revert (&rest ignore) +(defun reftex-toc-revert (&rest _) "Regenerate the TOC from the internal lists." (interactive) (let ((unsplittable (if (fboundp 'frame-property) (frame-property (selected-frame) 'unsplittable) (frame-parameter nil 'unsplittable))) - (reftex-rebuilding-toc t)) + (reftex--rebuilding-toc t)) (if unsplittable (switch-to-buffer (reftex-get-file-buffer-force reftex-last-toc-file)) @@ -607,9 +613,9 @@ With prefix arg 1, restrict index to the section at point." (reftex-get-file-buffer-force reftex-last-toc-file)))) (reftex-erase-buffer "*toc*") (setq current-prefix-arg nil) - (reftex-toc t)) + (reftex-toc t t)) -(defun reftex-toc-external (&rest ignore) +(defun reftex-toc-external (&rest _) "Switch to table of contents of an external document." (interactive) (reftex-toc-dframe-p nil 'error) @@ -637,18 +643,17 @@ Useful for large TOCs." ;; Promotion/Demotion stuff -(defvar pro-or-de) -(defvar start-pos) -(defvar start-line) -(defvar mark-line) +(defvar reftex--pro-or-de) +(defvar reftex--start-line) +(defvar reftex--mark-line) -(defun reftex-toc-demote (&optional arg) +(defun reftex-toc-demote (&optional _arg) "Demote section at point. If region is active, apply to all in region." - (interactive "p") + (interactive) (reftex-toc-do-promote 1)) -(defun reftex-toc-promote (&optional arg) +(defun reftex-toc-promote (&optional _arg) "Promote section at point. If region is active, apply to all in region." - (interactive "p") + (interactive) (reftex-toc-do-promote -1)) (defun reftex-toc-do-promote (delta) "Workhorse for `reftex-toc-promote' and `reftex-toc-demote'. @@ -657,14 +662,15 @@ point." ;; We should not do anything unless we are sure this is going to work for ;; each section in the region. Therefore we first collect information and ;; test. - (let* ((start-line (+ (count-lines (point-min) (point)) - (if (bolp) 1 0))) - (mark-line (if (reftex-region-active-p) - (save-excursion (goto-char (mark)) - (+ (count-lines (point-min) (point)) - (if (bolp) 1 0))))) + (let* ((reftex--start-line (+ (count-lines (point-min) (point)) + (if (bolp) 1 0))) + (reftex--mark-line + (if (reftex-region-active-p) + (save-excursion (goto-char (mark)) + (+ (count-lines (point-min) (point)) + (if (bolp) 1 0))))) (start-pos (point)) - (pro-or-de (if (> delta 0) "de" "pro")) + (reftex--pro-or-de (if (> delta 0) "de" "pro")) beg end entries data sections nsec msg) (setq msg (catch 'exit @@ -713,23 +719,23 @@ point." ;; Rescan the document and rebuilt the toc buffer (save-window-excursion (reftex-toc-Rescan)) - (reftex-toc-restore-region start-line mark-line) + (reftex-toc-restore-region reftex--start-line reftex--mark-line) (message "%d section%s %smoted" - nsec (if (= 1 nsec) "" "s") pro-or-de) + nsec (if (= 1 nsec) "" "s") reftex--pro-or-de) nil)) (if msg (progn (ding) (message "%s" msg))))) (defun reftex-toc-restore-region (point-line &optional mark-line) - (let (mpos) - (when mark-line - (goto-char (point-min)) - (forward-line (1- mark-line)) - (setq mpos (point))) + (let ((mpos + (when mark-line + (goto-char (point-min)) + (forward-line (1- mark-line)) + (point)))) (when point-line (goto-char (point-min)) (forward-line (1- point-line))) - (when mark-line + (when mpos (set-mark mpos) (if (featurep 'xemacs) (zmacs-activate-region) @@ -749,7 +755,7 @@ promotion/demotion later. DELTA is the level change." (name nil) ;; Here follows some paranoid code to make very sure we are not ;; going to break anything - (name1 ; dummy + (_ (if (and (markerp marker) (marker-buffer marker)) ;; Buffer is still live and we have the marker. (progn @@ -772,24 +778,24 @@ promotion/demotion later. DELTA is the level change." ;; We don't have a live marker: scan and load files. (reftex-toc-load-all-files-for-promotion))) (level (cdr (assoc name reftex-section-levels-all))) - (dummy (if (not (integerp level)) - (progn - (goto-char toc-point) - (error "Cannot %smote special sections" pro-or-de)))) + (_ (if (not (integerp level)) + (progn + (goto-char toc-point) + (error "Cannot %smote special sections" reftex--pro-or-de)))) (newlevel (if (>= level 0) (+ delta level) (- level delta))) - (dummy2 (if (or (and (>= level 0) (= newlevel -1)) - (and (< level 0) (= newlevel 0))) - (error "Cannot %smote \\%s" pro-or-de name))) + (_ (if (or (and (>= level 0) (= newlevel -1)) + (and (< level 0) (= newlevel 0))) + (error "Cannot %smote \\%s" reftex--pro-or-de name))) (newname (reftex-toc-newhead-from-alist newlevel name reftex-section-levels-all))) (if (and name newname) (list data name newname toc-point) (goto-char toc-point) - (error "Cannot %smote \\%s" pro-or-de name)))) + (error "Cannot %smote \\%s" reftex--pro-or-de name)))) (defun reftex-toc-promote-action (x) "Change the level of a TOC entry. -PRO-OR-DE is assumed to be dynamically scoped into this function." +`reftex--pro-or-de' is assumed to be dynamically scoped into this function." (let* ((data (car x)) (name (nth 1 x)) (newname (nth 2 x)) @@ -798,7 +804,7 @@ PRO-OR-DE is assumed to be dynamically scoped into this function." (goto-char (marker-position marker)) (if (looking-at (concat "\\([ \t]*" reftex-section-pre-regexp "\\)" (regexp-quote name))) (replace-match (concat "\\1" newname)) - (error "Fatal error during %smotion" pro-or-de))))) + (error "Fatal error during %smotion" reftex--pro-or-de))))) (defun reftex-toc-extract-section-number (entry) "Get the numbering of a TOC entry, for message purposes." @@ -848,11 +854,11 @@ if these sets are sorted blocks in the alist." "Make sure all files of the document are being visited by buffers, and that the scanning info is absolutely up to date. We do this by rescanning with `reftex-keep-temporary-buffers' bound to t. -The variable PRO-OR-DE is assumed to be dynamically scoped into this function. +The variable `reftex--pro-or-de' is assumed to be dynamically scoped into this function. When finished, we exit with an error message." (let ((reftex-keep-temporary-buffers t)) (reftex-toc-Rescan) - (reftex-toc-restore-region start-line mark-line) + (reftex-toc-restore-region reftex--start-line reftex--mark-line) (throw 'exit "TOC had to be updated first. Please check selection and repeat the command."))) @@ -895,7 +901,7 @@ label prefix determines the wording of a reference." (let* ((toc (get-text-property (point) :data)) (toc-window (selected-window)) - show-window show-buffer match) + match) (unless toc (error "Don't know which TOC line to visit")) @@ -926,30 +932,33 @@ label prefix determines the wording of a reference." (setq match (reftex-show-label-location toc reftex-callback-fwd no-revisit t)))) - (setq show-window (selected-window) - show-buffer (current-buffer)) - (unless match (select-window toc-window) (error "Cannot find location")) - (select-window toc-window) - - ;; use the `final' parameter to decide what to do next + ;; Use the `final' parameter to decide what to do next. (cond ((eq final t) - (reftex-unhighlight 0) - (select-window show-window)) + (with-selected-window toc-window + (reftex-unhighlight 0))) ((eq final 'hide) - (reftex-unhighlight 0) - (or (one-window-p) (delete-window)) - ;; If `show-window' is still live, show-buffer is already visible - ;; so let's not make it visible in yet-another-window. - (if (window-live-p show-window) - (set-buffer show-buffer) - (switch-to-buffer show-buffer)) - (reftex-re-enlarge)) - (t nil)))) + (let ((show-window (selected-window)) + (show-buffer (window-buffer))) + (unless (eq show-window toc-window) ;FIXME: Can this happen? + (with-selected-window toc-window + (reftex-unhighlight 0) + (or (one-window-p) (delete-window)))) + ;; If `show-window' is still live, show-buffer is already visible + ;; so let's not make it visible in yet-another-window. + (unless (window-live-p show-window) + ;; FIXME: How could show-window not be live? + (switch-to-buffer show-buffer)) + (reftex-re-enlarge))) + (t + (unless (eq (selected-frame) (window-frame toc-window)) + ;; Make sure `toc-window' is not just selected but has focus. + (select-frame-set-input-focus (window-frame toc-window))) + (select-window toc-window))))) (defun reftex-toc-find-section (toc &optional no-revisit) (let* ((file (nth 3 toc)) commit 08dad2f84ddc2934ced2b1e4ec891a581d59d617 Author: Eli Zaretskii Date: Mon Apr 27 18:21:13 2015 +0300 Fix a typo in bibtex.el * lisp/textmodes/bibtex.el (bibtex-insert-kill): Fix a typo from last change. (Bug#20429) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 8a01852..10edefc 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -2229,7 +2229,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'." bibtex-entry-kill-ring)) ;; If we copied an entry from a buffer containing only this one entry, ;; it can be missing the second "\n". - (unless (looking-back "\n\n" (- (point 2))) (insert "\n")) + (unless (looking-back "\n\n" (- (point) 2)) (insert "\n")) (unless (functionp bibtex-reference-keys) ;; update `bibtex-reference-keys' (save-excursion commit d89687b1ba4d0e4a252ca48749103467f2642212 Author: Eli Zaretskii Date: Mon Apr 27 18:15:52 2015 +0300 Fix redisplay of frame after loading new fonts * src/xdisp.c (redisplay_internal): When retrying redisplay of a frame because new fonts were loaded, disable all redisplay optimizations on that frame by calling SET_FRAME_GARBAGED. (Bug#20410) diff --git a/src/xdisp.c b/src/xdisp.c index 5a27adc..c2f0b74 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13359,6 +13359,13 @@ redisplay_internal (void) if (f->fonts_changed) { adjust_frame_glyphs (f); + /* Disable all redisplay optimizations for this frame. + This is because adjust_frame_glyphs resets the + enabled_p flag for all glyph rows of all windows, so + many optimizations will fail anyway, and some might + fail to test that flag and do bogus things as + result. */ + SET_FRAME_GARBAGED (f); f->fonts_changed = false; } /* If cursor type has been changed on the frame @@ -13753,6 +13760,10 @@ redisplay_internal (void) if (f->fonts_changed) { adjust_frame_glyphs (f); + /* Disable all redisplay optimizations for this + frame. For the reasons, see the comment near + the previous call to adjust_frame_glyphs above. */ + SET_FRAME_GARBAGED (f); f->fonts_changed = false; goto retry_frame; }