commit 6710c265aa300bd29e5841a88c03ca101d3d1f75 (HEAD, refs/remotes/origin/master) Author: Phillip Lord Date: Mon Nov 20 22:29:29 2017 +0000 Fix lower case installer name * admin/nt/dist-build/build-zips.sh (build_installer): diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh index d41f6d9cbd..28451c0063 100755 --- a/admin/nt/dist-build/build-zips.sh +++ b/admin/nt/dist-build/build-zips.sh @@ -81,7 +81,7 @@ function build_installer { -DARCH=$ARCH -DEMACS_VERSION=$ACTUAL_VERSION \ -DOUT_VERSION=$OF_VERSION emacs.nsi rm emacs.nsi - mv Emacs-$OF_VERSION-$ARCH-installer.exe ~/emacs-upload + mv emacs-$OF_VERSION-$ARCH-installer.exe ~/emacs-upload } set -o errexit @@ -167,8 +167,6 @@ else OF_VERSION="$VERSION-`date +%Y-%m-%d`" fi - - if (($GIT_UP)) then git_up commit 556aca3a44562ed4fc9570a42ef2defeaea5260b Author: Eric Abrahamsen Date: Mon Nov 20 14:21:32 2017 -0800 Use message instead of gnus-message in gnus-summary-current-score * lisp/gnus/gnus-score.el (gnus-summary-current-score): The only point of this function is to display the score to the user, there's no need to do gnus-message filtering. diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index bc11aa528f..6c3a8b4cec 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1078,11 +1078,11 @@ EXTRA is the possible non-standard header." "Return the score of the current article. With prefix ARG, return the total score of the current (sub)thread." (interactive "P") - (gnus-message 1 "%s" (if arg - (gnus-thread-total-score - (gnus-id-to-thread - (mail-header-id (gnus-summary-article-header)))) - (gnus-summary-article-score)))) + (message "%s" (if arg + (gnus-thread-total-score + (gnus-id-to-thread + (mail-header-id (gnus-summary-article-header)))) + (gnus-summary-article-score)))) (defun gnus-score-change-score-file (file) "Change current score alist." commit 046cde2d66ed044eb7eb71cd9e69206ee59e12fe Author: Phillip Lord Date: Fri Nov 17 23:07:38 2017 +0000 Add date to snapshot file * admin/nt/dist-build/build-zips.sh: Add date to all out files. * admin/nt/dist-build/emacs.nsi: Lower case and date installer. diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh index ce4a11dc1e..d41f6d9cbd 100755 --- a/admin/nt/dist-build/build-zips.sh +++ b/admin/nt/dist-build/build-zips.sh @@ -47,21 +47,28 @@ function build_zip { cd $HOME/emacs-build/build/emacs-$VERSION/$ARCH export PKG_CONFIG_PATH=$PKG + + ## Running configure forces a rebuild of the C core which takes + ## time that is not always needed + if (($CONFIG)) + then ../../../git/$BRANCH/configure \ --without-dbus \ --host=$HOST --without-compress-install \ $CACHE \ CFLAGS="-O2 -static -g3" + fi + make -j 16 install \ prefix=$HOME/emacs-build/install/emacs-$VERSION/$ARCH cd $HOME/emacs-build/install/emacs-$VERSION/$ARCH cp $HOME/emacs-build/deps/libXpm/$ARCH/libXpm-noX4.dll bin - zip -r -9 emacs-$VERSION-$ARCH-no-deps.zip * - mv emacs-$VERSION-$ARCH-no-deps.zip $HOME/emacs-upload + zip -r -9 emacs-$OF_VERSION-$ARCH-no-deps.zip * + mv emacs-$OF_VERSION-$ARCH-no-deps.zip $HOME/emacs-upload rm bin/libXpm-noX4.dll unzip $HOME/emacs-build/deps/emacs-26-$ARCH-deps.zip - zip -r -9 emacs-$VERSION-$ARCH.zip * - mv emacs-$VERSION-$ARCH.zip ~/emacs-upload + zip -r -9 emacs-$OF_VERSION-$ARCH.zip * + mv emacs-$OF_VERSION-$ARCH.zip ~/emacs-upload } function build_installer { @@ -72,9 +79,9 @@ function build_installer { makensis -v4 \ -DARCH=$ARCH -DEMACS_VERSION=$ACTUAL_VERSION \ - -DOUT_VERSION=$VERSION emacs.nsi + -DOUT_VERSION=$OF_VERSION emacs.nsi rm emacs.nsi - mv Emacs-$ARCH-$VERSION-installer.exe ~/emacs-upload + mv Emacs-$OF_VERSION-$ARCH-installer.exe ~/emacs-upload } set -o errexit @@ -86,8 +93,9 @@ BUILD=1 BUILD_32=1 BUILD_64=1 GIT_UP=0 +CONFIG=1 -while getopts "36ghsiV:" opt; do +while getopts "36ghnsiV:" opt; do case $opt in 3) BUILD_32=1 @@ -105,6 +113,9 @@ while getopts "36ghsiV:" opt; do BUILD_64=0 GIT_UP=1 ;; + n) + CONFIG=0 + ;; i) BUILD=0 ;; @@ -143,16 +154,20 @@ fi MAJOR_VERSION="$(echo $VERSION | cut -d'.' -f1)" +ACTUAL_VERSION=$VERSION +VERSION=$VERSION$SNAPSHOT +OF_VERSION=$VERSION + if [ -z $SNAPSHOT ]; then BRANCH=emacs-$VERSION else BRANCH=master CACHE=-C + OF_VERSION="$VERSION-`date +%Y-%m-%d`" fi -ACTUAL_VERSION=$VERSION -VERSION=$VERSION$SNAPSHOT + if (($GIT_UP)) then diff --git a/admin/nt/dist-build/emacs.nsi b/admin/nt/dist-build/emacs.nsi index 8138272377..dce8f3db4a 100644 --- a/admin/nt/dist-build/emacs.nsi +++ b/admin/nt/dist-build/emacs.nsi @@ -2,7 +2,7 @@ !include LogicLib.nsh !include x64.nsh -Outfile "Emacs-${ARCH}-${OUT_VERSION}-installer.exe" +Outfile "emacs-${OUT_VERSION}-${ARCH}-installer.exe" SetCompressor /solid lzma @@ -49,7 +49,6 @@ function .onInit StrCpy $INSTDIR "$PROGRAMFILES\Emacs" ${Endif} ${EndIf} - functionend commit 5b5f441ff8986800aa5f175bb5db2dd90e642a3a Author: Alan Mackenzie Date: Mon Nov 20 18:05:33 2017 +0000 read_key_sequence: correct the handling of raw_keybuf in recursive calls This fixes bug #29349. * src/keyboard.c (raw_keybuf_buffer, raw_keybuf_count_buffer): New variables pointed to by ... (raw_keybuf, raw_keybuf_count): Variables converted to pointers. (GROW_RAW_KEYBUF): enhance with a length argument. (command_loop_1): Initialize the above two pointers to their canonical values. (read_key_sequence): In recursive calls (for menus) the function was overwriting the raw event buffer of the outer call. Correct this by introducing a local buffer for each level of call, and setting this up to be used by the call to read_char. Any contents of this local buffer are appended to the global buffer afterwards. diff --git a/src/keyboard.c b/src/keyboard.c index 6b7a6bfa74..b18dc1abbe 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -121,12 +121,17 @@ ptrdiff_t this_command_key_count; /* This vector is used as a buffer to record the events that were actually read by read_key_sequence. */ -static Lisp_Object raw_keybuf; -static int raw_keybuf_count; - -#define GROW_RAW_KEYBUF \ - if (raw_keybuf_count == ASIZE (raw_keybuf)) \ - raw_keybuf = larger_vector (raw_keybuf, 1, -1) +static Lisp_Object raw_keybuf_buffer; +static int raw_keybuf_count_buffer; +static Lisp_Object *raw_keybuf = &raw_keybuf_buffer; +static int *raw_keybuf_count = &raw_keybuf_count_buffer; + +#define GROW_RAW_KEYBUF(inc) \ + if (*raw_keybuf_count > ASIZE (*raw_keybuf) - (inc)) \ + *raw_keybuf = \ + larger_vector (*raw_keybuf, \ + (inc) + *raw_keybuf_count - ASIZE (*raw_keybuf), \ + -1) /* Number of elements of this_command_keys that precede this key sequence. */ @@ -1365,6 +1370,8 @@ command_loop_1 (void) Vthis_command_keys_shift_translated = Qnil; /* Read next key sequence; i gets its length. */ + raw_keybuf_count = &raw_keybuf_count_buffer; /* For safety */ + raw_keybuf = &raw_keybuf_buffer; /* Ditto */ i = read_key_sequence (keybuf, ARRAYELTS (keybuf), Qnil, 0, 1, 1, 0); @@ -8913,6 +8920,11 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, /* How many keys there are in the current key sequence. */ int t; + int *outer_raw_keybuf_count; + Lisp_Object *outer_raw_keybuf; + int inner_raw_keybuf_count_buffer; + Lisp_Object inner_raw_keybuf_buffer = Fmake_vector (make_number (30), Qnil); + /* The length of the echo buffer when we started reading, and the length of this_command_keys when we started reading. */ ptrdiff_t echo_start UNINIT; @@ -8973,7 +8985,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, /* List of events for which a fake prefix key has been generated. */ Lisp_Object fake_prefixed_keys = Qnil; - raw_keybuf_count = 0; + *raw_keybuf_count = 0; last_nonmenu_event = Qnil; @@ -9145,11 +9157,23 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, { KBOARD *interrupted_kboard = current_kboard; struct frame *interrupted_frame = SELECTED_FRAME (); + int i; + outer_raw_keybuf_count = raw_keybuf_count; + outer_raw_keybuf = raw_keybuf; + inner_raw_keybuf_count_buffer = 0; + raw_keybuf_count = &inner_raw_keybuf_count_buffer; + raw_keybuf = &inner_raw_keybuf_buffer; /* Calling read_char with COMMANDFLAG = -2 avoids redisplay in read_char and its subroutines. */ key = read_char (prevent_redisplay ? -2 : NILP (prompt), current_binding, last_nonmenu_event, &used_mouse_menu, NULL); + raw_keybuf_count = outer_raw_keybuf_count; + raw_keybuf = outer_raw_keybuf; + GROW_RAW_KEYBUF (inner_raw_keybuf_count_buffer); + for (i = 0; i < inner_raw_keybuf_count_buffer; i++) + ASET (*raw_keybuf, (*raw_keybuf_count)++, + AREF (inner_raw_keybuf_buffer, i)); if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ /* When switching to a new tty (with a new keyboard), read_char returns the new buffer, rather than -2 @@ -9257,9 +9281,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, && XINT (key) == quit_char && current_buffer != starting_buffer) { - GROW_RAW_KEYBUF; - ASET (raw_keybuf, raw_keybuf_count, key); - raw_keybuf_count++; + GROW_RAW_KEYBUF (1); + ASET (*raw_keybuf, *raw_keybuf_count, key); + (*raw_keybuf_count)++; keybuf[t++] = key; mock_input = t; Vquit_flag = Qnil; @@ -9298,9 +9322,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, current_binding = active_maps (first_event); } - GROW_RAW_KEYBUF; - ASET (raw_keybuf, raw_keybuf_count, key); - raw_keybuf_count++; + GROW_RAW_KEYBUF (1); + ASET (*raw_keybuf, *raw_keybuf_count, key); + (*raw_keybuf_count)++; } /* Clicks in non-text areas get prefixed by the symbol @@ -9346,8 +9370,9 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, && BUFFERP (XWINDOW (window)->contents) && XBUFFER (XWINDOW (window)->contents) != current_buffer) { - ASET (raw_keybuf, raw_keybuf_count, key); - raw_keybuf_count++; + GROW_RAW_KEYBUF (1); + ASET (*raw_keybuf, *raw_keybuf_count, key); + (*raw_keybuf_count)++; keybuf[t] = key; mock_input = t + 1; @@ -10120,7 +10145,7 @@ shows the events before all translations (except for input methods). The value is always a vector. */) (void) { - return Fvector (raw_keybuf_count, XVECTOR (raw_keybuf)->contents); + return Fvector (*raw_keybuf_count, XVECTOR (*raw_keybuf)->contents); } DEFUN ("clear-this-command-keys", Fclear_this_command_keys, @@ -11265,8 +11290,8 @@ syms_of_keyboard (void) this_command_keys = Fmake_vector (make_number (40), Qnil); staticpro (&this_command_keys); - raw_keybuf = Fmake_vector (make_number (30), Qnil); - staticpro (&raw_keybuf); + raw_keybuf_buffer = Fmake_vector (make_number (30), Qnil); + staticpro (raw_keybuf); DEFSYM (Qcommand_execute, "command-execute"); DEFSYM (Qinternal_echo_keystrokes_prefix, "internal-echo-keystrokes-prefix"); commit 9c6791afcd2b60f069494031ef64a5aac70ca3f8 Merge: 5f1cf4b5c7 eb335c97b2 Author: Glenn Morris Date: Mon Nov 20 13:10:11 2017 -0500 ; Merge from origin/emacs-26 The following commit was skipped: eb335c9 (origin/emacs-26) * src/keyboard.c: Undo last change, meant f... commit 5f1cf4b5c7640ed747bd867712a4580bc2e5b92f Merge: 7aa59d42a7 fc5b8f1055 Author: Glenn Morris Date: Mon Nov 20 13:10:11 2017 -0500 Merge from origin/emacs-26 fc5b8f1 Fix Bug#29149 5622b2e Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into... 4da8799 (emacs-26) Fix misbehavior when drawing three-pixel high hori... 1b082c8 MH-E: don't automatically download external-body parts 069f978 ; * lisp/emacs-lisp/byte-run.el: Fix a typo in a comment. 504a56c ; Fix last commit a34e44e ; Fix last commit a8892b4 Further fix for Bug#29291 d14923b Fix divider frame params on NS (bug#29352) b2518ac Spelling fixes # Conflicts: # etc/NEWS # test/lisp/net/tramp-tests.el commit 7aa59d42a72ef51e0ee902b67097983fc1bfe44c Merge: 33bfbfee7e 18b2359411 Author: Glenn Morris Date: Mon Nov 20 13:08:35 2017 -0500 ; Merge from origin/emacs-26 The following commit was skipped: 18b2359 * src/keyboard.c: Make xterm-mouse clicks on mode-line work commit 33bfbfee7ef04392b0c30ca2ab5074a14c4ddad7 Merge: 7cf41d8088 6e6bf60eab Author: Glenn Morris Date: Mon Nov 20 13:08:35 2017 -0500 Merge from origin/emacs-26 6e6bf60 Don't let delete_frame select a tooltip frame (Bug#27647) e9dd580 Filter obtrusive events in help-read-key-sequence. 90075e8 Fix symlink flag in tramp-gvfs-handle-file-attributes c355529 Fix bug in tramp-handle-file-truename 4c21d04 Fix a typo in doc string of electric-indent-functions-without... 319c2de Avoid assertion violations in echo_area_display 63c7733 ; * lisp/ido.el (ido-find-alternate-file): Doc fix. (Bug#29278) cbd319a Fix case-folding in Occur 29520b0 Fix quick-calc in C mode with hex values 3e80124 Improve documentation of dired-next/prev-marked-file 90add18 Prevent aborts in line-move-visual 648c128 More fixes in src/.gdbinit 104f3e5 Document how to enter whitespace when using grep-read-files commit 7cf41d8088284c2fe8b1807d07fc082a270e6a78 Merge: 93a4953463 d8e0951d5f Author: Glenn Morris Date: Mon Nov 20 13:08:34 2017 -0500 ; Merge from origin/emacs-26 The following commit was skipped: d8e0951 ; Remove Tramp test instrumentation. Do not merge commit 93a49534630ba2f828f55d4ddd6fc0374f589c3c Merge: 7da1e9cd18 42c8768134 Author: Glenn Morris Date: Mon Nov 20 13:08:34 2017 -0500 Merge from origin/emacs-26 42c8768 Fix .gdbinit following lisp.h changes 720322a ; Spelling fixes 617c556 * lisp/simple.el (shell-command): Doc fixes. 1faade8 Fix marker adjustment for undo (Bug#29118) commit 7da1e9cd186723846b49bd7ba5ba87efb44c4ec1 Author: Stefan Monnier Date: Mon Nov 20 13:05:28 2017 -0500 * lisp/erc/erc-services.el: Use lexical-binding diff --git a/lisp/erc/erc-services.el b/lisp/erc/erc-services.el index 348a592a88..6d0e7c85a9 100644 --- a/lisp/erc/erc-services.el +++ b/lisp/erc/erc-services.el @@ -1,4 +1,4 @@ -;;; erc-services.el --- Identify to NickServ +;;; erc-services.el --- Identify to NickServ -*- lexical-binding:t -*- ;; Copyright (C) 2002-2004, 2006-2017 Free Software Foundation, Inc. @@ -89,7 +89,7 @@ Possible settings are:. latter. nil - Disables automatic Nickserv identification. -You can also use M-x erc-nickserv-identify-mode to change modes." +You can also use \\[erc-nickserv-identify-mode] to change modes." :group 'erc-services :type '(choice (const autodetect) (const nick-change) @@ -348,7 +348,7 @@ Hooks are called with arguments (NETWORK NICK)." :group 'erc-services :type 'hook) -(defun erc-nickserv-identification-autodetect (proc parsed) +(defun erc-nickserv-identification-autodetect (_proc parsed) "Check for NickServ's successful identification notice. Make sure it is the real NickServ for this network and that it has specifically confirmed a successful identification attempt. @@ -368,7 +368,7 @@ If this is the case, run `erc-nickserv-identified-hook'." (run-hook-with-args 'erc-nickserv-identified-hook network nick) nil))) -(defun erc-nickserv-identify-autodetect (proc parsed) +(defun erc-nickserv-identify-autodetect (_proc parsed) "Identify to NickServ when an identify request is received. Make sure it is the real NickServ for this network. If `erc-prompt-for-nickserv-password' is non-nil, prompt the user for the @@ -390,7 +390,7 @@ password for this nickname, otherwise try to send it automatically." (erc-nickserv-call-identify-function nick) nil)))) -(defun erc-nickserv-identify-on-connect (server nick) +(defun erc-nickserv-identify-on-connect (_server nick) "Identify to Nickserv after the connection to the server is established." (unless (or (and (null erc-nickserv-passwords) (null erc-prompt-for-nickserv-password)) @@ -398,7 +398,7 @@ password for this nickname, otherwise try to send it automatically." (erc-nickserv-alist-regexp (erc-network)))) (erc-nickserv-call-identify-function nick))) -(defun erc-nickserv-identify-on-nick-change (nick old-nick) +(defun erc-nickserv-identify-on-nick-change (nick _old-nick) "Identify to Nickserv whenever your nick changes." (unless (or (and (null erc-nickserv-passwords) (null erc-prompt-for-nickserv-password)) @@ -407,9 +407,9 @@ password for this nickname, otherwise try to send it automatically." (erc-nickserv-call-identify-function nick))) (defun erc-nickserv-call-identify-function (nickname) - "Call `erc-nickserv-identify' interactively or run it with NICKNAME's -password. -The action is determined by the value of `erc-prompt-for-nickserv-password'." + "Call `erc-nickserv-identify'. +Either call it interactively or run it with NICKNAME's password, +depending on the value of `erc-prompt-for-nickserv-password'." (if erc-prompt-for-nickserv-password (call-interactively 'erc-nickserv-identify) (when erc-nickserv-passwords @@ -418,6 +418,8 @@ The action is determined by the value of `erc-prompt-for-nickserv-password'." (nth 1 (assoc (erc-network) erc-nickserv-passwords)))))))) +(defvar erc-auto-discard-away) + ;;;###autoload (defun erc-nickserv-identify (password) "Send an \"identify \" message to NickServ. commit 51a5ccbe850da9fa5b58cee169fd5dbe8917f4e7 Author: Olaf Rogalsky Date: Mon Nov 20 12:47:21 2017 -0500 * src/keyboard.c: Make xterm-mouse clicks on mode-line work Copyright-paperwork-exempt: yes (read_key_sequence): Recompute first_event after replay_sequence, since it might have changed (bug#29104). diff --git a/src/keyboard.c b/src/keyboard.c index 399149ae97..6b7a6bfa74 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8919,7 +8919,6 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, ptrdiff_t keys_start; Lisp_Object current_binding = Qnil; - Lisp_Object first_event = Qnil; /* Index of the first key that has no binding. It is useless to try fkey.start larger than that. */ @@ -9029,6 +9028,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, starting_buffer = current_buffer; first_unbound = bufsize + 1; + Lisp_Object first_event = mock_input > 0 ? keybuf[0] : Qnil; /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in commit eb335c97b23fb845de358d3392f03e5faa2b51b5 Author: Stefan Monnier Date: Mon Nov 20 12:45:20 2017 -0500 * src/keyboard.c: Undo last change, meant for master only diff --git a/src/keyboard.c b/src/keyboard.c index f32b156013..57757cf211 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8916,6 +8916,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, ptrdiff_t keys_start; Lisp_Object current_binding = Qnil; + Lisp_Object first_event = Qnil; /* Index of the first key that has no binding. It is useless to try fkey.start larger than that. */ @@ -9025,7 +9026,6 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, starting_buffer = current_buffer; first_unbound = bufsize + 1; - Lisp_Object first_event = mock_input > 0 ? keybuf[0] : Qnil; /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in commit fc5b8f105505b4f9bb32c5d84d685ab0bc991802 Author: Michael Albinus Date: Mon Nov 20 14:28:22 2017 +0100 Fix Bug#29149 * lisp/net/tramp.el (tramp-drop-volume-letter): Handle also backup file names. (tramp-handle-find-backup-file-name): Call `tramp-drop-volume-letter' on the results. (Bug#29149) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index aadfcadebc..efd31b26be 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1858,7 +1858,8 @@ letter into the file name. This function removes it." (if (tramp-compat-file-name-quoted-p name) 'tramp-compat-file-name-quote 'identity) (let ((name (tramp-compat-file-name-unquote name))) - (if (string-match "\\`[a-zA-Z]:/" name) + ;; A volume letter could occur also in encoded backup file names. + (if (string-match "\\(\\`[[:alpha:]]:/\\|/!drive_[[:alpha:]]\\)" name) (replace-match "/" nil t name) name))))) @@ -3222,21 +3223,23 @@ User is always nil." (defun tramp-handle-find-backup-file-name (filename) "Like `find-backup-file-name' for Tramp files." (with-parsed-tramp-file-name filename nil - (let ((backup-directory-alist - (if tramp-backup-directory-alist - (mapcar - (lambda (x) - (cons - (car x) - (if (and (stringp (cdr x)) - (file-name-absolute-p (cdr x)) - (not (tramp-tramp-file-p (cdr x)))) - (tramp-make-tramp-file-name - method user domain host port (cdr x) hop) - (cdr x)))) - tramp-backup-directory-alist) - backup-directory-alist))) - (tramp-run-real-handler 'find-backup-file-name (list filename))))) + (mapcar + 'tramp-drop-volume-letter + (let ((backup-directory-alist + (if tramp-backup-directory-alist + (mapcar + (lambda (x) + (cons + (car x) + (if (and (stringp (cdr x)) + (file-name-absolute-p (cdr x)) + (not (tramp-tramp-file-p (cdr x)))) + (tramp-make-tramp-file-name + method user domain host port (cdr x) hop) + (cdr x)))) + tramp-backup-directory-alist) + backup-directory-alist))) + (tramp-run-real-handler 'find-backup-file-name (list filename)))))) (defun tramp-handle-insert-directory (filename switches &optional wildcard full-directory-p) commit 5622b2e26337c531304ac7177a347edb92edf804 Merge: 504a56cf32 4da87999c2 Author: Michael Albinus Date: Mon Nov 20 14:16:28 2017 +0100 Merge branch 'emacs-26' of git.sv.gnu.org:/srv/git/emacs into emacs-26 commit 4da87999c234155300b30b01c5a7e221d65e4cc8 Author: Martin Rudalics Date: Mon Nov 20 09:18:59 2017 +0100 Fix misbehavior when drawing three-pixel high horizontal dividers (Bug#29353) * src/xterm.c (x_draw_window_divider): * src/w32term.c (w32_draw_window_divider): Fix misbehavior when drawing three-pixel high horizontal dividers (Bug#29353). The misbehavior was noted by Keith David Bershatsky and analyzed by Alan Third. diff --git a/src/w32term.c b/src/w32term.c index e62d49dd94..7a3b2cc631 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -660,21 +660,25 @@ w32_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) ? face_last->foreground : FRAME_FOREGROUND_PIXEL (f)); - if (y1 - y0 > x1 - x0 && x1 - x0 > 2) - /* Vertical. */ + if ((y1 - y0 > x1 - x0) && (x1 - x0 >= 3)) + /* A vertical divider, at least three pixels wide: Draw first and + last pixels differently. */ { w32_fill_area_abs (f, hdc, color_first, x0, y0, x0 + 1, y1); w32_fill_area_abs (f, hdc, color, x0 + 1, y0, x1 - 1, y1); w32_fill_area_abs (f, hdc, color_last, x1 - 1, y0, x1, y1); } - else if (x1 - x0 > y1 - y0 && y1 - y0 > 3) - /* Horizontal. */ + else if ((x1 - x0 > y1 - y0) && (y1 - y0 >= 3)) + /* A horizontal divider, at least three pixels high: Draw first and + last pixels differently. */ { w32_fill_area_abs (f, hdc, color_first, x0, y0, x1, y0 + 1); w32_fill_area_abs (f, hdc, color, x0, y0 + 1, x1, y1 - 1); w32_fill_area_abs (f, hdc, color_last, x0, y1 - 1, x1, y1); } else + /* In any other case do not draw the first and last pixels + differently. */ w32_fill_area_abs (f, hdc, color, x0, y0, x1, y1); release_frame_dc (f, hdc); diff --git a/src/xterm.c b/src/xterm.c index 28abfaecde..1deb7b4601 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1104,8 +1104,9 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) : FRAME_FOREGROUND_PIXEL (f)); Display *display = FRAME_X_DISPLAY (f); - if (y1 - y0 > x1 - x0 && x1 - x0 > 2) - /* Vertical. */ + if ((y1 - y0 > x1 - x0) && (x1 - x0 >= 3)) + /* A vertical divider, at least three pixels wide: Draw first and + last pixels differently. */ { XSetForeground (display, f->output_data.x->normal_gc, color_first); x_fill_rectangle (f, f->output_data.x->normal_gc, @@ -1117,8 +1118,9 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) x_fill_rectangle (f, f->output_data.x->normal_gc, x1 - 1, y0, 1, y1 - y0); } - else if (x1 - x0 > y1 - y0 && y1 - y0 > 3) - /* Horizontal. */ + else if ((x1 - x0 > y1 - y0) && (y1 - y0 >= 3)) + /* A horizontal divider, at least three pixels high: Draw first and + last pixels differently. */ { XSetForeground (display, f->output_data.x->normal_gc, color_first); x_fill_rectangle (f, f->output_data.x->normal_gc, @@ -1132,6 +1134,8 @@ x_draw_window_divider (struct window *w, int x0, int x1, int y0, int y1) } else { + /* In any other case do not draw the first and last pixels + differently. */ XSetForeground (display, f->output_data.x->normal_gc, color); x_fill_rectangle (f, f->output_data.x->normal_gc, x0, y0, x1 - x0, y1 - y0); commit 1b082c886c9e2213a85b820c7f07cd5a30b8b99b Author: Mike Kupfer Date: Sat Nov 18 16:49:10 2017 -0800 MH-E: don't automatically download external-body parts * lisp/mh-e/mh-mime.el (mh-mime-display-single): Use mm-automatic-display-p to verify that a part should be displayed before doing the inline checks (SF#475). diff --git a/lisp/mh-e/mh-mime.el b/lisp/mh-e/mh-mime.el index 9d1edf0fc4..69c57e0afd 100644 --- a/lisp/mh-e/mh-mime.el +++ b/lisp/mh-e/mh-mime.el @@ -659,6 +659,7 @@ buttons for alternative parts that are usually suppressed." (attachmentp (equal (car (mm-handle-disposition handle)) "attachment")) (inlinep (and (equal (car (mm-handle-disposition handle)) "inline") + (mm-automatic-display-p handle) (mm-inlinable-p handle) (mm-inlined-p handle))) (displayp (or inlinep ; show if inline OR @@ -669,6 +670,7 @@ buttons for alternative parts that are usually suppressed." (and (not (equal (mm-handle-media-supertype handle) "image")) + (mm-automatic-display-p handle) (mm-inlinable-p handle) (mm-inlined-p handle))))))) (save-restriction commit 069f9784841c7aa11d86dbaecf0f5cde64aa4663 Author: Eli Zaretskii Date: Sun Nov 19 17:51:08 2017 +0200 ; * lisp/emacs-lisp/byte-run.el: Fix a typo in a comment. diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index c6ad209cd8..abfcdb347a 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -285,7 +285,7 @@ The return value is undefined. def)))) -;; Redefined in byte-optimize.el. +;; Redefined in byte-opt.el. ;; This is not documented--it's not clear that we should promote it. (fset 'inline 'progn) commit 504a56cf329f25f73b450e3f280144caf6e0b0d2 Author: Michael Albinus Date: Sun Nov 19 12:50:05 2017 +0100 ; Fix last commit diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index f91df46153..ad9d460d3c 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2986,7 +2986,6 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Copy ACL. Since we don't know whether Emacs is built ;; with local ACL support, we must check it. (when (set-file-acl tmp-name3 (file-acl tmp-name1)) - (file-acl tmp-name1) (file-acl tmp-name3) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) ;; Two files with same ACLs. commit a34e44e8ee197bf7f4674e7bed70032f6c7eb647 Author: Michael Albinus Date: Sun Nov 19 12:22:30 2017 +0100 ; Fix last commit * test/lisp/net/tramp-tests.el (tramp-test24-file-acl): Check for local ACL support. (Bug#29291) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 3d0ed499d5..f91df46153 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2986,7 +2986,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." ;; Copy ACL. Since we don't know whether Emacs is built ;; with local ACL support, we must check it. (when (set-file-acl tmp-name3 (file-acl tmp-name1)) - (file-acl tmp-name1) (file-acl tmp-name3)) + (file-acl tmp-name1) (file-acl tmp-name3) (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) ;; Two files with same ACLs. commit a8892b4e627087cdceef39a96e100cf18c9391ae Author: Michael Albinus Date: Sun Nov 19 12:11:18 2017 +0100 Further fix for Bug#29291 * test/lisp/net/tramp-tests.el (tramp-test24-file-acl): Check for local ACL support. (Bug#29291) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 62f72a3f6f..3d0ed499d5 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2983,9 +2983,11 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (set-file-modes tmp-name3 #o444) (should-not (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) - ;; Copy ACL. - (set-file-acl tmp-name3 (file-acl tmp-name1)) - (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3))) + ;; Copy ACL. Since we don't know whether Emacs is built + ;; with local ACL support, we must check it. + (when (set-file-acl tmp-name3 (file-acl tmp-name1)) + (file-acl tmp-name1) (file-acl tmp-name3)) + (should (string-equal (file-acl tmp-name1) (file-acl tmp-name3)))) ;; Two files with same ACLs. (delete-file tmp-name1) commit d14923b4d48410e37efc85b25cbe75e07c8f8ac7 Author: Alan Third Date: Sun Nov 19 11:00:31 2017 +0000 Fix divider frame params on NS (bug#29352) * src/nsfns.m (Fx_create_frame): Set right-divider-width and bottom-divider-width parameters. diff --git a/src/nsfns.m b/src/nsfns.m index c8a41f5b4b..8172268167 100644 --- a/src/nsfns.m +++ b/src/nsfns.m @@ -1234,6 +1234,10 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side x_default_parameter (f, parms, Qinternal_border_width, make_number (2), "internalBorderWidth", "InternalBorderWidth", RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qright_divider_width, make_number (0), + NULL, NULL, RES_TYPE_NUMBER); + x_default_parameter (f, parms, Qbottom_divider_width, make_number (0), + NULL, NULL, RES_TYPE_NUMBER); /* default vertical scrollbars on right on Mac */ { commit b2518ac7501810b49e078e55c07bf6740c27dec4 Author: Paul Eggert Date: Sun Nov 19 00:19:51 2017 -0800 Spelling fixes * lisp/help-fns.el (help-fns--analyze-function): Rename from help-fns--analyse-function. All uses changed. diff --git a/ChangeLog.3 b/ChangeLog.3 index e7831a37aa..17f18c0fad 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -38322,7 +38322,7 @@ Automatically detect whether .h file is C or C++ * lisp/progmodes/cc-mode.el (c-or-c++-mode): A new function which - analyses contents of the buffer to determine whether it looks like C++ + analyzes contents of the buffer to determine whether it looks like C++ source code and based on that enables c-mode or c++-mode. (c-or-c++-mode--regexp): Regular expression which, when matches a buffer, signals file is C++. diff --git a/etc/NEWS b/etc/NEWS index f79c2cbc8e..6da4ab93b1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1155,9 +1155,8 @@ branch-related commands on a keymap bound to 'B'. --- *** Opening a .h file will turn C or C++ mode depending on language used. -This is done with the help of 'c-or-c++-mode' function which analyses -contents of the buffer to determine whether it's a C or C++ source -file. +This is done with the help of the 'c-or-c++-mode' function, which +analyzes buffer contents to infer whether it's a C or C++ source file. --- ** New option 'cpp-message-min-time-interval' to allow user control diff --git a/lisp/help-fns.el b/lisp/help-fns.el index cae0247a54..7f135e52ee 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -560,7 +560,7 @@ FILE is the file where FUNCTION was probably defined." (setq short rel)))) short)) -(defun help-fns--analyse-function (function) +(defun help-fns--analyze-function (function) ;; FIXME: Document/explain the differences between FUNCTION, ;; REAL-FUNCTION, DEF, and REAL-DEF. "Return information about FUNCTION. @@ -602,7 +602,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (defun help-fns-function-description-header (function) "Print a line describing FUNCTION to `standard-output'." (pcase-let* ((`(,_real-function ,def ,aliased ,real-def) - (help-fns--analyse-function function)) + (help-fns--analyze-function function)) (file-name (find-lisp-object-file-name function (if aliased 'defun def))) (beg (if (and (or (byte-code-function-p def) @@ -692,7 +692,7 @@ Returns a list of the form (REAL-FUNCTION DEF ALIASED REAL-DEF)." (terpri)(terpri) (pcase-let* ((`(,real-function ,def ,_aliased ,real-def) - (help-fns--analyse-function function)) + (help-fns--analyze-function function)) (doc-raw (condition-case nil ;; FIXME: Maybe `documentation' should return nil ;; for invalid functions i.s.o. signaling an error. diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index f74e931a8b..22dea039cd 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -1859,7 +1859,7 @@ Key bindings: ;;;###autoload (defun c-or-c++-mode () - "Analyse buffer and enable either C or C++ mode. + "Analyze buffer and enable either C or C++ mode. Some people and projects use .h extension for C++ header files which is also the one used for C header files. This makes commit 18b235941109ab9e7a405cbe950886c97e897e11 Author: Olaf Rogalsky Date: Sat Nov 18 23:23:58 2017 -0500 * src/keyboard.c: Make xterm-mouse clicks on mode-line work (read_key_sequence): Recompute first_event after replay_sequence, since it might have changed (bug#29104). diff --git a/src/keyboard.c b/src/keyboard.c index 57757cf211..f32b156013 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -8916,7 +8916,6 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, ptrdiff_t keys_start; Lisp_Object current_binding = Qnil; - Lisp_Object first_event = Qnil; /* Index of the first key that has no binding. It is useless to try fkey.start larger than that. */ @@ -9026,6 +9025,7 @@ read_key_sequence (Lisp_Object *keybuf, int bufsize, Lisp_Object prompt, starting_buffer = current_buffer; first_unbound = bufsize + 1; + Lisp_Object first_event = mock_input > 0 ? keybuf[0] : Qnil; /* Build our list of keymaps. If we recognize a function key and replace its escape sequence in commit 6e6bf60eab1e921605064e3d39ea080639f8e0f6 Author: Martin Rudalics Date: Sat Nov 18 19:19:32 2017 +0100 Don't let delete_frame select a tooltip frame (Bug#27647) * src/frame.c (delete_frame): Don't select a tooltip frame. (Bug#27647) diff --git a/src/frame.c b/src/frame.c index 2b32751c0d..aacb27ec79 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1920,6 +1920,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force) See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=15025. */ FOR_EACH_FRAME (tail, frame1) if (!EQ (frame, frame1) + && NILP (Fframe_parameter (frame1, Qtooltip)) && (FRAME_TERMINAL (XFRAME (frame)) == FRAME_TERMINAL (XFRAME (frame1))) && FRAME_VISIBLE_P (XFRAME (frame1))) @@ -1930,7 +1931,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force) { FOR_EACH_FRAME (tail, frame1) { - if (! EQ (frame, frame1) && FRAME_LIVE_P (XFRAME (frame1))) + if (!EQ (frame, frame1) + && FRAME_LIVE_P (XFRAME (frame1)) + && NILP (Fframe_parameter (frame1, Qtooltip))) { /* Do not change a text terminal's top-frame. */ struct frame *f1 = XFRAME (frame1); commit e9dd580cc8b3134eb82d758efb070a3ab8dd3e9a Author: Alan Mackenzie Date: Sat Nov 18 14:52:39 2017 +0000 Filter obtrusive events in help-read-key-sequence. This fixes most of bug #29272. * lisp/help.el (help-read-key-sequence): After a mouse event, pause for 0.01s, discarding any events (such as ) received in this time, before polling for the double-click (etc.) events which may follow. This fixes the infinite loop which occurred whwn events triggered a sit-for whilst handling menu events. diff --git a/lisp/help.el b/lisp/help.el index fbb9fc8cbe..212e3679da 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -728,11 +728,17 @@ with `mouse-movement' events." Describe the following key, mouse click, or menu item: ")) ((and (pred vectorp) (let `(,key0 . ,_) (aref key 0)) (guard (symbolp key0)) (let keyname (symbol-name key0))) - (if no-mouse-movement - (string-match "mouse-movement" keyname) - (and (string-match "\\(mouse\\|down\\|click\\|drag\\)" - keyname) - (not (sit-for (/ double-click-time 1000.0) t))))))) + (or + (and no-mouse-movement + (string-match "mouse-movement" keyname)) + (and (string-match "\\(mouse\\|down\\|click\\|drag\\)" + keyname) + (progn + ;; Discard events (e.g. ) which might + ;; spuriously trigger the `sit-for'. + (sleep-for 0.01) + (while (read-event nil nil 0.01)) + (not (sit-for (/ double-click-time 1000.0) t)))))))) (list key ;; If KEY is a down-event, read and include the commit 90075e8e1e6d6d7b6b49cb20ecdbb5d3de53d48b Author: Michael Albinus Date: Sat Nov 18 15:08:32 2017 +0100 Fix symlink flag in tramp-gvfs-handle-file-attributes * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-attributes): Set proper symlink file mode flag. diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 709ea4670a..424e77b0eb 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -992,7 +992,7 @@ If FILE-SYSTEM is non-nil, return file system attributes." (tramp-file-mode-from-int (string-to-number n)) (format "%s%s%s%s------" - (if dirp "d" "-") + (if dirp "d" (if res-symlink-target "l" "-")) (if (equal (cdr (assoc "access::can-read" attributes)) "FALSE") "-" "r") commit c355529baedf3a5f03a8a4ee5904a5918f456b64 Author: Michael Albinus Date: Sat Nov 18 14:24:03 2017 +0100 Fix bug in tramp-handle-file-truename * lisp/net/tramp.el (tramp-handle-file-truename): Expand localname. * test/lisp/net/tramp-tests.el (tramp-test21-file-links): Check also relative symbolic links. diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 3d5dcbdbb1..aadfcadebc 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -3207,7 +3207,8 @@ User is always nil." (if (file-remote-p symlink-target) (let (file-name-handler-alist) (tramp-compat-file-name-quote symlink-target)) - symlink-target) + (expand-file-name + symlink-target (file-name-directory v2-localname))) v2-localname))))) (when (>= numchase numchase-limit) (tramp-error diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index cf85b071e1..62f72a3f6f 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2671,7 +2671,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should-error (make-symbolic-link tmp-name1 tmp-name2) :type 'file-already-exists) - ;; number means interactive case. + ;; A number means interactive case. (cl-letf (((symbol-function 'yes-or-no-p) 'ignore)) (should-error (make-symbolic-link tmp-name1 tmp-name2 0) @@ -2783,6 +2783,15 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) (should (file-equal-p tmp-name1 tmp-name2)) + ;; Check relative symlink file name. + (delete-file tmp-name2) + (let ((default-directory tramp-test-temporary-file-directory)) + (make-symbolic-link (file-name-nondirectory tmp-name1) tmp-name2)) + (should (file-symlink-p tmp-name2)) + (should-not (string-equal tmp-name2 (file-truename tmp-name2))) + (should + (string-equal (file-truename tmp-name1) (file-truename tmp-name2))) + (should (file-equal-p tmp-name1 tmp-name2)) ;; Symbolic links could look like a remote file name. ;; They must be quoted then. (delete-file tmp-name2) commit 4c21d04057d5f4f801d57e8aa2ffdab834ddc48a Author: Eli Zaretskii Date: Sat Nov 18 13:46:13 2017 +0200 Fix a typo in doc string of electric-indent-functions-without-reindent * lisp/electric.el (electric-indent-functions-without-reindent): Doc fix. (Bug#29304) diff --git a/lisp/electric.el b/lisp/electric.el index d7929945db..5ce747410b 100644 --- a/lisp/electric.el +++ b/lisp/electric.el @@ -227,7 +227,7 @@ Python does not lend itself to fully automatic indentation.") haskell-indentation-indent-line haskell-indent-cycle haskell-simple-indent yaml-indent-line) "List of indent functions that can't reindent. -If `line-indent-function' is one of those, then `electric-indent-mode' will +If `indent-line-function' is one of those, then `electric-indent-mode' will not try to reindent lines. It is normally better to make the major mode set `electric-indent-inhibit', but this can be used as a workaround.") commit 319c2de9dab577ea97f6c63cb8fd5b7ac3da82b0 Author: Eli Zaretskii Date: Sat Nov 18 13:41:03 2017 +0200 Avoid assertion violations in echo_area_display * src/xdisp.c (echo_area_display): Don't try redisplaying the echo area if the selected-frame's mini-window is nil. (Bug#27647) diff --git a/src/xdisp.c b/src/xdisp.c index 4c82737e41..02c5d76e06 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -11510,6 +11510,9 @@ echo_area_display (bool update_frame_p) struct frame *sf = SELECTED_FRAME (); mini_window = FRAME_MINIBUF_WINDOW (sf); + if (NILP (mini_window)) + return; + w = XWINDOW (mini_window); f = XFRAME (WINDOW_FRAME (w)); commit 63c773399e954eb027853557b0a20dbcc67b669e Author: Eli Zaretskii Date: Sat Nov 18 13:14:52 2017 +0200 ; * lisp/ido.el (ido-find-alternate-file): Doc fix. (Bug#29278) diff --git a/lisp/ido.el b/lisp/ido.el index 4f1e36ba91..96a362f760 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4302,7 +4302,7 @@ For details of keybindings, see `ido-find-file'." ;;;###autoload (defun ido-find-alternate-file () - "Switch to another file and show it in another window. + "Find another file, select its buffer, kill previous buffer. The file name is selected interactively by typing a substring. For details of keybindings, see `ido-find-file'." (interactive) commit cbd319a351cc60bf67f6d682809282c889598ece Author: Eli Zaretskii Date: Sat Nov 18 13:06:22 2017 +0200 Fix case-folding in Occur * lisp/replace.el (occur-engine): Bind case-fold-search in each buffer we search. (Bug#29254) diff --git a/lisp/replace.el b/lisp/replace.el index cdaeb9240a..80e584517c 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1643,175 +1643,185 @@ See also `multi-occur'." (inhibit-field-text-motion t) (headerpt (with-current-buffer out-buf (point)))) (with-current-buffer buf - (or coding - ;; Set CODING only if the current buffer locally - ;; binds buffer-file-coding-system. - (not (local-variable-p 'buffer-file-coding-system)) - (setq coding buffer-file-coding-system)) - (save-excursion - (goto-char (point-min)) ;; begin searching in the buffer - (while (not (eobp)) - (setq origpt (point)) - (when (setq endpt (re-search-forward regexp nil t)) - (setq lines (1+ lines)) ;; increment matching lines count - (setq matchbeg (match-beginning 0)) - ;; Get beginning of first match line and end of the last. - (save-excursion - (goto-char matchbeg) - (setq begpt (line-beginning-position)) - (goto-char endpt) - (setq endpt (line-end-position))) - ;; Sum line numbers up to the first match line. - (setq curr-line (+ curr-line (count-lines origpt begpt))) - (setq marker (make-marker)) - (set-marker marker matchbeg) - (setq curstring (occur-engine-line begpt endpt keep-props)) - ;; Highlight the matches - (let ((len (length curstring)) - (start 0)) - ;; Count empty lines that don't use next loop (Bug#22062). - (when (zerop len) - (setq matches (1+ matches))) - (while (and (< start len) - (string-match regexp curstring start)) - (setq matches (1+ matches)) - (add-text-properties - (match-beginning 0) (match-end 0) - '(occur-match t) curstring) - (when match-face - ;; Add `match-face' to faces copied from the buffer. - (add-face-text-property + ;; The following binding is for when case-fold-search + ;; has a local binding in the original buffer, in which + ;; case we cannot bind it globally and let that have + ;; effect in every buffer we search. + (let ((case-fold-search case-fold)) + (or coding + ;; Set CODING only if the current buffer locally + ;; binds buffer-file-coding-system. + (not (local-variable-p 'buffer-file-coding-system)) + (setq coding buffer-file-coding-system)) + (save-excursion + (goto-char (point-min)) ;; begin searching in the buffer + (while (not (eobp)) + (setq origpt (point)) + (when (setq endpt (re-search-forward regexp nil t)) + (setq lines (1+ lines)) ;; increment matching lines count + (setq matchbeg (match-beginning 0)) + ;; Get beginning of first match line and end of the last. + (save-excursion + (goto-char matchbeg) + (setq begpt (line-beginning-position)) + (goto-char endpt) + (setq endpt (line-end-position))) + ;; Sum line numbers up to the first match line. + (setq curr-line (+ curr-line (count-lines origpt begpt))) + (setq marker (make-marker)) + (set-marker marker matchbeg) + (setq curstring (occur-engine-line begpt endpt keep-props)) + ;; Highlight the matches + (let ((len (length curstring)) + (start 0)) + ;; Count empty lines that don't use next loop (Bug#22062). + (when (zerop len) + (setq matches (1+ matches))) + (while (and (< start len) + (string-match regexp curstring start)) + (setq matches (1+ matches)) + (add-text-properties (match-beginning 0) (match-end 0) - match-face nil curstring)) - ;; Avoid infloop (Bug#7593). - (let ((end (match-end 0))) - (setq start (if (= start end) (1+ start) end))))) - ;; Generate the string to insert for this match - (let* ((match-prefix - ;; Using 7 digits aligns tabs properly. - (apply #'propertize (format "%7d:" curr-line) - (append - (when prefix-face - `(font-lock-face ,prefix-face)) - `(occur-prefix t mouse-face (highlight) - ;; Allow insertion of text at - ;; the end of the prefix (for - ;; Occur Edit mode). - front-sticky t rear-nonsticky t - occur-target ,marker follow-link t - help-echo "mouse-2: go to this occurrence")))) - (match-str - ;; We don't put `mouse-face' on the newline, - ;; because that loses. And don't put it - ;; on context lines to reduce flicker. - (propertize curstring 'mouse-face (list 'highlight) - 'occur-target marker - 'follow-link t - 'help-echo - "mouse-2: go to this occurrence")) - (out-line - (concat - match-prefix - ;; Add non-numeric prefix to all non-first lines - ;; of multi-line matches. - (replace-regexp-in-string - "\n" - (if prefix-face - (propertize "\n :" 'font-lock-face prefix-face) - "\n :") - match-str) - ;; Add marker at eol, but no mouse props. - (propertize "\n" 'occur-target marker))) - (data - (if (= nlines 0) - ;; The simple display style - out-line - ;; The complex multi-line display style. - (setq ret (occur-context-lines - out-line nlines keep-props begpt endpt - curr-line prev-line prev-after-lines - prefix-face)) - ;; Set first elem of the returned list to `data', - ;; and the second elem to `prev-after-lines'. - (setq prev-after-lines (nth 1 ret)) - (nth 0 ret)))) - ;; Actually insert the match display data - (with-current-buffer out-buf - (when (and list-matching-lines-jump-to-current-line - (not multi-occur-p) - (not orig-line-shown-p) - (>= curr-line orig-line)) - (insert - (concat - (propertize - (format "%7d:%s" orig-line orig-line-str) - 'face list-matching-lines-current-line-face - 'mouse-face 'mode-line-highlight - 'help-echo "Current line") "\n")) - (setq orig-line-shown-p t finalpt (point))) - (insert data))) - (goto-char endpt)) - (if endpt - (progn - ;; Sum line numbers between first and last match lines. - (setq curr-line (+ curr-line (count-lines begpt endpt) - ;; Add 1 for empty last match line since - ;; count-lines returns 1 line less. - (if (and (bolp) (eolp)) 1 0))) - ;; On to the next match... - (forward-line 1)) - (goto-char (point-max))) - (setq prev-line (1- curr-line))) - ;; Insert original line if haven't done yet. - (when (and list-matching-lines-jump-to-current-line - (not multi-occur-p) - (not orig-line-shown-p)) - (with-current-buffer out-buf - (insert - (concat - (propertize - (format "%7d:%s" orig-line orig-line-str) - 'face list-matching-lines-current-line-face - 'mouse-face 'mode-line-highlight - 'help-echo "Current line") "\n")))) - ;; Flush remaining context after-lines. - (when prev-after-lines - (with-current-buffer out-buf - (insert (apply #'concat (occur-engine-add-prefix - prev-after-lines prefix-face))))))) - (when (not (zerop lines)) ;; is the count zero? - (setq global-lines (+ global-lines lines) - global-matches (+ global-matches matches)) - (with-current-buffer out-buf - (goto-char headerpt) - (let ((beg (point)) - end) - (insert (propertize - (format "%d match%s%s%s in buffer: %s%s\n" - matches (if (= matches 1) "" "es") - ;; Don't display the same number of lines - ;; and matches in case of 1 match per line. - (if (= lines matches) - "" (format " in %d line%s" - lines (if (= lines 1) "" "s"))) - ;; Don't display regexp for multi-buffer. - (if (> (length buffers) 1) - "" (occur-regexp-descr regexp)) - (buffer-name buf) - (if in-region-p - (format " within region: %d-%d" - occur--region-start - occur--region-end) - "")) - 'read-only t)) - (setq end (point)) - (add-text-properties beg end `(occur-title ,buf)) - (when title-face - (add-face-text-property beg end title-face)) - (goto-char (if finalpt - (setq occur--final-pos - (cl-incf finalpt (- end beg))) - (point-min))))))))) + '(occur-match t) curstring) + (when match-face + ;; Add `match-face' to faces copied from the buffer. + (add-face-text-property + (match-beginning 0) (match-end 0) + match-face nil curstring)) + ;; Avoid infloop (Bug#7593). + (let ((end (match-end 0))) + (setq start (if (= start end) (1+ start) end))))) + ;; Generate the string to insert for this match + (let* ((match-prefix + ;; Using 7 digits aligns tabs properly. + (apply #'propertize (format "%7d:" curr-line) + (append + (when prefix-face + `(font-lock-face ,prefix-face)) + `(occur-prefix t mouse-face (highlight) + ;; Allow insertion of text + ;; at the end of the prefix + ;; (for Occur Edit mode). + front-sticky t + rear-nonsticky t + occur-target ,marker + follow-link t + help-echo "mouse-2: go to this occurrence")))) + (match-str + ;; We don't put `mouse-face' on the newline, + ;; because that loses. And don't put it + ;; on context lines to reduce flicker. + (propertize curstring 'mouse-face (list 'highlight) + 'occur-target marker + 'follow-link t + 'help-echo + "mouse-2: go to this occurrence")) + (out-line + (concat + match-prefix + ;; Add non-numeric prefix to all non-first lines + ;; of multi-line matches. + (replace-regexp-in-string + "\n" + (if prefix-face + (propertize + "\n :" 'font-lock-face prefix-face) + "\n :") + match-str) + ;; Add marker at eol, but no mouse props. + (propertize "\n" 'occur-target marker))) + (data + (if (= nlines 0) + ;; The simple display style + out-line + ;; The complex multi-line display style. + (setq ret (occur-context-lines + out-line nlines keep-props begpt + endpt curr-line prev-line + prev-after-lines prefix-face)) + ;; Set first elem of the returned list to `data', + ;; and the second elem to `prev-after-lines'. + (setq prev-after-lines (nth 1 ret)) + (nth 0 ret)))) + ;; Actually insert the match display data + (with-current-buffer out-buf + (when (and list-matching-lines-jump-to-current-line + (not multi-occur-p) + (not orig-line-shown-p) + (>= curr-line orig-line)) + (insert + (concat + (propertize + (format "%7d:%s" orig-line orig-line-str) + 'face list-matching-lines-current-line-face + 'mouse-face 'mode-line-highlight + 'help-echo "Current line") "\n")) + (setq orig-line-shown-p t finalpt (point))) + (insert data))) + (goto-char endpt)) + (if endpt + (progn + ;; Sum line numbers between first and last match lines. + (setq curr-line (+ curr-line (count-lines begpt endpt) + ;; Add 1 for empty last match line + ;; since count-lines returns one + ;; line less. + (if (and (bolp) (eolp)) 1 0))) + ;; On to the next match... + (forward-line 1)) + (goto-char (point-max))) + (setq prev-line (1- curr-line))) + ;; Insert original line if haven't done yet. + (when (and list-matching-lines-jump-to-current-line + (not multi-occur-p) + (not orig-line-shown-p)) + (with-current-buffer out-buf + (insert + (concat + (propertize + (format "%7d:%s" orig-line orig-line-str) + 'face list-matching-lines-current-line-face + 'mouse-face 'mode-line-highlight + 'help-echo "Current line") "\n")))) + ;; Flush remaining context after-lines. + (when prev-after-lines + (with-current-buffer out-buf + (insert (apply #'concat (occur-engine-add-prefix + prev-after-lines prefix-face))))))) + (when (not (zerop lines)) ;; is the count zero? + (setq global-lines (+ global-lines lines) + global-matches (+ global-matches matches)) + (with-current-buffer out-buf + (goto-char headerpt) + (let ((beg (point)) + end) + (insert (propertize + (format "%d match%s%s%s in buffer: %s%s\n" + matches (if (= matches 1) "" "es") + ;; Don't display the same number of lines + ;; and matches in case of 1 match per line. + (if (= lines matches) + "" (format " in %d line%s" + lines + (if (= lines 1) "" "s"))) + ;; Don't display regexp for multi-buffer. + (if (> (length buffers) 1) + "" (occur-regexp-descr regexp)) + (buffer-name buf) + (if in-region-p + (format " within region: %d-%d" + occur--region-start + occur--region-end) + "")) + 'read-only t)) + (setq end (point)) + (add-text-properties beg end `(occur-title ,buf)) + (when title-face + (add-face-text-property beg end title-face)) + (goto-char (if finalpt + (setq occur--final-pos + (cl-incf finalpt (- end beg))) + (point-min)))))))))) ;; Display total match count and regexp for multi-buffer. (when (and (not (zerop global-lines)) (> (length buffers) 1)) (goto-char (point-min)) commit 29520b083f4bddbf5f7d3bbf0b3d30f31025f4f8 Author: OGAWA Hirofumi Date: Sat Nov 18 12:29:41 2017 +0200 Fix quick-calc in C mode with hex values * lisp/calc/calc-aent.el (math-read-token): Make sure the match against "0[xX][0-9a-fA-F]+" is found at math-exp-pos. See http://lists.gnu.org/archive/html/emacs-devel/2017-11/msg00174.html for the details. Copyright-paperwork-exempt: yes diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index f70a6d0eb0..997ac3d583 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el @@ -728,7 +728,9 @@ in Calc algebraic input.") math-exp-str (1- math-exp-pos)) (1- math-exp-pos)))))) (or (and (memq calc-language calc-lang-c-type-hex) - (string-match "0[xX][0-9a-fA-F]+" math-exp-str math-exp-pos)) + (eq (string-match "0[xX][0-9a-fA-F]+" math-exp-str + math-exp-pos) + math-exp-pos)) (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\(0*\\([2-9]\\|1[0-4]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-dA-D.]+[eE][-+_]?[0-9]+\\|0*\\([2-9]\\|[0-2][0-9]\\|3[0-6]\\)\\(#[#]?\\|\\^\\^\\)[0-9a-zA-Zα-ωΑ-Ω:.]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" math-exp-str math-exp-pos)) (setq math-exp-token 'number commit 3e801240986af911e5d97828a2743b04237c9f9c Author: Eli Zaretskii Date: Sat Nov 18 11:42:06 2017 +0200 Improve documentation of dired-next/prev-marked-file * lisp/dired.el (dired-next-marked-file, dired-prev-marked-file): Doc fixes. (Bug#29340) diff --git a/lisp/dired.el b/lisp/dired.el index f1a74639a9..eb88e27375 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3363,9 +3363,14 @@ argument or confirmation)." (save-excursion (not (dired-move-to-filename)))) (defun dired-next-marked-file (arg &optional wrap opoint) - "Move to the next marked file. -If WRAP is non-nil, wrap around to the beginning of the buffer if -we reach the end." + "Move to the ARGth next marked file. +ARG is the numeric prefix argument and defaults to 1. +If WRAP is non-nil, which happens interactively, wrap around +to the beginning of the buffer and search from there, if no +marked file is found after this line. +Optional argument OPOINT specifies the buffer position to +return to if no ARGth marked file is found; it defaults to +the position where this command was invoked." (interactive "p\np") (or opoint (setq opoint (point)));; return to where interactively started (if (if (> arg 0) @@ -3382,9 +3387,11 @@ we reach the end." (dired-next-marked-file arg nil opoint)))) (defun dired-prev-marked-file (arg &optional wrap) - "Move to the previous marked file. -If WRAP is non-nil, wrap around to the end of the buffer if we -reach the beginning of the buffer." + "Move to the ARGth previous marked file. +ARG is the numeric prefix argument and defaults to 1. +If WRAP is non-nil, which happens interactively, wrap around +to the end of the buffer and search backwards from there, if +no ARGth marked file is found before this line." (interactive "p\np") (dired-next-marked-file (- arg) wrap)) commit 90add182a4d7b42942722d6cffb1ca213e546a37 Author: Eli Zaretskii Date: Fri Nov 17 21:37:04 2017 +0200 Prevent aborts in line-move-visual * src/indent.c (line_number_display_width): Avoid assertion violations in init_iterator when the window's buffer was temporarily switched without updating window-start. (Bug#29326) diff --git a/src/indent.c b/src/indent.c index 192eec72ef..5f931a511e 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1959,21 +1959,26 @@ line_number_display_width (struct window *w, int *width, int *pixel_width) else { struct it it; - struct text_pos wstart; + struct text_pos startpos; bool saved_restriction = false; ptrdiff_t count = SPECPDL_INDEX (); - SET_TEXT_POS_FROM_MARKER (wstart, w->start); + SET_TEXT_POS_FROM_MARKER (startpos, w->start); void *itdata = bidi_shelve_cache (); - /* We must start from window's start point, but it could be - outside the accessible region. */ - if (wstart.charpos < BEGV || wstart.charpos > ZV) + /* We want to start from window's start point, but it could be + outside the accessible region, in which case we widen the + buffer temporarily. It could even be beyond the buffer's end + (Org mode's display of source code snippets is known to cause + that), in which case we just punt and start from point instead. */ + if (startpos.charpos > Z) + SET_TEXT_POS (startpos, PT, PT_BYTE); + if (startpos.charpos < BEGV || startpos.charpos > ZV) { record_unwind_protect (save_restriction_restore, save_restriction_save ()); Fwiden (); saved_restriction = true; } - start_display (&it, w, wstart); + start_display (&it, w, startpos); /* The call to move_it_by_lines below will not generate a line number if the first line shown in the window is hscrolled such that all of its display elements are out of view. So we commit 648c128b5f5eb8988aabcc2073b706d2561acd15 Author: Eli Zaretskii Date: Fri Nov 17 17:41:23 2017 +0200 More fixes in src/.gdbinit * src/.gdbinit (pwinx): Update to match 'struct window'. (pcursorx): Use "." instead of "->" because the argument is a struct, not a pointer. diff --git a/src/.gdbinit b/src/.gdbinit index 48bb5dfadb..e22d03ea47 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -352,7 +352,7 @@ end define pcursorx set $cp = $arg0 - printf "y=%d x=%d vpos=%d hpos=%d", $cp->y, $cp->x, $cp->vpos, $cp->hpos + printf "y=%d x=%d vpos=%d hpos=%d", $cp.y, $cp.x, $cp.vpos, $cp.hpos end document pcursorx Pretty print a window cursor. @@ -369,11 +369,11 @@ end define pwinx set $w = $arg0 - if ($w->mini_p != Qnil) + if ($w->mini != 0) printf "Mini " end - printf "Window %d ", $int - xgetptr $w->buffer + printf "Window %d ", $w->sequence_number + xgetptr $w->contents set $tem = (struct buffer *) $ptr xgetptr $tem->name_ printf "%s", ((struct Lisp_String *) $ptr)->u.s.data @@ -381,16 +381,14 @@ define pwinx xgetptr $w->start set $tem = (struct Lisp_Marker *) $ptr printf "start=%d end:", $tem->charpos - if ($w->window_end_valid != Qnil) - xgetint $w->window_end_pos - printf "pos=%d", $int - xgetint $w->window_end_vpos - printf " vpos=%d", $int + if ($w->window_end_valid != 0) + printf "pos=%d", $w->window_end_pos + printf " vpos=%d", $w->window_end_vpos else printf "invalid" end printf " vscroll=%d", $w->vscroll - if ($w->force_start != Qnil) + if ($w->force_start != 0) printf " FORCE_START" end if ($w->must_be_updated_p) commit 104f3e51fe6d22cf0ee280509df1b133cb8e1f89 Author: Robert Pluim Date: Fri Nov 17 15:39:02 2017 +0200 Document how to enter whitespace when using grep-read-files * lisp/progmodes/grep.el (lgrep, rgrep, grep-read-files): Explain how to enter whitespace when using grep-read-files. (Bug#29303) * lisp/progmodes/project.el (project-find-regexp): Likewise. * lisp/vc/vc-git.el (vc-git-grep): Likewise. diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index d0404fdeaf..c2d8022354 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -904,7 +904,9 @@ substitution string. Note dynamic scoping of variables.") (defun grep-read-files (regexp) "Read a file-name pattern arg for interactive grep. -The pattern can include shell wildcards." +The pattern can include shell wildcards. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'." (let* ((bn (or (buffer-file-name) (replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))) (fn (and bn @@ -954,7 +956,9 @@ The pattern can include shell wildcards." "Run grep, searching for REGEXP in FILES in directory DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. -entering `ch' is equivalent to `*.[ch]'. +entering `ch' is equivalent to `*.[ch]'. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed. @@ -1032,7 +1036,9 @@ This command shares argument histories with \\[rgrep] and \\[grep]." "Recursively grep for REGEXP in FILES in directory tree rooted at DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. -entering `ch' is equivalent to `*.[ch]'. +entering `ch' is equivalent to `*.[ch]'. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed. diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 9dc0da4ad5..93a945edaa 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -307,7 +307,11 @@ DIRS must contain directory names." (defun project-find-regexp (regexp) "Find all matches for REGEXP in the current project's roots. With \\[universal-argument] prefix, you can specify the directory -to search in, and the file name pattern to search for." +to search in, and the file name pattern to search for. The +pattern may use abbreviations defined in `grep-files-aliases', +e.g. entering `ch' is equivalent to `*.[ch]'. As whitespace +triggers completion when entering a pattern, including it +requires quoting, e.g. `\\[quoted-insert]'." (interactive (list (project--read-regexp))) (let* ((pr (project-current t)) (dirs (if current-prefix-arg diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index ed85603f82..060072ea54 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1407,7 +1407,9 @@ This requires git 1.8.4 or later, for the \"-L\" option of \"git log\"." "Run git grep, searching for REGEXP in FILES in directory DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. -entering `ch' is equivalent to `*.[ch]'. +entering `ch' is equivalent to `*.[ch]'. As whitespace triggers +completion when entering a pattern, including it requires +quoting, e.g. `\\[quoted-insert]'. With \\[universal-argument] prefix, you can edit the constructed shell command line before it is executed. commit d8e0951d5f680aa7f688416eec19a1f062241f44 Author: Michael Albinus Date: Fri Nov 17 08:53:05 2017 +0100 ; Remove Tramp test instrumentation. Do not merge * test/Makefile.in: Remove instrumentation for tramp-tests. * test/lisp/net/tramp-tests.el (tramp-test41-asynchronous-requests): Remove instrumentation. diff --git a/test/Makefile.in b/test/Makefile.in index 17ab36f5af..e316c88235 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -146,8 +146,7 @@ endif $(AM_V_ELC)$(emacs) -f batch-byte-compile $< ## Save logs, and show logs for failed tests. -WRITE_LOG = $(if $(and ${EMACS_HYDRA_CI}, $(findstring tramp, $@)), |& tee $@, > $@ 2>&1) \ - || { STAT=$$?; cat $@; exit $$STAT; } +WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; } ifeq ($(TEST_LOAD_EL), yes) testloadfile = $*.el diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 77b1e2dcc9..cf85b071e1 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4452,7 +4452,6 @@ process sentinels. They shall not disturb each other." ;; seconds, and we send a SIGUSR1 signal after 300 seconds. (with-timeout (300 (tramp--test-timeout-handler)) (define-key special-event-map [sigusr1] 'tramp--test-timeout-handler) - (tramp--test-instrument-test-case (if (getenv "EMACS_HYDRA_CI") 10 0) (let* (;; For the watchdog. (default-directory (expand-file-name temporary-file-directory)) (watchdog @@ -4500,16 +4499,11 @@ process sentinels. They shall not disturb each other." (default-directory tmp-name) (file (buffer-name (nth (random (length buffers)) buffers)))) - (tramp--test-message - "Start timer %s %s" file (current-time-string)) (funcall timer-operation file) ;; Adjust timer if it takes too much time. (when (> (- (float-time) time) timer-repeat) (setq timer-repeat (* 1.5 timer-repeat)) - (setf (timer--repeat-delay timer) timer-repeat) - (tramp--test-message "Increase timer %s" timer-repeat)) - (tramp--test-message - "Stop timer %s %s" file (current-time-string))))))) + (setf (timer--repeat-delay timer) timer-repeat))))))) ;; Create temporary buffers. The number of buffers ;; corresponds to the number of processes; it could be @@ -4556,8 +4550,6 @@ process sentinels. They shall not disturb each other." (proc (get-buffer-process buf)) (file (process-get proc 'foo)) (count (process-get proc 'bar))) - (tramp--test-message - "Start action %d %s %s" count buf (current-time-string)) ;; Regular operation prior process action. (if (= count 0) (should-not (file-attributes file)) @@ -4571,8 +4563,6 @@ process sentinels. They shall not disturb each other." (if (= count 2) (should-not (file-attributes file)) (should (file-attributes file))) - (tramp--test-message - "Stop action %d %s %s" count buf (current-time-string)) (process-put proc 'bar (1+ count)) (unless (process-live-p proc) (setq buffers (delq buf buffers)))))) @@ -4580,7 +4570,6 @@ process sentinels. They shall not disturb each other." ;; Checks. All process output shall exists in the ;; respective buffers. All created files shall be ;; deleted. - (tramp--test-message "Check %s" (current-time-string)) (dolist (buf buffers) (with-current-buffer buf (should (string-equal (format "%s\n" buf) (buffer-string))))) @@ -4595,7 +4584,7 @@ process sentinels. They shall not disturb each other." (ignore-errors (delete-process (get-buffer-process buf))) (ignore-errors (kill-buffer buf))) (ignore-errors (cancel-timer timer)) - (ignore-errors (delete-directory tmp-name 'recursive))))))) + (ignore-errors (delete-directory tmp-name 'recursive)))))) (ert-deftest tramp-test42-recursive-load () "Check that Tramp does not fail due to recursive load." commit 42c8768134dcfaaf08637e36fe478605c1957517 Author: Eli Zaretskii Date: Fri Nov 17 12:08:06 2017 +0200 Fix .gdbinit following lisp.h changes * src/.gdbinit (xsymname, pwinx, pgx, xbuffer, xcar, xcdr, xlist) (xprintstr): Adapt to latest changes in Lisp object C structures. (Bug#29332) diff --git a/src/.gdbinit b/src/.gdbinit index 60f6348715..48bb5dfadb 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -78,7 +78,7 @@ end # Access the name of a symbol define xsymname xgetsym $arg0 - set $symname = $ptr->name + set $symname = $ptr->u.s.name end # Set up something to print out s-expressions. @@ -376,7 +376,7 @@ define pwinx xgetptr $w->buffer set $tem = (struct buffer *) $ptr xgetptr $tem->name_ - printf "%s", ((struct Lisp_String *) $ptr)->data + printf "%s", ((struct Lisp_String *) $ptr)->u.s.data printf "\n" xgetptr $w->start set $tem = (struct Lisp_Marker *) $ptr @@ -504,7 +504,7 @@ define pgx xgettype ($g.object) if ($type == Lisp_String) xgetptr $g.object - printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->data, $g.charpos + printf " str=0x%x[%d]", ((struct Lisp_String *)$ptr)->u.s.data, $g.charpos else printf " pos=%d", $g.charpos end @@ -896,7 +896,7 @@ define xbuffer xgetptr $ print (struct buffer *) $ptr xgetptr $->name_ - output ((struct Lisp_String *) $ptr)->data + output ((struct Lisp_String *) $ptr)->u.s.data echo \n end document xbuffer @@ -935,7 +935,7 @@ end define xcar xgetptr $ xgettype $ - print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->car : 0) + print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.car : 0) end document xcar Assume that $ is an Emacs Lisp pair and print its car. @@ -944,7 +944,7 @@ end define xcdr xgetptr $ xgettype $ - print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.cdr : 0) + print/x ($type == Lisp_Cons ? ((struct Lisp_Cons *) $ptr)->u.s.u.cdr : 0) end document xcdr Assume that $ is an Emacs Lisp pair and print its cdr. @@ -957,9 +957,9 @@ define xlist set $nil = $ptr set $i = 0 while $cons != $nil && $i < 10 - p/x $cons->car + p/x $cons->u.s.car xpr - xgetptr $cons->u.cdr + xgetptr $cons->u.s.u.cdr set $cons = (struct Lisp_Cons *) $ptr set $i = $i + 1 printf "---\n" @@ -1072,13 +1072,13 @@ Print $ as a lisp object of any type. end define xprintstr - set $data = (char *) $arg0->data - set $strsize = ($arg0->size_byte < 0) ? ($arg0->size & ~ARRAY_MARK_FLAG) : $arg0->size_byte + set $data = (char *) $arg0->u.s.data + set $strsize = ($arg0->u.s.size_byte < 0) ? ($arg0->u.s.size & ~ARRAY_MARK_FLAG) : $arg0->u.s.size_byte # GDB doesn't like zero repetition counts if $strsize == 0 output "" else - output ($arg0->size > 1000) ? 0 : ($data[0])@($strsize) + output ($arg0->u.s.size > 1000) ? 0 : ($data[0])@($strsize) end end @@ -1255,7 +1255,7 @@ commands xsymname globals.f_Vinitial_window_system xgetptr $symname set $tem = (struct Lisp_String *) $ptr - set $tem = (char *) $tem->data + set $tem = (char *) $tem->u.s.data # If we are running in synchronous mode, we want a chance to look # around before Emacs exits. Perhaps we should put the break # somewhere else instead... commit 720322aab8cd8ffc24481f280c3acf60efdbc28b Author: Paul Eggert Date: Thu Nov 16 00:00:31 2017 -0800 ; Spelling fixes diff --git a/ChangeLog.3 b/ChangeLog.3 index 940379cf60..e7831a37aa 100644 --- a/ChangeLog.3 +++ b/ChangeLog.3 @@ -6941,7 +6941,7 @@ * test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084): Add comments to explain the test logic. Pass '--binary' option to 'patch' program in windows environments. - Check explicitely that a backup is created before compare file contents. + Check explicitly that a backup is created before compare file contents. * test/lisp/dired-tests.el (dired-test-bug25609): Declare variable 'dired-dwim-target' right before the test. @@ -13221,7 +13221,7 @@ Remove Emacs 23 compat code from Tramp * doc/misc/tramp.texi (Remote processes): Don't mention - Emacs 24 explicitely. + Emacs 24 explicitly. (Frequently Asked Questions): Remove Emacs 23 from compatibility list. diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 8e7cd13088..f3cb810913 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -597,7 +597,7 @@ the Perl source to be checked as its standard input." "Perl backend for Flymake. Launches `perl-flymake-command' (which see) and passes to its standard input the contents of the current buffer. The output of this -command is analysed for error and warning messages." +command is analyzed for error and warning messages." (unless (executable-find (car perl-flymake-command)) (error "Cannot find a suitable checker")) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 1f4aa6d9fb..da08bb0788 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2268,7 +2268,7 @@ the Ruby source to be checked as its standard input." "Ruby backend for Flymake. Launches `ruby-flymake-command' (which see) and passes to its standard input the contents of the current buffer. The output of this -command is analysed for error and warning messages." +command is analyzed for error and warning messages." (unless (executable-find (car ruby-flymake-command)) (error "Cannot find a suitable checker")) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 68236daf49..77b1e2dcc9 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -3070,7 +3070,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (file-selinux-context tmp-name3)) ;; We cannot expect that copying over file system ;; boundaries keeps SELinux context. So we copy it - ;; explicitely. + ;; explicitly. (should (set-file-selinux-context tmp-name3 (file-selinux-context tmp-name1))) @@ -3104,7 +3104,7 @@ This tests also `make-symbolic-link', `file-truename' and `add-name-to-file'." (should (file-selinux-context tmp-name1)) ;; We cannot expect that copying over file system ;; boundaries keeps SELinux context. So we copy it - ;; explicitely. + ;; explicitly. (should (set-file-selinux-context tmp-name1 (file-selinux-context tmp-name3))) commit 617c55681307c2d8203778c9f654f279c7bddb27 Author: Charles A. Roelli Date: Wed Nov 15 20:35:18 2017 +0100 * lisp/simple.el (shell-command): Doc fixes. diff --git a/lisp/simple.el b/lisp/simple.el index 65906c8869..7d47d0f864 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3393,10 +3393,10 @@ The optional second argument OUTPUT-BUFFER, if non-nil, says to put the output in some other buffer. If OUTPUT-BUFFER is a buffer or buffer name, erase that buffer and insert the output there; a non-nil value of -`shell-command-dont-erase-buffer' prevent to erase the buffer. -If OUTPUT-BUFFER is not a buffer and not nil, insert the output -in current buffer after point leaving mark after it. -This cannot be done asynchronously. +`shell-command-dont-erase-buffer' prevents the buffer from being +erased. If OUTPUT-BUFFER is not a buffer and not nil, insert the +output in current buffer after point leaving mark after it. This +cannot be done asynchronously. If the command terminates without error, but generates output, and you did not specify \"insert it in the current buffer\", @@ -3404,7 +3404,7 @@ the output can be displayed in the echo area or in its buffer. If the output is short enough to display in the echo area \(determined by the variable `max-mini-window-height' if `resize-mini-windows' is non-nil), it is shown there. -Otherwise,the buffer containing the output is displayed. +Otherwise, the buffer containing the output is displayed. If there is output and an error, and you did not specify \"insert it in the current buffer\", a message about the error goes at the end commit 1faade882165de2e9bd63702c59c8f26531c18ed Author: Noam Postavsky Date: Wed Nov 15 07:03:23 2017 -0500 Fix marker adjustment for undo (Bug#29118) * lisp/simple.el (primitive-undo): Compare marker against absolute value of POS, because the sign of POS is irrelevant to markers. diff --git a/lisp/simple.el b/lisp/simple.el index 4db81071b5..65906c8869 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2565,10 +2565,10 @@ Return what remains of the list." (setq did-apply t))) ;; Element (STRING . POS) means STRING was deleted. (`(,(and string (pred stringp)) . ,(and pos (pred integerp))) - (when (let ((apos (abs pos))) - (or (< apos (point-min)) (> apos (point-max)))) - (error "Changes to be undone are outside visible portion of buffer")) - (let (valid-marker-adjustments) + (let ((valid-marker-adjustments nil) + (apos (abs pos))) + (when (or (< apos (point-min)) (> apos (point-max))) + (error "Changes to be undone are outside visible portion of buffer")) ;; Check that marker adjustments which were recorded ;; with the (STRING . POS) record are still valid, ie ;; the markers haven't moved. We check their validity @@ -2579,7 +2579,7 @@ Return what remains of the list." (let* ((marker-adj (pop list)) (m (car marker-adj))) (and (eq (marker-buffer m) (current-buffer)) - (= pos m) + (= apos m) (push marker-adj valid-marker-adjustments)))) ;; Insert string and adjust point (if (< pos 0)