commit 5f8878796e20580afa4fbe171ddc0d0c7280c193 (HEAD, refs/remotes/origin/master) Author: Eli Zaretskii Date: Thu Apr 23 10:59:24 2015 +0300 ; * src/keyboard.c (read_event_from_main_queue): Fix indentation. diff --git a/src/keyboard.c b/src/keyboard.c index 068a47c..bd79f90 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2192,7 +2192,7 @@ read_event_from_main_queue (struct timespec *end_time, save_getcjmp (save_jump); restore_getcjmp (local_getcjmp); if (!end_time) - timer_start_idle (); + timer_start_idle (); c = kbd_buffer_get_event (&kb, used_mouse_menu, end_time); restore_getcjmp (save_jump); commit f2e2cd5969ddfb8d0302e2ee82986fa4a79b5b69 Author: Eli Zaretskii Date: Thu Apr 23 10:15:07 2015 +0300 Avoid starting threads by w32-shell-execute * src/w32fns.c (Fw32_shell_execute): Convert "file:///" URLs into local file names, before invoking ShellExecute. (Bug#20220) diff --git a/src/w32fns.c b/src/w32fns.c index 6abb433..b9d7bd4 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -29,6 +29,8 @@ along with GNU Emacs. If not, see . */ #include #include +#include + #include "lisp.h" #include "w32term.h" #include "frame.h" @@ -7038,7 +7040,28 @@ a ShowWindow flag: #else /* !CYGWIN */ - current_dir = ENCODE_FILE (current_dir); + const char file_url_str[] = "file:///"; + const int file_url_len = sizeof (file_url_str) - 1; + if (strncmp (SSDATA (document), file_url_str, file_url_len) == 0) + { + /* Passing "file:///" URLs to ShellExecute causes shlwapi.dll to + start a thread in some rare system configurations, for + unknown reasons. That thread is started in the context of + the Emacs process, but out of control of our code, and seems + to never exit afterwards. Each such thread reserves 8MB of + stack space (because that's the value recorded in the Emacs + executable at link time: Emacs needs a large stack). So a + large enough number of invocations of w32-shell-execute can + potentially cause the Emacs process to run out of available + address space, which is nasty. To work around this, we + convert such URLs to local file names, which seems to prevent + those threads from starting. See bug #20220. */ + char *p = SSDATA (document) + file_url_len; + + if (c_isalpha (*p) && p[1] == ':' && IS_DIRECTORY_SEP (p[2])) + document = Fsubstring_no_properties (document, + make_number (file_url_len), Qnil); + } /* We have a situation here. If DOCUMENT is a relative file name, but its name includes leading directories, i.e. it lives not in CURRENT_DIR, but in its subdirectory, then ShellExecute below @@ -7071,6 +7094,8 @@ a ShowWindow flag: else document = ENCODE_FILE (document); UNGCPRO; + + current_dir = ENCODE_FILE (current_dir); if (use_unicode) { wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH]; commit 62fe329762301b4edf546e74893d9169906ffa96 Author: Martin Rudalics Date: Thu Apr 23 09:11:59 2015 +0200 Fix following doc-links in `widget-documentation-link-action' * lisp/wid-edit.el (widget-documentation-link-action): Make following doc-links less simplistic (Bug#20398). diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index 04a900f..0a95783 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -2846,9 +2846,17 @@ The following properties have special meanings for this widget: (if (and (fboundp symbol) (boundp symbol)) ;; If there are two doc strings, give the user a way to pick one. (apropos (concat "\\`" (regexp-quote string) "\\'")) - (if (fboundp symbol) - (describe-function symbol) - (describe-variable symbol))))) + (cond + ((fboundp symbol) + (describe-function symbol)) + ((facep symbol) + (describe-face symbol)) + ((featurep symbol) + (describe-package symbol)) + ((or (boundp symbol) (get symbol 'variable-documentation)) + (describe-variable symbol)) + (t + (message "No documentation available for %s" symbol)))))) (defcustom widget-documentation-links t "Add hyperlinks to documentation strings when non-nil." commit 557c7d6fc6a6520a7ca92d2d006299fae0978aa3 Author: Thomas Fitzsimmons Date: Wed Apr 22 22:07:17 2015 -0400 Improve EUDC manual * eudc.texi (Troubleshooting): New LDAP troubleshooting subsection. diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 4d6e6ad..064f570 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi @@ -248,7 +248,7 @@ Pass any required extra options to @command{ldapsearch} using @end itemize The following examples use a base of -@code{ou=people,dc=example,dc=com} and the host name +@code{ou=people,dc=gnu,dc=org} and the host name @code{ldap.gnu.org}, a server that supports LDAP-over-SSL (the @code{ldaps} protocol, with default port @code{636}) and which requires authentication by the user @code{emacsuser} with password @@ -274,6 +274,7 @@ the wildcard character to the end of the last word. @menu * Emacs-only Configuration:: Configure with @file{.emacs} * External Configuration:: Configure with @file{/etc/openldap/ldap.conf} +* Troubleshooting:: Debug @command{ldapsearch} failures @end menu @node Emacs-only Configuration @@ -305,8 +306,8 @@ LDAP: ("ldaps://ldap.gnu.org" . ldap))) (customize-set-variable 'ldap-host-parameters-alist '(("ldaps://ldap.gnu.org" - base "ou=people,dc=example,dc=com" - binddn "example\\emacsuser" + base "ou=people,dc=gnu,dc=org" + binddn "gnu\\emacsuser" passwd ldap-password-read))) @end lisp @@ -330,7 +331,7 @@ Your system may already be configured for a default LDAP server. For example, @file{/etc/openldap/ldap.conf} might contain: @example -BASE ou=people,dc=example,dc=com +BASE ou=people,dc=gnu,dc=org URI ldaps://ldap.gnu.org TLS_CACERTDIR /etc/openldap/certs @end example @@ -339,11 +340,11 @@ TLS_CACERTDIR /etc/openldap/certs @cindex binddn Authentication requires a password, and a @dfn{bind distinguished name (binddn)} representing the user, in this case, -@code{example\emacsuser}. These can be specified in +@code{gnu\emacsuser}. These can be specified in @file{~/.authinfo.gpg} with the following line: @example -machine ldaps://ldap.gnu.org binddn example\emacsuser password s3cr3t +machine ldaps://ldap.gnu.org binddn gnu\emacsuser password s3cr3t @end example Then in the @file{.emacs} init file, these expressions suffice to @@ -372,7 +373,7 @@ case @command{ldapsearch} defaults to the host name in The @file{~/.authinfo.gpg} line becomes: @example -binddn example\emacsuser password s3cr3t +binddn gnu\emacsuser password s3cr3t @end example @noindent @@ -391,6 +392,23 @@ and the @file{.emacs} expressions become: '(("" auth-source t))) @end lisp +@node Troubleshooting +@subsection Troubleshooting + +If @command{ldapsearch} exits with an error, you'll see a message like +this in the @code{*Messages*} buffer (all on one line): + +@example +ldap-search-internal: Failed ldapsearch invocation: + ldapsearch "-Hldaps://ldap.gnu.org" "-bou=people,dc=gnu,dc=org" + "-Dgnu\emacsuser" "-W" "-LL" "-tt" "(&(mail=name*))" + "givenname" "sn" "mail" +@end example + +The @command{ldapsearch} command is formatted such that it can be +copied and pasted into a terminal. Set the @command{ldapsearch} debug +level to 5 by appending @code{-d 5} to the command line. + @node Usage @chapter Usage commit 7128b0de899111c97749e3b7cddfb2935a7f0a9a Author: Paul Eggert Date: Wed Apr 22 10:58:13 2015 -0700 Omit needless "\ " after multibyte then newline * src/print.c: Include , for c_isxdigit. (print_object): When print-escape-multibyte is non-nil and a multibyte character is followed by a newline or formfeed, followed by a hex digit, don't output a needless "\ " before the hex digit. * test/automated/print-tests.el (print-hex-backslash): New test. diff --git a/src/lread.c b/src/lread.c index fa9a63e..a84450a 100644 --- a/src/lread.c +++ b/src/lread.c @@ -3024,7 +3024,7 @@ read1 (Lisp_Object readcharfun, int *pch, bool first_in_list) ch = read_escape (readcharfun, 1); - /* CH is -1 if \ newline has just been seen. */ + /* CH is -1 if \ newline or \ space has just been seen. */ if (ch == -1) { if (p == read_buffer) diff --git a/src/print.c b/src/print.c index 916276b..bff5932 100644 --- a/src/print.c +++ b/src/print.c @@ -37,6 +37,7 @@ along with GNU Emacs. If not, see . */ #include "termhooks.h" /* For struct terminal. */ #include "font.h" +#include #include #include @@ -1385,9 +1386,9 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) register ptrdiff_t i, i_byte; struct gcpro gcpro1; ptrdiff_t size_byte; - /* 1 means we must ensure that the next character we output + /* True means we must ensure that the next character we output cannot be taken as part of a hex character escape. */ - bool need_nonhex = 0; + bool need_nonhex = false; bool multibyte = STRING_MULTIBYTE (obj); GCPRO1 (obj); @@ -1411,60 +1412,46 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) QUIT; - if (c == '\n' && print_escape_newlines) - print_c_string ("\\n", printcharfun); - else if (c == '\f' && print_escape_newlines) - print_c_string ("\\f", printcharfun); - else if (multibyte - && (CHAR_BYTE8_P (c) - || (! ASCII_CHAR_P (c) && print_escape_multibyte))) - { - /* When multibyte is disabled, - print multibyte string chars using hex escapes. - For a char code that could be in a unibyte string, - when found in a multibyte string, always use a hex escape - so it reads back as multibyte. */ - char outbuf[50]; - int len; - - if (CHAR_BYTE8_P (c)) - len = sprintf (outbuf, "\\%03o", CHAR_TO_BYTE8 (c)); - else - { - len = sprintf (outbuf, "\\x%04x", c); - need_nonhex = 1; - } - strout (outbuf, len, len, printcharfun); - } - else if (! multibyte - && SINGLE_BYTE_CHAR_P (c) && ! ASCII_CHAR_P (c) - && print_escape_nonascii) + if (multibyte + ? (CHAR_BYTE8_P (c) && (c = CHAR_TO_BYTE8 (c), true)) + : (SINGLE_BYTE_CHAR_P (c) && ! ASCII_CHAR_P (c) + && print_escape_nonascii)) { - /* When printing in a multibyte buffer - or when explicitly requested, + /* When printing a raw 8-bit byte in a multibyte buffer, or + (when requested) a non-ASCII character in a unibyte buffer, print single-byte non-ASCII string chars using octal escapes. */ char outbuf[5]; int len = sprintf (outbuf, "\\%03o", c); strout (outbuf, len, len, printcharfun); + need_nonhex = false; + } + else if (multibyte + && ! ASCII_CHAR_P (c) && print_escape_multibyte) + { + /* When requested, print multibyte chars using hex escapes. */ + char outbuf[sizeof "\\x" + INT_STRLEN_BOUND (c)]; + int len = sprintf (outbuf, "\\x%04x", c); + strout (outbuf, len, len, printcharfun); + need_nonhex = true; } else { /* If we just had a hex escape, and this character could be taken as part of it, output `\ ' to prevent that. */ - if (need_nonhex) - { - need_nonhex = 0; - if ((c >= 'a' && c <= 'f') - || (c >= 'A' && c <= 'F') - || (c >= '0' && c <= '9')) - print_c_string ("\\ ", printcharfun); - } - - if (c == '\"' || c == '\\') + if (need_nonhex && c_isxdigit (c)) + print_c_string ("\\ ", printcharfun); + + if (c == '\n' && print_escape_newlines + ? (c = 'n', true) + : c == '\f' && print_escape_newlines + ? (c = 'f', true) + : c == '\"' || c == '\\') printchar ('\\', printcharfun); + printchar (c, printcharfun); + need_nonhex = false; } } printchar ('\"', printcharfun); diff --git a/test/automated/print-tests.el b/test/automated/print-tests.el index 2761109..fe8c565 100644 --- a/test/automated/print-tests.el +++ b/test/automated/print-tests.el @@ -21,6 +21,12 @@ (require 'ert) +(ert-deftest print-hex-backslash () + (should (string= (let ((print-escape-multibyte t) + (print-escape-newlines t)) + (prin1-to-string "\u00A2\ff")) + "\"\\x00a2\\ff\""))) + (ert-deftest terpri () (should (string= (with-output-to-string (princ 'abc) commit df61b078228d8ee62abc9b03ae357a867c1013b3 Author: Oleh Krehel Date: Wed Apr 22 14:45:09 2015 +0200 Add a new `inhibit-message' variable * src/xdisp.c (syms_of_xdisp): Define a boolean `inhibit_message'. (message3): Don't call `message3_nolog' (i.e. use the Echo Area) when `inhibit_message' is non-zero. * etc/NEWS: Add an entry. * doc/lispref/display.texi: Add an entry for `inhibit-message', mention it in `message'. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index e2a38b6..d5d9bb5 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -257,6 +257,9 @@ text properties (@pxref{Logging Messages}). In batch mode, the message is printed to the standard error stream, followed by a newline. +When @code{inhibit-message} is non-@code{nil}, no message will be displayed +in the echo area, it will only be logged to @samp{*Messages*}. + If @var{format-string} is @code{nil} or the empty string, @code{message} clears the echo area; if the echo area has been expanded automatically, this brings it back to its normal size. If @@ -282,6 +285,11 @@ To automatically display a message in the echo area or in a pop-buffer, depending on its size, use @code{display-message-or-buffer} (see below). @end defun +@defvar inhibit-message +When this variable is non-@code{nil}, @code{message} and related functions +will not use the Echo Area to display messages. +@end defvar + @defmac with-temp-message message &rest body This construct displays a message in the echo area temporarily, during the execution of @var{body}. It displays @var{message}, executes diff --git a/etc/NEWS b/etc/NEWS index 804b819..e2b6b11 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -200,6 +200,11 @@ font, and (iii) the specified window. ** New possible value for `system-type': nacl. ++++ +** New variable `inhibit-message', when bound to non-nil, inhibits + `message' and related functions from displaying messages the Echo + Area. The output is still logged to the *Messages* buffer. + * Editing Changes in Emacs 25.1 diff --git a/src/xdisp.c b/src/xdisp.c index a17f5a9..6ca1906 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -10053,8 +10053,8 @@ message3 (Lisp_Object m) message_dolog (buffer, nbytes, true, multibyte); SAFE_FREE (); } - message3_nolog (m); - + if (! inhibit_message) + message3_nolog (m); UNGCPRO; } @@ -30430,6 +30430,11 @@ syms_of_xdisp (void) DEFSYM (Qredisplay_internal, "redisplay_internal (C function)"); + DEFVAR_BOOL("inhibit-message", inhibit_message, + doc: /* Non-nil means calls to `message' are not displayed. +They are still logged to the *Messages* buffer. */); + inhibit_message = 0; + message_dolog_marker1 = Fmake_marker (); staticpro (&message_dolog_marker1); message_dolog_marker2 = Fmake_marker (); commit 7793db6a762112944ab05b1c03884632bd9d91cc Author: Martin Rudalics Date: Wed Apr 22 15:02:22 2015 +0200 Fix last fix in `display-buffer-record-window'. * lisp/window.el (display-buffer-record-window): Fix last fix. diff --git a/lisp/window.el b/lisp/window.el index 07e477d..32467c3 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5481,7 +5481,8 @@ element is BUFFER." (setcar quit-restore 'same) ;; The selected-window might have changed in ;; between (Bug#20353). - (unless (memq (selected-window) '(window (nth 2 quit-restore))) + (unless (or (eq window (selected-window)) + (eq window (nth 2 quit-restore))) (setcar (cddr quit-restore) (selected-window))))) ;; WINDOW shows another buffer. (with-current-buffer (window-buffer window) commit c4e0ba51552ec773003f5f81a09132d729f812cc Author: Eli Zaretskii Date: Wed Apr 22 14:25:34 2015 +0300 Minor edits in CONTRIBUTE * CONTRIBUTE: Rearrange instructions about log messages. Use "Git" capitalized all over. Use 2 spaces between sentences. diff --git a/CONTRIBUTE b/CONTRIBUTE index d0e3750..1e04e3b 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -7,19 +7,22 @@ http://www.gnu.org/software/emacs/manual/html_node/emacs/Contributing.html * Information for Emacs Developers. An "Emacs Developer" is someone who contributes a lot of code or -documentation to the Emacs repository. Generally, they have write +documentation to the Emacs repository. Generally, they have write access to the Emacs git repository on Savannah https://savannah.gnu.org/git/?group=emacs. ** Write access to the Emacs repository. Once you become a frequent contributor to Emacs, we can consider -giving you write access to the version-control repository. Request -access on the emacs-devel@gnu.org mailing list. +giving you write access to the version-control repository. Request +access on the emacs-devel@gnu.org mailing list. Also, be sure to +subscribe to the emacs-devel@gnu.org mailing list and include the +"emacs-announce" topic, so that you get the announcements about +feature freeze and other important events. ** Using the Emacs repository -Emacs uses git for the source code repository. +Emacs uses Git for the source code repository. See http://www.emacswiki.org/emacs/GitQuickStartForEmacsDevs to get started, and http://www.emacswiki.org/emacs/GitForEmacsDevs for more @@ -28,16 +31,18 @@ advanced information. Alternately, see admin/notes/git-workflow. If committing changes written by someone else, make the commit in -their name, not yours. git distinguishes between the author +their name, not yours. Git distinguishes between the author and the committer; use the --author option on the commit command to specify the actual author; the committer defaults to you. ** Commit messages -When a release is prepared, the commit messages are used to generate -the ChangeLog file. So a typical patch does not touch any of the -ChangeLog files in the repository, but contains the ChangeLog entries -in its message. Here is an example commit message (indented): +Emacs development no longer stores descriptions of new changes in +ChangeLog files. Instead, a single ChangeLog file is generated from +the commit messages when a release is prepared. So changes you commit +should not touch any of the ChangeLog files in the repository, but +instead should contain the log entries in the commit message. Here is +an example of a commit message (indented): Deactivate shifted region @@ -48,10 +53,17 @@ in its message. Here is an example commit message (indented): * src/frame.c (Fhandle_switch_frame, Fselected_frame): Deactivate the mark. -The general format is as follows. +Below are some rules and recommendations for formatting commit +messages: -- Start with a single unindented summary line explaining the change, - then an empty line, then unindented ChangeLog entries. +- Start with a single unindented summary line explaining the change; + do not end this line with a period. If that line starts with a + semi-colon and a space "; ", the log message will be ignored when + generating the ChangeLog file. Use this for minor commits that do + not need separate ChangeLog entries, such as changes in etc/NEWS. + +- After the summary line, there should be an empty line, then + unindented ChangeLog entries. - Limit lines in commit messages to 78 characters, unless they consist of a single word of at most 140 characters; this is enforced by a @@ -64,22 +76,37 @@ The general format is as follows. file first line (starting with the asterisk). Then there is no individual files section. -- Explaining the rationale for a design choice is best done in comments - in the source code. However, sometimes it is useful to describe just - the rationale for a change; that can be done in the commit message - between the summary line and the file entries. +- If the commit has authors other than yourself, the commit message + should contain a separate line like the following: + + Co-authored-by: Joe Schmoe + +- If the commit is a tiny change that is exempt from copyright paperwork, + the commit message should contain a separate line like the following: + + Copyright-paperwork-exempt: yes + +- The commit message should contain "Bug#NNNNN" if it is related to + bug number NNNNN in the debbugs database. This string is often + parenthesized, as in "(Bug#19003)". - Commit messages should contain only printable UTF-8 characters. - Commit messages should not contain the "Signed-off-by:" lines that are used in some other projects. +- Explaining the rationale for a design choice is best done in comments + in the source code. However, sometimes it is useful to describe just + the rationale for a change; that can be done in the commit message + between the summary line and the file entries. + - Emacs generally follows the GNU coding standards when it comes to ChangeLogs: - http://www.gnu.org/prep/standards/html_node/Change-Logs.html . One - exception is that we still sometimes quote `like-this' (as the - standards used to recommend) rather than 'like-this' (as they do - now), because `...' is so widely used elsewhere in Emacs. + http://www.gnu.org/prep/standards/html_node/Change-Logs.html or + "(info (standards)Change Logs"). One exception is that we still + sometimes quote `like-this' (as the standards used to recommend) + rather than 'like-this' (as they do now), because `...' is so widely + used elsewhere in Emacs. - Some of the rules in the GNU coding standards section 5.2 "Commenting Your Work" also apply to ChangeLog entries: they must be @@ -102,27 +129,15 @@ The general format is as follows. (Rather than anything involving "ditto" and suchlike.) -- If the commit has authors other than yourself, the commit message - should contain a separate line like the following: - - Co-authored-by: Joe Schmoe - -- If the commit is a tiny change that is exempt from copyright paperwork, - the commit message should contain a separate line like the following: - - Copyright-paperwork-exempt: yes - -- The commit message should contain "Bug#NNNNN" if it is related to - bug number NNNNN in the debbugs database. This string is often - parenthesized, as in "(Bug#19003)". - -- In ChangeLog entries, there is no standard or recommended way to - identify revisions. +- There is no standard or recommended way to identify revisions in + ChangeLog entries. Using Git SHA1 values limits the usability of + the references to Git, and will become much less useful if Emacs + switches to a different VCS. So we recommend against that. One way to identify revisions is by quoting their summary line. Another is with an action stamp - an RFC3339 date followed by ! followed by the committer's email - for example, - "2014-01-16T05:43:35Z!esr@thyrsus.com". Often, "my previous commit" + "2014-01-16T05:43:35Z!esr@thyrsus.com". Often, "my previous commit" will suffice. - There is no need to mention files such as NEWS, MAINTAINERS, and @@ -130,12 +145,6 @@ The general format is as follows. 'configure', in the ChangeLog entry. "There is no need" means you don't have to, but you can if you want to. -- If a commit message's first line starts with "; ", the message is - ignored when generating ChangeLog history files via 'make ChangeLog' - or via 'make change-history'. You can use "; " for minor commits - that do not need separate ChangeLog entries, as well as commits that - only modify files that don't need these entries at all. - ** Generating ChangeLog entries - You can use various Emacs functions to ease the process of writing @@ -156,7 +165,7 @@ The general format is as follows. with Emacs commands like 'C-x 4 a', and commit the change using the shell command 'vc-dwim --commit'. Type 'vc-dwim --help' for more. -** branches +** Branches Development normally takes places on the trunk. Sometimes specialized features are developed on separate branches @@ -167,9 +176,9 @@ Development is discussed on the emacs-devel mailing list. Sometime before the release of a new major version of Emacs a "feature freeze" is imposed on the trunk, to prepare for creating a release branch. No new features may be added to the trunk after this point, -until the release branch is created. Announcements about the freeze -(and other important events) are made on the info-gnu-emacs mailing -list, and not anywhere else. +until the release branch is created. Announcements about the freeze +(and other important events) are made on the emacs-devel mailing +list under the "emacs-announce" topic, and not anywhere else. The trunk branch is named "master" in git; release branches are named "emacs-nn" where "nn" is the major version. @@ -188,13 +197,13 @@ then exclude that commit from the merge to trunk. ** Other process information -See all the files in admin/notes/* . In particular, see +See all the files in admin/notes/* . In particular, see admin/notes/newfile, see admin/notes/repo. *** git vs rename -git does not explicitly represent a file renaming; it uses a percent -changed heuristic to deduce that a file was renamed. So if you are +Git does not explicitly represent a file renaming; it uses a percent +changed heuristic to deduce that a file was renamed. So if you are planning to make extensive changes to a file after renaming it (or moving it to another directory), you should: @@ -205,7 +214,7 @@ moving it to another directory), you should: - make other changes - merge the feature branch to trunk, _not_ squashing the commits into - one. The commit message on this merge should summarize the renames + one. The commit message on this merge should summarize the renames and all the changes. ** Emacs Mailing lists. @@ -232,7 +241,7 @@ Doc-strings should be updated together with the code. Think about whether your change requires updating the manuals. If you know it does not, mark the NEWS entry with "---". If you know that *all* the necessary documentation updates have been made, mark -the entry with "+++". Otherwise do not mark it. +the entry with "+++". Otherwise do not mark it. Please see (info "(elisp)Documentation Tips") or https://www.gnu.org/software/emacs/manual/html_node/elisp/Documentation-Tips.html @@ -258,7 +267,9 @@ top-level directory. Most tests are in the directory The best way to understand Emacs Internals is to read the code, but the nodes "Tips" and "GNU Emacs Internals" in the Appendix -of the Emacs Lisp Reference Manual may also help. +of the Emacs Lisp Reference Manual may also help. Some source files, +such as xdisp.c, have large commentaries describing the design and +implementation in more detail. The file etc/DEBUG describes how to debug Emacs bugs. commit 934968a2adea1b4a550f2a0d5a47fc5757bb9082 Author: Artur Malabarba Date: Wed Apr 22 11:53:00 2015 +0100 * lisp/files.el (basic-save-buffer): Fix argument diff --git a/lisp/files.el b/lisp/files.el index fd7293b..045eeaf 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4708,7 +4708,7 @@ to do the job of saving; if they do not, then the buffer is saved in the visited file in the usual way. Before and after saving the buffer, this function runs `before-save-hook' and `after-save-hook', respectively." - (interactive) + (interactive '(called-interactively)) (save-current-buffer ;; In an indirect buffer, save its base buffer instead. (if (buffer-base-buffer) commit 3beb6b8b86f62762f9969b2d2393098c498eb04e Author: Artur Malabarba Date: Wed Apr 22 11:51:11 2015 +0100 * lisp/cus-edit.el (custom-file): Consider init-file-had-error In case `(and (null custom-file) init-file-had-error)' do the same thing we'd do if `(null user-init-file)', which is to either error out or return nil. This is in line with `custom-save-all' which would throw an error in that situation. (bug#20355) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index cd894f4..9f57d0d 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -4377,7 +4377,8 @@ if only the first line of the docstring is shown.")) (defun custom-file (&optional no-error) "Return the file name for saving customizations." - (if (null user-init-file) + (if (or (null user-init-file) + (and (null custom-file) init-file-had-error)) ;; Started with -q, i.e. the file containing Custom settings ;; hasn't been read. Saving settings there won't make much ;; sense. commit 8991937a746d2c941a4be05ae5d053df93f2537e Author: Artur Malabarba Date: Wed Apr 22 09:31:16 2015 +0100 * lisp/emacs-lisp/package.el: Hide lower-priority packages in menu (package-menu-hide-low-priority): New variable, see its doc. (package-archive-priorities): Update doc. (package-desc-priority): New function. (package-desc-priority-version): Use it. (package--remove-hidden): New function. (package-menu--refresh): Use it. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index f712b5b..999e857 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -225,6 +225,30 @@ a package can run arbitrary code." :group 'package :version "24.1") +(defcustom package-menu-hide-low-priority 'archive + "If non-nil, hide low priority packages from the packages menu. +A package is considered low priority if there's another version +of it available such that: + (a) the archive of the other package is higher priority than + this one, as per `package-archive-priorities'; + or + (b) they both have the same archive priority but the other + package has a higher version number. + +This variable has three possible values: + nil: no packages are hidden; + archive: only criteria (a) is used; + t: both criteria are used. + +This variable has no effect if `package-menu--hide-obsolete' is +nil, so it can be toggled with \\ \\[package-menu-hide-obsolete]." + :type '(choice (const :tag "Don't hide anything" nil) + (const :tag "Hide per package-archive-priorities" + archive) + (const :tag "Hide per archive and version number" t)) + :group 'package + :version "25.1") + (defcustom package-archive-priorities nil "An alist of priorities for packages. @@ -235,7 +259,9 @@ number from the archive with the highest priority is selected. When higher versions are available from archives with lower priorities, the user has to select those manually. -Archives not in this list have the priority 0." +Archives not in this list have the priority 0. + +See also `package-menu-hide-low-priority'." :type '(alist :key-type (string :tag "Archive name") :value-type (integer :tag "Priority (default is 0)")) :risky t @@ -467,6 +493,10 @@ This is, approximately, the inverse of `version-to-list'. (nth 1 keywords) keywords))) +(defun package-desc-priority (p) + "Return the priority of the archive of package-desc object P." + (package-archive-priority (package-desc-archive p))) + ;; Package descriptor format used in finder-inf.el and package--builtins. (cl-defstruct (package--bi-desc (:constructor package-make-builtin (version summary)) @@ -2471,6 +2501,32 @@ Installed obsolete packages are always displayed.") "Hiding" "Displaying")) (revert-buffer nil 'no-confirm)) +(defun package--remove-hidden (pkg-list) + "Filter PKG-LIST according to `package-archive-priorities'. +PKG-LIST must be a list of package-desc objects sorted by +decreasing version number. +Return a list of packages tied for the highest priority according +to their archives." + (when pkg-list + ;; The first is a variable toggled with + ;; `package-menu-hide-obsolete', the second is a static user + ;; option that defines *what* we hide. + (if (and package-menu--hide-obsolete + package-menu-hide-low-priority) + (let ((max-priority (package-desc-priority (car pkg-list))) + (out (list (pop pkg-list)))) + (dolist (p pkg-list (nreverse out)) + (let ((priority (package-desc-priority p))) + (cond + ((> priority max-priority) + (setq max-priority priority) + (setq out (list p))) + ;; This assumes pkg-list is sorted by version number. + ((and (= priority max-priority) + (eq package-menu-hide-low-priority 'archive)) + (push p out)))))) + pkg-list))) + (defun package-menu--refresh (&optional packages keywords) "Re-populate the `tabulated-list-entries'. PACKAGES should be nil or t, which means to display all known packages. @@ -2500,7 +2556,7 @@ KEYWORDS should be nil or a list of keywords." (dolist (elt package-archive-contents) (setq name (car elt)) (when (or (eq packages t) (memq name packages)) - (dolist (pkg (cdr elt)) + (dolist (pkg (package--remove-hidden (cdr elt))) ;; Hide available obsolete packages. (when (and (not (and package-menu--hide-obsolete (package-installed-p (package-desc-name pkg) @@ -2731,8 +2787,7 @@ defaults to 0." This allows for easy comparison of package versions from different archives if archive priorities are meant to be taken in consideration." - (cons (package-archive-priority - (package-desc-archive pkg-desc)) + (cons (package-desc-priority pkg-desc) (package-desc-version pkg-desc))) (defun package-menu--find-upgrades () commit c3b41c6448f3be90667c0b8e26189226911eca52 Author: Artur Malabarba Date: Tue Apr 21 11:35:40 2015 +0100 * lisp/emacs-lisp/package.el: Implement displaying obsolete packages (package-menu--hide-obsolete): New variable. (package--remove-hidden): Use it. (package-menu-hide-obsolete): New interactive function to toggle the variable. (package--quick-help-keys): Document it. (package-menu-async): Add :version tag. (package-menu-mode-map): Bind package-menu-hide-obsolete. (package-desc-status): Indicate non-installed obsolete packages as avail-obso. (package-menu-mark-install): Allow installation of avail-obso. (package-menu--status-predicate): Sort avail-obso with available. diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index c69e15b..f712b5b 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -2296,6 +2296,7 @@ will be deleted." (define-key map "x" 'package-menu-execute) (define-key map "h" 'package-menu-quick-help) (define-key map "?" 'package-menu-describe-package) + (define-key map "(" #'package-menu-hide-obsolete) (define-key map [menu-bar package-menu] (cons "Package" menu-map)) (define-key menu-map [mq] '(menu-item "Quit" quit-window @@ -2446,14 +2447,29 @@ of these dependencies, similar to the list returned by (let* ((ins (cadr (assq name package-alist))) (ins-v (if ins (package-desc-version ins)))) (cond - ((or (null ins) (version-list-< ins-v version)) + ;; Installed obsolete packages are handled in the `dir' + ;; clause above. Here we handle available obsolete, which + ;; are displayed depending on `package-menu--hide-obsolete'. + ((and ins (version-list-<= version ins-v)) "avail-obso") + (t (if (memq name package-menu--new-package-list) - "new" "available")) - ((version-list-< version ins-v) "obsolete") - ((version-list-= version ins-v) - (if (not signed) "unsigned" - (if (package--user-selected-p name) - "installed" "dependency"))))))))) + "new" "available")))))))) + +(defvar package-menu--hide-obsolete t + "Whether avaiable obsolete packages should be hidden. +Can be toggled with \\ \\[package-menu-hide-obsolete]. +Installed obsolete packages are always displayed.") + +(defun package-menu-hide-obsolete () + "Toggle visibility of obsolete available packages." + (interactive) + (unless (derived-mode-p 'package-menu-mode) + (user-error "The current buffer is not a Package Menu")) + (setq package-menu--hide-obsolete + (not package-menu--hide-obsolete)) + (message "%s available-obsolete packages" (if package-menu--hide-obsolete + "Hiding" "Displaying")) + (revert-buffer nil 'no-confirm)) (defun package-menu--refresh (&optional packages keywords) "Re-populate the `tabulated-list-entries'. @@ -2485,9 +2501,10 @@ KEYWORDS should be nil or a list of keywords." (setq name (car elt)) (when (or (eq packages t) (memq name packages)) (dolist (pkg (cdr elt)) - ;; Hide obsolete packages. - (when (and (not (package-installed-p (package-desc-name pkg) - (package-desc-version pkg))) + ;; Hide available obsolete packages. + (when (and (not (and package-menu--hide-obsolete + (package-installed-p (package-desc-name pkg) + (package-desc-version pkg)))) (package--has-keyword-p pkg keywords)) (package--push pkg (package-desc-status pkg) info-list))))) @@ -2580,6 +2597,7 @@ Return (PKG-DESC [NAME VERSION STATUS DOC])." (face (pcase status (`"built-in" 'font-lock-builtin-face) (`"available" 'default) + (`"avail-obso" 'font-lock-comment-face) (`"new" 'bold) (`"held" 'font-lock-constant-face) (`"disabled" 'font-lock-warning-face) @@ -2637,7 +2655,7 @@ If optional arg BUTTON is non-nil, describe its associated package." (defun package-menu-mark-install (&optional _num) "Mark a package for installation and move to the next line." (interactive "p") - (if (member (package-menu-get-status) '("available" "new" "dependency")) + (if (member (package-menu-get-status) '("available" "avail-obso" "new" "dependency")) (tabulated-list-put-tag "I" t) (forward-line))) @@ -2665,7 +2683,7 @@ If optional arg BUTTON is non-nil, describe its associated package." (defvar package--quick-help-keys '(("install," "delete," "unmark," ("execute" . 1)) ("next," "previous") - ("refresh-contents," "g-redisplay," "filter," "help"))) + ("refresh-contents," "g-redisplay," "filter," "(-toggle-obsolete" "help"))) (defun package--prettify-quick-help-key (desc) "Prettify DESC to be displayed as a help menu." @@ -2879,8 +2897,11 @@ Optional argument NOQUERY non-nil means do not ask the user to confirm." (package-menu--name-predicate A B)) ((string= sA "new") t) ((string= sB "new") nil) - ((string= sA "available") t) - ((string= sB "available") nil) + ((string-prefix-p "avail" sA) + (if (string-prefix-p "avail" sB) + (package-menu--name-predicate A B) + t)) + ((string-prefix-p "avail" sB) nil) ((string= sA "installed") t) ((string= sB "installed") nil) ((string= sA "dependency") t) @@ -2950,6 +2971,7 @@ after `package-menu--perform-transaction'." This includes refreshing archive contents as well as installing packages." :type 'boolean + :version "25.1" :group 'package) ;;;###autoload commit 00b73a0865f25e195722c5a046310379d260d1e8 Author: Glenn Morris Date: Wed Apr 22 06:17:45 2015 -0400 ; Auto-commit of loaddefs files. diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el index 0b7e9e0..ce083c9 100644 --- a/lisp/textmodes/reftex.el +++ b/lisp/textmodes/reftex.el @@ -2446,7 +2446,7 @@ of ENTRY-LIST is a list of cons cells (\"MACRONAME\" . LEVEL). See ;;;*** -;;;### (autoloads nil "reftex-cite" "reftex-cite.el" "5a53c260fa01268c04ea2f558add9d7d") +;;;### (autoloads nil "reftex-cite" "reftex-cite.el" "9e0690737924aef6e3836bc2c42a36c9") ;;; Generated autoloads from reftex-cite.el (autoload 'reftex-default-bibliography "reftex-cite" "\ commit c5e89be20a3feba9c67be6855b1dbdc6d8ae5ce2 Author: Alan Mackenzie Date: Wed Apr 22 09:49:27 2015 +0000 On C-y, stop some text property entries being written into buffer-undo-list lisp/subr.el (remove-yank-excluded-properties): enclose the code in `with-silent-modifications'. diff --git a/lisp/subr.el b/lisp/subr.el index 1d41e01..062c9f9 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2811,20 +2811,21 @@ if it's an autoloaded macro." "Process text properties between START and END, inserted for a `yank'. Perform the handling specified by `yank-handled-properties', then remove properties specified by `yank-excluded-properties'." - (let ((inhibit-read-only t)) - (dolist (handler yank-handled-properties) - (let ((prop (car handler)) - (fun (cdr handler)) - (run-start start)) - (while (< run-start end) - (let ((value (get-text-property run-start prop)) - (run-end (next-single-property-change - run-start prop nil end))) - (funcall fun value run-start run-end) - (setq run-start run-end))))) - (if (eq yank-excluded-properties t) - (set-text-properties start end nil) - (remove-list-of-text-properties start end yank-excluded-properties)))) + (with-silent-modifications + (let ((inhibit-read-only t)) + (dolist (handler yank-handled-properties) + (let ((prop (car handler)) + (fun (cdr handler)) + (run-start start)) + (while (< run-start end) + (let ((value (get-text-property run-start prop)) + (run-end (next-single-property-change + run-start prop nil end))) + (funcall fun value run-start run-end) + (setq run-start run-end))))) + (if (eq yank-excluded-properties t) + (set-text-properties start end nil) + (remove-list-of-text-properties start end yank-excluded-properties))))) (defvar yank-undo-function) commit f974317897441f638808cbcfecb2c8fd1c0281ec Author: Martin Rudalics Date: Wed Apr 22 11:17:27 2015 +0200 In display-buffer-record-window record selected window if necessary. * lisp/window.el (display-buffer-record-window): Store selected window if it differs from 3rd element of 'quit-restore' parameter (Bug#20353). diff --git a/lisp/window.el b/lisp/window.el index 46a7dd0..07e477d 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5474,10 +5474,15 @@ element is BUFFER." (cond ((eq type 'reuse) (if (eq (window-buffer window) buffer) - ;; WINDOW shows BUFFER already. - (when (consp (window-parameter window 'quit-restore)) - ;; If WINDOW has a quit-restore parameter, reset its car. - (setcar (window-parameter window 'quit-restore) 'same)) + ;; WINDOW shows BUFFER already. Update WINDOW's quit-restore + ;; parameter, if any. + (let ((quit-restore (window-parameter window 'quit-restore))) + (when (consp quit-restore) + (setcar quit-restore 'same) + ;; The selected-window might have changed in + ;; between (Bug#20353). + (unless (memq (selected-window) '(window (nth 2 quit-restore))) + (setcar (cddr quit-restore) (selected-window))))) ;; WINDOW shows another buffer. (with-current-buffer (window-buffer window) (set-window-parameter