Merge commit 'de238b39e335c6814283faa171b35145f124edf2'

This commit is contained in:
Stephen Leake 2019-04-11 14:00:02 -07:00
commit 7ba7def5ca
135 changed files with 3477 additions and 2458 deletions

View file

@ -1,6 +1,7 @@
((nil . ((tab-width . 8)
(sentence-end-double-space . t)
(fill-column . 70)))
(fill-column . 70)
(bug-reference-url-format . "https://debbugs.gnu.org/%s")))
(c-mode . ((c-file-style . "GNU")
(c-noise-macro-names . ("INLINE" "ATTRIBUTE_NO_SANITIZE_UNDEFINED" "UNINIT" "CALLBACK" "ALIGN_STACK"))
(electric-quote-comment . nil)
@ -12,8 +13,7 @@
(log-edit-setup-add-author . t)))
(change-log-mode . ((add-log-time-zone-rule . t)
(fill-column . 74)
(bug-reference-url-format . "https://debbugs.gnu.org/%s")
(mode . bug-reference)))
(eval . (bug-reference-mode))))
(diff-mode . ((mode . whitespace)))
(emacs-lisp-mode . ((indent-tabs-mode . nil)
(electric-quote-comment . nil)

1
.gitignore vendored
View file

@ -185,7 +185,6 @@ src/bootstrap-emacs
src/emacs
src/emacs-[0-9]*
src/temacs
src/temacs.in
src/fingerprint.c
src/dmpstruct.h
src/*.pdmp

View file

@ -537,19 +537,21 @@ fi)
AC_ARG_ENABLE(checking,
[AS_HELP_STRING([--enable-checking@<:@=LIST@:>@],
[enable expensive run-time checks. With LIST,
[enable expensive checks. With LIST,
enable only specific categories of checks.
Categories are: all,yes,no.
Flags are: stringbytes, stringoverrun, stringfreelist,
xmallocoverrun, conslist, glyphs])],
structs, xmallocoverrun, conslist, glyphs])],
[ac_checking_flags="${enableval}"],[])
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="$IFS,"
CHECK_STRUCTS=false
for check in $ac_checking_flags
do
case $check in
# these set all the flags to specific states
yes) ac_enable_checking=1 ;;
no) ac_enable_checking= ;
CHECK_STRUCTS=false
ac_gc_check_stringbytes= ;
ac_gc_check_string_overrun= ;
ac_gc_check_string_free_list= ;
@ -557,6 +559,7 @@ do
ac_gc_check_cons_list= ;
ac_glyphs_debug= ;;
all) ac_enable_checking=1 ;
CHECK_STRUCTS=true
ac_gc_check_stringbytes=1 ;
ac_gc_check_string_overrun=1 ;
ac_gc_check_string_free_list=1 ;
@ -567,6 +570,7 @@ do
stringbytes) ac_gc_check_stringbytes=1 ;;
stringoverrun) ac_gc_check_string_overrun=1 ;;
stringfreelist) ac_gc_check_string_free_list=1 ;;
structs) CHECK_STRUCTS=true ;;
xmallocoverrun) ac_xmalloc_overrun=1 ;;
conslist) ac_gc_check_cons_list=1 ;;
glyphs) ac_glyphs_debug=1 ;;
@ -579,6 +583,15 @@ if test x$ac_enable_checking != x ; then
AC_DEFINE(ENABLE_CHECKING, 1,
[Define to 1 if expensive run-time data type and consistency checks are enabled.])
fi
if $CHECK_STRUCTS; then
AC_DEFINE([CHECK_STRUCTS], 1,
[Define this to check whether someone updated the portable dumper
code after changing the layout of a structure that it uses.
If you change one of these structures, check that the pdumper.c
code is still valid, and update the pertinent hash in pdumper.c
by manually copying the hash from the newly-generated dmpstruct.h.])
fi
AC_SUBST([CHECK_STRUCTS])
if test x$ac_gc_check_stringbytes != x ; then
AC_DEFINE(GC_CHECK_STRING_BYTES, 1,
[Define this temporarily to hunt a bug. If defined, the size of

View file

@ -1484,7 +1484,7 @@ Stevens, Andy Stewart, Jonathan Stigelman, Martin Stjernholm, Kim F.
Storm, Steve Strassmann, Christopher Suckling, Olaf Sylvester, Naoto
Takahashi, Steven Tamm, Jan Tatarik, Luc Teirlinck, Jean-Philippe Theberge, Jens
T. Berger Thielemann, Spencer Thomas, Jim Thompson, Toru Tomabechi,
David O'Toole, Markus Triska, Tom Tromey, Enami Tsugutomo, Eli
David O'Toole, Markus Triska, Tom Tromey, Eli
Tziperman, Daiki Ueno, Masanobu Umeda, Rajesh Vaidheeswarran, Neil
W. Van Dyke, Didier Verna, Joakim Verona, Ulrik Vieth, Geoffrey
Voelker, Johan Vromans, Inge Wallin, John Paul Wallington, Colin

View file

@ -2577,11 +2577,11 @@ The quick brown fox jum @point{}ped.
@end example
@end deffn
@deffn Command indent-relative-maybe
@deffn Command indent-relative-first-indent-point
@comment !!SourceFile indent.el
This command indents the current line like the previous nonblank line,
by calling @code{indent-relative} with @code{t} as the
@var{unindented-ok} argument. The return value is unpredictable.
@var{first-only} argument. The return value is unpredictable.
If the previous nonblank line has no indent points beyond the current
column, this command does nothing.

View file

@ -1951,7 +1951,13 @@ The optional argument @var{all-frames} has the same meaning as in
@code{next-window}.
This function does not select a window that has a non-@code{nil}
@code{no-other-window} window parameter (@pxref{Window Parameters}).
@code{no-other-window} window parameter (@pxref{Window Parameters}),
provided that @code{ignore-window-parameters} is @code{nil}.
If the @code{other-window} parameter of the selected window is a
function, and @code{ignore-window-parameters} is @code{nil}, that
function will be called with the arguments @var{count} and
@var{all-frames} instead of the normal operation of this function.
@end deffn
@defun walk-windows fun &optional minibuf all-frames
@ -3936,8 +3942,33 @@ described next to deal with the window and its buffer.
This function handles @var{window} and its buffer after quitting. The
optional argument @var{window} must be a live window and defaults to
the selected one. The function's behavior is determined by the four
elements of the @code{quit-restore} window parameter (@pxref{Window
Parameters}), which is set to @code{nil} afterwards.
elements of the list specified by the @code{quit-restore} window
parameter (@pxref{Window Parameters}), which is set to @code{nil}
afterwards.
The first element of the @code{quit-restore} parameter is one of the
symbols @code{window}, meaning that the window has been specially
created by @code{display-buffer}; @code{frame}, a separate frame has
been created; @code{same}, the window has only ever displayed this
buffer; or @code{other}, the window showed another buffer before.
@code{frame} and @code{window} affect how the window is quit, while
@code{same} and @code{other} affect the redisplay of buffers
previously shown in this window.
The second element is either one of the symbols @code{window} or
@code{frame}, or a list whose elements are the buffer shown in the
window before, that buffer's window start and window point positions,
and the window's height at that time. If that buffer is still live
when the window is quit, then the function @code{quit-restore-window}
reuses the window to display the buffer.
The third element is the window selected at the time the parameter was
created. If @code{quit-restore-window} deletes the window passed to
it as argument, it then tries to reselect this window.
The fourth element is the buffer whose display caused the creation of
this parameter. @code{quit-restore-window} deletes the specified window
only if it still shows that buffer.
The window is deleted entirely if: 1) the first element of the
@code{quit-restore} parameter is one of 'window or 'frame, 2) the
@ -4627,13 +4658,14 @@ This function sets the display-start position of @var{window} to
@var{position} in @var{window}'s buffer. It returns @var{position}.
The display routines insist that the position of point be visible when a
buffer is displayed. Normally, they change the display-start position
(that is, scroll the window) whenever necessary to make point visible.
However, if you specify the start position with this function using
@code{nil} for @var{noforce}, it means you want display to start at
@var{position} even if that would put the location of point off the
screen. If this does place point off screen, the display routines move
point to the left margin on the middle line in the window.
buffer is displayed. Normally, they select the display-start position
according to their internal logic (and scroll the window if necessary)
to make point visible. However, if you specify the start position
with this function using @code{nil} for @var{noforce}, it means you
want display to start at @var{position} even if that would put the
location of point off the screen. If this does place point off
screen, the display routines attempt to move point to the left margin
on the middle line in the window.
For example, if point @w{is 1} and you set the start of the window
@w{to 37}, the start of the next line, point will be above the top
@ -4680,6 +4712,13 @@ it is still 1 when redisplay occurs. Here is an example:
@end group
@end example
If the attempt to make point visible (i.e., in a fully-visible screen
line) fails, the display routines will disregard the requested
window-start position and compute a new one anyway. Thus, for
reliable results Lisp programs that call this function should always
move point to be inside the window whose display starts at
@var{position}.
If @var{noforce} is non-@code{nil}, and @var{position} would place point
off screen at the next redisplay, then redisplay computes a new window-start
position that works well with point, and thus @var{position} is not used.
@ -5796,8 +5835,8 @@ and heights, if possible. Frames are not resized by this function.
@section Window Parameters
@cindex window parameters
This section describes how window parameters can be used to associate
additional information with windows.
This section describes the window parameters that can be used to
associate additional information with windows.
@defun window-parameter window parameter
This function returns @var{window}'s value for @var{parameter}. The
@ -5930,44 +5969,21 @@ parameter is installed and updated by the function
@vindex quit-restore@r{, a window parameter}
This parameter is installed by the buffer display functions
(@pxref{Choosing Window}) and consulted by @code{quit-restore-window}
(@pxref{Quitting Windows}). It contains four elements:
(@pxref{Quitting Windows}). It is a list of four elements, see the
description of @code{quit-restore-window} in @ref{Quitting Windows}
for details.
The first element is one of the symbols @code{window}, meaning that
the window has been specially created by @code{display-buffer};
@code{frame}, a separate frame has been created; @code{same}, the
window has only ever displayed this buffer; or @code{other}, the
window showed another buffer before. @code{frame} and @code{window}
affect how the window is quit, while @code{same} and @code{other}
affect the redisplay of buffers previously shown in this window.
The second element is either one of the symbols @code{window} or
@code{frame}, or a list whose elements are the buffer shown in the
window before, that buffer's window start and window point positions,
and the window's height at that time. If that buffer is still live
when the window is quit, then the function @code{quit-restore-window}
reuses the window to display the buffer.
The third element is the window selected at the time the parameter was
created. If @code{quit-restore-window} deletes the window passed to
it as argument, it then tries to reselect this window.
The fourth element is the buffer whose display caused the creation of
this parameter. @code{quit-restore-window} deletes the specified window
only if it still shows that buffer.
See the description of @code{quit-restore-window} in @ref{Quitting
Windows} for details.
@item window-side window-slot
@item window-side
@itemx window-slot
@vindex window-side@r{, a window parameter}
@vindex window-slot@r{, a window parameter}
These parameters are used for implementing side windows (@pxref{Side
Windows}).
These parameters are used internally for implementing side windows
(@pxref{Side Windows}).
@item window-atom
@vindex window-atom@r{, a window parameter}
This parameter is used for implementing atomic windows, see @ref{Atomic
Windows}.
This parameter is used internally for implementing atomic windows, see
@ref{Atomic Windows}.
@item mode-line-format
@vindex mode-line-format@r{, a window parameter}
@ -5989,11 +6005,12 @@ affected.
@item min-margins
@vindex min-margins@r{, a window parameter}
The value of this parameter is a cons cell whose @sc{car} and @sc{cdr},
if non-@code{nil}, specify the minimum values (in columns) for the left
and right margin of this window. When present, Emacs will use these
values instead of the actual margin widths for determining whether a
window can be split or shrunk horizontally.
The value of this parameter is a cons cell whose @sc{car} and
@sc{cdr}, if non-@code{nil}, specify the minimum values (in columns)
for the left and right margin of this window (@pxref{Display Margins}.
When present, Emacs will use these values instead of the actual margin
widths for determining whether a window can be split or shrunk
horizontally.
Emacs never auto-adjusts the margins of any window after splitting or
resizing it. It is the sole responsibility of any application setting

View file

@ -88,11 +88,11 @@ framework for writing object-oriented applications in Emacs.
use @eieio{} to create classes, methods for those classes, and
instances of classes.
Here is a simple example of a class named @code{record}, containing
Here is a simple example of a class named @code{person}, containing
three slots named @code{name}, @code{birthday}, and @code{phone}:
@example
(defclass record () ; No superclasses
(defclass person () ; No superclasses
((name :initarg :name
:initform ""
:type string
@ -106,23 +106,23 @@ three slots named @code{name}, @code{birthday}, and @code{phone}:
(phone :initarg :phone
:initform ""
:documentation "Phone number."))
"A single record for tracking people I know.")
"A class for tracking people I know.")
@end example
Each class can have methods, which are defined like this:
@example
(cl-defmethod call-record ((rec record) &optional scriptname)
"Dial the phone for the record REC.
(cl-defmethod call-person ((pers person) &optional scriptname)
"Dial the phone for the person PERS.
Execute the program SCRIPTNAME to dial the phone."
(message "Dialing the phone for %s" (oref rec name))
(message "Dialing the phone for %s" (oref pers name))
(shell-command (concat (or scriptname "dialphone.sh")
" "
(oref rec phone))))
(oref pers phone))))
@end example
@noindent
In this example, the first argument to @code{call-record} is a list,
In this example, the first argument to @code{call-person} is a list,
of the form (@var{varname} @var{classname}). @var{varname} is the
name of the variable used for the first argument; @var{classname} is
the name of the class that is expected as the first argument for this
@ -130,17 +130,17 @@ method.
@eieio{} dispatches methods based on the type of the first argument.
You can have multiple methods with the same name for different classes
of object. When the @code{call-record} method is called, the first
of object. When the @code{call-person} method is called, the first
argument is examined to determine the class of that argument, and the
method matching the input type is then executed.
Once the behavior of a class is defined, you can create a new
object of type @code{record}. Objects are created by calling the
object of type @code{person}. Objects are created by calling the
constructor. The constructor is a function with the same name as your
class which returns a new instance of that class. Here is an example:
@example
(setq rec (record :name "Eric" :birthday "June" :phone "555-5555"))
(setq pers (person :name "Eric" :birthday "June" :phone "555-5555"))
@end example
@noindent
@ -157,19 +157,19 @@ first argument should be an object of a class which has had this
method defined for it. In this example it would look like this:
@example
(call-record rec)
(call-person pers)
@end example
@noindent
or
@example
(call-record rec "my-call-script")
(call-person pers "my-call-script")
@end example
In these examples, @eieio{} automatically examines the class of
@code{rec}, and ensures that the method defined above is called. If
@code{rec} is some other class lacking a @code{call-record} method, or
@code{pers}, and ensures that the method defined above is called. If
@code{pers} is some other class lacking a @code{call-person} method, or
some other data type, Emacs signals a @code{cl-no-applicable-method}
error. @ref{Signals}.
@ -270,10 +270,18 @@ by a symbol with the name @var{class-name}. @eieio{} stores the structure of
the class as a symbol property of @var{class-name} (@pxref{Symbol
Components,,,elisp,GNU Emacs Lisp Reference Manual}).
When defining a class, @eieio{} overwrites any preexisting variable or
function bindings for the symbol @var{class-name}, which may lead to
undesired consequences. Before naming a new class, you should check
for name conflicts. To help avoid cross-package conflicts you should
choose a name with the same prefix you chose for the rest of your
package's functions and variables (@pxref{Coding
Conventions,,,elisp,GNU Emacs Lisp Reference Manual}).
The @var{class-name} symbol's variable documentation string is a
modified version of the doc string found in @var{options-and-doc}.
Each time a method is defined, the symbol's documentation string is
updated to include the methods documentation as well.
updated to include the method's documentation as well.
The parent classes for @var{class-name} is @var{superclass-list}.
Each element of @var{superclass-list} must be a class. These classes
@ -625,10 +633,10 @@ function of @code{:initform}.
@node Making New Objects
@chapter Making New Objects
Suppose we have a simple class is defined, such as:
Suppose we have defined a simple class, such as:
@example
(defclass record ()
(defclass my-class ()
( ) "Doc String")
@end example
@ -636,10 +644,10 @@ Suppose we have a simple class is defined, such as:
It is now possible to create objects of that class type.
Calling @code{defclass} has defined two new functions. One is the
constructor @var{record}, and the other is the predicate,
@var{record}-p.
constructor @var{my-class}, and the other is the predicate,
@var{my-class}-p.
@defun record object-name &rest slots
@defun my-class object-name &rest slots
This creates and returns a new object. This object is not assigned to
anything, and will be garbage collected if not saved. This object
@ -657,7 +665,7 @@ can do any valid Lispy thing you want with it, such as
Example of creating an object from a class:
@example
(record :value 3 :reference nil)
(my-class :value 3 :reference nil)
@end example
@end defun

View file

@ -2671,7 +2671,7 @@ name syntax. Its value changes after every call of
this variable in external packages, a call of @code{file-remote-p} is
much more appropriate.
@ifinfo
@pxref{Magic File Names, , , elisp}
@pxref{Magic File Names, , , elisp}.
@end ifinfo
@end defvar
@end ifset
@ -3010,7 +3010,7 @@ Starting with Emacs 26, you could use connection-local variables for
setting different values of @code{explicit-shell-file-name} for
different remote hosts.
@ifinfo
@xref{Connection Variables, , , emacs}
@xref{Connection Variables, , , emacs}.
@end ifinfo
@lisp
@ -3720,7 +3720,7 @@ Set @code{file-precious-flag} to @code{t} for files accessed by
@value{tramp} so the file contents are checked using checksum by
first saving to a temporary file.
@ifinfo
@pxref{Saving Buffers, , , elisp}
@pxref{Saving Buffers, , , elisp}.
@end ifinfo
@lisp

View file

@ -84,6 +84,11 @@ The new command-line argument '--dump-file=FILE' allows to specify a
non-default '.pdmp' file to load the state from; see the node "Initial
Options" in the Emacs manual for more information.
+++
** The new configure option '--enable-checking=structs' attempts to
check that the portable dumper code has been updated to match the last
change to one of the data structures that it relies on.
* Startup Changes in Emacs 27.1
@ -1234,6 +1239,12 @@ the 128...255 range, as expected.
This allows to create and parent immediately a minibuffer-only child
frame when making a frame.
---
*** New predicates 'display-blink-cursor-p' and 'display-symbol-keys-p'.
These predicates are to be preferred over 'display-graphic-p' when
testing for blinking cursor capability and the capability to have
symbols (e.g., [return], [tab], [backspace]) as keys respectively.
** Tabulated List mode
+++
@ -1250,6 +1261,89 @@ near the current column in Tabulated Lists (see variables
+++
*** 'text-mode-variant' is now obsolete, use 'derived-mode-p' instead.
** CUA mode
---
*** New defcustom 'cua-rectangle-terminal-modifier-key'.
This defcustom allows for the customization of the modifier key used
in a terminal frame.
** JS mode
---
*** JSX syntax is now automatically detected and enabled.
If a file imports Facebook's 'React' library, or if the file uses the
extension '.jsx', then various features supporting XML-like syntax
will be supported in 'js-mode' and derivative modes. ('js-jsx-mode'
no longer needs to be enabled.)
---
*** New defcustom 'js-jsx-detect-syntax' disables automatic detection.
This is turned on by default.
---
*** New defcustom 'js-jsx-syntax' enables JSX syntax unconditionally.
This is off by default.
---
*** New variable 'js-jsx-regexps' controls JSX detection.
---
*** JSX syntax is now highlighted like SGML.
---
*** JSX code is properly indented in many more scenarios.
Previously, JSX indentation usually only worked when an element was
wrapped in parenthesis (e.g. in a 'return' statement or a function
call). It would also fail in many intricate cases. Now, indentation
should work anywhere without parenthesis; many more intricacies are
supported; and, indentation conventions align more closely with those
of the React developer community (see 'js-jsx-align->-with-<'),
otherwise still adhering to SGML conventions.
---
*** New defcustom 'js-jsx-align->-with-<' controls '>' indents.
Commonly in JSX code, a '>' on its own line is indented at the same
level as its opening '<'. This is the new default for JSX. This
behavior is slightly different than that used by SGML in Emacs, where
'>' is indented at the same level as attributes, which was also the
old default for JSX.
This is turned on by default. To get back the old default indentation
behavior of aligning '>' with attributes, set 'js-jsx-align->-with-<'
to nil.
---
*** Indentation uses 'js-indent-level' instead of 'sgml-basic-offset'.
Since JSX is a syntax extension of JavaScript, it makes the most sense
for JSX expressions to be indented the same number of spaces as other
JS expressions. This is a breaking change, but it probably aligns
with how you'd expect this indentation to behave. If you want JSX to
be indented like JS, you won't need to change your config.
The old behavior can be emulated by controlling JSX indentation
independently of JS, by setting 'js-jsx-indent-level'.
---
*** New defcustom 'js-jsx-indent-level' for different JSX indentation.
If you wish to indent JSX by a different number of spaces than JS, set
this variable to the desired number.
---
*** New defcustom 'js-jsx-attribute-offset' for JSX attribute indents.
---
*** New variable 'js-syntactic-mode-name' controls mode name display.
Previously, the mode name was simply 'JavaScript'. Now, when a syntax
extension like JSX is enabled, the mode name is 'JavaScript[JSX]'.
Set this variable to nil to disable the new behavior.
---
*** New function 'js-use-syntactic-mode-name' for deriving modes.
Packages deriving from 'js-mode' with 'define-derived-mode' should
call this function to add enabled syntax extensions to their mode
name, too.
* New Modes and Packages in Emacs 27.1

View file

@ -89,7 +89,7 @@ main (int argc, char **argv)
fclose (f);
}
uint8_t digest[32];
unsigned char digest[32];
sha256_finish_ctx (&ctx, digest);
if (raw)
@ -99,12 +99,12 @@ main (int argc, char **argv)
}
else
{
printf ("#include \"fingerprint.h\"\n");
printf ("\n");
printf ("const uint8_t fingerprint[32] = { ");
puts ("#include \"fingerprint.h\"\n"
"unsigned char const fingerprint[] =\n"
"{");
for (int i = 0; i < 32; ++i)
printf ("%s0x%02X", i ? ", " : "", digest[i]);
printf (" };\n");
printf ("\t0x%02X,\n", digest[i]);
puts ("};");
}
return EXIT_SUCCESS;

View file

@ -343,10 +343,11 @@ This has been reported by a file notification event.")
;; Functions:
(defun auto-revert-remove-current-buffer ()
"Remove dead buffer from `auto-revert-buffer-list'."
(defun auto-revert-remove-current-buffer (&optional buffer)
"Remove BUFFER from `auto-revert-buffer-list'.
BUFFER defaults to `current-buffer'."
(setq auto-revert-buffer-list
(delq (current-buffer) auto-revert-buffer-list)))
(delq (or buffer (current-buffer)) auto-revert-buffer-list)))
;;;###autoload
(define-minor-mode auto-revert-mode
@ -464,7 +465,7 @@ If `global-auto-revert-non-file-buffers' is non-nil, this mode
may also revert some non-file buffers, as described in the
documentation of that variable. It ignores buffers with modes
matching `global-auto-revert-ignore-modes', and buffers with a
non-nil vale of `global-auto-revert-ignore-buffer'.
non-nil value of `global-auto-revert-ignore-buffer'.
When a buffer is reverted, a message is generated. This can be
suppressed by setting `auto-revert-verbose' to nil.
@ -509,7 +510,7 @@ will use an up-to-date value of `auto-revert-interval'"
(ignore-errors
(file-notify-rm-watch auto-revert-notify-watch-descriptor)))))
auto-revert-notify-watch-descriptor-hash-list)
(remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch))
(remove-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch t))
(setq auto-revert-notify-watch-descriptor nil
auto-revert-notify-modified-p nil))
@ -772,10 +773,12 @@ the timer when no buffers need to be checked."
(setq bufs (delq nil
(mapcar
(lambda (buf)
(with-current-buffer buf
(and (or (not (file-remote-p default-directory))
(file-remote-p default-directory nil t))
buf)))
(and (buffer-live-p buf)
(with-current-buffer buf
(and
(or (not (file-remote-p default-directory))
(file-remote-p default-directory nil t))
buf))))
bufs)))
;; Partition `bufs' into two halves depending on whether or not
;; the buffers are in `auto-revert-remaining-buffers'. The two
@ -792,24 +795,23 @@ the timer when no buffers need to be checked."
(not (and auto-revert-stop-on-user-input
(input-pending-p))))
(let ((buf (car bufs)))
(with-current-buffer buf
(if (buffer-live-p buf)
(progn
;; Test if someone has turned off Auto-Revert Mode
;; in a non-standard way, for example by changing
;; major mode.
(if (and (not auto-revert-mode)
(not auto-revert-tail-mode)
(memq buf auto-revert-buffer-list))
(auto-revert-remove-current-buffer))
(when (auto-revert-active-p)
;; Enable file notification.
(when (and auto-revert-use-notify
(not auto-revert-notify-watch-descriptor))
(auto-revert-notify-add-watch))
(auto-revert-handler)))
(if (not (buffer-live-p buf))
;; Remove dead buffer from `auto-revert-buffer-list'.
(auto-revert-remove-current-buffer))))
(auto-revert-remove-current-buffer buf)
(with-current-buffer buf
;; Test if someone has turned off Auto-Revert Mode
;; in a non-standard way, for example by changing
;; major mode.
(if (and (not auto-revert-mode)
(not auto-revert-tail-mode)
(memq buf auto-revert-buffer-list))
(auto-revert-remove-current-buffer))
(when (auto-revert-active-p)
;; Enable file notification.
(when (and auto-revert-use-notify
(not auto-revert-notify-watch-descriptor))
(auto-revert-notify-add-watch))
(auto-revert-handler)))))
(setq bufs (cdr bufs)))
(setq auto-revert-remaining-buffers bufs)
;; Check if we should cancel the timer.

View file

@ -382,10 +382,12 @@ Also see `make-text-button'."
If the button at POS is a text property button, the return value
is a marker pointing to POS."
(let ((button (get-char-property pos 'button)))
(if (or (overlayp button) (null button))
button
;; Must be a text-property button; return a marker pointing to it.
(copy-marker pos t))))
(and button (get-char-property pos 'category)
(if (overlayp button)
button
;; Must be a text-property button;
;; return a marker pointing to it.
(copy-marker pos t)))))
(defun next-button (pos &optional count-current)
"Return the next button after position POS in the current buffer.

View file

@ -856,6 +856,19 @@ QUOTE may be `may' (value may be quoted),
`',(cdr el) (cdr el)))
pass1)))
(cons 'may `[,@(mapcar #'cdr pass1)]))))
((and (recordp value) (symbolp (aref value 0)))
(let* ((pass1 (let ((res ()))
(dotimes (i (length value))
(push (desktop--v2s (aref value i)) res))
(nreverse res)))
(special (assq nil pass1)))
(if special
(cons nil `(record
,@(mapcar (lambda (el)
(if (eq (car el) 'must)
`',(cdr el) (cdr el)))
pass1)))
(cons 'may (apply #'record (mapcar #'cdr pass1))))))
((consp value)
(let ((p value)
newlist

View file

@ -774,6 +774,15 @@ as an argument to `dired-goto-file'."
(file-name-as-directory (abbreviate-file-name filename))
(abbreviate-file-name filename)))))
(defun dired-grep-read-files ()
"Use file at point as the file for grep's default file-name pattern suggestion.
If a directory or nothing is found at point, return nil."
(let ((file-name (dired-file-name-at-point)))
(if (and file-name
(not (file-directory-p file-name)))
file-name)))
(put 'dired-mode 'grep-read-files 'dired-grep-read-files)
;;;###autoload (define-key ctl-x-map "d" 'dired)
;;;###autoload
(defun dired (dirname &optional switches)
@ -1269,8 +1278,8 @@ If HDR is non-nil, insert a header line with the directory name."
;; as indicated by `ls-lisp-use-insert-directory-program'.
(not (and (featurep 'ls-lisp)
(null ls-lisp-use-insert-directory-program)))
(not (and (featurep 'eshell)
(bound-and-true-p eshell-ls-use-in-dired)))
;; FIXME: Big ugly hack for Eshell's eshell-ls-use-in-dired.
(not (bound-and-true-p eshell-ls-use-in-dired))
(or (file-remote-p dir)
(if (eq dired-use-ls-dired 'unspecified)
;; Check whether "ls --dired" gives exit code 0, and

View file

@ -175,8 +175,8 @@ in the default way after this call."
(defun standard-display-g1 (c sc)
"Display character C as character SC in the g1 character set.
This function assumes that your terminal uses the SO/SI characters;
it is meaningless for an X frame."
(if (memq window-system '(x w32 ns))
it is meaningless for a graphical frame."
(if (display-graphic-p)
(error "Cannot use string glyphs in a windowing system"))
(or standard-display-table
(setq standard-display-table (make-display-table)))
@ -186,9 +186,9 @@ it is meaningless for an X frame."
;;;###autoload
(defun standard-display-graphic (c gc)
"Display character C as character GC in graphics character set.
This function assumes VT100-compatible escapes; it is meaningless for an
X frame."
(if (memq window-system '(x w32 ns))
This function assumes VT100-compatible escapes; it is meaningless
for a graphical frame."
(if (display-graphic-p)
(error "Cannot use string glyphs in a windowing system"))
(or standard-display-table
(setq standard-display-table (make-display-table)))
@ -276,7 +276,7 @@ in `.emacs'."
(progn
(standard-display-default
(unibyte-char-to-multibyte 160) (unibyte-char-to-multibyte 255))
(unless (or (memq window-system '(x w32 ns)))
(unless (display-graphic-p)
(and (terminal-coding-system)
(set-terminal-coding-system nil))))
@ -289,7 +289,7 @@ in `.emacs'."
;; unless some other has been specified.
(if (equal current-language-environment "English")
(set-language-environment "latin-1"))
(unless (or noninteractive (memq window-system '(x w32 ns)))
(unless (or noninteractive (display-graphic-p))
;; Send those codes literally to a character-based terminal.
;; If we are using single-byte characters,
;; it doesn't matter which coding system we use.

View file

@ -52,7 +52,7 @@
(defcustom elide-head-headers-to-hide
'(("is free software[:;] you can redistribute it" . ; GNU boilerplate
"\\(Boston, MA 0211\\(1-1307\\|0-1301\\), USA\\|\
If not, see <http://www\\.gnu\\.org/licenses/>\\)\\.")
If not, see <https?://www\\.gnu\\.org/licenses/>\\)\\.")
("The Regents of the University of California\\. All rights reserved\\." .
"SUCH DAMAGE\\.") ; BSD
("Permission is hereby granted, free of charge" . ; X11

View file

@ -36,6 +36,11 @@
;;; Code:
;; The autoloads.el mechanism which adds package--builtin-versions
;; maintenance to loaddefs.el doesn't work for preloaded packages (such
;; as this one), so we have to do it by hand!
(push (purecopy '(nadvice 1 0)) package--builtin-versions)
;;;; Lightweight advice/hook
(defvar advice--where-alist
'((:around "\300\301\302\003#\207" 5)
@ -241,6 +246,8 @@ different, but `function-equal' will hopefully ignore those differences.")
(if (local-variable-p var) (symbol-value var)
(setq advice--buffer-local-function-sample
;; This function acts like the t special value in buffer-local hooks.
;; FIXME: Provide an `advice-bottom' function that's like
;; `advice-cd*r' but also follows through this proxy.
(lambda (&rest args) (apply (default-value var) args)))))
(eval-and-compile

View file

@ -427,7 +427,7 @@ and after the region marked by the rectangle to search."
(defcustom cua-rectangle-modifier-key 'meta
"Modifier key used for rectangle commands bindings.
On non-window systems, always use the meta modifier.
On non-window systems, use `cua-rectangle-terminal-modifier-key'.
Must be set prior to enabling CUA."
:type '(choice (const :tag "Meta key" meta)
(const :tag "Alt key" alt)
@ -435,6 +435,16 @@ Must be set prior to enabling CUA."
(const :tag "Super key" super))
:group 'cua)
(defcustom cua-rectangle-terminal-modifier-key 'meta
"Modifier key used for rectangle commands bindings in terminals.
Must be set prior to enabling CUA."
:type '(choice (const :tag "Meta key" meta)
(const :tag "Alt key" alt)
(const :tag "Hyper key" hyper)
(const :tag "Super key" super))
:group 'cua
:version "27.1")
(defcustom cua-enable-rectangle-auto-help t
"If non-nil, automatically show help for region, rectangle and global mark."
:type 'boolean
@ -1237,10 +1247,9 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(defun cua--init-keymaps ()
;; Cache actual rectangle modifier key.
(setq cua--rectangle-modifier-key
(if (and cua-rectangle-modifier-key
(memq window-system '(x)))
cua-rectangle-modifier-key
'meta))
(if (eq (framep (selected-frame)) t)
cua-rectangle-terminal-modifier-key
cua-rectangle-modifier-key))
;; C-return always toggles rectangle mark
(define-key cua-global-keymap cua-rectangle-mark-key 'cua-set-rectangle-mark)
(unless (eq cua--rectangle-modifier-key 'meta)

View file

@ -90,7 +90,7 @@
;;; Code:
(require 'eshell)
(require 'esh-mode)
;;;###autoload
(progn
@ -141,12 +141,12 @@ file named by `eshell-aliases-file'.")
(defvar eshell-failed-commands-alist nil
"An alist of command name failures.")
(defun eshell-alias-initialize ()
(defun eshell-alias-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the alias handling code."
(make-local-variable 'eshell-failed-commands-alist)
(add-hook 'eshell-alternate-command-hook 'eshell-fix-bad-commands t t)
(add-hook 'eshell-alternate-command-hook #'eshell-fix-bad-commands t t)
(eshell-read-aliases-list)
(add-hook 'eshell-named-command-hook 'eshell-maybe-replace-by-alias t t)
(add-hook 'eshell-named-command-hook #'eshell-maybe-replace-by-alias t t)
(make-local-variable 'eshell-complex-commands)
(add-to-list 'eshell-complex-commands 'eshell-command-aliased-p))

View file

@ -71,7 +71,7 @@ This can be any sexp, and should end with at least two newlines."
:type 'hook
:group 'eshell-banner)
(defun eshell-banner-initialize ()
(defun eshell-banner-initialize () ;Called from `eshell-mode' via intern-soft!
"Output a welcome banner on initialization."
;; it's important to use `eshell-interactive-print' rather than
;; `insert', because `insert' doesn't know how to interact with the

View file

@ -244,7 +244,7 @@ to writing a completion function."
(let ((completion-at-point-functions '(lisp-completion-at-point)))
(completion-at-point)))
(defun eshell-cmpl-initialize ()
(defun eshell-cmpl-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the completions module."
(set (make-local-variable 'pcomplete-command-completion-function)
eshell-command-completion-function)

View file

@ -42,7 +42,8 @@
;;; Code:
(require 'eshell)
(require 'esh-mode) ;For eshell-directory-name
(require 'esh-var) ;For eshell-variable-aliases-list
(require 'ring)
(require 'esh-opt)
@ -169,7 +170,7 @@ Thus, this does not include the current directory.")
;;; Functions:
(defun eshell-dirs-initialize ()
(defun eshell-dirs-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the builtin functions for Eshell."
(make-local-variable 'eshell-variable-aliases-list)
(setq eshell-variable-aliases-list

View file

@ -125,7 +125,7 @@ This option slows down recursive glob processing by quite a bit."
;;; Functions:
(defun eshell-glob-initialize ()
(defun eshell-glob-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the extended globbing code."
;; it's important that `eshell-glob-chars-list' come first
(when (boundp 'eshell-special-chars-outside-quoting)

View file

@ -59,6 +59,7 @@
(require 'ring)
(require 'esh-opt)
(require 'esh-mode)
(require 'em-pred)
(require 'eshell)
@ -192,7 +193,6 @@ element, regardless of any text on the command line. In that case,
(defvar eshell-isearch-map
(let ((map (copy-keymap isearch-mode-map)))
(define-key map [(control ?m)] 'eshell-isearch-return)
(define-key map [return] 'eshell-isearch-return)
(define-key map [(control ?r)] 'eshell-isearch-repeat-backward)
(define-key map [(control ?s)] 'eshell-isearch-repeat-forward)
(define-key map [(control ?g)] 'eshell-isearch-abort)
@ -216,11 +216,11 @@ Returns non-nil if INPUT is blank."
Returns nil if INPUT is prepended by blank space, otherwise non-nil."
(not (string-match-p "\\`\\s-+" input)))
(defun eshell-hist-initialize ()
(defun eshell-hist-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the history management code for one Eshell buffer."
(when (eshell-using-module 'eshell-cmpl)
(add-hook 'pcomplete-try-first-hook
'eshell-complete-history-reference nil t))
#'eshell-complete-history-reference nil t))
(if (and (eshell-using-module 'eshell-rebind)
(not eshell-non-interactive-p))
@ -235,11 +235,13 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
(lambda ()
(if (>= (point) eshell-last-output-end)
(setq overriding-terminal-local-map
eshell-isearch-map)))) nil t)
eshell-isearch-map))))
nil t)
(add-hook 'isearch-mode-end-hook
(function
(lambda ()
(setq overriding-terminal-local-map nil))) nil t))
(setq overriding-terminal-local-map nil)))
nil t))
(define-key eshell-mode-map [up] 'eshell-previous-matching-input-from-input)
(define-key eshell-mode-map [down] 'eshell-next-matching-input-from-input)
(define-key eshell-mode-map [(control up)] 'eshell-previous-input)
@ -288,17 +290,17 @@ Returns nil if INPUT is prepended by blank space, otherwise non-nil."
(if eshell-history-file-name
(eshell-read-history nil t))
(add-hook 'eshell-exit-hook 'eshell-write-history nil t))
(add-hook 'eshell-exit-hook #'eshell-write-history nil t))
(unless eshell-history-ring
(setq eshell-history-ring (make-ring eshell-history-size)))
(add-hook 'eshell-exit-hook 'eshell-write-history nil t)
(add-hook 'eshell-exit-hook #'eshell-write-history nil t)
(add-hook 'kill-emacs-hook 'eshell-save-some-history)
(add-hook 'kill-emacs-hook #'eshell-save-some-history)
(make-local-variable 'eshell-input-filter-functions)
(add-hook 'eshell-input-filter-functions 'eshell-add-to-history nil t)
(add-hook 'eshell-input-filter-functions #'eshell-add-to-history nil t)
(define-key eshell-command-map [(control ?l)] 'eshell-list-history)
(define-key eshell-command-map [(control ?x)] 'eshell-get-next-from-history))
@ -754,7 +756,7 @@ matched."
(setq nth (eshell-hist-word-reference nth)))
(unless (numberp mth)
(setq mth (eshell-hist-word-reference mth)))
(cons (mapconcat 'identity (eshell-sublist textargs nth mth) " ")
(cons (mapconcat #'identity (eshell-sublist textargs nth mth) " ")
end))))
(defun eshell-hist-parse-modifier (hist reference)

View file

@ -29,7 +29,8 @@
(require 'cl-lib)
(require 'esh-util)
(require 'esh-opt)
(eval-when-compile (require 'eshell))
(require 'esh-proc)
(require 'esh-cmd)
;;;###autoload
(progn

View file

@ -46,9 +46,7 @@
;;; Code:
(require 'esh-util)
(require 'esh-arg)
(eval-when-compile (require 'eshell))
(require 'esh-mode)
;;;###autoload
(progn
@ -247,10 +245,10 @@ EXAMPLES:
(lambda ()
(insert eshell-modifier-help-string)))))
(defun eshell-pred-initialize ()
(defun eshell-pred-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the predicate/modifier code."
(add-hook 'eshell-parse-argument-hook
'eshell-parse-arg-modifier t t)
#'eshell-parse-arg-modifier t t)
(define-key eshell-command-map [(meta ?q)] 'eshell-display-predicate-help)
(define-key eshell-command-map [(meta ?m)] 'eshell-display-modifier-help))

View file

@ -99,7 +99,7 @@ arriving, or after."
;;; Functions:
(defun eshell-prompt-initialize ()
(defun eshell-prompt-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the prompting code."
(unless eshell-non-interactive-p
(add-hook 'eshell-post-command-hook 'eshell-emit-prompt nil t)

View file

@ -145,7 +145,7 @@ This is default behavior of shells like bash."
;;; Functions:
(defun eshell-rebind-initialize ()
(defun eshell-rebind-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the inputting code."
(unless eshell-non-interactive-p
(add-hook 'eshell-mode-hook 'eshell-setup-input-keymap nil t)

View file

@ -23,8 +23,7 @@
;;; Code:
(require 'eshell)
(require 'esh-opt)
(require 'esh-mode)
;;;###autoload
(progn
@ -57,7 +56,7 @@ This includes when running `eshell-command'."
;;; Functions:
(defun eshell-script-initialize ()
(defun eshell-script-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the script parsing code."
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
@ -73,13 +72,14 @@ This includes when running `eshell-command'."
;; to ruin it for other modules
(let (eshell-inside-quote-regexp
eshell-outside-quote-regexp)
(and (not eshell-non-interactive-p)
(and (not (bound-and-true-p eshell-non-interactive-p))
eshell-login-script
(file-readable-p eshell-login-script)
(eshell-do-eval
(list 'eshell-commands
(catch 'eshell-replace-command
(eshell-source-file eshell-login-script))) t))
(eshell-source-file eshell-login-script)))
t))
(and eshell-rc-script
(file-readable-p eshell-rc-script)
(eshell-do-eval

View file

@ -166,7 +166,7 @@ The options are `begin', `after' or `end'."
;;; Functions:
(defun eshell-smart-initialize ()
(defun eshell-smart-initialize () ;Called from `eshell-mode' via intern-soft!
"Setup Eshell smart display."
(unless eshell-non-interactive-p
;; override a few variables, since they would interfere with the

View file

@ -147,7 +147,7 @@ behavior for short-lived processes, see bug#18108."
;;; Functions:
(defun eshell-term-initialize ()
(defun eshell-term-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the `term' interface code."
(make-local-variable 'eshell-interpreter-alist)
(setq eshell-interpreter-alist
@ -191,7 +191,7 @@ allowed."
(term-exec term-buf program program nil args)
(let ((proc (get-buffer-process term-buf)))
(if (and proc (eq 'run (process-status proc)))
(set-process-sentinel proc 'eshell-term-sentinel)
(set-process-sentinel proc #'eshell-term-sentinel)
(error "Failed to invoke visual command")))
(term-char-mode)
(if eshell-escape-control-x

View file

@ -46,7 +46,7 @@
:tag "TRAMP Eshell features"
:group 'eshell-module))
(defun eshell-tramp-initialize ()
(defun eshell-tramp-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the TRAMP-using commands code."
(when (eshell-using-module 'eshell-cmpl)
(add-hook 'pcomplete-try-first-hook

View file

@ -35,8 +35,7 @@
;;; Code:
(require 'eshell)
(require 'esh-opt)
(require 'esh-mode)
(require 'pcomplete)
;;;###autoload
@ -140,7 +139,7 @@ Otherwise, Emacs will attempt to use rsh to invoke du on the remote machine."
;;; Functions:
(defun eshell-unix-initialize ()
(defun eshell-unix-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the UNIX support/emulation code."
(when (eshell-using-module 'eshell-cmpl)
(add-hook 'pcomplete-try-first-hook

View file

@ -25,9 +25,9 @@
;; hook `eshell-parse-argument-hook'. For a good example of this, see
;; `eshell-parse-drive-letter', defined in eshell-dirs.el.
(provide 'esh-arg)
;;; Code:
(require 'esh-mode)
(require 'esh-util)
(defgroup eshell-arg nil
"Argument parsing involves transforming the arguments passed on the
@ -36,6 +36,48 @@ yield the values intended."
:tag "Argument parsing"
:group 'eshell)
;;; Internal Variables:
(defvar eshell-current-argument nil)
(defvar eshell-current-modifiers nil)
(defvar eshell-arg-listified nil)
(defvar eshell-nested-argument nil)
(defvar eshell-current-quoted nil)
(defvar eshell-inside-quote-regexp nil)
(defvar eshell-outside-quote-regexp nil)
;;; User Variables:
(defcustom eshell-arg-load-hook nil
"A hook that gets run when `eshell-arg' is loaded."
:version "24.1" ; removed eshell-arg-initialize
:type 'hook
:group 'eshell-arg)
(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?\s ?\t ?\n)
"List of characters to recognize as argument separators."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-inside-quoting '(?\\ ?\")
"Characters which are still special inside double quotes."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-outside-quoting
(append eshell-delimiter-argument-list '(?# ?! ?\\ ?\" ?\'))
"Characters that require escaping outside of double quotes.
Without escaping them, they will introduce a change in the argument."
:type '(repeat character)
:group 'eshell-arg)
(defsubst eshell-arg-delimiter (&optional pos)
"Return non-nil if POS is an argument delimiter.
If POS is nil, the location of point is checked."
(let ((pos (or pos (point))))
(or (= pos (point-max))
(memq (char-after pos) eshell-delimiter-argument-list))))
(defcustom eshell-parse-argument-hook
(list
;; a term such as #<buffer NAME>, or #<process NAME> is a buffer
@ -113,47 +155,13 @@ treated as a literal character."
:type 'hook
:group 'eshell-arg)
;;; Code:
;;; User Variables:
(defcustom eshell-arg-load-hook nil
"A hook that gets run when `eshell-arg' is loaded."
:version "24.1" ; removed eshell-arg-initialize
:type 'hook
:group 'eshell-arg)
(defcustom eshell-delimiter-argument-list '(?\; ?& ?\| ?\> ?\s ?\t ?\n)
"List of characters to recognize as argument separators."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-inside-quoting '(?\\ ?\")
"Characters which are still special inside double quotes."
:type '(repeat character)
:group 'eshell-arg)
(defcustom eshell-special-chars-outside-quoting
(append eshell-delimiter-argument-list '(?# ?! ?\\ ?\" ?\'))
"Characters that require escaping outside of double quotes.
Without escaping them, they will introduce a change in the argument."
:type '(repeat character)
:group 'eshell-arg)
;;; Internal Variables:
(defvar eshell-current-argument nil)
(defvar eshell-current-modifiers nil)
(defvar eshell-arg-listified nil)
(defvar eshell-nested-argument nil)
(defvar eshell-current-quoted nil)
(defvar eshell-inside-quote-regexp nil)
(defvar eshell-outside-quote-regexp nil)
;;; Functions:
(defun eshell-arg-initialize ()
(defun eshell-arg-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the argument parsing code."
;; This is supposedly run after enabling esh-mode, when eshell-mode-map
;; already exists.
(defvar eshell-command-map)
(define-key eshell-command-map [(meta ?b)] 'eshell-insert-buffer-name)
(set (make-local-variable 'eshell-inside-quote-regexp) nil)
(set (make-local-variable 'eshell-outside-quote-regexp) nil))
@ -195,13 +203,6 @@ Without escaping them, they will introduce a change in the argument."
(setq eshell-current-argument argument))
(throw 'eshell-arg-done t))
(defsubst eshell-arg-delimiter (&optional pos)
"Return non-nil if POS is an argument delimiter.
If POS is nil, the location of point is checked."
(let ((pos (or pos (point))))
(or (= pos (point-max))
(memq (char-after pos) eshell-delimiter-argument-list))))
(defun eshell-quote-argument (string)
"Return STRING with magic characters quoted.
Magic characters are those in `eshell-special-chars-outside-quoting'."
@ -405,4 +406,5 @@ If the form has no `type', the syntax is parsed as if `type' were
(char-to-string (char-after)))))
(goto-char end)))))))
(provide 'esh-arg)
;;; esh-arg.el ends here

View file

@ -105,6 +105,8 @@
(require 'eldoc))
(require 'esh-arg)
(require 'esh-proc)
(require 'esh-module)
(require 'esh-io)
(require 'esh-ext)
(eval-when-compile
@ -285,7 +287,7 @@ otherwise t.")
"Return currently running command process, if non-Lisp."
eshell-last-async-proc)
(defun eshell-cmd-initialize ()
(defun eshell-cmd-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the Eshell command processing module."
(set (make-local-variable 'eshell-current-command) nil)
(set (make-local-variable 'eshell-command-name) nil)
@ -1337,7 +1339,7 @@ messages, and errors."
(eshell-print "\n"))
(eshell-close-handles 0 (list 'quote result)))))
(defalias 'eshell-lisp-command* 'eshell-lisp-command)
(defalias 'eshell-lisp-command* #'eshell-lisp-command)
(provide 'esh-cmd)

View file

@ -31,17 +31,12 @@
;;; Code:
(provide 'esh-ext)
(require 'esh-util)
(eval-when-compile
(require 'cl-lib)
(require 'esh-cmd))
(eval-when-compile (require 'cl-lib))
(require 'esh-io)
(require 'esh-arg)
(require 'esh-opt)
(require 'esh-proc)
(defgroup eshell-ext nil
"External commands are invoked when operating system executables are
@ -177,9 +172,9 @@ external version."
;;; Functions:
(defun eshell-ext-initialize ()
(defun eshell-ext-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the external command handling code."
(add-hook 'eshell-named-command-hook 'eshell-explicit-command nil t))
(add-hook 'eshell-named-command-hook #'eshell-explicit-command nil t))
(defun eshell-explicit-command (command args)
"If a command name begins with `*', call it externally always.
@ -193,8 +188,6 @@ This bypasses all Lisp functions and aliases."
(error "%s: external command not found"
(substring command 1))))))
(autoload 'eshell-close-handles "esh-io")
(defun eshell-remote-command (command args)
"Insert output from a remote COMMAND, using ARGS.
A remote command is something that executes on a different machine.
@ -211,7 +204,7 @@ causing the user to wonder if anything's really going on..."
(progn
(setq exitcode
(shell-command
(mapconcat 'shell-quote-argument
(mapconcat #'shell-quote-argument
(append (list command) args) " ")
outbuf errbuf))
(eshell-print (with-current-buffer outbuf (buffer-string)))
@ -235,6 +228,8 @@ causing the user to wonder if anything's really going on..."
(cl-assert interp)
(if (functionp (car interp))
(apply (car interp) (append (cdr interp) args))
(require 'esh-proc)
(declare-function eshell-gather-process-output "esh-proc" (command args))
(eshell-gather-process-output
(car interp) (append (cdr interp) args)))))
@ -249,7 +244,7 @@ Adds the given PATH to $PATH.")
(if args
(progn
(setq eshell-path-env (getenv "PATH")
args (mapconcat 'identity args path-separator)
args (mapconcat #'identity args path-separator)
eshell-path-env
(if prepend
(concat args path-separator eshell-path-env)
@ -336,4 +331,5 @@ line of the form #!<interp>."
(cdr interp)))))
(or interp (list fullname)))))))
(provide 'esh-ext)
;;; esh-ext.el ends here

View file

@ -68,8 +68,6 @@
;;; Code:
(provide 'esh-io)
(require 'esh-arg)
(require 'esh-util)
@ -171,7 +169,7 @@ not be added to this variable."
;;; Functions:
(defun eshell-io-initialize ()
(defun eshell-io-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the I/O subsystem code."
(add-hook 'eshell-parse-argument-hook
'eshell-parse-redirection nil t)
@ -511,4 +509,5 @@ Returns what was actually sent, or nil if nothing was sent."
(eshell-output-object-to-target object (car target))
(setq target (cdr target))))))
(provide 'esh-io)
;;; esh-io.el ends here

View file

@ -58,13 +58,10 @@
;;; Code:
(provide 'esh-mode)
(require 'esh-util)
(require 'esh-module)
(require 'esh-cmd)
(require 'esh-io)
(require 'esh-var)
(require 'esh-arg) ;For eshell-parse-arguments
(defgroup eshell-mode nil
"This module contains code for handling input from the user."
@ -202,6 +199,12 @@ This is used by `eshell-watch-for-password-prompt'."
:type 'boolean
:group 'eshell-mode)
(defcustom eshell-directory-name
(locate-user-emacs-file "eshell/" ".eshell/")
"The directory where Eshell control files should be kept."
:type 'directory
:group 'eshell)
(defvar eshell-first-time-p t
"A variable which is non-nil the first time Eshell is loaded.")
@ -292,7 +295,7 @@ and the hook `eshell-exit-hook'."
;; It's fine to run this unconditionally since it can be customized
;; via the `eshell-kill-processes-on-exit' variable.
(and (fboundp 'eshell-query-kill-processes)
(not (memq 'eshell-query-kill-processes eshell-exit-hook))
(not (memq #'eshell-query-kill-processes eshell-exit-hook))
(eshell-query-kill-processes))
(run-hooks 'eshell-exit-hook))
@ -334,7 +337,6 @@ and the hook `eshell-exit-hook'."
(define-key eshell-command-map [(control ?b)] 'eshell-backward-argument)
(define-key eshell-command-map [(control ?e)] 'eshell-show-maximum-output)
(define-key eshell-command-map [(control ?f)] 'eshell-forward-argument)
(define-key eshell-command-map [return] 'eshell-copy-old-input)
(define-key eshell-command-map [(control ?m)] 'eshell-copy-old-input)
(define-key eshell-command-map [(control ?o)] 'eshell-kill-output)
(define-key eshell-command-map [(control ?r)] 'eshell-show-output)
@ -410,23 +412,23 @@ and the hook `eshell-exit-hook'."
(when (and load-hook (boundp load-hook))
(if (memq initfunc (symbol-value load-hook)) (setq initfunc nil))
(run-hooks load-hook))
;; So we don't need the -initialize functions on the hooks (b#5375).
;; So we don't need the -initialize functions on the hooks (bug#5375).
(and initfunc (fboundp initfunc) (funcall initfunc))))
(if eshell-send-direct-to-subprocesses
(add-hook 'pre-command-hook 'eshell-intercept-commands t t))
(add-hook 'pre-command-hook #'eshell-intercept-commands t t))
(if eshell-scroll-to-bottom-on-input
(add-hook 'pre-command-hook 'eshell-preinput-scroll-to-bottom t t))
(add-hook 'pre-command-hook #'eshell-preinput-scroll-to-bottom t t))
(when eshell-scroll-show-maximum-output
(set (make-local-variable 'scroll-conservatively) 1000))
(when eshell-status-in-mode-line
(add-hook 'eshell-pre-command-hook 'eshell-command-started nil t)
(add-hook 'eshell-post-command-hook 'eshell-command-finished nil t))
(add-hook 'eshell-pre-command-hook #'eshell-command-started nil t)
(add-hook 'eshell-post-command-hook #'eshell-command-finished nil t))
(add-hook 'kill-buffer-hook 'eshell-kill-buffer-function t t)
(add-hook 'kill-buffer-hook #'eshell-kill-buffer-function t t)
(if eshell-first-time-p
(run-hooks 'eshell-first-time-mode-hook))
@ -451,10 +453,10 @@ and the hook `eshell-exit-hook'."
(if eshell-send-direct-to-subprocesses
(progn
(setq eshell-send-direct-to-subprocesses nil)
(remove-hook 'pre-command-hook 'eshell-intercept-commands t)
(remove-hook 'pre-command-hook #'eshell-intercept-commands t)
(message "Sending subprocess input on RET"))
(setq eshell-send-direct-to-subprocesses t)
(add-hook 'pre-command-hook 'eshell-intercept-commands t t)
(add-hook 'pre-command-hook #'eshell-intercept-commands t t)
(message "Sending subprocess input directly")))
(defun eshell-self-insert-command ()
@ -543,7 +545,7 @@ and the hook `eshell-exit-hook'."
"Push a mark at the end of the last input text."
(push-mark (1- eshell-last-input-end) t))
(custom-add-option 'eshell-pre-command-hook 'eshell-push-command-mark)
(custom-add-option 'eshell-pre-command-hook #'eshell-push-command-mark)
(defsubst eshell-goto-input-start ()
"Goto the start of the last command input.
@ -551,7 +553,7 @@ Putting this function on `eshell-pre-command-hook' will mimic Plan 9's
9term behavior."
(goto-char eshell-last-input-start))
(custom-add-option 'eshell-pre-command-hook 'eshell-push-command-mark)
(custom-add-option 'eshell-pre-command-hook #'eshell-goto-input-start)
(defsubst eshell-interactive-print (string)
"Print STRING to the eshell display buffer."
@ -1021,4 +1023,5 @@ This function could be in the list `eshell-output-filter-functions'."
(custom-add-option 'eshell-output-filter-functions
'eshell-handle-ansi-color)
(provide 'esh-mode)
;;; esh-mode.el ends here

View file

@ -22,9 +22,6 @@
;;; Code:
(provide 'esh-module)
(require 'eshell)
(require 'esh-util)
(defgroup eshell-module nil
@ -101,4 +98,5 @@ customization group. Example: `eshell-cmpl' for that module."
(unload-feature module)
(message "Unloading %s...done" (symbol-name module))))))
(provide 'esh-module)
;;; esh-module.el ends here

View file

@ -23,9 +23,6 @@
;;; Code:
(provide 'esh-opt)
(require 'esh-ext)
;; Unused.
;; (defgroup eshell-opt nil
@ -36,6 +33,10 @@
;;; User Functions:
;; Macro expansion of eshell-eval-using-options refers to eshell-stringify-list
;; defined in esh-util.
(require 'esh-util)
(defmacro eshell-eval-using-options (name macro-args options &rest body-forms)
"Process NAME's MACRO-ARGS using a set of command line OPTIONS.
After doing so, stores settings in local symbols as declared by OPTIONS;
@ -127,6 +128,8 @@ let-bound variable `args'."
(defun eshell--do-opts (name options args)
"Helper function for `eshell-eval-using-options'.
This code doesn't really need to be macro expanded everywhere."
(require 'esh-ext)
(declare-function eshell-external-command "esh-ext" (command args))
(let ((ext-command
(catch 'eshell-ext-command
(let ((usage-msg
@ -145,6 +148,8 @@ This code doesn't really need to be macro expanded everywhere."
(defun eshell-show-usage (name options)
"Display the usage message for NAME, using OPTIONS."
(require 'esh-ext)
(declare-function eshell-search-path "esh-ext" (name))
(let ((usage (format "usage: %s %s\n\n" name
(cadr (memq ':usage options))))
(extcmd (memq ':external options))
@ -273,4 +278,5 @@ switch is unrecognized."
(setq index (1+ index))))))))
(nconc (mapcar #'cdr opt-vals) eshell--args)))
(provide 'esh-opt)
;;; esh-opt.el ends here

View file

@ -23,9 +23,7 @@
;;; Code:
(provide 'esh-proc)
(require 'esh-cmd)
(require 'esh-io)
(defgroup eshell-proc nil
"When Eshell invokes external commands, it always does so
@ -118,14 +116,17 @@ information, for example."
Runs `eshell-reset-after-proc' and `eshell-kill-hook', passing arguments
PROC and STATUS to functions on the latter."
;; Was there till 24.1, but it is not optional.
(if (memq 'eshell-reset-after-proc eshell-kill-hook)
(setq eshell-kill-hook (delq 'eshell-reset-after-proc eshell-kill-hook)))
(if (memq #'eshell-reset-after-proc eshell-kill-hook)
(setq eshell-kill-hook (delq #'eshell-reset-after-proc eshell-kill-hook)))
(eshell-reset-after-proc status)
(run-hook-with-args 'eshell-kill-hook proc status))
(defun eshell-proc-initialize ()
(defun eshell-proc-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the process handling code."
(make-local-variable 'eshell-process-list)
;; This is supposedly run after enabling esh-mode, when eshell-command-map
;; already exists.
(defvar eshell-command-map)
(define-key eshell-command-map [(meta ?i)] 'eshell-insert-process)
(define-key eshell-command-map [(control ?c)] 'eshell-interrupt-process)
(define-key eshell-command-map [(control ?k)] 'eshell-kill-process)
@ -139,9 +140,11 @@ PROC and STATUS to functions on the latter."
"Reset the command input location after a process terminates.
The signals which will cause this to happen are matched by
`eshell-reset-signals'."
(if (and (stringp status)
(string-match eshell-reset-signals status))
(eshell-reset)))
(when (and (stringp status)
(string-match eshell-reset-signals status))
(require 'esh-mode)
(declare-function eshell-reset "esh-mode" (&optional no-hooks))
(eshell-reset)))
(defun eshell-wait-for-process (&rest procs)
"Wait until PROC has successfully completed."
@ -209,7 +212,8 @@ The prompt will be set to PROMPT."
(function
(lambda (proc)
(cons (process-name proc) t)))
(process-list)) nil t))
(process-list))
nil t))
(defun eshell-insert-process (process)
"Insert the name of PROCESS into the current buffer at point."
@ -220,10 +224,12 @@ The prompt will be set to PROMPT."
(defsubst eshell-record-process-object (object)
"Record OBJECT as now running."
(if (and (eshell-processp object)
eshell-current-subjob-p)
(eshell-interactive-print
(format "[%s] %d\n" (process-name object) (process-id object))))
(when (and (eshell-processp object)
eshell-current-subjob-p)
(require 'esh-mode)
(declare-function eshell-interactive-print "esh-mode" (string))
(eshell-interactive-print
(format "[%s] %d\n" (process-name object) (process-id object))))
(setq eshell-process-list
(cons (list object eshell-current-handles
eshell-current-subjob-p nil nil)
@ -254,7 +260,7 @@ the full name of a command, otherwise just the nondirectory part must match.")
(defun eshell-needs-pipe-p (command)
"Return non-nil if COMMAND needs `process-connection-type' to be nil.
See `eshell-needs-pipe'."
(and eshell-in-pipeline-p
(and (bound-and-true-p eshell-in-pipeline-p)
(not (eq eshell-in-pipeline-p 'first))
;; FIXME should this return non-nil for anything that is
;; neither 'first nor 'last? See bug#1388 discussion.
@ -267,6 +273,8 @@ See `eshell-needs-pipe'."
(defun eshell-gather-process-output (command args)
"Gather the output from COMMAND + ARGS."
(require 'esh-var)
(declare-function eshell-environment-variables "esh-var" ())
(unless (and (file-executable-p command)
(file-regular-p (file-truename command)))
(error "%s: not an executable file" command))
@ -283,14 +291,14 @@ See `eshell-needs-pipe'."
(unless (eshell-needs-pipe-p command)
process-connection-type))
(command (file-local-name (expand-file-name command))))
(apply 'start-file-process
(apply #'start-file-process
(file-name-nondirectory command) nil command args)))
(eshell-record-process-object proc)
(set-process-buffer proc (current-buffer))
(if (eshell-interactive-output-p)
(set-process-filter proc 'eshell-output-filter)
(set-process-filter proc 'eshell-insertion-filter))
(set-process-sentinel proc 'eshell-sentinel)
(set-process-filter proc (if (eshell-interactive-output-p)
#'eshell-output-filter
#'eshell-insertion-filter))
(set-process-sentinel proc #'eshell-sentinel)
(run-hook-with-args 'eshell-exec-hook proc)
(when (fboundp 'process-coding-system)
(let ((coding-systems (process-coding-system proc)))
@ -325,14 +333,14 @@ See `eshell-needs-pipe'."
(set-buffer oldbuf)
(run-hook-with-args 'eshell-exec-hook command)
(setq exit-status
(apply 'call-process-region
(apply #'call-process-region
(append (list eshell-last-sync-output-start (point)
command t
eshell-scratch-buffer nil)
args)))
;; When in a pipeline, record the place where the output of
;; this process will begin.
(and eshell-in-pipeline-p
(and (bound-and-true-p eshell-in-pipeline-p)
(set-marker eshell-last-sync-output-start (point)))
;; Simulate the effect of the process filter.
(when (numberp exit-status)
@ -349,11 +357,14 @@ See `eshell-needs-pipe'."
(setq lbeg lend)
(set-buffer proc-buf))
(set-buffer oldbuf))
(require 'esh-mode)
(declare-function eshell-update-markers "esh-mode" (pmark))
(defvar eshell-last-output-end) ;Defined in esh-mode.el.
(eshell-update-markers eshell-last-output-end)
;; Simulate the effect of eshell-sentinel.
(eshell-close-handles (if (numberp exit-status) exit-status -1))
(eshell-kill-process-function command exit-status)
(or eshell-in-pipeline-p
(or (bound-and-true-p eshell-in-pipeline-p)
(setq eshell-last-sync-output-start nil))
(if (not (numberp exit-status))
(error "%s: external command failed: %s" command exit-status))
@ -540,7 +551,11 @@ See the variable `eshell-kill-processes-on-exit'."
(defun eshell-send-eof-to-process ()
"Send EOF to process."
(interactive)
(require 'esh-mode)
(declare-function eshell-send-input "esh-mode"
(&optional use-region queue-p no-newline))
(eshell-send-input nil nil t)
(eshell-process-interact 'process-send-eof))
(provide 'esh-proc)
;;; esh-proc.el ends here

View file

@ -478,24 +478,22 @@ list."
(insert-file-contents (or filename eshell-hosts-file))
(goto-char (point-min))
(while (re-search-forward
"^\\([^#[:space:]]+\\)\\s-+\\(\\S-+\\)\\(\\s-*\\(\\S-+\\)\\)?" nil t)
(if (match-string 1)
(cl-pushnew (match-string 1) hosts :test #'equal))
(if (match-string 2)
(cl-pushnew (match-string 2) hosts :test #'equal))
(if (match-string 4)
(cl-pushnew (match-string 4) hosts :test #'equal))))
(sort hosts #'string-lessp)))
;; "^ \t\\([^# \t\n]+\\)[ \t]+\\([^ \t\n]+\\)\\([ \t]*\\([^ \t\n]+\\)\\)?"
"^[ \t]*\\([^# \t\n]+\\)[ \t]+\\([^ \t\n].+\\)" nil t)
(push (cons (match-string 1)
(split-string (match-string 2)))
hosts)))
(nreverse hosts)))
(defun eshell-read-hosts (file result-var timestamp-var)
"Read the contents of /etc/passwd for user names."
"Read the contents of /etc/hosts for host names."
(if (or (not (symbol-value result-var))
(not (symbol-value timestamp-var))
(time-less-p
(symbol-value timestamp-var)
(file-attribute-modification-time (file-attributes file))))
(progn
(set result-var (eshell-read-hosts-file file))
(set result-var (apply #'nconc (eshell-read-hosts-file file)))
(set timestamp-var (current-time))))
(symbol-value result-var))

View file

@ -105,11 +105,12 @@
;;; Code:
(provide 'esh-var)
(require 'esh-util)
(require 'esh-cmd)
(require 'esh-opt)
(require 'esh-module)
(require 'esh-arg)
(require 'esh-io)
(require 'pcomplete)
(require 'env)
@ -198,7 +199,7 @@ function), and the arguments passed to this function would be the list
;;; Functions:
(defun eshell-var-initialize ()
(defun eshell-var-initialize () ;Called from `eshell-mode' via intern-soft!
"Initialize the variable handle code."
;; Break the association with our parent's environment. Otherwise,
;; changing a variable will affect all of Emacs.
@ -206,6 +207,9 @@ function), and the arguments passed to this function would be the list
(set (make-local-variable 'process-environment)
(eshell-copy-environment)))
;; This is supposedly run after enabling esh-mode, when eshell-command-map
;; already exists.
(defvar eshell-command-map)
(define-key eshell-command-map [(meta ?v)] 'eshell-insert-envvar)
(set (make-local-variable 'eshell-special-chars-inside-quoting)
@ -213,16 +217,16 @@ function), and the arguments passed to this function would be the list
(set (make-local-variable 'eshell-special-chars-outside-quoting)
(append eshell-special-chars-outside-quoting '(?$)))
(add-hook 'eshell-parse-argument-hook 'eshell-interpolate-variable t t)
(add-hook 'eshell-parse-argument-hook #'eshell-interpolate-variable t t)
(add-hook 'eshell-prepare-command-hook
'eshell-handle-local-variables nil t)
#'eshell-handle-local-variables nil t)
(when (eshell-using-module 'eshell-cmpl)
(add-hook 'pcomplete-try-first-hook
'eshell-complete-variable-reference nil t)
#'eshell-complete-variable-reference nil t)
(add-hook 'pcomplete-try-first-hook
'eshell-complete-variable-assignment nil t)))
#'eshell-complete-variable-assignment nil t)))
(defun eshell-handle-local-variables ()
"Allow for the syntax `VAR=val <command> <args>'."
@ -532,7 +536,7 @@ For example, to retrieve the second element of a user's record in
(setq separator (caar indices)
refs (cdr refs)))
(setq value
(mapcar 'eshell-convert
(mapcar #'eshell-convert
(split-string value separator)))))
(cond
((< (length refs) 0)
@ -618,4 +622,5 @@ For example, to retrieve the second element of a user's record in
(setq pcomplete-stub (substring arg pos))
(throw 'pcomplete-completions (pcomplete-entries)))))
(provide 'esh-var)
;;; esh-var.el ends here

View file

@ -175,7 +175,10 @@
(eval-when-compile
(require 'cl-lib))
(require 'esh-util)
(require 'esh-mode)
(require 'esh-module) ;For eshell-using-module
(require 'esh-proc) ;For eshell-wait-for-process
(require 'esh-io) ;For eshell-last-command-status
(require 'esh-cmd)
(defgroup eshell nil
"Command shell implemented entirely in Emacs Lisp.
@ -217,12 +220,6 @@ shells such as bash, zsh, rc, 4dos."
:type 'string
:group 'eshell)
(defcustom eshell-directory-name
(locate-user-emacs-file "eshell/" ".eshell/")
"The directory where Eshell control files should be kept."
:type 'directory
:group 'eshell)
;;;_* Running Eshell
;;
;; There are only three commands used to invoke Eshell. The first two
@ -256,11 +253,12 @@ buffer selected (or created)."
buf))
(defun eshell-return-exits-minibuffer ()
;; This is supposedly run after enabling esh-mode, when eshell-mode-map
;; already exists.
(defvar eshell-mode-map)
(define-key eshell-mode-map [(control ?g)] 'abort-recursive-edit)
(define-key eshell-mode-map [return] 'exit-minibuffer)
(define-key eshell-mode-map [(control ?m)] 'exit-minibuffer)
(define-key eshell-mode-map [(control ?j)] 'exit-minibuffer)
(define-key eshell-mode-map [(meta return)] 'exit-minibuffer)
(define-key eshell-mode-map [(meta control ?m)] 'exit-minibuffer))
(defvar eshell-non-interactive-p nil
@ -275,7 +273,6 @@ non-interactive sessions, such as when using `eshell-command'.")
"Execute the Eshell command string COMMAND.
With prefix ARG, insert output into the current buffer at point."
(interactive)
(require 'esh-cmd)
(unless arg
(setq arg current-prefix-arg))
(let ((eshell-non-interactive-p t))
@ -363,7 +360,8 @@ corresponding to a successful execution."
(let ((result (eshell-do-eval
(list 'eshell-commands
(list 'eshell-command-to-value
(eshell-parse-command command))) t)))
(eshell-parse-command command)))
t)))
(cl-assert (eq (car result) 'quote))
(if (and status-var (symbolp status-var))
(set status-var eshell-last-command-status))
@ -404,5 +402,4 @@ Emacs."
(run-hooks 'eshell-load-hook)
(provide 'eshell)
;;; eshell.el ends here

View file

@ -55,6 +55,7 @@ This means to treat a terminal of type TYPE as if it were of type ALIAS."
:group 'terminals
:version "25.1")
(declare-function display-graphic-p "frame" (&optional display))
(declare-function xw-defined-colors "term/common-win" (&optional frame))
(defvar help-xref-stack-item)
@ -1239,7 +1240,7 @@ of a global face. Value is the new attribute value."
;; explicitly in VALID, using color approximation code
;; in tty-colors.el.
(when (and (memq attribute '(:foreground :background))
(not (memq (window-system frame) '(x w32 ns)))
(not (display-graphic-p frame))
(not (member new-value
'("unspecified"
"unspecified-fg" "unspecified-bg"))))
@ -1833,7 +1834,7 @@ The argument FRAME specifies which frame to try.
The value may be different for frames on different display types.
If FRAME doesn't support colors, the value is nil.
If FRAME is nil, that stands for the selected frame."
(if (memq (framep (or frame (selected-frame))) '(x w32 ns))
(if (display-graphic-p frame)
(xw-defined-colors frame)
(mapcar 'car (tty-color-alist frame))))
(defalias 'x-defined-colors 'defined-colors)
@ -1877,7 +1878,7 @@ or one of the strings \"unspecified-fg\" or \"unspecified-bg\".
If FRAME is omitted or nil, use the selected frame."
(unless (member color '(unspecified "unspecified-bg" "unspecified-fg"))
(if (member (framep (or frame (selected-frame))) '(x w32 ns))
(if (display-graphic-p frame)
(xw-color-defined-p color frame)
(numberp (tty-color-translate color frame)))))
(defalias 'x-color-defined-p 'color-defined-p)
@ -1903,7 +1904,7 @@ return value is nil."
(cond
((member color '(unspecified "unspecified-fg" "unspecified-bg"))
nil)
((memq (framep (or frame (selected-frame))) '(x w32 ns))
((display-graphic-p frame)
(xw-color-values color frame))
(t
(tty-color-values color frame))))
@ -1917,7 +1918,7 @@ return value is nil."
The optional argument DISPLAY specifies which display to ask about.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display."
(if (memq (framep-on-display display) '(x w32 ns))
(if (display-graphic-p display)
(xw-display-color-p display)
(tty-display-color-p display)))
(defalias 'x-display-color-p 'display-color-p)
@ -1928,12 +1929,9 @@ If omitted or nil, that stands for the selected frame's display."
"Return non-nil if frames on DISPLAY can display shades of gray.
DISPLAY should be either a frame or a display name (a string).
If omitted or nil, that stands for the selected frame's display."
(let ((frame-type (framep-on-display display)))
(cond
((memq frame-type '(x w32 ns))
(x-display-grayscale-p display))
(t
(> (tty-color-gray-shades display) 2)))))
(if (display-graphic-p display)
(x-display-grayscale-p display)
(> (tty-color-gray-shades display) 2)))
(defun read-color (&optional prompt convert-to-RGB allow-empty-name msg)
"Read a color name or RGB triplet.

View file

@ -2705,9 +2705,8 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|CBR\\|7Z\\)\\'" . archive-mo
("\\.dbk\\'" . xml-mode)
("\\.dtd\\'" . sgml-mode)
("\\.ds\\(ss\\)?l\\'" . dsssl-mode)
("\\.jsm?\\'" . javascript-mode)
("\\.js[mx]?\\'" . javascript-mode)
("\\.json\\'" . javascript-mode)
("\\.jsx\\'" . js-jsx-mode)
("\\.[ds]?vh?\\'" . verilog-mode)
("\\.by\\'" . bovine-grammar-mode)
("\\.wy\\'" . wisent-grammar-mode)

View file

@ -974,7 +974,7 @@ recently selected windows nor the buffer list."
(select-frame frame norecord)
(raise-frame frame)
;; Ensure, if possible, that FRAME gets input focus.
(when (memq (window-system frame) '(x w32 ns))
(when (display-multi-frame-p frame)
(x-focus-frame frame))
;; Move mouse cursor if necessary.
(cond
@ -1027,16 +1027,15 @@ that variable should be nil."
"Do whatever is right to suspend the current frame.
Calls `suspend-emacs' if invoked from the controlling tty device,
`suspend-tty' from a secondary tty device, and
`iconify-or-deiconify-frame' from an X frame."
`iconify-or-deiconify-frame' from a graphical frame."
(interactive)
(let ((type (framep (selected-frame))))
(cond
((memq type '(x ns w32)) (iconify-or-deiconify-frame))
((eq type t)
(if (controlling-tty-p)
(suspend-emacs)
(suspend-tty)))
(t (suspend-emacs)))))
(cond
((display-multi-frame-p) (iconify-or-deiconify-frame))
((eq (framep (selected-frame)) t)
(if (controlling-tty-p)
(suspend-emacs)
(suspend-tty)))
(t (suspend-emacs))))
(defun make-frame-names-alist ()
;; Only consider the frames on the same display.
@ -1856,6 +1855,14 @@ for FRAME."
;;;; Frame/display capabilities.
;; These functions should make the features they test explicit in
;; their names, so that when capabilities or the corresponding Emacs
;; features change, it will be easy to find all the tests for such
;; capabilities by a simple text search. See more about the history
;; and the intent of these functions in
;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2019-04/msg00004.html
;; or in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35058#17.
(declare-function msdos-mouse-p "dosfns.c")
(defun display-mouse-p (&optional display)
@ -1906,6 +1913,7 @@ frame's display)."
(fboundp 'image-mask-p)
(fboundp 'image-size)))
(defalias 'display-blink-cursor-p 'display-graphic-p)
(defalias 'display-multi-frame-p 'display-graphic-p)
(defalias 'display-multi-font-p 'display-graphic-p)
@ -1927,6 +1935,16 @@ frame's display)."
(t
nil))))
(defun display-symbol-keys-p (&optional display)
"Return non-nil if DISPLAY supports symbol names as keys.
This means that, for example, DISPLAY can differentiate between
the keybinding RET and [return]."
(let ((frame-type (framep-on-display display)))
(or (memq frame-type '(x w32 ns pc))
;; MS-DOS and MS-Windows terminals have built-in support for
;; function (symbol) keys
(memq system-type '(ms-dos windows-nt)))))
(declare-function x-display-screens "xfns.c" (&optional terminal))
(defun display-screens (&optional display)
@ -2083,7 +2101,7 @@ If DISPLAY is omitted or nil, it defaults to the selected frame's display."
((eq frame-type 'pc)
4)
(t
(truncate (log (length (tty-color-alist)) 2))))))
(logb (length (tty-color-alist)))))))
(declare-function x-display-color-cells "xfns.c" (&optional terminal))
@ -2546,7 +2564,7 @@ terminals, cursor blinking is controlled by the terminal."
:init-value (not (or noninteractive
no-blinking-cursor
(eq system-type 'ms-dos)
(not (memq window-system '(x w32 ns)))))
(not (display-blink-cursor-p))))
:initialize 'custom-initialize-delay
:group 'cursor
:global t

View file

@ -276,7 +276,7 @@ Actually a hash table holding subjects mapped to t.")
(defmacro gnus-agent-with-refreshed-group (group &rest body)
"Performs the body then updates the group's line in the group
buffer. Automatically blocks multiple updates due to recursion."
`(prog1 (let ((gnus-agent-inhibit-update-total-fetched-for t)) ,@body)
`(prog1 (let ((gnus-agent-inhibit-update-total-fetched-for t)) ,@body)
(when (and gnus-agent-need-update-total-fetched-for
(not gnus-agent-inhibit-update-total-fetched-for))
(with-current-buffer gnus-group-buffer
@ -311,9 +311,10 @@ buffer. Automatically blocks multiple updates due to recursion."
(defun gnus-agent-cat-set-property (category property value)
(if value
(setcdr (or (assq property category)
(let ((cell (cons property nil)))
(let ((cell (cons property nil)))
(setcdr category (cons cell (cdr category)))
cell)) value)
cell))
value)
(let ((category category))
(while (cond ((eq property (caadr category))
(setcdr category (cddr category))
@ -378,7 +379,8 @@ manipulated as follows:
(setcdr (or (assq 'agent-groups category)
(let ((cell (cons 'agent-groups nil)))
(setcdr category (cons cell (cdr category)))
cell)) new-g))
cell))
new-g))
(t
(let ((groups groups))
(while groups
@ -395,7 +397,8 @@ manipulated as follows:
(setcdr (or (assq 'agent-groups category)
(let ((cell (cons 'agent-groups nil)))
(setcdr category (cons cell (cdr category)))
cell)) groups))))))
cell))
groups))))))
(defsubst gnus-agent-cat-make (name &optional default-agent-predicate)
(list name `(agent-predicate . ,(or default-agent-predicate 'false))))
@ -1557,11 +1560,8 @@ downloaded into the agent."
(skip-chars-forward " ")
(setq crosses nil)
(while (looking-at "\\([^: \n]+\\):\\([0-9]+\\) *")
(push (cons (buffer-substring (match-beginning 1)
(match-end 1))
(string-to-number
(buffer-substring (match-beginning 2)
(match-end 2))))
(push (cons (match-string 1)
(string-to-number (match-string 2)))
crosses)
(goto-char (match-end 0)))
(gnus-agent-crosspost crosses (caar pos) date)))
@ -2939,7 +2939,7 @@ The following commands are available:
'or)
((memq (car predicate) gnus-category-not)
'not))
,@(mapcar 'gnus-category-make-function-1 (cdr predicate))))
,@(mapcar #'gnus-category-make-function-1 (cdr predicate))))
(t
(error "Unknown predicate type: %s" predicate))))
@ -2965,7 +2965,7 @@ return read articles, nil when it is known to always return read
articles, and t_nil when the function may return both read and unread
articles."
(let ((func (car function))
(args (mapcar 'gnus-function-implies-unread-1 (cdr function))))
(args (mapcar #'gnus-function-implies-unread-1 (cdr function))))
(cond ((eq func 'and)
(cond ((memq t args) ; if any argument returns only unread articles
;; then that argument constrains the result to only unread articles.
@ -3151,38 +3151,37 @@ FORCE is equivalent to setting the expiration predicates to true."
(nov-file (concat dir ".overview"))
(cnt 0)
(completed -1)
dlist
type)
type
;; The normal article alist contains elements that look like
;; (article# . fetch_date) I need to combine other
;; information with this list. For example, a flag indicating
;; that a particular article MUST BE KEPT. To do this, I'm
;; going to transform the elements to look like (article#
;; fetch_date keep_flag NOV_entry_position) Later, I'll reverse
;; the process to generate the expired article alist.
;; The normal article alist contains elements that look like
;; (article# . fetch_date) I need to combine other
;; information with this list. For example, a flag indicating
;; that a particular article MUST BE KEPT. To do this, I'm
;; going to transform the elements to look like (article#
;; fetch_date keep_flag NOV_entry_position) Later, I'll reverse
;; the process to generate the expired article alist.
(dlist
(nconc
;; Convert the alist elements to (article# fetch_date nil nil).
(mapcar (lambda (e)
(list (car e) (cdr e) nil nil))
alist)
;; Convert the alist elements to (article# fetch_date nil
;; nil).
(setq dlist (mapcar (lambda (e)
(list (car e) (cdr e) nil nil)) alist))
;; Convert the keep lists to elements that look like (article#
;; nil keep_flag nil) then append it to the expanded dlist
;; These statements are sorted by ascending precedence of the
;; keep_flag.
(mapcar (lambda (e)
(list e nil 'unread nil))
unreads)
;; Convert the keep lists to elements that look like (article#
;; nil keep_flag nil) then append it to the expanded dlist
;; These statements are sorted by ascending precedence of the
;; keep_flag.
(setq dlist (nconc dlist
(mapcar (lambda (e)
(list e nil 'unread nil))
unreads)))
(setq dlist (nconc dlist
(mapcar (lambda (e)
(list e nil 'marked nil))
marked)))
(setq dlist (nconc dlist
(mapcar (lambda (e)
(list e nil 'special nil))
specials)))
(mapcar (lambda (e)
(list e nil 'marked nil))
marked)
(mapcar (lambda (e)
(list e nil 'special nil))
specials))))
(set-buffer overview)
(erase-buffer)
@ -3391,7 +3390,7 @@ article alist" type) actions))
(when actions
(gnus-agent-message 8 "gnus-agent-expire: %s:%d: %s"
decoded article-number
(mapconcat 'identity actions ", ")))))
(mapconcat #'identity actions ", ")))))
(t
(gnus-agent-message
10 "gnus-agent-expire: %s:%d: Article kept as \
@ -3624,7 +3623,7 @@ If CACHED-HEADER is nil, articles are only excluded if the article itself
has been fetched."
;; Logically equivalent to: (gnus-sorted-difference articles (mapcar
;; 'car gnus-agent-article-alist))
;; #'car gnus-agent-article-alist))
;; Functionally, I don't need to construct a temp list using mapcar.

View file

@ -107,7 +107,7 @@ seen in the same session."
(defun gnus-dup-enter-articles ()
"Enter articles from the current group for future duplicate suppression."
(unless gnus-dup-list
(unless gnus-dup-hashtb
(gnus-dup-open))
(setq gnus-dup-list-dirty t) ; mark list for saving
(let (msgid)
@ -133,7 +133,7 @@ seen in the same session."
(defun gnus-dup-suppress-articles ()
"Mark duplicate articles as read."
(unless gnus-dup-list
(unless gnus-dup-hashtb
(gnus-dup-open))
(gnus-message 8 "Suppressing duplicates...")
(let ((auto (and gnus-newsgroup-auto-expire
@ -152,9 +152,10 @@ seen in the same session."
(defun gnus-dup-unsuppress-article (article)
"Stop suppression of ARTICLE."
(let* ((header (gnus-data-header (gnus-data-find article)))
(id (when header (mail-header-id header))))
(when id
(let (header id)
(when (and gnus-dup-hashtb
(setq header (gnus-data-header (gnus-data-find article)))
(setq id (mail-header-id header)))
(setq gnus-dup-list-dirty t)
(setq gnus-dup-list (delete id gnus-dup-list))
(remhash id gnus-dup-hashtb))))

View file

@ -2560,7 +2560,11 @@ If FAR, it is likely that the group is not on the current line.
If TEST-MARKED, the line must be marked."
(when group
(let ((start (point))
(active (and (gethash group gnus-active-hashtb)
(active (and (or
;; some kind of group may be only there.
(gethash group gnus-active-hashtb)
;; all groups (but with exception) are there.
(gethash group gnus-newsrc-hashtb))
group)))
(beginning-of-line)
(cond

View file

@ -2145,12 +2145,15 @@ The info element is shared with the same element of
(condition-case ()
(if (and (stringp (progn
(setq group (read cur)
group (cond ((numberp group)
(number-to-string group))
((symbolp group)
(symbol-name group))
((stringp group)
group)))))
group
(encode-coding-string
(cond ((numberp group)
(number-to-string group))
((symbolp group)
(symbol-name group))
((stringp group)
group))
'latin-1))))
(numberp (setq max (read cur)))
(numberp (setq min (read cur)))
(null (progn

View file

@ -27,7 +27,34 @@
(require 'cl-lib)
(defvar tool-bar-mode)
(defvar gnus-category-predicate-alist)
(defvar gnus-category-predicate-cache)
(defvar gnus-inhibit-article-treatments)
(defvar gnus-inhibit-demon)
(defvar gnus-tmp-article-number)
(defvar gnus-tmp-closing-bracket)
(defvar gnus-tmp-current)
(defvar gnus-tmp-dummy)
(defvar gnus-tmp-expirable)
(defvar gnus-tmp-from)
(defvar gnus-tmp-group-name)
(defvar gnus-tmp-header)
(defvar gnus-tmp-indentation)
(defvar gnus-tmp-level)
(defvar gnus-tmp-lines)
(defvar gnus-tmp-number)
(defvar gnus-tmp-opening-bracket)
(defvar gnus-tmp-process)
(defvar gnus-tmp-replied)
(defvar gnus-tmp-score)
(defvar gnus-tmp-score-char)
(defvar gnus-tmp-subject)
(defvar gnus-tmp-subject-or-nil)
(defvar gnus-tmp-unread)
(defvar gnus-tmp-unread-and-unselected)
(defvar gnus-tmp-unread-and-unticked)
(defvar gnus-tmp-user-defined)
(defvar gnus-use-article-prefetch)
(require 'gnus)
(require 'gnus-group)
@ -784,7 +811,7 @@ score file."
:group 'gnus-score-default
:type 'integer)
(defun gnus-widget-reversible-match (widget value)
(defun gnus-widget-reversible-match (_widget value)
"Ignoring WIDGET, convert VALUE to internal form.
VALUE should have the form `FOO' or `(not FOO)', where FOO is an symbol."
;; (debug value)
@ -794,7 +821,7 @@ VALUE should have the form `FOO' or `(not FOO)', where FOO is an symbol."
(eq (nth 0 value) 'not)
(symbolp (nth 1 value)))))
(defun gnus-widget-reversible-to-internal (widget value)
(defun gnus-widget-reversible-to-internal (_widget value)
"Ignoring WIDGET, convert VALUE to internal form.
VALUE should have the form `FOO' or `(not FOO)', where FOO is an atom.
FOO is converted to (FOO nil) and (not FOO) is converted to (FOO t)."
@ -803,7 +830,7 @@ FOO is converted to (FOO nil) and (not FOO) is converted to (FOO t)."
(list value nil)
(list (nth 1 value) t)))
(defun gnus-widget-reversible-to-external (widget value)
(defun gnus-widget-reversible-to-external (_widget value)
"Ignoring WIDGET, convert VALUE to external form.
VALUE should have the form `(FOO nil)' or `(FOO t)', where FOO is an atom.
\(FOO nil) is converted to FOO and (FOO t) is converted to (not FOO)."
@ -1385,7 +1412,8 @@ the normal Gnus MIME machinery."
(?A (car (cdr (funcall gnus-extract-address-components gnus-tmp-from)))
?s)
(?a (or (car (funcall gnus-extract-address-components gnus-tmp-from))
gnus-tmp-from) ?s)
gnus-tmp-from)
?s)
(?F gnus-tmp-from ?s)
(?x ,(macroexpand '(mail-header-xref gnus-tmp-header)) ?s)
(?D ,(macroexpand '(mail-header-date gnus-tmp-header)) ?s)
@ -1397,12 +1425,15 @@ the normal Gnus MIME machinery."
(?k (gnus-summary-line-message-size gnus-tmp-header) ?s)
(?L gnus-tmp-lines ?s)
(?Z (or (nnir-article-rsv (mail-header-number gnus-tmp-header))
0) ?d)
0)
?d)
(?G (or (nnir-article-group (mail-header-number gnus-tmp-header))
"") ?s)
"")
?s)
(?g (or (gnus-group-short-name
(nnir-article-group (mail-header-number gnus-tmp-header)))
"") ?s)
"")
?s)
(?O gnus-tmp-downloaded ?c)
(?I gnus-tmp-indentation ?s)
(?T (if (= gnus-tmp-level 0) "" (make-string (frame-width) ? )) ?s)
@ -1427,7 +1458,8 @@ the normal Gnus MIME machinery."
(?P (gnus-pick-line-number) ?d)
(?B gnus-tmp-thread-tree-header-string ?s)
(user-date (gnus-user-date
,(macroexpand '(mail-header-date gnus-tmp-header))) ?s))
,(macroexpand '(mail-header-date gnus-tmp-header)))
?s))
"An alist of format specifications that can appear in summary lines.
These are paired with what variables they correspond with, along with
the type of the variable (string, integer, character, etc).")
@ -1672,6 +1704,7 @@ For example:
(eval-when-compile
;; Bind features so that require will believe that gnus-sum has
;; already been loaded (avoids infinite recursion)
(with-no-warnings (defvar features)) ;Not just a local variable.
(let ((features (cons 'gnus-sum features)))
(require 'gnus-art)))
@ -3107,18 +3140,16 @@ The following commands are available:
(defun gnus-summary-make-local-variables ()
"Make all the local summary buffer variables."
(let (global)
(dolist (local gnus-summary-local-variables)
(if (consp local)
(progn
(if (eq (cdr local) 'global)
;; Copy the global value of the variable.
(setq global (symbol-value (car local)))
;; Use the value from the list.
(setq global (eval (cdr local))))
(set (make-local-variable (car local)) global))
;; Simple nil-valued local variable.
(set (make-local-variable local) nil)))))
(dolist (local gnus-summary-local-variables)
(if (consp local)
(let ((global (if (eq (cdr local) 'global)
;; Copy the global value of the variable.
(symbol-value (car local))
;; Use the value from the list.
(eval (cdr local)))))
(set (make-local-variable (car local)) global))
;; Simple nil-valued local variable.
(set (make-local-variable local) nil))))
;; Summary data functions.
@ -3525,13 +3556,12 @@ buffer that was in action when the last article was fetched."
(score-file gnus-current-score-file)
(default-charset gnus-newsgroup-charset)
vlist)
(let ((locals gnus-newsgroup-variables))
(while locals
(if (consp (car locals))
(push (eval (caar locals)) vlist)
(push (eval (car locals)) vlist))
(setq locals (cdr locals)))
(setq vlist (nreverse vlist)))
(dolist (local gnus-newsgroup-variables)
(push (eval (if (consp local) (car local)
local)
t)
vlist))
(setq vlist (nreverse vlist))
(with-temp-buffer
(setq gnus-newsgroup-name name
gnus-newsgroup-marked marked
@ -3546,12 +3576,11 @@ buffer that was in action when the last article was fetched."
gnus-reffed-article-number reffed
gnus-current-score-file score-file
gnus-newsgroup-charset default-charset)
(let ((locals gnus-newsgroup-variables))
(while locals
(if (consp (car locals))
(set (caar locals) (pop vlist))
(set (car locals) (pop vlist)))
(setq locals (cdr locals))))))))
(dolist (local gnus-newsgroup-variables)
(set (if (consp local)
(car local)
local)
(pop vlist)))))))
(defun gnus-summary-article-unread-p (article)
"Say whether ARTICLE is unread or not."
@ -3639,19 +3668,23 @@ buffer that was in action when the last article was fetched."
pos)))
(setq gnus-summary-mark-positions pos))))
(defun gnus-summary-insert-dummy-line (gnus-tmp-subject gnus-tmp-number)
(defun gnus-summary-insert-dummy-line (subject number)
"Insert a dummy root in the summary buffer."
(beginning-of-line)
(add-text-properties
(point) (progn (eval gnus-summary-dummy-line-format-spec) (point))
(list 'gnus-number gnus-tmp-number 'gnus-intangible gnus-tmp-number)))
(point) (let ((gnus-tmp-subject subject)
(gnus-tmp-number number))
(eval gnus-summary-dummy-line-format-spec t)
(point))
(list 'gnus-number number 'gnus-intangible number)))
(defun gnus-summary-extract-address-component (from)
(or (car (funcall gnus-extract-address-components from))
from))
(defun gnus-summary-from-or-to-or-newsgroups (header gnus-tmp-from)
(let ((mail-parse-charset gnus-newsgroup-charset)
(defun gnus-summary-from-or-to-or-newsgroups (header from)
(let ((gnus-tmp-from from)
(mail-parse-charset gnus-newsgroup-charset)
;; Is it really necessary to do this next part for each summary line?
;; Luckily, doesn't seem to slow things down much.
(mail-parse-ignored-charsets
@ -3678,25 +3711,31 @@ buffer that was in action when the last article was fetched."
(and
(memq 'Newsgroups gnus-extra-headers)
(eq (car (gnus-find-method-for-group
gnus-newsgroup-name)) 'nntp)
gnus-newsgroup-name))
'nntp)
(gnus-group-real-name gnus-newsgroup-name))))
(concat gnus-summary-newsgroup-prefix newsgroups)))))
(bidi-string-mark-left-to-right
(inline
(gnus-summary-extract-address-component gnus-tmp-from))))))
(defun gnus-summary-insert-line (gnus-tmp-header
gnus-tmp-level gnus-tmp-current
undownloaded gnus-tmp-unread gnus-tmp-replied
gnus-tmp-expirable gnus-tmp-subject-or-nil
&optional gnus-tmp-dummy gnus-tmp-score
gnus-tmp-process)
(if (>= gnus-tmp-level (length gnus-thread-indent-array))
(defun gnus-summary-insert-line (header level current undownloaded
unread replied expirable subject-or-nil
&optional dummy score process)
(if (>= level (length gnus-thread-indent-array))
(gnus-make-thread-indent-array (max (* 2 (length gnus-thread-indent-array))
gnus-tmp-level)))
(let* ((gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level))
level)))
(let* ((gnus-tmp-header header)
(gnus-tmp-level level)
(gnus-tmp-current current)
(gnus-tmp-unread unread)
(gnus-tmp-expirable expirable)
(gnus-tmp-subject-or-nil subject-or-nil)
(gnus-tmp-dummy dummy)
(gnus-tmp-process process)
(gnus-tmp-indentation (aref gnus-thread-indent-array gnus-tmp-level))
(gnus-tmp-lines (mail-header-lines gnus-tmp-header))
(gnus-tmp-score (or gnus-tmp-score gnus-summary-default-score 0))
(gnus-tmp-score (or score gnus-summary-default-score 0))
(gnus-tmp-score-char
(if (or (null gnus-summary-default-score)
(<= (abs (- gnus-tmp-score gnus-summary-default-score))
@ -3709,7 +3748,7 @@ buffer that was in action when the last article was fetched."
(cond (gnus-tmp-process gnus-process-mark)
((memq gnus-tmp-current gnus-newsgroup-cached)
gnus-cached-mark)
(gnus-tmp-replied gnus-replied-mark)
(replied gnus-replied-mark)
((memq gnus-tmp-current gnus-newsgroup-forwarded)
gnus-forwarded-mark)
((memq gnus-tmp-current gnus-newsgroup-saved)
@ -4461,7 +4500,7 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise."
;; build complete threads - if the roots haven't been expired by the
;; server, that is.
(let ((mail-parse-charset gnus-newsgroup-charset)
id heads)
heads)
(maphash
(lambda (id refs)
(when (not (car refs))
@ -4485,7 +4524,6 @@ Returns HEADER if it was entered in the DEPENDENCIES. Returns nil otherwise."
;; on the beginning of the line.
(defsubst gnus-nov-parse-line (number dependencies &optional force-new)
(let ((eol (point-at-eol))
(buffer (current-buffer))
header references in-reply-to)
;; overview: [num subject from date id refs chars lines misc]
@ -4940,8 +4978,16 @@ Note that THREAD must never, ever be anything else than a variable -
using some other form will lead to serious barfage."
(or (symbolp thread) (signal 'wrong-type-argument '(symbolp thread)))
;; (8% speedup to gnus-summary-prepare, just for fun :-)
(list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207"
(vector thread) 2))
(cond
((and (boundp 'lexical-binding) lexical-binding)
;; FIXME: This version could be a "defsubst" rather than a macro.
`(#[257 "\211:\203\16\0\211@;\203\15\0A@@\207"
[] 2]
,thread))
(t
;; Not sure how XEmacs handles these things, so let's keep the old code.
(list 'byte-code "\10\211:\203\17\0\211@;\203\16\0A@@\207"
(vector thread) 2))))
(defsubst gnus-article-sort-by-number (h1 h2)
"Sort articles by article number."
@ -5972,7 +6018,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
(min (car active))
(max (cdr active))
(types gnus-article-mark-lists)
marks var articles article mark mark-type
var articles article mark mark-type
bgn end)
;; Hack to avoid adjusting marks for imap.
(when (eq (car (gnus-find-method-for-group (gnus-info-group info)))
@ -6234,7 +6280,7 @@ The resulting hash table is returned, or nil if no Xrefs were found."
(defun gnus-mark-xrefs-as-read (from-newsgroup headers unreads)
"Look through all the headers and mark the Xrefs as read."
(let ((virtual (gnus-virtual-group-p from-newsgroup))
name info xref-hashtb idlist method nth4)
name info xref-hashtb method nth4)
(with-current-buffer gnus-group-buffer
(when (setq xref-hashtb
(gnus-create-xref-hashtb from-newsgroup headers unreads))
@ -7488,7 +7534,7 @@ The state which existed when entering the ephemeral is reset."
(with-current-buffer buffer
(gnus-deaden-summary))))))
(defun gnus-summary-wake-up-the-dead (&rest args)
(defun gnus-summary-wake-up-the-dead (&rest _)
"Wake up the dead summary buffer."
(interactive)
(gnus-dead-summary-mode -1)
@ -7714,6 +7760,12 @@ Given a prefix, will force an `article' buffer configuration."
(gnus-article-setup-buffer))
(gnus-set-global-variables)
(with-current-buffer gnus-article-buffer
;; The buffer may be non-empty and even narrowed, so go back to
;; a sane state.
(widen)
;; We're going to erase the buffer anyway so do it now: it can save us from
;; uselessly performing multibyte-conversion of the current content.
(let ((inhibit-read-only t)) (erase-buffer))
(setq gnus-article-charset gnus-newsgroup-charset)
(setq gnus-article-ignored-charsets gnus-newsgroup-ignored-charsets)
(mm-enable-multibyte))
@ -7857,7 +7909,7 @@ If BACKWARD, the previous article is selected instead of the next."
(gnus-summary-walk-group-buffer
gnus-newsgroup-name cmd unread backward point))))))))
(defun gnus-summary-walk-group-buffer (from-group cmd unread backward start)
(defun gnus-summary-walk-group-buffer (_from-group cmd unread backward start)
(let ((keystrokes '((?\C-n (gnus-group-next-unread-group 1))
(?\C-p (gnus-group-prev-unread-group 1))))
(cursor-in-echo-area t)
@ -8151,7 +8203,7 @@ score higher than the default score."
"Select the first unread subject that has a score over the default score."
(interactive)
(let ((data gnus-newsgroup-data)
article score)
article)
(while (and (setq article (gnus-data-number (car data)))
(or (gnus-data-read-p (car data))
(not (> (gnus-summary-article-score article)
@ -8564,7 +8616,7 @@ If UNREPLIED (the prefix), limit to unreplied articles."
(gnus-summary-limit gnus-newsgroup-replied))
(gnus-summary-position-point))
(defun gnus-summary-limit-exclude-marks (marks &optional reverse)
(defun gnus-summary-limit-exclude-marks (marks &optional _reverse)
"Exclude articles that are marked with MARKS (e.g. \"DK\").
If REVERSE, limit the summary buffer to articles that are marked
with MARKS. MARKS can either be a string of marks or a list of marks.
@ -8866,7 +8918,7 @@ fetch-old-headers verbiage, and so on."
(push gnus-newsgroup-limit gnus-newsgroup-limits)
(setq gnus-newsgroup-limit nil)
(maphash
(lambda (id deps)
(lambda (_id deps)
(unless (car deps)
;; These threads have no parents -- they are roots.
(let ((nodes (cdr deps))
@ -9524,6 +9576,9 @@ fetched headers for, whether they are displayed or not."
(func `(lambda (h) (,(intern (concat "mail-header-" header)) h)))
(case-fold-search t))
(dolist (header gnus-newsgroup-headers)
;; FIXME: when called from gnus-summary-limit-include-thread via
;; gnus-summary-limit-include-matching-articles, `regexp' is a decoded
;; string whereas the header isn't decoded.
(when (string-match regexp (funcall func header))
(push (mail-header-number header) articles)))
(nreverse articles)))
@ -9538,7 +9593,7 @@ be taken into consideration. If NOT-CASE-FOLD, case won't be folded
in the comparisons. If NOT-MATCHING, return a list of all articles that
not match REGEXP on HEADER."
(let ((case-fold-search (not not-case-fold))
articles d func)
articles func)
(if (consp header)
(if (eq (car header) 'extra)
(setq func
@ -9658,6 +9713,10 @@ to save in."
(gnus-summary-remove-process-mark article))
(ps-despool filename))
(defvar ps-right-header)
(defvar ps-left-header)
(defvar shr-ignore-cache)
(defun gnus-print-buffer ()
(let ((ps-left-header
(list
@ -9883,7 +9942,7 @@ prefix specifies how many places to rotate each letter forward."
;; Create buttons and stuff...
(gnus-treat-article nil))
(defun gnus-summary-idna-message (&optional arg)
(defun gnus-summary-idna-message (&optional _arg)
"Decode IDNA encoded domain names in the current articles.
IDNA encoded domain names looks like `xn--bar'. If a string
remain unencoded after running this function, it is likely an
@ -9891,7 +9950,7 @@ invalid IDNA string (`xn--bar' is invalid).
You must have GNU Libidn (URL `https://www.gnu.org/software/libidn/')
installed for this command to work."
(interactive "P")
(interactive)
(gnus-summary-select-article)
(let ((mail-header-separator ""))
(gnus-eval-in-buffer-window gnus-article-buffer
@ -9903,9 +9962,9 @@ installed for this command to work."
(replace-match (puny-decode-domain (match-string 1))))
(set-window-start (get-buffer-window (current-buffer)) start))))))
(defun gnus-summary-morse-message (&optional arg)
(defun gnus-summary-morse-message (&optional _arg)
"Morse decode the current article."
(interactive "P")
(interactive)
(gnus-summary-select-article)
(let ((mail-header-separator ""))
(gnus-eval-in-buffer-window gnus-article-buffer
@ -9963,11 +10022,11 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
(cond ((and (eq action 'move)
(not (gnus-check-backend-function
'request-move-article gnus-newsgroup-name)))
(error "The current group does not support article moving"))
(user-error "The current group does not support article moving"))
((and (eq action 'crosspost)
(not (gnus-check-backend-function
'request-replace-article gnus-newsgroup-name)))
(error "The current group does not support article editing")))
(user-error "The current group does not support article editing")))
(let ((articles (gnus-summary-work-articles n))
(prefix (if (gnus-check-backend-function
'request-move-article gnus-newsgroup-name)
@ -9979,7 +10038,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
(crosspost "Crosspost" "Crossposting")))
(copy-buf (save-excursion
(nnheader-set-temp-buffer " *copy article*")))
art-group to-method new-xref to-groups
art-group to-method new-xref article to-groups
articles-to-update-marks encoded)
(unless (assq action names)
(error "Unknown action %s" action))
@ -10029,7 +10088,9 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
(or (car select-method)
(gnus-group-decoded-name to-newsgroup))
articles)
(dolist (article articles)
;; This `while' is not equivalent to a `dolist' (bug#33653#134).
(while articles
(setq article (pop articles))
;; Set any marks that may have changed in the summary buffer.
(when gnus-preserve-marks
(gnus-summary-push-marks-to-backend article))
@ -10231,7 +10292,7 @@ ACTION can be either `move' (the default), `crosspost' or `copy'."
to-newsgroup
select-method))
;;;!!!Why is this necessary?
;;!!!Why is this necessary?
(set-buffer gnus-summary-buffer)
(when (eq action 'move)
@ -10597,7 +10658,7 @@ groups."
(let ((mbl mml-buffer-list))
(setq mml-buffer-list nil)
(let ((rfc2047-quote-decoded-words-containing-tspecials t))
(mime-to-mml ,'current-handles))
(mime-to-mml ',current-handles))
(let ((mbl1 mml-buffer-list))
(setq mml-buffer-list mbl)
(set (make-local-variable 'mml-buffer-list) mbl1))
@ -10885,8 +10946,8 @@ the actual number of articles unmarked is returned."
(set var (cons article (symbol-value var)))
(if (memq type '(processable cached replied forwarded recent saved))
(gnus-summary-update-secondary-mark article)
;;; !!! This is bogus. We should find out what primary
;;; !!! mark we want to set.
;; !!! This is bogus. We should find out what primary
;; !!! mark we want to set.
(gnus-summary-update-mark gnus-del-mark 'unread)))))
(defun gnus-summary-mark-as-expirable (n)
@ -12015,10 +12076,10 @@ Argument REVERSE means reverse order."
(interactive "P")
(gnus-summary-sort 'marks reverse))
(defun gnus-summary-sort-by-original (&optional reverse)
(defun gnus-summary-sort-by-original (&optional _reverse)
"Sort the summary buffer using the default sorting method.
Argument REVERSE means reverse order."
(interactive "P")
(interactive)
(let* ((inhibit-read-only t)
(gnus-summary-prepare-hook nil))
;; We do the sorting by regenerating the threads.
@ -12344,7 +12405,7 @@ save those articles instead."
(string= to-newsgroup prefix))
(setq to-newsgroup default))
(unless to-newsgroup
(error "No group name entered"))
(user-error "No group name entered"))
(setq encoded (encode-coding-string
to-newsgroup
(gnus-group-name-charset to-method to-newsgroup)))
@ -12356,7 +12417,7 @@ save those articles instead."
(gnus-activate-group encoded nil nil to-method)
(gnus-subscribe-group encoded))
(error "Couldn't create group %s" to-newsgroup)))
(error "No such group: %s" to-newsgroup))
(user-error "No such group: %s" to-newsgroup))
encoded)))
(defvar gnus-summary-save-parts-counter)
@ -12654,14 +12715,21 @@ If REVERSE, save parts that do not match TYPE."
(c cond)
(list gnus-summary-highlight))
(while list
(setcdr c (cons (list (caar list) (list 'quote (cdar list)))
nil))
(setcdr c `((,(caar list) ',(cdar list))))
(setq c (cdr c)
list (cdr list)))
(gnus-byte-compile (list 'lambda nil cond))))))
(gnus-byte-compile
`(lambda ()
(with-no-warnings ;See docstring of gnus-summary-highlight.
(defvar score) (defvar default) (defvar default-high)
(defvar default-low) (defvar mark) (defvar uncached))
,cond))))))
(defun gnus-summary-highlight-line ()
"Highlight current line according to `gnus-summary-highlight'."
(with-no-warnings ;See docstring of gnus-summary-highlight.
(defvar score) (defvar default) (defvar default-high) (defvar default-low)
(defvar mark) (defvar uncached))
(let* ((beg (point-at-bol))
(article (or (gnus-summary-article-number) gnus-current-article))
(score (or (cdr (assq article

View file

@ -476,29 +476,32 @@ If MODE is not set, try to find mode automatically."
(mm-decode-string text charset))
(t
text)))
(require 'font-lock)
;; I find font-lock a bit too verbose.
(let ((font-lock-verbose nil)
(font-lock-support-mode nil)
(let ((font-lock-verbose nil) ; font-lock is a bit too verbose.
(enable-local-variables nil))
;; Disable support modes, e.g., jit-lock, lazy-lock, etc.
;; Note: XEmacs people use `font-lock-mode-hook' to run those modes.
;; We used to set font-lock-mode-hook to nil to avoid enabling
;; support modes, but now that we use font-lock-ensure, support modes
;; aren't a problem any more. So we could probably get rid of this
;; setting now, but it seems harmless and potentially still useful.
(set (make-local-variable 'font-lock-mode-hook) nil)
(setq buffer-file-name (mm-handle-filename handle))
(with-demoted-errors
(if mode
(save-window-excursion
(switch-to-buffer (current-buffer))
(funcall mode))
(if mode
(save-window-excursion
;; According to Katsumi Yamaoka <yamaoka@jpl.org>, org-mode
;; requires the buffer to be temporarily displayed here, but
;; I could not reproduce this problem. Furthermore, if
;; there's such a problem, we should fix org-mode rather than
;; use switch-to-buffer which can have undesirable
;; side-effects!
;;(switch-to-buffer (current-buffer))
(funcall mode))
(let ((auto-mode-alist
(delq (rassq 'doc-view-mode-maybe auto-mode-alist)
(copy-sequence auto-mode-alist))))
(set-auto-mode)
(setq mode major-mode)))
;; The mode function might have already turned on font-lock.
;; Do not fontify if the guess mode is fundamental.
(unless (or font-lock-mode
(eq major-mode 'fundamental-mode))
(unless (eq major-mode 'fundamental-mode)
(font-lock-ensure))))
(setq text (buffer-string))
(when (eq mode 'diff-mode)
@ -508,7 +511,7 @@ If MODE is not set, try to find mode automatically."
;; Set buffer unmodified to avoid confirmation when killing the
;; buffer.
(set-buffer-modified-p nil))
(let ((b (1- (point))))
(let ((b (- (point) (save-restriction (widen) (point-min)))))
(mm-insert-inline handle text)
(dolist (ov ovs)
(move-overlay (nth 0 ov) (+ (nth 1 ov) b)

View file

@ -663,7 +663,7 @@ nn*-request-list should have been called before calling this function."
(narrow-to-region (point) (point-at-eol))
(setq group (read buffer))
(unless (stringp group)
(setq group (symbol-name group)))
(setq group (encode-coding-string (symbol-name group) 'latin-1)))
(if (and (numberp (setq max (read buffer)))
(numberp (setq min (read buffer))))
(push (list group (cons min max))

View file

@ -259,7 +259,7 @@ non-nil.")
(t
(nnheader-re-read-dir nnml-current-directory)
(nnmail-activate 'nnml)
(let ((active (nth 1 (assoc group nnml-group-alist))))
(let ((active (nth 1 (assoc-string group nnml-group-alist))))
(if (not active)
(nnheader-report 'nnml "No such group: %s" decoded)
(nnheader-report 'nnml "Selected group %s" decoded)
@ -295,7 +295,7 @@ non-nil.")
(nnheader-report 'nnml "%s is a file"
(directory-file-name (nnml-group-pathname group
nil server))))
((assoc group nnml-group-alist)
((assoc-string group nnml-group-alist)
t)
(t
(let (active)
@ -379,7 +379,7 @@ non-nil.")
(nnml-nov-delete-article group number))
(push number rest)))
(push number rest)))
(let ((active (nth 1 (assoc group nnml-group-alist))))
(let ((active (nth 1 (assoc-string group nnml-group-alist))))
(when active
(setcar active (or (and active-articles
(apply 'min active-articles))
@ -520,7 +520,7 @@ non-nil.")
(nnheader-report 'nnml "No such directory: %s/" file))
;; Remove the group from all structures.
(setq nnml-group-alist
(delq (assoc group nnml-group-alist) nnml-group-alist)
(delq (assoc-string group nnml-group-alist) nnml-group-alist)
nnml-current-group nil
nnml-current-directory nil)
;; Save the active file.
@ -549,7 +549,7 @@ non-nil.")
(when (<= (length (directory-files old-dir)) 2)
(ignore-errors (delete-directory old-dir)))
;; That went ok, so we change the internal structures.
(let ((entry (assoc group nnml-group-alist)))
(let ((entry (assoc-string group nnml-group-alist)))
(when entry
(setcar entry new-name))
(setq nnml-current-directory nil
@ -597,7 +597,7 @@ non-nil.")
(when (setq path (nnml-article-to-file article))
(when (file-writable-p path)
(or (not nnmail-keep-last-article)
(not (eq (cdr (nth 1 (assoc group nnml-group-alist)))
(not (eq (cdr (nth 1 (assoc-string group nnml-group-alist)))
article)))))))
;; Find an article number in the current group given the Message-ID.
@ -742,7 +742,7 @@ article number. This function is called narrowed to an article."
"Compute the next article number in GROUP on SERVER."
(let* ((encoded (if nnmail-group-names-not-encoded-p
(nnml-encoded-group-name group server)))
(active (cadr (assoc (or encoded group) nnml-group-alist))))
(active (cadr (assoc-string (or encoded group) nnml-group-alist))))
;; The group wasn't known to nnml, so we just create an active
;; entry for it.
(unless active
@ -783,7 +783,7 @@ article number. This function is called narrowed to an article."
(cdr nnml-incremental-nov-buffer-alist)))))
(defun nnml-open-incremental-nov (group)
(or (cdr (assoc group nnml-incremental-nov-buffer-alist))
(or (cdr (assoc-string group nnml-incremental-nov-buffer-alist))
(let ((buffer (nnml-get-nov-buffer group t)))
(push (cons group buffer) nnml-incremental-nov-buffer-alist)
buffer)))

View file

@ -340,10 +340,10 @@ for decoding when the cdr that the data specify is not available.")
(let (elem)
;; There may be two or more entries in `nnrss-group-alist' since
;; this function didn't delete them formerly.
(while (setq elem (assoc group nnrss-group-alist))
(while (setq elem (assoc-string group nnrss-group-alist))
(setq nnrss-group-alist (delq elem nnrss-group-alist))))
(setq nnrss-server-data
(delq (assoc group nnrss-server-data) nnrss-server-data))
(delq (assoc-string group nnrss-server-data) nnrss-server-data))
(nnrss-save-server-data server)
(ignore-errors
(let ((file-name-coding-system nnmail-pathname-coding-system))
@ -367,7 +367,7 @@ for decoding when the cdr that the data specify is not available.")
(with-current-buffer nntp-server-buffer
(erase-buffer)
(dolist (group groups)
(let ((elem (assoc (gnus-group-decoded-name group) nnrss-server-data)))
(let ((elem (assoc-string (gnus-group-decoded-name group) nnrss-server-data)))
(insert (format "%S %s 1 y\n" group (or (cadr elem) 0)))))
'active))
@ -539,7 +539,7 @@ which RSS 2.0 allows."
(if (hash-table-p nnrss-group-hashtb)
(clrhash nnrss-group-hashtb)
(setq nnrss-group-hashtb (make-hash-table :test 'equal)))
(let ((pair (assoc group nnrss-server-data)))
(let ((pair (assoc-string group nnrss-server-data)))
(setq nnrss-group-max (or (cadr pair) 0))
(setq nnrss-group-min (+ nnrss-group-max 1)))
(let ((file (nnrss-make-filename group server))
@ -644,8 +644,8 @@ which RSS 2.0 allows."
(concat group ".xml"))
nnrss-directory))))
(setq xml (nnrss-fetch file t))
(setq url (or (nth 2 (assoc group nnrss-server-data))
(cadr (assoc group nnrss-group-alist))))
(setq url (or (nth 2 (assoc-string group nnrss-server-data))
(cadr (assoc-string group nnrss-group-alist))))
(unless url
(setq url
(cdr
@ -653,7 +653,7 @@ which RSS 2.0 allows."
(nnrss-discover-feed
(read-string
(format "URL to search for %s: " group) "http://")))))
(let ((pair (assoc group nnrss-server-data)))
(let ((pair (assoc-string group nnrss-server-data)))
(if pair
(setcdr (cdr pair) (list url))
(push (list group nnrss-group-max url) nnrss-server-data)))
@ -721,7 +721,7 @@ which RSS 2.0 allows."
(setq extra nil))
(when changed
(nnrss-save-group-data group server)
(let ((pair (assoc group nnrss-server-data)))
(let ((pair (assoc-string group nnrss-server-data)))
(if pair
(setcar (cdr pair) nnrss-group-max)
(push (list group nnrss-group-max) nnrss-server-data)))
@ -792,7 +792,7 @@ It is useful when `(setq nnrss-use-local t)'."
(insert "RSSDIR='" (expand-file-name nnrss-directory) "'\n")
(dolist (elem nnrss-server-data)
(let ((url (or (nth 2 elem)
(cadr (assoc (car elem) nnrss-group-alist)))))
(cadr (assoc-string (car elem) nnrss-group-alist)))))
(insert "$WGET -q -O \"$RSSDIR\"/'"
(nnrss-translate-file-chars (concat (car elem) ".xml"))
"' '" url "'\n"))))

View file

@ -600,8 +600,9 @@ considered.
If the previous nonblank line has no indent points beyond the
column point starts at, then `tab-to-tab-stop' is done, if both
FIRST-ONLY and UNINDENTED-OK are nil, otherwise nothing is done
in this case.
FIRST-ONLY and UNINDENTED-OK are nil, otherwise nothing is done.
If there isn't a previous nonblank line and UNINDENTED-OK is nil,
call `tab-to-tab-stop'.
See also `indent-relative-first-indent-point'."
(interactive "P")

View file

@ -4768,7 +4768,7 @@ first line or header line, and for breadcrumb links.")
;; This is a serious problem for trying to handle multiple
;; frame types at once. We want this text to be invisible
;; on frames that can display the font above.
(when (memq (framep (selected-frame)) '(x pc w32 ns))
(when (display-multi-font-p)
(add-text-properties (1- (match-beginning 2)) (match-end 2)
'(invisible t front-sticky nil rear-nonsticky t))))))

View file

@ -568,7 +568,7 @@ While this input method is active, the variable
(quail-delete-overlays)
(setq describe-current-input-method-function nil)
(quail-hide-guidance)
(remove-hook 'post-command-hook 'quail-show-guidance t)
(remove-hook 'post-command-hook #'quail-show-guidance t)
(run-hooks 'quail-deactivate-hook))
(kill-local-variable 'input-method-function))
;; Let's activate Quail input method.
@ -579,19 +579,18 @@ While this input method is active, the variable
(setq name (car (car quail-package-alist)))
(error "No Quail package loaded"))
(quail-select-package name)))
(setq deactivate-current-input-method-function 'quail-deactivate)
(setq describe-current-input-method-function 'quail-help)
(setq deactivate-current-input-method-function #'quail-deactivate)
(setq describe-current-input-method-function #'quail-help)
(quail-delete-overlays)
(setq quail-guidance-str "")
(quail-show-guidance)
;; If we are in minibuffer, turn off the current input method
;; before exiting.
(when (eq (selected-window) (minibuffer-window))
(add-hook 'minibuffer-exit-hook 'quail-exit-from-minibuffer)
(add-hook 'post-command-hook 'quail-show-guidance nil t))
(add-hook 'minibuffer-exit-hook #'quail-exit-from-minibuffer)
(add-hook 'post-command-hook #'quail-show-guidance nil t))
(run-hooks 'quail-activate-hook)
(make-local-variable 'input-method-function)
(setq input-method-function 'quail-input-method)))
(setq-local input-method-function #'quail-input-method)))
(define-obsolete-variable-alias
'quail-inactivate-hook
@ -1367,9 +1366,7 @@ If STR has `advice' text property, append the following special event:
(let ((start (overlay-start overlay))
(end (overlay-end overlay)))
(if (< start end)
(prog1
(string-to-list (buffer-substring start end))
(delete-region start end)))))
(string-to-list (delete-and-extract-region start end)))))
(defsubst quail-delete-region ()
"Delete the text in the current translation region of Quail."

View file

@ -1,6 +1,6 @@
;;; sami.el --- Quail package for inputting Sámi -*-coding: utf-8;-*-
;; Copyright (C) 1998, 2001-2019 Free Software Foundation, Inc.
;; Copyright (C) 2019 Free Software Foundation, Inc.
;; Author: Wojciech S. Gac <wojciech.s.gac@gmail.com>
;; Maintainer: Wojciech S. Gac <wojciech.s.gac@gmail.com>>

View file

@ -968,7 +968,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(program (car command))
(args (cdr command))
(command
(format "cd %s; %s"
(format "cd %s && exec %s"
(tramp-shell-quote-argument localname)
(mapconcat #'tramp-shell-quote-argument
(cons program args) " ")))
@ -1000,24 +1000,16 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
;; otherwise we might be interrupted by
;; `verify-visited-file-modtime'.
(let ((buffer-undo-list t)
(inhibit-read-only t)
(mark (point)))
(inhibit-read-only t))
(clear-visited-file-modtime)
(narrow-to-region (point-max) (point-max))
;; We call `tramp-adb-maybe-open-connection', in
;; order to cleanup the prompt afterwards.
(tramp-adb-maybe-open-connection v)
(widen)
(delete-region mark (point-max))
(narrow-to-region (point-max) (point-max))
(delete-region (point-min) (point-max))
;; Send the command.
(let* ((p (tramp-get-connection-process v))
(prompt
(tramp-get-connection-property p "prompt" nil)))
(tramp-set-connection-property
p "prompt" (regexp-quote command))
(tramp-adb-send-command v command)
(tramp-set-connection-property p "prompt" prompt)
(let* ((p (tramp-get-connection-process v)))
(tramp-adb-send-command v command nil t) ; nooutput
;; Stop process if indicated.
(when stop
(stop-process p))
@ -1032,6 +1024,14 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(ignore-errors
(set-process-query-on-exit-flag p (null noquery))
(set-marker (process-mark p) (point)))
;; Read initial output. Remove the first line,
;; which is the command echo.
(while
(progn
(goto-char (point-min))
(not (re-search-forward "[\n]" nil t)))
(tramp-accept-process-output p 0))
(delete-region (point-min) (point))
;; Return process.
p))))
@ -1119,26 +1119,27 @@ This happens for Android >= 4.0."
;; Connection functions
(defun tramp-adb-send-command (vec command)
(defun tramp-adb-send-command (vec command &optional neveropen nooutput)
"Send the COMMAND to connection VEC."
(tramp-adb-maybe-open-connection vec)
(unless neveropen (tramp-adb-maybe-open-connection vec))
(tramp-message vec 6 "%s" command)
(tramp-send-string vec command)
;; FIXME: Race condition.
(tramp-adb-wait-for-output (tramp-get-connection-process vec))
(with-current-buffer (tramp-get-connection-buffer vec)
(save-excursion
(goto-char (point-min))
;; We can't use stty to disable echo of command. stty is said
;; to be added to toybox 0.7.6. busybox shall have it, but this
;; isn't used any longer for Android.
(delete-matching-lines (regexp-quote command))
;; When the local machine is W32, there are still trailing ^M.
;; There must be a better solution by setting the correct coding
;; system, but this requires changes in core Tramp.
(goto-char (point-min))
(while (re-search-forward "\r+$" nil t)
(replace-match "" nil nil)))))
(unless nooutput
;; FIXME: Race condition.
(tramp-adb-wait-for-output (tramp-get-connection-process vec))
(with-current-buffer (tramp-get-connection-buffer vec)
(save-excursion
(goto-char (point-min))
;; We can't use stty to disable echo of command. stty is said
;; to be added to toybox 0.7.6. busybox shall have it, but this
;; isn't used any longer for Android.
(delete-matching-lines (regexp-quote command))
;; When the local machine is W32, there are still trailing ^M.
;; There must be a better solution by setting the correct coding
;; system, but this requires changes in core Tramp.
(goto-char (point-min))
(while (re-search-forward "\r+$" nil t)
(replace-match "" nil nil))))))
(defun tramp-adb-send-command-and-check (vec command)
"Run COMMAND and check its exit status.
@ -1245,6 +1246,9 @@ connection if a previous connection has died for some reason."
(tramp-adb-wait-for-output p 30)
(unless (process-live-p p)
(tramp-error vec 'file-error "Terminated!"))
;; Set sentinel and query flag. Initialize variables.
(set-process-sentinel p #'tramp-process-sentinel)
(process-put p 'vector vec)
(process-put p 'adjust-window-size-function #'ignore)
(set-process-query-on-exit-flag p nil)

View file

@ -584,9 +584,7 @@ offered."
(defun tramp-archive-handle-file-readable-p (filename)
"Like `file-readable-p' for file archives."
(with-parsed-tramp-file-name
(tramp-archive-gvfs-file-name filename) nil
(tramp-check-cached-permissions v ?r)))
(file-readable-p (tramp-archive-gvfs-file-name filename)))
(defun tramp-archive-handle-file-system-info (filename)
"Like `file-system-info' for file archives."

View file

@ -1136,7 +1136,8 @@ If FILE-SYSTEM is non-nil, return file system attributes."
"Like `file-executable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-executable-p"
(tramp-check-cached-permissions v ?x))))
(and (file-exists-p filename)
(tramp-check-cached-permissions v ?x)))))
(defun tramp-gvfs-handle-file-name-all-completions (filename directory)
"Like `file-name-all-completions' for Tramp files."
@ -1258,7 +1259,20 @@ file-notify events."
"Like `file-readable-p' for Tramp files."
(with-parsed-tramp-file-name filename nil
(with-tramp-file-property v localname "file-readable-p"
(tramp-check-cached-permissions v ?r))))
(and (file-exists-p filename)
(or (tramp-check-cached-permissions v ?r)
;; If the user is different from what we guess to be
;; the user, we don't know. Let's check, whether
;; access is restricted explicitly.
(and (/= (tramp-gvfs-get-remote-uid v 'integer)
(tramp-compat-file-attribute-user-id
(file-attributes filename 'integer)))
(not
(string-equal
"FALSE"
(cdr (assoc
"access::can-read"
(tramp-gvfs-get-file-attributes filename)))))))))))
(defun tramp-gvfs-handle-file-system-info (filename)
"Like `file-system-info' for Tramp files."

View file

@ -2769,15 +2769,6 @@ the result will be a local, non-Tramp, file name."
;;; Remote commands:
(defun tramp-process-sentinel (proc event)
"Flush file caches."
(unless (process-live-p proc)
(let ((vec (process-get proc 'vector)))
(when vec
(tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event)
(tramp-flush-connection-properties proc)
(tramp-flush-directory-properties vec "")))))
;; We use BUFFER also as connection buffer during setup. Because of
;; this, its original contents must be saved, and restored once
;; connection has been setup.
@ -2912,8 +2903,7 @@ the result will be a local, non-Tramp, file name."
;; otherwise we might be interrupted by
;; `verify-visited-file-modtime'.
(let ((buffer-undo-list t)
(inhibit-read-only t)
(mark (point-max)))
(inhibit-read-only t))
(clear-visited-file-modtime)
(narrow-to-region (point-max) (point-max))
;; We call `tramp-maybe-open-connection', in
@ -2926,9 +2916,7 @@ the result will be a local, non-Tramp, file name."
(let ((pid (tramp-send-command-and-read v "echo $$")))
(process-put p 'remote-pid pid)
(tramp-set-connection-property p "remote-pid" pid))
(widen)
(delete-region mark (point-max))
(narrow-to-region (point-max) (point-max))
(delete-region (point-min) (point-max))
;; Now do it.
(if command
;; Send the command.

View file

@ -2801,14 +2801,14 @@ for all methods. Resulting data are derived from default settings."
:port method :require '(:port) :max most-positive-fixnum))))
;; Generic function.
(defun tramp-parse-group (regexp match-level skip-regexp)
(defun tramp-parse-group (regexp match-level skip-chars)
"Return a (user host) tuple allowed to access.
User is always nil."
(let (result)
(when (re-search-forward regexp (point-at-eol) t)
(setq result (list nil (match-string match-level))))
(or
(> (skip-chars-forward skip-regexp) 0)
(> (skip-chars-forward skip-chars) 0)
(forward-line 1))
result))
@ -2864,7 +2864,7 @@ User is always nil."
(tramp-parse-group
(concat "\\(?:^[ \t]*Host\\)" "\\|" "\\(?:^.+\\)"
"\\|" "\\(" tramp-host-regexp "\\)")
1 "[ \t]+"))
1 " \t"))
;; Generic function.
(defun tramp-parse-shostkeys-sknownhosts (dirname regexp)
@ -4212,6 +4212,19 @@ the remote host use line-endings as defined in the variable
;; Reenable the timers.
(with-timeout-unsuspend stimers))))
(defun tramp-process-sentinel (proc event)
"Flush file caches and remove shell prompt."
(unless (process-live-p proc)
(let ((vec (process-get proc 'vector))
(prompt (tramp-get-connection-property proc "prompt" nil)))
(when vec
(tramp-message vec 5 "Sentinel called: `%S' `%s'" proc event)
(tramp-flush-connection-properties proc)
(tramp-flush-directory-properties vec ""))
(goto-char (point-max))
(when (and prompt (re-search-backward (regexp-quote prompt) nil t))
(delete-region (point) (point-max))))))
(defun tramp-get-inode (vec)
"Returns the virtual inode number.
If it doesn't exist, generate a new one."

View file

@ -327,11 +327,11 @@ behavior for explicit filling, you might as well use \\[newline-and-indent]."
(defcustom comment-empty-lines nil
"If nil, `comment-region' does not comment out empty lines.
If t, it always comments out empty lines.
If `eol' it only comments out empty lines if comments are
terminated by the end of line (i.e. `comment-end' is empty)."
If `eol', it only comments out empty lines if comments are
terminated by the end of line (i.e., `comment-end' is empty)."
:type '(choice (const :tag "Never" nil)
(const :tag "Always" t)
(const :tag "EOl-terminated" eol))
(const :tag "Always" t)
(const :tag "EOL-terminated" eol))
:group 'comment)
;;;;

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
;; bug-reference.el --- buttonize bug references
;; bug-reference.el --- buttonize bug references -*- lexical-binding: t; -*-
;; Copyright (C) 2008-2019 Free Software Foundation, Inc.
@ -91,7 +91,7 @@ The second subexpression should match the bug reference (usually a number)."
(bug-reference-set-overlay-properties)
(defun bug-reference-unfontify (start end)
"Remove bug reference overlays from region."
"Remove bug reference overlays from the region between START and END."
(dolist (o (overlays-in start end))
(when (eq (overlay-get o 'category) 'bug-reference)
(delete-overlay o))))
@ -99,7 +99,7 @@ The second subexpression should match the bug reference (usually a number)."
(defvar bug-reference-prog-mode)
(defun bug-reference-fontify (start end)
"Apply bug reference overlays to region."
"Apply bug reference overlays to the region between START and END."
(save-excursion
(let ((beg-line (progn (goto-char start) (line-beginning-position)))
(end-line (progn (goto-char end) (line-end-position))))

View file

@ -562,7 +562,7 @@ LINE, END-LINE, COL, and END-COL can also be functions of no argument
that return the corresponding line or column number. They can assume REGEXP
has just been matched, and should correspondingly preserve this match data.
f/usr/shaTYPE is 2 or nil for a real error or 1 for warning or 0 for info.
TYPE is 2 or nil for a real error or 1 for warning or 0 for info.
TYPE can also be of the form (WARNING . INFO). In that case this
will be equivalent to 1 if the WARNING'th subexpression matched
or else equivalent to 0 if the INFO'th subexpression matched.
@ -2056,8 +2056,7 @@ by replacing the first word, e.g., `compilation-scroll-output' from
(if (boundp 'byte-compile-bound-variables)
(memq (cdr v) byte-compile-bound-variables)))
`(set (make-local-variable ',(car v)) ,(cdr v))))
'(compilation-buffer-name-function
compilation-directory-matcher
'(compilation-directory-matcher
compilation-error
compilation-error-regexp-alist
compilation-error-regexp-alist-alist

View file

@ -959,8 +959,16 @@ substitution string. Note dynamic scoping of variables.")
The pattern can include shell wildcards. As whitespace triggers
completion when entering a pattern, including it requires
quoting, e.g. `\\[quoted-insert]<space>'."
(let* ((bn (or (buffer-file-name)
(replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name))))
(let* ((grep-read-files-function (get major-mode 'grep-read-files))
(file-name-at-point
(run-hook-with-args-until-success 'file-name-at-point-functions))
(bn (if grep-read-files-function
(funcall grep-read-files-function)
(or (if (and (stringp file-name-at-point)
(not (file-directory-p file-name-at-point)))
file-name-at-point)
(buffer-file-name)
(replace-regexp-in-string "<[0-9]+>\\'" "" (buffer-name)))))
(fn (and bn
(stringp bn)
(file-name-nondirectory bn)))

File diff suppressed because it is too large Load diff

View file

@ -675,7 +675,7 @@ Which one will be chosen depends on the value of
(defconst python-syntax-propertize-function
(syntax-propertize-rules
((python-rx string-delimiter)
((rx (or "\"\"\"" "'''"))
(0 (ignore (python-syntax-stringify))))))
(define-obsolete-variable-alias 'python--prettify-symbols-alist
@ -701,35 +701,27 @@ is used to limit the scan."
(defun python-syntax-stringify ()
"Put `syntax-table' property correctly on single/triple quotes."
(let* ((num-quotes (length (match-string-no-properties 1)))
(ppss (prog2
(backward-char num-quotes)
(syntax-ppss)
(forward-char num-quotes)))
(string-start (and (not (nth 4 ppss)) (nth 8 ppss)))
(quote-starting-pos (- (point) num-quotes))
(quote-ending-pos (point))
(num-closing-quotes
(and string-start
(python-syntax-count-quotes
(char-before) string-start quote-starting-pos))))
(cond ((and string-start (= num-closing-quotes 0))
;; This set of quotes doesn't match the string starting
;; kind. Do nothing.
(let* ((ppss (save-excursion (backward-char 3) (syntax-ppss)))
(string-start (and (eq t (nth 3 ppss)) (nth 8 ppss)))
(quote-starting-pos (- (point) 3))
(quote-ending-pos (point)))
(cond ((or (nth 4 ppss) ;Inside a comment
(and string-start
;; Inside of a string quoted with different triple quotes.
(not (eql (char-after string-start)
(char-after quote-starting-pos)))))
;; Do nothing.
nil)
((not string-start)
((nth 5 ppss)
;; The first quote is escaped, so it's not part of a triple quote!
(goto-char (1+ quote-starting-pos)))
((null string-start)
;; This set of quotes delimit the start of a string.
(put-text-property quote-starting-pos (1+ quote-starting-pos)
'syntax-table (string-to-syntax "|")))
((= num-quotes num-closing-quotes)
(t
;; This set of quotes delimit the end of a string.
(put-text-property (1- quote-ending-pos) quote-ending-pos
'syntax-table (string-to-syntax "|")))
((> num-quotes num-closing-quotes)
;; This may only happen whenever a triple quote is closing
;; a single quoted string. Add string delimiter syntax to
;; all three quotes.
(put-text-property quote-starting-pos quote-ending-pos
'syntax-table (string-to-syntax "|"))))))
(defvar python-mode-syntax-table

View file

@ -2905,8 +2905,7 @@ STRING This is ignored for the purposes of calculating
(setq align-point (point))))
(or (bobp)
(forward-char -1))
;; FIXME: This charset looks too much like a regexp. --Stef
(skip-chars-forward "[a-z0-9]*?")
(skip-chars-forward "*0-9?[]a-z")
)
((string-match "[])}]" x)
(setq x (sh-safe-forward-sexp -1))

View file

@ -14263,13 +14263,13 @@ and the case items."
(defun verilog-sk-define-signal ()
"Insert a definition of signal under point at top of module."
(interactive "*")
(let* ((sig-re "[a-zA-Z0-9_]*")
(let* ((sig-chars "a-zA-Z0-9_")
(v1 (buffer-substring
(save-excursion
(skip-chars-backward sig-re)
(skip-chars-backward sig-chars)
(point))
(save-excursion
(skip-chars-forward sig-re)
(skip-chars-forward sig-chars)
(point)))))
(if (not (member v1 verilog-keywords))
(save-excursion

View file

@ -2643,22 +2643,24 @@ characters."
(setq def (lookup-key map key))
;; Restore the match data while we process the command.
(cond ((eq def 'help)
(with-output-to-temp-buffer "*Help*"
(princ
(concat "Query replacing "
(if backward "backward " "")
(if delimited-flag
(or (and (symbolp delimited-flag)
(get delimited-flag
'isearch-message-prefix))
"word ") "")
(if regexp-flag "regexp " "")
from-string " with "
next-replacement ".\n\n"
(substitute-command-keys
query-replace-help)))
(with-current-buffer standard-output
(help-mode))))
(let ((display-buffer-overriding-action
'(nil (inhibit-same-window . t))))
(with-output-to-temp-buffer "*Help*"
(princ
(concat "Query replacing "
(if backward "backward " "")
(if delimited-flag
(or (and (symbolp delimited-flag)
(get delimited-flag
'isearch-message-prefix))
"word ") "")
(if regexp-flag "regexp " "")
from-string " with "
next-replacement ".\n\n"
(substitute-command-keys
query-replace-help)))
(with-current-buffer standard-output
(help-mode)))))
((eq def 'exit)
(setq keep-going nil)
(setq done t))

View file

@ -8221,6 +8221,9 @@ CHOICE - the string to insert in the buffer,
BUFFER - the buffer in which the choice should be inserted,
BASE-POSITION - where to insert the completion.
Functions should also accept and ignore a potential fourth
argument, passed for backwards compatibility.
If a function in the list returns non-nil, that function is supposed
to have inserted the CHOICE in the BUFFER, and possibly exited
the minibuffer; no further functions will be called.
@ -8705,7 +8708,7 @@ call `normal-erase-is-backspace-mode' (which see) instead."
(and (not noninteractive)
(or (memq system-type '(ms-dos windows-nt))
(memq window-system '(w32 ns))
(and (memq window-system '(x))
(and (eq window-system 'x)
(fboundp 'x-backspace-delete-keys-p)
(x-backspace-delete-keys-p))
;; If the terminal Emacs is running on has erase char
@ -8716,6 +8719,8 @@ call `normal-erase-is-backspace-mode' (which see) instead."
normal-erase-is-backspace)
1 0)))))
(declare-function display-symbol-keys-p "frame" (&optional display))
(define-minor-mode normal-erase-is-backspace-mode
"Toggle the Erase and Delete mode of the Backspace and Delete keys.
@ -8751,8 +8756,7 @@ See also `normal-erase-is-backspace'."
(let ((enabled (eq 1 (terminal-parameter
nil 'normal-erase-is-backspace))))
(cond ((or (memq window-system '(x w32 ns pc))
(memq system-type '(ms-dos windows-nt)))
(cond ((display-symbol-keys-p)
(let ((bindings
'(([M-delete] [M-backspace])
([C-M-delete] [C-M-backspace])

View file

@ -138,7 +138,7 @@ This sets each VAR's default value to the corresponding VALUE.
The VALUE for the Nth VAR can refer to the new default values
of previous VARs.
\(setq-default [VAR VALUE]...)"
\(fn [VAR VALUE]...)"
(declare (debug setq))
(let ((exps nil))
(while args
@ -779,9 +779,9 @@ Elements of ALIST that are not conses are ignored."
alist)
(defun alist-get (key alist &optional default remove testfn)
"Return the value associated with KEY in ALIST.
"Find the first element of ALIST whose `car' equals KEY and return its `cdr'.
If KEY is not found in ALIST, return DEFAULT.
Use TESTFN to lookup in the alist if non-nil. Otherwise, use `assq'.
Equality with KEY is tested by TESTFN, defaulting to `eq'.
You can use `alist-get' in PLACE expressions. This will modify
an existing association (more precisely, the first one if

View file

@ -116,7 +116,7 @@ You can always manually refine a hunk with `diff-refine-hunk'."
"If non-nil, diff hunk font-lock includes source language syntax highlighting.
This highlighting is the same as added by `font-lock-mode'
when corresponding source files are visited normally.
Syntax highlighting is added over diff own highlighted changes.
Syntax highlighting is added over diff-mode's own highlighted changes.
If t, the default, highlight syntax only in Diff buffers created by Diff
commands that compare files or by VC commands that compare revisions.
@ -126,17 +126,17 @@ For diffs against the working-tree version of a file, the highlighting is
based on the current file contents. File-based fontification tries to
infer fontification from the compared files.
If revision-based or file-based method fails, use hunk-based method to get
fontification from hunk alone if the value is `hunk-also'.
If `hunk-only', fontification is based on hunk alone, without full source.
If `hunk-only' fontification is based on hunk alone, without full source.
It tries to highlight hunks without enough context that sometimes might result
in wrong fontification. This is the fastest option, but less reliable."
in wrong fontification. This is the fastest option, but less reliable.
If `hunk-also', use reliable file-based syntax highlighting when available
and hunk-based syntax highlighting otherwise as a fallback."
:version "27.1"
:type '(choice (const :tag "Don't highlight syntax" nil)
(const :tag "Hunk-based also" hunk-also)
(const :tag "Hunk-based only" hunk-only)
(const :tag "Highlight syntax" t)))
(const :tag "Highlight syntax" t)
(const :tag "Allow hunk-based fallback" hunk-also)))
(defvar diff-vc-backend nil
"The VC backend that created the current Diff buffer, if any.")
@ -144,9 +144,8 @@ in wrong fontification. This is the fastest option, but less reliable."
(defvar diff-vc-revisions nil
"The VC revisions compared in the current Diff buffer, if any.")
(defvar diff-default-directory nil
(defvar-local diff-default-directory nil
"The default directory where the current Diff buffer was created.")
(make-variable-buffer-local 'diff-default-directory)
(defvar diff-outline-regexp
"\\([*+][*+][*+] [^0-9]\\|@@ ...\\|\\*\\*\\* [0-9].\\|--- [0-9]..\\)")
@ -2423,7 +2422,9 @@ When OLD is non-nil, highlight the hunk from the old source."
(let* ((hunk (buffer-substring-no-properties beg end))
;; Trim a trailing newline to find hunk in diff-syntax-fontify-props
;; in diffs that have no newline at end of diff file.
(text (string-trim-right (or (with-demoted-errors (diff-hunk-text hunk (not old) nil)) "")))
(text (string-trim-right
(or (with-demoted-errors (diff-hunk-text hunk (not old) nil))
"")))
(line (if (looking-at "\\(?:\\*\\{15\\}.*\n\\)?[-@* ]*\\([0-9,]+\\)\\([ acd+]+\\([0-9,]+\\)\\)?")
(if old (match-string 1)
(if (match-end 3) (match-string 3) (match-string 1)))))
@ -2432,83 +2433,106 @@ When OLD is non-nil, highlight the hunk from the old source."
(list (string-to-number (match-string 1 line))
(string-to-number (match-string 2 line)))
(list (string-to-number line) 1)))) ; One-line diffs
props)
(cond
((and diff-vc-backend (not (eq diff-font-lock-syntax 'hunk-only)))
(let* ((file (diff-find-file-name old t))
(revision (and file (if (not old) (nth 1 diff-vc-revisions)
(or (nth 0 diff-vc-revisions)
(vc-working-revision file))))))
(if file
(if (not revision)
;; Get properties from the current working revision
(when (and (not old) (file-exists-p file) (file-regular-p file))
;; Try to reuse an existing buffer
(if (get-file-buffer (expand-file-name file))
(with-current-buffer (get-file-buffer (expand-file-name file))
(setq props (diff-syntax-fontify-props nil text line-nb)))
;; Get properties from the file
(with-temp-buffer
(insert-file-contents file)
(setq props (diff-syntax-fontify-props file text line-nb)))))
;; Get properties from a cached revision
(let* ((buffer-name (format " *diff-syntax:%s.~%s~*"
(expand-file-name file) revision))
(buffer (gethash buffer-name diff-syntax-fontify-revisions)))
(unless (and buffer (buffer-live-p buffer))
(let* ((vc-buffer (ignore-errors
(vc-find-revision-no-save
(expand-file-name file) revision
diff-vc-backend
(get-buffer-create buffer-name)))))
(when vc-buffer
(setq buffer vc-buffer)
(puthash buffer-name buffer diff-syntax-fontify-revisions))))
(when buffer
(with-current-buffer buffer
(setq props (diff-syntax-fontify-props file text line-nb))))))
;; If file is unavailable, get properties from the hunk alone
(setq file (car (diff-hunk-file-names old)))
(with-temp-buffer
(insert text)
(setq props (diff-syntax-fontify-props file text line-nb t))))))
((and diff-default-directory (not (eq diff-font-lock-syntax 'hunk-only)))
(let ((file (car (diff-hunk-file-names old))))
(if (and file (file-exists-p file) (file-regular-p file))
;; Try to get full text from the file
(with-temp-buffer
(insert-file-contents file)
(setq props (diff-syntax-fontify-props file text line-nb)))
;; Otherwise, get properties from the hunk alone
(with-temp-buffer
(insert text)
(setq props (diff-syntax-fontify-props file text line-nb t))))))
((memq diff-font-lock-syntax '(hunk-also hunk-only))
(let ((file (car (diff-hunk-file-names old))))
(with-temp-buffer
(insert text)
(setq props (diff-syntax-fontify-props file text line-nb t))))))
(props
(or
(when (and diff-vc-backend
(not (eq diff-font-lock-syntax 'hunk-only)))
(let* ((file (diff-find-file-name old t))
(revision (and file (if (not old) (nth 1 diff-vc-revisions)
(or (nth 0 diff-vc-revisions)
(vc-working-revision file))))))
(when file
(if (not revision)
;; Get properties from the current working revision
(when (and (not old) (file-exists-p file)
(file-regular-p file))
(let ((buf (get-file-buffer (expand-file-name file))))
;; Try to reuse an existing buffer
(if buf
(with-current-buffer buf
(diff-syntax-fontify-props nil text line-nb))
;; Get properties from the file
(with-temp-buffer
(insert-file-contents file)
(diff-syntax-fontify-props file text line-nb)))))
;; Get properties from a cached revision
(let* ((buffer-name (format " *diff-syntax:%s.~%s~*"
(expand-file-name file)
revision))
(buffer (gethash buffer-name
diff-syntax-fontify-revisions)))
(unless (and buffer (buffer-live-p buffer))
(let* ((vc-buffer (ignore-errors
(vc-find-revision-no-save
(expand-file-name file) revision
diff-vc-backend
(get-buffer-create buffer-name)))))
(when vc-buffer
(setq buffer vc-buffer)
(puthash buffer-name buffer
diff-syntax-fontify-revisions))))
(when buffer
(with-current-buffer buffer
(diff-syntax-fontify-props file text line-nb))))))))
(let ((file (car (diff-hunk-file-names old))))
(cond
((and file diff-default-directory
(not (eq diff-font-lock-syntax 'hunk-only))
(not diff-vc-backend)
(file-readable-p file) (file-regular-p file))
;; Try to get full text from the file.
(with-temp-buffer
(insert-file-contents file)
(diff-syntax-fontify-props file text line-nb)))
;; Otherwise, get properties from the hunk alone
((memq diff-font-lock-syntax '(hunk-also hunk-only))
(with-temp-buffer
(insert text)
(diff-syntax-fontify-props file text line-nb t))))))))
;; Put properties over the hunk text
(goto-char beg)
(when (and props (eq (diff-hunk-style) 'unified))
(while (< (progn (forward-line 1) (point)) end)
(when (or (and (not old) (not (looking-at-p "[-<]")))
(and old (not (looking-at-p "[+>]"))))
(unless (looking-at-p "\\\\") ; skip "\ No newline at end of file"
(if (and old (not (looking-at-p "[-<]")))
;; Fontify context lines only from new source,
;; don't refontify context lines from old source.
(pop props)
(let ((line-props (pop props))
(bol (1+ (point))))
(dolist (prop line-props)
(let ((ol (make-overlay (+ bol (nth 0 prop))
(+ bol (nth 1 prop))
nil 'front-advance nil)))
(overlay-put ol 'diff-mode 'syntax)
(overlay-put ol 'evaporate t)
(overlay-put ol 'face (nth 2 prop))))))))))))
;; Skip the "\ No newline at end of file" lines as well as the lines
;; corresponding to the "other" version.
(unless (looking-at-p (if old "[+>\\]" "[-<\\]"))
(if (and old (not (looking-at-p "[-<]")))
;; Fontify context lines only from new source,
;; don't refontify context lines from old source.
(pop props)
(let ((line-props (pop props))
(bol (1+ (point))))
(dolist (prop line-props)
;; Ideally, we'd want to use text-properties as in:
;;
;; (add-face-text-property
;; (+ bol (nth 0 prop)) (+ bol (nth 1 prop))
;; (nth 2 prop) 'append)
;;
;; rather than overlays here, but they'd get removed by later
;; font-locking.
;; This is because we also apply faces outside of the
;; beg...end chunk currently font-locked and when font-lock
;; later comes to handle the rest of the hunk that we already
;; handled we don't (want to) redo it (we work at
;; hunk-granularity rather than font-lock's own chunk
;; granularity).
;; I see two ways to fix this:
;; - don't immediately apply the props that fall outside of
;; font-lock's chunk but stash them somewhere (e.g. in another
;; text property) and only later when font-lock comes back
;; move them to `face'.
;; - change the code so work at font-lock's chunk granularity
;; (this seems doable without too much extra overhead,
;; contrary to the refine highlighting, which inherently
;; works at a different granularity).
(let ((ol (make-overlay (+ bol (nth 0 prop))
(+ bol (nth 1 prop))
nil 'front-advance nil)))
(overlay-put ol 'diff-mode 'syntax)
(overlay-put ol 'evaporate t)
(overlay-put ol 'face (nth 2 prop)))))))))))
(defun diff-syntax-fontify-props (file text line-nb &optional hunk-only)
"Get font-lock properties from the source code.
@ -2516,21 +2540,23 @@ FILE is the name of the source file. If non-nil, it requests initialization
of the mode according to FILE.
TEXT is the literal source text from hunk.
LINE-NB is a pair of numbers: start line number and the number of
lines in the hunk. NO-INIT means no initialization is needed to set major
mode. When HUNK-ONLY is non-nil, then don't verify the existence of the
lines in the hunk.
When HUNK-ONLY is non-nil, then don't verify the existence of the
hunk text in the source file. Otherwise, don't highlight the hunk if the
hunk text is not found in the source file."
(when file
;; When initialization is requested, we should be in a brand new
;; temp buffer.
(cl-assert (eq t buffer-undo-list))
(cl-assert (not font-lock-mode))
(cl-assert (null buffer-file-name))
(let ((enable-local-variables :safe) ;; to find `mode:'
(buffer-file-name file))
(set-auto-mode)
(when (and (memq 'generic-mode-find-file-hook find-file-hook)
(fboundp 'generic-mode-find-file-hook))
;; FIXME: Is this really worth the trouble?
(when (and (fboundp 'generic-mode-find-file-hook)
(memq #'generic-mode-find-file-hook
;; There's no point checking the buffer-local value,
;; we're in a fresh new buffer.
(default-value 'find-file-hook)))
(generic-mode-find-file-hook))))
(let ((font-lock-defaults (or font-lock-defaults '(nil t)))

View file

@ -350,7 +350,7 @@ The first subexpression is the actual text of the field.")
(defun log-edit-goto-eoh () ;FIXME: Almost rfc822-goto-eoh!
(goto-char (point-min))
(when (re-search-forward
"^\\([^[:alpha:]]\\|[[:alnum:]-]+[^[:alnum:]-:]\\)" nil 'move)
"^\\([^[:alpha:]]\\|[[:alnum:]-]+[^[:alnum:]-]\\)" nil 'move)
(goto-char (match-beginning 0))))
(defun log-edit--match-first-line (limit)

View file

@ -1806,7 +1806,12 @@ Return t if the buffer had changes, nil otherwise."
;;;###autoload
(defun vc-version-diff (_files rev1 rev2)
"Report diffs between REV1 and REV2 revisions of the fileset."
"Report diffs between revisions REV1 and REV2 in the repository history.
This compares two revisions of the current fileset.
If REV1 is nil, it defaults to the current revision, i.e. revision
of the last commit.
If REV2 is nil, it defaults to the work tree, i.e. the current
state of each file in the fileset."
(interactive (vc-diff-build-argument-list-internal))
;; All that was just so we could do argument completion!
(when (and (not rev1) rev2)
@ -1891,8 +1896,14 @@ The merge base is a common ancestor between REV1 and REV2 revisions."
;;;###autoload
(defun vc-version-ediff (files rev1 rev2)
"Show differences between revisions of the fileset in the
repository history using ediff."
"Show differences between REV1 and REV2 of FILES using ediff.
This compares two revisions of the files in FILES. Currently,
only a single file's revisions can be compared, i.e. FILES can
specify only one file name.
If REV1 is nil, it defaults to the current revision, i.e. revision
of the last commit.
If REV2 is nil, it defaults to the work tree, i.e. the current
state of each file in FILES."
(interactive (vc-diff-build-argument-list-internal))
;; All that was just so we could do argument completion!
(when (and (not rev1) rev2)

View file

@ -1163,8 +1163,9 @@ When not inside a field, signal an error."
(defun widget-at (&optional pos)
"The button or field at POS (default, point)."
(or (get-char-property (or pos (point)) 'button)
(widget-field-at pos)))
(let ((widget (or (get-char-property (or pos (point)) 'button)
(widget-field-at pos))))
(and (widgetp widget) widget)))
;;;###autoload
(defun widget-setup ()

View file

@ -9314,6 +9314,8 @@ is active. This function is run by `mouse-autoselect-window-timer'."
;; autoselection.
(mouse-autoselect-window-start mouse-position window)))))
(declare-function display-multi-frame-p "frame" (&optional display))
(defun handle-select-window (event)
"Handle select-window events."
(interactive "^e")
@ -9351,7 +9353,7 @@ is active. This function is run by `mouse-autoselect-window-timer'."
;; we might get two windows with an active cursor.
(select-window window)
(cond
((or (not (memq (window-system frame) '(x w32 ns)))
((or (not (display-multi-frame-p))
(not focus-follows-mouse)
;; Focus FRAME if it's either a child frame or an ancestor
;; of the frame switched from.

View file

@ -718,10 +718,10 @@ This follows the rule [28] in the XML specifications."
(cond ((looking-at "PUBLIC\\s-+")
(goto-char (match-end 0))
(unless (or (re-search-forward
"\\=\"\\([[:space:][:alnum:]-'()+,./:=?;!*#@$_%]*\\)\""
"\\=\"\\([[:space:][:alnum:]'()+,./:=?;!*#@$_%-]*\\)\""
nil t)
(re-search-forward
"\\='\\([[:space:][:alnum:]-()+,./:=?;!*#@$_%]*\\)'"
"\\='\\([[:space:][:alnum:]()+,./:=?;!*#@$_%-]*\\)'"
nil t))
(error "XML: Missing Public ID"))
(let ((pubid (match-string-no-properties 1)))

View file

@ -366,7 +366,7 @@ possibly_non_vc_files="
$top_level_ChangeLog
MANIFEST aclocal.m4 configure
admin/charsets/jisx2131-filter
src/config.in src/dmpstruct.h src/emacs-module.h
src/config.in src/emacs-module.h
src/fingerprint.c
"$(
find admin doc etc lisp \

View file

@ -331,6 +331,7 @@ BUILD_DETAILS = @BUILD_DETAILS@
UNEXEC_OBJ = @UNEXEC_OBJ@
DUMPING=@DUMPING@
CHECK_STRUCTS = @CHECK_STRUCTS@
# 'make' verbosity.
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@ -458,7 +459,9 @@ all: emacs$(EXEEXT) $(pdmp) $(OTHER_FILES)
dmpstruct_headers=$(srcdir)/lisp.h $(srcdir)/buffer.h \
$(srcdir)/intervals.h $(srcdir)/charset.h $(srcdir)/bignum.h
ifeq ($(CHECK_STRUCTS),true)
pdumper.o: dmpstruct.h
endif
dmpstruct.h: $(srcdir)/dmpstruct.awk
dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers)
$(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \
@ -541,7 +544,7 @@ ${lispintdir}/cp51932.el ${lispintdir}/eucjp-ms.el: FORCE
charsets = ${top_srcdir}/admin/charsets/charsets.stamp
${charsets}: FORCE
${MAKE} -C ../admin/charsets all
$(MAKE) -C ../admin/charsets all
charscript = ${lispintdir}/charscript.el
${charscript}: FORCE
@ -592,8 +595,9 @@ $(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
$(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \
$(shortlisp)
$(libsrc)/make-docfile$(EXEEXT): $(lib)/libgnu.a
$(MAKE) -C $(libsrc) make-docfile$(EXEEXT)
$(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \
$(lib)/libgnu.a
$(MAKE) -C $(dir $@) $(notdir $@)
buildobj.h: Makefile
$(AM_V_GEN)for i in $(ALLOBJS); do \
@ -621,30 +625,21 @@ $(ALLOBJS): globals.h
LIBEGNU_ARCHIVE = $(lib)/lib$(if $(HYBRID_MALLOC),e)gnu.a
$(LIBEGNU_ARCHIVE): $(config_h)
$(MAKE) -C $(lib) all
$(MAKE) -C $(dir $@) all
EMACS_DEPS_PRE=$(LIBXMENU) $(ALLOBJS)
EMACS_DEPS_POST=$(LIBEGNU_ARCHIVE) $(EMACSRES) ${charsets} ${charscript}
BUILD_EMACS_PRE=$(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
-o $@ $(ALLOBJS)
BUILD_EMACS_POST=$(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)
## We hash this file to generate the build fingerprint
temacs.in$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint-dummy.o $(EMACS_DEPS_POST)
$(BUILD_EMACS_PRE) fingerprint-dummy.o $(BUILD_EMACS_POST)
$(libsrc)/make-fingerprint$(EXEEXT): $(libsrc)/make-fingerprint.c $(lib)/libgnu.a
$(MAKE) -C $(libsrc) make-fingerprint$(EXEEXT)
fingerprint.c: temacs.in$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT)
$(libsrc)/make-fingerprint$(EXEEXT) temacs.in$(EXEEXT) > fingerprint.c
FINGERPRINTED = $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES)
fingerprint.c: $(FINGERPRINTED) $(libsrc)/make-fingerprint$(EXEEXT)
$(AM_V_GEN)$(libsrc)/make-fingerprint$(EXEEXT) $(FINGERPRINTED) >$@.tmp
$(AM_V_at)mv $@.tmp $@
## We have to create $(etc) here because init_cmdargs tests its
## existence when setting Vinstallation_directory (FIXME?).
## This goes on to affect various things, and the emacs binary fails
## to start if Vinstallation_directory has the wrong value.
temacs$(EXEEXT): $(EMACS_DEPS_PRE) fingerprint.o $(EMACS_DEPS_POST)
$(BUILD_EMACS_PRE) fingerprint.o $(BUILD_EMACS_POST)
temacs$(EXEEXT): fingerprint.o $(charsets) $(charscript)
$(AM_V_CCLD)$(CC) -o $@ $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
$(ALLOBJS) fingerprint.o \
$(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)
$(MKDIR_P) $(etc)
ifeq ($(DUMPING),unexec)
ifneq ($(PAXCTL_notdumped),)
@ -655,15 +650,15 @@ endif
## The following oldxmenu-related rules are only (possibly) used if
## HAVE_X11 && !USE_GTK, but there is no harm in always defining them.
$(lwlibdir)/liblw.a: $(config_h) globals.h lisp.h FORCE
$(MAKE) -C $(lwlibdir) liblw.a
$(MAKE) -C $(dir $@) $(notdir $@)
$(oldXMenudir)/libXMenu11.a: FORCE
$(MAKE) -C $(oldXMenudir) libXMenu11.a
$(MAKE) -C $(dir $@) $(notdir $@)
FORCE:
.PHONY: FORCE
.PRECIOUS: ../config.status Makefile
../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4
$(MAKE) -C .. $(notdir $@)
$(MAKE) -C $(dir $@) $(notdir $@)
Makefile: ../config.status $(srcdir)/Makefile.in
$(MAKE) -C .. src/$@
@ -681,7 +676,7 @@ ns-app: emacs$(EXEEXT) $(pdmp)
mostlyclean:
rm -f temacs$(EXEEXT) core ./*.core \#* ./*.o
rm -f temacs.in$(EXEEXT) fingerprint.c dmpstruct.h
rm -f dmpstruct.h fingerprint.c
rm -f emacs.pdmp
rm -f ../etc/DOC
rm -f bootstrap-emacs$(EXEEXT) $(bootstrap_pdmp)
@ -719,7 +714,7 @@ extraclean: distclean
ETAGS = ../lib-src/etags${EXEEXT}
${ETAGS}: FORCE
${MAKE} -C ../lib-src $(notdir $@)
$(MAKE) -C $(dir $@) $(notdir $@)
# Remove macuvs.h and fingerprint.c since they'd cause `src/emacs`
# to be built before we can get TAGS.
@ -744,11 +739,8 @@ TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2)
## Arrange to make tags tables for ../lisp and ../lwlib,
## which the above TAGS file for the C files includes by reference.
../lisp/TAGS: FORCE
$(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)"
$(lwlibdir)/TAGS: FORCE
$(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)"
../lisp/TAGS $(lwlibdir)/TAGS: FORCE
$(MAKE) -C $(dir $@) $(notdir $@) ETAGS="$(ETAGS)"
tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS
.PHONY: tags

View file

@ -3718,8 +3718,8 @@ Its value is void, and its function definition and property list are nil. */)
Lisp_Object
make_misc_ptr (void *a)
{
struct Lisp_Misc_Ptr *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Misc_Ptr, pointer,
PVEC_MISC_PTR);
struct Lisp_Misc_Ptr *p = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Misc_Ptr,
PVEC_MISC_PTR);
p->pointer = a;
return make_lisp_ptr (p, Lisp_Vectorlike);
}
@ -3729,7 +3729,7 @@ make_misc_ptr (void *a)
Lisp_Object
build_overlay (Lisp_Object start, Lisp_Object end, Lisp_Object plist)
{
struct Lisp_Overlay *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Overlay, next,
struct Lisp_Overlay *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Overlay, plist,
PVEC_OVERLAY);
Lisp_Object overlay = make_lisp_ptr (p, Lisp_Vectorlike);
OVERLAY_START (overlay) = start;
@ -3743,8 +3743,8 @@ DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
doc: /* Return a newly allocated marker which does not point at any place. */)
(void)
{
struct Lisp_Marker *p = ALLOCATE_PSEUDOVECTOR (struct Lisp_Marker, buffer,
PVEC_MARKER);
struct Lisp_Marker *p = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker,
PVEC_MARKER);
p->buffer = 0;
p->bytepos = 0;
p->charpos = 0;
@ -3766,8 +3766,8 @@ build_marker (struct buffer *buf, ptrdiff_t charpos, ptrdiff_t bytepos)
/* Every character is at least one byte. */
eassert (charpos <= bytepos);
struct Lisp_Marker *m = ALLOCATE_PSEUDOVECTOR (struct Lisp_Marker, buffer,
PVEC_MARKER);
struct Lisp_Marker *m = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Marker,
PVEC_MARKER);
m->buffer = buf;
m->charpos = charpos;
m->bytepos = bytepos;
@ -3821,8 +3821,8 @@ make_event_array (ptrdiff_t nargs, Lisp_Object *args)
Lisp_Object
make_user_ptr (void (*finalizer) (void *), void *p)
{
struct Lisp_User_Ptr *uptr = ALLOCATE_PSEUDOVECTOR (struct Lisp_User_Ptr,
finalizer, PVEC_USER_PTR);
struct Lisp_User_Ptr *uptr
= ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_User_Ptr, PVEC_USER_PTR);
uptr->finalizer = finalizer;
uptr->p = p;
return make_lisp_ptr (uptr, Lisp_Vectorlike);
@ -3945,7 +3945,7 @@ FUNCTION. FUNCTION will be run once per finalizer object. */)
(Lisp_Object function)
{
struct Lisp_Finalizer *finalizer
= ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, prev, PVEC_FINALIZER);
= ALLOCATE_PSEUDOVECTOR (struct Lisp_Finalizer, function, PVEC_FINALIZER);
finalizer->function = function;
finalizer->prev = finalizer->next = NULL;
finalizer_insert (&finalizers, finalizer);

