1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

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
This commit is contained in:
Paul Eggert 2017-11-08 19:22:26 -08:00
commit 6ee8270594
50 changed files with 866 additions and 248 deletions

View file

@ -27,10 +27,11 @@ admin/notes/git-workflow.
** Getting involved with development
Discussion about Emacs development takes place on emacs-devel@gnu.org.
You can subscribe to the emacs-devel@gnu.org mailing list, paying
attention to postings with subject lines containing "emacs-announce",
as these discuss important events like feature freezes. See
https://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list
You can subscribe to the emacs-devel@gnu.org mailing list.
If you want to get only the important mails (for things like
feature freezes), choose to receive only the 'emacs-announce' topic
(although so far this feature has not been well or consistently used).
See https://lists.gnu.org/mailman/listinfo/emacs-devel for mailing list
instructions and archives. You can develop and commit changes in your
own copy of the repository, and discuss proposed changes on the
mailing list. Frequent contributors to Emacs can request write access

View file

@ -177,6 +177,11 @@ General steps (for each step, check for possible errors):
See the info-gnu-emacs mailing list archives for the form
of past announcements. The first pretest announcement, and the
release announcement, should have more detail.
Use the emacs-devel topic 'emacs-announce'. The best way to do
this is to add a header "Keywords: emacs-announce" to your mail.
(You can also put it in the Subject, but this is not as good
because replies that invariably are not announcements also get
sent out as if they were.)
12. After a release, update the Emacs pages as below.

View file

@ -2218,7 +2218,7 @@ test "$CANNOT_DUMP" = yes ||
case "$opsys" in
## darwin ld insists on the use of malloc routines in the System framework.
darwin | mingw32 | nacl | sol2-10) ;;
cygwin | qnxto)
cygwin | qnxto | freebsd)
hybrid_malloc=yes
system_malloc= ;;
*) test "$ac_cv_func_sbrk" = yes && system_malloc=$emacs_cv_sanitize_address;;

View file

@ -1887,8 +1887,7 @@ the special XREF mode:
@table @kbd
@item @key{RET}
@itemx mouse-2
Display the reference on the current line and bury the @file{*xref*}
buffer.
Display the reference on the current line.
@item n
@itemx .
@findex xref-next-line
@ -1903,6 +1902,10 @@ Move to the previous reference and display it in the other window
@findex xref-show-location-at-point
Display the reference on the current line in the other window
(@code{xref-show-location-at-point}).
@item TAB
@findex xref-quit-and-goto-xref
Display the reference on the current line and bury the @file{*xref*}
buffer (@code{xref-quit-and-goto-xref}).
@findex xref-query-replace-in-results
@item r @var{pattern} @key{RET} @var{replacement} @key{RET}
Perform interactive query-replace on references that match

View file

@ -1886,10 +1886,10 @@ prefix or @code{nil}, meaning it has failed to determine a prefix.
@cindex filling, automatic
@cindex Auto Fill mode
@c FIXME: I don't think any of the variables below is a/an normal/abnormal hook.
Auto Fill mode is a minor mode that fills lines automatically as text
is inserted. This section describes the hook used by Auto Fill mode.
For a description of functions that you can call explicitly to fill and
Auto Fill mode is a minor mode that fills lines automatically as text is
inserted. @xref{Auto Fill,,, emacs, The GNU Emacs Manual}. This
section describes some variables used by Auto Fill mode. For a
description of functions that you can call explicitly to fill and
justify existing text, see @ref{Filling}.
Auto Fill mode also enables the functions that change the margins and
@ -1898,11 +1898,11 @@ justification style to refill portions of the text. @xref{Margins}.
@defvar auto-fill-function
The value of this buffer-local variable should be a function (of no
arguments) to be called after self-inserting a character from the table
@code{auto-fill-chars}. It may be @code{nil}, in which case nothing
special is done in that case.
@code{auto-fill-chars}, see below. It may be @code{nil}, in which case
nothing special is done in that case.
The value of @code{auto-fill-function} is @code{do-auto-fill} when
Auto-Fill mode is enabled. That is a function whose sole purpose is to
The value of @code{auto-fill-function} is @code{do-auto-fill} when Auto
Fill mode is enabled. That is a function whose sole purpose is to
implement the usual strategy for breaking a line.
@end defvar
@ -1919,6 +1919,14 @@ self-inserted---space and newline in most language environments. They
have an entry @code{t} in the table.
@end defvar
@defopt comment-auto-fill-only-comments
This variable, if non-@code{nil}, means to fill lines automatically
within comments only. More precisely, this means that if a comment
syntax was defined for the current buffer, then self-inserting a
character outside of a comment will not call @code{auto-fill-function}.
@end defopt
@node Sorting
@section Sorting Text
@cindex sorting text

View file

@ -5127,7 +5127,10 @@ redisplaying a window with scrolling. Displaying a different buffer in
the window also runs these functions.
This variable is not a normal hook, because each function is called with
two arguments: the window, and its new display-start position.
two arguments: the window, and its new display-start position. At the
time of the call, the display-start position of the window argument is
already set to its new value, and the buffer to be displayed in the
window is already set as the current buffer.
These functions must take care when using @code{window-end}
(@pxref{Window Start and End}); if you need an up-to-date value, you
@ -5138,6 +5141,11 @@ is scrolled. It's not designed for that, and such use probably won't
work.
@end defvar
@defun run-window-scroll-functions &optional window
This function calls @code{window-scroll-functions} for the specified
@var{window}, which defaults to the selected window.
@end defun
@defvar window-size-change-functions
This variable holds a list of functions to be called if the size of any
window changes for any reason. The functions are called once per
@ -5167,17 +5175,22 @@ be called again.
@defvar window-configuration-change-hook
A normal hook that is run every time the window configuration of a frame
changes. Window configuration changes include splitting and deleting
windows and the display of a different buffer in a window. Resizing the
windows, and the display of a different buffer in a window. Resizing the
frame or individual windows do not count as configuration changes. Use
@code{window-size-change-functions}, see above, when you want to track
size changes that are not caused by the deletion or creation of windows.
The buffer-local part of this hook is run once for each window on the
The buffer-local value of this hook is run once for each window on the
affected frame, with the relevant window selected and its buffer
current. The global part is run once for the modified frame, with that
frame selected.
current. The global value of this hook is run once for the modified
frame, with that frame selected.
@end defvar
@defun run-window-configuration-change-hook &optional frame
This function runs @code{window-configuration-change-hook} for the
specified @var{frame}, which defaults to the selected frame.
@end defun
In addition, you can use @code{jit-lock-register} to register a Font
Lock fontification function, which will be called whenever parts of a
buffer are (re)fontified because a window was scrolled or its size

View file

@ -1760,6 +1760,7 @@ file. For commands that you can use to view the effect of your changes,
see @ref{Indentation Commands} and @ref{Filling and Breaking}.
For details of the @ccmode{} style system, see @ref{Styles}.
@item @kbd{C-c :} (@code{c-scope-operator})
@kindex C-c :
@findex c-scope-operator
@ -1768,6 +1769,18 @@ In C++, it is also sometimes desirable to insert the double-colon scope
operator without performing the electric behavior of colon insertion.
@kbd{C-c :} does just this.
@item @kbd{C-c C-z} (@code{c-display-defun-name})
@kindex C-c C-z
@findex c-display-defun-name
@findex display-defun-name (c-)
Display the current function name, if any, in the minibuffer.
Additionally, if a prefix argument is given, push the function name to
the kill ring. If there is no current function,
@code{c-display-defun-name} does nothing. In Emacs, you can use this
command in the middle of an interactive search if you set the
customizable option @code{isearch-allow-scroll} to non-@code{nil}.
@xref{Not Exiting Isearch,,,emacs, GNU Emacs Manual}.
@item @kbd{C-c C-\} (@code{c-backslash-region})
@kindex C-c C-\
@findex c-backslash-region

View file

@ -94,7 +94,11 @@ There's one way to find out if GnuTLS is available, by calling
Zaretskii) in the same directory as Emacs, you should be OK.
@defun gnutls-available-p
This function returns @code{t} if GnuTLS is available in this instance of Emacs.
This function returns non-@code{nil} if GnuTLS is available in this
instance of Emacs, @code{nil} otherwise. If GnuTLS is available, the
value is a list of GnuTLS capabilities supported by the installed
GnuTLS library, which depends on the library version. The meaning of
the capabilities is documented in the doc string of this function.
@end defun
Oh, but sometimes things go wrong. Budgets aren't balanced,

View file

