aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2017-11-08 19:22:26 -0800
committerPaul Eggert2017-11-08 19:22:26 -0800
commit6ee827059463e4b95c9251ef22a21f9c67cf668d (patch)
tree0612e1b84922cc43eeed5ea219104d4c5985cbdf
parent83dc3f0e9b518e45bcfb0aaebcc706f79622f157 (diff)
parent255ba01148f69f452937e67feb7af5d4c1466fed (diff)
downloademacs-6ee827059463e4b95c9251ef22a21f9c67cf668d.tar.gz
emacs-6ee827059463e4b95c9251ef22a21f9c67cf668d.zip
Merge from origin/emacs-26
255ba01148 Fix handling of nil PRED2 arg for completion-table-with-pr... 949b70a7d8 ; Minor comment copyedit in window.c 20f9bf30f0 Describe Lao rendering problem 3d61657694 Fix docstring of arabic-shaper-ZWNJ-handling db949166ec Handle single-line comments correctly (Bug#26049) 795bb233a5 * test/lisp/net/tramp-tests.el (tramp-test16-file-expand-w... ba00ea7d0d * etc/PROBLEMS: Add URL to relevant issues for xterm+evil bug 4a6015811e ; In text.texi fix typo spotted by Štěpán Němec 93cd8415b2 Document new treatment of 'comment-auto-fill-only-comments' ca2d94ba61 Do not load Tramp unless `tramp-mode' is non-nil 709478eaa8 Prefer `customize-set-variable' in tramp.texi 5d36f2227f Fix last change in hscroll_window_tree 72d07d1950 Ediff: add some missing documentation 18af404ef3 Support python virtualenv on w32 (Bug#24464) efd0371c23 Improve dired deletion error handling (Bug#28797) 5d744e032f Don't replace user input when completion prefix is empty (... ec6cf35c5f ; Describe xt-mouse problems with Evil mode c572e1f329 Return non-nil from gnutls-available-p under GnuTLS 2.x a2cc6d74c5 Fix Flymake help-echo functions across windows (bug#29142) 58bb3462ee Add tests for Flymake backends for Ruby and Perl 58e742b21d Add a Flymake backend for Perl 9dee764165 Add a Flymake backend for Ruby 3ad712ebc9 Add a Flymake backend for Python (bug#28808) 8db2b3a79b Allow "%" in Tramp host names 8c50842790 ; Fix typo in test/file-organization.org 00fa4449cd ; Fix typo 918a2dda07 Use hybrid malloc for FreeBSD (Bug#28308) 725ab635d9 Add html-, mhtml- and python-mode support to semantic symref 369da28702 Improve documentation of 'window-scroll-functions' 93818eed8a Fix subtle problems in tabulated-list-mode with line numbers 1f1de8e872 Make gdb-non-stop-setting default to nil on MS-Windows 680e8e119b Fix gdb-mi prompt after "attach PID" command ff33074546 Fix doc string of 'window-configuration-change-hook' 787b75ad71 Improve documentation of window hooks d9be8704ae Fix hscroll suspension after cursor motion 6f43d29d29 ; * CONTRIBUTE, admin/make-tarball.txt: Doc tweaks re 'ema... a0d30d6369 Introduce a function to CC Mode which displays the current... 383abc8898 ; Fix some comment typos b02c2714c3 Fix typos in ediff-wind.el 4f38bdec74 Examine tex-chktex--process in the correct buffer 94b490529a * nt/INSTALL.W64: Update to current mingw64 install instru... c25113d4ac Don't resignal errors in flymake-diag-region e950f329c0 New xref-quit-and-goto-xref command bound to TAB (bug#28814) 5d34e1b288 Allow split-window-sensibly to split threshold in further ... 2a973edeac Honor window-switching intents in xref-find-definitions (b... 78e9065e9f * lisp/emacs-lisp/generator.el (iter-do): Add a debug decl... caa63cc96c * lisp/progmodes/flymake.el (flymake-start): Fix dead buff... 9f4f130b79 Fix buffer name comparison in async shell-command # Conflicts: # etc/NEWS # lisp/vc/ediff-wind.el
-rw-r--r--CONTRIBUTE9
-rw-r--r--admin/make-tarball.txt5
-rw-r--r--configure.ac2
-rw-r--r--doc/emacs/maintaining.texi7
-rw-r--r--doc/lispref/text.texi24
-rw-r--r--doc/lispref/windows.texi23
-rw-r--r--doc/misc/cc-mode.texi13
-rw-r--r--doc/misc/emacs-gnutls.texi6
-rw-r--r--doc/misc/tramp.texi77
-rw-r--r--etc/NEWS.2619
-rw-r--r--etc/PROBLEMS46
-rw-r--r--lisp/calc/calcalg2.el2
-rw-r--r--lisp/cedet/semantic/symref/grep.el20
-rw-r--r--lisp/dired.el2
-rw-r--r--lisp/emacs-lisp/generator.el3
-rw-r--r--lisp/emacs-lisp/tabulated-list.el15
-rw-r--r--lisp/language/misc-lang.el4
-rw-r--r--lisp/minibuffer.el2
-rw-r--r--lisp/net/tramp-gvfs.el3
-rw-r--r--lisp/net/tramp.el18
-rw-r--r--lisp/newcomment.el8
-rw-r--r--lisp/pcomplete.el2
-rw-r--r--lisp/progmodes/cc-cmds.el19
-rw-r--r--lisp/progmodes/cc-mode.el3
-rw-r--r--lisp/progmodes/cperl-mode.el4
-rw-r--r--lisp/progmodes/flymake-proc.el2
-rw-r--r--lisp/progmodes/flymake.el26
-rw-r--r--lisp/progmodes/gdb-mi.el19
-rw-r--r--lisp/progmodes/perl-mode.el71
-rw-r--r--lisp/progmodes/python.el151
-rw-r--r--lisp/progmodes/ruby-mode.el63
-rw-r--r--lisp/progmodes/xref.el91
-rw-r--r--lisp/simple.el40
-rw-r--r--lisp/textmodes/reftex-index.el2
-rw-r--r--lisp/textmodes/reftex-ref.el2
-rw-r--r--lisp/textmodes/reftex-toc.el2
-rw-r--r--lisp/textmodes/tex-mode.el3
-rw-r--r--lisp/vc/ediff.el125
-rw-r--r--lisp/window.el35
-rw-r--r--nt/INSTALL.W648
-rw-r--r--src/gmalloc.c11
-rw-r--r--src/gnutls.c2
-rw-r--r--src/window.c6
-rw-r--r--src/xdisp.c19
-rw-r--r--test/file-organization.org2
-rw-r--r--test/lisp/minibuffer-tests.el32
-rw-r--r--test/lisp/net/tramp-tests.el32
-rw-r--r--test/lisp/progmodes/flymake-resources/test.pl2
-rw-r--r--test/lisp/progmodes/flymake-resources/test.rb5
-rw-r--r--test/lisp/progmodes/flymake-tests.el27
50 files changed, 866 insertions, 248 deletions
diff --git a/CONTRIBUTE b/CONTRIBUTE
index c7f3330ab01..c324375bb07 100644
--- a/CONTRIBUTE
+++ b/CONTRIBUTE
@@ -27,10 +27,11 @@ admin/notes/git-workflow.
27** Getting involved with development 27** Getting involved with development
28 28
29Discussion about Emacs development takes place on emacs-devel@gnu.org. 29Discussion about Emacs development takes place on emacs-devel@gnu.org.
30You can subscribe to the emacs-devel@gnu.org mailing list, paying 30You can subscribe to the emacs-devel@gnu.org mailing list.
31attention to postings with subject lines containing "emacs-announce", 31If you want to get only the important mails (for things like
32as these discuss important events like feature freezes. See 32feature freezes), choose to receive only the 'emacs-announce' topic
33https://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list 33(although so far this feature has not been well or consistently used).
34See https://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list
34instructions and archives. You can develop and commit changes in your 35instructions and archives. You can develop and commit changes in your
35own copy of the repository, and discuss proposed changes on the 36own copy of the repository, and discuss proposed changes on the
36mailing list. Frequent contributors to Emacs can request write access 37mailing list. Frequent contributors to Emacs can request write access
diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt
index 3b811fb208c..ac6d15d6cee 100644
--- a/admin/make-tarball.txt
+++ b/admin/make-tarball.txt
@@ -177,6 +177,11 @@ General steps (for each step, check for possible errors):
177 See the info-gnu-emacs mailing list archives for the form 177 See the info-gnu-emacs mailing list archives for the form
178 of past announcements. The first pretest announcement, and the 178 of past announcements. The first pretest announcement, and the
179 release announcement, should have more detail. 179 release announcement, should have more detail.
180 Use the emacs-devel topic 'emacs-announce'. The best way to do
181 this is to add a header "Keywords: emacs-announce" to your mail.
182 (You can also put it in the Subject, but this is not as good
183 because replies that invariably are not announcements also get
184 sent out as if they were.)
180 185
18112. After a release, update the Emacs pages as below. 18612. After a release, update the Emacs pages as below.
182 187
diff --git a/configure.ac b/configure.ac
index 5ab95991ef0..2dd21b77dac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2218,7 +2218,7 @@ test "$CANNOT_DUMP" = yes ||
2218case "$opsys" in 2218case "$opsys" in
2219 ## darwin ld insists on the use of malloc routines in the System framework. 2219 ## darwin ld insists on the use of malloc routines in the System framework.
2220 darwin | mingw32 | nacl | sol2-10) ;; 2220 darwin | mingw32 | nacl | sol2-10) ;;
2221 cygwin | qnxto) 2221 cygwin | qnxto | freebsd)
2222 hybrid_malloc=yes 2222 hybrid_malloc=yes
2223 system_malloc= ;; 2223 system_malloc= ;;
2224 *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;; 2224 *) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;;
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:
1887@table @kbd 1887@table @kbd
1888@item @key{RET} 1888@item @key{RET}
1889@itemx mouse-2 1889@itemx mouse-2
1890Display the reference on the current line and bury the @file{*xref*} 1890Display the reference on the current line.
1891buffer.
1892@item n 1891@item n
1893@itemx . 1892@itemx .
1894@findex xref-next-line 1893@findex xref-next-line
@@ -1903,6 +1902,10 @@ Move to the previous reference and display it in the other window
1903@findex xref-show-location-at-point 1902@findex xref-show-location-at-point
1904Display the reference on the current line in the other window 1903Display the reference on the current line in the other window
1905(@code{xref-show-location-at-point}). 1904(@code{xref-show-location-at-point}).
1905@item TAB
1906@findex xref-quit-and-goto-xref
1907Display the reference on the current line and bury the @file{*xref*}
1908buffer (@code{xref-quit-and-goto-xref}).
1906@findex xref-query-replace-in-results 1909@findex xref-query-replace-in-results
1907@item r @var{pattern} @key{RET} @var{replacement} @key{RET} 1910@item r @var{pattern} @key{RET} @var{replacement} @key{RET}
1908Perform interactive query-replace on references that match 1911Perform interactive query-replace on references that match
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 6094a41c473..ab554dcd421 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.
1886@cindex filling, automatic 1886@cindex filling, automatic
1887@cindex Auto Fill mode 1887@cindex Auto Fill mode
1888 1888
1889@c FIXME: I don't think any of the variables below is a/an normal/abnormal hook. 1889Auto Fill mode is a minor mode that fills lines automatically as text is
1890 Auto Fill mode is a minor mode that fills lines automatically as text 1890inserted. @xref{Auto Fill,,, emacs, The GNU Emacs Manual}. This
1891is inserted. This section describes the hook used by Auto Fill mode. 1891section describes some variables used by Auto Fill mode. For a
1892For a description of functions that you can call explicitly to fill and 1892description of functions that you can call explicitly to fill and
1893justify existing text, see @ref{Filling}. 1893justify existing text, see @ref{Filling}.
1894 1894
1895 Auto Fill mode also enables the functions that change the margins and 1895 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}.
1898@defvar auto-fill-function 1898@defvar auto-fill-function
1899The value of this buffer-local variable should be a function (of no 1899The value of this buffer-local variable should be a function (of no
1900arguments) to be called after self-inserting a character from the table 1900arguments) to be called after self-inserting a character from the table
1901@code{auto-fill-chars}. It may be @code{nil}, in which case nothing 1901@code{auto-fill-chars}, see below. It may be @code{nil}, in which case
1902special is done in that case. 1902nothing special is done in that case.
1903 1903
1904The value of @code{auto-fill-function} is @code{do-auto-fill} when 1904The value of @code{auto-fill-function} is @code{do-auto-fill} when Auto
1905Auto-Fill mode is enabled. That is a function whose sole purpose is to 1905Fill mode is enabled. That is a function whose sole purpose is to
1906implement the usual strategy for breaking a line. 1906implement the usual strategy for breaking a line.
1907@end defvar 1907@end defvar
1908 1908
@@ -1919,6 +1919,14 @@ self-inserted---space and newline in most language environments. They
1919have an entry @code{t} in the table. 1919have an entry @code{t} in the table.
1920@end defvar 1920@end defvar
1921 1921
1922@defopt comment-auto-fill-only-comments
1923This variable, if non-@code{nil}, means to fill lines automatically
1924within comments only. More precisely, this means that if a comment
1925syntax was defined for the current buffer, then self-inserting a
1926character outside of a comment will not call @code{auto-fill-function}.
1927@end defopt
1928
1929
1922@node Sorting 1930@node Sorting
1923@section Sorting Text 1931@section Sorting Text
1924@cindex sorting text 1932@cindex sorting text
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 5014cd3d82d..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
5127the window also runs these functions. 5127the window also runs these functions.
5128 5128
5129This variable is not a normal hook, because each function is called with 5129This variable is not a normal hook, because each function is called with
5130two arguments: the window, and its new display-start position. 5130two arguments: the window, and its new display-start position. At the
5131time of the call, the display-start position of the window argument is
5132already set to its new value, and the buffer to be displayed in the
5133window is already set as the current buffer.
5131 5134
5132These functions must take care when using @code{window-end} 5135These functions must take care when using @code{window-end}
5133(@pxref{Window Start and End}); if you need an up-to-date value, you 5136(@pxref{Window Start and End}); if you need an up-to-date value, you
@@ -5138,6 +5141,11 @@ is scrolled. It's not designed for that, and such use probably won't
5138work. 5141work.
5139@end defvar 5142@end defvar
5140 5143
5144@defun run-window-scroll-functions &optional window
5145This function calls @code{window-scroll-functions} for the specified
5146@var{window}, which defaults to the selected window.
5147@end defun
5148
5141@defvar window-size-change-functions 5149@defvar window-size-change-functions
5142This variable holds a list of functions to be called if the size of any 5150This variable holds a list of functions to be called if the size of any
5143window changes for any reason. The functions are called once per 5151window changes for any reason. The functions are called once per
@@ -5167,17 +5175,22 @@ be called again.
5167@defvar window-configuration-change-hook 5175@defvar window-configuration-change-hook
5168A normal hook that is run every time the window configuration of a frame 5176A normal hook that is run every time the window configuration of a frame
5169changes. Window configuration changes include splitting and deleting 5177changes. Window configuration changes include splitting and deleting
5170windows and the display of a different buffer in a window. Resizing the 5178windows, and the display of a different buffer in a window. Resizing the
5171frame or individual windows do not count as configuration changes. Use 5179frame or individual windows do not count as configuration changes. Use
5172@code{window-size-change-functions}, see above, when you want to track 5180@code{window-size-change-functions}, see above, when you want to track
5173size changes that are not caused by the deletion or creation of windows. 5181size changes that are not caused by the deletion or creation of windows.
5174 5182
5175The buffer-local part of this hook is run once for each window on the 5183The buffer-local value of this hook is run once for each window on the
5176affected frame, with the relevant window selected and its buffer 5184affected frame, with the relevant window selected and its buffer
5177current. The global part is run once for the modified frame, with that 5185current. The global value of this hook is run once for the modified
5178frame selected. 5186frame, with that frame selected.
5179@end defvar 5187@end defvar
5180 5188
5189@defun run-window-configuration-change-hook &optional frame
5190This function runs @code{window-configuration-change-hook} for the
5191specified @var{frame}, which defaults to the selected frame.
5192@end defun
5193
5181 In addition, you can use @code{jit-lock-register} to register a Font 5194 In addition, you can use @code{jit-lock-register} to register a Font
5182Lock fontification function, which will be called whenever parts of a 5195Lock fontification function, which will be called whenever parts of a
5183buffer are (re)fontified because a window was scrolled or its size 5196buffer are (re)fontified because a window was scrolled or its size
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index c90f6d06bf6..13f5c81d949 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,
1760see @ref{Indentation Commands} and @ref{Filling and Breaking}. 1760see @ref{Indentation Commands} and @ref{Filling and Breaking}.
1761 1761
1762For details of the @ccmode{} style system, see @ref{Styles}. 1762For details of the @ccmode{} style system, see @ref{Styles}.
1763
1763@item @kbd{C-c :} (@code{c-scope-operator}) 1764@item @kbd{C-c :} (@code{c-scope-operator})
1764@kindex C-c : 1765@kindex C-c :
1765@findex c-scope-operator 1766@findex c-scope-operator
@@ -1768,6 +1769,18 @@ In C++, it is also sometimes desirable to insert the double-colon scope
1768operator without performing the electric behavior of colon insertion. 1769operator without performing the electric behavior of colon insertion.
1769@kbd{C-c :} does just this. 1770@kbd{C-c :} does just this.
1770 1771
1772@item @kbd{C-c C-z} (@code{c-display-defun-name})
1773@kindex C-c C-z
1774@findex c-display-defun-name
1775@findex display-defun-name (c-)
1776Display the current function name, if any, in the minibuffer.
1777Additionally, if a prefix argument is given, push the function name to
1778the kill ring. If there is no current function,
1779@code{c-display-defun-name} does nothing. In Emacs, you can use this
1780command in the middle of an interactive search if you set the
1781customizable option @code{isearch-allow-scroll} to non-@code{nil}.
1782@xref{Not Exiting Isearch,,,emacs, GNU Emacs Manual}.
1783
1771@item @kbd{C-c C-\} (@code{c-backslash-region}) 1784@item @kbd{C-c C-\} (@code{c-backslash-region})
1772@kindex C-c C-\ 1785@kindex C-c C-\
1773@findex c-backslash-region 1786@findex c-backslash-region
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
94Zaretskii) in the same directory as Emacs, you should be OK. 94Zaretskii) in the same directory as Emacs, you should be OK.
95 95
96@defun gnutls-available-p 96@defun gnutls-available-p
97This function returns @code{t} if GnuTLS is available in this instance of Emacs. 97This function returns non-@code{nil} if GnuTLS is available in this
98instance of Emacs, @code{nil} otherwise. If GnuTLS is available, the
99value is a list of GnuTLS capabilities supported by the installed
100GnuTLS library, which depends on the library version. The meaning of
101the capabilities is documented in the doc string of this function.
98@end defun 102@end defun
99 103
100Oh, but sometimes things go wrong. Budgets aren't balanced, 104Oh, but sometimes things go wrong. Budgets aren't balanced,
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
581installed and loaded: 581installed and loaded:
582 582
583@lisp 583@lisp
584@group 584(customize-set-variable 'tramp-verbose 6 "Enable remote command traces")
585(custom-set-variables
586 '(tramp-verbose 6 nil (tramp) "Enable remote command traces"))
587@end group
588@end lisp 585@end lisp
589 586
590 587
@@ -1155,7 +1152,7 @@ option to determine the default method for remote file names that do
1155not have one specified. 1152not have one specified.
1156 1153
1157@lisp 1154@lisp
1158(custom-set-variables '(tramp-default-method "ssh" nil (tramp))) 1155(customize-set-variable 'tramp-default-method "ssh")
1159@end lisp 1156@end lisp
1160@end defopt 1157@end defopt
1161 1158
@@ -1242,7 +1239,7 @@ this substitution can be overridden with @option{tramp-default-user}.
1242For example: 1239For example:
1243 1240
1244@lisp 1241@lisp
1245(custom-set-variables'(tramp-default-user "root" nil (tramp))) 1242(customize-set-variable 'tramp-default-user "root")
1246@end lisp 1243@end lisp
1247@end defopt 1244@end defopt
1248 1245
@@ -1298,9 +1295,9 @@ follows:
1298@lisp 1295@lisp
1299@group 1296@group
1300(custom-set-variables 1297(custom-set-variables
1301 '(tramp-default-method "ssh" nil (tramp)) 1298 '(tramp-default-method "ssh")
1302 '(tramp-default-user "john" nil (tramp)) 1299 '(tramp-default-user "john")
1303 '(tramp-default-host "target" nil (tramp))) 1300 '(tramp-default-host "target"))
1304@end group 1301@end group
1305@end lisp 1302@end lisp
1306 1303
@@ -1858,21 +1855,20 @@ example below:
1858 1855
1859@lisp 1856@lisp
1860@group 1857@group
1861(custom-set-variables 1858(customize-set-variable
1862 '(tramp-password-prompt-regexp 1859 'tramp-password-prompt-regexp
1863 (concat 1860 (concat
1864 "^.*" 1861 "^.*"
1865 (regexp-opt 1862 (regexp-opt
1866 '("passphrase" "Passphrase" 1863 '("passphrase" "Passphrase"
1867 ;; English 1864 ;; English
1868 "password" "Password" 1865 "password" "Password"
1869 ;; Deutsch 1866 ;; Deutsch
1870 "passwort" "Passwort" 1867 "passwort" "Passwort"
1871 ;; Français 1868 ;; Français
1872 "mot de passe" "Mot de passe") 1869 "mot de passe" "Mot de passe")
1873 t) 1870 t)
1874 ".*:\0? *") 1871 ".*:\0? *"))
1875 nil (tramp)))
1876@end group 1872@end group
1877@end lisp 1873@end lisp
1878 1874
@@ -2175,8 +2171,8 @@ Example:
2175@group 2171@group
2176(add-to-list 'backup-directory-alist 2172(add-to-list 'backup-directory-alist
2177 (cons "." "~/.emacs.d/backups/")) 2173 (cons "." "~/.emacs.d/backups/"))
2178(custom-set-variables 2174(customize-set-variable
2179 '(tramp-backup-directory-alist backup-directory-alist 6 nil (tramp))) 2175 'tramp-backup-directory-alist backup-directory-alist)
2180@end group 2176@end group
2181@end lisp 2177@end lisp
2182 2178
@@ -2549,7 +2545,7 @@ For ad-hoc definitions to be saved automatically in
2549@option{tramp-save-ad-hoc-proxies} to non-@code{nil}. 2545@option{tramp-save-ad-hoc-proxies} to non-@code{nil}.
2550 2546
2551@lisp 2547@lisp
2552(custom-set-variables '(tramp-save-ad-hoc-proxies t nil (tramp))) 2548(customize-set-variable 'tramp-save-ad-hoc-proxies t)
2553@end lisp 2549@end lisp
2554@end defopt 2550@end defopt
2555 2551
@@ -3189,10 +3185,11 @@ which allows you to set the @code{ControlPath} provided the variable
3189 3185
3190@lisp 3186@lisp
3191@group 3187@group
3192(setq tramp-ssh-controlmaster-options 3188(customize-set-variable
3193 (concat 3189 'tramp-ssh-controlmaster-options
3194 "-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p " 3190 (concat
3195 "-o ControlMaster=auto -o ControlPersist=yes")) 3191 "-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
3192 "-o ControlMaster=auto -o ControlPersist=yes"))
3196@end group 3193@end group
3197@end lisp 3194@end lisp
3198 3195
@@ -3205,10 +3202,7 @@ behavior, then any changes to @command{ssh} can be suppressed with
3205this @code{nil} setting: 3202this @code{nil} setting:
3206 3203
3207@lisp 3204@lisp
3208@group 3205(customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
3209(custom-set-variables
3210 '(tramp-use-ssh-controlmaster-options nil nil (tramp)))
3211@end group
3212@end lisp 3206@end lisp
3213 3207
3214 3208
@@ -3364,8 +3358,8 @@ You can define default methods and user names for hosts,
3364@lisp 3358@lisp
3365@group 3359@group
3366(custom-set-variables 3360(custom-set-variables
3367 '(tramp-default-method "ssh" nil (tramp)) 3361 '(tramp-default-method "ssh")
3368 '(tramp-default-user "news" nil (tramp))) 3362 '(tramp-default-user "news"))
3369@end group 3363@end group
3370@end lisp 3364@end lisp
3371 3365
@@ -3659,7 +3653,7 @@ disable such features.
3659Disable @value{tramp} file name completion: 3653Disable @value{tramp} file name completion:
3660 3654
3661@lisp 3655@lisp
3662(custom-set-variables '(ido-enable-tramp-completion nil)) 3656(customize-set-variable 'ido-enable-tramp-completion nil)
3663@end lisp 3657@end lisp
3664 3658
3665@item 3659@item
@@ -3682,15 +3676,16 @@ To keep Ange FTP as default the remote files access package, set this
3682in @file{.emacs}: 3676in @file{.emacs}:
3683 3677
3684@lisp 3678@lisp
3685(custom-set-variables '(tramp-default-method "ftp" nil (tramp))) 3679(customize-set-variable 'tramp-default-method "ftp")
3686@end lisp 3680@end lisp
3687 3681
3688@item 3682@item
3689To disable both @value{tramp} (and Ange FTP), set @code{tramp-mode} to 3683To disable both @value{tramp} (and Ange FTP), set @code{tramp-mode} to
3690@code{nil} in @file{.emacs}. 3684@code{nil} in @file{.emacs}. @strong{Note}, that we don't use
3685@code{customize-set-variable}, in order to avoid loading @value{tramp}.
3691 3686
3692@lisp 3687@lisp
3693(custom-set-variables '(tramp-mode nil nil (tramp))) 3688(setq tramp-mode nil)
3694@end lisp 3689@end lisp
3695 3690
3696@item 3691@item
diff --git a/etc/NEWS.26 b/etc/NEWS.26
index 286d27455fe..f79c2cbc8ea 100644
--- a/etc/NEWS.26
+++ b/etc/NEWS.26
@@ -1213,6 +1213,16 @@ New user options `term-char-mode-buffer-read-only' and
1213are non-nil by default. Customize these options to nil if you want 1213are non-nil by default. Customize these options to nil if you want
1214the previous behavior. 1214the previous behavior.
1215 1215
1216** Xref
1217
1218+++
1219*** When an *xref* buffer is needed, 'TAB' quits and jumps to an xref.
1220
1221A new command 'xref-quit-and-goto-xref', bound to 'TAB' in *xref*
1222buffers, quits the window before jumping to the destination. In many
1223situations, the intended window configuration is restored, just as if
1224the *xref* buffer hadn't been necessary in the first place.
1225
1216 1226
1217* New Modes and Packages in Emacs 26.1 1227* New Modes and Packages in Emacs 26.1
1218 1228
@@ -1262,6 +1272,11 @@ table implementation. This uses a new bytecode op 'switch', which
1262isn't compatible with previous Emacs versions. This functionality can 1272isn't compatible with previous Emacs versions. This functionality can
1263be disabled by setting 'byte-compile-cond-use-jump-table' to nil. 1273be disabled by setting 'byte-compile-cond-use-jump-table' to nil.
1264 1274
1275+++
1276** If 'comment-auto-fill-only-comments' is non-nil, 'auto-fill-function'
1277is now called only if either no comment syntax is defined for the
1278current buffer or the self-insertion takes place within a comment.
1279
1265--- 1280---
1266** The alist 'ucs-names' is now a hash table. 1281** The alist 'ucs-names' is now a hash table.
1267 1282
@@ -1526,6 +1541,10 @@ and 'gnutls-symmetric-decrypt'.
1526See the node "(elisp) GnuTLS Cryptography" in the ELisp manual for details. 1541See the node "(elisp) GnuTLS Cryptography" in the ELisp manual for details.
1527 1542
1528+++ 1543+++
1544** The function 'gnutls-available-p' now returns a list of capabilities
1545supported by the GnuTLS library used by Emacs.
1546
1547+++
1529** Emacs now supports records for user-defined types, via the new 1548** Emacs now supports records for user-defined types, via the new
1530functions 'make-record', 'record', and 'recordp'. Records are now 1549functions 'make-record', 'record', and 'recordp'. Records are now
1531used internally to represent cl-defstruct and defclass instances, for 1550used internally to represent cl-defstruct and defclass instances, for
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index 4db97ffd74c..6a847f695b9 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -826,6 +826,36 @@ index 45cc554..0cc5e76 100644
826If you can't modify that file directly, copy it to the directory 826If you can't modify that file directly, copy it to the directory
827~/.m17n.d/ (create it if it doesn't exist), and apply the patch. 827~/.m17n.d/ (create it if it doesn't exist), and apply the patch.
828 828
829** Emacs running on GNU/Linux system with the m17n library Ver.1.7.1 or the
830earlier version has a problem with rendering Lao script with OpenType font.
831
832The problem can be fixed by installing the newer version of the m17n
833library (if any), or by following this procedure:
834
8351. Locate the file LAOO-OTF.flt installed on your system as part of the
836m17n library. Usually it is under the directory /usr/share/m17n.
837
8382. Apply the following patch to LAOO-OTF.flt
839
840------------------------------------------------------------
841diff --git a/FLT/LAOO-OTF.flt b/FLT/LAOO-OTF.flt
842index 5504171..431adf8 100644
843--- a/FLT/LAOO-OTF.flt
844+++ b/FLT/LAOO-OTF.flt
845@@ -3,7 +3,7 @@
846 ;; See the end for copying conditions.
847
848 (font layouter laoo-otf nil
849- (font (nil phetsarath\ ot unicode-bmp)))
850+ (font (nil nil unicode-bmp :otf=lao\ )))
851
852 ;;; <li> LAOO-OTF.flt
853
854------------------------------------------------------------
855
856If you can't modify that file directly, copy it to the directory
857~/.m17n.d/ (create it if it doesn't exist), and apply the patch.
858
829* Internationalization problems 859* Internationalization problems
830 860
831** M-{ does not work on a Spanish PC keyboard. 861** M-{ does not work on a Spanish PC keyboard.
@@ -1462,6 +1492,22 @@ this, you can remove the X resource or put this in your init file:
1462 1492
1463 (xterm-remove-modify-other-keys) 1493 (xterm-remove-modify-other-keys)
1464 1494
1495** Emacs's xterm-mouse doesn't work well in Evil mode.
1496
1497Specifically, clicking mouse-1 doesn't work as expected: instead of
1498moving point where you click, it highlights the region between the
1499line beginning and the click location, and displays error messages
1500about unbound keys in the echo area.
1501
1502To work around this, put this in your .emacs file:
1503
1504 (with-eval-after-load 'evil-maps
1505 (define-key evil-motion-state-map [down-mouse-1] nil))
1506
1507This appears to be a bug in Evil.
1508See discussions in https://github.com/emacs-evil/evil/issues/960
1509and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29143
1510
1465** Emacs spontaneously displays "I-search: " at the bottom of the screen. 1511** Emacs spontaneously displays "I-search: " at the bottom of the screen.
1466 1512
1467This means that Control-S/Control-Q (XON/XOFF) "flow control" is being 1513This means that Control-S/Control-Q (XON/XOFF) "flow control" is being
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 @@
2354 2354
2355;; The variables math-solve-lhs, math-solve-rhs and math-try-solve-sign 2355;; The variables math-solve-lhs, math-solve-rhs and math-try-solve-sign
2356;; are local to math-try-solve-for, but are used by math-try-solve-prod. 2356;; are local to math-try-solve-for, but are used by math-try-solve-prod.
2357;; (math-solve-lhs and math-solve-rhs are is also local to 2357;; (math-solve-lhs and math-solve-rhs are also local to
2358;; math-decompose-poly, but used by math-solve-poly-funny-powers.) 2358;; math-decompose-poly, but used by math-solve-poly-funny-powers.)
2359(defvar math-solve-lhs) 2359(defvar math-solve-lhs)
2360(defvar math-solve-rhs) 2360(defvar math-solve-rhs)
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 @@
38 ( 38 (
39 ) 39 )
40 "A symref tool implementation using grep. 40 "A symref tool implementation using grep.
41This tool uses EDE to find he root of the project, then executes 41This tool uses EDE to find the root of the project, then executes
42find-grep in the project. The output is parsed for hits 42find-grep in the project. The output is parsed for hits and
43and those hits returned.") 43those hits returned.")
44 44
45(defvar semantic-symref-filepattern-alist 45(defvar semantic-symref-filepattern-alist
46 '((c-mode "*.[ch]") 46 '((c-mode "*.[ch]")
47 (c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh") 47 (c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
48 (html-mode "*.s?html" "*.php") 48 (html-mode "*.html" "*.shtml" "*.php")
49 (mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove
50 ; duplication of
51 ; HTML-related patterns.
52 ; Maybe they belong in the
53 ; major mode definition?
49 (ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml" 54 (ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
50 "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile") 55 "Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
56 (python-mode "*.py" "*.pyi" "*.pyw")
51 (perl-mode "*.pl" "*.PL") 57 (perl-mode "*.pl" "*.PL")
52 (cperl-mode "*.pl" "*.PL") 58 (cperl-mode "*.pl" "*.PL")
53 (lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs") 59 (lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs")
@@ -58,7 +64,7 @@ See find -name man page for format.")
58(defun semantic-symref-derive-find-filepatterns (&optional mode) 64(defun semantic-symref-derive-find-filepatterns (&optional mode)
59 ;; FIXME: This should be moved to grep.el, where it could be used 65 ;; FIXME: This should be moved to grep.el, where it could be used
60 ;; for "C-u M-x grep" as well. 66 ;; for "C-u M-x grep" as well.
61 "Derive a list of file patterns for the current buffer. 67 "Derive a list of file (glob) patterns for the current buffer.
62Looks first in `semantic-symref-filepattern-alist'. If it is not 68Looks first in `semantic-symref-filepattern-alist'. If it is not
63there, it then looks in `auto-mode-alist', and attempts to derive something 69there, it then looks in `auto-mode-alist', and attempts to derive something
64from that. 70from that.
@@ -78,7 +84,7 @@ Optional argument MODE specifies the `major-mode' to test."
78 (error "Customize `semantic-symref-filepattern-alist' for %S" 84 (error "Customize `semantic-symref-filepattern-alist' for %S"
79 major-mode) 85 major-mode)
80 (let ((args `("-name" ,(car pat)))) 86 (let ((args `("-name" ,(car pat))))
81 (if (null (cdr args)) 87 (if (null (cdr pat))
82 args 88 args
83 `("(" ,@args 89 `("(" ,@args
84 ,@(mapcan (lambda (s) `("-o" "-name" ,s)) pat) 90 ,@(mapcan (lambda (s) `("-o" "-name" ,s)) pat)
@@ -149,7 +155,7 @@ This shell should support pipe redirect syntax."
149 (oref tool searchfor)) 155 (oref tool searchfor))
150 (t 156 (t
151 ;; Can't use the word boundaries: Grep 157 ;; Can't use the word boundaries: Grep
152 ;; doesn't always agrees with the language 158 ;; doesn't always agree with the language
153 ;; syntax on those. 159 ;; syntax on those.
154 (format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)" 160 (format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)"
155 (oref tool searchfor))))) 161 (oref tool searchfor)))))
diff --git a/lisp/dired.el b/lisp/dired.el
index 46918180f12..0abb521cc5b 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3146,7 +3146,7 @@ non-empty directories is allowed."
3146 #'dired-delete-entry fn)) 3146 #'dired-delete-entry fn))
3147 (quit (throw '--delete-cancel (message "OK, canceled"))) 3147 (quit (throw '--delete-cancel (message "OK, canceled")))
3148 (error ;; catch errors from failed deletions 3148 (error ;; catch errors from failed deletions
3149 (dired-log "%s\n" err) 3149 (dired-log "%s: %s\n" (car err) (error-message-string err))
3150 (setq failures (cons (car (car l)) failures))))) 3150 (setq failures (cons (car (car l)) failures)))))
3151 (setq l (cdr l))) 3151 (setq l (cdr l)))
3152 (if (not failures) 3152 (if (not failures)
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."
718 "Loop over values from an iterator. 718 "Loop over values from an iterator.
719Evaluate BODY with VAR bound to each value from ITERATOR. 719Evaluate BODY with VAR bound to each value from ITERATOR.
720Return the value with which ITERATOR finished iteration." 720Return the value with which ITERATOR finished iteration."
721 (declare (indent 1)) 721 (declare (indent 1)
722 (debug ((symbolp form) body)))
722 (let ((done-symbol (cps--gensym "iter-do-iterator-done")) 723 (let ((done-symbol (cps--gensym "iter-do-iterator-done"))
723 (condition-symbol (cps--gensym "iter-do-condition")) 724 (condition-symbol (cps--gensym "iter-do-condition"))
724 (it-symbol (cps--gensym "iter-do-iterator")) 725 (it-symbol (cps--gensym "iter-do-iterator"))
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."
603 (let ((lnum-width (tabulated-list-line-number-width))) 603 (let ((lnum-width (tabulated-list-line-number-width)))
604 (when (not (= tabulated-list--current-lnum-width lnum-width)) 604 (when (not (= tabulated-list--current-lnum-width lnum-width))
605 (setq-local tabulated-list--current-lnum-width lnum-width) 605 (setq-local tabulated-list--current-lnum-width lnum-width)
606 (tabulated-list-revert))))) 606 (tabulated-list-init-header)))))
607
608(defun tabulated-list-window-scroll-function (window _start)
609 (if display-line-numbers
610 (let ((lnum-width
611 (with-selected-window window
612 (line-number-display-width 'columns))))
613 (when (not (= tabulated-list--current-lnum-width lnum-width))
614 (setq-local tabulated-list--current-lnum-width lnum-width)
615 (tabulated-list-init-header)))))
607 616
608;;; The mode definition: 617;;; The mode definition:
609 618
@@ -654,7 +663,9 @@ as the ewoc pretty-printer."
654 ;; the line-number width needs to change due to scrolling. 663 ;; the line-number width needs to change due to scrolling.
655 (setq-local tabulated-list--current-lnum-width 0) 664 (setq-local tabulated-list--current-lnum-width 0)
656 (add-hook 'pre-redisplay-functions 665 (add-hook 'pre-redisplay-functions
657 #'tabulated-list-watch-line-number-width nil t)) 666 #'tabulated-list-watch-line-number-width nil t)
667 (add-hook 'window-scroll-functions
668 #'tabulated-list-window-scroll-function nil t))
658 669
659(put 'tabulated-list-mode 'mode-class 'special) 670(put 'tabulated-list-mode 'mode-class 'special)
660 671
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
87grapheme cluster, and not displayed. 87grapheme cluster, and not displayed.
88 88
89If the value is `as-space', the glyph is displayed by a 89If the value is `as-space', the glyph is displayed by a
90thin (i.e. 1-dot width) space. 90thin (i.e. 1-dot width) space."
91
92Customizing the value takes effect when you start Emacs next time."
93 :group 'mule 91 :group 'mule
94 :version "26.1" 92 :version "26.1"
95 :type '(choice 93 :type '(choice
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index c3f77afae60..77fddc3436d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -392,7 +392,7 @@ obeys predicates."
392 (and (funcall pred1 x) (funcall pred2 x))))) 392 (and (funcall pred1 x) (funcall pred2 x)))))
393 ;; If completion failed and we're not applying pred1 strictly, try 393 ;; If completion failed and we're not applying pred1 strictly, try
394 ;; again without pred1. 394 ;; again without pred1.
395 (and (not strict) pred1 pred2 395 (and (not strict) pred1
396 (complete-with-action action table string pred2)))))) 396 (complete-with-action action table string pred2))))))
397 397
398(defun completion-table-in-turn (&rest tables) 398(defun completion-table-in-turn (&rest tables)
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."
1292 (when (and user domain) 1292 (when (and user domain)
1293 (setq user (concat domain ";" user))) 1293 (setq user (concat domain ";" user)))
1294 (url-parse-make-urlobj 1294 (url-parse-make-urlobj
1295 method (and user (url-hexify-string user)) nil host 1295 method (and user (url-hexify-string user))
1296 nil (and host (url-hexify-string host))
1296 (if (stringp port) (string-to-number port) port) 1297 (if (stringp port) (string-to-number port) port)
1297 (and localname (url-hexify-string localname)) nil nil t)) 1298 (and localname (url-hexify-string localname)) nil nil t))
1298 (url-parse-make-urlobj 1299 (url-parse-make-urlobj
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index a23da848112..15868bd2e8f 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -818,7 +818,7 @@ Used in `tramp-make-tramp-file-name'.")
818 "Regexp matching delimiter between user and host names. 818 "Regexp matching delimiter between user and host names.
819Derived from `tramp-postfix-user-format'.") 819Derived from `tramp-postfix-user-format'.")
820 820
821(defconst tramp-host-regexp "[a-zA-Z0-9_.-]+" 821(defconst tramp-host-regexp "[a-zA-Z0-9_.%-]+"
822 "Regexp matching host names.") 822 "Regexp matching host names.")
823 823
824(defconst tramp-prefix-ipv6-format-alist 824(defconst tramp-prefix-ipv6-format-alist
@@ -2305,8 +2305,10 @@ Falls back to normal file name handler if no Tramp file name handler exists."
2305;;;###autoload 2305;;;###autoload
2306(progn (defun tramp-autoload-file-name-handler (operation &rest args) 2306(progn (defun tramp-autoload-file-name-handler (operation &rest args)
2307 "Load Tramp file name handler, and perform OPERATION." 2307 "Load Tramp file name handler, and perform OPERATION."
2308 (let ((default-directory temporary-file-directory)) 2308 (if tramp-mode
2309 (load "tramp" 'noerror 'nomessage)) 2309 (let ((default-directory temporary-file-directory))
2310 (load "tramp" 'noerror 'nomessage))
2311 (tramp-unload-file-name-handlers))
2310 (apply operation args))) 2312 (apply operation args)))
2311 2313
2312;; `tramp-autoload-file-name-handler' must be registered before 2314;; `tramp-autoload-file-name-handler' must be registered before
@@ -2422,12 +2424,13 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'."
2422 (equal (apply operation args) operation)))) 2424 (equal (apply operation args) operation))))
2423 2425
2424;;;###autoload 2426;;;###autoload
2425(defun tramp-unload-file-name-handlers () 2427(progn (defun tramp-unload-file-name-handlers ()
2426 "Unload Tramp file name handlers from `file-name-handler-alist'." 2428 "Unload Tramp file name handlers from `file-name-handler-alist'."
2427 (dolist (fnh '(tramp-file-name-handler 2429 (dolist (fnh '(tramp-file-name-handler
2428 tramp-completion-file-name-handler)) 2430 tramp-completion-file-name-handler
2431 tramp-autoload-file-name-handler))
2429 (let ((a1 (rassq fnh file-name-handler-alist))) 2432 (let ((a1 (rassq fnh file-name-handler-alist)))
2430 (setq file-name-handler-alist (delq a1 file-name-handler-alist))))) 2433 (setq file-name-handler-alist (delq a1 file-name-handler-alist))))))
2431 2434
2432(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers) 2435(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
2433 2436
@@ -4631,9 +4634,6 @@ Only works for Bourne-like shells."
4631(provide 'tramp) 4634(provide 'tramp)
4632 4635
4633;;; TODO: 4636;;; TODO:
4634
4635;; * In Emacs 21, `insert-directory' shows total number of bytes used
4636;; by the files in that directory. Add this here.
4637;; 4637;;
4638;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) 4638;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
4639;; 4639;;
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 2e644c3a99c..56ae14dee41 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -69,6 +69,9 @@
69 69
70;;; Code: 70;;; Code:
71 71
72(eval-when-compile
73 (require 'subr-x))
74
72;;;###autoload 75;;;###autoload
73(defalias 'indent-for-comment 'comment-indent) 76(defalias 'indent-for-comment 'comment-indent)
74;;;###autoload 77;;;###autoload
@@ -1141,6 +1144,9 @@ the region rather than at left margin."
1141 1144
1142 ;; make the leading and trailing lines if requested 1145 ;; make the leading and trailing lines if requested
1143 (when lines 1146 (when lines
1147 ;; Trim trailing whitespace from cs if there's some.
1148 (setq cs (string-trim-right cs))
1149
1144 (let ((csce 1150 (let ((csce
1145 (comment-make-extra-lines 1151 (comment-make-extra-lines
1146 cs ce ccs cce min-indent max-indent block))) 1152 cs ce ccs cce min-indent max-indent block)))
@@ -1211,7 +1217,7 @@ changed with `comment-style'."
1211 (progn (goto-char end) (end-of-line) (skip-syntax-backward " ") 1217 (progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
1212 (<= (point) end)) 1218 (<= (point) end))
1213 (or block (not (string= "" comment-end))) 1219 (or block (not (string= "" comment-end)))
1214 (or block (progn (goto-char beg) (search-forward "\n" end t))))) 1220 (or block (progn (goto-char beg) (re-search-forward "$" end t)))))
1215 1221
1216 ;; don't add end-markers just because the user asked for `block' 1222 ;; don't add end-markers just because the user asked for `block'
1217 (unless (or lines (string= "" comment-end)) (setq block nil)) 1223 (unless (or lines (string= "" comment-end)) (setq block nil))
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'."
772 (setq c (cdr c))) 772 (setq c (cdr c)))
773 (setq pcomplete-stub (substring common-stub 0 len) 773 (setq pcomplete-stub (substring common-stub 0 len)
774 pcomplete-autolist t) 774 pcomplete-autolist t)
775 (when (and begin (not pcomplete-show-list)) 775 (when (and begin (> len 0) (not pcomplete-show-list))
776 (delete-region begin (point)) 776 (delete-region begin (point))
777 (pcomplete-insert-entry "" pcomplete-stub)) 777 (pcomplete-insert-entry "" pcomplete-stub))
778 (throw 'pcomplete-completions completions)) 778 (throw 'pcomplete-completions completions))
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'."
1821 "Return the name of the current defun, or NIL if there isn't one. 1821 "Return the name of the current defun, or NIL if there isn't one.
1822\"Defun\" here means a function, or other top level construct 1822\"Defun\" here means a function, or other top level construct
1823with a brace block." 1823with a brace block."
1824 (interactive)
1825 (c-save-buffer-state 1824 (c-save-buffer-state
1826 (beginning-of-defun-function end-of-defun-function 1825 (beginning-of-defun-function end-of-defun-function
1827 where pos name-end case-fold-search) 1826 where pos name-end case-fold-search)
@@ -2048,6 +2047,23 @@ with a brace block."
2048 (eq (char-after) ?\{) 2047 (eq (char-after) ?\{)
2049 (cons (point-min) (point-max)))))))) 2048 (cons (point-min) (point-max))))))))
2050 2049
2050(defun c-display-defun-name (&optional arg)
2051 "Display the name of the current CC mode defun and the position in it.
2052With a prefix arg, push the name onto the kill ring too."
2053 (interactive "P")
2054 (save-restriction
2055 (widen)
2056 (c-save-buffer-state ((name (c-defun-name))
2057 (limits (c-declaration-limits t))
2058 (point-bol (c-point 'bol)))
2059 (when name
2060 (message "%s. Line %s/%s." name
2061 (1+ (count-lines (car limits) point-bol))
2062 (count-lines (car limits) (cdr limits)))
2063 (if arg (kill-new name))
2064 (sit-for 3 t)))))
2065(put 'c-display-defun-name 'isearch-scroll t)
2066
2051(defun c-mark-function () 2067(defun c-mark-function ()
2052 "Put mark at end of the current top-level declaration or macro, point at beginning. 2068 "Put mark at end of the current top-level declaration or macro, point at beginning.
2053If point is not inside any then the closest following one is 2069If 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."
2092 2108
2093(defun c-cpp-define-name () 2109(defun c-cpp-define-name ()
2094 "Return the name of the current CPP macro, or NIL if we're not in one." 2110 "Return the name of the current CPP macro, or NIL if we're not in one."
2095 (interactive)
2096 (let (case-fold-search) 2111 (let (case-fold-search)
2097 (save-excursion 2112 (save-excursion
2098 (and c-opt-cpp-macro-define-start 2113 (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."
389 ;;(define-key c-mode-base-map "\C-c\C-v" 'c-version) 389 ;;(define-key c-mode-base-map "\C-c\C-v" 'c-version)
390 ;; (define-key c-mode-base-map "\C-c\C-y" 'c-toggle-hungry-state) Commented out by ACM, 2005-11-22. 390 ;; (define-key c-mode-base-map "\C-c\C-y" 'c-toggle-hungry-state) Commented out by ACM, 2005-11-22.
391 (define-key c-mode-base-map "\C-c\C-w" 'c-subword-mode) 391 (define-key c-mode-base-map "\C-c\C-w" 'c-subword-mode)
392 (define-key c-mode-base-map "\C-c\C-k" 'c-toggle-comment-style)) 392 (define-key c-mode-base-map "\C-c\C-k" 'c-toggle-comment-style)
393 (define-key c-mode-base-map "\C-c\C-z" 'c-display-defun-name))
393 394
394;; We don't require the outline package, but we configure it a bit anyway. 395;; We don't require the outline package, but we configure it a bit anyway.
395(cc-bytecomp-defvar outline-level) 396(cc-bytecomp-defvar outline-level)
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 1681922fa5a..e6ab8c4ea60 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',
1896 (if cperl-pod-here-scan 1896 (if cperl-pod-here-scan
1897 (or cperl-syntaxify-by-font-lock 1897 (or cperl-syntaxify-by-font-lock
1898 (progn (or cperl-faces-init (cperl-init-faces-weak)) 1898 (progn (or cperl-faces-init (cperl-init-faces-weak))
1899 (cperl-find-pods-heres))))) 1899 (cperl-find-pods-heres))))
1900 ;; Setup Flymake
1901 (add-hook 'flymake-diagnostic-functions 'perl-flymake nil t))
1900 1902
1901;; Fix for perldb - make default reasonable 1903;; Fix for perldb - make default reasonable
1902(defun cperl-db () 1904(defun cperl-db ()
diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el
index f504a1c21a8..e28451d9417 100644
--- a/lisp/progmodes/flymake-proc.el
+++ b/lisp/progmodes/flymake-proc.el
@@ -82,7 +82,7 @@ Overrides `flymake-proc-allowed-file-name-masks'."
82 ("\\.xml\\'" flymake-proc-xml-init) 82 ("\\.xml\\'" flymake-proc-xml-init)
83 ("\\.html?\\'" flymake-proc-xml-init) 83 ("\\.html?\\'" flymake-proc-xml-init)
84 ("\\.cs\\'" flymake-proc-simple-make-init) 84 ("\\.cs\\'" flymake-proc-simple-make-init)
85 ("\\.p[ml]\\'" flymake-proc-perl-init) 85 ;; ("\\.p[ml]\\'" flymake-proc-perl-init)
86 ("\\.php[345]?\\'" flymake-proc-php-init) 86 ("\\.php[345]?\\'" flymake-proc-php-init)
87 ("\\.h\\'" flymake-proc-master-make-header-init flymake-proc-master-cleanup) 87 ("\\.h\\'" flymake-proc-master-make-header-init flymake-proc-master-cleanup)
88 ("\\.java\\'" flymake-proc-simple-make-java-init flymake-proc-simple-java-cleanup) 88 ("\\.java\\'" flymake-proc-simple-make-java-init flymake-proc-simple-java-cleanup)
diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 19dac81fe6d..0d200f01b34 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -342,7 +342,7 @@ region is invalid."
342 (let* ((beg (fallback-bol)) 342 (let* ((beg (fallback-bol))
343 (end (fallback-eol beg))) 343 (end (fallback-eol beg)))
344 (cons beg end))))))) 344 (cons beg end)))))))
345 (error (flymake-error "Invalid region line=%s col=%s" line col)))) 345 (error (flymake-log :warning "Invalid region line=%s col=%s" line col))))
346 346
347(defvar flymake-diagnostic-functions nil 347(defvar flymake-diagnostic-functions nil
348 "Special hook of Flymake backends that check a buffer. 348 "Special hook of Flymake backends that check a buffer.
@@ -522,11 +522,12 @@ associated `flymake-category' return DEFAULT."
522 (flymake--fringe-overlay-spec 522 (flymake--fringe-overlay-spec
523 (overlay-get ov 'bitmap))) 523 (overlay-get ov 'bitmap)))
524 (default-maybe 'help-echo 524 (default-maybe 'help-echo
525 (lambda (_window _ov pos) 525 (lambda (window _ov pos)
526 (mapconcat 526 (with-selected-window window
527 #'flymake--diag-text 527 (mapconcat
528 (flymake-diagnostics pos) 528 #'flymake--diag-text
529 "\n"))) 529 (flymake-diagnostics pos)
530 "\n"))))
530 (default-maybe 'severity (warning-numeric-level :error)) 531 (default-maybe 'severity (warning-numeric-level :error))
531 (default-maybe 'priority (+ 100 (overlay-get ov 'severity)))) 532 (default-maybe 'priority (+ 100 (overlay-get ov 'severity))))
532 ;; Some properties can't be overridden. 533 ;; Some properties can't be overridden.
@@ -603,8 +604,8 @@ not expected."
603 (null expected-token)) 604 (null expected-token))
604 ;; should never happen 605 ;; should never happen
605 (flymake-error "Unexpected report from stopped backend %s" backend)) 606 (flymake-error "Unexpected report from stopped backend %s" backend))
606 ((and (not (eq expected-token token)) 607 ((not (or (eq expected-token token)
607 (not force)) 608 force))
608 (flymake-error "Obsolete report from backend %s with explanation %s" 609 (flymake-error "Obsolete report from backend %s with explanation %s"
609 backend explanation)) 610 backend explanation))
610 ((eq :panic report-action) 611 ((eq :panic report-action)
@@ -744,8 +745,11 @@ Interactively, with a prefix arg, FORCE is t."
744 () 745 ()
745 (remove-hook 'post-command-hook #'start-post-command 746 (remove-hook 'post-command-hook #'start-post-command
746 nil) 747 nil)
747 (with-current-buffer buffer 748 ;; The buffer may have disappeared already, e.g. because of
748 (flymake-start (remove 'post-command deferred) force))) 749 ;; code like `(with-temp-buffer (python-mode) ...)'.
750 (when (buffer-live-p buffer)
751 (with-current-buffer buffer
752 (flymake-start (remove 'post-command deferred) force))))
749 (start-on-display 753 (start-on-display
750 () 754 ()
751 (remove-hook 'window-configuration-change-hook #'start-on-display 755 (remove-hook 'window-configuration-change-hook #'start-on-display
@@ -948,7 +952,7 @@ applied."
948 (message 952 (message
949 "%s" 953 "%s"
950 (funcall (overlay-get target 'help-echo) 954 (funcall (overlay-get target 'help-echo)
951 nil nil (point))))) 955 (selected-window) target (point)))))
952 (interactive 956 (interactive
953 (user-error "No more Flymake errors%s" 957 (user-error "No more Flymake errors%s"
954 (if filter 958 (if filter
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 28d1974893d..58552759b95 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -400,14 +400,22 @@ valid signal handlers.")
400 (const :tag "Unlimited" nil)) 400 (const :tag "Unlimited" nil))
401 :version "22.1") 401 :version "22.1")
402 402
403(defcustom gdb-non-stop-setting t 403(defcustom gdb-non-stop-setting (not (eq system-type 'windows-nt))
404 "When in non-stop mode, stopped threads can be examined while 404 "If non-nil, GDB sessions are expected to support the non-stop mode.
405When in the non-stop mode, stopped threads can be examined while
405other threads continue to execute. 406other threads continue to execute.
406 407
408If this is non-nil, GDB will be sent the \"set non-stop 1\" command,
409and if that results in an error, the non-stop setting will be
410turned off automatically.
411
412On MS-Windows, this is off by default, because MS-Windows targets
413don't support the non-stop mode.
414
407GDB session needs to be restarted for this setting to take effect." 415GDB session needs to be restarted for this setting to take effect."
408 :type 'boolean 416 :type 'boolean
409 :group 'gdb-non-stop 417 :group 'gdb-non-stop
410 :version "23.2") 418 :version "26.1")
411 419
412;; TODO Some commands can't be called with --all (give a notice about 420;; TODO Some commands can't be called with --all (give a notice about
413;; it in setting doc) 421;; it in setting doc)
@@ -2188,7 +2196,10 @@ a GDB/MI reply message."
2188 2196
2189(defun gdbmi-bnf-console-stream-output (c-string) 2197(defun gdbmi-bnf-console-stream-output (c-string)
2190 "Handler for the console-stream-output GDB/MI output grammar rule." 2198 "Handler for the console-stream-output GDB/MI output grammar rule."
2191 (gdb-console c-string)) 2199 (gdb-console c-string)
2200 ;; We've written to the GUD console, so we should print the prompt
2201 ;; after the next result-class or async-class.
2202 (setq gdb-first-done-or-error t))
2192 2203
2193(defun gdbmi-bnf-target-stream-output (_c-string) 2204(defun gdbmi-bnf-target-stream-output (_c-string)
2194 "Handler for the target-stream-output GDB/MI output grammar rule." 2205 "Handler for the target-stream-output GDB/MI output grammar rule."
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
@@ -581,6 +581,73 @@ create a new comment."
581 (match-string-no-properties 1)))) 581 (match-string-no-properties 1))))
582 582
583 583
584;;; Flymake support
585(defcustom perl-flymake-command '("perl" "-w" "-c")
586 "External tool used to check Perl source code.
587This is a non empty list of strings, the checker tool possibly
588followed by required arguments. Once launched it will receive
589the Perl source to be checked as its standard input."
590 :group 'perl
591 :type '(repeat string))
592
593(defvar-local perl--flymake-proc nil)
594
595;;;###autoload
596(defun perl-flymake (report-fn &rest _args)
597 "Perl backend for Flymake. Launches
598`perl-flymake-command' (which see) and passes to its standard
599input the contents of the current buffer. The output of this
600command is analysed for error and warning messages."
601 (unless (executable-find (car perl-flymake-command))
602 (error "Cannot find a suitable checker"))
603
604 (when (process-live-p perl--flymake-proc)
605 (kill-process perl--flymake-proc))
606
607 (let ((source (current-buffer)))
608 (save-restriction
609 (widen)
610 (setq
611 perl--flymake-proc
612 (make-process
613 :name "perl-flymake" :noquery t :connection-type 'pipe
614 :buffer (generate-new-buffer " *perl-flymake*")
615 :command perl-flymake-command
616 :sentinel
617 (lambda (proc _event)
618 (when (eq 'exit (process-status proc))
619 (unwind-protect
620 (if (with-current-buffer source (eq proc perl--flymake-proc))
621 (with-current-buffer (process-buffer proc)
622 (goto-char (point-min))
623 (cl-loop
624 while (search-forward-regexp
625 "^\\(.+\\) at - line \\([0-9]+\\)"
626 nil t)
627 for msg = (match-string 1)
628 for (beg . end) = (flymake-diag-region
629 source
630 (string-to-number (match-string 2)))
631 for type =
632 (if (string-match
633 "\\(Scalar value\\|Useless use\\|Unquoted string\\)"
634 msg)
635 :warning
636 :error)
637 collect (flymake-make-diagnostic source
638 beg
639 end
640 type
641 msg)
642 into diags
643 finally (funcall report-fn diags)))
644 (flymake-log :debug "Canceling obsolete check %s"
645 proc))
646 (kill-buffer (process-buffer proc)))))))
647 (process-send-region perl--flymake-proc (point-min) (point-max))
648 (process-send-eof perl--flymake-proc))))
649
650
584(defvar perl-mode-hook nil 651(defvar perl-mode-hook nil
585 "Normal hook to run when entering Perl mode.") 652 "Normal hook to run when entering Perl mode.")
586 653
@@ -665,7 +732,9 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
665 ;; Setup outline-minor-mode. 732 ;; Setup outline-minor-mode.
666 (setq-local outline-regexp perl-outline-regexp) 733 (setq-local outline-regexp perl-outline-regexp)
667 (setq-local outline-level 'perl-outline-level) 734 (setq-local outline-level 'perl-outline-level)
668 (setq-local add-log-current-defun-function #'perl-current-defun-name)) 735 (setq-local add-log-current-defun-function #'perl-current-defun-name)
736 ;; Setup Flymake
737 (add-hook 'flymake-diagnostic-functions #'perl-flymake nil t))
669 738
670;; This is used by indent-for-comment 739;; This is used by indent-for-comment
671;; to decide how much to indent a comment in Perl code 740;; to decide how much to indent a comment in Perl code
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 895117b9ee3..d4226e5ce7b 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2113,20 +2113,25 @@ remote host, the returned value is intended for
2113(defun python-shell-calculate-exec-path () 2113(defun python-shell-calculate-exec-path ()
2114 "Calculate `exec-path'. 2114 "Calculate `exec-path'.
2115Prepends `python-shell-exec-path' and adds the binary directory 2115Prepends `python-shell-exec-path' and adds the binary directory
2116for virtualenv if `python-shell-virtualenv-root' is set. If 2116for virtualenv if `python-shell-virtualenv-root' is set - this
2117`default-directory' points to a remote host, the returned value 2117will use the python interpreter from inside the virtualenv when
2118appends `python-shell-remote-exec-path' instead of `exec-path'." 2118starting the shell. If `default-directory' points to a remote host,
2119the returned value appends `python-shell-remote-exec-path' instead
2120of `exec-path'."
2119 (let ((new-path (copy-sequence 2121 (let ((new-path (copy-sequence
2120 (if (file-remote-p default-directory) 2122 (if (file-remote-p default-directory)
2121 python-shell-remote-exec-path 2123 python-shell-remote-exec-path
2122 exec-path)))) 2124 exec-path)))
2125
2126 ;; Windows and POSIX systems use different venv directory structures
2127 (virtualenv-bin-dir (if (eq system-type 'windows-nt) "Scripts" "bin")))
2123 (python-shell--add-to-path-with-priority 2128 (python-shell--add-to-path-with-priority
2124 new-path python-shell-exec-path) 2129 new-path python-shell-exec-path)
2125 (if (not python-shell-virtualenv-root) 2130 (if (not python-shell-virtualenv-root)
2126 new-path 2131 new-path
2127 (python-shell--add-to-path-with-priority 2132 (python-shell--add-to-path-with-priority
2128 new-path 2133 new-path
2129 (list (expand-file-name "bin" python-shell-virtualenv-root))) 2134 (list (expand-file-name virtualenv-bin-dir python-shell-virtualenv-root)))
2130 new-path))) 2135 new-path)))
2131 2136
2132(defun python-shell-tramp-refresh-remote-path (vec paths) 2137(defun python-shell-tramp-refresh-remote-path (vec paths)
@@ -5142,6 +5147,138 @@ returned as is."
5142 (ignore-errors (string-match regexp "") t)) 5147 (ignore-errors (string-match regexp "") t))
5143 5148
5144 5149
5150;;; Flymake integration
5151
5152(defgroup python-flymake nil
5153 "Integration between Python and Flymake."
5154 :group 'python
5155 :link '(custom-group-link :tag "Flymake" flymake)
5156 :version "26.1")
5157
5158(defcustom python-flymake-command '("pyflakes")
5159 "The external tool that will be used to perform the syntax check.
5160This is a non empty list of strings, the checker tool possibly followed by
5161required arguments. Once launched it will receive the Python source to be
5162checked as its standard input.
5163To use `flake8' you would set this to (\"flake8\" \"-\")."
5164 :group 'python-flymake
5165 :type '(repeat string))
5166
5167;; The default regexp accomodates for older pyflakes, which did not
5168;; report the column number, and at the same time it's compatible with
5169;; flake8 output, although it may be redefined to explicitly match the
5170;; TYPE
5171(defcustom python-flymake-command-output-pattern
5172 (list
5173 "^\\(?:<?stdin>?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$"
5174 1 2 nil 3)
5175 "Specify how to parse the output of `python-flymake-command'.
5176The value has the form (REGEXP LINE COLUMN TYPE MESSAGE): if
5177REGEXP matches, the LINE'th subexpression gives the line number,
5178the COLUMN'th subexpression gives the column number on that line,
5179the TYPE'th subexpression gives the type of the message and the
5180MESSAGE'th gives the message text itself.
5181
5182If COLUMN or TYPE are nil or that index didn't match, that
5183information is not present on the matched line and a default will
5184be used."
5185 :group 'python-flymake
5186 :type '(list regexp
5187 (integer :tag "Line's index")
5188 (choice
5189 (const :tag "No column" nil)
5190 (integer :tag "Column's index"))
5191 (choice
5192 (const :tag "No type" nil)
5193 (integer :tag "Type's index"))
5194 (integer :tag "Message's index")))
5195
5196(defcustom python-flymake-msg-alist
5197 '(("\\(^redefinition\\|.*unused.*\\|used$\\)" . :warning))
5198 "Alist used to associate messages to their types.
5199Each element should be a cons-cell (REGEXP . TYPE), where TYPE must be
5200one defined in the variable `flymake-diagnostic-types-alist'.
5201For example, when using `flake8' a possible configuration could be:
5202
5203 ((\"\\(^redefinition\\|.*unused.*\\|used$\\)\" . :warning)
5204 (\"^E999\" . :error)
5205 (\"^[EW][0-9]+\" . :note))
5206
5207By default messages are considered errors."
5208 :group 'python-flymake
5209 :type `(alist :key-type (regexp)
5210 :value-type (symbol)))
5211
5212(defvar-local python--flymake-proc nil)
5213
5214(defun python--flymake-parse-output (source proc report-fn)
5215 "Collect diagnostics parsing checker tool's output line by line."
5216 (let ((rx (nth 0 python-flymake-command-output-pattern))
5217 (lineidx (nth 1 python-flymake-command-output-pattern))
5218 (colidx (nth 2 python-flymake-command-output-pattern))
5219 (typeidx (nth 3 python-flymake-command-output-pattern))
5220 (msgidx (nth 4 python-flymake-command-output-pattern)))
5221 (with-current-buffer (process-buffer proc)
5222 (goto-char (point-min))
5223 (cl-loop
5224 while (search-forward-regexp rx nil t)
5225 for msg = (match-string msgidx)
5226 for (beg . end) = (flymake-diag-region
5227 source
5228 (string-to-number
5229 (match-string lineidx))
5230 (and colidx
5231 (match-string colidx)
5232 (string-to-number
5233 (match-string colidx))))
5234 for type = (or (and typeidx
5235 (match-string typeidx)
5236 (assoc-default
5237 (match-string typeidx)
5238 python-flymake-msg-alist
5239 #'string-match))
5240 (assoc-default msg
5241 python-flymake-msg-alist
5242 #'string-match)
5243 :error)
5244 collect (flymake-make-diagnostic
5245 source beg end type msg)
5246 into diags
5247 finally (funcall report-fn diags)))))
5248
5249(defun python-flymake (report-fn &rest _args)
5250 "Flymake backend for Python.
5251This backend uses `python-flymake-command' (which see) to launch a process
5252that is passed the current buffer's content via stdin.
5253REPORT-FN is Flymake's callback function."
5254 (unless (executable-find (car python-flymake-command))
5255 (error "Cannot find a suitable checker"))
5256
5257 (when (process-live-p python--flymake-proc)
5258 (kill-process python--flymake-proc))
5259
5260 (let ((source (current-buffer)))
5261 (save-restriction
5262 (widen)
5263 (setq python--flymake-proc
5264 (make-process
5265 :name "python-flymake"
5266 :noquery t
5267 :connection-type 'pipe
5268 :buffer (generate-new-buffer " *python-flymake*")
5269 :command python-flymake-command
5270 :sentinel
5271 (lambda (proc _event)
5272 (when (eq 'exit (process-status proc))
5273 (unwind-protect
5274 (when (with-current-buffer source
5275 (eq proc python--flymake-proc))
5276 (python--flymake-parse-output source proc report-fn))
5277 (kill-buffer (process-buffer proc)))))))
5278 (process-send-region python--flymake-proc (point-min) (point-max))
5279 (process-send-eof python--flymake-proc))))
5280
5281
5145(defun python-electric-pair-string-delimiter () 5282(defun python-electric-pair-string-delimiter ()
5146 (when (and electric-pair-mode 5283 (when (and electric-pair-mode
5147 (memq last-command-event '(?\" ?\')) 5284 (memq last-command-event '(?\" ?\'))
@@ -5255,7 +5392,9 @@ returned as is."
5255 (make-local-variable 'python-shell-internal-buffer) 5392 (make-local-variable 'python-shell-internal-buffer)
5256 5393
5257 (when python-indent-guess-indent-offset 5394 (when python-indent-guess-indent-offset
5258 (python-indent-guess-indent-offset))) 5395 (python-indent-guess-indent-offset))
5396
5397 (add-hook 'flymake-diagnostic-functions #'python-flymake nil t))
5259 5398
5260 5399
5261(provide 'python) 5400(provide 'python)
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'.")
2253 (progn (set-match-data value) t)) 2253 (progn (set-match-data value) t))
2254 (ruby-match-expression-expansion limit))))) 2254 (ruby-match-expression-expansion limit)))))
2255 2255
2256;;; Flymake support
2257(defcustom ruby-flymake-command '("ruby" "-w" "-c")
2258 "External tool used to check Ruby source code.
2259This is a non empty list of strings, the checker tool possibly
2260followed by required arguments. Once launched it will receive
2261the Ruby source to be checked as its standard input."
2262 :group 'ruby
2263 :type '(repeat string))
2264
2265(defvar-local ruby--flymake-proc nil)
2266
2267(defun ruby-flymake (report-fn &rest _args)
2268 "Ruby backend for Flymake. Launches
2269`ruby-flymake-command' (which see) and passes to its standard
2270input the contents of the current buffer. The output of this
2271command is analysed for error and warning messages."
2272 (unless (executable-find (car ruby-flymake-command))
2273 (error "Cannot find a suitable checker"))
2274
2275 (when (process-live-p ruby--flymake-proc)
2276 (kill-process ruby--flymake-proc))
2277
2278 (let ((source (current-buffer)))
2279 (save-restriction
2280 (widen)
2281 (setq
2282 ruby--flymake-proc
2283 (make-process
2284 :name "ruby-flymake" :noquery t :connection-type 'pipe
2285 :buffer (generate-new-buffer " *ruby-flymake*")
2286 :command ruby-flymake-command
2287 :sentinel
2288 (lambda (proc _event)
2289 (when (eq 'exit (process-status proc))
2290 (unwind-protect
2291 (if (with-current-buffer source (eq proc ruby--flymake-proc))
2292 (with-current-buffer (process-buffer proc)
2293 (goto-char (point-min))
2294 (cl-loop
2295 while (search-forward-regexp
2296 "^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
2297 nil t)
2298 for msg = (match-string 2)
2299 for (beg . end) = (flymake-diag-region
2300 source
2301 (string-to-number (match-string 1)))
2302 for type = (if (string-match "^warning" msg)
2303 :warning
2304 :error)
2305 collect (flymake-make-diagnostic source
2306 beg
2307 end
2308 type
2309 msg)
2310 into diags
2311 finally (funcall report-fn diags)))
2312 (flymake-log :debug "Canceling obsolete check %s"
2313 proc))
2314 (kill-buffer (process-buffer proc)))))))
2315 (process-send-region ruby--flymake-proc (point-min) (point-max))
2316 (process-send-eof ruby--flymake-proc))))
2317
2256;;;###autoload 2318;;;###autoload
2257(define-derived-mode ruby-mode prog-mode "Ruby" 2319(define-derived-mode ruby-mode prog-mode "Ruby"
2258 "Major mode for editing Ruby code." 2320 "Major mode for editing Ruby code."
@@ -2265,6 +2327,7 @@ See `font-lock-syntax-table'.")
2265 2327
2266 (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local) 2328 (add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local)
2267 (add-hook 'electric-indent-functions 'ruby--electric-indent-p nil 'local) 2329 (add-hook 'electric-indent-functions 'ruby--electric-indent-p nil 'local)
2330 (add-hook 'flymake-diagnostic-functions 'ruby-flymake nil 'local)
2268 2331
2269 (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil)) 2332 (setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil))
2270 (setq-local font-lock-keywords ruby-font-lock-keywords) 2333 (setq-local font-lock-keywords ruby-font-lock-keywords)
diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 3dbf65ef6f5..db025d40aa3 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -448,43 +448,74 @@ If SELECT is non-nil, select the target window."
448 (when xref-w 448 (when xref-w
449 (set-window-dedicated-p xref-w xref-w-dedicated))))) 449 (set-window-dedicated-p xref-w xref-w-dedicated)))))
450 450
451(defun xref--show-pos-in-buf (pos buf select) 451(defvar-local xref--original-window-intent nil
452 (let ((xref-buf (current-buffer)) 452 "Original window-switching intent before xref buffer creation.")
453 win) 453
454(defvar-local xref--original-window nil
455 "The original window this xref buffer was created from.")
456
457(defun xref--show-pos-in-buf (pos buf)
458 "Goto and display position POS of buffer BUF in a window.
459Honor `xref--original-window-intent', run `xref-after-jump-hook'
460and finally return the window."
461 (let* ((xref-buf (current-buffer))
462 (pop-up-frames
463 (or (eq xref--original-window-intent 'frame)
464 pop-up-frames))
465 (action
466 (cond ((memq
467 xref--original-window-intent
468 '(window frame))
469 t)
470 ((and
471 (window-live-p xref--original-window)
472 (or (not (window-dedicated-p xref--original-window))
473 (eq (window-buffer xref--original-window) buf)))
474 `(,(lambda (buf _alist)
475 (set-window-buffer xref--original-window buf)
476 xref--original-window))))))
454 (with-selected-window 477 (with-selected-window
455 (xref--with-dedicated-window 478 (with-selected-window
456 (display-buffer buf)) 479 ;; Just before `display-buffer', place ourselves in the
480 ;; original window to suggest preserving it. Of course, if
481 ;; user has deleted the original window, all bets are off,
482 ;; just use the selected one.
483 (or (and (window-live-p xref--original-window)
484 xref--original-window)
485 (selected-window))
486 (display-buffer buf action))
457 (xref--goto-char pos) 487 (xref--goto-char pos)
458 (run-hooks 'xref-after-jump-hook) 488 (run-hooks 'xref-after-jump-hook)
459 (let ((buf (current-buffer))) 489 (let ((buf (current-buffer)))
460 (setq win (selected-window))
461 (with-current-buffer xref-buf 490 (with-current-buffer xref-buf
462 (setq-local other-window-scroll-buffer buf)))) 491 (setq-local other-window-scroll-buffer buf)))
463 (when select 492 (selected-window))))
464 (select-window win))))
465 493
466(defun xref--show-location (location &optional select) 494(defun xref--show-location (location &optional select)
495 "Help `xref-show-xref' and `xref-goto-xref' do their job.
496Go to LOCATION and if SELECT is non-nil select its window. If
497SELECT is `quit', also quit the *xref* window."
467 (condition-case err 498 (condition-case err
468 (let* ((marker (xref-location-marker location)) 499 (let* ((marker (xref-location-marker location))
469 (buf (marker-buffer marker))) 500 (buf (marker-buffer marker))
470 (xref--show-pos-in-buf marker buf select)) 501 (xref-buffer (current-buffer)))
502 (cond (select
503 (if (eq select 'quit) (quit-window nil nil))
504 (with-current-buffer xref-buffer
505 (select-window (xref--show-pos-in-buf marker buf))))
506 (t
507 (save-selected-window
508 (xref--with-dedicated-window
509 (xref--show-pos-in-buf marker buf))))))
471 (user-error (message (error-message-string err))))) 510 (user-error (message (error-message-string err)))))
472 511
473(defvar-local xref--window nil
474 "The original window this xref buffer was created from.")
475
476(defun xref-show-location-at-point () 512(defun xref-show-location-at-point ()
477 "Display the source of xref at point in the appropriate window, if any." 513 "Display the source of xref at point in the appropriate window, if any."
478 (interactive) 514 (interactive)
479 (let* ((xref (xref--item-at-point)) 515 (let* ((xref (xref--item-at-point))
480 (xref--current-item xref)) 516 (xref--current-item xref))
481 (when xref 517 (when xref
482 ;; Try to avoid the window the current xref buffer was 518 (xref--show-location (xref-item-location xref)))))
483 ;; originally created from.
484 (if (window-live-p xref--window)
485 (with-selected-window xref--window
486 (xref--show-location (xref-item-location xref)))
487 (xref--show-location (xref-item-location xref))))))
488 519
489(defun xref-next-line () 520(defun xref-next-line ()
490 "Move to the next xref and display its source in the appropriate window." 521 "Move to the next xref and display its source in the appropriate window."
@@ -503,12 +534,19 @@ If SELECT is non-nil, select the target window."
503 (back-to-indentation) 534 (back-to-indentation)
504 (get-text-property (point) 'xref-item))) 535 (get-text-property (point) 'xref-item)))
505 536
506(defun xref-goto-xref () 537(defun xref-goto-xref (&optional quit)
507 "Jump to the xref on the current line and select its window." 538 "Jump to the xref on the current line and select its window.
539Non-interactively, non-nil QUIT means to first quit the *xref*
540buffer."
508 (interactive) 541 (interactive)
509 (let ((xref (or (xref--item-at-point) 542 (let ((xref (or (xref--item-at-point)
510 (user-error "No reference at point")))) 543 (user-error "No reference at point"))))
511 (xref--show-location (xref-item-location xref) t))) 544 (xref--show-location (xref-item-location xref) (if quit 'quit t))))
545
546(defun xref-quit-and-goto-xref ()
547 "Quit *xref* buffer, then jump to xref on current line."
548 (interactive)
549 (xref-goto-xref t))
512 550
513(defun xref-query-replace-in-results (from to) 551(defun xref-query-replace-in-results (from to)
514 "Perform interactive replacement of FROM with TO in all displayed xrefs. 552 "Perform interactive replacement of FROM with TO in all displayed xrefs.
@@ -632,6 +670,7 @@ references displayed in the current *xref* buffer."
632 (define-key map (kbd "p") #'xref-prev-line) 670 (define-key map (kbd "p") #'xref-prev-line)
633 (define-key map (kbd "r") #'xref-query-replace-in-results) 671 (define-key map (kbd "r") #'xref-query-replace-in-results)
634 (define-key map (kbd "RET") #'xref-goto-xref) 672 (define-key map (kbd "RET") #'xref-goto-xref)
673 (define-key map (kbd "TAB") #'xref-quit-and-goto-xref)
635 (define-key map (kbd "C-o") #'xref-show-location-at-point) 674 (define-key map (kbd "C-o") #'xref-show-location-at-point)
636 ;; suggested by Johan Claesson "to further reduce finger movement": 675 ;; suggested by Johan Claesson "to further reduce finger movement":
637 (define-key map (kbd ".") #'xref-next-line) 676 (define-key map (kbd ".") #'xref-next-line)
@@ -726,7 +765,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
726 (xref--xref-buffer-mode) 765 (xref--xref-buffer-mode)
727 (pop-to-buffer (current-buffer)) 766 (pop-to-buffer (current-buffer))
728 (goto-char (point-min)) 767 (goto-char (point-min))
729 (setq xref--window (assoc-default 'window alist)) 768 (setq xref--original-window (assoc-default 'window alist)
769 xref--original-window-intent (assoc-default 'display-action alist))
730 (current-buffer))))) 770 (current-buffer)))))
731 771
732 772
@@ -753,7 +793,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
753 (t 793 (t
754 (xref-push-marker-stack) 794 (xref-push-marker-stack)
755 (funcall xref-show-xrefs-function xrefs 795 (funcall xref-show-xrefs-function xrefs
756 `((window . ,(selected-window))))))) 796 `((window . ,(selected-window))
797 (display-action . ,display-action))))))
757 798
758(defun xref--prompt-p (command) 799(defun xref--prompt-p (command)
759 (or (eq xref-prompt-for-identifier t) 800 (or (eq xref-prompt-for-identifier t)
diff --git a/lisp/simple.el b/lisp/simple.el
index 375a79e7662..e09ddd2e689 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3492,10 +3492,11 @@ the use of a shell (with its need to quote arguments)."
3492 (save-match-data 3492 (save-match-data
3493 (if (string-match "[ \t]*&[ \t]*\\'" command) 3493 (if (string-match "[ \t]*&[ \t]*\\'" command)
3494 ;; Command ending with ampersand means asynchronous. 3494 ;; Command ending with ampersand means asynchronous.
3495 (let ((buffer (get-buffer-create 3495 (let* ((buffer (get-buffer-create
3496 (or output-buffer "*Async Shell Command*"))) 3496 (or output-buffer "*Async Shell Command*")))
3497 (directory default-directory) 3497 (bname (buffer-name buffer))
3498 proc) 3498 (directory default-directory)
3499 proc)
3499 ;; Remove the ampersand. 3500 ;; Remove the ampersand.
3500 (setq command (substring command 0 (match-beginning 0))) 3501 (setq command (substring command 0 (match-beginning 0)))
3501 ;; Ask the user what to do with already running process. 3502 ;; Ask the user what to do with already running process.
@@ -3510,30 +3511,24 @@ the use of a shell (with its need to quote arguments)."
3510 ((eq async-shell-command-buffer 'confirm-new-buffer) 3511 ((eq async-shell-command-buffer 'confirm-new-buffer)
3511 ;; If will create a new buffer, query first. 3512 ;; If will create a new buffer, query first.
3512 (if (yes-or-no-p "A command is running in the default buffer. Use a new buffer? ") 3513 (if (yes-or-no-p "A command is running in the default buffer. Use a new buffer? ")
3513 (setq buffer (generate-new-buffer 3514 (setq buffer (generate-new-buffer bname))
3514 (or (and (bufferp output-buffer) (buffer-name output-buffer))
3515 output-buffer "*Async Shell Command*")))
3516 (error "Shell command in progress"))) 3515 (error "Shell command in progress")))
3517 ((eq async-shell-command-buffer 'new-buffer) 3516 ((eq async-shell-command-buffer 'new-buffer)
3518 ;; It will create a new buffer. 3517 ;; It will create a new buffer.
3519 (setq buffer (generate-new-buffer 3518 (setq buffer (generate-new-buffer bname)))
3520 (or (and (bufferp output-buffer) (buffer-name output-buffer))
3521 output-buffer "*Async Shell Command*"))))
3522 ((eq async-shell-command-buffer 'confirm-rename-buffer) 3519 ((eq async-shell-command-buffer 'confirm-rename-buffer)
3523 ;; If will rename the buffer, query first. 3520 ;; If will rename the buffer, query first.
3524 (if (yes-or-no-p "A command is running in the default buffer. Rename it? ") 3521 (if (yes-or-no-p "A command is running in the default buffer. Rename it? ")
3525 (progn 3522 (progn
3526 (with-current-buffer buffer 3523 (with-current-buffer buffer
3527 (rename-uniquely)) 3524 (rename-uniquely))
3528 (setq buffer (get-buffer-create 3525 (setq buffer (get-buffer-create bname)))
3529 (or output-buffer "*Async Shell Command*"))))
3530 (error "Shell command in progress"))) 3526 (error "Shell command in progress")))
3531 ((eq async-shell-command-buffer 'rename-buffer) 3527 ((eq async-shell-command-buffer 'rename-buffer)
3532 ;; It will rename the buffer. 3528 ;; It will rename the buffer.
3533 (with-current-buffer buffer 3529 (with-current-buffer buffer
3534 (rename-uniquely)) 3530 (rename-uniquely))
3535 (setq buffer (get-buffer-create 3531 (setq buffer (get-buffer-create bname)))))
3536 (or output-buffer "*Async Shell Command*"))))))
3537 (with-current-buffer buffer 3532 (with-current-buffer buffer
3538 (shell-command--save-pos-or-erase) 3533 (shell-command--save-pos-or-erase)
3539 (setq default-directory directory) 3534 (setq default-directory directory)
@@ -3542,19 +3537,18 @@ the use of a shell (with its need to quote arguments)."
3542 (setq mode-line-process '(":%s")) 3537 (setq mode-line-process '(":%s"))
3543 (require 'shell) (shell-mode) 3538 (require 'shell) (shell-mode)
3544 (set-process-sentinel proc 'shell-command-sentinel) 3539 (set-process-sentinel proc 'shell-command-sentinel)
3545 ;; Use the comint filter for proper handling of carriage motion 3540 ;; Use the comint filter for proper handling of
3546 ;; (see `comint-inhibit-carriage-motion'),. 3541 ;; carriage motion (see comint-inhibit-carriage-motion).
3547 (set-process-filter proc 'comint-output-filter) 3542 (set-process-filter proc 'comint-output-filter)
3548 (if async-shell-command-display-buffer 3543 (if async-shell-command-display-buffer
3549 (display-buffer buffer '(nil (allow-no-window . t))) 3544 (display-buffer buffer '(nil (allow-no-window . t)))
3550 (add-function :before (process-filter proc) 3545 (add-function :before (process-filter proc)
3551 `(lambda (process string) 3546 (lambda (process _string)
3552 (when (and (= 0 (buffer-size (process-buffer process))) 3547 (let ((buf (process-buffer process)))
3553 (string= (buffer-name (process-buffer process)) 3548 (when (and (zerop (buffer-size buf))
3554 ,(or output-buffer "*Async Shell Command*"))) 3549 (string= (buffer-name buf)
3555 (display-buffer (process-buffer process)))) 3550 bname))
3556 )) 3551 (display-buffer buf))))))))
3557 ))
3558 ;; Otherwise, command is executed synchronously. 3552 ;; Otherwise, command is executed synchronously.
3559 (shell-command-on-region (point) (point) command 3553 (shell-command-on-region (point) (point) command
3560 output-buffer nil error-buffer))))))) 3554 output-buffer nil error-buffer)))))))
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."
474 474
475 (interactive) 475 (interactive)
476 476
477 ;; Ensure access to scanning info and rescan buffer if prefix are is '(4). 477 ;; Ensure access to scanning info and rescan buffer if prefix arg is '(4).
478 (let ((current-prefix-arg current-prefix-arg)) 478 (let ((current-prefix-arg current-prefix-arg))
479 (reftex-ensure-index-support t) 479 (reftex-ensure-index-support t)
480 (reftex-access-scan-info current-prefix-arg)) 480 (reftex-access-scan-info current-prefix-arg))
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index f9f23201b43..8d69d8feda5 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."
134 134
135 (interactive) 135 (interactive)
136 136
137 ;; Ensure access to scanning info and rescan buffer if prefix are is '(4). 137 ;; Ensure access to scanning info and rescan buffer if prefix arg is '(4).
138 (reftex-access-scan-info current-prefix-arg) 138 (reftex-access-scan-info current-prefix-arg)
139 139
140 ;; Find out what kind of environment this is and abort if necessary. 140 ;; 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."
216 (or reftex-support-index 216 (or reftex-support-index
217 (setq reftex-toc-include-index-entries nil)) 217 (setq reftex-toc-include-index-entries nil))
218 218
219 ;; Ensure access to scanning info and rescan buffer if prefix are is '(4) 219 ;; Ensure access to scanning info and rescan buffer if prefix arg is '(4)
220 (reftex-access-scan-info current-prefix-arg) 220 (reftex-access-scan-info current-prefix-arg)
221 221
222 (let* ((this-buf (current-buffer)) 222 (let* ((this-buf (current-buffer))
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."
3512 (lambda (process _event) 3512 (lambda (process _event)
3513 (when (eq (process-status process) 'exit) 3513 (when (eq (process-status process) 'exit)
3514 (unwind-protect 3514 (unwind-protect
3515 (when (eq process tex-chktex--process) 3515 (when (eq process
3516 (with-current-buffer source tex-chktex--process))
3516 (with-current-buffer (process-buffer process) 3517 (with-current-buffer (process-buffer process)
3517 (goto-char (point-min)) 3518 (goto-char (point-min))
3518 (cl-loop 3519 (cl-loop
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 @@
185 185
186;;;###autoload 186;;;###autoload
187(defun ediff-files (file-A file-B &optional startup-hooks) 187(defun ediff-files (file-A file-B &optional startup-hooks)
188 "Run Ediff on a pair of files, FILE-A and FILE-B." 188 "Run Ediff on a pair of files, FILE-A and FILE-B.
189STARTUP-HOOKS is a list of functions that Emacs calls without
190arguments after setting up the Ediff buffers."
189 (interactive 191 (interactive
190 (let ((dir-A (if ediff-use-last-dir 192 (let ((dir-A (if ediff-use-last-dir
191 ediff-last-dir-A 193 ediff-last-dir-A
@@ -221,7 +223,9 @@
221 223
222;;;###autoload 224;;;###autoload
223(defun ediff-files3 (file-A file-B file-C &optional startup-hooks) 225(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
224 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C." 226 "Run Ediff on three files, FILE-A, FILE-B, and FILE-C.
227STARTUP-HOOKS is a list of functions that Emacs calls without
228arguments after setting up the Ediff buffers."
225 (interactive 229 (interactive
226 (let ((dir-A (if ediff-use-last-dir 230 (let ((dir-A (if ediff-use-last-dir
227 ediff-last-dir-A 231 ediff-last-dir-A
@@ -419,7 +423,14 @@ If this file is a backup, `ediff' it with its original."
419 423
420;;;###autoload 424;;;###autoload
421(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name) 425(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
422 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B." 426 "Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B.
427STARTUP-HOOKS is a list of functions that Emacs calls without
428arguments after setting up the Ediff buffers. JOB-NAME is a
429symbol describing the Ediff job type; it defaults to
430`ediff-buffers', but can also be one of
431`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor',
432`ediff-last-dir-C', `ediff-buffers3', `ediff-merge-buffers', or
433`ediff-merge-buffers-with-ancestor'."
423 (interactive 434 (interactive
424 (let (bf) 435 (let (bf)
425 (list (setq bf (read-buffer "Buffer A to compare: " 436 (list (setq bf (read-buffer "Buffer A to compare: "
@@ -441,7 +452,14 @@ If this file is a backup, `ediff' it with its original."
441;;;###autoload 452;;;###autoload
442(defun ediff-buffers3 (buffer-A buffer-B buffer-C 453(defun ediff-buffers3 (buffer-A buffer-B buffer-C
443 &optional startup-hooks job-name) 454 &optional startup-hooks job-name)
444 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C." 455 "Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C.
456STARTUP-HOOKS is a list of functions that Emacs calls without
457arguments after setting up the Ediff buffers. JOB-NAME is a
458symbol describing the Ediff job type; it defaults to
459`ediff-buffers3', but can also be one of
460`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor',
461`ediff-last-dir-C', `ediff-buffers', `ediff-merge-buffers', or
462`ediff-merge-buffers-with-ancestor'."
445 (interactive 463 (interactive
446 (let (bf bff) 464 (let (bf bff)
447 (list (setq bf (read-buffer "Buffer A to compare: " 465 (list (setq bf (read-buffer "Buffer A to compare: "
@@ -637,7 +655,8 @@ regular expression; only file names that match the regexp are considered."
637(defun ediff-merge-directories (dir1 dir2 regexp &optional merge-autostore-dir) 655(defun ediff-merge-directories (dir1 dir2 regexp &optional merge-autostore-dir)
638 "Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have 656 "Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have
639the same name in both. The third argument, REGEXP, is nil or a regular 657the same name in both. The third argument, REGEXP, is nil or a regular
640expression; only file names that match the regexp are considered." 658expression; only file names that match the regexp are considered.
659MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
641 (interactive 660 (interactive
642 (let ((dir-A (ediff-get-default-directory-name)) 661 (let ((dir-A (ediff-get-default-directory-name))
643 (default-regexp (eval ediff-default-filtering-regexp)) 662 (default-regexp (eval ediff-default-filtering-regexp))
@@ -674,7 +693,8 @@ expression; only file names that match the regexp are considered."
674Ediff merges files that have identical names in DIR1, DIR2. If a pair of files 693Ediff merges files that have identical names in DIR1, DIR2. If a pair of files
675in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge 694in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge
676without ancestor. The fourth argument, REGEXP, is nil or a regular expression; 695without ancestor. The fourth argument, REGEXP, is nil or a regular expression;
677only file names that match the regexp are considered." 696only file names that match the regexp are considered.
697MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
678 (interactive 698 (interactive
679 (let ((dir-A (ediff-get-default-directory-name)) 699 (let ((dir-A (ediff-get-default-directory-name))
680 (default-regexp (eval ediff-default-filtering-regexp)) 700 (default-regexp (eval ediff-default-filtering-regexp))
@@ -710,7 +730,8 @@ only file names that match the regexp are considered."
710 &optional merge-autostore-dir) 730 &optional merge-autostore-dir)
711 "Run Ediff on a directory, DIR1, merging its files with their revisions. 731 "Run Ediff on a directory, DIR1, merging its files with their revisions.
712The second argument, REGEXP, is a regular expression that filters the file 732The second argument, REGEXP, is a regular expression that filters the file
713names. Only the files that are under revision control are taken into account." 733names. Only the files that are under revision control are taken into account.
734MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
714 (interactive 735 (interactive
715 (let ((dir-A (ediff-get-default-directory-name)) 736 (let ((dir-A (ediff-get-default-directory-name))
716 (default-regexp (eval ediff-default-filtering-regexp)) 737 (default-regexp (eval ediff-default-filtering-regexp))
@@ -740,7 +761,8 @@ names. Only the files that are under revision control are taken into account."
740 merge-autostore-dir) 761 merge-autostore-dir)
741 "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors. 762 "Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors.
742The second argument, REGEXP, is a regular expression that filters the file 763The second argument, REGEXP, is a regular expression that filters the file
743names. Only the files that are under revision control are taken into account." 764names. Only the files that are under revision control are taken into account.
765MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
744 (interactive 766 (interactive
745 (let ((dir-A (ediff-get-default-directory-name)) 767 (let ((dir-A (ediff-get-default-directory-name))
746 (default-regexp (eval ediff-default-filtering-regexp)) 768 (default-regexp (eval ediff-default-filtering-regexp))
@@ -908,7 +930,9 @@ names. Only the files that are under revision control are taken into account."
908With prefix argument, DUMB-MODE, or on a non-windowing display, works as 930With prefix argument, DUMB-MODE, or on a non-windowing display, works as
909follows: 931follows:
910If WIND-A is nil, use selected window. 932If WIND-A is nil, use selected window.
911If WIND-B is nil, use window next to WIND-A." 933If WIND-B is nil, use window next to WIND-A.
934STARTUP-HOOKS is a list of functions that Emacs calls without
935arguments after setting up the Ediff buffers."
912 (interactive "P") 936 (interactive "P")
913 (ediff-windows dumb-mode wind-A wind-B 937 (ediff-windows dumb-mode wind-A wind-B
914 startup-hooks 'ediff-windows-wordwise 'word-mode)) 938 startup-hooks 'ediff-windows-wordwise 'word-mode))
@@ -919,7 +943,9 @@ If WIND-B is nil, use window next to WIND-A."
919With prefix argument, DUMB-MODE, or on a non-windowing display, works as 943With prefix argument, DUMB-MODE, or on a non-windowing display, works as
920follows: 944follows:
921If WIND-A is nil, use selected window. 945If WIND-A is nil, use selected window.
922If WIND-B is nil, use window next to WIND-A." 946If WIND-B is nil, use window next to WIND-A.
947STARTUP-HOOKS is a list of functions that Emacs calls without
948arguments after setting up the Ediff buffers."
923 (interactive "P") 949 (interactive "P")
924 (ediff-windows dumb-mode wind-A wind-B 950 (ediff-windows dumb-mode wind-A wind-B
925 startup-hooks 'ediff-windows-linewise nil)) 951 startup-hooks 'ediff-windows-linewise nil))
@@ -963,9 +989,12 @@ If WIND-B is nil, use window next to WIND-A."
963;;;###autoload 989;;;###autoload
964(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks) 990(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks)
965 "Run Ediff on a pair of regions in specified buffers. 991 "Run Ediff on a pair of regions in specified buffers.
992BUFFER-A and BUFFER-B are the buffers to be compared.
966Regions (i.e., point and mark) can be set in advance or marked interactively. 993Regions (i.e., point and mark) can be set in advance or marked interactively.
967This function is effective only for relatively small regions, up to 200 994This function is effective only for relatively small regions, up to 200
968lines. For large regions, use `ediff-regions-linewise'." 995lines. For large regions, use `ediff-regions-linewise'.
996STARTUP-HOOKS is a list of functions that Emacs calls without
997arguments after setting up the Ediff buffers."
969 (interactive 998 (interactive
970 (let (bf) 999 (let (bf)
971 (list (setq bf (read-buffer "Region's A buffer: " 1000 (list (setq bf (read-buffer "Region's A buffer: "
@@ -1003,10 +1032,13 @@ lines. For large regions, use `ediff-regions-linewise'."
1003;;;###autoload 1032;;;###autoload
1004(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks) 1033(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
1005 "Run Ediff on a pair of regions in specified buffers. 1034 "Run Ediff on a pair of regions in specified buffers.
1035BUFFER-A and BUFFER-B are the buffers to be compared.
1006Regions (i.e., point and mark) can be set in advance or marked interactively. 1036Regions (i.e., point and mark) can be set in advance or marked interactively.
1007Each region is enlarged to contain full lines. 1037Each region is enlarged to contain full lines.
1008This function is effective for large regions, over 100-200 1038This function is effective for large regions, over 100-200
1009lines. For small regions, use `ediff-regions-wordwise'." 1039lines. For small regions, use `ediff-regions-wordwise'.
1040STARTUP-HOOKS is a list of functions that Emacs calls without
1041arguments after setting up the Ediff buffers."
1010 (interactive 1042 (interactive
1011 (let (bf) 1043 (let (bf)
1012 (list (setq bf (read-buffer "Region A's buffer: " 1044 (list (setq bf (read-buffer "Region A's buffer: "
@@ -1127,7 +1159,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
1127 ;; MERGE-BUFFER-FILE is the file to be 1159 ;; MERGE-BUFFER-FILE is the file to be
1128 ;; associated with the merge buffer 1160 ;; associated with the merge buffer
1129 &optional startup-hooks merge-buffer-file) 1161 &optional startup-hooks merge-buffer-file)
1130 "Merge two files without ancestor." 1162 "Merge two files without ancestor.
1163FILE-A and FILE-B are the names of the files to be merged.
1164STARTUP-HOOKS is a list of functions that Emacs calls without
1165arguments after setting up the Ediff buffers. MERGE-BUFFER-FILE
1166is the name of the file to be associated with the merge buffer.."
1131 (interactive 1167 (interactive
1132 (let ((dir-A (if ediff-use-last-dir 1168 (let ((dir-A (if ediff-use-last-dir
1133 ediff-last-dir-A 1169 ediff-last-dir-A
@@ -1171,7 +1207,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
1171 ;; to be associated with the 1207 ;; to be associated with the
1172 ;; merge buffer 1208 ;; merge buffer
1173 merge-buffer-file) 1209 merge-buffer-file)
1174 "Merge two files with ancestor." 1210 "Merge two files with ancestor.
1211FILE-A and FILE-B are the names of the files to be merged, and
1212FILE-ANCESTOR is the name of the ancestor file. STARTUP-HOOKS is
1213a list of functions that Emacs calls without arguments after
1214setting up the Ediff buffers. MERGE-BUFFER-FILE is the name of
1215the file to be associated with the merge buffer."
1175 (interactive 1216 (interactive
1176 (let ((dir-A (if ediff-use-last-dir 1217 (let ((dir-A (if ediff-use-last-dir
1177 ediff-last-dir-A 1218 ediff-last-dir-A
@@ -1229,7 +1270,16 @@ lines. For small regions, use `ediff-regions-wordwise'."
1229 ;; MERGE-BUFFER-FILE is the file to be 1270 ;; MERGE-BUFFER-FILE is the file to be
1230 ;; associated with the merge buffer 1271 ;; associated with the merge buffer
1231 startup-hooks job-name merge-buffer-file) 1272 startup-hooks job-name merge-buffer-file)
1232 "Merge buffers without ancestor." 1273 "Merge buffers without ancestor.
1274BUFFER-A and BUFFER-B are the buffers to be merged.
1275STARTUP-HOOKS is a list of functions that Emacs calls without
1276arguments after setting up the Ediff buffers. JOB-NAME is a
1277symbol describing the Ediff job type; it defaults to
1278`ediff-merge-buffers', but can also be one of
1279`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor',
1280`ediff-last-dir-C', `ediff-buffers', `ediff-buffers3', or
1281`ediff-merge-buffers-with-ancestor'. MERGE-BUFFER-FILE is the
1282name of the file to be associated with the merge buffer."
1233 (interactive 1283 (interactive
1234 (let (bf) 1284 (let (bf)
1235 (list (setq bf (read-buffer "Buffer A to merge: " 1285 (list (setq bf (read-buffer "Buffer A to merge: "
@@ -1256,7 +1306,16 @@ lines. For small regions, use `ediff-regions-wordwise'."
1256 ;; file to be associated 1306 ;; file to be associated
1257 ;; with the merge buffer 1307 ;; with the merge buffer
1258 merge-buffer-file) 1308 merge-buffer-file)
1259 "Merge buffers with ancestor." 1309 "Merge buffers with ancestor.
1310BUFFER-A and BUFFER-B are the buffers to be merged, and
1311BUFFER-ANCESTOR is their ancestor. STARTUP-HOOKS is a list of
1312functions that Emacs calls without arguments after setting up the
1313Ediff buffers. JOB-NAME is a symbol describing the Ediff job
1314type; it defaults to `ediff-merge-buffers-with-ancestor', but can
1315also be one of `ediff-merge-files-with-ancestor',
1316`ediff-last-dir-ancestor', `ediff-last-dir-C', `ediff-buffers',
1317`ediff-buffers3', or `ediff-merge-buffers'. MERGE-BUFFER-FILE is
1318the name of the file to be associated with the merge buffer."
1260 (interactive 1319 (interactive
1261 (let (bf bff) 1320 (let (bf bff)
1262 (list (setq bf (read-buffer "Buffer A to merge: " 1321 (list (setq bf (read-buffer "Buffer A to merge: "
@@ -1287,8 +1346,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
1287(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file) 1346(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
1288 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer 1347 ;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
1289 "Run Ediff by merging two revisions of a file. 1348 "Run Ediff by merging two revisions of a file.
1290The file is the optional FILE argument or the file visited by the current 1349The file is the optional FILE argument or the file visited by the
1291buffer." 1350current buffer. STARTUP-HOOKS is a list of functions that Emacs
1351calls without arguments after setting up the Ediff buffers.
1352MERGE-BUFFER-FILE is the name of the file to be associated with
1353the merge buffer."
1292 (interactive) 1354 (interactive)
1293 (if (stringp file) (find-file file)) 1355 (if (stringp file) (find-file file))
1294 (let (rev1 rev2) 1356 (let (rev1 rev2)
@@ -1319,8 +1381,11 @@ buffer."
1319 ;; buffer 1381 ;; buffer
1320 merge-buffer-file) 1382 merge-buffer-file)
1321 "Run Ediff by merging two revisions of a file with a common ancestor. 1383 "Run Ediff by merging two revisions of a file with a common ancestor.
1322The file is the optional FILE argument or the file visited by the current 1384The file is the optional FILE argument or the file visited by the
1323buffer." 1385current buffer. STARTUP-HOOKS is a list of functions that Emacs
1386calls without arguments after setting up the Ediff buffers.
1387MERGE-BUFFER-FILE is the name of the file to be associated with
1388the merge buffer."
1324 (interactive) 1389 (interactive)
1325 (if (stringp file) (find-file file)) 1390 (if (stringp file) (find-file file))
1326 (let (rev1 rev2 ancestor-rev) 1391 (let (rev1 rev2 ancestor-rev)
@@ -1360,8 +1425,8 @@ buffer."
1360 "Query for a file name, and then run Ediff by patching that file. 1425 "Query for a file name, and then run Ediff by patching that file.
1361If optional PATCH-BUF is given, use the patch in that buffer 1426If optional PATCH-BUF is given, use the patch in that buffer
1362and don't ask the user. 1427and don't ask the user.
1363If prefix argument, then: if even argument, assume that the patch is in a 1428If prefix argument ARG, then: if even argument, assume that the
1364buffer. If odd -- assume it is in a file." 1429patch is in a buffer. If odd -- assume it is in a file."
1365 (interactive "P") 1430 (interactive "P")
1366 (let (source-dir source-file) 1431 (let (source-dir source-file)
1367 (require 'ediff-ptch) 1432 (require 'ediff-ptch)
@@ -1394,7 +1459,7 @@ prompts for the buffer or a file, depending on the answer.
1394With ARG=1, assumes the patch is in a file and prompts for the file. 1459With ARG=1, assumes the patch is in a file and prompts for the file.
1395With ARG=2, assumes the patch is in a buffer and prompts for the buffer. 1460With ARG=2, assumes the patch is in a buffer and prompts for the buffer.
1396PATCH-BUF is an optional argument, which specifies the buffer that contains the 1461PATCH-BUF is an optional argument, which specifies the buffer that contains the
1397patch. If not given, the user is prompted according to the prefix argument." 1462patch. If not given, the user is prompted according to the prefix argument."
1398 (interactive "P") 1463 (interactive "P")
1399 (require 'ediff-ptch) 1464 (require 'ediff-ptch)
1400 (setq patch-buf 1465 (setq patch-buf
@@ -1421,7 +1486,9 @@ patch. If not given, the user is prompted according to the prefix argument."
1421 "Run Ediff by comparing versions of a file. 1486 "Run Ediff by comparing versions of a file.
1422The file is an optional FILE argument or the file entered at the prompt. 1487The file is an optional FILE argument or the file entered at the prompt.
1423Default: the file visited by the current buffer. 1488Default: the file visited by the current buffer.
1424Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'." 1489Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'.
1490STARTUP-HOOKS is a list of functions that Emacs calls without
1491arguments after setting up the Ediff buffers."
1425 ;; if buffer is non-nil, use that buffer instead of the current buffer 1492 ;; if buffer is non-nil, use that buffer instead of the current buffer
1426 (interactive "P") 1493 (interactive "P")
1427 (if (not (stringp file)) 1494 (if (not (stringp file))
@@ -1434,7 +1501,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
1434 'no-dirs))) 1501 'no-dirs)))
1435 (find-file file) 1502 (find-file file)
1436 (if (and (buffer-modified-p) 1503 (if (and (buffer-modified-p)
1437 (y-or-n-p (format "Buffer %s is modified. Save buffer? " 1504 (y-or-n-p (format "Buffer %s is modified. Save buffer? "
1438 (buffer-name)))) 1505 (buffer-name))))
1439 (save-buffer (current-buffer))) 1506 (save-buffer (current-buffer)))
1440 (let (rev1 rev2) 1507 (let (rev1 rev2)
@@ -1517,6 +1584,7 @@ With optional NODE, goes to that node."
1517 1584
1518;;;###autoload 1585;;;###autoload
1519(defun ediff-files-command () 1586(defun ediff-files-command ()
1587 "Call `ediff-files' with the next two command line arguments."
1520 (let ((file-a (nth 0 command-line-args-left)) 1588 (let ((file-a (nth 0 command-line-args-left))
1521 (file-b (nth 1 command-line-args-left))) 1589 (file-b (nth 1 command-line-args-left)))
1522 (setq command-line-args-left (nthcdr 2 command-line-args-left)) 1590 (setq command-line-args-left (nthcdr 2 command-line-args-left))
@@ -1524,6 +1592,7 @@ With optional NODE, goes to that node."
1524 1592
1525;;;###autoload 1593;;;###autoload
1526(defun ediff3-files-command () 1594(defun ediff3-files-command ()
1595 "Call `ediff3-files' with the next three command line arguments."
1527 (let ((file-a (nth 0 command-line-args-left)) 1596 (let ((file-a (nth 0 command-line-args-left))
1528 (file-b (nth 1 command-line-args-left)) 1597 (file-b (nth 1 command-line-args-left))
1529 (file-c (nth 2 command-line-args-left))) 1598 (file-c (nth 2 command-line-args-left)))
@@ -1532,6 +1601,7 @@ With optional NODE, goes to that node."
1532 1601
1533;;;###autoload 1602;;;###autoload
1534(defun ediff-merge-command () 1603(defun ediff-merge-command ()
1604 "Call `ediff-merge-files' with the next two command line arguments."
1535 (let ((file-a (nth 0 command-line-args-left)) 1605 (let ((file-a (nth 0 command-line-args-left))
1536 (file-b (nth 1 command-line-args-left))) 1606 (file-b (nth 1 command-line-args-left)))
1537 (setq command-line-args-left (nthcdr 2 command-line-args-left)) 1607 (setq command-line-args-left (nthcdr 2 command-line-args-left))
@@ -1539,6 +1609,7 @@ With optional NODE, goes to that node."
1539 1609
1540;;;###autoload 1610;;;###autoload
1541(defun ediff-merge-with-ancestor-command () 1611(defun ediff-merge-with-ancestor-command ()
1612 "Call `ediff-merge-files-with-ancestor' with the next three command line arguments."
1542 (let ((file-a (nth 0 command-line-args-left)) 1613 (let ((file-a (nth 0 command-line-args-left))
1543 (file-b (nth 1 command-line-args-left)) 1614 (file-b (nth 1 command-line-args-left))
1544 (ancestor (nth 2 command-line-args-left))) 1615 (ancestor (nth 2 command-line-args-left)))
@@ -1547,6 +1618,7 @@ With optional NODE, goes to that node."
1547 1618
1548;;;###autoload 1619;;;###autoload
1549(defun ediff-directories-command () 1620(defun ediff-directories-command ()
1621 "Call `ediff-directories' with the next three command line arguments."
1550 (let ((file-a (nth 0 command-line-args-left)) 1622 (let ((file-a (nth 0 command-line-args-left))
1551 (file-b (nth 1 command-line-args-left)) 1623 (file-b (nth 1 command-line-args-left))
1552 (regexp (nth 2 command-line-args-left))) 1624 (regexp (nth 2 command-line-args-left)))
@@ -1555,6 +1627,7 @@ With optional NODE, goes to that node."
1555 1627
1556;;;###autoload 1628;;;###autoload
1557(defun ediff-directories3-command () 1629(defun ediff-directories3-command ()
1630 "Call `ediff-directories3' with the next four command line arguments."
1558 (let ((file-a (nth 0 command-line-args-left)) 1631 (let ((file-a (nth 0 command-line-args-left))
1559 (file-b (nth 1 command-line-args-left)) 1632 (file-b (nth 1 command-line-args-left))
1560 (file-c (nth 2 command-line-args-left)) 1633 (file-c (nth 2 command-line-args-left))
@@ -1564,6 +1637,7 @@ With optional NODE, goes to that node."
1564 1637
1565;;;###autoload 1638;;;###autoload
1566(defun ediff-merge-directories-command () 1639(defun ediff-merge-directories-command ()
1640 "Call `ediff-merge-directories' with the next three command line arguments."
1567 (let ((file-a (nth 0 command-line-args-left)) 1641 (let ((file-a (nth 0 command-line-args-left))
1568 (file-b (nth 1 command-line-args-left)) 1642 (file-b (nth 1 command-line-args-left))
1569 (regexp (nth 2 command-line-args-left))) 1643 (regexp (nth 2 command-line-args-left)))
@@ -1572,6 +1646,7 @@ With optional NODE, goes to that node."
1572 1646
1573;;;###autoload 1647;;;###autoload
1574(defun ediff-merge-directories-with-ancestor-command () 1648(defun ediff-merge-directories-with-ancestor-command ()
1649 "Call `ediff-merge-directories-with-ancestor' with the next four command line arguments."
1575 (let ((file-a (nth 0 command-line-args-left)) 1650 (let ((file-a (nth 0 command-line-args-left))
1576 (file-b (nth 1 command-line-args-left)) 1651 (file-b (nth 1 command-line-args-left))
1577 (ancestor (nth 2 command-line-args-left)) 1652 (ancestor (nth 2 command-line-args-left))
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
6465vertically only if it has at least this many lines. If this is 6465vertically only if it has at least this many lines. If this is
6466nil, `split-window-sensibly' is not allowed to split a window 6466nil, `split-window-sensibly' is not allowed to split a window
6467vertically. If, however, a window is the only window on its 6467vertically. If, however, a window is the only window on its
6468frame, `split-window-sensibly' may split it vertically 6468frame, or all the other ones are dedicated,
6469disregarding the value of this variable." 6469`split-window-sensibly' may split it vertically disregarding the
6470value of this variable."
6470 :type '(choice (const nil) (integer :tag "lines")) 6471 :type '(choice (const nil) (integer :tag "lines"))
6471 :version "23.1" 6472 :version "23.1"
6472 :group 'windows) 6473 :group 'windows)
@@ -6573,15 +6574,27 @@ split."
6573 ;; Split window horizontally. 6574 ;; Split window horizontally.
6574 (with-selected-window window 6575 (with-selected-window window
6575 (split-window-right))) 6576 (split-window-right)))
6576 (and (eq window (frame-root-window (window-frame window))) 6577 (and
6577 (not (window-minibuffer-p window)) 6578 ;; If WINDOW is the only usable window on its frame (it is
6578 ;; If WINDOW is the only window on its frame and is not the 6579 ;; the only one or, not being the only one, all the other
6579 ;; minibuffer window, try to split it vertically disregarding 6580 ;; ones are dedicated) and is not the minibuffer window, try
6580 ;; the value of `split-height-threshold'. 6581 ;; to split it vertically disregarding the value of
6581 (let ((split-height-threshold 0)) 6582 ;; `split-height-threshold'.
6582 (when (window-splittable-p window) 6583 (let ((frame (window-frame window)))
6583 (with-selected-window window 6584 (or
6584 (split-window-below)))))))) 6585 (eq window (frame-root-window frame))
6586 (catch 'done
6587 (walk-window-tree (lambda (w)
6588 (unless (or (eq w window)
6589 (window-dedicated-p w))
6590 (throw 'done nil)))
6591 frame)
6592 t)))
6593 (not (window-minibuffer-p window))
6594 (let ((split-height-threshold 0))
6595 (when (window-splittable-p window)
6596 (with-selected-window window
6597 (split-window-below))))))))
6585 6598
6586(defun window--try-to-split-window (window &optional alist) 6599(defun window--try-to-split-window (window &optional alist)
6587 "Try to split WINDOW. 6600 "Try to split WINDOW.
diff --git a/nt/INSTALL.W64 b/nt/INSTALL.W64
index 4a93dc02c8b..392ecf2b3a4 100644
--- a/nt/INSTALL.W64
+++ b/nt/INSTALL.W64
@@ -49,13 +49,13 @@ will also be available at the Windows console.
49 49
50** Download and install the necessary packages 50** Download and install the necessary packages
51 51
52Run msys2_shell.bat in your MSYS2 directory and you will see a BASH window 52Run c:/msys64/msys2.exe in your MSYS2 directory and you will see a BASH window
53opened. 53opened.
54 54
55In the BASH prompt, use the following command to install the necessary 55In the BASH prompt, use the following command to install the necessary
56packages (you can copy and paste it into the shell with Shift + Insert): 56packages (you can copy and paste it into the shell with Shift + Insert):
57 57
58 pacman -S base-devel \ 58 pacman -S --needed base-devel \
59 mingw-w64-x86_64-toolchain \ 59 mingw-w64-x86_64-toolchain \
60 mingw-w64-x86_64-xpm-nox \ 60 mingw-w64-x86_64-xpm-nox \
61 mingw-w64-x86_64-libtiff \ 61 mingw-w64-x86_64-libtiff \
@@ -63,7 +63,7 @@ packages (you can copy and paste it into the shell with Shift + Insert):
63 mingw-w64-x86_64-libpng \ 63 mingw-w64-x86_64-libpng \
64 mingw-w64-x86_64-libjpeg-turbo \ 64 mingw-w64-x86_64-libjpeg-turbo \
65 mingw-w64-x86_64-librsvg \ 65 mingw-w64-x86_64-librsvg \
66 mingw-w64-x86_64-liblcms2 \ 66 mingw-w64-x86_64-lcms2 \
67 mingw-w64-x86_64-libxml2 \ 67 mingw-w64-x86_64-libxml2 \
68 mingw-w64-x86_64-gnutls \ 68 mingw-w64-x86_64-gnutls \
69 mingw-w64-x86_64-zlib 69 mingw-w64-x86_64-zlib
@@ -126,7 +126,7 @@ Now you're ready to build and install Emacs with autogen, configure, make,
126and make install. 126and make install.
127 127
128First we need to switch to the MinGW-w64 environment. Exit the MSYS2 BASH 128First we need to switch to the MinGW-w64 environment. Exit the MSYS2 BASH
129console and run mingw64_shell.bat in the C:\msys64 folder, then cd back to 129console and run mingw64.exe in the C:\msys64 folder, then cd back to
130your Emacs source directory, e.g.: 130your Emacs source directory, e.g.:
131 131
132 cd /c/emacs/emacs-26 132 cd /c/emacs/emacs-26
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);
1502static void * 1502static void *
1503gdefault_morecore (ptrdiff_t increment) 1503gdefault_morecore (ptrdiff_t increment)
1504{ 1504{
1505 void *result;
1506#ifdef HYBRID_MALLOC 1505#ifdef HYBRID_MALLOC
1507 if (!DUMPED) 1506 if (!DUMPED)
1508 { 1507 {
1509 return bss_sbrk (increment); 1508 return bss_sbrk (increment);
1510 } 1509 }
1511#endif 1510#endif
1512 result = (void *) __sbrk (increment); 1511#ifdef HAVE_SBRK
1513 if (result == (void *) -1) 1512 void *result = (void *) __sbrk (increment);
1514 return NULL; 1513 if (result != (void *) -1)
1515 return result; 1514 return result;
1515#endif
1516 return NULL;
1516} 1517}
1517 1518
1518void *(*__morecore) (ptrdiff_t) = gdefault_morecore; 1519void *(*__morecore) (ptrdiff_t) = gdefault_morecore;
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'. */)
2422 2422
2423#ifdef HAVE_GNUTLS 2423#ifdef HAVE_GNUTLS
2424 2424
2425 capabilities = Fcons (intern("gnutls"), capabilities);
2426
2425# ifdef HAVE_GNUTLS3 2427# ifdef HAVE_GNUTLS3
2426 capabilities = Fcons (intern("gnutls3"), capabilities); 2428 capabilities = Fcons (intern("gnutls3"), capabilities);
2427 capabilities = Fcons (intern("digests"), capabilities); 2429 capabilities = Fcons (intern("digests"), capabilities);
diff --git a/src/window.c b/src/window.c
index 9bb2c43a698..cc1d2a7b36e 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6661,7 +6661,7 @@ the return value is nil. Otherwise the value is t. */)
6661 6661
6662 We have to do this in order to capture the following 6662 We have to do this in order to capture the following
6663 scenario: Suppose our frame contains two live windows W1 and 6663 scenario: Suppose our frame contains two live windows W1 and
6664 W2 and set-window-configuration replaces them by two 6664 W2 and 'set-window-configuration' replaces them by two
6665 windows W3 and W4 that were dead the last time 6665 windows W3 and W4 that were dead the last time
6666 run_window_size_change_functions was run. If W3 and W4 have 6666 run_window_size_change_functions was run. If W3 and W4 have
6667 the same values for their old and new pixel sizes but these 6667 the same values for their old and new pixel sizes but these
@@ -7617,8 +7617,8 @@ on their symbols to be controlled by this variable. */);
7617 DEFVAR_LISP ("window-configuration-change-hook", 7617 DEFVAR_LISP ("window-configuration-change-hook",
7618 Vwindow_configuration_change_hook, 7618 Vwindow_configuration_change_hook,
7619 doc: /* Functions to call when window configuration changes. 7619 doc: /* Functions to call when window configuration changes.
7620The buffer-local part is run once per window, with the relevant window 7620The buffer-local value is run once per window, with the relevant window
7621selected; while the global part is run only once for the modified frame, 7621selected; while the global value is run only once for the modified frame,
7622with the relevant frame selected. */); 7622with the relevant frame selected. */);
7623 Vwindow_configuration_change_hook = Qnil; 7623 Vwindow_configuration_change_hook = Qnil;
7624 7624
diff --git a/src/xdisp.c b/src/xdisp.c
index 900a8dc1637..f1a6c622d09 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13174,8 +13174,20 @@ hscroll_window_tree (Lisp_Object window)
13174 13174
13175 /* If the position of this window's point has explicitly 13175 /* If the position of this window's point has explicitly
13176 changed, no more suspend auto hscrolling. */ 13176 changed, no more suspend auto hscrolling. */
13177 if (NILP (Fequal (Fwindow_point (window), Fwindow_old_point (window)))) 13177 if (w->suspend_auto_hscroll
13178 w->suspend_auto_hscroll = false; 13178 && NILP (Fequal (Fwindow_point (window),
13179 Fwindow_old_point (window))))
13180 {
13181 w->suspend_auto_hscroll = false;
13182 /* When hscrolling just the current line, and the rest
13183 of lines were temporarily hscrolled, but no longer
13184 are, force thorough redisplay of this window, to show
13185 the effect of disabling hscroll suspension immediately. */
13186 if (w->min_hscroll == 0 && w->hscroll > 0
13187 && EQ (Fbuffer_local_value (Qauto_hscroll_mode, w->contents),
13188 Qcurrent_line))
13189 SET_FRAME_GARBAGED (XFRAME (w->frame));
13190 }
13179 13191
13180 /* Remember window point. */ 13192 /* Remember window point. */
13181 Fset_marker (w->old_pointm, 13193 Fset_marker (w->old_pointm,
@@ -32563,6 +32575,9 @@ display-start position.
32563These functions are called whenever the `window-start' marker is modified, 32575These functions are called whenever the `window-start' marker is modified,
32564either to point into another buffer (e.g. via `set-window-buffer') or another 32576either to point into another buffer (e.g. via `set-window-buffer') or another
32565place in the same buffer. 32577place in the same buffer.
32578When each function is called, the `window-start' marker of its window
32579argument has been already set to the new value, and the buffer which that
32580window will display is set to be the current buffer.
32566Note that the value of `window-end' is not valid when these functions are 32581Note that the value of `window-end' is not valid when these functions are
32567called. 32582called.
32568 32583
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
30 30
31Tests should normally reside in a file with ~-tests.el~ added to the 31Tests should normally reside in a file with ~-tests.el~ added to the
32base-name of the tested source file; hence ~ert.el~ is tested in 32base-name of the tested source file; hence ~ert.el~ is tested in
33~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As n 33~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As an
34exception, tests for a single feature may be placed into multiple 34exception, tests for a single feature may be placed into multiple
35files of any name which are themselves placed in a directory named 35files of any name which are themselves placed in a directory named
36after the feature with ~-tests~ appended, such as 36after the feature with ~-tests~ appended, such as
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 @@
42 (should (equal (buffer-string) 42 (should (equal (buffer-string)
43 "test: ")))))) 43 "test: "))))))
44 44
45(ert-deftest completion-table-with-predicate-test ()
46 (let ((full-collection
47 '("apple" ; Has A.
48 "beet" ; Has B.
49 "banana" ; Has A & B.
50 "cherry" ; Has neither.
51 ))
52 (no-A (lambda (x) (not (string-match-p "a" x))))
53 (no-B (lambda (x) (not (string-match-p "b" x)))))
54 (should
55 (member "cherry"
56 (completion-table-with-predicate
57 full-collection no-A t "" no-B t)))
58 (should-not
59 (member "banana"
60 (completion-table-with-predicate
61 full-collection no-A t "" no-B t)))
62 ;; "apple" should still match when strict is nil.
63 (should (eq t (try-completion
64 "apple"
65 (apply-partially
66 'completion-table-with-predicate
67 full-collection no-A nil)
68 no-B)))
69 ;; "apple" should still match when strict is nil and pred2 is nil
70 ;; (Bug#27841).
71 (should (eq t (try-completion
72 "apple"
73 (apply-partially
74 'completion-table-with-predicate
75 full-collection no-A nil))))))
76
45(provide 'completion-tests) 77(provide 'completion-tests)
46;;; completion-tests.el ends here 78;;; completion-tests.el ends here
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index af707f85007..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'."
2290 2290
2291 ;; Cleanup. 2291 ;; Cleanup.
2292 (ignore-errors 2292 (ignore-errors
2293 (delete-directory tmp-name1)))))) 2293 (delete-directory tmp-name1 'recursive))))))
2294 2294
2295(ert-deftest tramp-test17-insert-directory () 2295(ert-deftest tramp-test17-insert-directory ()
2296 "Check `insert-directory'." 2296 "Check `insert-directory'."
@@ -4432,23 +4432,27 @@ process sentinels. They shall not disturb each other."
4432 "Check that Tramp is loaded lazily, only when needed." 4432 "Check that Tramp is loaded lazily, only when needed."
4433 ;; Tramp is neither loaded at Emacs startup, nor when completing a 4433 ;; Tramp is neither loaded at Emacs startup, nor when completing a
4434 ;; non-Tramp file name like "/foo". Completing a Tramp-alike file 4434 ;; non-Tramp file name like "/foo". Completing a Tramp-alike file
4435 ;; name like "/foo:" autoloads Tramp. 4435 ;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t.
4436 (let ((code 4436 (let ((code
4437 "(progn \ 4437 "(progn \
4438 (message \"Tramp loaded: %s\" (featurep 'tramp)) \ 4438 (setq tramp-mode %s) \
4439 (message \"Tramp loaded: %%s\" (featurep 'tramp)) \
4439 (file-name-all-completions \"/foo\" \"/\") \ 4440 (file-name-all-completions \"/foo\" \"/\") \
4440 (message \"Tramp loaded: %s\" (featurep 'tramp)) \ 4441 (message \"Tramp loaded: %%s\" (featurep 'tramp)) \
4441 (file-name-all-completions \"/foo:\" \"/\") \ 4442 (file-name-all-completions \"/foo:\" \"/\") \
4442 (message \"Tramp loaded: %s\" (featurep 'tramp)))")) 4443 (message \"Tramp loaded: %%s\" (featurep 'tramp)))"))
4443 (should 4444 (dolist (tm '(t nil))
4444 (string-match 4445 (should
4445 "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+" 4446 (string-match
4446 (shell-command-to-string 4447 (format
4447 (format 4448 "Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+"
4448 "%s -batch -Q -L %s --eval %s" 4449 tm)
4449 (expand-file-name invocation-name invocation-directory) 4450 (shell-command-to-string
4450 (mapconcat 'shell-quote-argument load-path " -L ") 4451 (format
4451 (shell-quote-argument code))))))) 4452 "%s -batch -Q -L %s --eval %s"
4453 (expand-file-name invocation-name invocation-directory)
4454 (mapconcat 'shell-quote-argument load-path " -L ")
4455 (shell-quote-argument (format code tm)))))))))
4452 4456
4453(ert-deftest tramp-test43-unload () 4457(ert-deftest tramp-test43-unload ()
4454 "Check that Tramp and its subpackages unload completely. 4458 "Check that Tramp and its subpackages unload completely.
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 @@
1@arr = [1,2,3,4]; 1@arr = [1,2,3,4];
2unknown;
2my $b = @arr[1]; 3my $b = @arr[1];
4[
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 @@
1def bla
2 return 2
3 print "not reached"
4 something
5 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
108 (should (eq 'flymake-warning 108 (should (eq 'flymake-warning
109 (face-at-point))))) 109 (face-at-point)))))
110 110
111(ert-deftest warning-predicate-rx-perl () 111(ert-deftest perl-backend ()
112 "Test perl warning via regular expression predicate." 112 "Test the perl backend"
113 (skip-unless (executable-find "perl")) 113 (skip-unless (executable-find "perl"))
114 (flymake-tests--with-flymake 114 (flymake-tests--with-flymake ("test.pl")
115 ("test.pl" :severity-predicate "^Scalar value")
116 (flymake-goto-next-error) 115 (flymake-goto-next-error)
117 (should (eq 'flymake-warning 116 (should (eq 'flymake-warning (face-at-point)))
118 (face-at-point))))) 117 (flymake-goto-next-error)
118 (should (eq 'flymake-error (face-at-point)))))
119 119
120(ert-deftest warning-predicate-function-perl () 120(ert-deftest ruby-backend ()
121 "Test perl warning via function predicate." 121 "Test the ruby backend"
122 (skip-unless (executable-find "perl")) 122 (skip-unless (executable-find "ruby"))
123 (flymake-tests--with-flymake 123 (flymake-tests--with-flymake ("test.rb")
124 ("test.pl" :severity-predicate
125 (lambda (msg) (string-match "^Scalar value" msg)))
126 (flymake-goto-next-error) 124 (flymake-goto-next-error)
127 (should (eq 'flymake-warning 125 (should (eq 'flymake-warning (face-at-point)))
128 (face-at-point))))) 126 (flymake-goto-next-error)
127 (should (eq 'flymake-error (face-at-point)))))
129 128
130(ert-deftest different-diagnostic-types () 129(ert-deftest different-diagnostic-types ()
131 "Test GCC warning via function predicate." 130 "Test GCC warning via function predicate."