From 9f4f130b793e3a6ef7abef99e3e892271128e4b2 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 3 Nov 2017 11:50:13 +0200 Subject: [PATCH 01/48] Fix buffer name comparison in async shell-command * lisp/simple.el (shell-command): Keep track of output-buffer by its name, not by its object. (Bug#28997) --- lisp/simple.el | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index 372e153d626..4db81071b58 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -3487,10 +3487,11 @@ the use of a shell (with its need to quote arguments)." (save-match-data (if (string-match "[ \t]*&[ \t]*\\'" command) ;; Command ending with ampersand means asynchronous. - (let ((buffer (get-buffer-create - (or output-buffer "*Async Shell Command*"))) - (directory default-directory) - proc) + (let* ((buffer (get-buffer-create + (or output-buffer "*Async Shell Command*"))) + (bname (buffer-name buffer)) + (directory default-directory) + proc) ;; Remove the ampersand. (setq command (substring command 0 (match-beginning 0))) ;; Ask the user what to do with already running process. @@ -3505,30 +3506,24 @@ the use of a shell (with its need to quote arguments)." ((eq async-shell-command-buffer 'confirm-new-buffer) ;; If will create a new buffer, query first. (if (yes-or-no-p "A command is running in the default buffer. Use a new buffer? ") - (setq buffer (generate-new-buffer - (or (and (bufferp output-buffer) (buffer-name output-buffer)) - output-buffer "*Async Shell Command*"))) + (setq buffer (generate-new-buffer bname)) (error "Shell command in progress"))) ((eq async-shell-command-buffer 'new-buffer) ;; It will create a new buffer. - (setq buffer (generate-new-buffer - (or (and (bufferp output-buffer) (buffer-name output-buffer)) - output-buffer "*Async Shell Command*")))) + (setq buffer (generate-new-buffer bname))) ((eq async-shell-command-buffer 'confirm-rename-buffer) ;; If will rename the buffer, query first. (if (yes-or-no-p "A command is running in the default buffer. Rename it? ") (progn (with-current-buffer buffer (rename-uniquely)) - (setq buffer (get-buffer-create - (or output-buffer "*Async Shell Command*")))) + (setq buffer (get-buffer-create bname))) (error "Shell command in progress"))) ((eq async-shell-command-buffer 'rename-buffer) ;; It will rename the buffer. (with-current-buffer buffer (rename-uniquely)) - (setq buffer (get-buffer-create - (or output-buffer "*Async Shell Command*")))))) + (setq buffer (get-buffer-create bname))))) (with-current-buffer buffer (shell-command--save-pos-or-erase) (setq default-directory directory) @@ -3537,19 +3532,18 @@ the use of a shell (with its need to quote arguments)." (setq mode-line-process '(":%s")) (require 'shell) (shell-mode) (set-process-sentinel proc 'shell-command-sentinel) - ;; Use the comint filter for proper handling of carriage motion - ;; (see `comint-inhibit-carriage-motion'),. + ;; Use the comint filter for proper handling of + ;; carriage motion (see comint-inhibit-carriage-motion). (set-process-filter proc 'comint-output-filter) (if async-shell-command-display-buffer (display-buffer buffer '(nil (allow-no-window . t))) (add-function :before (process-filter proc) - `(lambda (process string) - (when (and (= 0 (buffer-size (process-buffer process))) - (string= (buffer-name (process-buffer process)) - ,(or output-buffer "*Async Shell Command*"))) - (display-buffer (process-buffer process)))) - )) - )) + (lambda (process _string) + (let ((buf (process-buffer process))) + (when (and (zerop (buffer-size buf)) + (string= (buffer-name buf) + bname)) + (display-buffer buf)))))))) ;; Otherwise, command is executed synchronously. (shell-command-on-region (point) (point) command output-buffer nil error-buffer))))))) From caa63cc96cfd2d21872eba17a474b4535178ad58 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 3 Nov 2017 08:33:13 -0400 Subject: [PATCH 02/48] * lisp/progmodes/flymake.el (flymake-start): Fix dead buffer case Don't try to flymake-start within a buffer that doesn't exist any more. --- lisp/progmodes/flymake.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 1048bc50655..c2349d8c7cc 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -601,8 +601,8 @@ not expected." (null expected-token)) ;; should never happen (flymake-error "Unexpected report from stopped backend %s" backend)) - ((and (not (eq expected-token token)) - (not force)) + ((not (or (eq expected-token token) + force)) (flymake-error "Obsolete report from backend %s with explanation %s" backend explanation)) ((eq :panic report-action) @@ -742,8 +742,11 @@ Interactively, with a prefix arg, FORCE is t." () (remove-hook 'post-command-hook #'start-post-command nil) - (with-current-buffer buffer - (flymake-start (remove 'post-command deferred) force))) + ;; The buffer may have disappeared already, e.g. because of + ;; code like `(with-temp-buffer (python-mode) ...)'. + (when (buffer-live-p buffer) + (with-current-buffer buffer + (flymake-start (remove 'post-command deferred) force)))) (start-on-display () (remove-hook 'window-configuration-change-hook #'start-on-display From 78e9065e9f090ea9c10f89495eab9f8069597b74 Mon Sep 17 00:00:00 2001 From: Paul Pogonyshev Date: Fri, 3 Nov 2017 15:49:51 +0200 Subject: [PATCH 03/48] * lisp/emacs-lisp/generator.el (iter-do): Add a debug declaration. --- lisp/emacs-lisp/generator.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/emacs-lisp/generator.el b/lisp/emacs-lisp/generator.el index 410e4edcc92..ef6cfba420c 100644 --- a/lisp/emacs-lisp/generator.el +++ b/lisp/emacs-lisp/generator.el @@ -718,7 +718,8 @@ is blocked." "Loop over values from an iterator. Evaluate BODY with VAR bound to each value from ITERATOR. Return the value with which ITERATOR finished iteration." - (declare (indent 1)) + (declare (indent 1) + (debug ((symbolp form) body))) (let ((done-symbol (cps--gensym "iter-do-iterator-done")) (condition-symbol (cps--gensym "iter-do-condition")) (it-symbol (cps--gensym "iter-do-iterator")) From 2a973edeacefcabb9fd8024188b7e167f0f9a9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 13 Oct 2017 15:13:14 +0100 Subject: [PATCH 04/48] Honor window-switching intents in xref-find-definitions (bug#28814) When there is more than one xref to jump to, and an *xref* window appears to help the user choose, the original intent to open a definition in another window or frame is remembered when the choice to go to or show a reference is finally made. * lisp/progmodes/xref.el (xref--show-pos-in-buf): Rewrite. (xref--original-window-intent): New variable. (xref--original-window): Rename from xref--window and move up here for clarity. (xref--show-pos-in-buf): Rewrite. Don't take SELECT arg here. (xref--show-location): Handle window selection decision here. (xref--window): Rename to xref--original-window. (xref-show-location-at-point): Don't attempt window management here. (xref--show-xrefs): Ensure display-action intent is saved. --- lisp/progmodes/xref.el | 69 +++++++++++++++++++++++++++++------------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 3dbf65ef6f5..ee23bc7a64e 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -448,43 +448,68 @@ If SELECT is non-nil, select the target window." (when xref-w (set-window-dedicated-p xref-w xref-w-dedicated))))) -(defun xref--show-pos-in-buf (pos buf select) - (let ((xref-buf (current-buffer)) - win) +(defvar-local xref--original-window-intent nil + "Original window-switching intent before xref buffer creation.") + +(defvar-local xref--original-window nil + "The original window this xref buffer was created from.") + +(defun xref--show-pos-in-buf (pos buf) + "Goto and display position POS of buffer BUF in a window. +Honor `xref--original-window-intent', run `xref-after-jump-hook' +and finally return the window." + (let* ((xref-buf (current-buffer)) + (pop-up-frames + (or (eq xref--original-window-intent 'frame) + pop-up-frames)) + (action + (cond ((memq + xref--original-window-intent + '(window frame)) + t) + ((and + (window-live-p xref--original-window) + (or (not (window-dedicated-p xref--original-window)) + (eq (window-buffer xref--original-window) buf))) + `(,(lambda (buf _alist) + (set-window-buffer xref--original-window buf) + xref--original-window)))))) (with-selected-window - (xref--with-dedicated-window - (display-buffer buf)) + (with-selected-window + ;; Just before `display-buffer', place ourselves in the + ;; original window to suggest preserving it. Of course, if + ;; user has deleted the original window, all bets are off, + ;; just use the selected one. + (or (and (window-live-p xref--original-window) + xref--original-window) + (selected-window)) + (display-buffer buf action)) (xref--goto-char pos) (run-hooks 'xref-after-jump-hook) (let ((buf (current-buffer))) - (setq win (selected-window)) (with-current-buffer xref-buf - (setq-local other-window-scroll-buffer buf)))) - (when select - (select-window win)))) + (setq-local other-window-scroll-buffer buf))) + (selected-window)))) (defun xref--show-location (location &optional select) (condition-case err (let* ((marker (xref-location-marker location)) (buf (marker-buffer marker))) - (xref--show-pos-in-buf marker buf select)) + (cond (select + (select-window (xref--show-pos-in-buf marker buf))) + (t + (save-selected-window + (xref--with-dedicated-window + (xref--show-pos-in-buf marker buf)))))) (user-error (message (error-message-string err))))) -(defvar-local xref--window nil - "The original window this xref buffer was created from.") - (defun xref-show-location-at-point () "Display the source of xref at point in the appropriate window, if any." (interactive) (let* ((xref (xref--item-at-point)) (xref--current-item xref)) (when xref - ;; Try to avoid the window the current xref buffer was - ;; originally created from. - (if (window-live-p xref--window) - (with-selected-window xref--window - (xref--show-location (xref-item-location xref))) - (xref--show-location (xref-item-location xref)))))) + (xref--show-location (xref-item-location xref))))) (defun xref-next-line () "Move to the next xref and display its source in the appropriate window." @@ -726,7 +751,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (xref--xref-buffer-mode) (pop-to-buffer (current-buffer)) (goto-char (point-min)) - (setq xref--window (assoc-default 'window alist)) + (setq xref--original-window (assoc-default 'window alist) + xref--original-window-intent (assoc-default 'display-action alist)) (current-buffer))))) @@ -753,7 +779,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)." (t (xref-push-marker-stack) (funcall xref-show-xrefs-function xrefs - `((window . ,(selected-window))))))) + `((window . ,(selected-window)) + (display-action . ,display-action)))))) (defun xref--prompt-p (command) (or (eq xref-prompt-for-identifier t) From 5d34e1b2881caa5743816030c2e9cdcda58e9719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Mon, 23 Oct 2017 09:05:32 +0100 Subject: [PATCH 05/48] Allow split-window-sensibly to split threshold in further edge case As a fallback, and to avoid creating a frame, split-window-sensibly would previously disregard split-height-threshold if the window to be split is the frame's root window. This change generalizes that: it disregards the threshold if the window to be split is the frame's only _usable_ window (it is either the only one, as before, or all the other windows are dedicated to some buffer and thus cannot be touched). This is required for the fix to bug#28814. * lisp/window.el (split-height-threshold): Adjust doc to match split-window-sensibly. (split-window-sensibly): Also disregard threshold if all other windows are dedicated. --- lisp/window.el | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/lisp/window.el b/lisp/window.el index f87294ceb15..8939e7d589b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6465,8 +6465,9 @@ If this is an integer, `split-window-sensibly' may split a window vertically only if it has at least this many lines. If this is nil, `split-window-sensibly' is not allowed to split a window vertically. If, however, a window is the only window on its -frame, `split-window-sensibly' may split it vertically -disregarding the value of this variable." +frame, or all the other ones are dedicated, +`split-window-sensibly' may split it vertically disregarding the +value of this variable." :type '(choice (const nil) (integer :tag "lines")) :version "23.1" :group 'windows) @@ -6573,15 +6574,27 @@ split." ;; Split window horizontally. (with-selected-window window (split-window-right))) - (and (eq window (frame-root-window (window-frame window))) - (not (window-minibuffer-p window)) - ;; If WINDOW is the only window on its frame and is not the - ;; minibuffer window, try to split it vertically disregarding - ;; the value of `split-height-threshold'. - (let ((split-height-threshold 0)) - (when (window-splittable-p window) - (with-selected-window window - (split-window-below)))))))) + (and + ;; If WINDOW is the only usable window on its frame (it is + ;; the only one or, not being the only one, all the other + ;; ones are dedicated) and is not the minibuffer window, try + ;; to split it vertically disregarding the value of + ;; `split-height-threshold'. + (let ((frame (window-frame window))) + (or + (eq window (frame-root-window frame)) + (catch 'done + (walk-window-tree (lambda (w) + (unless (or (eq w window) + (window-dedicated-p w)) + (throw 'done nil))) + frame) + t))) + (not (window-minibuffer-p window)) + (let ((split-height-threshold 0)) + (when (window-splittable-p window) + (with-selected-window window + (split-window-below)))))))) (defun window--try-to-split-window (window &optional alist) "Try to split WINDOW. From e950f329c0cfbe9bf3ba2c2e8ee788d6cdf4cebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 13 Oct 2017 16:37:47 +0100 Subject: [PATCH 06/48] New xref-quit-and-goto-xref command bound to TAB (bug#28814) This is like xref-goto-xref, but quits the *xref* window just before the user jump to ref. * lisp/progmodes/xref.el (xref--show-location): Handle 'quit value for SELECT. (xref-goto-xref): Take optional QUIT arg. (xref-quit-and-goto-xref): New command. (xref--xref-buffer-mode-map): Bind "Q" and "TAB" to xref-quit-and-goto-xref. * doc/emacs/maintaining.texi (Xref Commands): Describe new bindings in *xref*. * etc/NEWS (Xref): Describe new binding. --- doc/emacs/maintaining.texi | 7 +++++-- etc/NEWS | 10 ++++++++++ lisp/progmodes/xref.el | 24 +++++++++++++++++++----- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index dc0a71511ff..112f1f4d9ed 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi @@ -1887,8 +1887,7 @@ the special XREF mode: @table @kbd @item @key{RET} @itemx mouse-2 -Display the reference on the current line and bury the @file{*xref*} -buffer. +Display the reference on the current line. @item n @itemx . @findex xref-next-line @@ -1903,6 +1902,10 @@ Move to the previous reference and display it in the other window @findex xref-show-location-at-point Display the reference on the current line in the other window (@code{xref-show-location-at-point}). +@item TAB +@findex xref-quit-and-goto-xref +Display the reference on the current line and bury the @file{*xref*} +buffer (@code{xref-quit-and-goto-xref}). @findex xref-query-replace-in-results @item r @var{pattern} @key{RET} @var{replacement} @key{RET} Perform interactive query-replace on references that match diff --git a/etc/NEWS b/etc/NEWS index 286d27455fe..10e9a7f00f3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1213,6 +1213,16 @@ New user options `term-char-mode-buffer-read-only' and are non-nil by default. Customize these options to nil if you want the previous behavior. +** Xref + ++++ +*** When an *xref* buffer is needed, 'TAB' quits and jumps to an xref. + +A new command 'xref-quit-and-goto-xref', bound to 'TAB' in *xref* +buffers, quits the window before jumping to the destination. In many +situations, the intended window configuration is restored, just as if +the *xref* buffer hadn't been necessary in the first place. + * New Modes and Packages in Emacs 26.1 diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index ee23bc7a64e..db025d40aa3 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -492,11 +492,17 @@ and finally return the window." (selected-window)))) (defun xref--show-location (location &optional select) + "Help `xref-show-xref' and `xref-goto-xref' do their job. +Go to LOCATION and if SELECT is non-nil select its window. If +SELECT is `quit', also quit the *xref* window." (condition-case err (let* ((marker (xref-location-marker location)) - (buf (marker-buffer marker))) + (buf (marker-buffer marker)) + (xref-buffer (current-buffer))) (cond (select - (select-window (xref--show-pos-in-buf marker buf))) + (if (eq select 'quit) (quit-window nil nil)) + (with-current-buffer xref-buffer + (select-window (xref--show-pos-in-buf marker buf)))) (t (save-selected-window (xref--with-dedicated-window @@ -528,12 +534,19 @@ and finally return the window." (back-to-indentation) (get-text-property (point) 'xref-item))) -(defun xref-goto-xref () - "Jump to the xref on the current line and select its window." +(defun xref-goto-xref (&optional quit) + "Jump to the xref on the current line and select its window. +Non-interactively, non-nil QUIT means to first quit the *xref* +buffer." (interactive) (let ((xref (or (xref--item-at-point) (user-error "No reference at point")))) - (xref--show-location (xref-item-location xref) t))) + (xref--show-location (xref-item-location xref) (if quit 'quit t)))) + +(defun xref-quit-and-goto-xref () + "Quit *xref* buffer, then jump to xref on current line." + (interactive) + (xref-goto-xref t)) (defun xref-query-replace-in-results (from to) "Perform interactive replacement of FROM with TO in all displayed xrefs. @@ -657,6 +670,7 @@ references displayed in the current *xref* buffer." (define-key map (kbd "p") #'xref-prev-line) (define-key map (kbd "r") #'xref-query-replace-in-results) (define-key map (kbd "RET") #'xref-goto-xref) + (define-key map (kbd "TAB") #'xref-quit-and-goto-xref) (define-key map (kbd "C-o") #'xref-show-location-at-point) ;; suggested by Johan Claesson "to further reduce finger movement": (define-key map (kbd ".") #'xref-next-line) From c25113d4ac20ceb2b7697e1df8dd649e01228779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 3 Nov 2017 16:53:45 +0000 Subject: [PATCH 07/48] Don't resignal errors in flymake-diag-region * lisp/progmodes/flymake.el (flymake-diag-region): Use flymake-log instead of flymake-error. --- lisp/progmodes/flymake.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index c2349d8c7cc..e13d79770e5 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -342,7 +342,7 @@ region is invalid." (let* ((beg (fallback-bol)) (end (fallback-eol beg))) (cons beg end))))))) - (error (flymake-error "Invalid region line=%s col=%s" line col)))) + (error (flymake-log :warning "Invalid region line=%s col=%s" line col)))) (defvar flymake-diagnostic-functions nil "Special hook of Flymake backends that check a buffer. From 94b490529a85ea0844f2e1cf0dc7d2284c2ff2f2 Mon Sep 17 00:00:00 2001 From: Stephen Leake Date: Fri, 3 Nov 2017 12:06:07 -0500 Subject: [PATCH 08/48] * nt/INSTALL.W64: Update to current mingw64 install instructions --- nt/INSTALL.W64 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/nt/INSTALL.W64 b/nt/INSTALL.W64 index 841660bf0f9..71864ce8c26 100644 --- a/nt/INSTALL.W64 +++ b/nt/INSTALL.W64 @@ -49,13 +49,13 @@ will also be available at the Windows console. ** Download and install the necessary packages -Run msys2_shell.bat in your MSYS2 directory and you will see a BASH window +Run c:/msys64/msys2.exe in your MSYS2 directory and you will see a BASH window opened. In the BASH prompt, use the following command to install the necessary packages (you can copy and paste it into the shell with Shift + Insert): - pacman -S base-devel \ + pacman -S --needed base-devel \ mingw-w64-x86_64-toolchain \ mingw-w64-x86_64-xpm-nox \ mingw-w64-x86_64-libtiff \ @@ -63,7 +63,7 @@ packages (you can copy and paste it into the shell with Shift + Insert): mingw-w64-x86_64-libpng \ mingw-w64-x86_64-libjpeg-turbo \ mingw-w64-x86_64-librsvg \ - mingw-w64-x86_64-liblcms2 \ + mingw-w64-x86_64-lcms2 \ mingw-w64-x86_64-libxml2 \ mingw-w64-x86_64-gnutls \ mingw-w64-x86_64-zlib @@ -126,10 +126,10 @@ Now you're ready to build and install Emacs with autogen, configure, make, and make install. First we need to switch to the MinGW-w64 environment. Exit the MSYS2 BASH -console and run mingw64_shell.bat in the C:\msys64 folder, then cd back to +console and run mingw64.exe in the C:\msys64 folder, then cd back to your Emacs source directory, e.g.: - cd /c/emacs/emacs-25 + cd /c/emacs/emacs-26 ** Run autogen @@ -146,7 +146,7 @@ that the example given here is just a simple one - for more information on the options available please see the INSTALL file in this directory. The '--prefix' option specifies a location for the resulting binary files, -which 'make install' will use - in this example we set it to C:\emacs\emacs-25. +which 'make install' will use - in this example we set it to C:\emacs\emacs-26. If a prefix is not specified the files will be put in the standard Unix directories located in your C:\msys64 directory, but this is not recommended. @@ -154,7 +154,7 @@ Note also that we need to disable Imagemagick because Emacs does not yet support it on Windows. PKG_CONFIG_PATH=/mingw64/lib/pkgconfig \ - ./configure --prefix=/c/emacs/emacs-25 --without-imagemagick + ./configure --prefix=/c/emacs/emacs-26 --without-imagemagick ** Run make From 4f38bdec743787bb4f00b51696afd3acf5a2e113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 3 Nov 2017 19:01:45 +0000 Subject: [PATCH 09/48] Examine tex-chktex--process in the correct buffer As in other Flymake backends, the process sentinel might run in arbitrary buffers where this variable's value doesn't make sense. For a way to trigger a problem due to this, see discussion starting in https://lists.gnu.org/archive/html/emacs-devel/2017-10/msg00645.html * lisp/textmodes/tex-mode.el (tex-chktex): Use with-current-buffer. --- lisp/textmodes/tex-mode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 3da6e4e1124..10ee10243ad 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -3512,7 +3512,8 @@ There might be text before point." (lambda (process _event) (when (eq (process-status process) 'exit) (unwind-protect - (when (eq process tex-chktex--process) + (when (eq process + (with-current-buffer source tex-chktex--process)) (with-current-buffer (process-buffer process) (goto-char (point-min)) (cl-loop From b02c2714c3f1835edf15e34c6b4e3be0c5dd8acf Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 3 Nov 2017 21:12:41 +0200 Subject: [PATCH 10/48] Fix typos in ediff-wind.el * lisp/vc/ediff-wind.el (ediff-setup-windows-multiframe-merge): Fix typos in commentary. (Bug#29138) --- lisp/vc/ediff-wind.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index e0c3dbe7b54..138cfdd2e70 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -518,12 +518,12 @@ into icons, regardless of the window manager." ;;; Algorithm: ;;; 1. Never use frames that have dedicated windows in them---it is bad to ;;; destroy dedicated windows. -;;; 2. If A and B are in the same frame but C's frame is different--- use one -;;; frame for A and B and use a separate frame for C. +;;; 2. If A and B are in the same frame but C's frame is different---use one +;;; frame for A and B, and use a separate frame for C. ;;; 3. If C's frame is non-existent, then: if the first suitable -;;; non-dedicated frame is different from A&B's, then use it for C. -;;; Otherwise, put A,B, and C in one frame. -;;; 4. If buffers A, B, C are is separate frames, use them to display these +;;; non-dedicated frame is different from A&B's, then use it for C. +;;; Otherwise, put A, B, and C in one frame. +;;; 4. If buffers A, B, C are in separate frames, use them to display these ;;; buffers. ;; Skip dedicated or iconified frames. From 383abc8898cbdb46e460adffbccfda8b2236d24e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Nov 2017 15:18:32 -0400 Subject: [PATCH 11/48] ; Fix some comment typos --- lisp/calc/calcalg2.el | 2 +- lisp/textmodes/reftex-index.el | 2 +- lisp/textmodes/reftex-ref.el | 2 +- lisp/textmodes/reftex-toc.el | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el index 53e02572064..48446c3c4c5 100644 --- a/lisp/calc/calcalg2.el +++ b/lisp/calc/calcalg2.el @@ -2354,7 +2354,7 @@ ;; The variables math-solve-lhs, math-solve-rhs and math-try-solve-sign ;; are local to math-try-solve-for, but are used by math-try-solve-prod. -;; (math-solve-lhs and math-solve-rhs are is also local to +;; (math-solve-lhs and math-solve-rhs are also local to ;; math-decompose-poly, but used by math-solve-poly-funny-powers.) (defvar math-solve-lhs) (defvar math-solve-rhs) diff --git a/lisp/textmodes/reftex-index.el b/lisp/textmodes/reftex-index.el index 120370a149a..811d1477ada 100644 --- a/lisp/textmodes/reftex-index.el +++ b/lisp/textmodes/reftex-index.el @@ -474,7 +474,7 @@ With prefix 3, restrict index to region." (interactive) - ;; Ensure access to scanning info and rescan buffer if prefix are is '(4). + ;; Ensure access to scanning info and rescan buffer if prefix arg is '(4). (let ((current-prefix-arg current-prefix-arg)) (reftex-ensure-index-support t) (reftex-access-scan-info current-prefix-arg)) diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el index c2c5ca3de06..ec41dee14e8 100644 --- a/lisp/textmodes/reftex-ref.el +++ b/lisp/textmodes/reftex-ref.el @@ -134,7 +134,7 @@ This function is controlled by the settings of reftex-insert-label-flags." (interactive) - ;; Ensure access to scanning info and rescan buffer if prefix are is '(4). + ;; Ensure access to scanning info and rescan buffer if prefix arg is '(4). (reftex-access-scan-info current-prefix-arg) ;; Find out what kind of environment this is and abort if necessary. diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el index c7a598c920d..c694fafcd52 100644 --- a/lisp/textmodes/reftex-toc.el +++ b/lisp/textmodes/reftex-toc.el @@ -216,7 +216,7 @@ When called with a raw C-u prefix, rescan the document first." (or reftex-support-index (setq reftex-toc-include-index-entries nil)) - ;; Ensure access to scanning info and rescan buffer if prefix are is '(4) + ;; Ensure access to scanning info and rescan buffer if prefix arg is '(4) (reftex-access-scan-info current-prefix-arg) (let* ((this-buf (current-buffer)) From a0d30d6369018deeffcae174a3c615e582de74d3 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Fri, 3 Nov 2017 19:45:17 +0000 Subject: [PATCH 12/48] Introduce a function to CC Mode which displays the current function name Remove an erroneous interactive specification from two functions. * lisp/progmodes/cc-cmds.el (c-display-defun-name): New command. (c-defun-name, c-cpp-define-name): Remove interactive specification. * lisp/progmodes/cc-mode.el (c-mode-base-map): Add binding C-c C-z for the new command. * doc/misc/cc-mode.texi (Other Commands): Add documentation for the new command. --- doc/misc/cc-mode.texi | 13 +++++++++++++ lisp/progmodes/cc-cmds.el | 19 +++++++++++++++++-- lisp/progmodes/cc-mode.el | 3 ++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index c90f6d06bf6..09a86c888d3 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -1760,6 +1760,7 @@ file. For commands that you can use to view the effect of your changes, see @ref{Indentation Commands} and @ref{Filling and Breaking}. For details of the @ccmode{} style system, see @ref{Styles}. + @item @kbd{C-c :} (@code{c-scope-operator}) @kindex C-c : @findex c-scope-operator @@ -1768,6 +1769,18 @@ In C++, it is also sometimes desirable to insert the double-colon scope operator without performing the electric behavior of colon insertion. @kbd{C-c :} does just this. +@item @kbd{C-c C-z} (@code{c-display-defun-name}) +@kindex C-c C-z +@findex c-display-defun-name +@findex display-defun-name (c-) +Display the current function name, if any, in the minibuffer. +Additionally, if a prefix argument is given, push the function name to +the kill ring. If there is no current function, +@code{c-display-defun-name} does nothing. In Emacs, you can use this +command in the middle of an interactive search if you set the +customizable option @code{isearch-allow-scoll} to non-@code{nil}. +@xref{Not Exiting Isearch,,,emacs, GNU Emacs Manual}. + @item @kbd{C-c C-\} (@code{c-backslash-region}) @kindex C-c C-\ @findex c-backslash-region diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index ca64b544200..2b663135932 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -1821,7 +1821,6 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'." "Return the name of the current defun, or NIL if there isn't one. \"Defun\" here means a function, or other top level construct with a brace block." - (interactive) (c-save-buffer-state (beginning-of-defun-function end-of-defun-function where pos name-end case-fold-search) @@ -2048,6 +2047,23 @@ with a brace block." (eq (char-after) ?\{) (cons (point-min) (point-max)))))))) +(defun c-display-defun-name (&optional arg) + "Display the name of the current CC mode defun and the position in it. +With a prefix arg, push the name onto the kill ring too." + (interactive "P") + (save-restriction + (widen) + (c-save-buffer-state ((name (c-defun-name)) + (limits (c-declaration-limits t)) + (point-bol (c-point 'bol))) + (when name + (message "%s. Line %s/%s." name + (1+ (count-lines (car limits) point-bol)) + (count-lines (car limits) (cdr limits))) + (if arg (kill-new name)) + (sit-for 3 t))))) +(put 'c-display-defun-name 'isearch-scroll t) + (defun c-mark-function () "Put mark at end of the current top-level declaration or macro, point at beginning. If point is not inside any then the closest following one is @@ -2092,7 +2108,6 @@ function does not require the declaration to contain a brace block." (defun c-cpp-define-name () "Return the name of the current CPP macro, or NIL if we're not in one." - (interactive) (let (case-fold-search) (save-excursion (and c-opt-cpp-macro-define-start diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index b0e5fe47a7c..f74e931a8bb 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -389,7 +389,8 @@ control). See \"cc-mode.el\" for more info." ;;(define-key c-mode-base-map "\C-c\C-v" 'c-version) ;; (define-key c-mode-base-map "\C-c\C-y" 'c-toggle-hungry-state) Commented out by ACM, 2005-11-22. (define-key c-mode-base-map "\C-c\C-w" 'c-subword-mode) - (define-key c-mode-base-map "\C-c\C-k" 'c-toggle-comment-style)) + (define-key c-mode-base-map "\C-c\C-k" 'c-toggle-comment-style) + (define-key c-mode-base-map "\C-c\C-z" 'c-display-defun-name)) ;; We don't require the outline package, but we configure it a bit anyway. (cc-bytecomp-defvar outline-level) From 6f43d29d29605b710e51ff7f1487063c2f5b0b5a Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Fri, 3 Nov 2017 15:55:22 -0400 Subject: [PATCH 13/48] ; * CONTRIBUTE, admin/make-tarball.txt: Doc tweaks re 'emacs-announce'. --- CONTRIBUTE | 9 +++++---- admin/make-tarball.txt | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTE b/CONTRIBUTE index c7f3330ab01..c324375bb07 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -27,10 +27,11 @@ admin/notes/git-workflow. ** Getting involved with development Discussion about Emacs development takes place on emacs-devel@gnu.org. -You can subscribe to the emacs-devel@gnu.org mailing list, paying -attention to postings with subject lines containing "emacs-announce", -as these discuss important events like feature freezes. See -https://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list +You can subscribe to the emacs-devel@gnu.org mailing list. +If you want to get only the important mails (for things like +feature freezes), choose to receive only the 'emacs-announce' topic +(although so far this feature has not been well or consistently used). +See https://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list instructions and archives. You can develop and commit changes in your own copy of the repository, and discuss proposed changes on the mailing list. Frequent contributors to Emacs can request write access diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 466ee09cd7d..6d6312c9b1b 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -177,6 +177,11 @@ General steps (for each step, check for possible errors): See the info-gnu-emacs mailing list archives for the form of past announcements. The first pretest announcement, and the release announcement, should have more detail. + Use the emacs-devel topic 'emacs-announce'. The best way to do + this is to add a header "Keywords: emacs-announce" to your mail. + (You can also put it in the Subject, but this is not as good + because replies that invariably are not announcements also get + sent out as if they were.) 12. After a release, update the Emacs pages as below. From d9be8704ae905e510cc4b657d267770deb816873 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 11:30:10 +0200 Subject: [PATCH 14/48] Fix hscroll suspension after cursor motion * src/xdisp.c (hscroll_window_tree): Trigger a thorough redisplay of the window when temporary suspension of hscrolling is disabled. (Bug#29002) --- src/xdisp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index dc23959aadb..b8bb6ba8dfc 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13174,8 +13174,15 @@ hscroll_window_tree (Lisp_Object window) /* If the position of this window's point has explicitly changed, no more suspend auto hscrolling. */ - if (NILP (Fequal (Fwindow_point (window), Fwindow_old_point (window)))) - w->suspend_auto_hscroll = false; + if (w->suspend_auto_hscroll + && NILP (Fequal (Fwindow_point (window), + Fwindow_old_point (window)))) + { + w->suspend_auto_hscroll = false; + /* Force thorough redisplay of this window, to show the + effect of disabling hscroll suspension immediately. */ + SET_FRAME_GARBAGED (XFRAME (w->frame)); + } /* Remember window point. */ Fset_marker (w->old_pointm, From 787b75ad71be76a6f4fac6e25577800112fe44b9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 11:56:26 +0200 Subject: [PATCH 15/48] Improve documentation of window hooks * doc/lispref/windows.texi (Window Hooks): Fix the description of window-configuration-change-hook. (Bug#29049) : Document these functions. --- doc/lispref/windows.texi | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 5014cd3d82d..fc642fe9447 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -5138,6 +5138,11 @@ is scrolled. It's not designed for that, and such use probably won't work. @end defvar +@defun run-window-scroll-functions &optional window +This function calls @code{window-scroll-functions} for the specified +@var{window}, which defaults to the selected window. +@end defun + @defvar window-size-change-functions This variable holds a list of functions to be called if the size of any window changes for any reason. The functions are called once per @@ -5167,17 +5172,22 @@ be called again. @defvar window-configuration-change-hook A normal hook that is run every time the window configuration of a frame changes. Window configuration changes include splitting and deleting -windows and the display of a different buffer in a window. Resizing the +windows, and the display of a different buffer in a window. Resizing the frame or individual windows do not count as configuration changes. Use @code{window-size-change-functions}, see above, when you want to track size changes that are not caused by the deletion or creation of windows. -The buffer-local part of this hook is run once for each window on the +The buffer-local value of this hook is run once for each window on the affected frame, with the relevant window selected and its buffer -current. The global part is run once for the modified frame, with that -frame selected. +current. The global value of this hook is run once for the modified +frame, with that frame selected. @end defvar +@defun run-window-configuration-change-hook &optional frame +This function runs @code{window-configuration-change-hook} for the +specified @var{frame}, which defaults to the selected frame. +@end defun + In addition, you can use @code{jit-lock-register} to register a Font Lock fontification function, which will be called whenever parts of a buffer are (re)fontified because a window was scrolled or its size From ff3307454631dd9cd0494b4b8a3b4d034e281839 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 12:00:03 +0200 Subject: [PATCH 16/48] Fix doc string of 'window-configuration-change-hook' * src/window.c (syms_of_window) : Doc fix. (Bug#29049) --- src/window.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/window.c b/src/window.c index 9bb2c43a698..0b220226ba3 100644 --- a/src/window.c +++ b/src/window.c @@ -7617,8 +7617,8 @@ on their symbols to be controlled by this variable. */); DEFVAR_LISP ("window-configuration-change-hook", Vwindow_configuration_change_hook, doc: /* Functions to call when window configuration changes. -The buffer-local part is run once per window, with the relevant window -selected; while the global part is run only once for the modified frame, +The buffer-local value is run once per window, with the relevant window +selected; while the global value is run only once for the modified frame, with the relevant frame selected. */); Vwindow_configuration_change_hook = Qnil; From 680e8e119bbdc7782886b92f1df090b08e4a9623 Mon Sep 17 00:00:00 2001 From: Mike Gulick Date: Sat, 4 Nov 2017 13:34:40 +0200 Subject: [PATCH 17/48] Fix gdb-mi prompt after "attach PID" command * lisp/progmodes/gdb-mi.el (gdbmi-bnf-console-stream-output): Set gdb-first-done-or-error non-nil. (Bug#29020) Copyright-paperwork-exempt: yes --- lisp/progmodes/gdb-mi.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 28d1974893d..4f366c6ede6 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -2188,7 +2188,10 @@ a GDB/MI reply message." (defun gdbmi-bnf-console-stream-output (c-string) "Handler for the console-stream-output GDB/MI output grammar rule." - (gdb-console c-string)) + (gdb-console c-string) + ;; We've written to the GUD console, so we should print the prompt + ;; after the next result-class or async-class. + (setq gdb-first-done-or-error t)) (defun gdbmi-bnf-target-stream-output (_c-string) "Handler for the target-stream-output GDB/MI output grammar rule." From 1f1de8e872282a12c3c17315c54d99026af32db9 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 13:56:39 +0200 Subject: [PATCH 18/48] Make gdb-non-stop-setting default to nil on MS-Windows * lisp/progmodes/gdb-mi.el (gdb-non-stop-setting): Now nil on MS-Windows. --- lisp/progmodes/gdb-mi.el | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 4f366c6ede6..58552759b95 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -400,14 +400,22 @@ valid signal handlers.") (const :tag "Unlimited" nil)) :version "22.1") -(defcustom gdb-non-stop-setting t - "When in non-stop mode, stopped threads can be examined while +(defcustom gdb-non-stop-setting (not (eq system-type 'windows-nt)) + "If non-nil, GDB sessions are expected to support the non-stop mode. +When in the non-stop mode, stopped threads can be examined while other threads continue to execute. +If this is non-nil, GDB will be sent the \"set non-stop 1\" command, +and if that results in an error, the non-stop setting will be +turned off automatically. + +On MS-Windows, this is off by default, because MS-Windows targets +don't support the non-stop mode. + GDB session needs to be restarted for this setting to take effect." :type 'boolean :group 'gdb-non-stop - :version "23.2") + :version "26.1") ;; TODO Some commands can't be called with --all (give a notice about ;; it in setting doc) From 93818eed8ab9840095911be7b0ca0f2104320ea0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 16:28:25 +0200 Subject: [PATCH 19/48] Fix subtle problems in tabulated-list-mode with line numbers * lisp/emacs-lisp/tabulated-list.el (tabulated-list-watch-line-number-width): Call tabulated-list-init-header instead of tabulated-list-revert. (tabulated-list-window-scroll-function): New function. (tabulated-list-mode): Put 'tabulated-list-window-scroll-function' on the buffer-local 'window-scroll-functions' list. --- lisp/emacs-lisp/tabulated-list.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lisp/emacs-lisp/tabulated-list.el b/lisp/emacs-lisp/tabulated-list.el index 73ddadfb805..3889ba8e587 100644 --- a/lisp/emacs-lisp/tabulated-list.el +++ b/lisp/emacs-lisp/tabulated-list.el @@ -603,7 +603,16 @@ With a numeric prefix argument N, sort the Nth column." (let ((lnum-width (tabulated-list-line-number-width))) (when (not (= tabulated-list--current-lnum-width lnum-width)) (setq-local tabulated-list--current-lnum-width lnum-width) - (tabulated-list-revert))))) + (tabulated-list-init-header))))) + +(defun tabulated-list-window-scroll-function (window _start) + (if display-line-numbers + (let ((lnum-width + (with-selected-window window + (line-number-display-width 'columns)))) + (when (not (= tabulated-list--current-lnum-width lnum-width)) + (setq-local tabulated-list--current-lnum-width lnum-width) + (tabulated-list-init-header))))) ;;; The mode definition: @@ -654,7 +663,9 @@ as the ewoc pretty-printer." ;; the line-number width needs to change due to scrolling. (setq-local tabulated-list--current-lnum-width 0) (add-hook 'pre-redisplay-functions - #'tabulated-list-watch-line-number-width nil t)) + #'tabulated-list-watch-line-number-width nil t) + (add-hook 'window-scroll-functions + #'tabulated-list-window-scroll-function nil t)) (put 'tabulated-list-mode 'mode-class 'special) From 369da28702a60543391bf9576eb904d21ca8ea09 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 4 Nov 2017 18:09:01 +0200 Subject: [PATCH 20/48] Improve documentation of 'window-scroll-functions' * doc/lispref/windows.texi (Window Hooks): Clarify the values of arguments of 'window-scroll-functions' functions. * src/xdisp.c (syms_of_xdisp) : Doc fix. --- doc/lispref/windows.texi | 5 ++++- src/xdisp.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index fc642fe9447..e1eac457179 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -5127,7 +5127,10 @@ redisplaying a window with scrolling. Displaying a different buffer in the window also runs these functions. This variable is not a normal hook, because each function is called with -two arguments: the window, and its new display-start position. +two arguments: the window, and its new display-start position. At the +time of the call, the display-start position of the window argument is +already set to its new value, and the buffer to be displayed in the +window is already set as the current buffer. These functions must take care when using @code{window-end} (@pxref{Window Start and End}); if you need an up-to-date value, you diff --git a/src/xdisp.c b/src/xdisp.c index b8bb6ba8dfc..baf075b1c8e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -32569,6 +32569,9 @@ display-start position. These functions are called whenever the `window-start' marker is modified, either to point into another buffer (e.g. via `set-window-buffer') or another place in the same buffer. +When each function is called, the `window-start' marker of its window +argument has been already set to the new value, and the buffer which that +window will display is set to be the current buffer. Note that the value of `window-end' is not valid when these functions are called. From 725ab635d9c4c0ecbd4b28df16d2b97337bbe989 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sat, 4 Nov 2017 22:19:08 +0100 Subject: [PATCH 21/48] Add html-, mhtml- and python-mode support to semantic symref * lisp/cedet/semantic/symref/grep.el (semantic-symref-filepattern-alist): Fix the entry for 'html-mode', which used a regexp-like syntax where only glob syntax is permitted. As a result, 'xref-find-references' (M-?) can now find references in HTML files. Also duplicate the same entry for the sake of 'mhtml-mode', and add a new one for 'python-mode'. (semantic-symref-derive-find-filepatterns): In the documentation, clarify that returned patterns must follow the glob syntax. Fix an 'if' test that always evaluates to nil. (semantic-symref-tool-grep): (semantic-symref-perform-search): Fix typos. --- lisp/cedet/semantic/symref/grep.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/lisp/cedet/semantic/symref/grep.el b/lisp/cedet/semantic/symref/grep.el index bc19cd30c45..0b263d8cc2d 100644 --- a/lisp/cedet/semantic/symref/grep.el +++ b/lisp/cedet/semantic/symref/grep.el @@ -38,16 +38,22 @@ ( ) "A symref tool implementation using grep. -This tool uses EDE to find he root of the project, then executes -find-grep in the project. The output is parsed for hits -and those hits returned.") +This tool uses EDE to find the root of the project, then executes +find-grep in the project. The output is parsed for hits and +those hits returned.") (defvar semantic-symref-filepattern-alist '((c-mode "*.[ch]") (c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh") - (html-mode "*.s?html" "*.php") + (html-mode "*.html" "*.shtml" "*.php") + (mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove + ; duplication of + ; HTML-related patterns. + ; Maybe they belong in the + ; major mode definition? (ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml" "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile") + (python-mode "*.py" "*.pyi" "*.pyw") (perl-mode "*.pl" "*.PL") (cperl-mode "*.pl" "*.PL") (lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs") @@ -58,7 +64,7 @@ See find -name man page for format.") (defun semantic-symref-derive-find-filepatterns (&optional mode) ;; FIXME: This should be moved to grep.el, where it could be used ;; for "C-u M-x grep" as well. - "Derive a list of file patterns for the current buffer. + "Derive a list of file (glob) patterns for the current buffer. Looks first in `semantic-symref-filepattern-alist'. If it is not there, it then looks in `auto-mode-alist', and attempts to derive something from that. @@ -78,7 +84,7 @@ Optional argument MODE specifies the `major-mode' to test." (error "Customize `semantic-symref-filepattern-alist' for %S" major-mode) (let ((args `("-name" ,(car pat)))) - (if (null (cdr args)) + (if (null (cdr pat)) args `("(" ,@args ,@(mapcan (lambda (s) `("-o" "-name" ,s)) pat) @@ -149,7 +155,7 @@ This shell should support pipe redirect syntax." (oref tool searchfor)) (t ;; Can't use the word boundaries: Grep - ;; doesn't always agrees with the language + ;; doesn't always agree with the language ;; syntax on those. (format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)" (oref tool searchfor))))) From 918a2dda07ebf16601a93d0464f62c4e846d8b39 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Tue, 31 Oct 2017 13:31:46 -0400 Subject: [PATCH 22/48] Use hybrid malloc for FreeBSD (Bug#28308) FreeBSD aarch64 does not provide sbrk, so gmalloc cannot be used; when using system malloc dumping does not work correctly (allocated data is invalid after dumping). * configure.ac: Set hybrid_malloc for freebsd. * src/gmalloc.c (gdefault_morecore) [!HAVE_SBRK]: Don't call sbrk. --- configure.ac | 2 +- src/gmalloc.c | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index d397e8fa7e1..5579342c4e5 100644 --- a/configure.ac +++ b/configure.ac @@ -2218,7 +2218,7 @@ test "$CANNOT_DUMP" = yes || case "$opsys" in ## darwin ld insists on the use of malloc routines in the System framework. darwin | mingw32 | nacl | sol2-10) ;; - cygwin | qnxto) + cygwin | qnxto | freebsd) hybrid_malloc=yes system_malloc= ;; *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; diff --git a/src/gmalloc.c b/src/gmalloc.c index 2bda95ebd3d..a17d39c1eeb 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c @@ -1502,17 +1502,18 @@ extern void *__sbrk (ptrdiff_t increment); static void * gdefault_morecore (ptrdiff_t increment) { - void *result; #ifdef HYBRID_MALLOC if (!DUMPED) { return bss_sbrk (increment); } #endif - result = (void *) __sbrk (increment); - if (result == (void *) -1) - return NULL; - return result; +#ifdef HAVE_SBRK + void *result = (void *) __sbrk (increment); + if (result != (void *) -1) + return result; +#endif + return NULL; } void *(*__morecore) (ptrdiff_t) = gdefault_morecore; From 00fa4449cd5a28f8f302e56e9175ebfe5dcb2da6 Mon Sep 17 00:00:00 2001 From: "Charles A. Roelli" Date: Sun, 5 Nov 2017 10:18:00 +0100 Subject: [PATCH 23/48] ; Fix typo * doc/misc/cc-mode.texi (Other Commands): Fix typo. --- doc/misc/cc-mode.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 09a86c888d3..13f5c81d949 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -1778,7 +1778,7 @@ Additionally, if a prefix argument is given, push the function name to the kill ring. If there is no current function, @code{c-display-defun-name} does nothing. In Emacs, you can use this command in the middle of an interactive search if you set the -customizable option @code{isearch-allow-scoll} to non-@code{nil}. +customizable option @code{isearch-allow-scroll} to non-@code{nil}. @xref{Not Exiting Isearch,,,emacs, GNU Emacs Manual}. @item @kbd{C-c C-\} (@code{c-backslash-region}) From 8c50842790a680aa0732fddeb4454eaa0ac2d7a6 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Nov 2017 12:40:13 +0100 Subject: [PATCH 24/48] ; Fix typo in test/file-organization.org --- test/file-organization.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/file-organization.org b/test/file-organization.org index 4d76c0068e3..6c93c28c8e1 100644 --- a/test/file-organization.org +++ b/test/file-organization.org @@ -30,7 +30,7 @@ the directory structure of the source tree; so tests for files in the Tests should normally reside in a file with ~-tests.el~ added to the base-name of the tested source file; hence ~ert.el~ is tested in -~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As n +~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As an exception, tests for a single feature may be placed into multiple files of any name which are themselves placed in a directory named after the feature with ~-tests~ appended, such as From 8db2b3a79bef0dab286badc3f0af164387a24a67 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Nov 2017 12:40:58 +0100 Subject: [PATCH 25/48] Allow "%" in Tramp host names * lisp/net/tramp-gvfs.el (tramp-gvfs-url-file-name): Hexify also host. * lisp/net/tramp.el (tramp-host-regexp): Allow "%" in host names. --- lisp/net/tramp-gvfs.el | 3 ++- lisp/net/tramp.el | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el index 51d24cbc1b0..709ea4670a8 100644 --- a/lisp/net/tramp-gvfs.el +++ b/lisp/net/tramp-gvfs.el @@ -1292,7 +1292,8 @@ file-notify events." (when (and user domain) (setq user (concat domain ";" user))) (url-parse-make-urlobj - method (and user (url-hexify-string user)) nil host + method (and user (url-hexify-string user)) + nil (and host (url-hexify-string host)) (if (stringp port) (string-to-number port) port) (and localname (url-hexify-string localname)) nil nil t)) (url-parse-make-urlobj diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index e300b3a58ed..67192e32401 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -818,7 +818,7 @@ Used in `tramp-make-tramp-file-name'.") "Regexp matching delimiter between user and host names. Derived from `tramp-postfix-user-format'.") -(defconst tramp-host-regexp "[a-zA-Z0-9_.-]+" +(defconst tramp-host-regexp "[a-zA-Z0-9_.%-]+" "Regexp matching host names.") (defconst tramp-prefix-ipv6-format-alist @@ -4631,9 +4631,6 @@ Only works for Bourne-like shells." (provide 'tramp) ;;; TODO: - -;; * In Emacs 21, `insert-directory' shows total number of bytes used -;; by the files in that directory. Add this here. ;; ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) ;; From 3ad712ebc91438838df29b0e12b3103d409ee3a4 Mon Sep 17 00:00:00 2001 From: Lele Gaifax Date: Fri, 3 Nov 2017 12:20:36 +0000 Subject: [PATCH 26/48] Add a Flymake backend for Python (bug#28808) Implement new Flymake backend with related customizable settings. * lisp/progmodes/python.el (python-flymake-command) (python-flymake-command-output-pattern) (python-flymake-msg-alist): New defcustom. (python--flymake-parse-output): New function, able to parse python-flymake-command output accordingly to python-flymake-command-output-pattern. (python-flymake): New function implementing the backend interface using python--flymake-parse-output for the real work. (python-mode): Add python-flymake to flymake-diagnostic-functions. --- lisp/progmodes/python.el | 136 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 135 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 895117b9ee3..b7902fb9786 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -5141,6 +5141,138 @@ returned as is." "Return non-nil if REGEXP is valid." (ignore-errors (string-match regexp "") t)) + +;;; Flymake integration + +(defgroup python-flymake nil + "Integration between Python and Flymake." + :group 'python + :link '(custom-group-link :tag "Flymake" flymake) + :version "26.1") + +(defcustom python-flymake-command '("pyflakes") + "The external tool that will be used to perform the syntax check. +This is a non empty list of strings, the checker tool possibly followed by +required arguments. Once launched it will receive the Python source to be +checked as its standard input. +To use `flake8' you would set this to (\"flake8\" \"-\")." + :group 'python-flymake + :type '(repeat string)) + +;; The default regexp accomodates for older pyflakes, which did not +;; report the column number, and at the same time it's compatible with +;; flake8 output, although it may be redefined to explicitly match the +;; TYPE +(defcustom python-flymake-command-output-pattern + (list + "^\\(?:?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$" + 1 2 nil 3) + "Specify how to parse the output of `python-flymake-command'. +The value has the form (REGEXP LINE COLUMN TYPE MESSAGE): if +REGEXP matches, the LINE'th subexpression gives the line number, +the COLUMN'th subexpression gives the column number on that line, +the TYPE'th subexpression gives the type of the message and the +MESSAGE'th gives the message text itself. + +If COLUMN or TYPE are nil or that index didn't match, that +information is not present on the matched line and a default will +be used." + :group 'python-flymake + :type '(list regexp + (integer :tag "Line's index") + (choice + (const :tag "No column" nil) + (integer :tag "Column's index")) + (choice + (const :tag "No type" nil) + (integer :tag "Type's index")) + (integer :tag "Message's index"))) + +(defcustom python-flymake-msg-alist + '(("\\(^redefinition\\|.*unused.*\\|used$\\)" . :warning)) + "Alist used to associate messages to their types. +Each element should be a cons-cell (REGEXP . TYPE), where TYPE must be +one defined in the variable `flymake-diagnostic-types-alist'. +For example, when using `flake8' a possible configuration could be: + + ((\"\\(^redefinition\\|.*unused.*\\|used$\\)\" . :warning) + (\"^E999\" . :error) + (\"^[EW][0-9]+\" . :note)) + +By default messages are considered errors." + :group 'python-flymake + :type `(alist :key-type (regexp) + :value-type (symbol))) + +(defvar-local python--flymake-proc nil) + +(defun python--flymake-parse-output (source proc report-fn) + "Collect diagnostics parsing checker tool's output line by line." + (let ((rx (nth 0 python-flymake-command-output-pattern)) + (lineidx (nth 1 python-flymake-command-output-pattern)) + (colidx (nth 2 python-flymake-command-output-pattern)) + (typeidx (nth 3 python-flymake-command-output-pattern)) + (msgidx (nth 4 python-flymake-command-output-pattern))) + (with-current-buffer (process-buffer proc) + (goto-char (point-min)) + (cl-loop + while (search-forward-regexp rx nil t) + for msg = (match-string msgidx) + for (beg . end) = (flymake-diag-region + source + (string-to-number + (match-string lineidx)) + (and colidx + (match-string colidx) + (string-to-number + (match-string colidx)))) + for type = (or (and typeidx + (match-string typeidx) + (assoc-default + (match-string typeidx) + python-flymake-msg-alist + #'string-match)) + (assoc-default msg + python-flymake-msg-alist + #'string-match) + :error) + collect (flymake-make-diagnostic + source beg end type msg) + into diags + finally (funcall report-fn diags))))) + +(defun python-flymake (report-fn &rest _args) + "Flymake backend for Python. +This backend uses `python-flymake-command' (which see) to launch a process +that is passed the current buffer's content via stdin. +REPORT-FN is Flymake's callback function." + (unless (executable-find (car python-flymake-command)) + (error "Cannot find a suitable checker")) + + (when (process-live-p python--flymake-proc) + (kill-process python--flymake-proc)) + + (let ((source (current-buffer))) + (save-restriction + (widen) + (setq python--flymake-proc + (make-process + :name "python-flymake" + :noquery t + :connection-type 'pipe + :buffer (generate-new-buffer " *python-flymake*") + :command python-flymake-command + :sentinel + (lambda (proc _event) + (when (eq 'exit (process-status proc)) + (unwind-protect + (when (with-current-buffer source + (eq proc python--flymake-proc)) + (python--flymake-parse-output source proc report-fn)) + (kill-buffer (process-buffer proc))))))) + (process-send-region python--flymake-proc (point-min) (point-max)) + (process-send-eof python--flymake-proc)))) + (defun python-electric-pair-string-delimiter () (when (and electric-pair-mode @@ -5255,7 +5387,9 @@ returned as is." (make-local-variable 'python-shell-internal-buffer) (when python-indent-guess-indent-offset - (python-indent-guess-indent-offset))) + (python-indent-guess-indent-offset)) + + (add-hook 'flymake-diagnostic-functions #'python-flymake nil t)) (provide 'python) From 9dee764165f54bf93039b8301e0ef6dd143d6cf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 3 Nov 2017 12:43:11 +0000 Subject: [PATCH 27/48] Add a Flymake backend for Ruby * lisp/progmodes/ruby-mode.el (ruby-flymake-command): New defcustom. (ruby--flymake-proc): New buffer-local variable. (ruby-flymake): New function. (ruby-mode): Add flymake-diagnostic-functions. --- lisp/progmodes/ruby-mode.el | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 0024957c39b..1f4aa6d9fbd 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2253,6 +2253,68 @@ See `font-lock-syntax-table'.") (progn (set-match-data value) t)) (ruby-match-expression-expansion limit))))) +;;; Flymake support +(defcustom ruby-flymake-command '("ruby" "-w" "-c") + "External tool used to check Ruby source code. +This is a non empty list of strings, the checker tool possibly +followed by required arguments. Once launched it will receive +the Ruby source to be checked as its standard input." + :group 'ruby + :type '(repeat string)) + +(defvar-local ruby--flymake-proc nil) + +(defun ruby-flymake (report-fn &rest _args) + "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." + (unless (executable-find (car ruby-flymake-command)) + (error "Cannot find a suitable checker")) + + (when (process-live-p ruby--flymake-proc) + (kill-process ruby--flymake-proc)) + + (let ((source (current-buffer))) + (save-restriction + (widen) + (setq + ruby--flymake-proc + (make-process + :name "ruby-flymake" :noquery t :connection-type 'pipe + :buffer (generate-new-buffer " *ruby-flymake*") + :command ruby-flymake-command + :sentinel + (lambda (proc _event) + (when (eq 'exit (process-status proc)) + (unwind-protect + (if (with-current-buffer source (eq proc ruby--flymake-proc)) + (with-current-buffer (process-buffer proc) + (goto-char (point-min)) + (cl-loop + while (search-forward-regexp + "^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" + nil t) + for msg = (match-string 2) + for (beg . end) = (flymake-diag-region + source + (string-to-number (match-string 1))) + for type = (if (string-match "^warning" msg) + :warning + :error) + collect (flymake-make-diagnostic source + beg + end + type + msg) + into diags + finally (funcall report-fn diags))) + (flymake-log :debug "Canceling obsolete check %s" + proc)) + (kill-buffer (process-buffer proc))))))) + (process-send-region ruby--flymake-proc (point-min) (point-max)) + (process-send-eof ruby--flymake-proc)))) + ;;;###autoload (define-derived-mode ruby-mode prog-mode "Ruby" "Major mode for editing Ruby code." @@ -2265,6 +2327,7 @@ See `font-lock-syntax-table'.") (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local) (add-hook 'electric-indent-functions 'ruby--electric-indent-p nil 'local) + (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil 'local) (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil)) (setq-local font-lock-keywords ruby-font-lock-keywords) From 58e742b21dcd15f5a00381de3e7179210978ddc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Fri, 3 Nov 2017 16:05:39 +0000 Subject: [PATCH 28/48] Add a Flymake backend for Perl Define a simple backend in perl-mode.el, which cperl-mode.el also uses. * lisp/progmodes/cperl-mode.el (cperl-mode): Add to flymake-diagnostic-functions. * lisp/progmodes/flymake-proc.el (flymake-proc-allowed-file-name-masks): Disable legacy backend for perl files. * lisp/progmodes/perl-mode.el (perl-flymake-command): New defcustom. (perl--flymake-proc): New buffer-local variable. (perl-flymake): New function. (perl-mode): Add to flymake-diagnostic-functions. --- lisp/progmodes/cperl-mode.el | 4 +- lisp/progmodes/flymake-proc.el | 2 +- lisp/progmodes/perl-mode.el | 71 +++++++++++++++++++++++++++++++++- 3 files changed, 74 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index 853604d1d79..4c63ec2fb4e 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -1896,7 +1896,9 @@ or as help on variables `cperl-tips', `cperl-problems', (if cperl-pod-here-scan (or cperl-syntaxify-by-font-lock (progn (or cperl-faces-init (cperl-init-faces-weak)) - (cperl-find-pods-heres))))) + (cperl-find-pods-heres)))) + ;; Setup Flymake + (add-hook 'flymake-diagnostic-functions 'perl-flymake nil t)) ;; Fix for perldb - make default reasonable (defun cperl-db () diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 5c4d451d638..2e98b2afd1e 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -73,7 +73,7 @@ ("\\.xml\\'" flymake-proc-xml-init) ("\\.html?\\'" flymake-proc-xml-init) ("\\.cs\\'" flymake-proc-simple-make-init) - ("\\.p[ml]\\'" flymake-proc-perl-init) + ;; ("\\.p[ml]\\'" flymake-proc-perl-init) ("\\.php[345]?\\'" flymake-proc-php-init) ("\\.h\\'" flymake-proc-master-make-header-init flymake-proc-master-cleanup) ("\\.java\\'" flymake-proc-simple-make-java-init flymake-proc-simple-java-cleanup) diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 24b934ce6c2..8e7cd13088f 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -580,6 +580,73 @@ create a new comment." (if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t) (match-string-no-properties 1)))) + +;;; Flymake support +(defcustom perl-flymake-command '("perl" "-w" "-c") + "External tool used to check Perl source code. +This is a non empty list of strings, the checker tool possibly +followed by required arguments. Once launched it will receive +the Perl source to be checked as its standard input." + :group 'perl + :type '(repeat string)) + +(defvar-local perl--flymake-proc nil) + +;;;###autoload +(defun perl-flymake (report-fn &rest _args) + "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." + (unless (executable-find (car perl-flymake-command)) + (error "Cannot find a suitable checker")) + + (when (process-live-p perl--flymake-proc) + (kill-process perl--flymake-proc)) + + (let ((source (current-buffer))) + (save-restriction + (widen) + (setq + perl--flymake-proc + (make-process + :name "perl-flymake" :noquery t :connection-type 'pipe + :buffer (generate-new-buffer " *perl-flymake*") + :command perl-flymake-command + :sentinel + (lambda (proc _event) + (when (eq 'exit (process-status proc)) + (unwind-protect + (if (with-current-buffer source (eq proc perl--flymake-proc)) + (with-current-buffer (process-buffer proc) + (goto-char (point-min)) + (cl-loop + while (search-forward-regexp + "^\\(.+\\) at - line \\([0-9]+\\)" + nil t) + for msg = (match-string 1) + for (beg . end) = (flymake-diag-region + source + (string-to-number (match-string 2))) + for type = + (if (string-match + "\\(Scalar value\\|Useless use\\|Unquoted string\\)" + msg) + :warning + :error) + collect (flymake-make-diagnostic source + beg + end + type + msg) + into diags + finally (funcall report-fn diags))) + (flymake-log :debug "Canceling obsolete check %s" + proc)) + (kill-buffer (process-buffer proc))))))) + (process-send-region perl--flymake-proc (point-min) (point-max)) + (process-send-eof perl--flymake-proc)))) + (defvar perl-mode-hook nil "Normal hook to run when entering Perl mode.") @@ -665,7 +732,9 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'." ;; Setup outline-minor-mode. (setq-local outline-regexp perl-outline-regexp) (setq-local outline-level 'perl-outline-level) - (setq-local add-log-current-defun-function #'perl-current-defun-name)) + (setq-local add-log-current-defun-function #'perl-current-defun-name) + ;; Setup Flymake + (add-hook 'flymake-diagnostic-functions #'perl-flymake nil t)) ;; This is used by indent-for-comment ;; to decide how much to indent a comment in Perl code From 58bb3462ee5d43efbebba29f8e218391966fb2a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 5 Nov 2017 12:51:30 +0000 Subject: [PATCH 29/48] Add tests for Flymake backends for Ruby and Perl * test/lisp/progmodes/flymake-tests.el (perl-backend) (ruby-backend): New tests. (warning-predicate-rx-perl, warning-predicate-function-perl): Delete tests. * test/lisp/progmodes/flymake-resources/test.pl: Include an error the test file. * test/lisp/progmodes/flymake-resources/test.rb: file. --- test/lisp/progmodes/flymake-resources/test.pl | 2 ++ test/lisp/progmodes/flymake-resources/test.rb | 5 ++++ test/lisp/progmodes/flymake-tests.el | 27 +++++++++---------- 3 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 test/lisp/progmodes/flymake-resources/test.rb diff --git a/test/lisp/progmodes/flymake-resources/test.pl b/test/lisp/progmodes/flymake-resources/test.pl index d5abcb47e7f..6f4f1ccef50 100644 --- a/test/lisp/progmodes/flymake-resources/test.pl +++ b/test/lisp/progmodes/flymake-resources/test.pl @@ -1,2 +1,4 @@ @arr = [1,2,3,4]; +unknown; my $b = @arr[1]; +[ diff --git a/test/lisp/progmodes/flymake-resources/test.rb b/test/lisp/progmodes/flymake-resources/test.rb new file mode 100644 index 00000000000..1419eaf3ad2 --- /dev/null +++ b/test/lisp/progmodes/flymake-resources/test.rb @@ -0,0 +1,5 @@ +def bla + return 2 + print "not reached" + something + oops diff --git a/test/lisp/progmodes/flymake-tests.el b/test/lisp/progmodes/flymake-tests.el index cfa810053ca..c60f9100345 100644 --- a/test/lisp/progmodes/flymake-tests.el +++ b/test/lisp/progmodes/flymake-tests.el @@ -108,24 +108,23 @@ SEVERITY-PREDICATE is used to setup (should (eq 'flymake-warning (face-at-point))))) -(ert-deftest warning-predicate-rx-perl () - "Test perl warning via regular expression predicate." +(ert-deftest perl-backend () + "Test the perl backend" (skip-unless (executable-find "perl")) - (flymake-tests--with-flymake - ("test.pl" :severity-predicate "^Scalar value") + (flymake-tests--with-flymake ("test.pl") (flymake-goto-next-error) - (should (eq 'flymake-warning - (face-at-point))))) + (should (eq 'flymake-warning (face-at-point))) + (flymake-goto-next-error) + (should (eq 'flymake-error (face-at-point))))) -(ert-deftest warning-predicate-function-perl () - "Test perl warning via function predicate." - (skip-unless (executable-find "perl")) - (flymake-tests--with-flymake - ("test.pl" :severity-predicate - (lambda (msg) (string-match "^Scalar value" msg))) +(ert-deftest ruby-backend () + "Test the ruby backend" + (skip-unless (executable-find "ruby")) + (flymake-tests--with-flymake ("test.rb") (flymake-goto-next-error) - (should (eq 'flymake-warning - (face-at-point))))) + (should (eq 'flymake-warning (face-at-point))) + (flymake-goto-next-error) + (should (eq 'flymake-error (face-at-point))))) (ert-deftest different-diagnostic-types () "Test GCC warning via function predicate." From a2cc6d74c5b94633e7fc044765e0ef40a8d63f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= Date: Sun, 5 Nov 2017 14:58:07 +0000 Subject: [PATCH 30/48] Fix Flymake help-echo functions across windows (bug#29142) * lisp/progmodes/flymake.el (flymake--highlight-line): Use with-selected-window. (flymake-goto-next-error): Call help-echo with a window and an overlay. --- lisp/progmodes/flymake.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index e13d79770e5..e833cd949ee 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -520,11 +520,12 @@ associated `flymake-category' return DEFAULT." (flymake--fringe-overlay-spec (overlay-get ov 'bitmap))) (default-maybe 'help-echo - (lambda (_window _ov pos) - (mapconcat - #'flymake--diag-text - (flymake-diagnostics pos) - "\n"))) + (lambda (window _ov pos) + (with-selected-window window + (mapconcat + #'flymake--diag-text + (flymake-diagnostics pos) + "\n")))) (default-maybe 'severity (warning-numeric-level :error)) (default-maybe 'priority (+ 100 (overlay-get ov 'severity)))) ;; Some properties can't be overridden. @@ -949,7 +950,7 @@ applied." (message "%s" (funcall (overlay-get target 'help-echo) - nil nil (point))))) + (selected-window) target (point))))) (interactive (user-error "No more Flymake errors%s" (if filter From c572e1f329583d40a6ae1a6cf493aba4a58c08e4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Nov 2017 17:26:36 +0200 Subject: [PATCH 31/48] Return non-nil from gnutls-available-p under GnuTLS 2.x * doc/misc/emacs-gnutls.texi (Help For Users): Update the documentation of 'gnutls-available-p'. * etc/NEWS (GnuTLS): Mention the change in the value returned by 'gnutls-available-p'. * src/gnutls.c (Fgnutls_available_p): Return non-nil when GnuTLS 2.x is available. (Bug#29147) --- doc/misc/emacs-gnutls.texi | 6 +++++- etc/NEWS | 4 ++++ src/gnutls.c | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/misc/emacs-gnutls.texi b/doc/misc/emacs-gnutls.texi index 0ad48b0b9ec..92846a924c5 100644 --- a/doc/misc/emacs-gnutls.texi +++ b/doc/misc/emacs-gnutls.texi @@ -94,7 +94,11 @@ There's one way to find out if GnuTLS is available, by calling Zaretskii) in the same directory as Emacs, you should be OK. @defun gnutls-available-p -This function returns @code{t} if GnuTLS is available in this instance of Emacs. +This function returns non-@code{nil} if GnuTLS is available in this +instance of Emacs, @code{nil} otherwise. If GnuTLS is available, the +value is a list of GnuTLS capabilities supported by the installed +GnuTLS library, which depends on the library version. The meaning of +the capabilities is documented in the doc string of this function. @end defun Oh, but sometimes things go wrong. Budgets aren't balanced, diff --git a/etc/NEWS b/etc/NEWS index 10e9a7f00f3..9853aa647a8 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1535,6 +1535,10 @@ See the node "(elisp) Checksum/Hash" in the ELisp manual for details. and 'gnutls-symmetric-decrypt'. See the node "(elisp) GnuTLS Cryptography" in the ELisp manual for details. ++++ +** The function 'gnutls-available-p' now returns a list of capabilities +supported by the GnuTLS library used by Emacs. + +++ ** Emacs now supports records for user-defined types, via the new functions 'make-record', 'record', and 'recordp'. Records are now diff --git a/src/gnutls.c b/src/gnutls.c index 36f65c4acb3..85cebd0e1c6 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -2422,6 +2422,8 @@ GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */) #ifdef HAVE_GNUTLS + capabilities = Fcons (intern("gnutls"), capabilities); + # ifdef HAVE_GNUTLS3 capabilities = Fcons (intern("gnutls3"), capabilities); capabilities = Fcons (intern("digests"), capabilities); From ec6cf35c5fa0842383a492500107314e6d39702c Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Nov 2017 17:49:43 +0200 Subject: [PATCH 32/48] ; Describe xt-mouse problems with Evil mode * etc/PROBLEMS: Describe a workaround for xt-mouse problems with Evil mode. (Bug#29143) --- etc/PROBLEMS | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index a67771d474d..bb699af9df5 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1466,6 +1466,18 @@ this, you can remove the X resource or put this in your init file: (xterm-remove-modify-other-keys) +** Emacs's xterm-mouse doesn't work well in Evil mode. + +Specifically, clicking mouse-1 doesn't work as expected: instead of +moving point where you click, it highlights the region between the +line beginning and the click location, and displays error messages +about unbound keys in the echo area. + +To work around this, put this in your .emacs file: + + (with-eval-after-load 'evil-maps + (define-key evil-motion-state-map [down-mouse-1] nil)) + ** Emacs spontaneously displays "I-search: " at the bottom of the screen. This means that Control-S/Control-Q (XON/XOFF) "flow control" is being From 5d744e032fee9ce60446a3cc0cf7c2e681ace465 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 5 Nov 2017 11:36:20 -0500 Subject: [PATCH 33/48] Don't replace user input when completion prefix is empty (Bug#18951) * lisp/pcomplete.el (pcomplete-parse-arguments): Only replace user input if we produced a non-empty common completion stub. --- lisp/pcomplete.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 745a813b758..2d2a8773bfe 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -772,7 +772,7 @@ this is `comint-dynamic-complete-functions'." (setq c (cdr c))) (setq pcomplete-stub (substring common-stub 0 len) pcomplete-autolist t) - (when (and begin (not pcomplete-show-list)) + (when (and begin (> len 0) (not pcomplete-show-list)) (delete-region begin (point)) (pcomplete-insert-entry "" pcomplete-stub)) (throw 'pcomplete-completions completions)) From efd0371c23c5dd04d73980b42d7cf64bbceccb9a Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Oct 2017 23:12:00 -0400 Subject: [PATCH 34/48] Improve dired deletion error handling (Bug#28797) * lisp/dired.el (dired-internal-do-deletions): Use `error-message-string' to produce a human readable error message. --- lisp/dired.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/dired.el b/lisp/dired.el index cf08143de70..f1a74639a94 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3144,7 +3144,7 @@ non-empty directories is allowed." #'dired-delete-entry fn)) (quit (throw '--delete-cancel (message "OK, canceled"))) (error ;; catch errors from failed deletions - (dired-log "%s\n" err) + (dired-log "%s: %s\n" (car err) (error-message-string err)) (setq failures (cons (car (car l)) failures))))) (setq l (cdr l))) (if (not failures) From 18af404ef33d8efcbb9446945e543251ab33aa3c Mon Sep 17 00:00:00 2001 From: Justin Timmons Date: Sun, 11 Dec 2016 19:39:56 -0500 Subject: [PATCH 35/48] Support python virtualenv on w32 (Bug#24464) According to the virtualenv docs only POSIX systems follow the structure "/path/to/venv/bin/", while windows systems use "/path/to/venv/Scripts" for the location of the binary files, most importantly including the python interpreter (see: https://virtualenv.pypa.io/en/stable/userguide/#windows-notes). * lisp/progmodes/python.el (python-shell-calculate-exec-path): Use the "/path/to/venv/Scripts" for `windows-nt' machines. Copyright-paperwork-exempt: yes --- lisp/progmodes/python.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index b7902fb9786..d4226e5ce7b 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -2113,20 +2113,25 @@ remote host, the returned value is intended for (defun python-shell-calculate-exec-path () "Calculate `exec-path'. Prepends `python-shell-exec-path' and adds the binary directory -for virtualenv if `python-shell-virtualenv-root' is set. If -`default-directory' points to a remote host, the returned value -appends `python-shell-remote-exec-path' instead of `exec-path'." +for virtualenv if `python-shell-virtualenv-root' is set - this +will use the python interpreter from inside the virtualenv when +starting the shell. If `default-directory' points to a remote host, +the returned value appends `python-shell-remote-exec-path' instead +of `exec-path'." (let ((new-path (copy-sequence (if (file-remote-p default-directory) python-shell-remote-exec-path - exec-path)))) + exec-path))) + + ;; Windows and POSIX systems use different venv directory structures + (virtualenv-bin-dir (if (eq system-type 'windows-nt) "Scripts" "bin"))) (python-shell--add-to-path-with-priority new-path python-shell-exec-path) (if (not python-shell-virtualenv-root) new-path (python-shell--add-to-path-with-priority new-path - (list (expand-file-name "bin" python-shell-virtualenv-root))) + (list (expand-file-name virtualenv-bin-dir python-shell-virtualenv-root))) new-path))) (defun python-shell-tramp-refresh-remote-path (vec paths) From 72d07d1950a88f9f08d8ad5f45cdf0f3353e1500 Mon Sep 17 00:00:00 2001 From: Philipp Stephani Date: Sat, 23 Sep 2017 20:43:44 +0200 Subject: [PATCH 36/48] Ediff: add some missing documentation * vc/ediff.el (ediff-files, ediff-files3, ediff-buffers) (ediff-buffers3, ediff-merge-directories) (ediff-merge-directories-with-ancestor) (ediff-merge-directory-revisions) (ediff-merge-directory-revisions-with-ancestor) (ediff-windows-wordwise, ediff-windows-linewise) (ediff-regions-wordwise, ediff-regions-linewise) (ediff-merge-files, ediff-merge-files-with-ancestor) (ediff-merge-buffers, ediff-merge-buffers-with-ancestor) (ediff-merge-revisions, ediff-merge-revisions-with-ancestor) (ediff-patch-file, ediff-revision): Document missing arguments. (ediff-patch-buffer, ediff-revision): Add second space after period. (ediff-files-command, ediff3-files-command, ediff-merge-command) (ediff-merge-with-ancestor-command, ediff-directories-command) (ediff-directories3-command, ediff-merge-directories-command): Add documentation for the command line functions. --- lisp/vc/ediff.el | 125 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 100 insertions(+), 25 deletions(-) diff --git a/lisp/vc/ediff.el b/lisp/vc/ediff.el index d0f8e63dcb1..0adf51328e2 100644 --- a/lisp/vc/ediff.el +++ b/lisp/vc/ediff.el @@ -185,7 +185,9 @@ ;;;###autoload (defun ediff-files (file-A file-B &optional startup-hooks) - "Run Ediff on a pair of files, FILE-A and FILE-B." + "Run Ediff on a pair of files, FILE-A and FILE-B. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." (interactive (let ((dir-A (if ediff-use-last-dir ediff-last-dir-A @@ -221,7 +223,9 @@ ;;;###autoload (defun ediff-files3 (file-A file-B file-C &optional startup-hooks) - "Run Ediff on three files, FILE-A, FILE-B, and FILE-C." + "Run Ediff on three files, FILE-A, FILE-B, and FILE-C. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." (interactive (let ((dir-A (if ediff-use-last-dir ediff-last-dir-A @@ -419,7 +423,14 @@ If this file is a backup, `ediff' it with its original." ;;;###autoload (defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name) - "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B." + "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers. JOB-NAME is a +symbol describing the Ediff job type; it defaults to +`ediff-buffers', but can also be one of +`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor', +`ediff-last-dir-C', `ediff-buffers3', `ediff-merge-buffers', or +`ediff-merge-buffers-with-ancestor'." (interactive (let (bf) (list (setq bf (read-buffer "Buffer A to compare: " @@ -441,7 +452,14 @@ If this file is a backup, `ediff' it with its original." ;;;###autoload (defun ediff-buffers3 (buffer-A buffer-B buffer-C &optional startup-hooks job-name) - "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C." + "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers. JOB-NAME is a +symbol describing the Ediff job type; it defaults to +`ediff-buffers3', but can also be one of +`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor', +`ediff-last-dir-C', `ediff-buffers', `ediff-merge-buffers', or +`ediff-merge-buffers-with-ancestor'." (interactive (let (bf bff) (list (setq bf (read-buffer "Buffer A to compare: " @@ -637,7 +655,8 @@ regular expression; only file names that match the regexp are considered." (defun ediff-merge-directories (dir1 dir2 regexp &optional merge-autostore-dir) "Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have the same name in both. The third argument, REGEXP, is nil or a regular -expression; only file names that match the regexp are considered." +expression; only file names that match the regexp are considered. +MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) (default-regexp (eval ediff-default-filtering-regexp)) @@ -674,7 +693,8 @@ expression; only file names that match the regexp are considered." Ediff merges files that have identical names in DIR1, DIR2. If a pair of files in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge without ancestor. The fourth argument, REGEXP, is nil or a regular expression; -only file names that match the regexp are considered." +only file names that match the regexp are considered. +MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) (default-regexp (eval ediff-default-filtering-regexp)) @@ -710,7 +730,8 @@ only file names that match the regexp are considered." &optional merge-autostore-dir) "Run Ediff on a directory, DIR1, merging its files with their revisions. The second argument, REGEXP, is a regular expression that filters the file -names. Only the files that are under revision control are taken into account." +names. Only the files that are under revision control are taken into account. +MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) (default-regexp (eval ediff-default-filtering-regexp)) @@ -740,7 +761,8 @@ names. Only the files that are under revision control are taken into account." merge-autostore-dir) "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors. The second argument, REGEXP, is a regular expression that filters the file -names. Only the files that are under revision control are taken into account." +names. Only the files that are under revision control are taken into account. +MERGE-AUTOSTORE-DIR is the directory in which to store merged files." (interactive (let ((dir-A (ediff-get-default-directory-name)) (default-regexp (eval ediff-default-filtering-regexp)) @@ -908,7 +930,9 @@ names. Only the files that are under revision control are taken into account." With prefix argument, DUMB-MODE, or on a non-windowing display, works as follows: If WIND-A is nil, use selected window. -If WIND-B is nil, use window next to WIND-A." +If WIND-B is nil, use window next to WIND-A. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." (interactive "P") (ediff-windows dumb-mode wind-A wind-B startup-hooks 'ediff-windows-wordwise 'word-mode)) @@ -919,7 +943,9 @@ If WIND-B is nil, use window next to WIND-A." With prefix argument, DUMB-MODE, or on a non-windowing display, works as follows: If WIND-A is nil, use selected window. -If WIND-B is nil, use window next to WIND-A." +If WIND-B is nil, use window next to WIND-A. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." (interactive "P") (ediff-windows dumb-mode wind-A wind-B startup-hooks 'ediff-windows-linewise nil)) @@ -963,9 +989,12 @@ If WIND-B is nil, use window next to WIND-A." ;;;###autoload (defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks) "Run Ediff on a pair of regions in specified buffers. +BUFFER-A and BUFFER-B are the buffers to be compared. Regions (i.e., point and mark) can be set in advance or marked interactively. This function is effective only for relatively small regions, up to 200 -lines. For large regions, use `ediff-regions-linewise'." +lines. For large regions, use `ediff-regions-linewise'. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." (interactive (let (bf) (list (setq bf (read-buffer "Region's A buffer: " @@ -1003,10 +1032,13 @@ lines. For large regions, use `ediff-regions-linewise'." ;;;###autoload (defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks) "Run Ediff on a pair of regions in specified buffers. +BUFFER-A and BUFFER-B are the buffers to be compared. Regions (i.e., point and mark) can be set in advance or marked interactively. Each region is enlarged to contain full lines. This function is effective for large regions, over 100-200 -lines. For small regions, use `ediff-regions-wordwise'." +lines. For small regions, use `ediff-regions-wordwise'. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." (interactive (let (bf) (list (setq bf (read-buffer "Region A's buffer: " @@ -1127,7 +1159,11 @@ lines. For small regions, use `ediff-regions-wordwise'." ;; MERGE-BUFFER-FILE is the file to be ;; associated with the merge buffer &optional startup-hooks merge-buffer-file) - "Merge two files without ancestor." + "Merge two files without ancestor. +FILE-A and FILE-B are the names of the files to be merged. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers. MERGE-BUFFER-FILE +is the name of the file to be associated with the merge buffer.." (interactive (let ((dir-A (if ediff-use-last-dir ediff-last-dir-A @@ -1171,7 +1207,12 @@ lines. For small regions, use `ediff-regions-wordwise'." ;; to be associated with the ;; merge buffer merge-buffer-file) - "Merge two files with ancestor." + "Merge two files with ancestor. +FILE-A and FILE-B are the names of the files to be merged, and +FILE-ANCESTOR is the name of the ancestor file. STARTUP-HOOKS is +a list of functions that Emacs calls without arguments after +setting up the Ediff buffers. MERGE-BUFFER-FILE is the name of +the file to be associated with the merge buffer." (interactive (let ((dir-A (if ediff-use-last-dir ediff-last-dir-A @@ -1229,7 +1270,16 @@ lines. For small regions, use `ediff-regions-wordwise'." ;; MERGE-BUFFER-FILE is the file to be ;; associated with the merge buffer startup-hooks job-name merge-buffer-file) - "Merge buffers without ancestor." + "Merge buffers without ancestor. +BUFFER-A and BUFFER-B are the buffers to be merged. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers. JOB-NAME is a +symbol describing the Ediff job type; it defaults to +`ediff-merge-buffers', but can also be one of +`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor', +`ediff-last-dir-C', `ediff-buffers', `ediff-buffers3', or +`ediff-merge-buffers-with-ancestor'. MERGE-BUFFER-FILE is the +name of the file to be associated with the merge buffer." (interactive (let (bf) (list (setq bf (read-buffer "Buffer A to merge: " @@ -1256,7 +1306,16 @@ lines. For small regions, use `ediff-regions-wordwise'." ;; file to be associated ;; with the merge buffer merge-buffer-file) - "Merge buffers with ancestor." + "Merge buffers with ancestor. +BUFFER-A and BUFFER-B are the buffers to be merged, and +BUFFER-ANCESTOR is their ancestor. STARTUP-HOOKS is a list of +functions that Emacs calls without arguments after setting up the +Ediff buffers. JOB-NAME is a symbol describing the Ediff job +type; it defaults to `ediff-merge-buffers-with-ancestor', but can +also be one of `ediff-merge-files-with-ancestor', +`ediff-last-dir-ancestor', `ediff-last-dir-C', `ediff-buffers', +`ediff-buffers3', or `ediff-merge-buffers'. MERGE-BUFFER-FILE is +the name of the file to be associated with the merge buffer." (interactive (let (bf bff) (list (setq bf (read-buffer "Buffer A to merge: " @@ -1287,8 +1346,11 @@ lines. For small regions, use `ediff-regions-wordwise'." (defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file) ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer "Run Ediff by merging two revisions of a file. -The file is the optional FILE argument or the file visited by the current -buffer." +The file is the optional FILE argument or the file visited by the +current buffer. STARTUP-HOOKS is a list of functions that Emacs +calls without arguments after setting up the Ediff buffers. +MERGE-BUFFER-FILE is the name of the file to be associated with +the merge buffer." (interactive) (if (stringp file) (find-file file)) (let (rev1 rev2) @@ -1319,8 +1381,11 @@ buffer." ;; buffer merge-buffer-file) "Run Ediff by merging two revisions of a file with a common ancestor. -The file is the optional FILE argument or the file visited by the current -buffer." +The file is the optional FILE argument or the file visited by the +current buffer. STARTUP-HOOKS is a list of functions that Emacs +calls without arguments after setting up the Ediff buffers. +MERGE-BUFFER-FILE is the name of the file to be associated with +the merge buffer." (interactive) (if (stringp file) (find-file file)) (let (rev1 rev2 ancestor-rev) @@ -1360,8 +1425,8 @@ buffer." "Query for a file name, and then run Ediff by patching that file. If optional PATCH-BUF is given, use the patch in that buffer and don't ask the user. -If prefix argument, then: if even argument, assume that the patch is in a -buffer. If odd -- assume it is in a file." +If prefix argument ARG, then: if even argument, assume that the +patch is in a buffer. If odd -- assume it is in a file." (interactive "P") (let (source-dir source-file) (require 'ediff-ptch) @@ -1394,7 +1459,7 @@ prompts for the buffer or a file, depending on the answer. With ARG=1, assumes the patch is in a file and prompts for the file. With ARG=2, assumes the patch is in a buffer and prompts for the buffer. PATCH-BUF is an optional argument, which specifies the buffer that contains the -patch. If not given, the user is prompted according to the prefix argument." +patch. If not given, the user is prompted according to the prefix argument." (interactive "P") (require 'ediff-ptch) (setq patch-buf @@ -1421,7 +1486,9 @@ patch. If not given, the user is prompted according to the prefix argument." "Run Ediff by comparing versions of a file. The file is an optional FILE argument or the file entered at the prompt. Default: the file visited by the current buffer. -Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'." +Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'. +STARTUP-HOOKS is a list of functions that Emacs calls without +arguments after setting up the Ediff buffers." ;; if buffer is non-nil, use that buffer instead of the current buffer (interactive "P") (if (not (stringp file)) @@ -1434,7 +1501,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'." 'no-dirs))) (find-file file) (if (and (buffer-modified-p) - (y-or-n-p (format "Buffer %s is modified. Save buffer? " + (y-or-n-p (format "Buffer %s is modified. Save buffer? " (buffer-name)))) (save-buffer (current-buffer))) (let (rev1 rev2) @@ -1517,6 +1584,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-files-command () + "Call `ediff-files' with the next two command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left))) (setq command-line-args-left (nthcdr 2 command-line-args-left)) @@ -1524,6 +1592,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff3-files-command () + "Call `ediff3-files' with the next three command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (file-c (nth 2 command-line-args-left))) @@ -1532,6 +1601,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-merge-command () + "Call `ediff-merge-files' with the next two command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left))) (setq command-line-args-left (nthcdr 2 command-line-args-left)) @@ -1539,6 +1609,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-merge-with-ancestor-command () + "Call `ediff-merge-files-with-ancestor' with the next three command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (ancestor (nth 2 command-line-args-left))) @@ -1547,6 +1618,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-directories-command () + "Call `ediff-directories' with the next three command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (regexp (nth 2 command-line-args-left))) @@ -1555,6 +1627,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-directories3-command () + "Call `ediff-directories3' with the next four command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (file-c (nth 2 command-line-args-left)) @@ -1564,6 +1637,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-merge-directories-command () + "Call `ediff-merge-directories' with the next three command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (regexp (nth 2 command-line-args-left))) @@ -1572,6 +1646,7 @@ With optional NODE, goes to that node." ;;;###autoload (defun ediff-merge-directories-with-ancestor-command () + "Call `ediff-merge-directories-with-ancestor' with the next four command line arguments." (let ((file-a (nth 0 command-line-args-left)) (file-b (nth 1 command-line-args-left)) (ancestor (nth 2 command-line-args-left)) From 5d36f2227f1d9eaf6c08b26ad889c3ae343c3580 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Nov 2017 20:10:38 +0200 Subject: [PATCH 37/48] Fix last change in hscroll_window_tree * src/xdisp.c (hscroll_window_tree): When hscroll suspension is being disabled, set the frame's garbaged flag less eagerly. (Bug#29002) --- src/xdisp.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/xdisp.c b/src/xdisp.c index baf075b1c8e..69b74dc6298 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -13179,9 +13179,14 @@ hscroll_window_tree (Lisp_Object window) Fwindow_old_point (window)))) { w->suspend_auto_hscroll = false; - /* Force thorough redisplay of this window, to show the - effect of disabling hscroll suspension immediately. */ - SET_FRAME_GARBAGED (XFRAME (w->frame)); + /* When hscrolling just the current line, and the rest + of lines were temporarily hscrolled, but no longer + are, force thorough redisplay of this window, to show + the effect of disabling hscroll suspension immediately. */ + if (w->min_hscroll == 0 && w->hscroll > 0 + && EQ (Fbuffer_local_value (Qauto_hscroll_mode, w->contents), + Qcurrent_line)) + SET_FRAME_GARBAGED (XFRAME (w->frame)); } /* Remember window point. */ From 709478eaa866e10a4600f8d8829ab8c79200d45e Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Nov 2017 20:07:12 +0100 Subject: [PATCH 38/48] Prefer `customize-set-variable' in tramp.texi * doc/misc/tramp.texi (Configuration, Default Method, Default User) (Default Host, Remote shell setup, Auto-save and Backup) (Ad-hoc multi-hops, Frequently Asked Questions): Prefer `customize-set-variable' over `custom-set-variables'. --- doc/misc/tramp.texi | 77 +++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 41 deletions(-) diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 47055793b73..f1d9434bf72 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -581,10 +581,7 @@ not auto loaded by Emacs. All examples require @value{tramp} is installed and loaded: @lisp -@group -(custom-set-variables - '(tramp-verbose 6 nil (tramp) "Enable remote command traces")) -@end group +(customize-set-variable 'tramp-verbose 6 "Enable remote command traces") @end lisp @@ -1155,7 +1152,7 @@ option to determine the default method for remote file names that do not have one specified. @lisp -(custom-set-variables '(tramp-default-method "ssh" nil (tramp))) +(customize-set-variable 'tramp-default-method "ssh") @end lisp @end defopt @@ -1242,7 +1239,7 @@ this substitution can be overridden with @option{tramp-default-user}. For example: @lisp -(custom-set-variables'(tramp-default-user "root" nil (tramp))) +(customize-set-variable 'tramp-default-user "root") @end lisp @end defopt @@ -1298,9 +1295,9 @@ follows: @lisp @group (custom-set-variables - '(tramp-default-method "ssh" nil (tramp)) - '(tramp-default-user "john" nil (tramp)) - '(tramp-default-host "target" nil (tramp))) + '(tramp-default-method "ssh") + '(tramp-default-user "john") + '(tramp-default-host "target")) @end group @end lisp @@ -1858,21 +1855,20 @@ example below: @lisp @group -(custom-set-variables - '(tramp-password-prompt-regexp - (concat - "^.*" - (regexp-opt - '("passphrase" "Passphrase" - ;; English - "password" "Password" - ;; Deutsch - "passwort" "Passwort" - ;; Français - "mot de passe" "Mot de passe") - t) - ".*:\0? *") - nil (tramp))) +(customize-set-variable + 'tramp-password-prompt-regexp + (concat + "^.*" + (regexp-opt + '("passphrase" "Passphrase" + ;; English + "password" "Password" + ;; Deutsch + "passwort" "Passwort" + ;; Français + "mot de passe" "Mot de passe") + t) + ".*:\0? *")) @end group @end lisp @@ -2175,8 +2171,8 @@ Example: @group (add-to-list 'backup-directory-alist (cons "." "~/.emacs.d/backups/")) -(custom-set-variables - '(tramp-backup-directory-alist backup-directory-alist 6 nil (tramp))) +(customize-set-variable + 'tramp-backup-directory-alist backup-directory-alist) @end group @end lisp @@ -2549,7 +2545,7 @@ For ad-hoc definitions to be saved automatically in @option{tramp-save-ad-hoc-proxies} to non-@code{nil}. @lisp -(custom-set-variables '(tramp-save-ad-hoc-proxies t nil (tramp))) +(customize-set-variable 'tramp-save-ad-hoc-proxies t) @end lisp @end defopt @@ -3189,10 +3185,11 @@ which allows you to set the @code{ControlPath} provided the variable @lisp @group -(setq tramp-ssh-controlmaster-options - (concat - "-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p " - "-o ControlMaster=auto -o ControlPersist=yes")) +(customize-set-variable + 'tramp-ssh-controlmaster-options + (concat + "-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p " + "-o ControlMaster=auto -o ControlPersist=yes")) @end group @end lisp @@ -3205,10 +3202,7 @@ behavior, then any changes to @command{ssh} can be suppressed with this @code{nil} setting: @lisp -@group -(custom-set-variables - '(tramp-use-ssh-controlmaster-options nil nil (tramp))) -@end group +(customize-set-variable 'tramp-use-ssh-controlmaster-options nil) @end lisp @@ -3364,8 +3358,8 @@ You can define default methods and user names for hosts, @lisp @group (custom-set-variables - '(tramp-default-method "ssh" nil (tramp)) - '(tramp-default-user "news" nil (tramp))) + '(tramp-default-method "ssh") + '(tramp-default-user "news")) @end group @end lisp @@ -3659,7 +3653,7 @@ disable such features. Disable @value{tramp} file name completion: @lisp -(custom-set-variables '(ido-enable-tramp-completion nil)) +(customize-set-variable 'ido-enable-tramp-completion nil) @end lisp @item @@ -3682,15 +3676,16 @@ To keep Ange FTP as default the remote files access package, set this in @file{.emacs}: @lisp -(custom-set-variables '(tramp-default-method "ftp" nil (tramp))) +(customize-set-variable 'tramp-default-method "ftp") @end lisp @item To disable both @value{tramp} (and Ange FTP), set @code{tramp-mode} to -@code{nil} in @file{.emacs}. +@code{nil} in @file{.emacs}. @strong{Note}, that we don't use +@code{customize-set-variable}, in order to avoid loading @value{tramp}. @lisp -(custom-set-variables '(tramp-mode nil nil (tramp))) +(setq tramp-mode nil) @end lisp @item From ca2d94ba61dee678f85bfc7299d167e7219e6d8f Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 5 Nov 2017 20:08:05 +0100 Subject: [PATCH 39/48] Do not load Tramp unless `tramp-mode' is non-nil * lisp/net/tramp.el (tramp-autoload-file-name-handler): Load Tramp only if `tramp-mode' is non-nil. (tramp-unload-file-name-handlers): Unload also `tramp-autoload-file-name-handler'. * test/lisp/net/tramp-tests.el (tramp-test42-delay-load): Extend test. --- lisp/net/tramp.el | 13 ++++++++----- test/lisp/net/tramp-tests.el | 30 +++++++++++++++++------------- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 67192e32401..3d5dcbdbb14 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -2305,8 +2305,10 @@ Falls back to normal file name handler if no Tramp file name handler exists." ;;;###autoload (progn (defun tramp-autoload-file-name-handler (operation &rest args) "Load Tramp file name handler, and perform OPERATION." - (let ((default-directory temporary-file-directory)) - (load "tramp" 'noerror 'nomessage)) + (if tramp-mode + (let ((default-directory temporary-file-directory)) + (load "tramp" 'noerror 'nomessage)) + (tramp-unload-file-name-handlers)) (apply operation args))) ;; `tramp-autoload-file-name-handler' must be registered before @@ -2422,12 +2424,13 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'." (equal (apply operation args) operation)))) ;;;###autoload -(defun tramp-unload-file-name-handlers () +(progn (defun tramp-unload-file-name-handlers () "Unload Tramp file name handlers from `file-name-handler-alist'." (dolist (fnh '(tramp-file-name-handler - tramp-completion-file-name-handler)) + tramp-completion-file-name-handler + tramp-autoload-file-name-handler)) (let ((a1 (rassq fnh file-name-handler-alist))) - (setq file-name-handler-alist (delq a1 file-name-handler-alist))))) + (setq file-name-handler-alist (delq a1 file-name-handler-alist)))))) (add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index af707f85007..8eedfd72094 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -4432,23 +4432,27 @@ process sentinels. They shall not disturb each other." "Check that Tramp is loaded lazily, only when needed." ;; Tramp is neither loaded at Emacs startup, nor when completing a ;; non-Tramp file name like "/foo". Completing a Tramp-alike file - ;; name like "/foo:" autoloads Tramp. + ;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t. (let ((code "(progn \ - (message \"Tramp loaded: %s\" (featurep 'tramp)) \ + (setq tramp-mode %s) \ + (message \"Tramp loaded: %%s\" (featurep 'tramp)) \ (file-name-all-completions \"/foo\" \"/\") \ - (message \"Tramp loaded: %s\" (featurep 'tramp)) \ + (message \"Tramp loaded: %%s\" (featurep 'tramp)) \ (file-name-all-completions \"/foo:\" \"/\") \ - (message \"Tramp loaded: %s\" (featurep 'tramp)))")) - (should - (string-match - "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+" - (shell-command-to-string - (format - "%s -batch -Q -L %s --eval %s" - (expand-file-name invocation-name invocation-directory) - (mapconcat 'shell-quote-argument load-path " -L ") - (shell-quote-argument code))))))) + (message \"Tramp loaded: %%s\" (featurep 'tramp)))")) + (dolist (tm '(t nil)) + (should + (string-match + (format + "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+" + tm) + (shell-command-to-string + (format + "%s -batch -Q -L %s --eval %s" + (expand-file-name invocation-name invocation-directory) + (mapconcat 'shell-quote-argument load-path " -L ") + (shell-quote-argument (format code tm))))))))) (ert-deftest tramp-test43-unload () "Check that Tramp and its subpackages unload completely. From 93cd8415b2536a4df15513d6dd1a409f55b81ac4 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 6 Nov 2017 08:45:52 +0100 Subject: [PATCH 40/48] Document new treatment of 'comment-auto-fill-only-comments' * doc/lispref/text.texi (Auto Filling): Add reference to Emacs manual. Add description of 'comment-auto-fill-only-comments'. * etc/NEWS: Mention new treatment of 'comment-auto-fill-only-comments'. --- doc/lispref/text.texi | 24 ++++++++++++++++-------- etc/NEWS | 5 +++++ 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index baa3c708e90..4872dbd3e9a 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1886,10 +1886,10 @@ prefix or @code{nil}, meaning it has failed to determine a prefix. @cindex filling, automatic @cindex Auto Fill mode -@c FIXME: I don't think any of the variables below is a/an normal/abnormal hook. - Auto Fill mode is a minor mode that fills lines automatically as text -is inserted. This section describes the hook used by Auto Fill mode. -For a description of functions that you can call explicitly to fill and +Auto Fill mode is a minor mode that fills lines automatically as text is +inserted. @xref{Auto Fill,,, emacs, The GNU Emacs Manual}. This +section describes some variables used by Auto Fill mode. For a +description of functions that you can call explicitly to fill and justify existing text, see @ref{Filling}. Auto Fill mode also enables the functions that change the margins and @@ -1898,11 +1898,11 @@ justification style to refill portions of the text. @xref{Margins}. @defvar auto-fill-function The value of this buffer-local variable should be a function (of no arguments) to be called after self-inserting a character from the table -@code{auto-fill-chars}. It may be @code{nil}, in which case nothing -special is done in that case. +@code{auto-fill-chars}, see below. It may be @code{nil}, in which case +nothing special is done in that case. -The value of @code{auto-fill-function} is @code{do-auto-fill} when -Auto-Fill mode is enabled. That is a function whose sole purpose is to +The value of @code{auto-fill-function} is @code{do-auto-fill} when Auto +Fill mode is enabled. That is a function whose sole purpose is to implement the usual strategy for breaking a line. @end defvar @@ -1919,6 +1919,14 @@ self-inserted---space and newline in most language environments. They have an entry @code{t} in the table. @end defvar +@defopt comment-auto-fill-only-comments +This variable, if non-@code{nil}, means to fill lines automatically +within comments only. More precisley, this means that if a comment +syntax was defined for the current buffer, then self-inserting a +character outside of a comment will not call @code{auto-fill-function}. +@end defopt + + @node Sorting @section Sorting Text @cindex sorting text diff --git a/etc/NEWS b/etc/NEWS index 9853aa647a8..f79c2cbc8ea 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1272,6 +1272,11 @@ table implementation. This uses a new bytecode op 'switch', which isn't compatible with previous Emacs versions. This functionality can be disabled by setting 'byte-compile-cond-use-jump-table' to nil. ++++ +** If 'comment-auto-fill-only-comments' is non-nil, 'auto-fill-function' +is now called only if either no comment syntax is defined for the +current buffer or the self-insertion takes place within a comment. + --- ** The alist 'ucs-names' is now a hash table. From 4a6015811eb7a454f9ee6712335e61679a960b61 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Mon, 6 Nov 2017 14:11:15 +0100 Subject: [PATCH 41/48] =?UTF-8?q?;=20In=20text.texi=20fix=20typo=20spotted?= =?UTF-8?q?=20by=20=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/lispref/text.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 4872dbd3e9a..3d26d0930f7 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -1921,7 +1921,7 @@ have an entry @code{t} in the table. @defopt comment-auto-fill-only-comments This variable, if non-@code{nil}, means to fill lines automatically -within comments only. More precisley, this means that if a comment +within comments only. More precisely, this means that if a comment syntax was defined for the current buffer, then self-inserting a character outside of a comment will not call @code{auto-fill-function}. @end defopt From ba00ea7d0dbc91cdf1b1bbcdce938c0ecd459cdb Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 6 Nov 2017 08:33:16 -0500 Subject: [PATCH 42/48] * etc/PROBLEMS: Add URL to relevant issues for xterm+evil bug --- etc/PROBLEMS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index bb699af9df5..e5611b05b1e 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -1478,6 +1478,10 @@ To work around this, put this in your .emacs file: (with-eval-after-load 'evil-maps (define-key evil-motion-state-map [down-mouse-1] nil)) +This appears to be a bug in Evil. +See discussions in https://github.com/emacs-evil/evil/issues/960 +and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29143 + ** Emacs spontaneously displays "I-search: " at the bottom of the screen. This means that Control-S/Control-Q (XON/XOFF) "flow control" is being From 795bb233a5451d506826a912025d9fd313625920 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Mon, 6 Nov 2017 18:50:53 -0500 Subject: [PATCH 43/48] * test/lisp/net/tramp-tests.el (tramp-test16-file-expand-wildcards): Clean up properly. --- test/lisp/net/tramp-tests.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 8eedfd72094..5a7134f5f53 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -2290,7 +2290,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'." ;; Cleanup. (ignore-errors - (delete-directory tmp-name1)))))) + (delete-directory tmp-name1 'recursive)))))) (ert-deftest tramp-test17-insert-directory () "Check `insert-directory'." From db949166ecb9aeaa15aa41369a55b3ea6ceaa3b0 Mon Sep 17 00:00:00 2001 From: Antonin Houska Date: Mon, 6 Nov 2017 09:59:07 +0100 Subject: [PATCH 44/48] Handle single-line comments correctly (Bug#26049) * lisp/newcomment.el (comment-region-internal): Previously, the comment text had to contain at least one line break character for the ending extra line to be added. Make the behavior more consistent by looking for end of line instead. (comment-region-internal): Remove trailing white space from the comment's initial line. Copyright-paperwork-exempt: yes --- lisp/newcomment.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 2a0f8a8ae50..66296b81828 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -69,6 +69,9 @@ ;;; Code: +(eval-when-compile + (require 'subr-x)) + ;;;###autoload (defalias 'indent-for-comment 'comment-indent) ;;;###autoload @@ -1141,6 +1144,9 @@ the region rather than at left margin." ;; make the leading and trailing lines if requested (when lines + ;; Trim trailing whitespace from cs if there's some. + (setq cs (string-trim-right cs)) + (let ((csce (comment-make-extra-lines cs ce ccs cce min-indent max-indent block))) @@ -1211,7 +1217,7 @@ changed with `comment-style'." (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") (<= (point) end)) (or block (not (string= "" comment-end))) - (or block (progn (goto-char beg) (search-forward "\n" end t))))) + (or block (progn (goto-char beg) (re-search-forward "$" end t))))) ;; don't add end-markers just because the user asked for `block' (unless (or lines (string= "" comment-end)) (setq block nil)) From 3d6165769417f52d26852dee7d6bee3d6086ca8a Mon Sep 17 00:00:00 2001 From: "K. Handa" Date: Tue, 7 Nov 2017 20:50:46 +0900 Subject: [PATCH 45/48] Fix docstring of arabic-shaper-ZWNJ-handling * lisp/language/misc-lang.el (arabic-shaper-ZWNJ-handling): Adjusted the doctstring for addition of :set (bug#28312). --- lisp/language/misc-lang.el | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lisp/language/misc-lang.el b/lisp/language/misc-lang.el index cbb581fd19f..c1aa79cae45 100644 --- a/lisp/language/misc-lang.el +++ b/lisp/language/misc-lang.el @@ -87,9 +87,7 @@ If the value is `absorb', ZWNJ is absorbed into the previous grapheme cluster, and not displayed. If the value is `as-space', the glyph is displayed by a -thin (i.e. 1-dot width) space. - -Customizing the value takes effect when you start Emacs next time." +thin (i.e. 1-dot width) space." :group 'mule :version "26.1" :type '(choice From 20f9bf30f0d2867522c8823d8c51a1db2634fe9e Mon Sep 17 00:00:00 2001 From: "K. Handa" Date: Tue, 7 Nov 2017 20:53:32 +0900 Subject: [PATCH 46/48] Describe Lao rendering problem * etc/PROBLEMS: Describe a workaround for the problem of Lao rendering by OpenTyype font. --- etc/PROBLEMS | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/etc/PROBLEMS b/etc/PROBLEMS index e5611b05b1e..3dd225302a7 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -830,6 +830,36 @@ index 45cc554..0cc5e76 100644 If you can't modify that file directly, copy it to the directory ~/.m17n.d/ (create it if it doesn't exist), and apply the patch. +** Emacs running on GNU/Linux system with the m17n library Ver.1.7.1 or the +earlier version has a problem with rendering Lao script with OpenType font. + +The problem can be fixed by installing the newer version of the m17n +library (if any), or by following this procedure: + +1. Locate the file LAOO-OTF.flt installed on your system as part of the +m17n library. Usually it is under the directory /usr/share/m17n. + +2. Apply the following patch to LAOO-OTF.flt + +------------------------------------------------------------ +diff --git a/FLT/LAOO-OTF.flt b/FLT/LAOO-OTF.flt +index 5504171..431adf8 100644 +--- a/FLT/LAOO-OTF.flt ++++ b/FLT/LAOO-OTF.flt +@@ -3,7 +3,7 @@ + ;; See the end for copying conditions. + + (font layouter laoo-otf nil +- (font (nil phetsarath\ ot unicode-bmp))) ++ (font (nil nil unicode-bmp :otf=lao\ ))) + + ;;;
  • LAOO-OTF.flt + +------------------------------------------------------------ + +If you can't modify that file directly, copy it to the directory +~/.m17n.d/ (create it if it doesn't exist), and apply the patch. + * Internationalization problems ** M-{ does not work on a Spanish PC keyboard. From 949b70a7d80c79b2593a7d88f6543e29dc63ed18 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 7 Nov 2017 21:57:56 +0200 Subject: [PATCH 47/48] ; Minor comment copyedit in window.c * src/window.c (Fset_window_configuration): Don't use non-ASCII quotes in comments. --- src/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index 0b220226ba3..cc1d2a7b36e 100644 --- a/src/window.c +++ b/src/window.c @@ -6661,7 +6661,7 @@ the return value is nil. Otherwise the value is t. */) We have to do this in order to capture the following scenario: Suppose our frame contains two live windows W1 and - W2 and ‘set-window-configuration’ replaces them by two + W2 and 'set-window-configuration' replaces them by two windows W3 and W4 that were dead the last time run_window_size_change_functions was run. If W3 and W4 have the same values for their old and new pixel sizes but these From 255ba01148f69f452937e67feb7af5d4c1466fed Mon Sep 17 00:00:00 2001 From: "Ryan C. Thompson" Date: Wed, 26 Jul 2017 11:09:42 -0700 Subject: [PATCH 48/48] Fix handling of nil PRED2 arg for completion-table-with-predicate * lisp/minibuffer.el (completion-table-with-predicate): Don't act as if strict is non-nil when pred2 is nil (Bug#27841). * test/lisp/minibuffer-tests.el (completion-table-with-predicate-test): Add a test for Bug#27841. --- lisp/minibuffer.el | 2 +- test/lisp/minibuffer-tests.el | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index f13f1fa7984..26861de87b0 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -392,7 +392,7 @@ obeys predicates." (and (funcall pred1 x) (funcall pred2 x))))) ;; If completion failed and we're not applying pred1 strictly, try ;; again without pred1. - (and (not strict) pred1 pred2 + (and (not strict) pred1 (complete-with-action action table string pred2)))))) (defun completion-table-in-turn (&rest tables) diff --git a/test/lisp/minibuffer-tests.el b/test/lisp/minibuffer-tests.el index c27b338f7f3..2d2ac85e3ff 100644 --- a/test/lisp/minibuffer-tests.el +++ b/test/lisp/minibuffer-tests.el @@ -42,5 +42,37 @@ (should (equal (buffer-string) "test: ")))))) +(ert-deftest completion-table-with-predicate-test () + (let ((full-collection + '("apple" ; Has A. + "beet" ; Has B. + "banana" ; Has A & B. + "cherry" ; Has neither. + )) + (no-A (lambda (x) (not (string-match-p "a" x)))) + (no-B (lambda (x) (not (string-match-p "b" x))))) + (should + (member "cherry" + (completion-table-with-predicate + full-collection no-A t "" no-B t))) + (should-not + (member "banana" + (completion-table-with-predicate + full-collection no-A t "" no-B t))) + ;; "apple" should still match when strict is nil. + (should (eq t (try-completion + "apple" + (apply-partially + 'completion-table-with-predicate + full-collection no-A nil) + no-B))) + ;; "apple" should still match when strict is nil and pred2 is nil + ;; (Bug#27841). + (should (eq t (try-completion + "apple" + (apply-partially + 'completion-table-with-predicate + full-collection no-A nil)))))) + (provide 'completion-tests) ;;; completion-tests.el ends here