commit 659609d1820129217e8c4526b629feddf3416767 (HEAD, refs/remotes/origin/master) Author: Fabián Ezequiel Gallina Date: Sun Apr 12 22:43:44 2015 -0300 python.el: Keep symmetry on sexp navigation with parens Fixes: debbugs:19954 * lisp/progmodes/python.el (python-nav--forward-sexp): Add argument skip-parens-p. (python-nav-forward-sexp, python-nav-backward-sexp) (python-nav-forward-sexp-safe) (python-nav-backward-sexp-safe): Use it. * test/automated/python-tests.el (python-nav-forward-sexp-1): Fix test. diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 856ed32..c9774a1 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -1580,11 +1580,13 @@ forward only one sexp, else move backwards." (while (and (funcall search-fn paren-regexp nil t) (python-syntax-context 'paren))))))) -(defun python-nav--forward-sexp (&optional dir safe) +(defun python-nav--forward-sexp (&optional dir safe skip-parens-p) "Move to forward sexp. With positive optional argument DIR direction move forward, else backwards. When optional argument SAFE is non-nil do not throw -errors when at end of sexp, skip it instead." +errors when at end of sexp, skip it instead. With optional +argument SKIP-PARENS-P force sexp motion to ignore parenthised +expressions when looking at them in either direction." (setq dir (or dir 1)) (unless (= dir 0) (let* ((forward-p (if (> dir 0) @@ -1596,11 +1598,13 @@ errors when at end of sexp, skip it instead." ;; Inside of a string, get out of it. (let ((forward-sexp-function)) (forward-sexp dir))) - ((or (eq context-type 'paren) - (and forward-p (looking-at (python-rx open-paren))) - (and (not forward-p) - (eq (syntax-class (syntax-after (1- (point)))) - (car (string-to-syntax ")"))))) + ((and (not skip-parens-p) + (or (eq context-type 'paren) + (if forward-p + (eq (syntax-class (syntax-after (point))) + (car (string-to-syntax "("))) + (eq (syntax-class (syntax-after (1- (point)))) + (car (string-to-syntax ")")))))) ;; Inside a paren or looking at it, lisp knows what to do. (if safe (python-nav--lisp-forward-sexp-safe dir) @@ -1636,7 +1640,7 @@ errors when at end of sexp, skip it instead." (cond ((and (not (eobp)) (python-info-current-line-empty-p)) (python-util-forward-comment dir) - (python-nav--forward-sexp dir)) + (python-nav--forward-sexp dir safe skip-parens-p)) ((eq context 'block-start) (python-nav-end-of-block)) ((eq context 'statement-start) @@ -1656,7 +1660,7 @@ errors when at end of sexp, skip it instead." (cond ((and (not (bobp)) (python-info-current-line-empty-p)) (python-util-forward-comment dir) - (python-nav--forward-sexp dir)) + (python-nav--forward-sexp dir safe skip-parens-p)) ((eq context 'block-end) (python-nav-beginning-of-block)) ((eq context 'statement-end) @@ -1674,47 +1678,69 @@ errors when at end of sexp, skip it instead." (python-nav-beginning-of-statement)) (t (goto-char next-sexp-pos)))))))))) -(defun python-nav-forward-sexp (&optional arg) +(defun python-nav-forward-sexp (&optional arg safe skip-parens-p) "Move forward across expressions. With ARG, do it that many times. Negative arg -N means move -backward N times." +backward N times. When optional argument SAFE is non-nil do not +throw errors when at end of sexp, skip it instead. With optional +argument SKIP-PARENS-P force sexp motion to ignore parenthised +expressions when looking at them in either direction (forced to t +in interactive calls)." (interactive "^p") (or arg (setq arg 1)) + ;; Do not follow parens on interactive calls. This hack to detect + ;; if the function was called interactively copes with the way + ;; `forward-sexp' works by calling `forward-sexp-function', losing + ;; interactive detection by checking `current-prefix-arg'. The + ;; reason to make this distinction is that lisp functions like + ;; `blink-matching-open' get confused causing issues like the one in + ;; Bug#16191. With this approach the user gets a simmetric behavior + ;; when working interactively while called functions expecting + ;; paren-based sexp motion work just fine. + (or + skip-parens-p + (setq skip-parens-p + (memq real-this-command + (list + #'forward-sexp #'backward-sexp + #'python-nav-forward-sexp #'python-nav-backward-sexp + #'python-nav-forward-sexp-safe #'python-nav-backward-sexp)))) (while (> arg 0) - (python-nav--forward-sexp 1) + (python-nav--forward-sexp 1 safe skip-parens-p) (setq arg (1- arg))) (while (< arg 0) - (python-nav--forward-sexp -1) + (python-nav--forward-sexp -1 safe skip-parens-p) (setq arg (1+ arg)))) -(defun python-nav-backward-sexp (&optional arg) +(defun python-nav-backward-sexp (&optional arg safe skip-parens-p) "Move backward across expressions. With ARG, do it that many times. Negative arg -N means move -forward N times." +forward N times. When optional argument SAFE is non-nil do not +throw errors when at end of sexp, skip it instead. With optional +argument SKIP-PARENS-P force sexp motion to ignore parenthised +expressions when looking at them in either direction (forced to t +in interactive calls)." (interactive "^p") (or arg (setq arg 1)) - (python-nav-forward-sexp (- arg))) + (python-nav-forward-sexp (- arg) safe skip-parens-p)) -(defun python-nav-forward-sexp-safe (&optional arg) +(defun python-nav-forward-sexp-safe (&optional arg skip-parens-p) "Move forward safely across expressions. With ARG, do it that many times. Negative arg -N means move -backward N times." +backward N times. With optional argument SKIP-PARENS-P force +sexp motion to ignore parenthised expressions when looking at +them in either direction (forced to t in interactive calls)." (interactive "^p") - (or arg (setq arg 1)) - (while (> arg 0) - (python-nav--forward-sexp 1 t) - (setq arg (1- arg))) - (while (< arg 0) - (python-nav--forward-sexp -1 t) - (setq arg (1+ arg)))) + (python-nav-forward-sexp arg t skip-parens-p)) -(defun python-nav-backward-sexp-safe (&optional arg) +(defun python-nav-backward-sexp-safe (&optional arg skip-parens-p) "Move backward safely across expressions. With ARG, do it that many times. Negative arg -N means move -forward N times." +forward N times. With optional argument SKIP-PARENS-P force sexp +motion to ignore parenthised expressions when looking at them in +either direction (forced to t in interactive calls)." (interactive "^p") - (or arg (setq arg 1)) - (python-nav-forward-sexp-safe (- arg))) + (python-nav-backward-sexp arg t skip-parens-p)) (defun python-nav--up-list (&optional dir) "Internal implementation of `python-nav-up-list'. diff --git a/test/automated/python-tests.el b/test/automated/python-tests.el index 47264c3..ae4323b 100644 --- a/test/automated/python-tests.el +++ b/test/automated/python-tests.el @@ -1998,19 +1998,36 @@ c() (should (save-excursion (beginning-of-line) (looking-at "c()"))) - ;; Movement next to a paren should do what lisp does and - ;; unfortunately It can't change, because otherwise - ;; `blink-matching-open' breaks. + ;; The default behavior when next to a paren should do what lisp + ;; does and, otherwise `blink-matching-open' breaks. (python-nav-forward-sexp -1) (should (looking-at "()")) (should (save-excursion (beginning-of-line) (looking-at "c()"))) - (python-nav-forward-sexp -1) + (end-of-line) + ;; Skipping parens should jump to `bolp' + (python-nav-forward-sexp -1 nil t) (should (looking-at "c()")) + (forward-line -1) + (end-of-line) + ;; b() + (python-nav-forward-sexp -1) + (should (looking-at "()")) (python-nav-forward-sexp -1) (should (looking-at "b()")) + (end-of-line) + (python-nav-forward-sexp -1 nil t) + (should (looking-at "b()")) + (forward-line -1) + (end-of-line) + ;; a() (python-nav-forward-sexp -1) + (should (looking-at "()")) + (python-nav-forward-sexp -1) + (should (looking-at "a()")) + (end-of-line) + (python-nav-forward-sexp -1 nil t) (should (looking-at "a()")))) (ert-deftest python-nav-forward-sexp-2 () commit ed28ca4c2429059608178d3d477dd169aae1f476 Author: João Távora Date: Sun Apr 12 23:23:44 2015 +0100 Don't use `setq-local' in Gnus code This might break upstream builds with older Emacsen * lisp/gnus/message.el (message-mode): Use `set' and `make-local-variable' instead of `setq-local'. diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index b1bee65..3dc2908 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -3092,8 +3092,8 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." ;; `electric-pair-mode', and C-M-* navigation by syntactically ;; excluding citations and other artifacts. ;; - (setq-local syntax-propertize-function 'message--syntax-propertize) - (setq-local parse-sexp-ignore-comments t)) + (set (make-local-variable 'syntax-propertize-function) 'message--syntax-propertize) + (set (make-local-variable 'parse-sexp-ignore-comments) t)) (defun message-setup-fill-variables () "Setup message fill variables." commit 3a4d0782520eab6c6466d640a4a261174f58ac19 Author: Paul Eggert Date: Sun Apr 12 15:21:08 2015 -0700 Update Makefile.in's .PHONY dependencies * Makefile.in (change-history-commit, master-branch-is-current) (no-ChangeLog): Now phony. diff --git a/Makefile.in b/Makefile.in index 0830dda..8a45f2c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1087,10 +1087,13 @@ bootstrap: bootstrap-clean $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile $(MAKE) all +.PHONY: ChangeLog change-history change-history-commit +.PHONY: master-branch-is-current no-ChangeLog unchanged-history-files + # The newest revision that should not appear in the generated ChangeLog. gen_origin = 3311ace9c54a50b83a838e2eb7fa9565176e0c4f + # Convert git commit log to ChangeLog file. make-dist uses this. -.PHONY: ChangeLog change-history unchanged-history-files ChangeLog: $(AM_V_GEN)distprefix=$(distprefix) srcprefix=$(srcdir)/ \ $(srcdir)/build-aux/gitlog-to-emacslog $(gen_origin) commit 9d7afc0cccff429587970a9350639bffd3c6c66e Author: Paul Eggert Date: Sun Apr 12 14:55:38 2015 -0700 Remove configure's --with-mmdf option * configure.ac (MAIL_USE_MMDF): Remove. * etc/NEWS: Document this. * lib-src/movemail.c: Assume MAIL_USE_MMDF is not defined. Fixes: bug#20308 diff --git a/configure.ac b/configure.ac index d692530..858cf78 100644 --- a/configure.ac +++ b/configure.ac @@ -269,11 +269,6 @@ if test "$with_hesiod" != no; then AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.]) fi -OPTION_DEFAULT_OFF([mmdf],[support MMDF mailboxes]) -if test "$with_mmdf" != no; then - AC_DEFINE(MAIL_USE_MMDF, 1, [Define to support MMDF mailboxes in movemail.]) -fi - OPTION_DEFAULT_OFF([mail-unlink],[unlink, rather than empty, mail spool after reading]) if test "$with_mail_unlink" != no; then AC_DEFINE(MAIL_UNLINK_SPOOL, 1, [Define to unlink, rather than empty, mail spool after reading.]) diff --git a/etc/NEWS b/etc/NEWS index 8ee6db6..e78a591 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -40,9 +40,16 @@ or by sticking with Emacs 24.4. If gnustep-config is not available, the old heuristics are used. --- -** The configure option `--with-pkg-config-prog' has been removed. +** The configure option '--with-pkg-config-prog' has been removed. Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to. +--- +** The configure option '--with-mmdf' has been removed. +It was no longer useful, as it relied on libraries that are no longer +supported, and its presence led to confusion during configuration. +This affects only the 'movemail' utility; Emacs itself can still +process MMDF-format files as before. + ** The configure option '--enable-silent-rules' is now the default, and silent rules are now quieter. To get the old behavior where 'make' chatters a lot, configure with '--disable-silent-rules' or diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 1618a69..231bc22 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -115,13 +115,9 @@ along with GNU Emacs. If not, see . */ #define MAIL_USE_SYSTEM_LOCK #endif -#ifdef MAIL_USE_MMDF -extern int lk_open (), lk_close (); -#endif - -#if !defined (MAIL_USE_SYSTEM_LOCK) && !defined (MAIL_USE_MMDF) && \ - (defined (HAVE_LIBMAIL) || defined (HAVE_LIBLOCKFILE)) && \ - defined (HAVE_MAILLOCK_H) +#if (!defined MAIL_USE_SYSTEM_LOCK \ + && (defined HAVE_LIBMAIL || defined HAVE_LIBLOCKFILE) \ + && defined HAVE_MAILLOCK_H) #include /* We can't use maillock unless we know what directory system mail files appear in. */ @@ -144,8 +140,7 @@ static bool mbx_delimit_end (FILE *); #endif #if (defined MAIL_USE_MAILLOCK \ - || (!defined DISABLE_DIRECT_ACCESS && !defined MAIL_USE_MMDF \ - && !defined MAIL_USE_SYSTEM_LOCK)) + || (!defined DISABLE_DIRECT_ACCESS && !defined MAIL_USE_SYSTEM_LOCK)) /* Like malloc but get fatal error if memory is exhausted. */ static void * @@ -229,10 +224,6 @@ main (int argc, char **argv) inname = argv[optind]; outname = argv[optind+1]; -#ifdef MAIL_USE_MMDF - mmdf_init (argv[0]); -#endif - if (*outname == 0) fatal ("Destination file name is empty", 0, 0); @@ -256,7 +247,6 @@ main (int argc, char **argv) char *lockname = 0; -#ifndef MAIL_USE_MMDF #ifndef MAIL_USE_SYSTEM_LOCK #ifdef MAIL_USE_MAILLOCK spool_name = mail_spool_name (inname); @@ -335,7 +325,6 @@ main (int argc, char **argv) delete_lockname = lockname; } #endif /* not MAIL_USE_SYSTEM_LOCK */ -#endif /* not MAIL_USE_MMDF */ #ifdef SIGCHLD signal (SIGCHLD, SIG_DFL); @@ -356,15 +345,11 @@ main (int argc, char **argv) if (setuid (getuid ()) < 0 || setregid (-1, real_gid) < 0) fatal ("Failed to drop privileges", 0, 0); -#ifndef MAIL_USE_MMDF #ifdef MAIL_USE_SYSTEM_LOCK indesc = open (inname, O_RDWR | O_BINARY); #else /* if not MAIL_USE_SYSTEM_LOCK */ indesc = open (inname, O_RDONLY | O_BINARY); #endif /* not MAIL_USE_SYSTEM_LOCK */ -#else /* MAIL_USE_MMDF */ - indesc = lk_open (inname, O_RDONLY | O_BINARY, 0, 0, 10); -#endif /* MAIL_USE_MMDF */ if (indesc < 0) pfatal_with_name (inname); @@ -474,11 +459,7 @@ main (int argc, char **argv) } #endif /* MAIL_USE_SYSTEM_LOCK */ -#ifdef MAIL_USE_MMDF - lk_close (indesc, 0, 0, 0); -#else close (indesc); -#endif #ifndef MAIL_USE_SYSTEM_LOCK if (! preserve_mail) commit 30bcb238c3a53f777c2a4952f51a68df6272cff4 Author: Paul Eggert Date: Sun Apr 12 11:26:50 2015 -0700 * doc/man/ChangeLog.01: Rename from doc/man/ChangeLog.1. That way, 'make install' won't think it's a man page. Reported by Ashish SHUKLA in: http://lists.gnu.org/archive/html/emacs-devel/2015-04/msg00656.html diff --git a/doc/man/ChangeLog.01 b/doc/man/ChangeLog.01 new file mode 100644 index 0000000..205e9b9 --- /dev/null +++ b/doc/man/ChangeLog.01 @@ -0,0 +1,194 @@ +2014-12-14 Glenn Morris + + * grep-changelog.1: Remove file. + +2014-11-10 Glenn Morris + + * emacs.1.in: Rename from emacs.1. + +2014-10-20 Glenn Morris + + * Merge in all changes up to 24.4 release. + +2014-09-29 Eli Zaretskii + + * emacs.1: Bump version to 25.0.50. + +2014-01-12 Glenn Morris + + * emacs.1: Replace reference to etc/MAILINGLISTS. + +2014-01-09 Glenn Morris + + * emacs.1: Refer to online service directory rather than etc/SERVICE. + +2013-08-31 Ulrich Müller + + * emacs.1: Update manual links. + +2013-04-20 Petr Hracek (tiny change) + + * emacs.1: Add some more command-line options. (Bug#14165) + +2012-12-02 Kevin Ryde + + * etags.1: Mention effect of --declarations in Lisp. + +2012-06-03 Glenn Morris + + * rcs-checkin.1: Remove. + +2012-04-07 Glenn Morris + + * emacs.1: Bump version to 24.1.50. + +2011-11-16 Juanma Barranquero + + * etags.1: Fix typo. + +2011-10-06 Chong Yidong + + * emacsclient.1: Document how -a "" starts the daemon. + +2011-09-17 Sven Joachim + + * emacs.1: Escape a dash. + +2011-07-12 Chong Yidong + + * emacsclient.1: Document exit status. + +2011-06-25 Andreas Rottmann + + * emacsclient.1: Mention --frame-parameters. + +2011-03-07 Chong Yidong + + * Version 23.3 released. + +2011-01-02 Jari Aalto + + * emacsclient.1: Arrange options alphabetically (Bug#7620). + +2010-10-12 Glenn Morris + + * emacs.1: Small fixes. + +2010-10-12 Ulrich Mueller + + * emacs.1: Update license description. + +2010-10-09 Glenn Morris + + * b2m.1: Remove file. + +2010-09-25 Ulrich Mueller + + * etags.1: xz compression is now supported. + +2010-08-26 Sven Joachim + + * emacs.1: Mention "maximized" value for the "fullscreen" X resource. + +2010-05-07 Chong Yidong + + * Version 23.2 released. + +2010-03-10 Chong Yidong + + * Branch for 23.2. + +2010-01-09 Chong Yidong + + * emacs.1: Copyedits. Update options -Q, -mm and --daemon. + Remove deprecated --unibyte option. + +2009-06-21 Chong Yidong + + * Branch for 23.1. + +2009-01-31 Glenn Morris + + * b2m.1: Minor fixes. + +2008-12-14 Dan Nicolaescu + + * ebrowse.1: Fix typos. Add more to the "SEE ALSO" section. + +2008-12-14 Glenn Morris + + * emacs.1: Fix MAILINGLISTS (default) location. + +2008-12-13 Glenn Morris + + * b2m.1: New file. Basic man-page. + + * grep-changelog.1: New file. Basic man-page, largely constructed from + program --help output. + + * rcs-checkin.1: New file. Basic man-page, largely from script + commentary. + + * ebrowse.1: Fix "emacsclient" typo. Replace problematic character. + Add some formatting. Add permissions notice. + + * emacs.1: Remove initial copyright comment, just refer to COPYING + section, merge years. + + * etags.1: Don't duplicate copyright info in initial comment, + just refer to COPYING section. + +2008-12-10 Dan Nicolaescu + + * ebrowse.1: New file, mostly just the results of --help in man format. + + * emacsclient.1: Describe what an empty string argument does for + --alternate-editor. + +2008-11-27 Dan Nicolaescu + + * emacsclient.1: Mention -nw and -c. Fix the character for --help. + Swap the order of -e and -n to follow the order displayed by --help. + +2008-03-13 Glenn Morris + + * emacs.1: Fix Emacs version. + +2008-01-08 Glenn Morris + + * emacs.1: Update Emacs version. + +2007-11-22 Francesco Potortì + + * etags.1: Ctags and Etags now share the same defaults, so remove + --defines, --globals, --members, --typedefs, --typedefs-and-c++. + +2007-11-15 Francesco Potortì + + * etags.1: Note that you can use "-" for stdout with -o. + +2007-09-06 Glenn Morris + + * ctags.1, emacs.1, emacsclient.1, etags.1: Move from etc/ to + doc/man/. + +;; Local Variables: +;; coding: utf-8 +;; End: + + Copyright (C) 2007-2015 Free Software Foundation, Inc. + + 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. + + 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 GNU Emacs. If not, see . diff --git a/doc/man/ChangeLog.1 b/doc/man/ChangeLog.1 deleted file mode 100644 index 205e9b9..0000000 --- a/doc/man/ChangeLog.1 +++ /dev/null @@ -1,194 +0,0 @@ -2014-12-14 Glenn Morris - - * grep-changelog.1: Remove file. - -2014-11-10 Glenn Morris - - * emacs.1.in: Rename from emacs.1. - -2014-10-20 Glenn Morris - - * Merge in all changes up to 24.4 release. - -2014-09-29 Eli Zaretskii - - * emacs.1: Bump version to 25.0.50. - -2014-01-12 Glenn Morris - - * emacs.1: Replace reference to etc/MAILINGLISTS. - -2014-01-09 Glenn Morris - - * emacs.1: Refer to online service directory rather than etc/SERVICE. - -2013-08-31 Ulrich Müller - - * emacs.1: Update manual links. - -2013-04-20 Petr Hracek (tiny change) - - * emacs.1: Add some more command-line options. (Bug#14165) - -2012-12-02 Kevin Ryde - - * etags.1: Mention effect of --declarations in Lisp. - -2012-06-03 Glenn Morris - - * rcs-checkin.1: Remove. - -2012-04-07 Glenn Morris - - * emacs.1: Bump version to 24.1.50. - -2011-11-16 Juanma Barranquero - - * etags.1: Fix typo. - -2011-10-06 Chong Yidong - - * emacsclient.1: Document how -a "" starts the daemon. - -2011-09-17 Sven Joachim - - * emacs.1: Escape a dash. - -2011-07-12 Chong Yidong - - * emacsclient.1: Document exit status. - -2011-06-25 Andreas Rottmann - - * emacsclient.1: Mention --frame-parameters. - -2011-03-07 Chong Yidong - - * Version 23.3 released. - -2011-01-02 Jari Aalto - - * emacsclient.1: Arrange options alphabetically (Bug#7620). - -2010-10-12 Glenn Morris - - * emacs.1: Small fixes. - -2010-10-12 Ulrich Mueller - - * emacs.1: Update license description. - -2010-10-09 Glenn Morris - - * b2m.1: Remove file. - -2010-09-25 Ulrich Mueller - - * etags.1: xz compression is now supported. - -2010-08-26 Sven Joachim - - * emacs.1: Mention "maximized" value for the "fullscreen" X resource. - -2010-05-07 Chong Yidong - - * Version 23.2 released. - -2010-03-10 Chong Yidong - - * Branch for 23.2. - -2010-01-09 Chong Yidong - - * emacs.1: Copyedits. Update options -Q, -mm and --daemon. - Remove deprecated --unibyte option. - -2009-06-21 Chong Yidong - - * Branch for 23.1. - -2009-01-31 Glenn Morris - - * b2m.1: Minor fixes. - -2008-12-14 Dan Nicolaescu - - * ebrowse.1: Fix typos. Add more to the "SEE ALSO" section. - -2008-12-14 Glenn Morris - - * emacs.1: Fix MAILINGLISTS (default) location. - -2008-12-13 Glenn Morris - - * b2m.1: New file. Basic man-page. - - * grep-changelog.1: New file. Basic man-page, largely constructed from - program --help output. - - * rcs-checkin.1: New file. Basic man-page, largely from script - commentary. - - * ebrowse.1: Fix "emacsclient" typo. Replace problematic character. - Add some formatting. Add permissions notice. - - * emacs.1: Remove initial copyright comment, just refer to COPYING - section, merge years. - - * etags.1: Don't duplicate copyright info in initial comment, - just refer to COPYING section. - -2008-12-10 Dan Nicolaescu - - * ebrowse.1: New file, mostly just the results of --help in man format. - - * emacsclient.1: Describe what an empty string argument does for - --alternate-editor. - -2008-11-27 Dan Nicolaescu - - * emacsclient.1: Mention -nw and -c. Fix the character for --help. - Swap the order of -e and -n to follow the order displayed by --help. - -2008-03-13 Glenn Morris - - * emacs.1: Fix Emacs version. - -2008-01-08 Glenn Morris - - * emacs.1: Update Emacs version. - -2007-11-22 Francesco Potortì - - * etags.1: Ctags and Etags now share the same defaults, so remove - --defines, --globals, --members, --typedefs, --typedefs-and-c++. - -2007-11-15 Francesco Potortì - - * etags.1: Note that you can use "-" for stdout with -o. - -2007-09-06 Glenn Morris - - * ctags.1, emacs.1, emacsclient.1, etags.1: Move from etc/ to - doc/man/. - -;; Local Variables: -;; coding: utf-8 -;; End: - - Copyright (C) 2007-2015 Free Software Foundation, Inc. - - 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. - - 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 GNU Emacs. If not, see . commit 950c0027cb4018c79d8f429007920ac279431cd4 Author: Paul Eggert Date: Sun Apr 12 10:21:59 2015 -0700 Improve 'make change-history' prereq tests * Makefile.in (gen_origin): Fix to match what's in the master branch. (no-ChangeLog, master-branch-is-current): New rules. (change-history): Depend on them, to avoid similar future problems. Escape the local-variables string to pacify Emacs when editing Makefile.in. diff --git a/Makefile.in b/Makefile.in index 9f235d5..0830dda 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1088,7 +1088,7 @@ bootstrap: bootstrap-clean $(MAKE) all # The newest revision that should not appear in the generated ChangeLog. -gen_origin = 2cdbb8983dd49ce5c31c74b26f740bcb3e5a4c5d +gen_origin = 3311ace9c54a50b83a838e2eb7fa9565176e0c4f # Convert git commit log to ChangeLog file. make-dist uses this. .PHONY: ChangeLog change-history unchanged-history-files ChangeLog: @@ -1101,16 +1101,20 @@ ChangeLog: CHANGELOG_HISTORY_INDEX_MAX = 1 CHANGELOG_N = ChangeLog.$(CHANGELOG_HISTORY_INDEX_MAX) -# Check that history-relevant files match what's in the repository. -# Otherwise, 'make change-history' might mess up the ChangeLog history files. +# Check that we are in a good state for changing history. +no-ChangeLog: + test ! -f ChangeLog +master-branch-is-current: + git branch | grep -q '^\* master$$' unchanged-history-files: x=$$(git diff-files --name-only $(CHANGELOG_N) Makefile.in) && \ test -z "$$x" # Copy newer commit messages to the start of the ChangeLog history file, # and consider them to be older. -change-history: ChangeLog unchanged-history-files - (sed '/^;; Local Variables:/,$$d' $(CHANGELOG_N).tmp new_origin=$$(git log --pretty=format:%H HEAD^!) && \ sed 's/^\(gen_origin *= *\).*/\1'"$$new_origin/" \ commit fe3b5b3f4599fb607ef03a99080b189464531da7 Author: Artur Malabarba Date: Sun Apr 12 16:10:22 2015 +0100 * test/automated/package-test.el (with-package-test): Kill Packages buffer diff --git a/test/automated/package-test.el b/test/automated/package-test.el index 2fbcfd0..4385ee0 100644 --- a/test/automated/package-test.el +++ b/test/automated/package-test.el @@ -125,6 +125,9 @@ '((package-test-archive-upload-base (make-temp-file "pkg-archive-base-" t)) (package-archive-upload-base package-test-archive-upload-base)) (list (cl-gensym)))) ;; Dummy value so `let' doesn't try to bind `nil' + (let ((buf (get-buffer "*Packages*"))) + (when (buffer-live-p buf) + (kill-buffer buf))) (unwind-protect (progn ,(if basedir `(cd ,basedir)) commit e99d8cb25db2d1306be011ecccd85845e41ccec8 Author: Artur Malabarba Date: Sun Apr 12 15:11:08 2015 +0100 * lisp/emacs-lisp/package.el: Improve transaction y-or-n prompt (package-menu--prompt-transaction-p): Prompt for "Delete" first, "Upgrade" last, and use capitalized instead of all-caps. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 92d71ba..6fb5ba4 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2780,15 +2780,15 @@ nil, but not both." (del (cl-set-difference delete upg :key #'package-desc-name))) (y-or-n-p (concat - (when upg "UPGRADE ") - (package-menu--list-to-prompt upg) - (when (and upg ins) - (if del "; " "; and ")) - (when ins "INSTALL ") - (package-menu--list-to-prompt ins) - (when (and del (or ins upg)) "; and ") - (when del "DELETE ") + (when del "Delete ") (package-menu--list-to-prompt del) + (when (and del ins) + (if upg "; " "; and ")) + (when ins "Install ") + (package-menu--list-to-prompt ins) + (when (and upg (or ins del)) "; and ") + (when upg "Upgrade ") + (package-menu--list-to-prompt upg) "? ")))) (defun package-menu--perform-transaction (install-list delete-list &optional async) commit 5aa0dfe4b73c0ef1a8462410265a29c55e244879 Author: Artur Malabarba Date: Sun Apr 12 15:03:45 2015 +0100 * lisp/emacs-lisp/package.el: Completely silence async operations (package--make-autoloads-and-stuff): Silence autoloads. (package--save-selected-packages): New function, silences `customize-save-variable'. (package--user-selected-p, package-install-from-buffer) (package-delete, package-install): Use it. (package-install-from-archive) (package-menu--perform-transaction): Silence. (package-menu-execute): Feedback when operation starts. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index bdb2cc0..92d71ba 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -866,6 +866,8 @@ untar into a directory named DIR; otherwise, signal an error." (let* ((auto-name (format "%s-autoloads.el" name)) ;;(ignore-name (concat name "-pkg.el")) (generated-autoload-file (expand-file-name auto-name pkg-dir)) + ;; Silence `autoload-generate-file-autoloads'. + (noninteractive package--silence) (backup-inhibited t) (version-control 'never)) (package-autoload-ensure-default-file generated-autoload-file) @@ -1573,15 +1575,20 @@ Used to populate `package-selected-packages'." unless (memq name dep-list) collect name))) +(defun package--save-selected-packages (value) + "Set and save `package-selected-packages' to VALUE." + (let ((save-silently package--silence)) + (customize-save-variable + 'package-selected-packages + (setq package-selected-packages value)))) + (defun package--user-selected-p (pkg) "Return non-nil if PKG is a package was installed by the user. PKG is a package name. This looks into `package-selected-packages', populating it first if it is still empty." (unless (consp package-selected-packages) - (customize-save-variable - 'package-selected-packages - (setq package-selected-packages (package--find-non-dependencies)))) + (package--save-selected-packages (package--find-non-dependencies))) (memq pkg package-selected-packages)) (defun package--get-deps (pkg &optional only) @@ -1691,7 +1698,8 @@ operation is done." package-unsigned-archives)) ;; If we don't care about the signature, unpack and we're ;; done. - (progn (package-unpack pkg-desc) + (progn (let ((save-silently async)) + (package-unpack pkg-desc)) (funcall callback)) ;; If we care, check it and *then* write the file. (let ((content (buffer-string))) @@ -1706,7 +1714,8 @@ operation is done." (package-desc-name pkg-desc))) ;; Signature checked, unpack now. (with-temp-buffer (insert content) - (package-unpack pkg-desc)) + (let ((save-silently async)) + (package-unpack pkg-desc))) ;; Here the package has been installed successfully, mark it as ;; signed if appropriate. (when good-sigs @@ -1833,8 +1842,8 @@ to install it but still mark it as selected." (package-desc-name pkg) pkg))) (unless (or dont-select (package--user-selected-p name)) - (customize-save-variable 'package-selected-packages - (cons name package-selected-packages)))) + (package--save-selected-packages + (cons name package-selected-packages)))) (if-let ((transaction (if (package-desc-p pkg) (unless (package-installed-p pkg) @@ -1891,8 +1900,8 @@ Downloads and installs required packages as needed." ;; Install the package itself. (package-unpack pkg-desc) (unless (package--user-selected-p name) - (customize-save-variable 'package-selected-packages - (cons name package-selected-packages))) + (package--save-selected-packages + (cons name package-selected-packages))) pkg-desc)) ;;;###autoload @@ -1959,8 +1968,7 @@ If NOSAVE is non-nil, the package is not removed from ;; Don't deselect if this is an older version of an ;; upgraded package. (package--newest-p pkg-desc)) - (customize-save-variable - 'package-selected-packages (remove name package-selected-packages))) + (package--save-selected-packages (remove name package-selected-packages))) (cond ((not (string-prefix-p (file-name-as-directory (expand-file-name package-user-dir)) (expand-file-name dir))) @@ -2802,15 +2810,17 @@ asynchronously." (lambda () (package-menu--perform-transaction rest delete-list async)))) ;; Once there are no more packages to install, proceed to ;; deletion. - (dolist (elt (package--sort-by-dependence delete-list)) - (condition-case-unless-debug err - (package-delete elt) - (error (message (cadr err))))) - (when package-selected-packages - (when-let ((removable (package--removable-packages))) - (package--message "These %d packages are no longer needed, type `M-x package-autoremove' to remove them (%s)" - (length removable) - (mapconcat #'symbol-name removable ", ")))) + (let ((package--silence async)) + (dolist (elt (package--sort-by-dependence delete-list)) + (condition-case-unless-debug err + (package-delete elt) + (error (message (cadr err))))) + (when package-selected-packages + (when-let ((removable (package--removable-packages))) + (package--message "These %d packages are no longer needed, type `M-x package-autoremove' to remove them (%s)" + (length removable) + (mapconcat #'symbol-name removable ", "))))) + (message "Transaction done") (package-menu--post-refresh))) (defun package-menu-execute (&optional noquery) @@ -2838,10 +2848,10 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." (user-error "No operations specified")) (when (or noquery (package-menu--prompt-transaction-p install-list delete-list)) - (let ((package--silence package-menu-async)) - ;; This calls `package-menu--generate' after everything's done. - (package-menu--perform-transaction - install-list delete-list package-menu-async))))) + (message "Transaction started") + ;; This calls `package-menu--generate' after everything's done. + (package-menu--perform-transaction + install-list delete-list package-menu-async)))) (defun package-menu--version-predicate (A B) (let ((vA (or (aref (cadr A) 1) '(0))) commit dfdd7e19446d5fbdbf2211d5ef80ac34655b9f30 Author: Artur Malabarba Date: Sun Apr 12 14:37:45 2015 +0100 Use delay-mode-hooks when visiting the init-file * lisp/emacs-lisp/package.el (package--ensure-init-file): delay-mode-hooks * lisp/cus-edit.el (custom-save-all): delay-mode-hooks diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index f56fb6a..9cc2fa8 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4406,7 +4406,9 @@ if only the first line of the docstring is shown.")) old-buffer-name) (with-current-buffer (let ((find-file-visit-truename t)) - (or old-buffer (find-file-noselect filename))) + (or old-buffer + (let ((delay-mode-hooks t)) + (find-file-noselect filename)))) ;; We'll save using file-precious-flag, so avoid destroying ;; symlinks. (If we're not already visiting the buffer, this is ;; handled by find-file-visit-truename, above.) @@ -4415,7 +4417,7 @@ if only the first line of the docstring is shown.")) (set-visited-file-name (file-chase-links filename))) (unless (eq major-mode 'emacs-lisp-mode) - (emacs-lisp-mode)) + (delay-mode-hooks (emacs-lisp-mode))) (let ((inhibit-read-only t) (print-length nil) (print-level nil)) diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ded2faa..bdb2cc0 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1778,7 +1778,9 @@ using `package-compute-transaction'." (goto-char (point-min)) (search-forward "(package-initialize)" nil 'noerror))))) (unless contains-init - (with-current-buffer (or buffer (find-file-noselect user-init-file)) + (with-current-buffer (or buffer + (let ((delay-mode-hooks t)) + (find-file-noselect user-init-file))) (save-excursion (save-restriction (widen) commit 5fb807efcd6dda113c0cfade9811070e45c36a2f Author: Artur Malabarba Date: Sun Apr 12 14:36:54 2015 +0100 * lisp/files.el: Only message when saving if save-silently is nil (save-silently): New variable. (files--message): New function. (find-file-noselect, save-buffer, basic-save-buffer) (basic-save-buffer-2, save-some-buffers, not-modified) (append-to-file): Use them. diff --git a/lisp/files.el b/lisp/files.el index 7a66259..5ef7318 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -573,6 +573,12 @@ using \\[read-only-mode]." Maximum length of the history list is determined by the value of `history-length', which see.") + +(defvar save-silently nil + "If non-nil, avoid messages when saving files. +Error-related messages will still be printed, but all other +messages will not.") + (put 'ange-ftp-completion-hook-function 'safe-magic t) (defun ange-ftp-completion-hook-function (op &rest args) @@ -1865,6 +1871,13 @@ If that fails, try to open it with `find-file-literally' out-of-memory-warning-percentage (file-size-human-readable (* total-free-memory 1024))))))))) +(defun files--message (format &rest args) + "Like `message', except sometimes don't print to minibuffer. +If the variable `save-silently' is non-nil, the message is not +displayed on the minibuffer." + (apply #'message format args) + (when save-silently (message nil))) + (defun find-file-noselect (filename &optional nowarn rawfile wildcards) "Read file FILENAME into a buffer and return the buffer. If a buffer exists visiting FILENAME, return that one, but @@ -1910,8 +1923,8 @@ the various files." (or nowarn find-file-suppress-same-file-warnings (string-equal filename (buffer-file-name other)) - (message "%s and %s are the same file" - filename (buffer-file-name other))) + (files--message "%s and %s are the same file" + filename (buffer-file-name other))) ;; Optionally also find that buffer. (if (or find-file-existing-other-name find-file-visit-truename) (setq buf other)))) @@ -4641,7 +4654,10 @@ See the subroutine `basic-save-buffer' for more information." ;; then Rmail-mbox never displays it due to buffer swapping. If ;; the test is ever re-introduced, be sure to handle saving of ;; Rmail files. - (if (and modp (buffer-file-name) (not noninteractive)) + (if (and modp + (buffer-file-name) + (not noninteractive) + (not save-silently)) (message "Saving file %s..." (buffer-file-name))) (basic-save-buffer) (and modp (memq arg '(4 64)) (setq buffer-backed-up nil)))) @@ -4785,7 +4801,7 @@ Before and after saving the buffer, this function runs (run-hooks 'after-save-hook)) (or noninteractive (not (called-interactively-p 'any)) - (message "(No changes need to be saved)"))))) + (files--message "(No changes need to be saved)"))))) ;; This does the "real job" of writing a buffer into its visited file ;; and making a backup file. This is what is normally done @@ -4858,9 +4874,10 @@ Before and after saving the buffer, this function runs ;; Pass in nil&nil rather than point-min&max ;; cause we're saving the whole buffer. ;; write-region-annotate-functions may use it. - (write-region nil nil - tempname nil realname - buffer-file-truename 'excl) + (write-region nil nil + tempname nil realname + buffer-file-truename 'excl) + (when save-silently (message nil)) nil) (file-already-exists t)) ;; The file was somehow created by someone else between @@ -4905,8 +4922,9 @@ Before and after saving the buffer, this function runs ;; Pass in nil&nil rather than point-min&max to indicate ;; we're saving the buffer rather than just a region. ;; write-region-annotate-functions may make us of it. - (write-region nil nil - buffer-file-name nil t buffer-file-truename) + (write-region nil nil + buffer-file-name nil t buffer-file-truename) + (when save-silently (message nil)) (setq success t)) ;; If we get an error writing the new file, and we made ;; the backup by renaming, undo the backing-up. @@ -5027,13 +5045,13 @@ change the additional actions you can take on files." (cond ((null autosaved-buffers) (when (called-interactively-p 'any) - (message "(No files need saving)"))) + (files--message "(No files need saving)"))) ((= (length autosaved-buffers) 1) - (message "(Saved %s)" (car autosaved-buffers))) + (files--message "(Saved %s)" (car autosaved-buffers))) (t - (message "(Saved %d files: %s)" - (length autosaved-buffers) - (mapconcat 'identity autosaved-buffers ", ")))))))) + (files--message "(Saved %d files: %s)" + (length autosaved-buffers) + (mapconcat 'identity autosaved-buffers ", ")))))))) (defun clear-visited-file-modtime () "Clear out records of last mod time of visited file. @@ -5048,8 +5066,8 @@ It is not a good idea to use this function in Lisp programs, because it prints a message in the minibuffer. Instead, use `set-buffer-modified-p'." (declare (interactive-only set-buffer-modified-p)) (interactive "P") - (message (if arg "Modification-flag set" - "Modification-flag cleared")) + (files--message (if arg "Modification-flag set" + "Modification-flag cleared")) (set-buffer-modified-p arg)) (defun toggle-read-only (&optional arg interactive) @@ -5083,7 +5101,8 @@ instead of any buffer contents; END is ignored. This does character code conversion and applies annotations like `write-region' does." (interactive "r\nFAppend to file: ") - (write-region start end filename t)) + (prog1 (write-region start end filename t) + (when save-silently (message nil)))) (defun file-newest-backup (filename) "Return most recent backup file for FILENAME or nil if no backups exist." commit 2e47de365b4dcec6781f6150cea977fa8d8a94f2 Author: Johan Bockgård Date: Sun Apr 12 16:26:52 2015 +0200 Support debug declarations in pcase macros * lisp/emacs-lisp/pcase.el (pcase-MACRO): New edebug spec. (pcase-UPAT): Use it. Remove "`". (pcase--edebug-match-macro): New function. (pcase-defmacro): Support debug declarations. * lisp/emacs-lisp/cl-macs.el (cl-struct) : * lisp/emacs-lisp/eieio.el (eieio) : * lisp/emacs-lisp/pcase.el (\`): : Add debug declaration. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 69f2792..41435b8 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2780,6 +2780,7 @@ non-nil value, that slot cannot be set via `setf'. Elements of FIELDS can be of the form (NAME UPAT) in which case the contents of field NAME is matched against UPAT, or they can be of the form NAME which is a shorthand for (NAME NAME)." + (declare (debug (sexp &rest [&or (sexp pcase-UPAT) sexp]))) `(and (pred (pcase--flip cl-typep ',type)) ,@(mapcar (lambda (field) diff --git a/lisp/emacs-lisp/eieio.el b/lisp/emacs-lisp/eieio.el index bca53c0..1114595 100644 --- a/lisp/emacs-lisp/eieio.el +++ b/lisp/emacs-lisp/eieio.el @@ -348,6 +348,7 @@ variable name of the same name as the slot." Elements of FIELDS can be of the form (NAME UPAT) in which case the contents of field NAME is matched against UPAT, or they can be of the form NAME which is a shorthand for (NAME NAME)." + (declare (debug (&rest [&or (sexp pcase-UPAT) sexp]))) (let ((is (make-symbol "table"))) ;; FIXME: This generates a horrendous mess of redundant let bindings. ;; `pcase' needs to be improved somehow to introduce let-bindings more diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index bbb278c..4960303 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -75,18 +75,11 @@ (&or symbolp ("or" &rest pcase-UPAT) ("and" &rest pcase-UPAT) - ("`" pcase-QPAT) ("guard" form) ("let" pcase-UPAT form) ("pred" pcase-FUN) ("app" pcase-FUN pcase-UPAT) - sexp)) - -(def-edebug-spec - pcase-QPAT - (&or ("," pcase-UPAT) - (pcase-QPAT . pcase-QPAT) - (vector &rest pcase-QPAT) + pcase-MACRO sexp)) (def-edebug-spec @@ -96,6 +89,18 @@ (functionp &rest form) sexp)) +(def-edebug-spec pcase-MACRO pcase--edebug-match-macro) + +(defun pcase--edebug-match-macro (cursor) + (let (specs) + (mapatoms + (lambda (s) + (let ((m (get s 'pcase-macroexpander))) + (when (and m (get-edebug-spec m)) + (push (cons (symbol-name s) (get-edebug-spec m)) + specs))))) + (edebug-match cursor (cons '&or specs)))) + ;;;###autoload (defmacro pcase (exp &rest cases) "Perform ML-style pattern matching on EXP. @@ -367,11 +372,14 @@ of the form (UPAT EXP)." (defmacro pcase-defmacro (name args &rest body) "Define a pcase UPattern macro." (declare (indent 2) (debug defun) (doc-string 3)) - (let ((fsym (intern (format "%s--pcase-macroexpander" name)))) - ;; Add the function via `fsym', so that an autoload cookie placed - ;; on a pcase-defmacro will cause the macro to be loaded on demand. + ;; Add the function via `fsym', so that an autoload cookie placed + ;; on a pcase-defmacro will cause the macro to be loaded on demand. + (let ((fsym (intern (format "%s--pcase-macroexpander" name))) + (decl (assq 'declare body))) + (when decl (setq body (remove decl body))) `(progn (defun ,fsym ,args ,@body) + (put ',fsym 'edebug-form-spec ',(cadr (assq 'debug decl))) (put ',name 'pcase-macroexpander #',fsym)))) (defun pcase--match (val upat) @@ -833,6 +841,13 @@ Otherwise, it defers to REST which is a list of branches of the form (t (error "Unknown internal pattern `%S'" upat))))) (t (error "Incorrect MATCH %S" (car matches))))) +(def-edebug-spec + pcase-QPAT + (&or ("," pcase-UPAT) + (pcase-QPAT . pcase-QPAT) + (vector &rest pcase-QPAT) + sexp)) + (pcase-defmacro \` (qpat) "Backquote-style pcase patterns. QPAT can take the following forms: @@ -842,6 +857,7 @@ QPAT can take the following forms: ,UPAT matches if the UPattern UPAT matches. STRING matches if the object is `equal' to STRING. ATOM matches if the object is `eq' to ATOM." + (declare (debug (pcase-QPAT))) (cond ((eq (car-safe qpat) '\,) (cadr qpat)) ((vectorp qpat) commit 66a53da5f0c15a1e69675e8157fbbc00a364bb80 Author: Johan Bockgård Date: Sun Apr 12 16:26:51 2015 +0200 pcase.el: Edebug support for `app' and vector patterns * lisp/emacs-lisp/pcase.el (pcase-FUN): New edebug spec. (pcase-UPAT): Use it. Support `app' patterns. (pcase-QPAT): Support vector patterns. diff --git a/lisp/emacs-lisp/pcase.el b/lisp/emacs-lisp/pcase.el index 3a2fa4f..bbb278c 100644 --- a/lisp/emacs-lisp/pcase.el +++ b/lisp/emacs-lisp/pcase.el @@ -78,17 +78,22 @@ ("`" pcase-QPAT) ("guard" form) ("let" pcase-UPAT form) - ("pred" - &or lambda-expr - ;; Punt on macros/special forms. - (functionp &rest form) - sexp) + ("pred" pcase-FUN) + ("app" pcase-FUN pcase-UPAT) sexp)) (def-edebug-spec pcase-QPAT (&or ("," pcase-UPAT) (pcase-QPAT . pcase-QPAT) + (vector &rest pcase-QPAT) + sexp)) + +(def-edebug-spec + pcase-FUN + (&or lambda-expr + ;; Punt on macros/special forms. + (functionp &rest form) sexp)) ;;;###autoload commit b62d7956bea87eba82a86bfeba2d637c7ef4016c Author: Johan Bockgård Date: Sun Apr 12 16:26:51 2015 +0200 edebug.el: Disambiguate vector specifications * lisp/emacs-lisp/edebug.el (edebug-match-list): Always treat `(vector ...)' as a vector specification, not as a sublist. diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index d0668bb..98fb7e9 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -1725,6 +1725,17 @@ expressions; a `progn' form will be returned enclosing these forms." (t (error "Bad spec: %s" specs))))) + ((eq 'vector spec) + (if (vectorp form) + ;; Special case: match a vector with the specs. + (let ((result (edebug-match-sublist + (edebug-new-cursor + form (cdr (edebug-top-offset cursor))) + (cdr specs)))) + (edebug-move-cursor cursor) + (list (apply 'vector result))) + (edebug-no-match cursor "Expected" specs))) + ((listp form) (prog1 (list (edebug-match-sublist @@ -1734,15 +1745,6 @@ expressions; a `progn' form will be returned enclosing these forms." specs)) (edebug-move-cursor cursor))) - ((and (eq 'vector spec) (vectorp form)) - ;; Special case: match a vector with the specs. - (let ((result (edebug-match-sublist - (edebug-new-cursor - form (cdr (edebug-top-offset cursor))) - (cdr specs)))) - (edebug-move-cursor cursor) - (list (apply 'vector result)))) - (t (edebug-no-match cursor "Expected" specs))) ))) commit f4dbec453dcf0586c2a7ac4b010ae12691bc215b Author: Johan Bockgård Date: Sun Apr 12 16:13:08 2015 +0200 (gnus-summary-refer-thread): Don't clobber unread articles This fixes a bug where `A T' causes "random" articles to become marked as read. * lisp/gnus/gnus-sum.el (gnus-summary-refer-thread): Make sure gnus-newsgroup-unreads remains sorted. diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c68d496..73a0d4b 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -9068,22 +9068,24 @@ non-numeric or nil fetch the number specified by the (regexp-opt ',(append refs (list id subject))))))) (gnus-fetch-headers (list last) (if (numberp limit) (* 2 limit) limit) t)))) - article-ids) + article-ids new-unreads) (when (listp new-headers) (dolist (header new-headers) - (push (mail-header-number header) article-ids) - (when (member (mail-header-number header) gnus-newsgroup-unselected) - (push (mail-header-number header) gnus-newsgroup-unreads) - (setq gnus-newsgroup-unselected - (delete (mail-header-number header) - gnus-newsgroup-unselected)))) + (push (mail-header-number header) article-ids)) + (setq article-ids (nreverse article-ids)) + (setq new-unreads + (gnus-sorted-intersection gnus-newsgroup-unselected article-ids)) + (setq gnus-newsgroup-unselected + (gnus-sorted-ndifference gnus-newsgroup-unselected new-unreads)) + (setq gnus-newsgroup-unreads + (gnus-sorted-nunion gnus-newsgroup-unreads new-unreads)) (setq gnus-newsgroup-headers (gnus-delete-duplicate-headers (gnus-merge 'list gnus-newsgroup-headers new-headers 'gnus-article-sort-by-number))) (setq gnus-newsgroup-articles - (gnus-sorted-nunion gnus-newsgroup-articles (nreverse article-ids))) + (gnus-sorted-nunion gnus-newsgroup-articles article-ids)) (gnus-summary-limit-include-thread id))) (gnus-summary-show-thread)) commit bda8469be55134d617f6a5409634758842fef15f Author: Johan Bockgård Date: Sun Apr 12 15:55:32 2015 +0200 mouse-sel.el: Fix mouse-sel-get-selection-function * lisp/obsolete/mouse-sel.el (mouse-sel-get-selection-function): Use gui--last-selected-text-primary instead of no longer existing gui-last-selected-text. diff --git a/lisp/obsolete/mouse-sel.el b/lisp/obsolete/mouse-sel.el index 25eb3e6..fcadedf 100644 --- a/lisp/obsolete/mouse-sel.el +++ b/lisp/obsolete/mouse-sel.el @@ -314,7 +314,7 @@ is `interprogram-cut-paste'.") (if (eq selection 'PRIMARY) (or (gui-selection-value) (bound-and-true-p x-last-selected-text-primary) - gui-last-selected-text) + gui--last-selected-text-primary) (x-get-selection selection))) "Function to call to get the selection. Called with one argument: commit a77540e77425cf51cc63de48eb12b27f4dea71e2 Author: Johan Bockgård Date: Sun Apr 12 15:50:02 2015 +0200 * lisp/rect.el (delete-whitespace-rectangle-line): Don't cross EOL. diff --git a/lisp/rect.el b/lisp/rect.el index 75585d2..acd3a48 100644 --- a/lisp/rect.el +++ b/lisp/rect.el @@ -346,7 +346,8 @@ no text on the right side of the rectangle." (defun delete-whitespace-rectangle-line (startcol _endcol fill) (when (= (move-to-column startcol (if fill t 'coerce)) startcol) (unless (= (point) (point-at-eol)) - (delete-region (point) (progn (skip-syntax-forward " ") (point)))))) + (delete-region (point) (progn (skip-syntax-forward " " (point-at-eol)) + (point)))))) ;;;###autoload (defalias 'close-rectangle 'delete-whitespace-rectangle) ;; Old name commit a3d11ecb83cab211c3ce6cb36f27d4c7e54712df Author: Johan Bockgård Date: Sun Apr 12 15:37:50 2015 +0200 * lisp/net/nsm.el (nsm-query-user): Use cursor-in-echo-area. diff --git a/lisp/net/nsm.el b/lisp/net/nsm.el index 2312e22..28253e5 100644 --- a/lisp/net/nsm.el +++ b/lisp/net/nsm.el @@ -308,6 +308,7 @@ unencrypted." (?s . session) (?a . always))) (prefix "") + (cursor-in-echo-area t) response) (while (not response) (setq response @@ -315,7 +316,7 @@ unencrypted." (assq (downcase (read-char (concat prefix - "Continue connecting? (No, Session only, Always)"))) + "Continue connecting? (No, Session only, Always) "))) responses))) (unless response (ding) commit d0fcb21254394e22542dbc350220db3bafe0cc13 Author: Artur Malabarba Date: Sun Apr 12 13:47:58 2015 +0100 * lisp/emacs-lisp/package.el (list-packages): Avoid redundant generate diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index dac70af..ded2faa 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2951,7 +2951,9 @@ The list is displayed in a buffer named `*Packages*'." ;; Fetch the remote list of packages. (unless no-fetch (package-menu-refresh)) - (package-menu--generate nil t)) + ;; If we're not async, this would be redundant. + (when package-menu-async + (package-menu--generate nil t))) ;; The package menu buffer has keybindings. If the user types ;; `M-x list-packages', that suggests it should become current. (switch-to-buffer buf))) commit d06eeb85e0445eddedc42480d9a0d9928eed357e Author: Artur Malabarba Date: Sun Apr 12 13:44:43 2015 +0100 * lisp/emacs-lisp/package.el (list-packages): Call refresh in right buffer diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index ad482e5..dac70af 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2943,13 +2943,14 @@ The list is displayed in a buffer named `*Packages*'." (add-hook 'package--post-download-archives-hook #'package-menu--post-refresh) - ;; Fetch the remote list of packages. - (unless no-fetch (package-menu-refresh)) - ;; Generate the Package Menu. (let ((buf (get-buffer-create "*Packages*"))) (with-current-buffer buf (package-menu-mode) + + ;; Fetch the remote list of packages. + (unless no-fetch (package-menu-refresh)) + (package-menu--generate nil t)) ;; The package menu buffer has keybindings. If the user types ;; `M-x list-packages', that suggests it should become current. commit 9a7ddde977378cb5276a81476ae458889c403267 Author: Artur Malabarba Date: Sun Apr 12 12:05:13 2015 +0100 * lisp/emacs-lisp/bytecomp.el: Silence noninteractive compilations (byte-compile--interactive): New var. (byte-compile--message): New function. (byte-compile-log-1, byte-force-recompile) (byte-recompile-directory, byte-recompile-file) (byte-compile-file, compile-defun) (byte-compile-file-form-defmumble, byte-compile) (byte-compile-file-form-defalias, display-call-tree): Use it. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index f0d2ee4..51bbf8a 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -979,6 +979,17 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x)) args)))))) +(defvar byte-compile--interactive nil + "Determine if `byte-compile--message' uses the minibuffer.") + +(defun byte-compile--message (format &rest args) + "Like `message', except sometimes don't print to minibuffer. +If the variable `byte-compile--interactive' is nil, the message +is not displayed on the minibuffer." + (apply #'message format args) + (unless byte-compile--interactive + (message nil))) + ;; Log something that isn't a warning. (defun byte-compile-log-1 (string) (with-current-buffer byte-compile-log-buffer @@ -986,7 +997,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (goto-char (point-max)) (byte-compile-warning-prefix nil nil) (cond (noninteractive - (message " %s" string)) + (byte-compile--message " %s" string)) (t (insert (format "%s\n" string))))))) @@ -1590,7 +1601,10 @@ extra args." "Recompile every `.el' file in DIRECTORY that already has a `.elc' file. Files in subdirectories of DIRECTORY are processed also." (interactive "DByte force recompile (directory): ") - (byte-recompile-directory directory nil t)) + (let ((byte-compile--interactive + (or byte-compile--interactive + (called-interactively-p 'any)))) + (byte-recompile-directory directory nil t))) ;;;###autoload (defun byte-recompile-directory (directory &optional arg force) @@ -1620,6 +1634,9 @@ that already has a `.elc' file." (compilation-mode)) (let ((directories (list default-directory)) (default-directory default-directory) + (byte-compile--interactive + (or byte-compile--interactive + (called-interactively-p 'any))) (skip-count 0) (fail-count 0) (file-count 0) @@ -1628,7 +1645,7 @@ that already has a `.elc' file." (displaying-byte-compile-warnings (while directories (setq directory (car directories)) - (message "Checking %s..." directory) + (byte-compile--message "Checking %s..." directory) (dolist (file (directory-files directory)) (let ((source (expand-file-name file directory))) (if (file-directory-p source) @@ -1653,13 +1670,13 @@ that already has a `.elc' file." (`t file-count) (_ fail-count))) (or noninteractive - (message "Checking %s..." directory)) + (byte-compile--message "Checking %s..." directory)) (if (not (eq last-dir directory)) (setq last-dir directory dir-count (1+ dir-count))) ))))) (setq directories (cdr directories)))) - (message "Done (Total of %d file%s compiled%s%s%s)" + (byte-compile--message "Done (Total of %d file%s compiled%s%s%s)" file-count (if (= file-count 1) "" "s") (if (> fail-count 0) (format ", %d failed" fail-count) "") (if (> skip-count 0) (format ", %d skipped" skip-count) "") @@ -1706,7 +1723,10 @@ If compilation is needed, this functions returns the result of current-prefix-arg))) (let ((dest (byte-compile-dest-file filename)) ;; Expand now so we get the current buffer's defaults - (filename (expand-file-name filename))) + (filename (expand-file-name filename)) + (byte-compile--interactive + (or byte-compile--interactive + (called-interactively-p 'any)))) (if (if (file-exists-p dest) ;; File was already compiled ;; Compile if forced to, or filename newer @@ -1718,7 +1738,7 @@ If compilation is needed, this functions returns the result of filename "? "))))) (progn (if (and noninteractive (not byte-compile-verbose)) - (message "Compiling %s..." filename)) + (byte-compile--message "Compiling %s..." filename)) (byte-compile-file filename load)) (when load (load (if (file-exists-p dest) dest filename))) @@ -1762,6 +1782,9 @@ The value is non-nil if there were no errors, nil if errors." (let ((byte-compile-current-file filename) (byte-compile-current-group nil) (set-auto-coding-for-load t) + (byte-compile--interactive + (or byte-compile--interactive + (called-interactively-p 'any))) target-file input-buffer output-buffer byte-compile-dest-file) (setq target-file (byte-compile-dest-file filename)) @@ -1817,14 +1840,14 @@ The value is non-nil if there were no errors, nil if errors." ;; (byte-compile-abbreviate-file filename) ;; (with-current-buffer input-buffer no-byte-compile)) (when (file-exists-p target-file) - (message "%s deleted because of `no-byte-compile: %s'" + (byte-compile--message "%s deleted because of `no-byte-compile: %s'" (byte-compile-abbreviate-file target-file) (buffer-local-value 'no-byte-compile input-buffer)) (condition-case nil (delete-file target-file) (error nil))) ;; We successfully didn't compile this file. 'no-byte-compile) (when byte-compile-verbose - (message "Compiling %s..." filename)) + (byte-compile--message "Compiling %s..." filename)) (setq byte-compiler-error-flag nil) ;; It is important that input-buffer not be current at this call, ;; so that the value of point set in input-buffer @@ -1836,7 +1859,7 @@ The value is non-nil if there were no errors, nil if errors." (if byte-compiler-error-flag nil (when byte-compile-verbose - (message "Compiling %s...done" filename)) + (byte-compile--message "Compiling %s...done" filename)) (kill-buffer input-buffer) (with-current-buffer output-buffer (goto-char (point-max)) @@ -1862,7 +1885,7 @@ The value is non-nil if there were no errors, nil if errors." ;; recompiled). Previously this was accomplished by ;; deleting target-file before writing it. (rename-file tempfile target-file t) - (or noninteractive (message "Wrote %s" target-file))) + (or noninteractive (byte-compile--message "Wrote %s" target-file))) ;; This is just to give a better error message than write-region (signal 'file-error (list "Opening output file" @@ -1896,6 +1919,9 @@ With argument ARG, insert value in current buffer after the form." (byte-compile-read-position (point)) (byte-compile-last-position byte-compile-read-position) (byte-compile-last-warned-form 'nothing) + (byte-compile--interactive + (or byte-compile--interactive + (called-interactively-p 'any))) (value (eval (let ((read-with-symbol-positions (current-buffer)) (read-symbol-positions-list nil)) @@ -1903,10 +1929,10 @@ With argument ARG, insert value in current buffer after the form." (byte-compile-sexp (read (current-buffer))))) lexical-binding))) (cond (arg - (message "Compiling from buffer... done.") + (byte-compile--message "Compiling from buffer... done.") (prin1 value (current-buffer)) (insert "\n")) - ((message "%s" (prin1-to-string value))))))) + ((byte-compile--message "%s" (prin1-to-string value))))))) (defun byte-compile-from-buffer (inbuffer) (let ((byte-compile-current-buffer inbuffer) @@ -2410,7 +2436,7 @@ not to take responsibility for the actual compilation of the code." (byte-compile-arglist-warn name arglist macro)) (if byte-compile-verbose - (message "Compiling %s... (%s)" + (byte-compile--message "Compiling %s... (%s)" (or byte-compile-current-file "") name)) (cond ((not (or macro (listp body))) ;; We do not know positively if the definition is a macro @@ -2580,7 +2606,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." ;; error to a simple message for the known case where signaling an error ;; causes problems. ((byte-code-function-p fun) - (message "Function %s is already compiled" + (byte-compile--message "Function %s is already compiled" (if (symbolp form) form "provided")) fun) (t @@ -4398,8 +4424,8 @@ binding slots have been popped." name macro arglist body rest) (when macro (if (null fun) - (message "Macro %s unrecognized, won't work in file" name) - (message "Macro %s partly recognized, trying our luck" name) + (byte-compile--message "Macro %s unrecognized, won't work in file" name) + (byte-compile--message "Macro %s partly recognized, trying our luck" name) (push (cons name (eval fun)) byte-compile-macro-environment))) (byte-compile-keep-pending form)))) @@ -4525,11 +4551,11 @@ The call tree also lists those functions which are not known to be called \(that is, to which no calls have been compiled\), and which cannot be invoked interactively." (interactive) - (message "Generating call tree...") + (byte-compile--message "Generating call tree...") (with-output-to-temp-buffer "*Call-Tree*" (set-buffer "*Call-Tree*") (erase-buffer) - (message "Generating call tree... (sorting on %s)" + (byte-compile--message "Generating call tree... (sorting on %s)" byte-compile-call-tree-sort) (insert "Call tree for " (cond ((null byte-compile-current-file) (or filename "???")) commit ad36067a1ea2204c51018de63e8eb2b71879ecb0 Author: Artur Malabarba Date: Sun Apr 12 12:01:24 2015 +0100 * lisp/files.el: Don't message when nothing happened (save-some-buffers, basic-save-buffer): Before messaging to say "nothing was saved" check if (called-interactively-p 'any). diff --git a/lisp/files.el b/lisp/files.el index eca52e0..7a66259 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4783,7 +4783,9 @@ Before and after saving the buffer, this function runs ;; Support VC `implicit' locking. (vc-after-save) (run-hooks 'after-save-hook)) - (or noninteractive (message "(No changes need to be saved)"))))) + (or noninteractive + (not (called-interactively-p 'any)) + (message "(No changes need to be saved)"))))) ;; This does the "real job" of writing a buffer into its visited file ;; and making a backup file. This is what is normally done @@ -5024,7 +5026,8 @@ change the additional actions you can take on files." (or queried (> files-done 0) abbrevs-done (cond ((null autosaved-buffers) - (message "(No files need saving)")) + (when (called-interactively-p 'any) + (message "(No files need saving)"))) ((= (length autosaved-buffers) 1) (message "(Saved %s)" (car autosaved-buffers))) (t commit 25449e7296fe6e5cd9bca49ae1bc52d1552d5324 Author: João Távora Date: Sun Apr 12 13:12:27 2015 +0100 Summary: Improve sexp-based movement in message-mode Works by giving citations and smileys a different syntax. This helps modes like `show-paren-mode', `electric-pair-mode', and C-M-* sexp-based movement. * lisp/gnus/message.el (message--syntax-propertize): New function. (message-mode): Set syntax-related vars. (message-smileys): New variable. * test/automated/message-mode-tests.el: New file diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index 04145de..b1bee65 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -2961,6 +2961,30 @@ See also `message-forbidden-properties'." (autoload 'ecomplete-setup "ecomplete") ;; for Emacs <23. +(defvar message-smileys '(":-)" ":)" + ":-(" ":(" + ";-)" ";)") + "A list of recognized smiley faces in `message-mode'.") + +(defun message--syntax-propertize (beg end) + "Syntax-propertize certain message text specially." + (let ((citation-regexp (concat "^" message-cite-prefix-regexp ".*$")) + (smiley-regexp (regexp-opt message-smileys))) + (goto-char beg) + (while (search-forward-regexp citation-regexp + end 'noerror) + (let ((start (match-beginning 0)) + (end (match-end 0))) + (add-text-properties start (1+ start) + `(syntax-table ,(string-to-syntax "<"))) + (add-text-properties end (min (1+ end) (point-max)) + `(syntax-table ,(string-to-syntax ">"))))) + (goto-char beg) + (while (search-forward-regexp smiley-regexp + end 'noerror) + (add-text-properties (match-beginning 0) (match-end 0) + `(syntax-table ,(string-to-syntax ".")))))) + ;;;###autoload (define-derived-mode message-mode text-mode "Message" "Major mode for editing mail and news to be sent. @@ -3063,7 +3087,13 @@ M-RET `message-newline-and-reformat' (break the line and reformat)." ;; multibyte is not necessary at all. -- zsh (mm-enable-multibyte)) (set (make-local-variable 'indent-tabs-mode) nil) ;No tabs for indentation. - (mml-mode)) + (mml-mode) + ;; Syntactic fontification. Helps `show-paren-mode', + ;; `electric-pair-mode', and C-M-* navigation by syntactically + ;; excluding citations and other artifacts. + ;; + (setq-local syntax-propertize-function 'message--syntax-propertize) + (setq-local parse-sexp-ignore-comments t)) (defun message-setup-fill-variables () "Setup message fill variables." diff --git a/test/automated/message-mode-tests.el b/test/automated/message-mode-tests.el new file mode 100644 index 0000000..12ecefe --- /dev/null +++ b/test/automated/message-mode-tests.el @@ -0,0 +1,55 @@ +;;; message-mode-tests.el --- Tests for message-mdoe -*- lexical-binding: t; -*- + +;; Copyright (C) 2015 Free Software Foundation, Inc. + +;; Author: João Távora + +;; This program 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, +;; 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 . + +;;; Commentary: + +;; This file contains tests for message-mode. + +;;; Code: +(require 'ert) +(require 'ert-x) + +(ert-deftest message-mode-propertize () + (with-temp-buffer + (unwind-protect + (progn + (message-mode) + (insert "here's an opener (\n" + "here's a sad face :-(\n" + "> here's citing someone with an opener (\n" + "and here's a closer ") + (let ((last-command-event ?\))) + (ert-simulate-command '(self-insert-command 1))) + ;; Syntax propertization doesn't kick in batch mode + (when noninteractive + (syntax-propertize (point-max))) + (backward-sexp) + (should (string= "here's an opener " + (buffer-substring-no-properties + (line-beginning-position) + (point)))) + (forward-sexp) + (should (string= "and here's a closer )" + (buffer-substring-no-properties + (line-beginning-position) + (point))))) + (set-buffer-modified-p nil)))) + +(provide 'message-mode-tests) +;;; message-mode-tests.el ends here