View file

@ -86,8 +86,8 @@ make_bignum_bits (size_t bits)
if (integer_width < bits)
overflow_error ();
struct Lisp_Bignum *b = ALLOCATE_PSEUDOVECTOR (struct Lisp_Bignum, value,
PVEC_BIGNUM);
struct Lisp_Bignum *b = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Bignum,
PVEC_BIGNUM);
mpz_init (b->value);
mpz_swap (b->value, mpz[0]);
return make_lisp_ptr (b, Lisp_Vectorlike);
@ -342,8 +342,8 @@ bignum_to_string (Lisp_Object num, int base)
Lisp_Object
make_bignum_str (char const *num, int base)
{
struct Lisp_Bignum *b = ALLOCATE_PSEUDOVECTOR (struct Lisp_Bignum, value,
PVEC_BIGNUM);
struct Lisp_Bignum *b = ALLOCATE_PLAIN_PSEUDOVECTOR (struct Lisp_Bignum,
PVEC_BIGNUM);
mpz_init (b->value);
int check = mpz_set_str (b->value, num, base);
eassert (check == 0);

View file

@ -584,10 +584,10 @@ even if it is dead. The return value is never nil. */)
set_string_intervals (name, NULL);
bset_name (b, name);
if (STRINGP (Vcode_conversion_workbuf_name)
&& strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name),
SBYTES (Vcode_conversion_workbuf_name)) == 0)
b->inhibit_buffer_hooks = true;
b->inhibit_buffer_hooks
= (STRINGP (Vcode_conversion_workbuf_name)
&& strncmp (SSDATA (name), SSDATA (Vcode_conversion_workbuf_name),
SBYTES (Vcode_conversion_workbuf_name)) == 0);
bset_undo_list (b, SREF (name, 0) != ' ' ? Qnil : Qt);