@ -581,10 +581,7 @@ not auto loaded by Emacs. All examples require @value{tramp} is
installed and loaded:
@lisp
@group
(custom-set-variables
'(tramp-verbose 6 nil (tramp) "Enable remote command traces"))
@end group
(customize-set-variable 'tramp-verbose 6 "Enable remote command traces")
@end lisp
@ -1155,7 +1152,7 @@ option to determine the default method for remote file names that do
not have one specified.
@lisp
(custom-set-variables '(tramp-default-method "ssh" nil (tramp)))
(customize-set-variable 'tramp-default-method "ssh")
@end lisp
@end defopt
@ -1242,7 +1239,7 @@ this substitution can be overridden with @option{tramp-default-user}.
For example:
@lisp
(custom-set-variables'(tramp-default-user "root" nil (tramp)))
(customize-set-variable 'tramp-default-user "root")
@end lisp
@end defopt
@ -1298,9 +1295,9 @@ follows:
@lisp
@group
(custom-set-variables
'(tramp-default-method "ssh" nil (tramp))
'(tramp-default-user "john" nil (tramp))
'(tramp-default-host "target" nil (tramp)))
'(tramp-default-method "ssh")
'(tramp-default-user "john")
'(tramp-default-host "target"))
@end group
@end lisp
@ -1858,21 +1855,20 @@ example below:
@lisp
@group
(custom-set-variables
'(tramp-password-prompt-regexp
(concat
"^.*"
(regexp-opt
'("passphrase" "Passphrase"
;; English
"password" "Password"
;; Deutsch
"passwort" "Passwort"
;; Français
"mot de passe" "Mot de passe")
t)
".*:\0? *")
nil (tramp)))
(customize-set-variable
'tramp-password-prompt-regexp
(concat
"^.*"
(regexp-opt
'("passphrase" "Passphrase"
;; English
"password" "Password"
;; Deutsch
"passwort" "Passwort"
;; Français
"mot de passe" "Mot de passe")
t)
".*:\0? *"))
@end group
@end lisp
@ -2175,8 +2171,8 @@ Example:
@group
(add-to-list 'backup-directory-alist
(cons "." "~/.emacs.d/backups/"))
(custom-set-variables
'(tramp-backup-directory-alist backup-directory-alist 6 nil (tramp)))
(customize-set-variable
'tramp-backup-directory-alist backup-directory-alist)
@end group
@end lisp
@ -2549,7 +2545,7 @@ For ad-hoc definitions to be saved automatically in
@option{tramp-save-ad-hoc-proxies} to non-@code{nil}.
@lisp
(custom-set-variables '(tramp-save-ad-hoc-proxies t nil (tramp)))
(customize-set-variable 'tramp-save-ad-hoc-proxies t)
@end lisp
@end defopt
@ -3189,10 +3185,11 @@ which allows you to set the @code{ControlPath} provided the variable
@lisp
@group
(setq tramp-ssh-controlmaster-options
(concat
"-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
"-o ControlMaster=auto -o ControlPersist=yes"))
(customize-set-variable
'tramp-ssh-controlmaster-options
(concat
"-o ControlPath=/tmp/ssh-ControlPath-%%r@@%%h:%%p "
"-o ControlMaster=auto -o ControlPersist=yes"))
@end group
@end lisp
@ -3205,10 +3202,7 @@ behavior, then any changes to @command{ssh} can be suppressed with
this @code{nil} setting:
@lisp
@group
(custom-set-variables
'(tramp-use-ssh-controlmaster-options nil nil (tramp)))
@end group
(customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
@end lisp
@ -3364,8 +3358,8 @@ You can define default methods and user names for hosts,
@lisp
@group
(custom-set-variables
'(tramp-default-method "ssh" nil (tramp))
'(tramp-default-user "news" nil (tramp)))
'(tramp-default-method "ssh")
'(tramp-default-user "news"))
@end group
@end lisp
@ -3659,7 +3653,7 @@ disable such features.
Disable @value{tramp} file name completion:
@lisp
(custom-set-variables '(ido-enable-tramp-completion nil))
(customize-set-variable 'ido-enable-tramp-completion nil)
@end lisp
@item
@ -3682,15 +3676,16 @@ To keep Ange FTP as default the remote files access package, set this
in @file{.emacs}:
@lisp
(custom-set-variables '(tramp-default-method "ftp" nil (tramp)))
(customize-set-variable 'tramp-default-method "ftp")
@end lisp
@item
To disable both @value{tramp} (and Ange FTP), set @code{tramp-mode} to
@code{nil} in @file{.emacs}.
@code{nil} in @file{.emacs}. @strong{Note}, that we don't use
@code{customize-set-variable}, in order to avoid loading @value{tramp}.
@lisp
(custom-set-variables '(tramp-mode nil nil (tramp)))
(setq tramp-mode nil)
@end lisp
@item

View file

@ -1213,6 +1213,16 @@ New user options `term-char-mode-buffer-read-only' and
are non-nil by default. Customize these options to nil if you want
the previous behavior.
** Xref
+++
*** When an *xref* buffer is needed, 'TAB' quits and jumps to an xref.
A new command 'xref-quit-and-goto-xref', bound to 'TAB' in *xref*
buffers, quits the window before jumping to the destination. In many
situations, the intended window configuration is restored, just as if
the *xref* buffer hadn't been necessary in the first place.
* New Modes and Packages in Emacs 26.1
@ -1262,6 +1272,11 @@ table implementation. This uses a new bytecode op 'switch', which
isn't compatible with previous Emacs versions. This functionality can
be disabled by setting 'byte-compile-cond-use-jump-table' to nil.
+++
** If 'comment-auto-fill-only-comments' is non-nil, 'auto-fill-function'
is now called only if either no comment syntax is defined for the
current buffer or the self-insertion takes place within a comment.
---
** The alist 'ucs-names' is now a hash table.
@ -1525,6 +1540,10 @@ See the node "(elisp) Checksum/Hash" in the ELisp manual for details.
and 'gnutls-symmetric-decrypt'.
See the node "(elisp) GnuTLS Cryptography" in the ELisp manual for details.
+++
** The function 'gnutls-available-p' now returns a list of capabilities
supported by the GnuTLS library used by Emacs.
+++
** Emacs now supports records for user-defined types, via the new
functions 'make-record', 'record', and 'recordp'. Records are now

View file

@ -826,6 +826,36 @@ index 45cc554..0cc5e76 100644
If you can't modify that file directly, copy it to the directory
~/.m17n.d/ (create it if it doesn't exist), and apply the patch.
** Emacs running on GNU/Linux system with the m17n library Ver.1.7.1 or the
earlier version has a problem with rendering Lao script with OpenType font.
The problem can be fixed by installing the newer version of the m17n
library (if any), or by following this procedure:
1. Locate the file LAOO-OTF.flt installed on your system as part of the
m17n library. Usually it is under the directory /usr/share/m17n.
2. Apply the following patch to LAOO-OTF.flt
------------------------------------------------------------
diff --git a/FLT/LAOO-OTF.flt b/FLT/LAOO-OTF.flt
index 5504171..431adf8 100644
--- a/FLT/LAOO-OTF.flt
+++ b/FLT/LAOO-OTF.flt
@@ -3,7 +3,7 @@
;; See the end for copying conditions.
(font layouter laoo-otf nil
- (font (nil phetsarath\ ot unicode-bmp)))
+ (font (nil nil unicode-bmp :otf=lao\ )))
;;; <li> LAOO-OTF.flt
------------------------------------------------------------
If you can't modify that file directly, copy it to the directory
~/.m17n.d/ (create it if it doesn't exist), and apply the patch.
* Internationalization problems
** M-{ does not work on a Spanish PC keyboard.
@ -1462,6 +1492,22 @@ this, you can remove the X resource or put this in your init file:
(xterm-remove-modify-other-keys)
** Emacs's xterm-mouse doesn't work well in Evil mode.
Specifically, clicking mouse-1 doesn't work as expected: instead of
moving point where you click, it highlights the region between the
line beginning and the click location, and displays error messages
about unbound keys in the echo area.
To work around this, put this in your .emacs file:
(with-eval-after-load 'evil-maps
(define-key evil-motion-state-map [down-mouse-1] nil))
This appears to be a bug in Evil.
See discussions in https://github.com/emacs-evil/evil/issues/960
and https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29143
** Emacs spontaneously displays "I-search: " at the bottom of the screen.
This means that Control-S/Control-Q (XON/XOFF) "flow control" is being

View file

@ -2354,7 +2354,7 @@
;; The variables math-solve-lhs, math-solve-rhs and math-try-solve-sign
;; are local to math-try-solve-for, but are used by math-try-solve-prod.
;; (math-solve-lhs and math-solve-rhs are is also local to
;; (math-solve-lhs and math-solve-rhs are also local to
;; math-decompose-poly, but used by math-solve-poly-funny-powers.)
(defvar math-solve-lhs)
(defvar math-solve-rhs)

View file

@ -38,16 +38,22 @@
(
)
"A symref tool implementation using grep.
This tool uses EDE to find he root of the project, then executes
find-grep in the project. The output is parsed for hits
and those hits returned.")
This tool uses EDE to find the root of the project, then executes
find-grep in the project. The output is parsed for hits and
those hits returned.")
(defvar semantic-symref-filepattern-alist
'((c-mode "*.[ch]")
(c++-mode "*.[chCH]" "*.[ch]pp" "*.cc" "*.hh")
(html-mode "*.s?html" "*.php")
(html-mode "*.html" "*.shtml" "*.php")
(mhtml-mode "*.html" "*.shtml" "*.php") ; FIXME: remove
; duplication of
; HTML-related patterns.
; Maybe they belong in the
; major mode definition?
(ruby-mode "*.r[bu]" "*.rake" "*.gemspec" "*.erb" "*.haml"
"Rakefile" "Thorfile" "Capfile" "Guardfile" "Vagrantfile")
(python-mode "*.py" "*.pyi" "*.pyw")
(perl-mode "*.pl" "*.PL")
(cperl-mode "*.pl" "*.PL")
(lisp-interaction-mode "*.el" "*.ede" ".emacs" "_emacs")
@ -58,7 +64,7 @@ See find -name man page for format.")
(defun semantic-symref-derive-find-filepatterns (&optional mode)
;; FIXME: This should be moved to grep.el, where it could be used
;; for "C-u M-x grep" as well.
"Derive a list of file patterns for the current buffer.
"Derive a list of file (glob) patterns for the current buffer.
Looks first in `semantic-symref-filepattern-alist'. If it is not
there, it then looks in `auto-mode-alist', and attempts to derive something
from that.
@ -78,7 +84,7 @@ Optional argument MODE specifies the `major-mode' to test."
(error "Customize `semantic-symref-filepattern-alist' for %S"
major-mode)
(let ((args `("-name" ,(car pat))))
(if (null (cdr args))
(if (null (cdr pat))
args
`("(" ,@args
,@(mapcan (lambda (s) `("-o" "-name" ,s)) pat)
@ -149,7 +155,7 @@ This shell should support pipe redirect syntax."
(oref tool searchfor))
(t
;; Can't use the word boundaries: Grep
;; doesn't always agrees with the language
;; doesn't always agree with the language
;; syntax on those.
(format "\\(^\\|\\W\\)%s\\(\\W\\|$\\)"
(oref tool searchfor)))))

View file

@ -3146,7 +3146,7 @@ non-empty directories is allowed."
#'dired-delete-entry fn))
(quit (throw '--delete-cancel (message "OK, canceled")))
(error ;; catch errors from failed deletions
(dired-log "%s\n" err)
(dired-log "%s: %s\n" (car err) (error-message-string err))
(setq failures (cons (car (car l)) failures)))))
(setq l (cdr l)))
(if (not failures)

View file

@ -718,7 +718,8 @@ is blocked."
"Loop over values from an iterator.
Evaluate BODY with VAR bound to each value from ITERATOR.
Return the value with which ITERATOR finished iteration."
(declare (indent 1))
(declare (indent 1)
(debug ((symbolp form) body)))
(let ((done-symbol (cps--gensym "iter-do-iterator-done"))
(condition-symbol (cps--gensym "iter-do-condition"))
(it-symbol (cps--gensym "iter-do-iterator"))

View file

@ -603,7 +603,16 @@ With a numeric prefix argument N, sort the Nth column."
(let ((lnum-width (tabulated-list-line-number-width)))
(when (not (= tabulated-list--current-lnum-width lnum-width))
(setq-local tabulated-list--current-lnum-width lnum-width)
(tabulated-list-revert)))))
(tabulated-list-init-header)))))
(defun tabulated-list-window-scroll-function (window _start)
(if display-line-numbers
(let ((lnum-width
(with-selected-window window
(line-number-display-width 'columns))))
(when (not (= tabulated-list--current-lnum-width lnum-width))
(setq-local tabulated-list--current-lnum-width lnum-width)
(tabulated-list-init-header)))))
;;; The mode definition:
@ -654,7 +663,9 @@ as the ewoc pretty-printer."
;; the line-number width needs to change due to scrolling.
(setq-local tabulated-list--current-lnum-width 0)
(add-hook 'pre-redisplay-functions
#'tabulated-list-watch-line-number-width nil t))
#'tabulated-list-watch-line-number-width nil t)
(add-hook 'window-scroll-functions
#'tabulated-list-window-scroll-function nil t))
(put 'tabulated-list-mode 'mode-class 'special)

View file

@ -87,9 +87,7 @@ If the value is `absorb', ZWNJ is absorbed into the previous
grapheme cluster, and not displayed.
If the value is `as-space', the glyph is displayed by a
thin (i.e. 1-dot width) space.
Customizing the value takes effect when you start Emacs next time."
thin (i.e. 1-dot width) space."
:group 'mule
:version "26.1"
:type '(choice

View file

@ -392,7 +392,7 @@ obeys predicates."
(and (funcall pred1 x) (funcall pred2 x)))))
;; If completion failed and we're not applying pred1 strictly, try
;; again without pred1.
(and (not strict) pred1 pred2
(and (not strict) pred1
(complete-with-action action table string pred2))))))
(defun completion-table-in-turn (&rest tables)

View file

@ -1292,7 +1292,8 @@ file-notify events."
(when (and user domain)
(setq user (concat domain ";" user)))
(url-parse-make-urlobj
method (and user (url-hexify-string user)) nil host
method (and user (url-hexify-string user))
nil (and host (url-hexify-string host))
(if (stringp port) (string-to-number port) port)
(and localname (url-hexify-string localname)) nil nil t))
(url-parse-make-urlobj

View file

@ -818,7 +818,7 @@ Used in `tramp-make-tramp-file-name'.")
"Regexp matching delimiter between user and host names.
Derived from `tramp-postfix-user-format'.")
(defconst tramp-host-regexp "[a-zA-Z0-9_.-]+"
(defconst tramp-host-regexp "[a-zA-Z0-9_.%-]+"
"Regexp matching host names.")
(defconst tramp-prefix-ipv6-format-alist
@ -2305,8 +2305,10 @@ Falls back to normal file name handler if no Tramp file name handler exists."
;;;###autoload
(progn (defun tramp-autoload-file-name-handler (operation &rest args)
"Load Tramp file name handler, and perform OPERATION."
(let ((default-directory temporary-file-directory))
(load "tramp" 'noerror 'nomessage))
(if tramp-mode
(let ((default-directory temporary-file-directory))
(load "tramp" 'noerror 'nomessage))
(tramp-unload-file-name-handlers))
(apply operation args)))
;; `tramp-autoload-file-name-handler' must be registered before
@ -2422,12 +2424,13 @@ Add operations defined in `HANDLER-alist' to `tramp-file-name-handler'."
(equal (apply operation args) operation))))
;;;###autoload
(defun tramp-unload-file-name-handlers ()
(progn (defun tramp-unload-file-name-handlers ()
"Unload Tramp file name handlers from `file-name-handler-alist'."
(dolist (fnh '(tramp-file-name-handler
tramp-completion-file-name-handler))
tramp-completion-file-name-handler
tramp-autoload-file-name-handler))
(let ((a1 (rassq fnh file-name-handler-alist)))
(setq file-name-handler-alist (delq a1 file-name-handler-alist)))))
(setq file-name-handler-alist (delq a1 file-name-handler-alist))))))
(add-hook 'tramp-unload-hook 'tramp-unload-file-name-handlers)
@ -4631,9 +4634,6 @@ Only works for Bourne-like shells."
(provide 'tramp)
;;; TODO:
;; * In Emacs 21, `insert-directory' shows total number of bytes used
;; by the files in that directory. Add this here.
;;
;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
;;

View file

@ -69,6 +69,9 @@
;;; Code:
(eval-when-compile
(require 'subr-x))
;;;###autoload
(defalias 'indent-for-comment 'comment-indent)
;;;###autoload
@ -1141,6 +1144,9 @@ the region rather than at left margin."
;; make the leading and trailing lines if requested
(when lines
;; Trim trailing whitespace from cs if there's some.
(setq cs (string-trim-right cs))
(let ((csce
(comment-make-extra-lines
cs ce ccs cce min-indent max-indent block)))
@ -1211,7 +1217,7 @@ changed with `comment-style'."
(progn (goto-char end) (end-of-line) (skip-syntax-backward " ")
(<= (point) end))
(or block (not (string= "" comment-end)))
(or block (progn (goto-char beg) (search-forward "\n" end t)))))
(or block (progn (goto-char beg) (re-search-forward "$" end t)))))
;; don't add end-markers just because the user asked for `block'
(unless (or lines (string= "" comment-end)) (setq block nil))

View file

@ -772,7 +772,7 @@ this is `comint-dynamic-complete-functions'."
(setq c (cdr c)))
(setq pcomplete-stub (substring common-stub 0 len)
pcomplete-autolist t)
(when (and begin (not pcomplete-show-list))
(when (and begin (> len 0) (not pcomplete-show-list))
(delete-region begin (point))
(pcomplete-insert-entry "" pcomplete-stub))
(throw 'pcomplete-completions completions))

View file

@ -1821,7 +1821,6 @@ the open-parenthesis that starts a defun; see `beginning-of-defun'."
"Return the name of the current defun, or NIL if there isn't one.
\"Defun\" here means a function, or other top level construct
with a brace block."
(interactive)
(c-save-buffer-state
(beginning-of-defun-function end-of-defun-function
where pos name-end case-fold-search)
@ -2048,6 +2047,23 @@ with a brace block."
(eq (char-after) ?\{)
(cons (point-min) (point-max))))))))
(defun c-display-defun-name (&optional arg)
"Display the name of the current CC mode defun and the position in it.
With a prefix arg, push the name onto the kill ring too."
(interactive "P")
(save-restriction
(widen)
(c-save-buffer-state ((name (c-defun-name))
(limits (c-declaration-limits t))
(point-bol (c-point 'bol)))
(when name
(message "%s. Line %s/%s." name
(1+ (count-lines (car limits) point-bol))
(count-lines (car limits) (cdr limits)))
(if arg (kill-new name))
(sit-for 3 t)))))
(put 'c-display-defun-name 'isearch-scroll t)
(defun c-mark-function ()
"Put mark at end of the current top-level declaration or macro, point at beginning.
If point is not inside any then the closest following one is
@ -2092,7 +2108,6 @@ function does not require the declaration to contain a brace block."
(defun c-cpp-define-name ()
"Return the name of the current CPP macro, or NIL if we're not in one."
(interactive)
(let (case-fold-search)
(save-excursion
(and c-opt-cpp-macro-define-start

View file

@ -389,7 +389,8 @@ control). See \"cc-mode.el\" for more info."
;;(define-key c-mode-base-map "\C-c\C-v" 'c-version)
;; (define-key c-mode-base-map "\C-c\C-y" 'c-toggle-hungry-state) Commented out by ACM, 2005-11-22.
(define-key c-mode-base-map "\C-c\C-w" 'c-subword-mode)
(define-key c-mode-base-map "\C-c\C-k" 'c-toggle-comment-style))
(define-key c-mode-base-map "\C-c\C-k" 'c-toggle-comment-style)
(define-key c-mode-base-map "\C-c\C-z" 'c-display-defun-name))
;; We don't require the outline package, but we configure it a bit anyway.
(cc-bytecomp-defvar outline-level)

View file

@ -1896,7 +1896,9 @@ or as help on variables `cperl-tips', `cperl-problems',
(if cperl-pod-here-scan
(or cperl-syntaxify-by-font-lock
(progn (or cperl-faces-init (cperl-init-faces-weak))
(cperl-find-pods-heres)))))
(cperl-find-pods-heres))))
;; Setup Flymake
(add-hook 'flymake-diagnostic-functions 'perl-flymake nil t))
;; Fix for perldb - make default reasonable
(defun cperl-db ()

View file

@ -82,7 +82,7 @@ Overrides `flymake-proc-allowed-file-name-masks'."
("\\.xml\\'" flymake-proc-xml-init)
("\\.html?\\'" flymake-proc-xml-init)
("\\.cs\\'" flymake-proc-simple-make-init)
("\\.p[ml]\\'" flymake-proc-perl-init)
;; ("\\.p[ml]\\'" flymake-proc-perl-init)
("\\.php[345]?\\'" flymake-proc-php-init)
("\\.h\\'" flymake-proc-master-make-header-init flymake-proc-master-cleanup)
("\\.java\\'" flymake-proc-simple-make-java-init flymake-proc-simple-java-cleanup)

View file

@ -342,7 +342,7 @@ region is invalid."
(let* ((beg (fallback-bol))
(end (fallback-eol beg)))
(cons beg end)))))))
(error (flymake-error "Invalid region line=%s col=%s" line col))))
(error (flymake-log :warning "Invalid region line=%s col=%s" line col))))
(defvar flymake-diagnostic-functions nil
"Special hook of Flymake backends that check a buffer.
@ -522,11 +522,12 @@ associated `flymake-category' return DEFAULT."
(flymake--fringe-overlay-spec
(overlay-get ov 'bitmap)))
(default-maybe 'help-echo
(lambda (_window _ov pos)
(mapconcat
#'flymake--diag-text
(flymake-diagnostics pos)
"\n")))
(lambda (window _ov pos)
(with-selected-window window
(mapconcat
#'flymake--diag-text
(flymake-diagnostics pos)
"\n"))))
(default-maybe 'severity (warning-numeric-level :error))
(default-maybe 'priority (+ 100 (overlay-get ov 'severity))))
;; Some properties can't be overridden.
@ -603,8 +604,8 @@ not expected."
(null expected-token))
;; should never happen
(flymake-error "Unexpected report from stopped backend %s" backend))
((and (not (eq expected-token token))
(not force))
((not (or (eq expected-token token)
force))
(flymake-error "Obsolete report from backend %s with explanation %s"
backend explanation))
((eq :panic report-action)
@ -744,8 +745,11 @@ Interactively, with a prefix arg, FORCE is t."
()
(remove-hook 'post-command-hook #'start-post-command
nil)
(with-current-buffer buffer
(flymake-start (remove 'post-command deferred) force)))
;; The buffer may have disappeared already, e.g. because of
;; code like `(with-temp-buffer (python-mode) ...)'.
(when (buffer-live-p buffer)
(with-current-buffer buffer
(flymake-start (remove 'post-command deferred) force))))
(start-on-display
()
(remove-hook 'window-configuration-change-hook #'start-on-display
@ -948,7 +952,7 @@ applied."
(message
"%s"
(funcall (overlay-get target 'help-echo)
nil nil (point)))))
(selected-window) target (point)))))
(interactive
(user-error "No more Flymake errors%s"
(if filter

View file

@ -400,14 +400,22 @@ valid signal handlers.")
(const :tag "Unlimited" nil))
:version "22.1")
(defcustom gdb-non-stop-setting t
"When in non-stop mode, stopped threads can be examined while
(defcustom gdb-non-stop-setting (not (eq system-type 'windows-nt))
"If non-nil, GDB sessions are expected to support the non-stop mode.
When in the non-stop mode, stopped threads can be examined while
other threads continue to execute.
If this is non-nil, GDB will be sent the \"set non-stop 1\" command,
and if that results in an error, the non-stop setting will be
turned off automatically.
On MS-Windows, this is off by default, because MS-Windows targets
don't support the non-stop mode.
GDB session needs to be restarted for this setting to take effect."
:type 'boolean
:group 'gdb-non-stop
:version "23.2")
:version "26.1")
;; TODO Some commands can't be called with --all (give a notice about
;; it in setting doc)
@ -2188,7 +2196,10 @@ a GDB/MI reply message."
(defun gdbmi-bnf-console-stream-output (c-string)
"Handler for the console-stream-output GDB/MI output grammar rule."
(gdb-console c-string))
(gdb-console c-string)
;; We've written to the GUD console, so we should print the prompt
;; after the next result-class or async-class.
(setq gdb-first-done-or-error t))
(defun gdbmi-bnf-target-stream-output (_c-string)
"Handler for the target-stream-output GDB/MI output grammar rule."

View file

@ -580,6 +580,73 @@ create a new comment."
(if (re-search-backward "^sub[ \t]+\\([^({ \t\n]+\\)" nil t)
(match-string-no-properties 1))))
;;; Flymake support
(defcustom perl-flymake-command '("perl" "-w" "-c")
"External tool used to check Perl source code.
This is a non empty list of strings, the checker tool possibly
followed by required arguments. Once launched it will receive
the Perl source to be checked as its standard input."
:group 'perl
:type '(repeat string))
(defvar-local perl--flymake-proc nil)
;;;###autoload
(defun perl-flymake (report-fn &rest _args)
"Perl backend for Flymake. Launches
`perl-flymake-command' (which see) and passes to its standard
input the contents of the current buffer. The output of this
command is analysed for error and warning messages."
(unless (executable-find (car perl-flymake-command))
(error "Cannot find a suitable checker"))
(when (process-live-p perl--flymake-proc)
(kill-process perl--flymake-proc))
(let ((source (current-buffer)))
(save-restriction
(widen)
(setq
perl--flymake-proc
(make-process
:name "perl-flymake" :noquery t :connection-type 'pipe
:buffer (generate-new-buffer " *perl-flymake*")
:command perl-flymake-command
:sentinel
(lambda (proc _event)
(when (eq 'exit (process-status proc))
(unwind-protect
(if (with-current-buffer source (eq proc perl--flymake-proc))
(with-current-buffer (process-buffer proc)
(goto-char (point-min))
(cl-loop
while (search-forward-regexp
"^\\(.+\\) at - line \\([0-9]+\\)"
nil t)
for msg = (match-string 1)
for (beg . end) = (flymake-diag-region
source
(string-to-number (match-string 2)))
for type =
(if (string-match
"\\(Scalar value\\|Useless use\\|Unquoted string\\)"
msg)
:warning
:error)
collect (flymake-make-diagnostic source
beg
end
type
msg)
into diags
finally (funcall report-fn diags)))
(flymake-log :debug "Canceling obsolete check %s"
proc))
(kill-buffer (process-buffer proc)))))))
(process-send-region perl--flymake-proc (point-min) (point-max))
(process-send-eof perl--flymake-proc))))
(defvar perl-mode-hook nil
"Normal hook to run when entering Perl mode.")
@ -665,7 +732,9 @@ Turning on Perl mode runs the normal hook `perl-mode-hook'."
;; Setup outline-minor-mode.
(setq-local outline-regexp perl-outline-regexp)
(setq-local outline-level 'perl-outline-level)
(setq-local add-log-current-defun-function #'perl-current-defun-name))
(setq-local add-log-current-defun-function #'perl-current-defun-name)
;; Setup Flymake
(add-hook 'flymake-diagnostic-functions #'perl-flymake nil t))
;; This is used by indent-for-comment
;; to decide how much to indent a comment in Perl code

View file

@ -2113,20 +2113,25 @@ remote host, the returned value is intended for
(defun python-shell-calculate-exec-path ()
"Calculate `exec-path'.
Prepends `python-shell-exec-path' and adds the binary directory
for virtualenv if `python-shell-virtualenv-root' is set. If
`default-directory' points to a remote host, the returned value
appends `python-shell-remote-exec-path' instead of `exec-path'."
for virtualenv if `python-shell-virtualenv-root' is set - this
will use the python interpreter from inside the virtualenv when
starting the shell. If `default-directory' points to a remote host,
the returned value appends `python-shell-remote-exec-path' instead
of `exec-path'."
(let ((new-path (copy-sequence
(if (file-remote-p default-directory)
python-shell-remote-exec-path
exec-path))))
exec-path)))
;; Windows and POSIX systems use different venv directory structures
(virtualenv-bin-dir (if (eq system-type 'windows-nt) "Scripts" "bin")))
(python-shell--add-to-path-with-priority
new-path python-shell-exec-path)
(if (not python-shell-virtualenv-root)
new-path
(python-shell--add-to-path-with-priority
new-path
(list (expand-file-name "bin" python-shell-virtualenv-root)))
(list (expand-file-name virtualenv-bin-dir python-shell-virtualenv-root)))
new-path)))
(defun python-shell-tramp-refresh-remote-path (vec paths)
@ -5141,6 +5146,138 @@ returned as is."
"Return non-nil if REGEXP is valid."
(ignore-errors (string-match regexp "") t))
;;; Flymake integration
(defgroup python-flymake nil
"Integration between Python and Flymake."
:group 'python
:link '(custom-group-link :tag "Flymake" flymake)
:version "26.1")
(defcustom python-flymake-command '("pyflakes")
"The external tool that will be used to perform the syntax check.
This is a non empty list of strings, the checker tool possibly followed by
required arguments. Once launched it will receive the Python source to be
checked as its standard input.
To use `flake8' you would set this to (\"flake8\" \"-\")."
:group 'python-flymake
:type '(repeat string))
;; The default regexp accomodates for older pyflakes, which did not
;; report the column number, and at the same time it's compatible with
;; flake8 output, although it may be redefined to explicitly match the
;; TYPE
(defcustom python-flymake-command-output-pattern
(list
"^\\(?:<?stdin>?\\):\\(?1:[0-9]+\\):\\(?:\\(?2:[0-9]+\\):\\)? \\(?3:.*\\)$"
1 2 nil 3)
"Specify how to parse the output of `python-flymake-command'.
The value has the form (REGEXP LINE COLUMN TYPE MESSAGE): if
REGEXP matches, the LINE'th subexpression gives the line number,
the COLUMN'th subexpression gives the column number on that line,
the TYPE'th subexpression gives the type of the message and the
MESSAGE'th gives the message text itself.
If COLUMN or TYPE are nil or that index didn't match, that
information is not present on the matched line and a default will
be used."
:group 'python-flymake
:type '(list regexp
(integer :tag "Line's index")
(choice
(const :tag "No column" nil)
(integer :tag "Column's index"))
(choice
(const :tag "No type" nil)
(integer :tag "Type's index"))
(integer :tag "Message's index")))
(defcustom python-flymake-msg-alist
'(("\\(^redefinition\\|.*unused.*\\|used$\\)" . :warning))
"Alist used to associate messages to their types.
Each element should be a cons-cell (REGEXP . TYPE), where TYPE must be
one defined in the variable `flymake-diagnostic-types-alist'.
For example, when using `flake8' a possible configuration could be:
((\"\\(^redefinition\\|.*unused.*\\|used$\\)\" . :warning)
(\"^E999\" . :error)
(\"^[EW][0-9]+\" . :note))
By default messages are considered errors."
:group 'python-flymake
:type `(alist :key-type (regexp)
:value-type (symbol)))
(defvar-local python--flymake-proc nil)
(defun python--flymake-parse-output (source proc report-fn)
"Collect diagnostics parsing checker tool's output line by line."
(let ((rx (nth 0 python-flymake-command-output-pattern))
(lineidx (nth 1 python-flymake-command-output-pattern))
(colidx (nth 2 python-flymake-command-output-pattern))
(typeidx (nth 3 python-flymake-command-output-pattern))
(msgidx (nth 4 python-flymake-command-output-pattern)))
(with-current-buffer (process-buffer proc)
(goto-char (point-min))
(cl-loop
while (search-forward-regexp rx nil t)
for msg = (match-string msgidx)
for (beg . end) = (flymake-diag-region
source
(string-to-number
(match-string lineidx))
(and colidx
(match-string colidx)
(string-to-number
(match-string colidx))))
for type = (or (and typeidx
(match-string typeidx)
(assoc-default
(match-string typeidx)
python-flymake-msg-alist
#'string-match))
(assoc-default msg
python-flymake-msg-alist
#'string-match)
:error)
collect (flymake-make-diagnostic
source beg end type msg)
into diags
finally (funcall report-fn diags)))))
(defun python-flymake (report-fn &rest _args)
"Flymake backend for Python.
This backend uses `python-flymake-command' (which see) to launch a process
that is passed the current buffer's content via stdin.
REPORT-FN is Flymake's callback function."
(unless (executable-find (car python-flymake-command))
(error "Cannot find a suitable checker"))
(when (process-live-p python--flymake-proc)
(kill-process python--flymake-proc))
(let ((source (current-buffer)))
(save-restriction
(widen)
(setq python--flymake-proc
(make-process
:name "python-flymake"
:noquery t
:connection-type 'pipe
:buffer (generate-new-buffer " *python-flymake*")
:command python-flymake-command
:sentinel
(lambda (proc _event)
(when (eq 'exit (process-status proc))
(unwind-protect
(when (with-current-buffer source
(eq proc python--flymake-proc))
(python--flymake-parse-output source proc report-fn))
(kill-buffer (process-buffer proc)))))))
(process-send-region python--flymake-proc (point-min) (point-max))
(process-send-eof python--flymake-proc))))
(defun python-electric-pair-string-delimiter ()
(when (and electric-pair-mode
@ -5255,7 +5392,9 @@ returned as is."
(make-local-variable 'python-shell-internal-buffer)
(when python-indent-guess-indent-offset
(python-indent-guess-indent-offset)))
(python-indent-guess-indent-offset))
(add-hook 'flymake-diagnostic-functions #'python-flymake nil t))
(provide 'python)

View file

@ -2253,6 +2253,68 @@ See `font-lock-syntax-table'.")
(progn (set-match-data value) t))
(ruby-match-expression-expansion limit)))))
;;; Flymake support
(defcustom ruby-flymake-command '("ruby" "-w" "-c")
"External tool used to check Ruby source code.
This is a non empty list of strings, the checker tool possibly
followed by required arguments. Once launched it will receive
the Ruby source to be checked as its standard input."
:group 'ruby
:type '(repeat string))
(defvar-local ruby--flymake-proc nil)
(defun ruby-flymake (report-fn &rest _args)
"Ruby backend for Flymake. Launches
`ruby-flymake-command' (which see) and passes to its standard
input the contents of the current buffer. The output of this
command is analysed for error and warning messages."
(unless (executable-find (car ruby-flymake-command))
(error "Cannot find a suitable checker"))
(when (process-live-p ruby--flymake-proc)
(kill-process ruby--flymake-proc))
(let ((source (current-buffer)))
(save-restriction
(widen)
(setq
ruby--flymake-proc
(make-process
:name "ruby-flymake" :noquery t :connection-type 'pipe
:buffer (generate-new-buffer " *ruby-flymake*")
:command ruby-flymake-command
:sentinel
(lambda (proc _event)
(when (eq 'exit (process-status proc))
(unwind-protect
(if (with-current-buffer source (eq proc ruby--flymake-proc))
(with-current-buffer (process-buffer proc)
(goto-char (point-min))
(cl-loop
while (search-forward-regexp
"^\\(?:.*.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
nil t)
for msg = (match-string 2)
for (beg . end) = (flymake-diag-region
source
(string-to-number (match-string 1)))
for type = (if (string-match "^warning" msg)
:warning
:error)
collect (flymake-make-diagnostic source
beg
end
type
msg)
into diags
finally (funcall report-fn diags)))
(flymake-log :debug "Canceling obsolete check %s"
proc))
(kill-buffer (process-buffer proc)))))))
(process-send-region ruby--flymake-proc (point-min) (point-max))
(process-send-eof ruby--flymake-proc))))
;;;###autoload
(define-derived-mode ruby-mode prog-mode "Ruby"
"Major mode for editing Ruby code."
@ -2265,6 +2327,7 @@ See `font-lock-syntax-table'.")
(add-hook 'after-save-hook 'ruby-mode-set-encoding nil 'local)
(add-hook 'electric-indent-functions 'ruby--electric-indent-p nil 'local)
(add-hook 'flymake-diagnostic-functions 'ruby-flymake nil 'local)
(setq-local font-lock-defaults '((ruby-font-lock-keywords) nil nil))
(setq-local font-lock-keywords ruby-font-lock-keywords)

View file

@ -448,43 +448,74 @@ If SELECT is non-nil, select the target window."
(when xref-w
(set-window-dedicated-p xref-w xref-w-dedicated)))))
(defun xref--show-pos-in-buf (pos buf select)
(let ((xref-buf (current-buffer))
win)
(defvar-local xref--original-window-intent nil
"Original window-switching intent before xref buffer creation.")
(defvar-local xref--original-window nil
"The original window this xref buffer was created from.")
(defun xref--show-pos-in-buf (pos buf)
"Goto and display position POS of buffer BUF in a window.
Honor `xref--original-window-intent', run `xref-after-jump-hook'
and finally return the window."
(let* ((xref-buf (current-buffer))
(pop-up-frames
(or (eq xref--original-window-intent 'frame)
pop-up-frames))
(action
(cond ((memq
xref--original-window-intent
'(window frame))
t)
((and
(window-live-p xref--original-window)
(or (not (window-dedicated-p xref--original-window))
(eq (window-buffer xref--original-window) buf)))
`(,(lambda (buf _alist)
(set-window-buffer xref--original-window buf)
xref--original-window))))))
(with-selected-window
(xref--with-dedicated-window
(display-buffer buf))
(with-selected-window
;; Just before `display-buffer', place ourselves in the
;; original window to suggest preserving it. Of course, if
;; user has deleted the original window, all bets are off,
;; just use the selected one.
(or (and (window-live-p xref--original-window)
xref--original-window)
(selected-window))
(display-buffer buf action))
(xref--goto-char pos)
(run-hooks 'xref-after-jump-hook)
(let ((buf (current-buffer)))
(setq win (selected-window))
(with-current-buffer xref-buf
(setq-local other-window-scroll-buffer buf))))
(when select
(select-window win))))
(setq-local other-window-scroll-buffer buf)))
(selected-window))))
(defun xref--show-location (location &optional select)
"Help `xref-show-xref' and `xref-goto-xref' do their job.
Go to LOCATION and if SELECT is non-nil select its window. If
SELECT is `quit', also quit the *xref* window."
(condition-case err
(let* ((marker (xref-location-marker location))
(buf (marker-buffer marker)))
(xref--show-pos-in-buf marker buf select))
(buf (marker-buffer marker))
(xref-buffer (current-buffer)))
(cond (select
(if (eq select 'quit) (quit-window nil nil))
(with-current-buffer xref-buffer
(select-window (xref--show-pos-in-buf marker buf))))
(t
(save-selected-window
(xref--with-dedicated-window
(xref--show-pos-in-buf marker buf))))))
(user-error (message (error-message-string err)))))
(defvar-local xref--window nil
"The original window this xref buffer was created from.")
(defun xref-show-location-at-point ()
"Display the source of xref at point in the appropriate window, if any."
(interactive)
(let* ((xref (xref--item-at-point))
(xref--current-item xref))
(when xref
;; Try to avoid the window the current xref buffer was
;; originally created from.
(if (window-live-p xref--window)
(with-selected-window xref--window
(xref--show-location (xref-item-location xref)))
(xref--show-location (xref-item-location xref))))))
(xref--show-location (xref-item-location xref)))))
(defun xref-next-line ()
"Move to the next xref and display its source in the appropriate window."
@ -503,12 +534,19 @@ If SELECT is non-nil, select the target window."
(back-to-indentation)
(get-text-property (point) 'xref-item)))
(defun xref-goto-xref ()
"Jump to the xref on the current line and select its window."
(defun xref-goto-xref (&optional quit)
"Jump to the xref on the current line and select its window.
Non-interactively, non-nil QUIT means to first quit the *xref*
buffer."
(interactive)
(let ((xref (or (xref--item-at-point)
(user-error "No reference at point"))))
(xref--show-location (xref-item-location xref) t)))
(xref--show-location (xref-item-location xref) (if quit 'quit t))))
(defun xref-quit-and-goto-xref ()
"Quit *xref* buffer, then jump to xref on current line."
(interactive)
(xref-goto-xref t))
(defun xref-query-replace-in-results (from to)
"Perform interactive replacement of FROM with TO in all displayed xrefs.
@ -632,6 +670,7 @@ references displayed in the current *xref* buffer."
(define-key map (kbd "p") #'xref-prev-line)
(define-key map (kbd "r") #'xref-query-replace-in-results)
(define-key map (kbd "RET") #'xref-goto-xref)
(define-key map (kbd "TAB") #'xref-quit-and-goto-xref)
(define-key map (kbd "C-o") #'xref-show-location-at-point)
;; suggested by Johan Claesson "to further reduce finger movement":
(define-key map (kbd ".") #'xref-next-line)
@ -726,7 +765,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
(xref--xref-buffer-mode)
(pop-to-buffer (current-buffer))
(goto-char (point-min))
(setq xref--window (assoc-default 'window alist))
(setq xref--original-window (assoc-default 'window alist)
xref--original-window-intent (assoc-default 'display-action alist))
(current-buffer)))))
@ -753,7 +793,8 @@ Return an alist of the form ((FILENAME . (XREF ...)) ...)."
(t
(xref-push-marker-stack)
(funcall xref-show-xrefs-function xrefs
`((window . ,(selected-window)))))))
`((window . ,(selected-window))
(display-action . ,display-action))))))
(defun xref--prompt-p (command)
(or (eq xref-prompt-for-identifier t)

View file

@ -3492,10 +3492,11 @@ the use of a shell (with its need to quote arguments)."
(save-match-data
(if (string-match "[ \t]*&[ \t]*\\'" command)
;; Command ending with ampersand means asynchronous.
(let ((buffer (get-buffer-create
(or output-buffer "*Async Shell Command*")))
(directory default-directory)
proc)
(let* ((buffer (get-buffer-create
(or output-buffer "*Async Shell Command*")))
(bname (buffer-name buffer))
(directory default-directory)
proc)
;; Remove the ampersand.
(setq command (substring command 0 (match-beginning 0)))
;; Ask the user what to do with already running process.
@ -3510,30 +3511,24 @@ the use of a shell (with its need to quote arguments)."
((eq async-shell-command-buffer 'confirm-new-buffer)
;; If will create a new buffer, query first.
(if (yes-or-no-p "A command is running in the default buffer. Use a new buffer? ")
(setq buffer (generate-new-buffer
(or (and (bufferp output-buffer) (buffer-name output-buffer))
output-buffer "*Async Shell Command*")))
(setq buffer (generate-new-buffer bname))
(error "Shell command in progress")))
((eq async-shell-command-buffer 'new-buffer)
;; It will create a new buffer.
(setq buffer (generate-new-buffer
(or (and (bufferp output-buffer) (buffer-name output-buffer))
output-buffer "*Async Shell Command*"))))
(setq buffer (generate-new-buffer bname)))
((eq async-shell-command-buffer 'confirm-rename-buffer)
;; If will rename the buffer, query first.
(if (yes-or-no-p "A command is running in the default buffer. Rename it? ")
(progn
(with-current-buffer buffer
(rename-uniquely))
(setq buffer (get-buffer-create
(or output-buffer "*Async Shell Command*"))))
(setq buffer (get-buffer-create bname)))
(error "Shell command in progress")))
((eq async-shell-command-buffer 'rename-buffer)
;; It will rename the buffer.
(with-current-buffer buffer
(rename-uniquely))
(setq buffer (get-buffer-create
(or output-buffer "*Async Shell Command*"))))))
(setq buffer (get-buffer-create bname)))))
(with-current-buffer buffer
(shell-command--save-pos-or-erase)
(setq default-directory directory)
@ -3542,19 +3537,18 @@ the use of a shell (with its need to quote arguments)."
(setq mode-line-process '(":%s"))
(require 'shell) (shell-mode)
(set-process-sentinel proc 'shell-command-sentinel)
;; Use the comint filter for proper handling of carriage motion
;; (see `comint-inhibit-carriage-motion'),.
;; Use the comint filter for proper handling of
;; carriage motion (see comint-inhibit-carriage-motion).
(set-process-filter proc 'comint-output-filter)
(if async-shell-command-display-buffer
(display-buffer buffer '(nil (allow-no-window . t)))
(add-function :before (process-filter proc)
`(lambda (process string)
(when (and (= 0 (buffer-size (process-buffer process)))
(string= (buffer-name (process-buffer process))
,(or output-buffer "*Async Shell Command*")))
(display-buffer (process-buffer process))))
))
))
(lambda (process _string)
(let ((buf (process-buffer process)))
(when (and (zerop (buffer-size buf))
(string= (buffer-name buf)
bname))
(display-buffer buf))))))))
;; Otherwise, command is executed synchronously.
(shell-command-on-region (point) (point) command
output-buffer nil error-buffer)))))))

View file

@ -474,7 +474,7 @@ With prefix 3, restrict index to region."
(interactive)
;; Ensure access to scanning info and rescan buffer if prefix are is '(4).
;; Ensure access to scanning info and rescan buffer if prefix arg is '(4).
(let ((current-prefix-arg current-prefix-arg))
(reftex-ensure-index-support t)
(reftex-access-scan-info current-prefix-arg))

View file

@ -134,7 +134,7 @@ This function is controlled by the settings of reftex-insert-label-flags."
(interactive)
;; Ensure access to scanning info and rescan buffer if prefix are is '(4).
;; Ensure access to scanning info and rescan buffer if prefix arg is '(4).
(reftex-access-scan-info current-prefix-arg)
;; Find out what kind of environment this is and abort if necessary.

View file

@ -216,7 +216,7 @@ When called with a raw C-u prefix, rescan the document first."
(or reftex-support-index
(setq reftex-toc-include-index-entries nil))
;; Ensure access to scanning info and rescan buffer if prefix are is '(4)
;; Ensure access to scanning info and rescan buffer if prefix arg is '(4)
(reftex-access-scan-info current-prefix-arg)
(let* ((this-buf (current-buffer))

View file

@ -3512,7 +3512,8 @@ There might be text before point."
(lambda (process _event)
(when (eq (process-status process) 'exit)
(unwind-protect
(when (eq process tex-chktex--process)
(when (eq process
(with-current-buffer source tex-chktex--process))
(with-current-buffer (process-buffer process)
(goto-char (point-min))
(cl-loop

View file

@ -185,7 +185,9 @@
;;;###autoload
(defun ediff-files (file-A file-B &optional startup-hooks)
"Run Ediff on a pair of files, FILE-A and FILE-B."
"Run Ediff on a pair of files, FILE-A and FILE-B.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@ -221,7 +223,9 @@
;;;###autoload
(defun ediff-files3 (file-A file-B file-C &optional startup-hooks)
"Run Ediff on three files, FILE-A, FILE-B, and FILE-C."
"Run Ediff on three files, FILE-A, FILE-B, and FILE-C.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@ -419,7 +423,14 @@ If this file is a backup, `ediff' it with its original."
;;;###autoload
(defun ediff-buffers (buffer-A buffer-B &optional startup-hooks job-name)
"Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B."
"Run Ediff on a pair of buffers, BUFFER-A and BUFFER-B.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers. JOB-NAME is a
symbol describing the Ediff job type; it defaults to
`ediff-buffers', but can also be one of
`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor',
`ediff-last-dir-C', `ediff-buffers3', `ediff-merge-buffers', or
`ediff-merge-buffers-with-ancestor'."
(interactive
(let (bf)
(list (setq bf (read-buffer "Buffer A to compare: "
@ -441,7 +452,14 @@ If this file is a backup, `ediff' it with its original."
;;;###autoload
(defun ediff-buffers3 (buffer-A buffer-B buffer-C
&optional startup-hooks job-name)
"Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C."
"Run Ediff on three buffers, BUFFER-A, BUFFER-B, and BUFFER-C.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers. JOB-NAME is a
symbol describing the Ediff job type; it defaults to
`ediff-buffers3', but can also be one of
`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor',
`ediff-last-dir-C', `ediff-buffers', `ediff-merge-buffers', or
`ediff-merge-buffers-with-ancestor'."
(interactive
(let (bf bff)
(list (setq bf (read-buffer "Buffer A to compare: "
@ -637,7 +655,8 @@ regular expression; only file names that match the regexp are considered."
(defun ediff-merge-directories (dir1 dir2 regexp &optional merge-autostore-dir)
"Run Ediff on a pair of directories, DIR1 and DIR2, merging files that have
the same name in both. The third argument, REGEXP, is nil or a regular
expression; only file names that match the regexp are considered."
expression; only file names that match the regexp are considered.
MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@ -674,7 +693,8 @@ expression; only file names that match the regexp are considered."
Ediff merges files that have identical names in DIR1, DIR2. If a pair of files
in DIR1 and DIR2 doesn't have an ancestor in ANCESTOR-DIR, Ediff will merge
without ancestor. The fourth argument, REGEXP, is nil or a regular expression;
only file names that match the regexp are considered."
only file names that match the regexp are considered.
MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@ -710,7 +730,8 @@ only file names that match the regexp are considered."
&optional merge-autostore-dir)
"Run Ediff on a directory, DIR1, merging its files with their revisions.
The second argument, REGEXP, is a regular expression that filters the file
names. Only the files that are under revision control are taken into account."
names. Only the files that are under revision control are taken into account.
MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@ -740,7 +761,8 @@ names. Only the files that are under revision control are taken into account."
merge-autostore-dir)
"Run Ediff on a directory, DIR1, merging its files with their revisions and ancestors.
The second argument, REGEXP, is a regular expression that filters the file
names. Only the files that are under revision control are taken into account."
names. Only the files that are under revision control are taken into account.
MERGE-AUTOSTORE-DIR is the directory in which to store merged files."
(interactive
(let ((dir-A (ediff-get-default-directory-name))
(default-regexp (eval ediff-default-filtering-regexp))
@ -908,7 +930,9 @@ names. Only the files that are under revision control are taken into account."
With prefix argument, DUMB-MODE, or on a non-windowing display, works as
follows:
If WIND-A is nil, use selected window.
If WIND-B is nil, use window next to WIND-A."
If WIND-B is nil, use window next to WIND-A.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
(interactive "P")
(ediff-windows dumb-mode wind-A wind-B
startup-hooks 'ediff-windows-wordwise 'word-mode))
@ -919,7 +943,9 @@ If WIND-B is nil, use window next to WIND-A."
With prefix argument, DUMB-MODE, or on a non-windowing display, works as
follows:
If WIND-A is nil, use selected window.
If WIND-B is nil, use window next to WIND-A."
If WIND-B is nil, use window next to WIND-A.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
(interactive "P")
(ediff-windows dumb-mode wind-A wind-B
startup-hooks 'ediff-windows-linewise nil))
@ -963,9 +989,12 @@ If WIND-B is nil, use window next to WIND-A."
;;;###autoload
(defun ediff-regions-wordwise (buffer-A buffer-B &optional startup-hooks)
"Run Ediff on a pair of regions in specified buffers.
BUFFER-A and BUFFER-B are the buffers to be compared.
Regions (i.e., point and mark) can be set in advance or marked interactively.
This function is effective only for relatively small regions, up to 200
lines. For large regions, use `ediff-regions-linewise'."
lines. For large regions, use `ediff-regions-linewise'.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
(interactive
(let (bf)
(list (setq bf (read-buffer "Region's A buffer: "
@ -1003,10 +1032,13 @@ lines. For large regions, use `ediff-regions-linewise'."
;;;###autoload
(defun ediff-regions-linewise (buffer-A buffer-B &optional startup-hooks)
"Run Ediff on a pair of regions in specified buffers.
BUFFER-A and BUFFER-B are the buffers to be compared.
Regions (i.e., point and mark) can be set in advance or marked interactively.
Each region is enlarged to contain full lines.
This function is effective for large regions, over 100-200
lines. For small regions, use `ediff-regions-wordwise'."
lines. For small regions, use `ediff-regions-wordwise'.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
(interactive
(let (bf)
(list (setq bf (read-buffer "Region A's buffer: "
@ -1127,7 +1159,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
;; MERGE-BUFFER-FILE is the file to be
;; associated with the merge buffer
&optional startup-hooks merge-buffer-file)
"Merge two files without ancestor."
"Merge two files without ancestor.
FILE-A and FILE-B are the names of the files to be merged.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers. MERGE-BUFFER-FILE
is the name of the file to be associated with the merge buffer.."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@ -1171,7 +1207,12 @@ lines. For small regions, use `ediff-regions-wordwise'."
;; to be associated with the
;; merge buffer
merge-buffer-file)
"Merge two files with ancestor."
"Merge two files with ancestor.
FILE-A and FILE-B are the names of the files to be merged, and
FILE-ANCESTOR is the name of the ancestor file. STARTUP-HOOKS is
a list of functions that Emacs calls without arguments after
setting up the Ediff buffers. MERGE-BUFFER-FILE is the name of
the file to be associated with the merge buffer."
(interactive
(let ((dir-A (if ediff-use-last-dir
ediff-last-dir-A
@ -1229,7 +1270,16 @@ lines. For small regions, use `ediff-regions-wordwise'."
;; MERGE-BUFFER-FILE is the file to be
;; associated with the merge buffer
startup-hooks job-name merge-buffer-file)
"Merge buffers without ancestor."
"Merge buffers without ancestor.
BUFFER-A and BUFFER-B are the buffers to be merged.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers. JOB-NAME is a
symbol describing the Ediff job type; it defaults to
`ediff-merge-buffers', but can also be one of
`ediff-merge-files-with-ancestor', `ediff-last-dir-ancestor',
`ediff-last-dir-C', `ediff-buffers', `ediff-buffers3', or
`ediff-merge-buffers-with-ancestor'. MERGE-BUFFER-FILE is the
name of the file to be associated with the merge buffer."
(interactive
(let (bf)
(list (setq bf (read-buffer "Buffer A to merge: "
@ -1256,7 +1306,16 @@ lines. For small regions, use `ediff-regions-wordwise'."
;; file to be associated
;; with the merge buffer
merge-buffer-file)
"Merge buffers with ancestor."
"Merge buffers with ancestor.
BUFFER-A and BUFFER-B are the buffers to be merged, and
BUFFER-ANCESTOR is their ancestor. STARTUP-HOOKS is a list of
functions that Emacs calls without arguments after setting up the
Ediff buffers. JOB-NAME is a symbol describing the Ediff job
type; it defaults to `ediff-merge-buffers-with-ancestor', but can
also be one of `ediff-merge-files-with-ancestor',
`ediff-last-dir-ancestor', `ediff-last-dir-C', `ediff-buffers',
`ediff-buffers3', or `ediff-merge-buffers'. MERGE-BUFFER-FILE is
the name of the file to be associated with the merge buffer."
(interactive
(let (bf bff)
(list (setq bf (read-buffer "Buffer A to merge: "
@ -1287,8 +1346,11 @@ lines. For small regions, use `ediff-regions-wordwise'."
(defun ediff-merge-revisions (&optional file startup-hooks merge-buffer-file)
;; MERGE-BUFFER-FILE is the file to be associated with the merge buffer
"Run Ediff by merging two revisions of a file.
The file is the optional FILE argument or the file visited by the current
buffer."
The file is the optional FILE argument or the file visited by the
current buffer. STARTUP-HOOKS is a list of functions that Emacs
calls without arguments after setting up the Ediff buffers.
MERGE-BUFFER-FILE is the name of the file to be associated with
the merge buffer."
(interactive)
(if (stringp file) (find-file file))
(let (rev1 rev2)
@ -1319,8 +1381,11 @@ buffer."
;; buffer
merge-buffer-file)
"Run Ediff by merging two revisions of a file with a common ancestor.
The file is the optional FILE argument or the file visited by the current
buffer."
The file is the optional FILE argument or the file visited by the
current buffer. STARTUP-HOOKS is a list of functions that Emacs
calls without arguments after setting up the Ediff buffers.
MERGE-BUFFER-FILE is the name of the file to be associated with
the merge buffer."
(interactive)
(if (stringp file) (find-file file))
(let (rev1 rev2 ancestor-rev)
@ -1360,8 +1425,8 @@ buffer."
"Query for a file name, and then run Ediff by patching that file.
If optional PATCH-BUF is given, use the patch in that buffer
and don't ask the user.
If prefix argument, then: if even argument, assume that the patch is in a
buffer. If odd -- assume it is in a file."
If prefix argument ARG, then: if even argument, assume that the
patch is in a buffer. If odd -- assume it is in a file."
(interactive "P")
(let (source-dir source-file)
(require 'ediff-ptch)
@ -1394,7 +1459,7 @@ prompts for the buffer or a file, depending on the answer.
With ARG=1, assumes the patch is in a file and prompts for the file.
With ARG=2, assumes the patch is in a buffer and prompts for the buffer.
PATCH-BUF is an optional argument, which specifies the buffer that contains the
patch. If not given, the user is prompted according to the prefix argument."
patch. If not given, the user is prompted according to the prefix argument."
(interactive "P")
(require 'ediff-ptch)
(setq patch-buf
@ -1421,7 +1486,9 @@ patch. If not given, the user is prompted according to the prefix argument."
"Run Ediff by comparing versions of a file.
The file is an optional FILE argument or the file entered at the prompt.
Default: the file visited by the current buffer.
Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'.
STARTUP-HOOKS is a list of functions that Emacs calls without
arguments after setting up the Ediff buffers."
;; if buffer is non-nil, use that buffer instead of the current buffer
(interactive "P")
(if (not (stringp file))
@ -1434,7 +1501,7 @@ Uses `vc.el' or `rcs.el' depending on `ediff-version-control-package'."
'no-dirs)))
(find-file file)
(if (and (buffer-modified-p)
(y-or-n-p (format "Buffer %s is modified. Save buffer? "
(y-or-n-p (format "Buffer %s is modified. Save buffer? "
(buffer-name))))
(save-buffer (current-buffer)))
(let (rev1 rev2)
@ -1517,6 +1584,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-files-command ()
"Call `ediff-files' with the next two command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left)))
(setq command-line-args-left (nthcdr 2 command-line-args-left))
@ -1524,6 +1592,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff3-files-command ()
"Call `ediff3-files' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(file-c (nth 2 command-line-args-left)))
@ -1532,6 +1601,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-merge-command ()
"Call `ediff-merge-files' with the next two command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left)))
(setq command-line-args-left (nthcdr 2 command-line-args-left))
@ -1539,6 +1609,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-merge-with-ancestor-command ()
"Call `ediff-merge-files-with-ancestor' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(ancestor (nth 2 command-line-args-left)))
@ -1547,6 +1618,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-directories-command ()
"Call `ediff-directories' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(regexp (nth 2 command-line-args-left)))
@ -1555,6 +1627,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-directories3-command ()
"Call `ediff-directories3' with the next four command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(file-c (nth 2 command-line-args-left))
@ -1564,6 +1637,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-merge-directories-command ()
"Call `ediff-merge-directories' with the next three command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(regexp (nth 2 command-line-args-left)))
@ -1572,6 +1646,7 @@ With optional NODE, goes to that node."
;;;###autoload
(defun ediff-merge-directories-with-ancestor-command ()
"Call `ediff-merge-directories-with-ancestor' with the next four command line arguments."
(let ((file-a (nth 0 command-line-args-left))
(file-b (nth 1 command-line-args-left))
(ancestor (nth 2 command-line-args-left))

View file

@ -6465,8 +6465,9 @@ If this is an integer, `split-window-sensibly' may split a window
vertically only if it has at least this many lines. If this is
nil, `split-window-sensibly' is not allowed to split a window
vertically. If, however, a window is the only window on its
frame, `split-window-sensibly' may split it vertically
disregarding the value of this variable."
frame, or all the other ones are dedicated,
`split-window-sensibly' may split it vertically disregarding the
value of this variable."
:type '(choice (const nil) (integer :tag "lines"))
:version "23.1"
:group 'windows)
@ -6573,15 +6574,27 @@ split."
;; Split window horizontally.
(with-selected-window window
(split-window-right)))
(and (eq window (frame-root-window (window-frame window)))
(not (window-minibuffer-p window))
;; If WINDOW is the only window on its frame and is not the
;; minibuffer window, try to split it vertically disregarding
;; the value of `split-height-threshold'.
(let ((split-height-threshold 0))
(when (window-splittable-p window)
(with-selected-window window
(split-window-below))))))))
(and
;; If WINDOW is the only usable window on its frame (it is
;; the only one or, not being the only one, all the other
;; ones are dedicated) and is not the minibuffer window, try
;; to split it vertically disregarding the value of
;; `split-height-threshold'.
(let ((frame (window-frame window)))
(or
(eq window (frame-root-window frame))
(catch 'done
(walk-window-tree (lambda (w)
(unless (or (eq w window)
(window-dedicated-p w))
(throw 'done nil)))
frame)
t)))
(not (window-minibuffer-p window))
(let ((split-height-threshold 0))
(when (window-splittable-p window)
(with-selected-window window
(split-window-below))))))))
(defun window--try-to-split-window (window &optional alist)
"Try to split WINDOW.

View file

@ -49,13 +49,13 @@ will also be available at the Windows console.
** Download and install the necessary packages
Run msys2_shell.bat in your MSYS2 directory and you will see a BASH window
Run c:/msys64/msys2.exe in your MSYS2 directory and you will see a BASH window
opened.
In the BASH prompt, use the following command to install the necessary
packages (you can copy and paste it into the shell with Shift + Insert):
pacman -S base-devel \
pacman -S --needed base-devel \
mingw-w64-x86_64-toolchain \
mingw-w64-x86_64-xpm-nox \
mingw-w64-x86_64-libtiff \
@ -63,7 +63,7 @@ packages (you can copy and paste it into the shell with Shift + Insert):
mingw-w64-x86_64-libpng \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-librsvg \
mingw-w64-x86_64-liblcms2 \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libxml2 \
mingw-w64-x86_64-gnutls \
mingw-w64-x86_64-zlib
@ -126,7 +126,7 @@ Now you're ready to build and install Emacs with autogen, configure, make,
and make install.
First we need to switch to the MinGW-w64 environment. Exit the MSYS2 BASH
console and run mingw64_shell.bat in the C:\msys64 folder, then cd back to
console and run mingw64.exe in the C:\msys64 folder, then cd back to
your Emacs source directory, e.g.:
cd /c/emacs/emacs-26

View file

@ -1502,17 +1502,18 @@ extern void *__sbrk (ptrdiff_t increment);
static void *
gdefault_morecore (ptrdiff_t increment)
{
void *result;
#ifdef HYBRID_MALLOC
if (!DUMPED)
{
return bss_sbrk (increment);
}
#endif
result = (void *) __sbrk (increment);
if (result == (void *) -1)
return NULL;
return result;
#ifdef HAVE_SBRK
void *result = (void *) __sbrk (increment);
if (result != (void *) -1)
return result;
#endif
return NULL;
}
void *(*__morecore) (ptrdiff_t) = gdefault_morecore;

View file

@ -2422,6 +2422,8 @@ GnuTLS AEAD ciphers : the list will contain `AEAD-ciphers'. */)
#ifdef HAVE_GNUTLS
capabilities = Fcons (intern("gnutls"), capabilities);
# ifdef HAVE_GNUTLS3
capabilities = Fcons (intern("gnutls3"), capabilities);
capabilities = Fcons (intern("digests"), capabilities);

View file

@ -6661,7 +6661,7 @@ the return value is nil. Otherwise the value is t. */)
We have to do this in order to capture the following
scenario: Suppose our frame contains two live windows W1 and
W2 and set-window-configuration replaces them by two
W2 and 'set-window-configuration' replaces them by two
windows W3 and W4 that were dead the last time
run_window_size_change_functions was run. If W3 and W4 have
the same values for their old and new pixel sizes but these
@ -7617,8 +7617,8 @@ on their symbols to be controlled by this variable. */);
DEFVAR_LISP ("window-configuration-change-hook",
Vwindow_configuration_change_hook,
doc: /* Functions to call when window configuration changes.
The buffer-local part is run once per window, with the relevant window
selected; while the global part is run only once for the modified frame,
The buffer-local value is run once per window, with the relevant window
selected; while the global value is run only once for the modified frame,
with the relevant frame selected. */);
Vwindow_configuration_change_hook = Qnil;

View file

@ -13174,8 +13174,20 @@ hscroll_window_tree (Lisp_Object window)
/* If the position of this window's point has explicitly
changed, no more suspend auto hscrolling. */
if (NILP (Fequal (Fwindow_point (window), Fwindow_old_point (window))))
w->suspend_auto_hscroll = false;
if (w->suspend_auto_hscroll
&& NILP (Fequal (Fwindow_point (window),
Fwindow_old_point (window))))
{
w->suspend_auto_hscroll = false;
/* When hscrolling just the current line, and the rest
of lines were temporarily hscrolled, but no longer
are, force thorough redisplay of this window, to show
the effect of disabling hscroll suspension immediately. */
if (w->min_hscroll == 0 && w->hscroll > 0
&& EQ (Fbuffer_local_value (Qauto_hscroll_mode, w->contents),
Qcurrent_line))
SET_FRAME_GARBAGED (XFRAME (w->frame));
}
/* Remember window point. */
Fset_marker (w->old_pointm,
@ -32563,6 +32575,9 @@ display-start position.
These functions are called whenever the `window-start' marker is modified,
either to point into another buffer (e.g. via `set-window-buffer') or another
place in the same buffer.
When each function is called, the `window-start' marker of its window
argument has been already set to the new value, and the buffer which that
window will display is set to be the current buffer.
Note that the value of `window-end' is not valid when these functions are
called.

View file

@ -30,7 +30,7 @@ the directory structure of the source tree; so tests for files in the
Tests should normally reside in a file with ~-tests.el~ added to the
base-name of the tested source file; hence ~ert.el~ is tested in
~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As n
~ert-tests.el~, and ~pcase.el~ is tested in ~pcase-tests.el~. As an
exception, tests for a single feature may be placed into multiple
files of any name which are themselves placed in a directory named
after the feature with ~-tests~ appended, such as

View file

@ -42,5 +42,37 @@
(should (equal (buffer-string)
"test: "))))))
(ert-deftest completion-table-with-predicate-test ()
(let ((full-collection
'("apple" ; Has A.
"beet" ; Has B.
"banana" ; Has A & B.
"cherry" ; Has neither.
))
(no-A (lambda (x) (not (string-match-p "a" x))))
(no-B (lambda (x) (not (string-match-p "b" x)))))
(should
(member "cherry"
(completion-table-with-predicate
full-collection no-A t "" no-B t)))
(should-not
(member "banana"
(completion-table-with-predicate
full-collection no-A t "" no-B t)))
;; "apple" should still match when strict is nil.
(should (eq t (try-completion
"apple"
(apply-partially
'completion-table-with-predicate
full-collection no-A nil)
no-B)))
;; "apple" should still match when strict is nil and pred2 is nil
;; (Bug#27841).
(should (eq t (try-completion
"apple"
(apply-partially
'completion-table-with-predicate
full-collection no-A nil))))))
(provide 'completion-tests)
;;; completion-tests.el ends here

View file

@ -2290,7 +2290,7 @@ This tests also `file-directory-p' and `file-accessible-directory-p'."
;; Cleanup.
(ignore-errors
(delete-directory tmp-name1))))))
(delete-directory tmp-name1 'recursive))))))
(ert-deftest tramp-test17-insert-directory ()
"Check `insert-directory'."
@ -4432,23 +4432,27 @@ process sentinels. They shall not disturb each other."
"Check that Tramp is loaded lazily, only when needed."
;; Tramp is neither loaded at Emacs startup, nor when completing a
;; non-Tramp file name like "/foo". Completing a Tramp-alike file
;; name like "/foo:" autoloads Tramp.
;; name like "/foo:" autoloads Tramp, when `tramp-mode' is t.
(let ((code
"(progn \
(message \"Tramp loaded: %s\" (featurep 'tramp)) \
(setq tramp-mode %s) \
(message \"Tramp loaded: %%s\" (featurep 'tramp)) \
(file-name-all-completions \"/foo\" \"/\") \
(message \"Tramp loaded: %s\" (featurep 'tramp)) \
(message \"Tramp loaded: %%s\" (featurep 'tramp)) \
(file-name-all-completions \"/foo:\" \"/\") \
(message \"Tramp loaded: %s\" (featurep 'tramp)))"))
(should
(string-match
"Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: t[\n\r]+"
(shell-command-to-string
(format
"%s -batch -Q -L %s --eval %s"
(expand-file-name invocation-name invocation-directory)
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument code)))))))
(message \"Tramp loaded: %%s\" (featurep 'tramp)))"))
(dolist (tm '(t nil))
(should
(string-match
(format
"Tramp loaded: nil[\n\r]+Tramp loaded: nil[\n\r]+Tramp loaded: %s[\n\r]+"
tm)
(shell-command-to-string
(format
"%s -batch -Q -L %s --eval %s"
(expand-file-name invocation-name invocation-directory)
(mapconcat 'shell-quote-argument load-path " -L ")
(shell-quote-argument (format code tm)))))))))
(ert-deftest tramp-test43-unload ()
"Check that Tramp and its subpackages unload completely.

View file

@ -1,2 +1,4 @@
@arr = [1,2,3,4];
unknown;
my $b = @arr[1];
[

View file

@ -0,0 +1,5 @@
def bla
return 2
print "not reached"
something
oops

View file

@ -108,24 +108,23 @@ SEVERITY-PREDICATE is used to setup
(should (eq 'flymake-warning
(face-at-point)))))
(ert-deftest warning-predicate-rx-perl ()
"Test perl warning via regular expression predicate."
(ert-deftest perl-backend ()
"Test the perl backend"
(skip-unless (executable-find "perl"))
(flymake-tests--with-flymake
("test.pl" :severity-predicate "^Scalar value")
(flymake-tests--with-flymake ("test.pl")
(flymake-goto-next-error)
(should (eq 'flymake-warning
(face-at-point)))))
(should (eq 'flymake-warning (face-at-point)))
(flymake-goto-next-error)
(should (eq 'flymake-error (face-at-point)))))
(ert-deftest warning-predicate-function-perl ()
"Test perl warning via function predicate."
(skip-unless (executable-find "perl"))
(flymake-tests--with-flymake
("test.pl" :severity-predicate
(lambda (msg) (string-match "^Scalar value" msg)))
(ert-deftest ruby-backend ()
"Test the ruby backend"
(skip-unless (executable-find "ruby"))
(flymake-tests--with-flymake ("test.rb")
(flymake-goto-next-error)
(should (eq 'flymake-warning
(face-at-point)))))
(should (eq 'flymake-warning (face-at-point)))
(flymake-goto-next-error)
(should (eq 'flymake-error (face-at-point)))))
(ert-deftest different-diagnostic-types ()
"Test GCC warning via function predicate."