commit d870ac2119c894b01ad5a381711e6b6fcf2af06a (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Mon Apr 20 18:59:39 2015 -0700 ; * test/automated/message-mode-tests.el: Standardize license notice. diff --git a/test/automated/message-mode-tests.el b/test/automated/message-mode-tests.el index 397707f..4354b23 100644 --- a/test/automated/message-mode-tests.el +++ b/test/automated/message-mode-tests.el @@ -1,21 +1,23 @@ ;;; message-mode-tests.el --- Tests for message-mode -*- lexical-binding: t; -*- -;; Copyright (C) 2015 Free Software Foundation, Inc. +;; Copyright (C) 2015 Free Software Foundation, Inc. ;; Author: João Távora -;; This program is free software; you can redistribute it and/or modify +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. -;; This program is distributed in the hope that it will be useful, +;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with GNU Emacs. If not, see . ;;; Commentary: commit c9a75a4030a556d700fd95222ec0bf4c1a9f67b5 Author: Stefan Monnier Date: Mon Apr 20 21:55:00 2015 -0400 Fix byte-compiler warnings about looking-back. * lisp/vc/log-view.el (log-view-end-of-defun-1): * lisp/textmodes/tex-mode.el (latex-forward-sexp-1): * lisp/textmodes/reftex-ref.el (reftex-goto-label): * lisp/textmodes/bibtex.el (bibtex-insert-kill): * lisp/progmodes/sh-script.el (sh--maybe-here-document): * lisp/progmodes/ruby-mode.el (ruby-end-of-defun): * lisp/progmodes/ada-mode.el (ada-in-numeric-literal-p): * lisp/org/org.el (org-insert-heading, org-sort-entries): * lisp/org/org-mouse.el (org-mouse-end-headline) (org-mouse-context-menu): * lisp/org/org-clock.el (org-clock-cancel): * lisp/man.el (Man-default-man-entry): * lisp/mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text) (rmail-ensure-blank-line): * lisp/mail/footnote.el (Footnote-delete-footnote): * lisp/mail/emacsbug.el (report-emacs-bug): * lisp/info.el (Info-follow-reference, Info-fontify-node): * lisp/info-look.el (info-lookup-guess-custom-symbol): * lisp/help-fns.el (help-fns--key-bindings): * lisp/files.el (hack-local-variables): * lisp/emulation/viper-ex.el (viper-get-ex-token, ex-cmd-complete) (viper-get-ex-pat, ex-expand-filsyms, viper-get-ex-file) (viper-complete-filename-or-exit): * lisp/emulation/viper-cmd.el (viper-backward-indent): * lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): * lisp/emacs-lisp/elint.el (elint-get-top-forms): * lisp/cus-edit.el (custom-face-edit-value-create): * lisp/calendar/todo-mode.el (todo-set-item-priority) (todo-filter-items-1, todo-convert-legacy-files) (todo-prefix-overlays): Add explicit second arg to looking-back. diff --git a/etc/NEWS b/etc/NEWS index 9dd0e15..804b819 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -233,7 +233,9 @@ Unicode standards. * Changes in Specialized Modes and Packages in Emacs 25.1 ** In xterms, killing text now also sets the CLIPBOARD/PRIMARY selection -in the surrounding GUI (using the OSC-52 escape sequence). +in the surrounding GUI (using the OSC-52 escape sequence). This only works +if your xterm supports it and enables the `allowWindowOps' options (disabled +by default at least in Debian, for security reasons). ** xterm-mouse-mode now supports mouse-tracking (if your xterm supports it). diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el index dcc960f..bb9316c 100644 --- a/lisp/calendar/todo-mode.el +++ b/lisp/calendar/todo-mode.el @@ -2606,7 +2606,8 @@ meaning to raise or lower the item's priority by one." ;; separator. (when (looking-back (concat "^" (regexp-quote todo-category-done) - "\n")) + "\n") + (line-beginning-position 0)) (todo-backward-item)))) (todo-insert-with-overlays item) ;; If item was marked, restore the mark. @@ -4231,7 +4232,8 @@ the values of FILTER and FILE-LIST." (if (and (eobp) (looking-back (concat (regexp-quote todo-done-string) - "\n"))) + "\n") + (line-beginning-position 0))) (delete-region (point) (progn (forward-line -2) (point)))))) @@ -4648,7 +4650,7 @@ name in `todo-directory'. See also the documentation string of ;; If the item ends with a non-comment parenthesis not ;; followed by a period, we lose (but we inherit that ;; problem from the legacy code). - (when (looking-back "(\\(.*\\)) ") + (when (looking-back "(\\(.*\\)) " (line-beginning-position)) (setq comment (match-string 1)) (replace-match "") (insert "[" todo-comment-string ": " comment "]")) @@ -5342,7 +5344,8 @@ of each other." (looking-at todo-done-string-start) (looking-back (concat "^" (regexp-quote todo-category-done) - "\n"))) + "\n") + (line-beginning-position 0))) (setq num 1 done t)) (setq prefix (concat (propertize diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 9cc2fa8..cd894f4 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -3115,7 +3115,7 @@ face attributes (as specified by a `default' defface entry)." widget (widget-get widget :default-face-attributes))) entry) - (unless (looking-back "^ *") + (unless (looking-back "^ *" (line-beginning-position)) (insert ?\n)) (insert-char ?\s (widget-get widget :extra-offset)) (if (or alist defaults show-all) diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index 1364670..317e5a6 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -374,7 +374,7 @@ Returns the forms." (let ((elint-current-pos (point))) ;; non-list check could be here too. errors may be out of seq. ;; quoted check cannot be elsewhere, since quotes skipped. - (if (looking-back "'") + (if (looking-back "'" (1- (point))) ;; Eg cust-print.el uses ' as a comment syntax. (elint-warning "Skipping quoted form `'%.20s...'" (read (current-buffer))) diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index fec172d..104c23c 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -437,9 +437,9 @@ This can be found in an RCS or SCCS header." ((re-search-forward (concat "@(#)" - (if buffer-file-name + (if buffer-file-name (regexp-quote (file-name-nondirectory buffer-file-name)) - "[^\t\n]*") + "[^\t\n]+") "\t\\([012345679.]*\\)") header-max t) (match-string-no-properties 1))))))) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 26a21d5..108d5cc 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -855,9 +855,10 @@ is the buffer position of the start of the containing expression." ;; Handle prefix characters and whitespace ;; following an open paren. (Bug#1012) (backward-prefix-chars) - (while (and (not (looking-back "^[ \t]*\\|([ \t]+")) - (or (not containing-sexp) - (< (1+ containing-sexp) (point)))) + (while (not (or (looking-back "^[ \t]*\\|([ \t]+" + (line-beginning-position)) + (and containing-sexp + (>= (1+ containing-sexp) (point))))) (forward-sexp -1) (backward-prefix-chars)) (setq calculate-lisp-indent-last-sexp (point))) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index bd03a87..5c91df9 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -4533,7 +4533,7 @@ One can use `` and '' to temporarily jump 1 step back." (interactive) (if viper-cted (let ((p (point)) (c (current-column)) bol (indent t)) - (if (looking-back "[0^]") + (if (looking-back "[0^]" (1- (point))) (progn (if (eq ?^ (preceding-char)) (setq viper-preserve-indent t)) @@ -4545,7 +4545,7 @@ One can use `` and '' to temporarily jump 1 step back." (delete-region (point) p) (if indent (indent-to (- c viper-shift-width))) - (if (or (bolp) (looking-back "[^ \t]")) + (if (or (bolp) (looking-back "[^ \t]" (1- (point)))) (setq viper-cted nil))))) ;; do smart indent diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index 212f053..e6bcf8f 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -455,7 +455,8 @@ reversed." (while (and (not (eolp)) cont) ;;(re-search-forward "[^/]*/") (re-search-forward "[^/]*\\(/\\|\n\\)") - (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/")) + (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/" + (line-beginning-position 0))) (setq cont nil)))) (backward-char 1) (setq ex-token (buffer-substring (point) (mark t))) @@ -468,7 +469,8 @@ reversed." (while (and (not (eolp)) cont) ;;(re-search-forward "[^\\?]*\\?") (re-search-forward "[^\\?]*\\(\\?\\|\n\\)") - (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?")) + (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?" + (line-beginning-position 0))) (setq cont nil)) (backward-char 1) (if (not (looking-at "\n")) (forward-char 1)))) @@ -563,14 +565,18 @@ reversed." save-pos (point))) (if (or (= dist 0) - (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") + (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)" + (line-beginning-position)) (looking-back - "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+")) + "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+" + (line-beginning-position))) ;; Preceding characters are not the ones allowed in an Ex command ;; or we have typed past command name. ;; Note: we didn't do parsing, so there can be surprises. - (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*") - (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)") + (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*" + (line-beginning-position)) + (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)" + (line-beginning-position)) (looking-at "[^ \t\n\C-m]")) nil (with-output-to-temp-buffer "*Completions*" @@ -747,7 +753,8 @@ reversed." (error "Missing closing delimiter for global regexp") (goto-char (point-max)))) (if (not (looking-back - (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c))) + (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c) + (line-beginning-position 0))) (setq cont nil) ;; we are at an escaped delimiter: unescape it and continue (delete-char -2) @@ -963,7 +970,7 @@ reversed." (while (re-search-forward "%\\|#" nil t) (let ((data (match-data)) (char (buffer-substring (match-beginning 0) (match-end 0)))) - (if (looking-back (concat "\\\\" char)) + (if (looking-back "\\\\." (- (point) 2)) (replace-match char) (store-match-data data) (if (string= char "%") @@ -989,7 +996,7 @@ reversed." (get-buffer-create viper-ex-work-buf-name)) (skip-chars-forward " \t") (if (looking-at "!") - (if (and (not (looking-back "[ \t]")) + (if (and (not (looking-back "[ \t]" (1- (point)))) ;; read doesn't have a corresponding :r! form, so ! is ;; immediately interpreted as a shell command. (not (string= ex-token "read"))) @@ -1066,7 +1073,7 @@ reversed." (cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer)) ;; apparently the argument to an Ex command is ;; supposed to be a shell command - ((looking-back "^[ \t]*!.*") + ((looking-back "^[ \t]*!.*" (line-beginning-position)) (setq ex-cmdfile t) (insert " ")) (t diff --git a/lisp/files.el b/lisp/files.el index 0b011f4..152f155 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -3375,7 +3375,7 @@ local variables, but directory-local variables may still be applied." (error "Local variables entry is missing the prefix")) (end-of-line) ;; Discard the suffix. - (if (looking-back suffix) + (if (looking-back suffix (line-beginning-position)) (delete-region (match-beginning 0) (point)) (error "Local variables entry is missing the suffix")) (forward-line 1)) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 7ecd271..53f4b38 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -329,7 +329,7 @@ suitable file is found, return nil." (with-current-buffer standard-output (fill-region-as-paragraph pt2 (point)) - (unless (looking-back "\n\n") + (unless (looking-back "\n\n" (- (point) 2)) (terpri)))))) (defun help-fns--compiler-macro (function) diff --git a/lisp/info-look.el b/lisp/info-look.el index 9cf185e..8a86dc8 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -634,7 +634,8 @@ Return nil if there is nothing appropriate in the buffer near point." (setq end (point)) (> end beg)) (and (looking-at "[ \t\n]") - (looking-back (concat "[" significant-chars "]")) + (looking-back (concat "[" significant-chars "]") + (1- (point))) (setq end (point)) (skip-chars-backward significant-chars) (setq beg (point)) diff --git a/lisp/info.el b/lisp/info.el index 0159661..057bd77 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2577,7 +2577,9 @@ new buffer." (save-excursion ;; Move point to the beginning of reference if point is on reference (or (looking-at "\\*note[ \n\t]+") - (and (looking-back "\\*note[ \n\t]+") + (and (looking-back "\\*note[ \n\t]+" + (save-excursion (skip-chars-backward " \n\t") + (line-beginning-position))) (goto-char (match-beginning 0))) (if (and (save-excursion (goto-char (+ (point) 5)) ; skip a possible *note @@ -4738,9 +4740,11 @@ first line or header line, and for breadcrumb links.") ;; an end of sentence (skip-syntax-backward " (")) (setq other-tag - (cond ((save-match-data (looking-back "\\ Date: Mon Apr 20 20:29:48 2015 -0400 Avoid non-nil current-load-list at startup * src/process.c (init_process_emacs): Move Fprovide statement... (syms_of_process): ... to here. diff --git a/src/process.c b/src/process.c index 3ffbbec..c745507 100644 --- a/src/process.c +++ b/src/process.c @@ -7498,40 +7498,6 @@ init_process_emacs (void) memset (datagram_address, 0, sizeof datagram_address); #endif - { - Lisp_Object subfeatures = Qnil; - const struct socket_options *sopt; - -#define ADD_SUBFEATURE(key, val) \ - subfeatures = pure_cons (pure_cons (key, pure_cons (val, Qnil)), subfeatures) - -#ifdef NON_BLOCKING_CONNECT - ADD_SUBFEATURE (QCnowait, Qt); -#endif -#ifdef DATAGRAM_SOCKETS - ADD_SUBFEATURE (QCtype, Qdatagram); -#endif -#ifdef HAVE_SEQPACKET - ADD_SUBFEATURE (QCtype, Qseqpacket); -#endif -#ifdef HAVE_LOCAL_SOCKETS - ADD_SUBFEATURE (QCfamily, Qlocal); -#endif - ADD_SUBFEATURE (QCfamily, Qipv4); -#ifdef AF_INET6 - ADD_SUBFEATURE (QCfamily, Qipv6); -#endif -#ifdef HAVE_GETSOCKNAME - ADD_SUBFEATURE (QCservice, Qt); -#endif - ADD_SUBFEATURE (QCserver, Qt); - - for (sopt = socket_options; sopt->name; sopt++) - subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures); - - Fprovide (intern_c_string ("make-network-process"), subfeatures); - } - #if defined (DARWIN_OS) /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive processes. As such, we only change the default value. */ @@ -7753,4 +7719,39 @@ The variable takes effect when `start-process' is called. */); defsubr (&Sprocess_inherit_coding_system_flag); defsubr (&Slist_system_processes); defsubr (&Sprocess_attributes); + + { + Lisp_Object subfeatures = Qnil; + const struct socket_options *sopt; + +#define ADD_SUBFEATURE(key, val) \ + subfeatures = pure_cons (pure_cons (key, pure_cons (val, Qnil)), subfeatures) + +#ifdef NON_BLOCKING_CONNECT + ADD_SUBFEATURE (QCnowait, Qt); +#endif +#ifdef DATAGRAM_SOCKETS + ADD_SUBFEATURE (QCtype, Qdatagram); +#endif +#ifdef HAVE_SEQPACKET + ADD_SUBFEATURE (QCtype, Qseqpacket); +#endif +#ifdef HAVE_LOCAL_SOCKETS + ADD_SUBFEATURE (QCfamily, Qlocal); +#endif + ADD_SUBFEATURE (QCfamily, Qipv4); +#ifdef AF_INET6 + ADD_SUBFEATURE (QCfamily, Qipv6); +#endif +#ifdef HAVE_GETSOCKNAME + ADD_SUBFEATURE (QCservice, Qt); +#endif + ADD_SUBFEATURE (QCserver, Qt); + + for (sopt = socket_options; sopt->name; sopt++) + subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures); + + Fprovide (intern_c_string ("make-network-process"), subfeatures); + } + } commit affca0fc843426a35c3116d6791f3ec2dd282f6a Author: Glenn Morris Date: Mon Apr 20 18:16:25 2015 -0400 * lisp/loadup.el (custom-current-group-alist): Reset before dumping. diff --git a/lisp/loadup.el b/lisp/loadup.el index bcfef60..0746f95 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -356,6 +356,8 @@ lost after dumping"))) lost after dumping"))) (setq current-load-list nil) +;; Avoid storing references to build directory in the binary. +(setq custom-current-group-alist nil) ;; We keep the load-history data in PURE space. ;; Make sure that the spine of the list is not in pure space because it can commit b32683f1df42b1f622f5d88bae4fc46354bbe0df Author: Glenn Morris Date: Mon Apr 20 17:46:24 2015 -0400 * lisp/startup.el (command-line) : Avoid rogue value in emacs -Q. diff --git a/lisp/startup.el b/lisp/startup.el index 7fa929a..cb8a6a9 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -907,7 +907,9 @@ please check its value") ((member argi '("-Q" "-quick")) (setq init-file-user nil site-run-file nil - inhibit-x-resources t)) + inhibit-x-resources t) + ;; Stop it showing up in emacs -Q's customize-rogue. + (put 'site-run-file 'standard-value '(nil))) ((member argi '("-no-x-resources")) (setq inhibit-x-resources t)) ((member argi '("-D" "-basic-display")) @@ -920,7 +922,8 @@ please check its value") (setq init-file-user (or argval (pop args)) argval nil)) ((equal argi "-no-site-file") - (setq site-run-file nil)) + (setq site-run-file nil) + (put 'site-run-file 'standard-value '(nil))) ((equal argi "-debug-init") (setq init-file-debug t)) ((equal argi "-iconic") commit 83e923bf37f17682ba331db83d268921ac0a4d1a Author: Glenn Morris Date: Mon Apr 20 17:44:59 2015 -0400 ; * lisp/loadup.el: Comment. diff --git a/lisp/loadup.el b/lisp/loadup.el index d24b4bf..bcfef60 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -63,6 +63,8 @@ (expand-file-name "textmodes" dir) (expand-file-name "vc" dir))))) +;; Prevent build-time PATH getting stored in the binary. +;; Mainly cosmetic, but helpful for Guix. (Bug#20330) (setq exec-path nil) (if (eq t purify-flag) commit 2fc11b3fa3418e0e8a624376ea8bf4cbc70c2657 Author: Ludovic Courtès Date: Mon Apr 20 17:44:23 2015 -0400 * lisp/loadup.el (exec-path): Avoid storing build-time PATH in binary. Fixes: debbugs:20330 diff --git a/lisp/loadup.el b/lisp/loadup.el index bfec75f..d24b4bf 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -63,6 +63,8 @@ (expand-file-name "textmodes" dir) (expand-file-name "vc" dir))))) +(setq exec-path nil) + (if (eq t purify-flag) ;; Hash consing saved around 11% of pure space in my tests. (setq purify-flag (make-hash-table :test 'equal :size 70000))) commit b3ff665b2abc18fafec9c2bedbccf8f2d94f3242 Author: Glenn Morris Date: Mon Apr 20 17:40:32 2015 -0400 * lisp/cus-start.el (exec-path): Set standard value, to avoid rogue. diff --git a/lisp/cus-start.el b/lisp/cus-start.el index 29ef371..071aaa6 100644 --- a/lisp/cus-start.el +++ b/lisp/cus-start.el @@ -169,7 +169,12 @@ Leaving \"Default\" unchecked is equivalent with specifying a default of (shell-file-name execute file) (exec-path execute (repeat (choice (const :tag "default directory" nil) - (directory :format "%v")))) + (directory :format "%v"))) + nil + :standard + (mapcar 'directory-file-name + (append (parse-colon-path (getenv "PATH")) + (list exec-directory)))) (exec-suffixes execute (repeat string)) ;; charset.c (charset-map-path installation commit cf2e9971ea12fb7bfa7700a9693d32ca30f87118 Author: Glenn Morris Date: Mon Apr 20 17:38:36 2015 -0400 Tweak exec-path in uninstalled case * src/callproc.c (init_callproc): If running uninstalled, do not include eventual installation libexec directory in exec-path. diff --git a/src/callproc.c b/src/callproc.c index e1fe8ed..12c8143 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1595,12 +1595,12 @@ init_callproc (void) #ifdef HAVE_NS const char *path_exec = ns_exec_path (); #endif + /* Running uninstalled, so default to tem rather than PATH_EXEC. */ Vexec_path = decode_env_path ("EMACSPATH", #ifdef HAVE_NS path_exec ? path_exec : #endif - PATH_EXEC, 0); - Vexec_path = Fcons (tem, Vexec_path); + SSDATA (tem), 0); Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path); } commit b7a015f5e02281cc8500154ebe4339a18587b415 Author: Artur Malabarba Date: Mon Apr 20 07:35:07 2015 +0100 * lisp/emacs-lisp/package.el: Filter by multiple keywords and cache keywords (package-menu-filter): Accept a list of keywords. (package--all-keywords): New variable to cache known keywords. (package-all-keywords): Populate it if necessary. (package-refresh-contents): Reset it. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 4590582..c69e15b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1343,6 +1343,11 @@ it to the file." (defvar package--downloads-in-progress nil "List of in-progress asynchronous downloads.") +(defvar package--all-keywords nil + "List of known keywords. +Generated by `package-all-keywords'. Reset to nil whenever the +package archives are retrieved.") + (declare-function epg-check-configuration "epg-config" (config &optional minimum-version)) (declare-function epg-configuration "epg-config" ()) @@ -1458,9 +1463,9 @@ and make them available for download. Optional argument ASYNC specifies whether to perform the downloads in the background." (interactive) - ;; FIXME: Do it asynchronously. (unless (file-exists-p package-user-dir) (make-directory package-user-dir t)) + (setq package--all-keywords nil) (let ((default-keyring (expand-file-name "package-keyring.gpg" data-directory)) (package--silence async)) @@ -2492,11 +2497,11 @@ KEYWORDS should be nil or a list of keywords." (defun package-all-keywords () "Collect all package keywords" - (let (keywords) + (unless package--all-keywords (package--mapc (lambda (desc) (let* ((desc-keywords (and desc (package-desc--keywords desc)))) - (setq keywords (append keywords desc-keywords))))) - keywords)) + (setq package--all-keywords (append desc-keywords package--all-keywords)))))) + package--all-keywords) (defun package--mapc (function &optional packages) "Call FUNCTION for all known PACKAGES. @@ -3005,9 +3010,17 @@ shown." (defun package-menu-filter (keyword) "Filter the *Packages* buffer. Show only those items that relate to the specified KEYWORD. +KEYWORD can be a string or a list of strings. If it is a list, a +package will be displayed if it matches any of the keywords. +Interactively, it is a list of strings separated by commas. + To restore the full package list, type `q'." - (interactive (list (completing-read "Keyword: " (package-all-keywords)))) - (package-show-package-list t (list keyword))) + (interactive + (list (completing-read-multiple + "Keywords (comma separated): " (package-all-keywords)))) + (package-show-package-list t (if (stringp keyword) + (list keyword) + keyword))) (defun package-list-packages-no-fetch () "Display a list of packages. commit fad6b8a093c14bcf3f699878de501a1a7467cf4c Author: Artur Malabarba Date: Mon Apr 20 07:20:54 2015 +0100 * lisp/emacs-lisp/package.el: Make archive and status pseudo-keywords (package--has-keyword-p): Understand "arc:xxxx" and "status:xxxx" as special keywords which match agains package archive and status respectively. * etc/NEWS: Document it. diff --git a/etc/NEWS b/etc/NEWS index a9c0d2e..9dd0e15 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -238,6 +238,11 @@ in the surrounding GUI (using the OSC-52 escape sequence). ** xterm-mouse-mode now supports mouse-tracking (if your xterm supports it). ** package.el + +*** When filtering the package menu, keywords starting with "arc:" or +"status:" represent package archive or status, respectively, instead +of actual keywords. + *** Most functions which involve downloading information now take an ASYNC argument. If it is non-nil, package.el performs the download(s) asynchronously. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 9cd6b3b..4590582 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2535,12 +2535,14 @@ Built-in packages are converted with `package--from-builtin'." "Test if package DESC has any of the given KEYWORDS. When none are given, the package matches." (if keywords - (let* ((desc-keywords (and desc (package-desc--keywords desc))) - found) - (dolist (k keywords) - (when (and (not found) - (member k desc-keywords)) - (setq found t))) + (let ((desc-keywords (and desc (package-desc--keywords desc))) + found) + (while (and (not found) keywords) + (let ((k (pop keywords))) + (setq found + (or (string= k (concat "arc:" (package-desc-archive desc))) + (string= k (concat "status:" (package-desc-status desc))) + (member k desc-keywords))))) found) t)) commit c0f5a3b3352b748a276cf420b834d677f3d0a671 Author: Eli Zaretskii Date: Mon Apr 20 18:46:11 2015 +0300 Describe and index "empty overlays". * doc/lispref/display.texi (Overlays): Improve indexing. (Managing Overlays): Describe "empty" overlays. (Overlay Properties, Finding Overlays): Add cross-reference to where empty overlays are described. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 54fe437..e2a38b6 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1310,6 +1310,7 @@ beginning and end. It also has properties that you can examine and set; these affect the display of the text within the overlay. @cindex scalability of overlays +@cindex overlays, scalability The visual effect of an overlay is the same as of the corresponding text property (@pxref{Text Properties}). However, due to a different implementation, overlays generally don't scale well (many operations @@ -1351,6 +1352,15 @@ and @var{end} must specify buffer positions; they may be integers or markers. If @var{buffer} is omitted, the overlay is created in the current buffer. +@cindex empty overlay +@cindex overlay, empty +An overlay whose @var{start} and @var{end} specify the same buffer +position is known as @dfn{empty}. A non-empty overlay can become +empty if the text between its @var{start} and @var{end} is deleted. +When that happens, the overlay is by default not deleted, but you can +cause it to be deleted by giving it the @samp{evaporate} property +(@pxref{Overlay Properties, evaporate property}). + The arguments @var{front-advance} and @var{rear-advance} specify the marker insertion type for the start of the overlay and for the end of the overlay, respectively. @xref{Marker Insertion Types}. If they @@ -1720,8 +1730,11 @@ line at display-time. @xref{Truncation}. @kindex evaporate @r{(overlay property)} If this property is non-@code{nil}, the overlay is deleted automatically if it becomes empty (i.e., if its length becomes zero). If you give -an empty overlay a non-@code{nil} @code{evaporate} property, that deletes -it immediately. +an empty overlay (@pxref{Managing Overlays, empty overlay}) a +non-@code{nil} @code{evaporate} property, that deletes it immediately. +Note that, unless an overlay has this property, it will not be deleted +when the text between its starting and ending positions is deleted +from the buffer. @item keymap @cindex keymap of character (and overlays) @@ -1777,10 +1790,10 @@ overlays that specify property @var{prop} for the character at point: This function returns a list of the overlays that overlap the region @var{beg} through @var{end}. ``Overlap'' means that at least one character is contained within the overlay and also contained within the -specified region; however, empty overlays are included in the result if -they are located at @var{beg}, strictly between @var{beg} and @var{end}, -or at @var{end} when @var{end} denotes the position at the end of the -buffer. +specified region; however, empty overlays (@pxref{Managing Overlays, +empty overlay}) are included in the result if they are located at +@var{beg}, strictly between @var{beg} and @var{end}, or at @var{end} +when @var{end} denotes the position at the end of the buffer. @end defun @defun next-overlay-change pos