View file

@ -741,8 +741,8 @@ struct buffer
See `cursor-type' for other values. */
Lisp_Object cursor_in_non_selected_windows_;
/* No more Lisp_Object beyond this point. Except undo_list,
which is handled specially in Fgarbage_collect. */
/* No more Lisp_Object beyond cursor_in_non_selected_windows_.
Except undo_list, which is handled specially in Fgarbage_collect. */
/* This structure holds the coordinates of the buffer contents
in ordinary buffers. In indirect buffers, this is not used. */
@ -1019,14 +1019,12 @@ bset_width_table (struct buffer *b, Lisp_Object val)
structure, make sure that this is still correct. */
#define BUFFER_LISP_SIZE \
((offsetof (struct buffer, own_text) - header_size) / word_size)
PSEUDOVECSIZE (struct buffer, cursor_in_non_selected_windows_)
/* Size of the struct buffer part beyond leading Lisp_Objects, in word_size
units. Rounding is needed for --with-wide-int configuration. */
/* Allocated size of the struct buffer part beyond leading
Lisp_Objects, in word_size units. */
#define BUFFER_REST_SIZE \
((((sizeof (struct buffer) - offsetof (struct buffer, own_text)) \
+ (word_size - 1)) & ~(word_size - 1)) / word_size)
#define BUFFER_REST_SIZE (VECSIZE (struct buffer) - BUFFER_LISP_SIZE)
/* Initialize the pseudovector header of buffer object. BUFFER_LISP_SIZE
is required for GC, but BUFFER_REST_SIZE is set up just to be consistent

View file

@ -787,28 +787,19 @@ static Lisp_Object gstring_work;
static Lisp_Object gstring_work_headers;
static Lisp_Object
fill_gstring_header (Lisp_Object header, ptrdiff_t from, ptrdiff_t from_byte,
fill_gstring_header (ptrdiff_t from, ptrdiff_t from_byte,
ptrdiff_t to, Lisp_Object font_object, Lisp_Object string)
{
ptrdiff_t len = to - from, i;
ptrdiff_t len = to - from;
if (len == 0)
error ("Attempt to shape zero-length text");
if (VECTORP (header))
{
if (ASIZE (header) != len + 1)
args_out_of_range (header, make_fixnum (len + 1));
}
else
{
if (len <= 8)
header = AREF (gstring_work_headers, len - 1);
else
header = make_uninit_vector (len + 1);
}
eassume (0 < len);
Lisp_Object header = (len <= 8
? AREF (gstring_work_headers, len - 1)
: make_uninit_vector (len + 1));
ASET (header, 0, font_object);
for (i = 0; i < len; i++)
for (ptrdiff_t i = 0; i < len; i++)
{
int c;
@ -1748,7 +1739,7 @@ should be ignored. */)
frombyte = string_char_to_byte (string, frompos);
}
header = fill_gstring_header (Qnil, frompos, frombyte,
header = fill_gstring_header (frompos, frombyte,
topos, font_object, string);
gstring = gstring_lookup_cache (header);
if (! NILP (gstring))

0
src/dmpstruct.awk Executable file → Normal file
View file

View file

@ -2686,8 +2686,9 @@ but is not deleted; if you save the buffer in a file, the invisible
text is included in the file. \\[widen] makes all visible again.
See also `save-restriction'.
When calling from a program, pass two arguments; positions (integers
or markers) bounding the text that should remain visible. */)
When calling from Lisp, pass two arguments START and END:
positions (integers or markers) bounding the text that should
remain visible. */)
(register Lisp_Object start, Lisp_Object end)
{
CHECK_FIXNUM_COERCE_MARKER (start);

View file

@ -427,7 +427,7 @@ static struct Lisp_Module_Function *
allocate_module_function (void)
{
return ALLOCATE_PSEUDOVECTOR (struct Lisp_Module_Function,
min_arity, PVEC_MODULE_FUNCTION);
documentation, PVEC_MODULE_FUNCTION);
}
#define XSET_MODULE_FUNCTION(var, ptr) \

View file

@ -822,6 +822,7 @@ t if it is locked by you, else a string saying which user has locked it. */)
USE_SAFE_ALLOCA;
filename = Fexpand_file_name (filename, Qnil);
filename = ENCODE_FILE (filename);
MAKE_LOCK_NAME (lfname, filename);

View file

@ -1,23 +0,0 @@
/* Dummy fingerprint
Copyright (C) 2016, 2018-2019 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "fingerprint.h"
/* Dummy fingerprint to use as hash input. */
const uint8_t fingerprint[32] = { 0 };

View file

@ -20,12 +20,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#ifndef EMACS_FINGERPRINT_H
#define EMACS_FINGERPRINT_H
#include <stdint.h>
/* We generate fingerprint.c and fingerprint.o from all the sources in
Emacs. This way, we have a unique value that we can use to pair
data files (like a portable dump image) with a specific build of
Emacs. */
extern const uint8_t fingerprint[32];
extern unsigned char const fingerprint[32];
#endif

View file

@ -3904,7 +3904,7 @@ static struct Lisp_Hash_Table *
allocate_hash_table (void)
{
return ALLOCATE_PSEUDOVECTOR (struct Lisp_Hash_Table,
count, PVEC_HASH_TABLE);
index, PVEC_HASH_TABLE);
}
/* An upper bound on the size of a hash table index. It must fit in

View file

@ -1444,7 +1444,7 @@ or t for the default fontset.
TARGET may be a single character to use FONT-SPEC for.
Target may be a cons (FROM . TO), where FROM and TO are characters.
TARGET may be a cons (FROM . TO), where FROM and TO are characters.
In that case, use FONT-SPEC for all the characters in the range
between FROM and TO (inclusive).

View file

@ -798,7 +798,8 @@ adjust_frame_size (struct frame *f, int new_width, int new_height, int inhibit,
static struct frame *
allocate_frame (void)
{
return ALLOCATE_ZEROED_PSEUDOVECTOR (struct frame, face_cache, PVEC_FRAME);
return ALLOCATE_ZEROED_PSEUDOVECTOR (struct frame, tool_bar_items,
PVEC_FRAME);
}
struct frame *
@ -5662,8 +5663,8 @@ selected frame. This is useful when `make-pointer-invisible' is set. */)
#ifdef HAVE_WINDOW_SYSTEM
# if (defined HAVE_NS \
|| (!defined USE_GTK && (defined HAVE_XINERAMA || defined HAVE_XRANDR)))
# if (defined USE_GTK || defined HAVE_NS || defined HAVE_XINERAMA \
|| defined HAVE_XRANDR)
void
free_monitors (struct MonitorInfo *monitors, int n_monitors)
{

View file

@ -190,9 +190,6 @@ struct frame
Lisp_Object current_tool_bar_string;
#endif
/* Desired and current tool-bar items. */
Lisp_Object tool_bar_items;
#ifdef USE_GTK
/* Where tool bar is, can be left, right, top or bottom.
Except with GTK, the only supported position is `top'. */
@ -204,7 +201,9 @@ struct frame
Lisp_Object font_data;
#endif
/* Beyond here, there should be no more Lisp_Object components. */
/* Desired and current tool-bar items. */
Lisp_Object tool_bar_items;
/* tool_bar_items should be the last Lisp_Object member. */
/* Cache of realized faces. */
struct face_cache *face_cache;

Some files were not shown because too many files have changed in this diff Show more