1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-22 07:09:54 +00:00

Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk

This commit is contained in:
Yuuki Harano 2021-06-13 17:34:06 +09:00
commit 7d5e94bada
148 changed files with 7249 additions and 1688 deletions

View File

@ -3847,27 +3847,28 @@ AC_DEFUN([libgccjit_smoke_test], [
}]])])
AC_DEFUN([libgccjit_not_found], [
AC_MSG_ERROR([elisp native compiler requested but libgccjit not found.
Please try installing libgccjit or similar package.
If you are sure you want Emacs compiled without elisp native compiler, pass
--without-native-compilation
to configure.])])
AC_MSG_ERROR([ELisp native compiler was requested, but libgccjit was not found.
Please try installing libgccjit or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-native-compilation option to configure.])])
AC_DEFUN([libgccjit_dev_not_found], [
AC_MSG_ERROR([elisp native compiler requested but libgccjit header files were
AC_MSG_ERROR([ELisp native compiler was requested, but libgccjit header files were
not found.
Please try installing libgccjit-dev or similar package.
If you are sure you want Emacs compiled without elisp native compiler, pass
--without-nativecomp
to configure.])])
Please try installing libgccjit-dev or a similar package.
If you are sure you want Emacs be compiled without ELisp native compiler,
pass the --without-nativecomp option to configure.])])
AC_DEFUN([libgccjit_broken], [
AC_MSG_ERROR([Installed libgccjit has failed passing the smoke test.
You can verify it yourself compiling:
AC_MSG_ERROR([The installed libgccjit failed to compile and run a test program using
the libgccjit library; see config.log for the details of the failure.
The test program can be found here:
<https://gcc.gnu.org/onlinedocs/jit/intro/tutorial01.html>.
Please report the issue to your distribution if libgccjit was installed through
that.
Here instructions on how to compile and install libgccjit from source:
You can try compiling it yourself to investigate the issues.
Please report the issue to your distribution if libgccjit was installed
through that.
You can find the instructions on how to compile and install libgccjit from
source on this site:
<https://gcc.gnu.org/wiki/JIT>.])])
HAVE_NATIVE_COMP=no

View File

@ -1189,8 +1189,8 @@ that has some special meaning for formatting the source code of a
program.
To activate the fill-column indication display, use the minor modes
@w{@kbd{M-x display-fill-column-indicator-mode}} and
@w{@kbd{M-x global-display-fill-column-indicator-mode}}, which enable
@kbd{M-x display-fill-@-column-indicator-mode} and
@kbd{M-x global-display-fill-column-indicator-mode}, which enable
the indicator locally or globally, respectively.
Alternatively, you can set the two buffer-local variables
@ -1220,8 +1220,8 @@ The value @code{nil} disables the indicator. When the mode is enabled
through the functions @code{display-fill-column-indicator-mode} or
@code{global-display-fill-column-indicator-mode}, they will use the
character specified by this variable, if it is non-@code{nil};
otherwise Emacs will use the character @samp{U+2502 VERTICAL LINE},
falling back to @samp{|} if @code{U+2502} cannot be displayed.
otherwise Emacs will use the character U+2502 @sc{box drawings light vertical},
falling back to @samp{|} if U+2502 cannot be displayed.
@item fill-column-indicator
@vindex fill-column-indicator
@ -1577,8 +1577,8 @@ characters, as well as many non-@acronym{ASCII} characters.
@cindex control characters on display
The @acronym{ASCII} character set contains non-printing @dfn{control
characters}. Two of these are displayed specially: the newline
character (Unicode code point @code{U+000A}) is displayed by starting
a new line, while the tab character (@code{U+0009}) is displayed as a
character (Unicode code point U+000A) is displayed by starting
a new line, while the tab character (U+0009) is displayed as a
space that extends to the next tab stop column (normally every 8
columns). The number of spaces per tab is controlled by the
buffer-local variable @code{tab-width}, which must have an integer
@ -1587,17 +1587,17 @@ character in the buffer is displayed has nothing to do with the
definition of @key{TAB} as a command.
Other @acronym{ASCII} control characters, whose codes are below
@code{U+0020} (octal 40, decimal 32), are displayed as a caret
U+0020 (octal 40, decimal 32), are displayed as a caret
(@samp{^}) followed by the non-control version of the character, with
the @code{escape-glyph} face. For instance, the @samp{control-A}
character, @code{U+0001}, is displayed as @samp{^A}.
character, U+0001, is displayed as @samp{^A}.
@cindex octal escapes
@vindex ctl-arrow
The raw bytes with codes @code{U+0080} (octal 200) through
@code{U+009F} (octal 237) are displayed as @dfn{octal escape
The raw bytes with codes U+0080 (octal 200) through
U+009F (octal 237) are displayed as @dfn{octal escape
sequences}, with the @code{escape-glyph} face. For instance,
character code @code{U+0098} (octal 230) is displayed as @samp{\230}.
character code U+0098 (octal 230) is displayed as @samp{\230}.
If you change the buffer-local variable @code{ctl-arrow} to
@code{nil}, the @acronym{ASCII} control characters are also displayed
as octal escape sequences instead of caret escape sequences. (You can
@ -1616,11 +1616,11 @@ can cause problems if they are entered into a buffer without your
realization, e.g., by yanking; for instance, source code compilers
typically do not treat non-@acronym{ASCII} spaces as whitespace
characters. To deal with this problem, Emacs displays such characters
specially: it displays @code{U+00A0} (no-break space) and other
specially: it displays U+00A0 @sc{no-break space} and other
characters from the Unicode horizontal space class with the
@code{nobreak-space} face, and it displays @code{U+00AD} (soft
hyphen), @code{U+2010} (hyphen), and @code{U+2011} (non-breaking
hyphen) with the @code{nobreak-hyphen} face. To disable this, change
@code{nobreak-space} face, and it displays U+00AD @sc{soft
hyphen}, U+2010 @sc{hyphen}, and U+2011 @sc{non-breaking
hyphen} with the @code{nobreak-hyphen} face. To disable this, change
the variable @code{nobreak-char-display} to @code{nil}. If you give
this variable a non-@code{nil} and non-@code{t} value, Emacs instead
displays such characters as a highlighted backslash followed by a
@ -1829,15 +1829,15 @@ variable @code{visual-line-fringe-indicators}.
That produces incorrect results when CJK and Latin text are mixed
together (because CJK characters don't use whitespace to separate
words). You can customize the option @code{word-wrap-by-category} to
allow Emacs to break lines after any character with ``|'' category
allow Emacs to break lines after any character with @samp{|} category
(@pxref{Categories,,, elisp, the Emacs Lisp Reference Manual}), which
provides better support for CJK characters. Also, if this variable is
set using Customize, Emacs automatically loads @file{kinsoku.el}.
When @file{kinsoku.el} is loaded, Emacs respects kinsoku rules when
breaking lines. That means characters with the ``>'' category don't
appear at the beginning of a line (e.g., U+FF0C FULLWIDTH COMMA), and
characters with the ``<'' category don't appear at the end of a line
(e.g., U+300A LEFT DOUBLE ANGLE BRACKET). You can view the category
breaking lines. That means characters with the @samp{>} category don't
appear at the beginning of a line (e.g., U+FF0C @sc{fullwidth comma}), and
characters with the @samp{<} category don't appear at the end of a line
(e.g., U+300A @sc{left double angle bracket}). You can view the category
set of a character using the commands @code{char-category-set} and
@code{category-set-mnemonics}, or by typing @kbd{C-u C-x =} with point
on the character and looking at the ``category'' section in the

View File

@ -15,4 +15,5 @@
@hyphenation{work-a-round}
@hyphenation{work-a-rounds}
@hyphenation{un-marked}
@hyphenation{dic-tion-ary}
@end iftex

View File

@ -365,7 +365,7 @@ Like @kbd{i}, but you can also specify dictionary completion
information.
@item u
Insert the lower-case version of this word in your private dic@-tion@-ary
Insert the lower-case version of this word in your private dictionary
file.
@item l @var{word} @key{RET}

View File

@ -311,13 +311,13 @@ the end. Using any other prefix argument specifies an earlier kill;
e.g., @kbd{C-u 4 C-y} reinserts the fourth most recent kill.
@xref{Earlier Kills}.
On graphical displays, @kbd{C-y} first checks if another application
has placed any text in the system clipboard more recently than the
last Emacs kill. If so, it inserts the clipboard's text instead.
Thus, Emacs effectively treats ``cut'' or ``copy'' clipboard
operations performed in other applications like Emacs kills, except
that they are not recorded in the kill ring. @xref{Cut and Paste},
for details.
On graphical displays and on capable text-mode displays, @kbd{C-y}
first checks if another application has placed any text in the system
clipboard more recently than the last Emacs kill. If so, it inserts
the clipboard's text instead. Thus, Emacs effectively treats ``cut''
or ``copy'' clipboard operations performed in other applications like
Emacs kills, except that they are not recorded in the kill ring.
@xref{Cut and Paste}, for details.
@menu
* Kill Ring:: Where killed text is stored.
@ -371,12 +371,12 @@ command, it works differently, see below.)
last-yank pointer which points at an entry in the kill ring. Each
time you kill, the last-yank pointer moves to the newly made entry at
the front of the ring. @kbd{C-y} yanks the entry which the last-yank
pointer points to. @kbd{M-y} moves the last-yank pointer to a
different entry, and the text in the buffer changes to match. Enough
@kbd{M-y} commands can move the pointer to any entry in the ring, so
you can get any entry into the buffer. Eventually the pointer reaches
the end of the ring; the next @kbd{M-y} loops back around to the first
entry again.
pointer points to. @kbd{M-y} after a @kbd{C-y} or another @kbd{M-y}
moves the last-yank pointer to the previous entry, and the text in the
buffer changes to match. Enough @kbd{M-y} commands one after another
can move the pointer to any entry in the ring, so you can get any
entry into the buffer. Eventually the pointer reaches the end of the
ring; the next @kbd{M-y} loops back around to the first entry again.
@kbd{M-y} moves the last-yank pointer around the ring, but it does
not change the order of the entries in the ring, which always runs from
@ -388,12 +388,13 @@ pointer by. A negative argument moves the pointer toward the front of
the ring; from the front of the ring, it moves around to the last
entry and continues forward from there.
Once the text you are looking for is brought into the buffer, you can
stop doing @kbd{M-y} commands and it will stay there. It's just a copy
of the kill ring entry, so editing it in the buffer does not change
what's in the ring. As long as no new killing is done, the last-yank
pointer remains at the same place in the kill ring, so repeating
@kbd{C-y} will yank another copy of the same previous kill.
Once the text you are looking for is brought into the buffer, you
can stop doing @kbd{M-y} commands and the last yanked text will stay
there. It's just a copy of the kill ring entry, so editing it in the
buffer does not change what's in the ring. As long as no new killing
is done, the last-yank pointer remains at the same place in the kill
ring, so repeating @kbd{C-y} will yank another copy of the same
previous kill.
When you call @kbd{C-y} with a numeric argument, that also sets the
last-yank pointer to the entry that it yanks.
@ -404,11 +405,18 @@ one of the previous kills. You can use the minibuffer history
commands (@pxref{Minibuffer History}) to navigate or search through
the entries in the kill ring until you find the one you want to
reinsert. Or you can use completion commands (@pxref{Completion
Commands}) to complete on the list of entries in the kill ring or pop
up the @file{*Completions*} buffer with the candidate entries from
which you can choose. After selecting the kill-ring entry, you can
optionally edit it in the minibuffer. Finally, type @kbd{RET} to exit
the minibuffer and insert the selected text.
Commands}) to complete on an entry from the list of entries in the
kill ring or pop up the @file{*Completions*} buffer with the candidate
entries from which you can choose. After selecting the kill-ring
entry, you can optionally edit it in the minibuffer. Finally, type
@kbd{RET} to exit the minibuffer and insert the text of the selected
kill-ring entry. Like in case of @kbd{M-y} after another yank
command, the last-yank pointer is left pointing at the text you just
yanked, whether it is one of the previous kills or an entry from the
kill-ring that you edited before inserting it. (In the latter case,
the edited entry is added to the front of the kill-ring.) So here,
too, typing @kbd{C-y} will yank another copy of the text just
inserted.
When invoked with a plain prefix argument (@kbd{C-u M-y}) after a
command that is not a yank command, @kbd{M-y} leaves the cursor in

View File

@ -1864,6 +1864,12 @@ it to exit. Programs that use @env{EDITOR} usually wait for the
editor---in this case @command{emacsclient}---to exit before doing
something else.
@findex server-edit-abort
If you want to abandon the edit instead, use the @w{@kbd{M-x
server-edit-abort}} command. This sends a message back to the
@command{emacsclient} program, telling it to exit with abnormal exit
status, and doesn't save any buffers.
You can also call @command{emacsclient} with multiple file name
arguments: @samp{emacsclient @var{file1} @var{file2} ...} tells the
Emacs server to visit @var{file1}, @var{file2}, and so forth. Emacs

View File

@ -310,6 +310,9 @@ the space that it occupied is given to an adjacent window (but not the
minibuffer window, even if that is active at the time). Deleting the
window has no effect on the buffer it used to display; the buffer
continues to exist, and you can still switch to it with @kbd{C-x b}.
The option @code{delete-window-choose-selected} allows to choose which
window becomes the new selected window instead (@pxref{Deleting
Windows,,, elisp, The Emacs Lisp Reference Manual}).
@findex kill-buffer-and-window
@kindex C-x 4 0

View File

@ -839,7 +839,7 @@ evaluated, and the result used. For instance:
@end example
@noindent
will be printed as
will result in:
@example
(concat "foo" "bar" "zot")
@ -866,13 +866,14 @@ should be included.
@end example
@item :no-eval*
Like @code{:no-eval}, but alaways inserts @samp{[it depends]} as the
result.
Like @code{:no-eval}, but always inserts @samp{[it depends]} as the
result. For instance:
@example
:no-eval* (buffer-string)
@end example
@noindent
will result in:
@example
@ -894,12 +895,21 @@ Used to output the result from non-evaluating example forms.
@item :eg-result
Used to output an example result from non-evaluating example forms.
For instance:
@example
:no-eval (looking-at "f[0-9]")
:eg-result t
@end example
@noindent
will result in:
@example
(looking-at "f[0-9]")
eg. @click{} t
@end example
@item :result-string
@itemx :eg-result-string
These two are the same as @code{:result} and @code{:eg-result},
@ -951,7 +961,7 @@ sections.
@defun shortdoc-add-function shortdoc-add-function group section elem
Lisp packages can add functions to groups with this command. Each
@var{elem} should be a function descriptions, as described above.
@var{elem} should be a function description, as described above.
@var{group} is the function group, and @var{section} is what section
in the function group to insert the function into.

View File

@ -1429,7 +1429,7 @@ other words, if a module function wants to call Lisp functions or
Emacs primitives, convert @code{emacs_value} objects to and from C
datatypes (@pxref{Module Values}), or interact with Emacs in any other
way, some call from Emacs to @code{emacs_module_init} or to a module
function must be in the call stack. Module function may not interact
function must be in the call stack. Module functions may not interact
with Emacs while garbage collection is running; @pxref{Garbage
Collection}. They may only interact with Emacs from Lisp interpreter
threads (including the main thread) created by Emacs; @pxref{Threads}.

View File

@ -240,7 +240,6 @@ they cannot be called interactively.
of constants and nonconstant parts. To make this easier, use the
@samp{`} syntax (@pxref{Backquote}). For example:
@example
@example
@group
(defmacro t-becomes-nil (variable)
@ -253,7 +252,6 @@ of constants and nonconstant parts. To make this easier, use the
@equiv{} (if (eq foo t) (setq foo nil))
@end group
@end example
@end example
@node Problems with Macros
@section Common Problems Using Macros

View File

@ -3004,7 +3004,8 @@ name.
However, @var{facespec} can also evaluate to a list of this form:
@example
(face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{})
(@var{subexp}
(face @var{face} @var{prop1} @var{val1} @var{prop2} @var{val2}@dots{}))
@end example
@noindent

View File

@ -2369,11 +2369,17 @@ has no effect except in @sc{cbreak} mode.
The argument @var{meta} controls support for input character codes
above 127. If @var{meta} is @code{t}, Emacs converts characters with
the 8th bit set into Meta characters. If @var{meta} is @code{nil},
the 8th bit set into Meta characters, before it decodes them as needed
(@pxref{Terminal I/O Encoding}). If @var{meta} is @code{nil},
Emacs disregards the 8th bit; this is necessary when the terminal uses
it as a parity bit. If @var{meta} is neither @code{t} nor @code{nil},
Emacs uses all 8 bits of input unchanged. This is good for terminals
that use 8-bit character sets.
it as a parity bit. If @var{meta} is the symbol @code{encoded}, Emacs
first decodes the characters using all the 8 bits of each byte, and
then converts the decoded single-byte characters into Meta characters
if they have their eighth bit set. Finally, if @var{meta} is neither
@code{t} nor @code{nil} nor @code{encoded}, Emacs uses all 8 bits of
input unchanged, both before and after decoding them. This is good
for terminals that use 8-bit character sets and don't encode the Meta
modifier as the eighth bit.
If @var{quit-char} is non-@code{nil}, it specifies the character to
use for quitting. Normally this character is @kbd{C-g}.
@ -2398,9 +2404,11 @@ flow control for output to the terminal. This value is meaningful only
when @var{interrupt} is @code{nil}.
@item meta
is @code{t} if Emacs treats the eighth bit of input characters as
the meta bit; @code{nil} means Emacs clears the eighth bit of every
input character; any other value means Emacs uses all eight bits as the
basic character code.
the Meta bit before decoding input; @code{encoded} if Emacs treats the
eighth bit of the decoded single-byte characters as the Meta bit;
@code{nil} if Emacs clears the eighth bit of every input character;
any other value means Emacs uses all eight bits as the basic character
code.
@item quit
is the character Emacs currently uses for quitting, usually @kbd{C-g}.
@end table

View File

@ -368,7 +368,7 @@ preceding expression either once or not at all. For example,
@anchor{Non-greedy repetition}
@item @samp{*?}, @samp{+?}, @samp{??}
@cindex non-greedy repetition characters in regexp
These are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+}
are @dfn{non-greedy} variants of the operators @samp{*}, @samp{+}
and @samp{?}. Where those operators match the largest possible
substring (consistent with matching the entire containing expression),
the non-greedy variants match the smallest possible substring
@ -443,6 +443,13 @@ including newline. However, a reversed range should always be from
the letter @samp{z} to the letter @samp{a} to make it clear that it is
not a typo; for example, @samp{[+-*/]} should be avoided, because it
matches only @samp{/} rather than the likely-intended four characters.
@item
If the end points of a range are raw 8-bit bytes (@pxref{Text
Representations}), or if the range start is ASCII and the end is a raw
byte (as in @samp{[a-\377]}), the range will match only ASCII
characters and raw 8-bit bytes, but not non-ASCII characters. This
feature is intended for searching text in unibyte buffers and strings.
@end enumerate
Some kinds of character alternatives are not the best style even

View File

@ -572,12 +572,14 @@ The function is called by @code{syntax-ppss} (@pxref{Position Parse}),
and by Font Lock mode during syntactic fontification (@pxref{Syntactic
Font Lock}). It is called with two arguments, @var{start} and
@var{end}, which are the starting and ending positions of the text on
which it should act. It is allowed to call @code{syntax-ppss} on any
position before @var{end}, but if a Lisp program calls
@code{syntax-ppss} on some position and later modifies the buffer at
some earlier position, then it is that program's responsibility to
call @code{syntax-ppss-flush-cache} to flush the now obsolete info
from the cache.
which it should act. It is allowed to arbitrarily move point within
the region delimited by @var{start} and @var{end}; such motions don't
need to use @code{save-excursion} (@pxref{Excursions}). It is also
allowed to call @code{syntax-ppss} on any position before @var{end},
but if a Lisp program calls @code{syntax-ppss} on some position and
later modifies the buffer at some earlier position, then it is that
program's responsibility to call @code{syntax-ppss-flush-cache} to
flush the now obsolete info from the cache.
@strong{Caution:} When this variable is non-@code{nil}, Emacs removes
@code{syntax-table} text properties arbitrarily and relies on

View File

@ -1582,6 +1582,12 @@ buffer-local binding in buffer @var{buffer}, it returns the default
value (@pxref{Default Value}) of @var{variable} instead.
@end defun
@defun buffer-local-boundp variable buffer
This returns non-@code{nil} if there's either a buffer-local binding
of @var{variable} (a symbol) in buffer @var{buffer}, or @var{variable}
has a global binding.
@end defun
@defun buffer-local-variables &optional buffer
This function returns a list describing the buffer-local variables in
buffer @var{buffer}. (If @var{buffer} is omitted, the current buffer

View File

@ -1318,6 +1318,33 @@ lieu of the usual action of @code{delete-window}. @xref{Window
Parameters}.
@end deffn
When @code{delete-window} deletes the selected window of its frame, it
has to make another window the new selected window of that frame. The
following option allows configuring which window is chosen.
@defopt delete-window-choose-selected
This option allows specifying which window should become a frame's
selected window after @code{delete-window} has deleted the previously
selected one. Possible choices are
@itemize
@item @code{mru}
(the default) choose the most recently used window on that frame.
@item @code{pos}
choose the window comprising the frame coordinates of point of the
previously selected window on that frame.
@item @code{nil}
choose the first window (the window returned by
@code{frame-first-window}) on that frame.
@end itemize
A window with a non-@code{nil} @code{no-other-window} parameter is
chosen only if all other windows on that frame have that parameter set
to a non-@code{nil} value too.
@end defopt
@deffn Command delete-other-windows &optional window
This function makes @var{window} fill its frame, deleting other
windows as necessary. If @var{window} is omitted or @code{nil}, it
@ -1838,6 +1865,14 @@ with @var{window} as the selected window without needlessly running
@code{buffer-list-update-hook}.
@end defmac
@defmac with-selected-frame frame forms@dots{}
This macro executes @var{forms} with @var{frame} as the selected
frame. The value returned is the value of the last form in
@var{forms}. This macro saves and restores the selected frame, and
changes the order of neither the recently selected windows nor the
buffers in the buffer list.
@end defmac
@defun frame-selected-window &optional frame
This function returns the window on @var{frame} that is selected
within that frame. @var{frame} should be a live frame; if omitted or
@ -1999,7 +2034,7 @@ meaning as for @code{next-window}.
criterion, without selecting it:
@cindex least recently used window
@defun get-lru-window &optional all-frames dedicated not-selected
@defun get-lru-window &optional all-frames dedicated not-selected no-other
This function returns a live window which is heuristically the least
recently used. The optional argument @var{all-frames} has
the same meaning as in @code{next-window}.
@ -2010,33 +2045,25 @@ window (@pxref{Dedicated Windows}) is never a candidate unless the
optional argument @var{dedicated} is non-@code{nil}. The selected
window is never returned, unless it is the only candidate. However, if
the optional argument @var{not-selected} is non-@code{nil}, this
function returns @code{nil} in that case.
function returns @code{nil} in that case. The optional argument
@var{no-other}, if non-@code{nil}, means to never return a window whose
@code{no-other-window} parameter is non-@code{nil}.
@end defun
@cindex most recently used window
@defun get-mru-window &optional all-frames dedicated not-selected
@defun get-mru-window &optional all-frames dedicated not-selected no-other
This function is like @code{get-lru-window}, but it returns the most
recently used window instead. The meaning of the arguments is the
same as described for @code{get-lru-window}.
same as for @code{get-lru-window}.
@end defun
@cindex largest window
@defun get-largest-window &optional all-frames dedicated not-selected
@defun get-largest-window &optional all-frames dedicated not-selected no-other
This function returns the window with the largest area (height times
width). The optional argument @var{all-frames} specifies the windows to
search, and has the same meaning as in @code{next-window}.
A minibuffer window is never a candidate. A dedicated window
(@pxref{Dedicated Windows}) is never a candidate unless the optional
argument @var{dedicated} is non-@code{nil}. The selected window is not
a candidate if the optional argument @var{not-selected} is
non-@code{nil}. If the optional argument @var{not-selected} is
non-@code{nil} and the selected window is the only candidate, this
function returns @code{nil}.
If there are two candidate windows of the same size, this function
prefers the one that comes first in the cyclic ordering of windows,
starting from the selected window.
width). If there are two candidate windows of the same size, it prefers
the one that comes first in the cyclic ordering of windows, starting
from the selected window. The meaning of the arguments is the same as
for @code{get-lru-window}.
@end defun
@cindex window that satisfies a predicate

View File

@ -197,7 +197,7 @@ searches for Lisp files.
.\" START DELETING HERE IF YOU'RE NOT USING X
.SS Using Emacs with X
.I Emacs
has been tailored to work well with the X window system.
has been tailored to work well with the X Window System.
If you run
.I Emacs
from under X windows, it will create its own X window to
@ -566,7 +566,7 @@ distribution.
/usr/local/share/info \(em files for the Info documentation browser.
The complete text of the Emacs reference manual is included in a
convenient tree structured form.
Also includes the Emacs Lisp Reference Manual, useful to anyone
This includes the Emacs Lisp Reference Manual, useful to anyone
wishing to write programs in the Emacs Lisp extension language,
and the Introduction to Programming in Emacs Lisp.

View File

@ -1,5 +1,5 @@
.\" See section COPYING for copyright and redistribution information.
.TH ETAGS 1 "2019-06-24" "GNU Tools" "GNU"
.TH ETAGS 1 "2021-03-30" "GNU Tools" "GNU"
.de BP
.sp
.ti -.2i
@ -50,9 +50,9 @@ format understood by
.BR vi ( 1 )\c
\&. Both forms of the program understand
the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang,
Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl,
Ruby, Rust, PHP, PostScript, Python, Prolog, Scheme and
most assembler\-like syntaxes.
Forth, Go, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Mercury, Pascal,
Perl, Ruby, Rust, PHP, PostScript, Python, Prolog, Scheme and most
assembler\-like syntaxes.
Both forms read the files specified on the command line, and write a tag
table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for
\fBctags\fP) in the current working directory.
@ -91,6 +91,9 @@ Only \fBctags\fP accepts this option.
In C and derived languages, create tags for function declarations,
and create tags for extern variables unless \-\-no\-globals is used.
In Lisp, create tags for (defvar foo) declarations.
In Mercury, declarations start a line with "\|\fB:-\fP\|" and are always
tagged. In addition, this option tags predicates or functions in first
rules of clauses, as in Prolog.
.TP
.B \-D, \-\-no\-defines
Do not create tag entries for C preprocessor constant definitions
@ -125,10 +128,14 @@ final brace of a function or structure definition in C and C++.
Parse the following files according to the given language. More than
one such options may be intermixed with filenames. Use \fB\-\-help\fP
to get a list of the available languages and their default filename
extensions. The "auto" language can be used to restore automatic
detection of language based on the file name. The "none"
language may be used to disable language parsing altogether; only
regexp matching is done in this case (see the \fB\-\-regex\fP option).
extensions. For example, as Mercury and Objective-C have same
filename extension \fI.m\fP, a test based on contents tries to detect
the language. If this test fails, \fB\-\-language=\fP\fImercury\fP or
\fB\-\-language=\fP\fIobjc\fP should be used.
The "auto" language can be used to restore automatic detection of language
based on the file name. The "none" language may be used to disable language
parsing altogether; only regexp matching is done in this case (see the
\fB\-\-regex\fP option).
.TP
.B \-\-members
Create tag entries for variables that are members of structure-like

View File

@ -115,10 +115,10 @@ Each class can have methods, which are defined like this:
(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 pers name))
(message "Dialing the phone for %s" (slot-value pers 'name))
(shell-command (concat (or scriptname "dialphone.sh")
" "
(oref pers phone))))
(slot-value pers 'phone))))
@end example
@noindent
@ -693,16 +693,43 @@ for each slot. For example:
@node Accessing Slots
@chapter Accessing Slots
There are several ways to access slot values in an object. The naming
and argument-order conventions are similar to those used for
referencing vectors (@pxref{Vectors,,,elisp,GNU Emacs Lisp Reference
Manual}).
There are several ways to access slot values in an object.
The following accessors are defined by CLOS to reference or modify
slot values, and use the previously mentioned set/ref routines.
@defun slot-value object slot
@anchor{slot-value}
This function retrieves the value of @var{slot} from @var{object}.
This is a generalized variable that can be used with @code{setf} to
modify the value stored in @var{slot}. @xref{Generalized
Variables,,,elisp,GNU Emacs Lisp Reference Manual}.
@end defun
@defun set-slot-value object slot value
@anchor{set-slot-value}
This function sets the value of @var{slot} from @var{object}.
This is not a CLOS function, but is the obsolete setter for
@code{slot-value} used by the @code{setf} macro. It is therefore
recommended to use @w{@code{(setf (slot-value @var{object} @var{slot})
@var{value})}} instead.
@end defun
@defun slot-makeunbound object slot
This function unbinds @var{slot} in @var{object}. Referencing an
unbound slot can signal an error.
@end defun
The following accessors follow a naming and argument-order conventions
are similar to those used for referencing vectors
(@pxref{Vectors,,,elisp,GNU Emacs Lisp Reference Manual}).
@defmac oref obj slot
@anchor{oref}
This macro retrieves the value stored in @var{obj} in the named
@var{slot}. Slot names are determined by @code{defclass} which
creates the slot.
@var{slot}. Unlike @code{slot-value}, the symbol for @var{slot} must
not be quoted.
This is a generalized variable that can be used with @code{setf} to
modify the value stored in @var{slot}. @xref{Generalized
@ -737,35 +764,6 @@ changed, this can be arranged by simply executing this bit of code:
@end example
@end defmac
The following accessors are defined by CLOS to reference or modify
slot values, and use the previously mentioned set/ref routines.
@defun slot-value object slot
@anchor{slot-value}
This function retrieves the value of @var{slot} from @var{object}.
Unlike @code{oref}, the symbol for @var{slot} must be quoted.
This is a generalized variable that can be used with @code{setf} to
modify the value stored in @var{slot}. @xref{Generalized
Variables,,,elisp,GNU Emacs Lisp Reference Manual}.
@end defun
@defun set-slot-value object slot value
@anchor{set-slot-value}
This function sets the value of @var{slot} from @var{object}. Unlike
@code{oset}, the symbol for @var{slot} must be quoted.
This is not a CLOS function, but is the obsolete setter for
@code{slot-value} used by the @code{setf} macro. It is therefore
recommended to use @w{@code{(setf (slot-value @var{object} @var{slot})
@var{value})}} instead.
@end defun
@defun slot-makeunbound object slot
This function unbinds @var{slot} in @var{object}. Referencing an
unbound slot can signal an error.
@end defun
@defun object-add-to-list object slot item &optional append
@anchor{object-add-to-list}
In OBJECT's @var{slot}, add @var{item} to the list of elements.
@ -807,7 +805,7 @@ Where each @var{var} is the local variable given to the associated
variable name of the same name as the slot.
@example
(defclass myclass () (x :initform 1))
(defclass myclass () ((x :initform 1)))
(setq mc (make-instance 'myclass))
(with-slots (x) mc x) => 1
(with-slots ((something x)) mc something) => 1
@ -981,8 +979,8 @@ the @code{subclass} specializer with @code{cl-defmethod}:
new))
@end example
The first argument of a static method will be a class rather than an
object. Use the functions @code{oref-default} or @code{oset-default} which
The argument of a static method will be a class rather than an object.
Use the functions @code{oref-default} or @code{oset-default} which
will work on a class.
A class's @code{make-instance} method is defined as a static
@ -1238,12 +1236,6 @@ of CLOS.
Return the list of public slots for @var{obj}.
@end defun
@defun class-slot-initarg class slot
For the given @var{class} return an :initarg associated with
@var{slot}. Not all slots have initargs, so the return value can be
@code{nil}.
@end defun
@node Base Classes
@chapter Base Classes
@ -1656,8 +1648,8 @@ Method invoked when an attempt to access a slot in @var{object} fails.
that was requested, and optional @var{new-value} is the value that was desired
to be set.
This method is called from @code{oref}, @code{oset}, and other functions which
directly reference slots in EIEIO objects.
This method is called from @code{slot-value}, @code{set-slot-value},
and other functions which directly reference slots in EIEIO objects.
The default method signals an error of type @code{invalid-slot-name}.
@xref{Signals}.

View File

@ -1870,6 +1870,11 @@ A customizable list of viewers that take preference over
Interface functions:
@table @code
@item mailcap-view-file
@findex mailcap-view-file
Prompt for a file name, and start a viewer applicable for the file
type in question.
@item mailcap-parse-mailcaps
@findex mailcap-parse-mailcaps
@vindex mailcap-prefer-mailcap-viewers

View File

@ -518,7 +518,7 @@ That is, if called with the following arguments, @var{server} and
for the values of the other parameters.
@example
(erc :server "chat.freenode.net" :full-name "Harry S Truman")
(erc :server "chat.freenode.net" :full-name "J. Random Hacker")
@end example
@end defun
@ -545,7 +545,7 @@ for the values of the other parameters, and @code{client-certificate}
will be @code{nil}.
@example
(erc-tls :server "chat.freenode.net" :full-name "Harry S Truman")
(erc-tls :server "chat.freenode.net" :full-name "J. Random Hacker")
@end example
To use a certificate with @code{erc-tls}, specify the optional

View File

@ -2583,25 +2583,28 @@ with the process mark and then execute the command.
@itemx M m
@kindex M m @r{(Group)}
@findex gnus-group-mark-group
Set the mark on the current group (@code{gnus-group-mark-group}).
Toggle the process mark for the current group
(@code{gnus-group-mark-group}).@*
If @code{gnus-process-mark-toggle} is @code{nil}, set the process mark
for the current group.
@item M-#
@kindex M-# @r{(Group)}
@itemx M u
@kindex M u @r{(Group)}
@findex gnus-group-unmark-group
Remove the mark from the current group
Remove the process mark, if any, from the current group
(@code{gnus-group-unmark-group}).
@item M U
@kindex M U @r{(Group)}
@findex gnus-group-unmark-all-groups
Remove the mark from all groups (@code{gnus-group-unmark-all-groups}).
Remove the process mark from all groups (@code{gnus-group-unmark-all-groups}).
@item M w
@kindex M w @r{(Group)}
@findex gnus-group-mark-region
Mark all groups between point and mark (@code{gnus-group-mark-region}).
Mark groups in region (@code{gnus-group-mark-region}).
@item M b
@kindex M b @r{(Group)}
@ -4041,9 +4044,11 @@ Toggle hiding empty topics
@item T #
@kindex T # @r{(Topic)}
@findex gnus-topic-mark-topic
Mark all groups in the current topic with the process mark
Toggle the process mark for all groups in the current topic
(@code{gnus-topic-mark-topic}). This command works recursively on
sub-topics unless given a prefix.
sub-topics unless given a prefix.@*
If @code{gnus-process-mark-toggle} is @code{nil}, set the process mark
for the current topic.
@item T M-#
@kindex T M-# @r{(Topic)}
@ -5241,6 +5246,12 @@ have to disable fetching headers with @samp{XOVER}:
Be aware, though, that this will make entering an @acronym{NNTP} group
much, much slower, so this is not recommended.
One particular scenario in which it can be desirable to not use
@samp{XOVER} is for @code{nnvirtual} groups in order to support
limiting by extra headers (e.g., by the newsgroup of its component
groups). Because group parameters are not inherited, a separate
select method for the component groups with the appropriate
@code{nov-is-evil} set as a method variable is required.
@node Summary Buffer Mode Line
@subsection Summary Buffer Mode Line
@ -6617,14 +6628,16 @@ articles into the cache. For more information,
@kindex # @r{(Summary)}
@kindex M P p @r{(Summary)}
@findex gnus-summary-mark-as-processable
Mark the current article with the process mark
(@code{gnus-summary-mark-as-processable}).
@findex gnus-summary-unmark-as-processable
Toggle the process mark for the current article
(@code{gnus-summary-mark-as-processable}).@*
If @code{gnus-process-mark-toggle} is @code{nil}, set the process mark
for the current article.
@item M P u
@itemx M-#
@kindex M P u @r{(Summary)}
@kindex M-# @r{(Summary)}
@findex gnus-summary-unmark-as-processable
Remove the process mark, if any, from the current article
(@code{gnus-summary-unmark-as-processable}).
@ -10562,13 +10575,15 @@ Here are the available keystrokes when using pick mode:
@item .
@kindex . @r{(Pick)}
@findex gnus-pick-article-or-thread
Pick the article or thread on the current line
(@code{gnus-pick-article-or-thread}). If the variable
Pick the article or thread on the current line or unpick it if is
already picked (@code{gnus-pick-article-or-thread}). If the variable
@code{gnus-thread-hide-subtree} is true, then this key selects the
entire thread when used at the first article of the thread. Otherwise,
it selects just the article. If given a numerical prefix, go to that
thread or article and pick it. (The line number is normally displayed
at the beginning of the summary pick lines.)
at the beginning of the summary pick lines.) If
@code{gnus-process-mark-toggle} is @code{nil}, this key will pick an
article or thread.
@item @key{SPC}
@kindex SPC @r{(Pick)}

130
etc/NEWS
View File

@ -111,6 +111,17 @@ filters.
* Changes in Emacs 28.1
+++
** Etags now supports the Mercury programming language.
See https://mercurylang.org.
+++
** Etags command line option '--declarations' now has Mercury-specific behavior.
All Mercury declarations are tagged by default. However, for
compatibility with 'etags' support for Prolog, predicates and
functions appearing first in clauses will also be tagged if 'etags' is
invoked with the '--declarations' command-line option.
+++
** New command 'font-lock-update', bound to 'C-x x f'.
This command updates the syntax highlighting in this buffer.
@ -295,6 +306,17 @@ default, 9.5 MiB). Press '?' or 'C-h' in that prompt to read more
about the different options to visit a file, how you can disable the
prompt, and how you can tweak the file size threshold.
+++
** Improved support for terminal emulators that encode the Meta flag.
Some terminal emulators set the 8th bit of Meta characters, and then
encode the resulting character code as if it were non-ASCII character
above codepoint 127. Previously, the only way of using these in Emacs
was to set up the terminal emulator to use the 'ESC' characters to send
Meta characters to Emacs, e.g., send "ESC x" when the user types
'M-x'. You can now avoid the need for this setup of such terminal
emulators by using the new input-meta-mode with the special value
'encoded' with these terminal emulators.
* Editing Changes in Emacs 28.1
@ -510,6 +532,13 @@ When emacsclient connects, Emacs will (by default) output a message
about how to exit the client frame. If 'server-client-instructions'
is set to nil, this message is inhibited.
+++
*** New command 'server-edit-abort'.
This command (not bound to any key by default) can be used to abort
an edit instead of marking it as "Done" (which the 'C-x #' command
does). The 'emacsclient' program exits with an abnormal status as
result of this command.
** Perl mode
---
@ -534,9 +563,23 @@ indentation is done using SMIE or with the old ad-hoc code.
** Icomplete
+++
*** New minor mode 'icomplete-vertical-mode'.
This mode is intended to be used with Icomplete or Fido, to display the
list of completions candidates vertically instead of horizontally.
*** New minor mode 'icomplete-vertical-mode', alias 'fido-vertical-mode'.
This mode is intended to be used with Icomplete ('M-x icomplete-mode')
or Fido ('M-x fido-mode'), to display the list of completions
candidates vertically instead of horizontally. When used with
Icomplete, completions are rotated and selection kept at the top.
When used with Fido, completions scroll like a typical dropdown
widget.
*** Default value of 'icomplete-compute-delay' has been changed to 0.15 s.
*** Default value of 'icomplete-max-delay-chars' has been changed to 2.
*** Reduced blinking while completing the next completions set.
Icomplete doesn't hide the hint with the previously computed
completions anymore when compute delay is in effect, or the previous
computation has been aborted by input. Instead it shows the previous
completions until the new ones are ready.
---
** Specific warnings can now be disabled from the warning buffer.
@ -551,8 +594,27 @@ disabled entirely.
---
*** Autoload the main entry point 'mspool-show'.
** Windmove
*** New user options to customize windmove keybindings.
These options include 'windmove-default-keybindings',
'windmove-display-default-keybindings',
'windmove-delete-default-keybindings',
'windmove-swap-states-default-keybindings'.
** Windows
+++
*** New option 'delete-window-choose-selected'.
This allows to choose a frame's selected window after deleting the
previously selected one.
+++
*** New argument NO-OTHER for some window functions.
'get-lru-window', get-mru-window and 'get-largest-window' now accept a
new optional argument NO-OTHER which, if non-nil, avoids returning a
window whose 'no-other-window' parameter is non-nil.
+++
*** New 'display-buffer' function 'display-buffer-use-least-recent-window'.
This is like 'display-buffer-use-some-window', but won't reuse the
@ -829,8 +891,22 @@ If non-nil, only branches and remotes are considered when doing
completion over Git branch names. The default is nil, which causes
tags to be considered as well.
---
*** New user option 'vc-git-log-switches'.
String or list of strings specifying switches for Git log under VC.
** Gnus
+++
*** The '#' command in the Group and Summary buffer now toggles,
instead of sets, the process mark.
+++
*** New user option 'gnus-process-mark-toggle'.
If non-nil (the default), the '#' command in the Group and Summary
buffers will toggle, instead of set, the process mark.
+++
*** New user option 'gnus-registry-register-all'.
If non-nil (the default), create registry entries for all messages.
@ -1037,6 +1113,15 @@ grep-like tools.
On systems where the grep command supports it, directories will be
skipped.
*** Commands that use 'grep-find' now follow symlinks for command-line args.
This is because the default value of 'grep-find-template' now includes
the 'find' option '-H'. Commands that use that variable, including
indirectly via a call to 'xref-matches-in-directory', might be
affected. In particular, there should be no need anymore to ensure
any directory names on the 'find' command lines end in a slash.
This change is for better compatibility with old versions of non-GNU
'find', such as the one used on macOS.
** Help
---
@ -1057,14 +1142,14 @@ GTK toolkit, this is only true if 'x-gtk-use-system-tooltips' is t.
+++
*** New command 'describe-command' shows help for a command.
This can be used instead of 'describe-function' for interactive
commands and is globally bound to `C-h x'.
commands and is globally bound to 'C-h x'.
+++
*** New command 'describe-keymap' describes keybindings in a keymap.
---
*** New user option 'describe-bindings-outline'.
It enables outlines in the output buffer of `describe-bindings' that
It enables outlines in the output buffer of 'describe-bindings' that
can provide a better overview in a long list of available bindings.
---
@ -1252,6 +1337,12 @@ it when producing a doc string.
This is bound to 'C-x n d' in 'shell-mode' buffers, and narrows to the
command line under point (and any following output).
---
*** New user option 'shell-has-auto-cd'.
If non-nil, 'shell-mode' handles implicit "cd" commands, changing the
directory if the command is a directory. Useful for shells like "zsh"
that has this feature.
** Eshell
---
@ -1541,6 +1632,11 @@ symbol property to the browsing commands. With a new command
'browse-url-with-browser-kind', an URL can explicitly be browsed with
either an internal or external browser.
---
*** Support for browsing of remote files.
If a remote file is taken, a local temporary copy of that file is
passed to the browser.
*** Support for the conkeror browser is now obsolete.
*** Support for the Mosaic browser has been removed.
@ -1991,6 +2087,15 @@ Shift while typing 'C-a', i.e. 'C-S-a', will now highlight the text.
** Miscellaneous
---
*** New variable 'hl-line-overlay-priority'.
This can be used to change the priority of the hl-line overlays.
+++
*** New command 'mailcap-view-file'.
This command will open a viewer based on the file type, as determined
by "~/.mailcap" and related files and variables.
+++
*** New command 'C-x C-k Q' to force redisplay in keyboard macros.
@ -2451,6 +2556,13 @@ similar to prefix arguments, but are more flexible and discoverable.
* Incompatible Editing Changes in Emacs 28.1
** 'electric-indent-mode' now also indents inside strings and comments,
(unless the indentation function doesn't, of course).
To recover the previous behavior you can use:
(add-hook 'electric-indent-functions
(lambda (_) (if (nth 8 (syntax-ppss)) 'no-indent)))
** The 'M-o' ('facemenu-keymap') global binding has been removed.
To restore the old binding, say something like:
@ -2502,7 +2614,7 @@ In previous versions of Emacs, numbers with a trailing dot and an exponent
were read as integers and the exponent ignored: 2.e6 was interpreted as the
integer 2. Such numerals are now read as floats with the exponent included:
2.e6 is now read as the floating-point value 2000000.0.
That is, (read-from-string "1.e3") => (1000.0 . 4) now.
That is, '(read-from-string "1.e3")' => '(1000.0 . 4)' now.
+++
** The 'lexical-binding' local variable is always enabled.
@ -2711,7 +2823,7 @@ form should be exceedingly rare. See the Info node "(elisp) Backtracking" in
the Emacs Lisp reference manual for background.
---
** 'sql-*-statement-starters' are no longer defcustoms.
** 'sql-*-statement-starters' are no longer user options.
These variables describe facts about the SQL standard and
product-specific additions. There should be no need for users to
customize them.
@ -2719,6 +2831,10 @@ customize them.
* Lisp Changes in Emacs 28.1
+++
** New function 'buffer-local-boundp'.
This predicate says whether a symbol is bound in a specific buffer.
---
** Emacs now attempts to test for high-rate subprocess output more fairly.
When several subprocesses produce output simultaneously at high rate,

View File

@ -142,7 +142,14 @@ University of California, as described above. */
# define CTAGS false
#endif
/* Copy to DEST from SRC (containing LEN bytes), and append a NUL byte. */
/* Define MERCURY_HEURISTICS_RATIO as it was necessary to disambiguate
Mercury from Objective C, which have same file extensions .m
See comments before function test_objc_is_mercury for details. */
#ifndef MERCURY_HEURISTICS_RATIO
# define MERCURY_HEURISTICS_RATIO 0.5
#endif
/* COPY to DEST from SRC (containing LEN bytes), and append a NUL byte. */
static void
memcpyz (void *dest, void const *src, ptrdiff_t len)
{
@ -359,6 +366,7 @@ static void HTML_labels (FILE *);
static void Lisp_functions (FILE *);
static void Lua_functions (FILE *);
static void Makefile_targets (FILE *);
static void Mercury_functions (FILE *);
static void Pascal_functions (FILE *);
static void Perl_functions (FILE *);
static void PHP_functions (FILE *);
@ -379,6 +387,7 @@ static ptrdiff_t readline_internal (linebuffer *, FILE *, char const *);
static bool nocase_tail (const char *);
static void get_tag (char *, char **);
static void get_lispy_tag (char *);
static void test_objc_is_mercury (char *, language **);
static void analyze_regex (char *);
static void free_regexps (void);
@ -684,10 +693,22 @@ static const char Makefile_help [] =
"In makefiles, targets are tags; additionally, variables are tags\n\
unless you specify '--no-globals'.";
/* Mercury and Objective C share the same .m file extensions. */
static const char *Mercury_suffixes [] =
{"m",
NULL};
static const char Mercury_help [] =
"In Mercury code, tags are all declarations beginning a line with ':-'\n\
and optionally Prolog-like definitions (first rule for a predicate or \
function).\n\
To enable this behavior, run etags using --declarations.";
static bool with_mercury_definitions = false;
float mercury_heuristics_ratio = MERCURY_HEURISTICS_RATIO;
static const char *Objc_suffixes [] =
{ "lm", /* Objective lex file */
"m", /* Objective C file */
NULL };
{ "lm", /* Objective lex file */
"m", /* By default, Objective C file will be assumed. */
NULL};
static const char Objc_help [] =
"In Objective C code, tags include Objective C definitions for classes,\n\
class categories, methods and protocols. Tags for variables and\n\
@ -831,7 +852,9 @@ static language lang_names [] =
{ "lisp", Lisp_help, Lisp_functions, Lisp_suffixes },
{ "lua", Lua_help,Lua_functions,Lua_suffixes,NULL,Lua_interpreters},
{ "makefile", Makefile_help,Makefile_targets,NULL,Makefile_filenames},
/* objc listed before mercury as it is a better default for .m extensions. */
{ "objc", Objc_help, plain_C_entries, Objc_suffixes },
{ "mercury", Mercury_help, Mercury_functions, Mercury_suffixes },
{ "pascal", Pascal_help, Pascal_functions, Pascal_suffixes },
{ "perl",Perl_help,Perl_functions,Perl_suffixes,NULL,Perl_interpreters},
{ "php", PHP_help, PHP_functions, PHP_suffixes },
@ -958,6 +981,9 @@ Relative ones are stored relative to the output file's directory.\n");
puts
("\tand create tags for extern variables unless --no-globals is used.");
puts ("In Mercury, tag both declarations starting a line with ':-' and first\n\
predicates or functions in clauses.");
if (CTAGS)
puts ("-d, --defines\n\
Create tag entries for C #define constants and enum constants, too.");
@ -1783,6 +1809,11 @@ find_entries (FILE *inf)
if (parser == NULL)
{
lang = get_language_from_filename (curfdp->infname, true);
/* Disambiguate file names between Objc and Mercury. */
if (lang != NULL && strcmp (lang->name, "objc") == 0)
test_objc_is_mercury (curfdp->infname, &lang);
if (lang != NULL && lang->function != NULL)
{
curfdp->lang = lang;
@ -6070,6 +6101,472 @@ prolog_atom (char *s, size_t pos)
return 0;
}
/*
* Support for Mercury
*
* Assumes that the declarations start at column 0.
* Original code by Sunichirou Sugou (1989) for Prolog.
* Rewritten by Anders Lindgren (1996) for Prolog.
* Adapted by Fabrice Nicol (2021) for Mercury.
* Note: Prolog-support behavior is preserved if
* --declarations is used, corresponding to
* with_mercury_definitions=true.
*/
static ptrdiff_t mercury_pr (char *, char *, ptrdiff_t);
static void mercury_skip_comment (linebuffer *, FILE *);
static bool is_mercury_type = false;
static bool is_mercury_quantifier = false;
static bool is_mercury_declaration = false;
/*
* Objective-C and Mercury have identical file extension .m.
* To disambiguate between Objective C and Mercury, parse file
* with the following heuristics hook:
* - if line starts with :-, choose Mercury unconditionally;
* - if line starts with #, @, choose Objective-C;
* - otherwise compute the following ratio:
*
* r = (number of lines with :-
* or % in non-commented parts or . at trimmed EOL)
* / (number of lines - number of lines starting by any amount
* of whitespace, optionally followed by comment(s))
*
* Note: strings are neglected in counts.
*
* If r > mercury_heuristics_ratio, choose Mercury.
* Experimental tests show that a possibly optimal default value for
* this floor value is around 0.5. This is the default value for
* MERCURY_HEURISTICS_RATIO, defined in the first lines of this file.
* The closer r is to 0.5, the closer the source code to pure Prolog.
* Idiomatic Mercury is scored either with r = 1.0 or higher.
* Objective-C is scored with r = 0.0. When this fails, the r-score
* never rose above 0.1 in Objective-C tests.
*/
static void
test_objc_is_mercury (char *this_file, language **lang)
{
if (this_file == NULL) return;
FILE* fp = fopen (this_file, "r");
if (fp == NULL)
pfatal (this_file);
bool blank_line = false; /* Line starting with any amount of white space
followed by optional comment(s). */
bool commented_line = false;
bool found_dot = false;
bool only_space_before = true;
bool start_of_line = true;
int c;
intmax_t lines = 1;
intmax_t mercury_dots = 0;
intmax_t percentage_signs = 0;
intmax_t rule_signs = 0;
float ratio = 0;
while ((c = fgetc (fp)) != EOF)
{
switch (c)
{
case '\n':
if (! blank_line) ++lines;
blank_line = true;
commented_line = false;
start_of_line = true;
if (found_dot) ++mercury_dots;
found_dot = false;
only_space_before = true;
break;
case '.':
found_dot = ! commented_line;
only_space_before = false;
break;
case '%': /* More frequent in Mercury. May be modulo in Obj.-C. */
if (! commented_line)
{
++percentage_signs;
/* Cannot tell if it is a comment or modulo yet for sure.
Yet works for heuristic purposes. */
commented_line = true;
}
found_dot = false;
start_of_line = false;
only_space_before = false;
break;
case '/':
{
int d = fgetc (fp);
found_dot = false;
only_space_before = false;
if (! commented_line)
{
if (d == '*')
commented_line = true;
else
/* If d == '/', cannot tell if it is an Obj.-C comment:
may be Mercury integ. division. */
blank_line = false;
}
}
FALLTHROUGH;
case ' ':
case '\t':
start_of_line = false;
break;
case ':':
c = fgetc (fp);
if (start_of_line)
{
if (c == '-')
{
ratio = 1.0; /* Failsafe, not an operator in Obj.-C. */
goto out;
}
start_of_line = false;
}
else
{
/* p :- q. Frequent in Mercury.
Rare or in quoted exprs in Obj.-C. */
if (c == '-' && ! commented_line)
++rule_signs;
}
blank_line = false;
found_dot = false;
only_space_before = false;
break;
case '@':
case '#':
if (start_of_line || only_space_before)
{
ratio = 0.0;
goto out;
}
FALLTHROUGH;
default:
start_of_line = false;
blank_line = false;
found_dot = false;
only_space_before = false;
}
}
/* Fallback heuristic test. Not failsafe but errless in pratice. */
ratio = ((float) rule_signs + percentage_signs + mercury_dots) / lines;
out:
if (fclose (fp) == EOF)
pfatal (this_file);
if (ratio > mercury_heuristics_ratio)
{
/* Change the language from Objective-C to Mercury. */
static language lang0 = { "mercury", Mercury_help, Mercury_functions,
Mercury_suffixes };
*lang = &lang0;
}
}
static void
Mercury_functions (FILE *inf)
{
char *cp, *last = NULL;
ptrdiff_t lastlen = 0, allocated = 0;
if (declarations) with_mercury_definitions = true;
LOOP_ON_INPUT_LINES (inf, lb, cp)
{
if (cp[0] == '\0') /* Empty line. */
continue;
else if (c_isspace (cp[0]) || cp[0] == '%')
/* A Prolog-type comment or anything other than a declaration. */
continue;
else if (cp[0] == '/' && cp[1] == '*') /* Mercury C-type comment. */
mercury_skip_comment (&lb, inf);
else
{
is_mercury_declaration = (cp[0] == ':' && cp[1] == '-');
if (is_mercury_declaration
|| with_mercury_definitions)
{
ptrdiff_t len = mercury_pr (cp, last, lastlen);
if (0 < len)
{
/* Store the declaration to avoid generating duplicate
tags later. */
if (allocated <= len)
{
xrnew (last, len + 1, 1);
allocated = len + 1;
}
memcpyz (last, cp, len);
lastlen = len;
}
}
}
}
free (last);
}
static void
mercury_skip_comment (linebuffer *plb, FILE *inf)
{
char *cp;
do
{
for (cp = plb->buffer; *cp != '\0'; ++cp)
if (cp[0] == '*' && cp[1] == '/')
return;
readline (plb, inf);
}
while (perhaps_more_input (inf));
}
/*
* A declaration is added if it matches:
* <beginning of line>:-<whitespace><Mercury Term><whitespace>(
* If with_mercury_definitions == true, we also add:
* <beginning of line><Mercury item><whitespace>(
* or <beginning of line><Mercury item><whitespace>:-
* As for Prolog support, different arities and types are not taken into
* consideration.
* Item is added to the tags database if it doesn't match the
* name of the previous declaration.
*
* Consume a Mercury declaration.
* Return the number of bytes consumed, or 0 if there was an error.
*
* A Mercury declaration must be one of:
* :- type
* :- solver type
* :- pred
* :- func
* :- inst
* :- mode
* :- typeclass
* :- instance
* :- pragma
* :- promise
* :- initialise
* :- finalise
* :- mutable
* :- module
* :- interface
* :- implementation
* :- import_module
* :- use_module
* :- include_module
* :- end_module
* followed on the same line by an alphanumeric sequence, starting with a lower
* case letter or by a single-quoted arbitrary string.
* Single quotes can escape themselves. Backslash quotes everything.
*
* Return the size of the name of the declaration or 0 if no header was found.
* As quantifiers may precede functions or predicates, we must list them too.
*/
static const char *Mercury_decl_tags[] = {"type", "solver type", "pred",
"func", "inst", "mode", "typeclass", "instance", "pragma", "promise",
"initialise", "finalise", "mutable", "module", "interface", "implementation",
"import_module", "use_module", "include_module", "end_module", "some", "all"};
static size_t
mercury_decl (char *s, size_t pos)
{
if (s == NULL) return 0;
size_t origpos;
origpos = pos;
while (s + pos != NULL && (c_isalnum (s[pos]) || s[pos] == '_')) ++pos;
unsigned char decl_type_length = pos - origpos;
char buf[decl_type_length + 1];
memset (buf, 0, decl_type_length + 1);
/* Mercury declaration tags. Consume them, then check the declaration item
following :- is legitimate, then go on as in the prolog case. */
memcpy (buf, &s[origpos], decl_type_length);
bool found_decl_tag = false;
if (is_mercury_quantifier)
{
if (strcmp (buf, "pred") != 0 && strcmp (buf, "func") != 0) /* Bad syntax. */
return 0;
is_mercury_quantifier = false; /* Reset to base value. */
found_decl_tag = true;
}
else
{
for (int j = 0; j < sizeof (Mercury_decl_tags) / sizeof (char*); ++j)
{
if (strcmp (buf, Mercury_decl_tags[j]) == 0)
{
found_decl_tag = true;
if (strcmp (buf, "type") == 0)
is_mercury_type = true;
if (strcmp (buf, "some") == 0
|| strcmp (buf, "all") == 0)
{
is_mercury_quantifier = true;
}
break; /* Found declaration tag of rank j. */
}
else
/* 'solver type' has a blank in the middle,
so this is the hard case. */
if (strcmp (buf, "solver") == 0)
{
++pos;
while (s + pos != NULL && (c_isalnum (s[pos]) || s[pos] == '_'))
++pos;
decl_type_length = pos - origpos;
char buf2[decl_type_length + 1];
memset (buf2, 0, decl_type_length + 1);
memcpy (buf2, &s[origpos], decl_type_length);
if (strcmp (buf2, "solver type") == 0)
{
found_decl_tag = false;
break; /* Found declaration tag of rank j. */
}
}
}
}
/* If with_mercury_definitions == false
* this is a Mercury syntax error, ignoring... */
if (with_mercury_definitions)
{
if (found_decl_tag)
pos = skip_spaces (s + pos) - s; /* Skip len blanks again. */
else
/* Prolog-like behavior
* we have parsed the predicate once, yet inappropriately
* so restarting again the parsing step. */
pos = 0;
}
else
{
if (found_decl_tag)
pos = skip_spaces (s + pos) - s; /* Skip len blanks again. */
else
return 0;
}
/* From now on it is the same as for Prolog except for module dots. */
if (c_islower (s[pos]) || s[pos] == '_' )
{
/* The name is unquoted.
Do not confuse module dots with end-of-declaration dots. */
while (c_isalnum (s[pos])
|| s[pos] == '_'
|| (s[pos] == '.' /* A module dot. */
&& s + pos + 1 != NULL
&& (c_isalnum (s[pos + 1]) || s[pos + 1] == '_')))
++pos;
return pos - origpos;
}
else if (s[pos] == '\'')
{
++pos;
for (;;)
{
if (s[pos] == '\'')
{
++pos;
if (s[pos] != '\'')
break;
++pos; /* A double quote. */
}
else if (s[pos] == '\0') /* Multiline quoted atoms are ignored. */
return 0;
else if (s[pos] == '\\')
{
if (s[pos+1] == '\0')
return 0;
pos += 2;
}
else
++pos;
}
return pos - origpos;
}
else if (is_mercury_quantifier && s[pos] == '[') /* :- some [T] pred/func. */
{
for (++pos; s + pos != NULL && s[pos] != ']'; ++pos) {}
if (s + pos == NULL) return 0;
++pos;
pos = skip_spaces (s + pos) - s;
return mercury_decl (s, pos) + pos - origpos;
}
else
return 0;
}
static ptrdiff_t
mercury_pr (char *s, char *last, ptrdiff_t lastlen)
{
size_t len0 = 0;
is_mercury_type = false;
is_mercury_quantifier = false;
if (is_mercury_declaration)
{
/* Skip len0 blanks only for declarations. */
len0 = skip_spaces (s + 2) - s;
}
size_t len = mercury_decl (s, len0);
if (len == 0) return 0;
len += len0;
if (( (s[len] == '.' /* This is a statement dot, not a module dot. */
|| (s[len] == '(' && (len += 1))
|| (s[len] == ':' /* Stopping in case of a rule. */
&& s[len + 1] == '-'
&& (len += 2)))
&& (lastlen != len || memcmp (s, last, len) != 0)
)
/* Types are often declared on several lines so keeping just
the first line. */
|| is_mercury_type)
{
char *name = skip_non_spaces (s + len0);
size_t namelen;
if (name >= s + len)
{
name = s;
namelen = len;
}
else
{
name = skip_spaces (name);
namelen = len - (name - s);
}
/* Remove trailing non-name characters. */
while (namelen > 0 && notinname (name[namelen - 1]))
namelen--;
make_tag (name, namelen, true, s, len, lineno, linecharno);
return len;
}
return 0;
}
/*
* Support for Erlang

View File

@ -64,7 +64,7 @@ endif
../config.status: $(top_srcdir)/configure.ac $(top_srcdir)/m4/*.m4
$(MAKE) -C .. $(notdir $@)
Makefile: ../config.status $(srcdir)/Makefile.in
$(MAKE) -C .. src/$@
$(MAKE) -C .. lib/$@
# Object modules that need not be built for Emacs.
# Emacs does not need e-regex.o (it has its own regex-emacs.c),

View File

@ -274,7 +274,7 @@ $(THEFILE)c:
ifeq ($(HAVE_NATIVE_COMP),yes)
$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
-l comp -f byte-compile-refresh-preloaded \
-f batch-byte-native-compile-for-bootstrap $(THEFILE)
-f batch-byte+native-compile $(THEFILE)
else
$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
-l bytecomp -f byte-compile-refresh-preloaded \
@ -295,7 +295,7 @@ endif
ifeq ($(HAVE_NATIVE_COMP),yes)
.el.elc:
$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) \
-l comp -f batch-byte-native-compile-for-bootstrap $<
-l comp -f batch-byte+native-compile $<
else
.el.elc:
$(AM_V_ELC)$(emacs) $(BYTE_COMPILE_FLAGS) -f batch-byte-compile $<

View File

@ -121,12 +121,12 @@ let-binding."
:initform nil
:documentation "Internal backend data.")
(create-function :initarg :create-function
:initform ignore
:initform #'ignore
:type function
:custom function
:documentation "The create function.")
(search-function :initarg :search-function
:initform ignore
:initform #'ignore
:type function
:custom function
:documentation "The search function.")))

View File

@ -47,7 +47,7 @@
;; and features of those files.
(defclass ede-target (eieio-speedbar-directory-button eieio-named)
((buttonface :initform speedbar-file-face) ;override for superclass
((buttonface :initform 'speedbar-file-face) ;override for superclass
(name :initarg :name
:type string
:custom string
@ -91,16 +91,16 @@ This is used to match target objects with the compilers they can use, and
which files this object is interested in."
:accessor ede-object-sourcecode)
(keybindings :allocation :class
:initform (("D" . ede-debug-target))
:initform '(("D" . ede-debug-target))
:documentation
"Keybindings specialized to this type of target."
:accessor ede-object-keybindings)
(menu :allocation :class
:initform ( [ "Debug target" ede-debug-target
(ede-buffer-belongs-to-target-p) ]
[ "Run target" ede-run-target
(ede-buffer-belongs-to-target-p) ]
)
:initform '( [ "Debug target" ede-debug-target
(ede-buffer-belongs-to-target-p) ]
[ "Run target" ede-run-target
(ede-buffer-belongs-to-target-p) ]
)
:documentation "Menu specialized to this type of target."
:accessor ede-object-menu)
)
@ -236,7 +236,7 @@ also be of a form used by TRAMP for use with scp, or rcp.")
This FTP site should be in Emacs form as needed by `ange-ftp'.
If this slot is nil, then use `ftp-site' instead.")
(configurations :initarg :configurations
:initform ("debug" "release")
:initform '("debug" "release")
:type list
:custom (repeat string)
:label "Configuration Options"
@ -258,25 +258,25 @@ and target specific elements such as build variables.")
:group (settings)
:documentation "Project local variables")
(keybindings :allocation :class
:initform (("D" . ede-debug-target)
("R" . ede-run-target))
:initform '(("D" . ede-debug-target)
("R" . ede-run-target))
:documentation "Keybindings specialized to this type of target."
:accessor ede-object-keybindings)
(menu :allocation :class
:initform
(
[ "Update Version" ede-update-version ede-object ]
[ "Version Control Status" ede-vc-project-directory ede-object ]
[ "Edit Project Homepage" ede-edit-web-page
(and ede-object (oref (ede-toplevel) web-site-file)) ]
[ "Browse Project URL" ede-web-browse-home
(and ede-object
(not (string= "" (oref (ede-toplevel) web-site-url)))) ]
"--"
[ "Rescan Project Files" ede-rescan-toplevel t ]
[ "Edit Projectfile" ede-edit-file-target
(ede-buffer-belongs-to-project-p) ]
)
'(
[ "Update Version" ede-update-version ede-object ]
[ "Version Control Status" ede-vc-project-directory ede-object ]
[ "Edit Project Homepage" ede-edit-web-page
(and ede-object (oref (ede-toplevel) web-site-file)) ]
[ "Browse Project URL" ede-web-browse-home
(and ede-object
(not (string= "" (oref (ede-toplevel) web-site-url)))) ]
"--"
[ "Rescan Project Files" ede-rescan-toplevel t ]
[ "Edit Projectfile" ede-edit-file-target
(ede-buffer-belongs-to-project-p) ]
)
:documentation "Menu specialized to this type of target."
:accessor ede-object-menu)
)

View File

@ -96,7 +96,7 @@ and also want to save some extra level of configuration.")
This filename excludes the directory name and is used to
initialize the :file slot of the persistent baseclass.")
(config-class
:initform ede-extra-config
:initform 'ede-extra-config
:allocation :class
:type class
:documentation

View File

@ -137,7 +137,7 @@ subclasses of this base target will override the default value.")
ede-project-with-config-program
ede-project-with-config-c
ede-project-with-config-java)
((config-class :initform ede-generic-config)
((config-class :initform 'ede-generic-config)
(config-file-basename :initform "EDEConfig.el")
(buildfile :initform ""
:type string

View File

@ -34,8 +34,8 @@
;;; Code:
(defclass ede-proj-target-makefile-objectcode (ede-proj-target-makefile)
(;; Give this a new default
(configuration-variables :initform ("debug" . (("CFLAGS" . "-g")
("LDFLAGS" . "-g"))))
(configuration-variables :initform '("debug" . (("CFLAGS" . "-g")
("LDFLAGS" . "-g"))))
;; @TODO - add an include path.
(availablecompilers :initform '(ede-gcc-compiler
ede-g++-compiler

View File

@ -220,7 +220,7 @@ This enables the creation of your target type."
((extension :initform ".ede")
(file-header-line :initform ";; EDE Project Files are auto generated: Do Not Edit")
(makefile-type :initarg :makefile-type
:initform Makefile
:initform 'Makefile
:type symbol
:custom (choice (const Makefile)
;(const Makefile.in)
@ -240,7 +240,7 @@ in targets.")
:documentation "Variables to set in this Makefile.")
(configuration-variables
:initarg :configuration-variables
:initform ("debug" (("DEBUG" . "1")))
:initform '("debug" (("DEBUG" . "1")))
:type list
:custom (repeat (cons (string :tag "Configuration")
(repeat
@ -269,10 +269,10 @@ These files can contain additional rules, variables, and customizations.")
:documentation
"Non-nil to do implement automatic dependencies in the Makefile.")
(menu :initform
(
[ "Regenerate Makefiles" ede-proj-regenerate t ]
[ "Upload Distribution" ede-upload-distribution t ]
)
'(
[ "Regenerate Makefiles" ede-proj-regenerate t ]
[ "Upload Distribution" ede-upload-distribution t ]
)
)
(metasubproject
:initarg :metasubproject

View File

@ -79,7 +79,7 @@ be searched."
;;; SEMANTIC Database related Code
;;; Classes:
(defclass semanticdb-table-ebrowse (semanticdb-table)
((major-mode :initform c++-mode)
((major-mode :initform #'c++-mode)
(ebrowse-tree :initform nil
:initarg :ebrowse-tree
:documentation
@ -95,7 +95,7 @@ This table is composited from the ebrowse *Globals* section.")
(defclass semanticdb-project-database-ebrowse
(semanticdb-project-database)
((new-table-class :initform semanticdb-table-ebrowse
((new-table-class :initform 'semanticdb-table-ebrowse
:type class
:documentation
"New tables created for this database are of this class.")

View File

@ -40,7 +40,7 @@
;;; Classes:
(defclass semanticdb-table-emacs-lisp (semanticdb-abstract-table)
((major-mode :initform emacs-lisp-mode)
((major-mode :initform #'emacs-lisp-mode)
)
"A table for returning search results from Emacs.")
@ -63,7 +63,7 @@ It does not need refreshing."
(defclass semanticdb-project-database-emacs-lisp
(semanticdb-project-database eieio-singleton)
((new-table-class :initform semanticdb-table-emacs-lisp
((new-table-class :initform 'semanticdb-table-emacs-lisp
:type class
:documentation
"New tables created for this database are of this class.")

View File

@ -80,7 +80,7 @@ See bottom of this file for instructions on managing this list.")
;;; Classes:
(defclass semanticdb-table-javascript (semanticdb-search-results-table)
((major-mode :initform javascript-mode)
((major-mode :initform #'javascript-mode)
)
"A table for returning search results from javascript.")
@ -88,7 +88,7 @@ See bottom of this file for instructions on managing this list.")
(semanticdb-project-database
eieio-singleton ;this db is for js globals, so singleton is appropriate
)
((new-table-class :initform semanticdb-table-javascript
((new-table-class :initform 'semanticdb-table-javascript
:type class
:documentation
"New tables created for this database are of this class.")

View File

@ -321,12 +321,12 @@ Adds the number of tags in this file to the object print name."
'(list-of semanticdb-abstract-table))
(defclass semanticdb-project-database (eieio-instance-tracker)
((tracking-symbol :initform semanticdb-database-list)
((tracking-symbol :initform 'semanticdb-database-list)
(reference-directory :type string
:documentation "Directory this database refers to.
When a cache directory is specified, then this refers to the directory
this database contains symbols for.")
(new-table-class :initform semanticdb-table
(new-table-class :initform 'semanticdb-table
:type class
:documentation
"New tables created for this database are of this class.")

View File

@ -38,13 +38,13 @@
(keybindings :initform nil)
(phony :initform t)
(sourcetype :initform
(semantic-ede-source-grammar-wisent
semantic-ede-source-grammar-bovine
))
'(semantic-ede-source-grammar-wisent
semantic-ede-source-grammar-bovine
))
(availablecompilers :initform
(semantic-ede-grammar-compiler-wisent
semantic-ede-grammar-compiler-bovine
))
'(semantic-ede-grammar-compiler-wisent
semantic-ede-grammar-compiler-bovine
))
(aux-packages :initform '("semantic" "cedet-compat"))
(pre-load-packages :initform '("cedet-compat" "semantic/grammar" "semantic/bovine/grammar" "semantic/wisent/grammar"))
)

View File

@ -168,7 +168,7 @@ This shell should support pipe redirect syntax."
(erase-buffer)
(setq default-directory rootdir)
(let ((cmd (semantic-symref-grep-use-template
(file-name-as-directory (file-local-name rootdir))
(directory-file-name (file-local-name rootdir))
filepattern grepflags greppat)))
(process-file semantic-symref-grep-shell nil b nil
shell-command-switch cmd)))

View File

@ -110,7 +110,12 @@ stack is broken."
:type (or null string)
:documentation
"If there is a colon in the inserter's name, it represents
additional static argument data."))
additional static argument data.")
(key :initform nil :allocation :class
:documentation
"The character code used to identify inserters of this style.
All children of this class should specify `key' slot with appropriate
:initform value."))
"This represents an item to be inserted via a template macro.
Plain text strings are not handled via this baseclass."
:abstract t)

View File

@ -89,6 +89,8 @@ DICT-ENTRIES are additional dictionary values to add."
;; for this insertion step.
))
(eieio-declare-slots (point :allocation :class))
(defun srecode-insert-fcn (template dictionary &optional stream skipresolver)
"Insert TEMPLATE using DICTIONARY into STREAM.
Optional SKIPRESOLVER means to avoid refreshing the tag list,
@ -134,13 +136,13 @@ has set everything up already."
)
(srecode-insert-method template dictionary))
;; Handle specialization of the POINT inserter.
(when (and (bufferp standard-output)
(slot-boundp 'srecode-template-inserter-point 'point)
)
(set-buffer standard-output)
(setq end-mark (point-marker))
(goto-char (oref-default 'srecode-template-inserter-point point)))
(oset-default 'srecode-template-inserter-point point eieio-unbound)
(when (bufferp standard-output)
(let ((point (oref-default 'srecode-template-inserter-point point)))
(when point
(set-buffer standard-output)
(setq end-mark (point-marker))
(goto-char point))))
(oset-default 'srecode-template-inserter-point point nil)
;; Return the end-mark.
(or end-mark (point)))
@ -733,6 +735,7 @@ DEPTH.")
"The character code used to identify inserters of this style.")
(point :type (or null marker)
:allocation :class
:initform nil
:documentation
"Record the value of (point) in this class slot.
It is the responsibility of the inserter algorithm to clear this

View File

@ -1528,7 +1528,7 @@ See `custom-enabled-themes' for a list of enabled themes."
(let* ((prop (car s))
(symbol (cadr s))
(val (assq-delete-all theme (get symbol prop))))
(custom-push-theme prop symbol theme 'reset)
(put symbol prop val)
(cond
((eq prop 'theme-value)
(custom-theme-recalc-variable symbol)

View File

@ -1859,7 +1859,7 @@ unless OK-IF-ALREADY-EXISTS is non-nil."
(while blist
(with-current-buffer (car blist)
(if (and buffer-file-name
(dired-in-this-tree-p buffer-file-name expanded-from-dir))
(file-in-directory-p buffer-file-name expanded-from-dir))
(let ((modflag (buffer-modified-p))
(to-file (replace-regexp-in-string
(concat "^" (regexp-quote from-dir))
@ -1878,7 +1878,7 @@ unless OK-IF-ALREADY-EXISTS is non-nil."
(while alist
(setq elt (car alist)
alist (cdr alist))
(if (dired-in-this-tree-p (car elt) expanded-dir)
(if (file-in-directory-p (car elt) expanded-dir)
;; ELT's subdir is affected by the rename
(dired-rename-subdir-2 elt dir to)))
(if (equal dir default-directory)
@ -1963,6 +1963,9 @@ or with the current marker character if MARKER-CHAR is t."
(let (to overwrite-query
overwrite-backup-query) ; for dired-handle-overwrite
(dolist (from fn-list)
;; Position point on the current file -- this is useful if
;; handling a number of files to show where we're working at.
(dired-goto-file from)
(setq to (funcall name-constructor from))
(if (equal to from)
(progn
@ -2704,7 +2707,7 @@ This function takes some pains to conform to `ls -lR' output."
(setq switches (string-replace "R" "" switches))
(dolist (cur-ass dired-subdir-alist)
(let ((cur-dir (car cur-ass)))
(and (dired-in-this-tree-p cur-dir dirname)
(and (file-in-directory-p cur-dir dirname)
(let ((cur-cons (assoc-string cur-dir dired-switches-alist)))
(if cur-cons
(setcdr cur-cons switches)
@ -2716,7 +2719,7 @@ This function takes some pains to conform to `ls -lR' output."
(defun dired-insert-subdir-validate (dirname &optional switches)
;; Check that it is valid to insert DIRNAME with SWITCHES.
;; Signal an error if invalid (e.g. user typed `i' on `..').
(or (dired-in-this-tree-p dirname (expand-file-name default-directory))
(or (file-in-directory-p dirname (expand-file-name default-directory))
(error "%s: not in this directory tree" dirname))
(let ((real-switches (or switches dired-subdir-switches)))
(when real-switches
@ -2757,7 +2760,7 @@ of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well."
(setq dir (car (car s-alist))
s-alist (cdr s-alist))
(and (or kill-root (not (string-equal dir dirname)))
(dired-in-this-tree-p dir dirname)
(file-in-directory-p dir dirname)
(dired-goto-subdir dir)
(setq m-alist (nconc (dired-kill-subdir remember-marks) m-alist))))
m-alist))
@ -2989,7 +2992,7 @@ Lower levels are unaffected."
(while rest
(setq elt (car rest)
rest (cdr rest))
(if (dired-in-this-tree-p (directory-file-name (car elt)) dir)
(if (file-in-directory-p (directory-file-name (car elt)) dir)
(setq rest nil
pos (dired-goto-subdir (car elt))))))
(if pos

View File

@ -2820,10 +2820,12 @@ You can then feed the file name(s) to other commands with \\[yank]."
;; Keeping Dired buffers in sync with the filesystem and with each other
(defun dired-buffers-for-dir (dir &optional file)
(defun dired-buffers-for-dir (dir &optional file subdirs)
"Return a list of buffers for DIR (top level or in-situ subdir).
If FILE is non-nil, include only those whose wildcard pattern (if any)
matches FILE.
If SUBDIRS is non-nil, also include the dired buffers of
directories below DIR.
The list is in reverse order of buffer creation, most recent last.
As a side effect, killed dired buffers for DIR are removed from
dired-buffers."
@ -2835,19 +2837,20 @@ dired-buffers."
((null (buffer-name buf))
;; Buffer is killed - clean up:
(setq dired-buffers (delq elt dired-buffers)))
((dired-in-this-tree-p dir (car elt))
((file-in-directory-p (car elt) dir)
(with-current-buffer buf
(and (assoc dir dired-subdir-alist)
(or (null file)
(if (stringp dired-directory)
(let ((wildcards (file-name-nondirectory
dired-directory)))
(or (zerop (length wildcards))
(string-match-p (dired-glob-regexp wildcards)
file)))
(member (expand-file-name file dir)
(cdr dired-directory))))
(setq result (cons buf result)))))))
(when (and (or subdirs
(assoc dir dired-subdir-alist))
(or (null file)
(if (stringp dired-directory)
(let ((wildcards (file-name-nondirectory
dired-directory)))
(or (zerop (length wildcards))
(string-match-p (dired-glob-regexp wildcards)
file)))
(member (expand-file-name file dir)
(cdr dired-directory)))))
(setq result (cons buf result)))))))
result))
(defun dired-glob-regexp (pattern)
@ -2912,6 +2915,7 @@ dired-buffers."
;;"Is FILE part of the directory tree starting at DIR?"
(let (case-fold-search)
(string-match-p (concat "^" (regexp-quote dir)) file)))
(make-obsolete 'dired-in-this-tree-p 'file-in-directory-p "28.1")
(define-obsolete-function-alias 'dired-in-this-tree
'dired-in-this-tree-p "27.1")
@ -3280,15 +3284,19 @@ non-empty directories is allowed."
(interactive)
(let* ((dired-marker-char dired-del-marker)
(regexp (dired-marker-regexp))
case-fold-search)
case-fold-search markers)
(if (save-excursion (goto-char (point-min))
(re-search-forward regexp nil t))
(dired-internal-do-deletions
(nreverse
;; this can't move point since ARG is nil
(dired-map-over-marks (cons (dired-get-filename) (point))
(dired-map-over-marks (cons (dired-get-filename)
(let ((m (point-marker)))
(push m markers)
m))
nil))
nil t)
(dolist (m markers) (set-marker m nil))
(or nomessage
(message "(No deletions requested)")))))
@ -3299,12 +3307,17 @@ non-empty directories is allowed."
;; This is more consistent with the file marking feature than
;; dired-do-flagged-delete.
(interactive "P")
(dired-internal-do-deletions
(nreverse
;; this may move point if ARG is an integer
(dired-map-over-marks (cons (dired-get-filename) (point))
arg))
arg t))
(let (markers)
(dired-internal-do-deletions
(nreverse
;; this may move point if ARG is an integer
(dired-map-over-marks (cons (dired-get-filename)
(let ((m (point-marker)))
(push m markers)
m))
arg))
arg t)
(dolist (m markers) (set-marker m nil))))
(defvar dired-deletion-confirmer 'yes-or-no-p) ; or y-or-n-p?
@ -3312,11 +3325,6 @@ non-empty directories is allowed."
;; L is an alist of files to delete, with their buffer positions.
;; ARG is the prefix arg.
;; Filenames are absolute.
;; (car L) *must* be the *last* (bottommost) file in the dired buffer.
;; That way as changes are made in the buffer they do not shift the
;; lines still to be changed, so the (point) values in L stay valid.
;; Also, for subdirs in natural order, a subdir's files are deleted
;; before the subdir itself - the other way around would not work.
(let* ((files (mapcar #'car l))
(count (length l))
(succ 0)
@ -3337,9 +3345,10 @@ non-empty directories is allowed."
(make-progress-reporter
(if trashing "Trashing..." "Deleting...")
succ count))
failures) ;; files better be in reverse order for this loop!
failures)
(while l
(goto-char (cdr (car l)))
(goto-char (marker-position (cdr (car l))))
(dired-move-to-filename)
(let ((inhibit-read-only t))
(condition-case err
(let ((fn (car (car l))))
@ -3422,7 +3431,8 @@ confirmation. To disable the confirmation, see
(file-name-nondirectory fn))))
(not dired-clean-confirm-killing-deleted-buffers))
(kill-buffer buf)))
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn))))
(let ((buf-list (dired-buffers-for-dir (expand-file-name fn)
nil 'subdirs)))
(and buf-list
(or (and dired-clean-confirm-killing-deleted-buffers
(y-or-n-p

View File

@ -245,10 +245,7 @@ or comment."
'electric-indent-functions
last-command-event)
(memq last-command-event electric-indent-chars))))
(not
(or (memq act '(nil no-indent))
;; In a string or comment.
(unless (eq act 'do-indent) (nth 8 (syntax-ppss))))))))
(not (memq act '(nil no-indent))))))
;; If we error during indent, silently give up since this is an
;; automatic action that the user didn't explicitly request.
;; But we don't want to suppress errors from elsewhere in *this*

View File

@ -37,8 +37,7 @@
"Return the time in seconds elapsed for execution of FORMS."
(declare (indent 0) (debug t))
(let ((t1 (make-symbol "t1")))
`(let (,t1)
(setq ,t1 (current-time))
`(let ((,t1 (current-time)))
,@forms
(float-time (time-since ,t1)))))

View File

@ -343,7 +343,7 @@ Same format as `byte-optimize--lexvars', with shared structure and contents.")
(numberp expr)
(stringp expr)
(and (consp expr)
(eq (car expr) 'quote)
(memq (car expr) '(quote function))
(symbolp (cadr expr)))
(keywordp expr)))
@ -1269,6 +1269,14 @@ See Info node `(elisp) Integer Basics'."
form)
form))
(put 'cons 'byte-optimizer #'byte-optimize-cons)
(defun byte-optimize-cons (form)
;; (cons X nil) => (list X)
(if (and (= (safe-length form) 3)
(null (nth 2 form)))
`(list ,(nth 1 form))
form))
;; Fixme: delete-char -> delete-region (byte-coded)
;; optimize string-as-unibyte, string-as-multibyte, string-make-unibyte,
;; string-make-multibyte for constant args.

View File

@ -606,7 +606,7 @@ Each element is (INDEX . VALUE)")
"Non nil while native compiling.")
(defvar byte-native-qualities nil
"To spill default qualities from the compiled file.")
(defvar byte-native-for-bootstrap nil
(defvar byte+native-compile nil
"Non nil while compiling for bootstrap."
;; During bootstrap we produce both the .eln and the .elc together.
;; Because the make target is the later this has to be produced as
@ -2109,7 +2109,7 @@ See also `emacs-lisp-byte-compile-and-load'."
;; recompiled). Previously this was accomplished by
;; deleting target-file before writing it.
(if byte-native-compiling
(if byte-native-for-bootstrap
(if byte+native-compile
;; Defer elc final renaming.
(setf byte-to-native-output-file
(cons tempfile target-file))

View File

@ -203,7 +203,7 @@ Make sure the width/height is correct."
(defclass chart-bar (chart)
((direction :initarg :direction
:initform vertical))
:initform 'vertical))
"Subclass for bar charts (vertical or horizontal).")
(cl-defmethod chart-draw ((c chart) &optional buff)

View File

@ -200,6 +200,9 @@ Emacs Lisp file:
\;; Local Variables:\n;; no-native-compile: t\n;; End:")
;;;###autoload(put 'no-native-compile 'safe-local-variable 'booleanp)
(defvar native-compile-target-directory nil
"When non-nil force the target directory for the eln files being compiled.")
(defvar comp-log-time-report nil
"If non-nil, log a time report for each pass.")
@ -1337,8 +1340,9 @@ clashes."
(unless (comp-ctxt-output comp-ctxt)
(setf (comp-ctxt-output comp-ctxt) (comp-el-to-eln-filename
filename
(when byte-native-for-bootstrap
(car (last native-comp-eln-load-path))))))
(or native-compile-target-directory
(when byte+native-compile
(car (last native-comp-eln-load-path)))))))
(setf (comp-ctxt-speed comp-ctxt) (alist-get 'native-comp-speed
byte-native-qualities)
(comp-ctxt-debug comp-ctxt) (alist-get 'native-comp-debug
@ -3643,7 +3647,7 @@ Prepare every function for final compilation and drive the C back-end."
;; unless during bootstrap or async compilation (bug#45056). GCC
;; leaks memory but also interfere with the ability of Emacs to
;; detect when a sub-process completes (TODO understand why).
(if (or byte-native-for-bootstrap comp-async-compilation)
(if (or byte+native-compile comp-async-compilation)
(comp-final1)
;; Call comp-final1 in a child process.
(let* ((output (comp-ctxt-output comp-ctxt))
@ -3941,7 +3945,11 @@ display a message."
(load1 load)
(process (make-process
:name (concat "Compiling: " source-file)
:buffer (get-buffer-create comp-async-buffer-name)
:buffer (with-current-buffer
(get-buffer-create
comp-async-buffer-name)
(setf buffer-read-only t)
(current-buffer))
:command (list
(expand-file-name invocation-name
invocation-directory)
@ -3970,8 +3978,9 @@ display a message."
(run-hooks 'native-comp-async-all-done-hook)
(with-current-buffer (get-buffer-create comp-async-buffer-name)
(save-excursion
(goto-char (point-max))
(insert "Compilation finished.\n")))
(let ((buffer-read-only nil))
(goto-char (point-max))
(insert "Compilation finished.\n"))))
;; `comp-deferred-pending-h' should be empty at this stage.
;; Reset it anyway.
(clrhash comp-deferred-pending-h)))
@ -4166,7 +4175,7 @@ it wont work in an interactive Emacs.
Native compilation equivalent to `batch-byte-compile'."
(comp-ensure-native-compiler)
(cl-loop for file in command-line-args-left
if (or (null byte-native-for-bootstrap)
if (or (null byte+native-compile)
(cl-notany (lambda (re) (string-match re file))
native-comp-bootstrap-deny-list))
do (comp--native-compile file)
@ -4174,18 +4183,18 @@ Native compilation equivalent to `batch-byte-compile'."
do (byte-compile-file file)))
;;;###autoload
(defun batch-byte-native-compile-for-bootstrap ()
(defun batch-byte+native-compile ()
"Like `batch-native-compile', but used for bootstrap.
Generate .elc files in addition to the .eln files.
Force the produced .eln to be outputted in the eln system
directory (the last entry in `native-comp-eln-load-path').
If the environment variable 'NATIVE_DISABLED' is set, only byte
compile."
directory (the last entry in `native-comp-eln-load-path') unless
`native-compile-target-directory' is non-nil. If the environment
variable 'NATIVE_DISABLED' is set, only byte compile."
(comp-ensure-native-compiler)
(if (equal (getenv "NATIVE_DISABLED") "1")
(batch-byte-compile)
(cl-assert (length= command-line-args-left 1))
(let ((byte-native-for-bootstrap t)
(let ((byte+native-compile t)
(byte-to-native-output-file nil))
(batch-native-compile)
(pcase byte-to-native-output-file

View File

@ -156,7 +156,7 @@ only one object ever exists."
;; NOTE TO SELF: In next version, make `slot-boundp' support classes
;; with class allocated slots or default values.
(let ((old (oref-default class singleton)))
(if (eq old eieio-unbound)
(if (eq old eieio--unbound)
(oset-default class singleton (cl-call-next-method))
old)))

View File

@ -71,11 +71,10 @@ Currently under control of this var:
- Define <class>-child-p and <class>-list-p predicates.
- Allow object names in constructors.")
(defconst eieio-unbound
(if (and (boundp 'eieio-unbound) (symbolp eieio-unbound))
eieio-unbound
(make-symbol "unbound"))
(define-obsolete-variable-alias 'eieio-unbound 'eieio--unbound "28.1")
(defvar eieio--unbound (make-symbol "eieio--unbound")
"Uninterned symbol representing an unbound slot in an object.")
(defvar eieio--unbound-form (macroexp-quote eieio--unbound))
;; This is a bootstrap for eieio-default-superclass so it has a value
;; while it is being built itself.
@ -264,6 +263,7 @@ use \\='%s or turn off `eieio-backward-compatibility' instead" cname)
(object-of-class-p obj class))))
(defvar eieio--known-slot-names nil)
(defvar eieio--known-class-slot-names nil)
(defun eieio-defclass-internal (cname superclasses slots options)
"Define CNAME as a new subclass of SUPERCLASSES.
@ -381,7 +381,7 @@ See `defclass' for more information."
(pcase-dolist (`(,name . ,slot) slots)
(let* ((init (or (plist-get slot :initform)
(if (member :initform slot) nil
eieio-unbound)))
eieio--unbound-form)))
(initarg (plist-get slot :initarg))
(docstr (plist-get slot :documentation))
(prot (plist-get slot :protection))
@ -395,6 +395,14 @@ See `defclass' for more information."
(skip-nil (eieio--class-option-assoc options :allow-nil-initform))
)
(unless (or (macroexp-const-p init)
(eieio--eval-default-p init))
;; FIXME: We duplicate this test here and in `defclass' because
;; if we move this part to `defclass' we may break some existing
;; code (because the `fboundp' test in `eieio--eval-default-p'
;; returns a different result at compile time).
(setq init (macroexp-quote init)))
;; Clean up the meaning of protection.
(setq prot
(pcase prot
@ -457,8 +465,9 @@ See `defclass' for more information."
(n (length slots))
(v (make-vector n nil)))
(dotimes (i n)
(setf (aref v i) (eieio-default-eval-maybe
(cl--slot-descriptor-initform (aref slots i)))))
(setf (aref v i) (eval
(cl--slot-descriptor-initform (aref slots i))
t)))
(setf (eieio--class-class-allocation-values newc) v))
;; Attach slot symbols into a hash table, and store the index of
@ -513,7 +522,7 @@ See `defclass' for more information."
cname
))
(defsubst eieio-eval-default-p (val)
(defun eieio--eval-default-p (val)
"Whether the default value VAL should be evaluated for use."
(and (consp val) (symbolp (car val)) (fboundp (car val))))
@ -522,10 +531,10 @@ See `defclass' for more information."
If SKIPNIL is non-nil, then if default value is nil return t instead."
(let ((value (cl--slot-descriptor-initform slot))
(spec (cl--slot-descriptor-type slot)))
(if (not (or (eieio-eval-default-p value) ;FIXME: Why?
(if (not (or (not (macroexp-const-p value))
eieio-skip-typecheck
(and skipnil (null value))
(eieio--perform-slot-validation spec value)))
(eieio--perform-slot-validation spec (eval value t))))
(signal 'invalid-slot-type (list (cl--slot-descriptor-name slot) spec value)))))
(defun eieio--slot-override (old new skipnil)
@ -546,7 +555,7 @@ If SKIPNIL is non-nil, then if default value is nil return t instead."
type tp a))
(setf (cl--slot-descriptor-type new) tp))
;; If we have a repeat, only update the initarg...
(unless (eq d eieio-unbound)
(unless (eq d eieio--unbound-form)
(eieio--perform-slot-validation-for-default new skipnil)
(setf (cl--slot-descriptor-initform old) d))
@ -604,6 +613,8 @@ if default value is nil."
(cold (car (cl-member a (eieio--class-class-slots newc)
:key #'cl--slot-descriptor-name))))
(cl-pushnew a eieio--known-slot-names)
(when (eq alloc :class)
(cl-pushnew a eieio--known-class-slot-names))
(condition-case nil
(if (sequencep d) (setq d (copy-sequence d)))
;; This copy can fail on a cons cell with a non-cons in the cdr. Let's
@ -679,7 +690,7 @@ the new child class."
(defun eieio--perform-slot-validation (spec value)
"Return non-nil if SPEC does not match VALUE."
(or (eq spec t) ; t always passes
(eq value eieio-unbound) ; unbound always passes
(eq value eieio--unbound) ; unbound always passes
(cl-typep value spec)))
(defun eieio--validate-slot-value (class slot-idx value slot)
@ -715,7 +726,7 @@ an error."
INSTANCE is the object being referenced. SLOTNAME is the offending
slot. If the slot is ok, return VALUE.
Argument FN is the function calling this verifier."
(if (and (eq value eieio-unbound) (not eieio-skip-typecheck))
(if (and (eq value eieio--unbound) (not eieio-skip-typecheck))
(slot-unbound instance (eieio--object-class instance) slotname fn)
value))
@ -755,15 +766,29 @@ Argument FN is the function calling this verifier."
(eieio-barf-if-slot-unbound (aref obj c) obj slot 'oref))))
(defun eieio-oref-default (obj slot)
(defun eieio-oref-default (class slot)
"Do the work for the macro `oref-default' with similar parameters.
Fills in OBJ's SLOT with its default value."
(declare (gv-setter eieio-oset-default))
(cl-check-type obj (or eieio-object class))
Fills in CLASS's SLOT with its default value."
(declare (gv-setter eieio-oset-default)
(compiler-macro
(lambda (exp)
(ignore class)
(pcase slot
((and (or `',name (and name (pred keywordp)))
(guard (not (memq name eieio--known-slot-names))))
(macroexp-warn-and-return
(format-message "Unknown slot `%S'" name) exp 'compile-only))
((and (or `',name (and name (pred keywordp)))
(guard (not (memq name eieio--known-class-slot-names))))
(macroexp-warn-and-return
(format-message "Slot `%S' is not class-allocated" name)
exp 'compile-only))
(_ exp)))))
(cl-check-type class (or eieio-object class))
(cl-check-type slot symbol)
(let* ((cl (cond ((symbolp obj) (cl--find-class obj))
((eieio-object-p obj) (eieio--object-class obj))
(t obj)))
(let* ((cl (cond ((symbolp class) (cl--find-class class))
((eieio-object-p class) (eieio--object-class class))
(t class)))
(c (eieio--slot-name-index cl slot)))
(if (not c)
;; It might be missing because it is a :class allocated slot.
@ -773,27 +798,13 @@ Fills in OBJ's SLOT with its default value."
;; Oref that slot.
(aref (eieio--class-class-allocation-values cl)
c)
(slot-missing obj slot 'oref-default))
(slot-missing class slot 'oref-default))
(eieio-barf-if-slot-unbound
(let ((val (cl--slot-descriptor-initform
(aref (eieio--class-slots cl)
(- c (eval-when-compile eieio--object-num-slots))))))
(eieio-default-eval-maybe val))
obj (eieio--class-name cl) 'oref-default))))
(defun eieio-default-eval-maybe (val)
"Check VAL, and return what `oref-default' would provide."
;; FIXME: What the hell is this supposed to do? Shouldn't it evaluate
;; variables as well? Why not just always call `eval'?
(cond
;; Is it a function call? If so, evaluate it.
((eieio-eval-default-p val)
(eval val t))
;;;; check for quoted things, and unquote them
;;((and (consp val) (eq (car val) 'quote))
;; (car (cdr val)))
;; return it verbatim
(t val)))
(eval val t))
class (eieio--class-name cl) 'oref-default))))
(defun eieio-oset (obj slot value)
"Do the work for the macro `oset'.
@ -820,6 +831,20 @@ Fills in OBJ's SLOT with VALUE."
(defun eieio-oset-default (class slot value)
"Do the work for the macro `oset-default'.
Fills in the default value in CLASS' in SLOT with VALUE."
(declare (compiler-macro
(lambda (exp)
(ignore class value)
(pcase slot
((and (or `',name (and name (pred keywordp)))
(guard (not (memq name eieio--known-slot-names))))
(macroexp-warn-and-return
(format-message "Unknown slot `%S'" name) exp 'compile-only))
((and (or `',name (and name (pred keywordp)))
(guard (not (memq name eieio--known-class-slot-names))))
(macroexp-warn-and-return
(format-message "Slot `%S' is not class-allocated" name)
exp 'compile-only))
(_ exp)))))
(setq class (eieio--class-object class))
(cl-check-type class eieio--class)
(cl-check-type slot symbol)
@ -836,22 +861,18 @@ Fills in the default value in CLASS' in SLOT with VALUE."
(signal 'invalid-slot-name (list (eieio--class-name class) slot)))
;; `oset-default' on an instance-allocated slot is allowed by EIEIO but
;; not by CLOS and is mildly inconsistent with the :initform thingy, so
;; it'd be nice to get of it. This said, it is/was used at one place by
;; gnus/registry.el, so it might be used elsewhere as well, so let's
;; keep it for now.
;; it'd be nice to get rid of it.
;; This said, it is/was used at one place by gnus/registry.el, so it
;; might be used elsewhere as well, so let's keep it for now.
;; FIXME: Generate a compile-time warning for it!
;; (error "Can't `oset-default' an instance-allocated slot: %S of %S"
;; slot class)
(eieio--validate-slot-value class c value slot)
;; Set this into the storage for defaults.
(if (eieio-eval-default-p value)
(error "Can't set default to a sexp that gets evaluated again"))
(setf (cl--slot-descriptor-initform
;; FIXME: Apparently we set it both in `slots' and in
;; `object-cache', which seems redundant.
(aref (eieio--class-slots class)
(- c (eval-when-compile eieio--object-num-slots))))
value)
(macroexp-quote value))
;; Take the value, and put it into our cache object.
(eieio-oset (eieio--class-default-object-cache class)
slot value)
@ -1093,8 +1114,20 @@ These match if the argument is the name of a subclass of CLASS."
(defmacro eieio-declare-slots (&rest slots)
"Declare that SLOTS are known eieio object slot names."
`(eval-when-compile
(setq eieio--known-slot-names (append ',slots eieio--known-slot-names))))
(let ((slotnames (mapcar (lambda (s) (if (consp s) (car s) s)) slots))
(classslots (delq nil
(mapcar (lambda (s)
(when (and (consp s)
(eq :class (plist-get (cdr s)
:allocation)))
(car s)))
slots))))
`(eval-when-compile
,@(when classslots
(mapcar (lambda (s) `(add-to-list 'eieio--known-class-slot-names ',s))
classslots))
,@(mapcar (lambda (s) `(add-to-list 'eieio--known-slot-names ',s))
slotnames))))
(provide 'eieio-core)

View File

@ -46,7 +46,7 @@
:documentation "A string for testing custom.
This is the next line of documentation.")
(listostuff :initarg :listostuff
:initform ("1" "2" "3")
:initform '("1" "2" "3")
:type list
:custom (repeat (string :tag "Stuff"))
:label "List of Strings"

View File

@ -248,7 +248,7 @@ and take the appropriate action."
Possible values are those symbols supported by the `exp-button-type' argument
to `speedbar-make-tag-line'."
:allocation :class)
(buttonface :initform speedbar-tag-face
(buttonface :initform 'speedbar-tag-face
:type (or symbol face)
:documentation
"The face used on the textual part of the button for this class.
@ -265,15 +265,15 @@ Add one of the child classes to this class to the parent list of a class."
:abstract t)
(defclass eieio-speedbar-directory-button (eieio-speedbar)
((buttontype :initform angle)
(buttonface :initform speedbar-directory-face))
((buttontype :initform 'angle)
(buttonface :initform 'speedbar-directory-face))
"Class providing support for objects which behave like a directory."
:method-invocation-order :depth-first
:abstract t)
(defclass eieio-speedbar-file-button (eieio-speedbar)
((buttontype :initform bracket)
(buttonface :initform speedbar-file-face))
((buttontype :initform 'bracket)
(buttonface :initform 'speedbar-file-face))
"Class providing support for objects which behave like a file."
:method-invocation-order :depth-first
:abstract t)

View File

@ -131,6 +131,7 @@ and reference them using the function `class-option'."
(let ((testsym1 (intern (concat (symbol-name name) "-p")))
(testsym2 (intern (format "%s--eieio-childp" name)))
(warnings '())
(accessors ()))
;; Collect the accessors we need to define.
@ -145,6 +146,8 @@ and reference them using the function `class-option'."
;; Update eieio--known-slot-names already in case we compile code which
;; uses this before the class is loaded.
(cl-pushnew sname eieio--known-slot-names)
(when (eq alloc :class)
(cl-pushnew sname eieio--known-class-slot-names))
(if eieio-error-unsupported-class-tags
(let ((tmp soptions))
@ -176,8 +179,22 @@ and reference them using the function `class-option'."
(signal 'invalid-slot-type (list :label label)))
;; Is there an initarg, but allocation of class?
(if (and initarg (eq alloc :class))
(message "Class allocated slots do not need :initarg"))
(when (and initarg (eq alloc :class))
(push (format "Meaningless :initarg for class allocated slot '%S'"
sname)
warnings))
(let ((init (plist-get soptions :initform)))
(unless (or (macroexp-const-p init)
(eieio--eval-default-p init))
;; FIXME: Historically, EIEIO used a heuristic to try and guess
;; whether the initform is a form to be evaluated or just
;; a constant. We use `eieio--eval-default-p' to see what the
;; heuristic says and if it disagrees with normal evaluation
;; then tweak the initform to make it fit and emit
;; a warning accordingly.
(push (format "Ambiguous initform needs quoting: %S" init)
warnings)))
;; Anyone can have an accessor function. This creates a function
;; of the specified name, and also performs a `defsetf' if applicable
@ -223,6 +240,8 @@ This method is obsolete."
))
`(progn
,@(mapcar (lambda (w) (macroexp-warn-and-return w `(progn ',w) 'compile-only))
warnings)
;; This test must be created right away so we can have self-
;; referencing classes. ei, a class whose slot can contain only
;; pointers to itself.
@ -282,9 +301,7 @@ This method is obsolete."
;;; Get/Set slots in an object.
;;
(defmacro oref (obj slot)
"Retrieve the value stored in OBJ in the slot named by SLOT.
Slot is the name of the slot when created by `defclass' or the label
created by the :initarg tag."
"Retrieve the value stored in OBJ in the slot named by SLOT."
(declare (debug (form symbolp)))
`(eieio-oref ,obj (quote ,slot)))
@ -292,13 +309,11 @@ created by the :initarg tag."
(defalias 'set-slot-value #'eieio-oset)
(make-obsolete 'set-slot-value "use (setf (slot-value ..) ..) instead" "25.1")
(defmacro oref-default (obj slot)
"Get the default value of OBJ (maybe a class) for SLOT.
The default value is the value installed in a class with the :initform
tag. SLOT can be the slot name, or the tag specified by the :initarg
tag in the `defclass' call."
(defmacro oref-default (class slot)
"Get the value of class allocated slot SLOT.
CLASS can also be an object, in which case we use the object's class."
(declare (debug (form symbolp)))
`(eieio-oref-default ,obj (quote ,slot)))
`(eieio-oref-default ,class (quote ,slot)))
;;; Handy CLOS macros
;;
@ -538,11 +553,11 @@ OBJECT can be an instance or a class."
((eieio-object-p object) (eieio-oref object slot))
((symbolp object) (eieio-oref-default object slot))
(t (signal 'wrong-type-argument (list 'eieio-object-p object))))
eieio-unbound))))
eieio--unbound))))
(defun slot-makeunbound (object slot)
"In OBJECT, make SLOT unbound."
(eieio-oset object slot eieio-unbound))
(eieio-oset object slot eieio--unbound))
(defun slot-exists-p (object-or-class slot)
"Return non-nil if OBJECT-OR-CLASS has SLOT."
@ -740,18 +755,14 @@ dynamically set from SLOTS."
(slots (eieio--class-slots this-class)))
(dotimes (i (length slots))
;; For each slot, see if we need to evaluate it.
;;
;; Paul Landes said in an email:
;; > CL evaluates it if it can, and otherwise, leaves it as
;; > the quoted thing as you already have. This is by the
;; > Sonya E. Keene book and other things I've look at on the
;; > web.
(let* ((slot (aref slots i))
(initform (cl--slot-descriptor-initform slot))
(dflt (eieio-default-eval-maybe initform)))
(when (not (eq dflt initform))
(initform (cl--slot-descriptor-initform slot)))
;; Those slots whose initform is constant already have the right
;; value set in the default-object.
(unless (macroexp-const-p initform)
;; FIXME: We should be able to just do (aset this (+ i <cst>) dflt)!
(eieio-oset this (cl--slot-descriptor-name slot) dflt)))))
(eieio-oset this (cl--slot-descriptor-name slot)
(eval initform t))))))
;; Shared initialize will parse our slots for us.
(shared-initialize this slots))

View File

@ -483,6 +483,10 @@ original definition, use \\[elp-restore-function] or \\[elp-restore-all]."
'face 'link
'help-echo "mouse-2 or RET jumps to definition")))
(define-derived-mode elp-results-mode special-mode "ELP"
"Mode for ELP results."
:interactive nil)
;;;###autoload
(defun elp-results ()
"Display current profiling results.
@ -490,11 +494,12 @@ If `elp-reset-after-results' is non-nil, then current profiling
information for all instrumented functions is reset after results are
displayed."
(interactive)
(let ((curbuf (current-buffer))
(resultsbuf (if elp-recycle-buffers-p
(get-buffer-create elp-results-buffer)
(generate-new-buffer elp-results-buffer))))
(set-buffer resultsbuf)
(pop-to-buffer
(if elp-recycle-buffers-p
(get-buffer-create elp-results-buffer)
(generate-new-buffer elp-results-buffer)))
(elp-results-mode)
(let ((inhibit-read-only t))
(erase-buffer)
;; get the length of the longest function name being profiled
(let* ((longest 0)
@ -565,9 +570,6 @@ displayed."
(if elp-sort-by-function
(setq resvec (sort resvec elp-sort-by-function)))
(mapc 'elp-output-result resvec))
;; now pop up results buffer
(set-buffer curbuf)
(pop-to-buffer resultsbuf)
;; copy results to standard-output?
(if (or elp-use-standard-output noninteractive)
(princ (buffer-substring (point-min) (point-max)))

View File

@ -60,8 +60,10 @@ FUNCTIONS is a list of elements on the form:
:args ARGS
:eval EXAMPLE-FORM
:no-eval EXAMPLE-FORM
:no-eval* EXAMPLE-FORM
:no-value EXAMPLE-FORM
:result RESULT-FORM
:result-string RESULT-FORM
:eg-result RESULT-FORM
:eg-result-string RESULT-FORM)
@ -887,6 +889,52 @@ There can be any number of :example/:result elements."
(unlock-buffer
:no-value (lock-buffer)))
(define-short-documentation-group overlay
"Predicates"
(overlayp
:no-eval (overlayp some-overlay)
:eg-result t)
"Creation and Deletion"
(make-overlay
:args (beg end &optional buffer)
:no-eval (make-overlay 1 10)
:eg-result-string "#<overlay from 1 to 10 in *foo*>")
(delete-overlay
:no-eval (delete-overlay foo)
:eg-result t)
"Searching Overlays"
(overlays-at
:no-eval (overlays-at 15)
:eg-result-string "(#<overlay from 1 to 10 in *foo*>)")
(overlays-in
:no-eval (overlays-in 1 30)
:eg-result-string "(#<overlay from 1 to 10 in *foo*>)")
(next-overlay-change
:no-eval (next-overlay-change 1)
:eg-result 20)
(previous-overlay-change
:no-eval (previous-overlay-change 30)
:eg-result 20)
"Overlay Properties"
(overlay-start
:no-eval (overlay-start foo)
:eg-result 1)
(overlay-end
:no-eval (overlay-end foo)
:eg-result 10)
(overlay-put
:no-eval (overlay-put foo 'happy t)
:eg-result t)
(overlay-get
:no-eval (overlay-get foo 'happy)
:eg-result t)
(overlay-buffer
:no-eval (overlay-buffer foo))
"Moving Overlays"
(move-overlay
:no-eval (move-overlay foo 5 20)
:eg-result-string "#<overlay from 5 to 20 in *foo*>"))
(define-short-documentation-group process
(make-process
:no-eval (make-process :name "foo" :command '("cat" "/tmp/foo"))

View File

@ -125,6 +125,10 @@ otherwise nil. That construct can be a two character comment
delimiter or an Escaped or Char-quoted character."))
(defun syntax-propertize-wholelines (start end)
"Extend the region delimited by START and END to whole lines.
This function is useful for
`syntax-propertize-extend-region-functions';
see Info node `(elisp) Syntax Properties'."
(goto-char start)
(cons (line-beginning-position)
(progn (goto-char end)

View File

@ -43,7 +43,8 @@
This is used by `epa-ks-lookup-key', for looking up public keys."
:type '(choice :tag "Keyserver"
(const random)
(repeat :tag "Random pool"
(string :tag "Keyserver address"))
(const "keyring.debian.org")
(const "keys.gnupg.net")
(const "keyserver.ubuntu.com")
@ -141,20 +142,33 @@ Keys are marked using `epa-ks-mark-key-to-fetch'."
(epa-ks--fetch-key id))))
(tabulated-list-clear-all-tags))
(defun epa-ks--query-url (query exact)
"Return URL for QUERY.
If EXACT is non-nil, don't accept approximate matches."
(format "https://%s/pks/lookup?%s"
(cond ((null epa-keyserver)
(user-error "Empty keyserver pool"))
((listp epa-keyserver)
(nth (random (length epa-keyserver))
epa-keyserver))
((stringp epa-keyserver)
epa-keyserver)
((error "Invalid type for `epa-keyserver'")))
(url-build-query-string
(append `(("search" ,query)
("options" "mr")
("op" "index"))
(and exact '(("exact" "on")))))))
(defun epa-ks--fetch-key (id)
"Send request to import key with specified ID."
(url-retrieve
(format "https://%s/pks/lookup?%s"
epa-keyserver
(url-build-query-string
`(("search" ,(concat "0x" (url-hexify-string id)))
("options" "mr")
("op" "get"))))
(epa-ks--query-url (concat "0x" (url-hexify-string id)) t)
(lambda (status)
(when (plist-get status :error)
(error "Request failed: %s"
(caddr (assq (caddr (plist-get status :error))
url-http-codes))))
(caddr (assq (caddr (plist-get status :error))
url-http-codes))))
(forward-paragraph)
(save-excursion
(goto-char (point-max))
@ -224,13 +238,7 @@ enough, since keyservers have strict timeout settings."
(erase-buffer))
(epa-ks-search-mode))
(url-retrieve
(format "https://%s/pks/lookup?%s"
epa-keyserver
(url-build-query-string
(append `(("search" ,query)
("options" "mr")
("op" "index"))
(and exact '(("exact" "on"))))))
(epa-ks--query-url query exact)
(lambda (status)
(when (plist-get status :error)
(when buf

View File

@ -2225,7 +2225,7 @@ Non-interactively, it takes the keyword arguments
That is, if called with
(erc :server \"chat.freenode.net\" :full-name \"Harry S Truman\")
(erc :server \"chat.freenode.net\" :full-name \"J. Random Hacker\")
then the server and full-name will be set to those values,
whereas `erc-compute-port' and `erc-compute-nick' will be invoked
@ -2260,7 +2260,7 @@ Non-interactively, it takes the keyword arguments
That is, if called with
(erc-tls :server \"chat.freenode.net\" :full-name \"Harry S Truman\")
(erc-tls :server \"chat.freenode.net\" :full-name \"J. Random Hacker\")
then the server and full-name will be set to those values,
whereas `erc-compute-port' and `erc-compute-nick' will be invoked

View File

@ -379,7 +379,7 @@ input."
(if (eq eshell-hist-ignoredups 'erase)
;; Remove any old occurrences of the input, and put
;; the new one at the end.
(progn
(unless (ring-empty-p eshell-history-ring)
(ring-remove eshell-history-ring
(ring-member eshell-history-ring input))
t)

View File

@ -171,7 +171,8 @@ operating on the next file and nil otherwise."
(goto-char pos))
(push-mark original-point t))
(switch-to-buffer (current-buffer))
(let (switch-to-buffer-preserve-window-point)
(switch-to-buffer (current-buffer)))
;; Now operate on the file.
;; If value is non-nil, continue to scan the next file.

View File

@ -6248,8 +6248,11 @@ Non-file buffers need a custom function."
(dolist (regexp revert-without-query)
(when (string-match regexp file-name)
(throw 'found t)))))
(yes-or-no-p (format "Revert buffer from file %s? "
file-name)))
(yes-or-no-p
(format (if (buffer-modified-p)
"Discard edits and reread from %s? "
"Revert buffer from file %s? ")
file-name)))
(run-hooks 'before-revert-hook)
;; If file was backed up but has changed since,
;; we should make another backup.

View File

@ -181,7 +181,7 @@ it should be a Lisp function. BUFFER is currently ignored."
;; We should perhaps go via a temporary buffer and copy it
;; back, in case of errors.
(if (and (zerop (save-window-excursion
(shell-command-on-region from to method t t
(shell-command-on-region from to method t 'no-mark
error-buff)))
;; gzip gives zero exit status with bad args, for instance.
(zerop (with-current-buffer error-buff

View File

@ -181,7 +181,11 @@ When setting this variable in a Lisp program, call
`set-fringe-mode' afterward to make it take real effect.
To modify the appearance of the fringe in a specific frame, use
the interactive function `set-fringe-style'."
the interactive function `set-fringe-style'.
Note that, despite the name, this is not a variable that controls
a (major or minor) Emacs mode, but controls the appearance of the
fringes."
:type `(choice
,@ (mapcar (lambda (style)
(let ((name
@ -248,7 +252,10 @@ Fringe widths set by `set-window-fringes' override the default
fringe widths set by this command. This command applies to all
frames that exist and frames to be created in the future. If you
want to set the default appearance of fringes on the selected
frame only, see the command `set-fringe-style'."
frame only, see the command `set-fringe-style'.
Note that, despite the name, this is not a (major or minor) Emacs
mode, but a command that controls the appearance of the fringes."
(interactive (list (fringe-query-style 'all-frames)))
(set-fringe-mode mode))

View File

@ -170,12 +170,17 @@ If `gnus-visible-headers' is non-nil, this variable will be ignored."
"All headers that do not match this regexp will be hidden.
This variable can also be a list of regexp of headers to remain visible.
If this variable is non-nil, `gnus-ignored-headers' will be ignored."
:type '(choice
(repeat :value-to-internal (lambda (widget value)
(custom-split-regexp-maybe value))
:match (lambda (widget value)
(or (stringp value)
(widget-editable-list-match widget value)))
:type `(choice
(repeat :value-to-internal
,(lambda (_widget value)
;; FIXME: Are we sure this can't be used without
;; loading cus-edit?
(declare-function custom-split-regexp-maybe
"cus-edit" (regexp))
(custom-split-regexp-maybe value))
:match ,(lambda (widget value)
(or (stringp value)
(widget-editable-list-match widget value)))
regexp)
(const :tag "Use gnus-ignored-headers" nil)
regexp)
@ -402,14 +407,14 @@ the entire emphasized word. The third is a number that says what
regexp grouping should be displayed and highlighted. The fourth
is the face used for highlighting."
:type
'(repeat
`(repeat
(menu-choice
:format "%[Customizing Style%]\n%v"
:indent 2
(group :tag "Default"
:value ("" 0 0 default)
:value-create
(lambda (widget)
,(lambda (widget)
(let ((value (widget-get
(cadr (widget-get (widget-get widget :parent)
:args))
@ -3738,7 +3743,7 @@ is to run."
(setq n 1))
(gnus-stop-date-timer)
(setq article-lapsed-timer
(run-at-time 1 n 'article-update-date-lapsed)))
(run-at-time 1 n #'article-update-date-lapsed)))
(defun gnus-stop-date-timer ()
"Stop the Date timer."
@ -4405,7 +4410,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
"\M-g" gnus-article-read-summary-keys)
(substitute-key-definition
'undefined 'gnus-article-read-summary-keys gnus-article-mode-map)
#'undefined #'gnus-article-read-summary-keys gnus-article-mode-map)
(defvar gnus-article-send-map)
(gnus-define-keys (gnus-article-send-map "S" gnus-article-mode-map)
@ -4483,12 +4488,12 @@ commands:
(make-local-variable 'gnus-article-image-alist)
(make-local-variable 'gnus-article-charset)
(make-local-variable 'gnus-article-ignored-charsets)
(setq-local bookmark-make-record-function 'gnus-summary-bookmark-make-record)
(setq-local bookmark-make-record-function #'gnus-summary-bookmark-make-record)
;; Prevent Emacs from displaying non-break space with
;; `nobreak-space' face.
(setq-local nobreak-char-display nil)
;; Enable `gnus-article-remove-images' to delete images shr.el renders.
(setq-local shr-put-image-function 'gnus-shr-put-image)
(setq-local shr-put-image-function #'gnus-shr-put-image)
(unless gnus-article-show-cursor
(setq cursor-in-non-selected-windows nil))
(gnus-set-default-directory)
@ -4723,16 +4728,17 @@ If ALL-HEADERS is non-nil, no headers are hidden."
(define-derived-mode gnus-sticky-article-mode gnus-article-mode "StickyArticle"
"Mode for sticky articles."
;; Release bindings that won't work.
(substitute-key-definition 'gnus-article-read-summary-keys 'undefined
(substitute-key-definition #'gnus-article-read-summary-keys #'undefined
gnus-sticky-article-mode-map)
(substitute-key-definition 'gnus-article-refer-article 'undefined
(substitute-key-definition #'gnus-article-refer-article #'undefined
gnus-sticky-article-mode-map)
(dolist (k '("e" "h" "s" "F" "R"))
(define-key gnus-sticky-article-mode-map k nil))
(define-key gnus-sticky-article-mode-map "k" 'gnus-kill-sticky-article-buffer)
(define-key gnus-sticky-article-mode-map "q" 'bury-buffer)
(define-key gnus-sticky-article-mode-map "\C-hc" 'describe-key-briefly)
(define-key gnus-sticky-article-mode-map "\C-hk" 'describe-key))
(define-key gnus-sticky-article-mode-map "k"
#'gnus-kill-sticky-article-buffer)
(define-key gnus-sticky-article-mode-map "q" #'bury-buffer)
(define-key gnus-sticky-article-mode-map "\C-hc" #'describe-key-briefly)
(define-key gnus-sticky-article-mode-map "\C-hk" #'describe-key))
(defun gnus-sticky-article (arg)
"Make the current article sticky.
@ -4863,9 +4869,9 @@ General format specifiers can also be used. See Info node
(defvar gnus-mime-button-map
(let ((map (make-sparse-keymap)))
(define-key map "\r" 'gnus-article-push-button)
(define-key map [mouse-2] 'gnus-article-push-button)
(define-key map [down-mouse-3] 'gnus-mime-button-menu)
(define-key map "\r" #'gnus-article-push-button)
(define-key map [mouse-2] #'gnus-article-push-button)
(define-key map [down-mouse-3] #'gnus-mime-button-menu)
(dolist (c gnus-mime-button-commands)
(define-key map (cadr c) (car c)))
map))
@ -6138,7 +6144,7 @@ If nil, don't show those extra buttons."
(let* ((preferred (or preferred (mm-preferred-alternative handles)))
(ihandles handles)
(point (point))
handle (inhibit-read-only t) begend not-pref) ;; from
(inhibit-read-only t) begend not-pref) ;; from
(save-window-excursion
(save-restriction
(when ibegend
@ -6152,8 +6158,8 @@ If nil, don't show those extra buttons."
(mm-remove-parts handles))
(setq begend (list (point-marker)))
;; Do the toggle.
(unless (setq not-pref (cadr (member preferred ihandles)))
(setq not-pref (car ihandles)))
(setq not-pref (or (cadr (member preferred ihandles))
(car ihandles)))
(when (or ibegend
(not preferred)
(not (gnus-unbuttonized-mime-type-p
@ -6164,22 +6170,22 @@ If nil, don't show those extra buttons."
(progn
(insert (format "%d. " id))
(point))
`(gnus-callback
(lambda (handles)
(unless ,(not ibegend)
(setq gnus-article-mime-handle-alist
',gnus-article-mime-handle-alist))
(gnus-mime-display-alternative
',ihandles ',not-pref ',begend ,id))
keymap ,gnus-mime-button-map
mouse-face ,gnus-article-mouse-face
face ,gnus-article-button-face
follow-link t
gnus-part ,id
article-type multipart
rear-nonsticky t))
(let ((gamha gnus-article-mime-handle-alist))
`(gnus-callback
,(lambda (_handles)
(unless (not ibegend)
(setq gnus-article-mime-handle-alist gamha))
(gnus-mime-display-alternative
ihandles not-pref begend id))
keymap ,gnus-mime-button-map
mouse-face ,gnus-article-mouse-face
face ,gnus-article-button-face
follow-link t
gnus-part ,id
article-type multipart
rear-nonsticky t)))
;; Do the handles
(while (setq handle (pop handles))
(dolist (handle handles)
(add-text-properties
;; (setq from
(point) ;; )
@ -6188,22 +6194,22 @@ If nil, don't show those extra buttons."
(if (equal handle preferred) ?* ? )
(mm-handle-media-type handle)))
(point))
`(gnus-callback
(lambda (handles)
(unless ,(not ibegend)
(setq gnus-article-mime-handle-alist
',gnus-article-mime-handle-alist))
(gnus-mime-display-alternative
',ihandles ',handle ',begend ,id))
keymap ,gnus-mime-button-map
mouse-face ,gnus-article-mouse-face
face ,gnus-article-button-face
follow-link t
gnus-part ,id
button t
category t
gnus-data ,handle
rear-nonsticky t))
(let ((gamha gnus-article-mime-handle-alist))
`(gnus-callback
,(lambda (_handles)
(unless (not ibegend)
(setq gnus-article-mime-handle-alist gamha))
(gnus-mime-display-alternative
ihandles handle begend id))
keymap ,gnus-mime-button-map
mouse-face ,gnus-article-mouse-face
face ,gnus-article-button-face
follow-link t
gnus-part ,id
button t
category t
gnus-data ,handle
rear-nonsticky t)))
(insert " "))
(insert "\n\n"))
(when preferred
@ -6308,7 +6314,8 @@ is the string to use when it is inactive.")
(setq gnus-article-image-alist (delq entry gnus-article-image-alist))
(gnus-delete-wash-type category)))
(defalias 'gnus-article-hide-headers-if-wanted 'gnus-article-maybe-hide-headers)
(defalias 'gnus-article-hide-headers-if-wanted
#'gnus-article-maybe-hide-headers)
(defun gnus-article-maybe-hide-headers ()
"Hide unwanted headers if `gnus-have-all-headers' is nil.
@ -6874,7 +6881,7 @@ then we display only bindings that start with that prefix."
parent agent draft)
(define-key keymap "S" map)
(define-key map [t] nil)
(define-key summap [t] 'undefined)
(define-key summap [t] #'undefined)
(with-current-buffer gnus-article-current-summary
(dolist (key sumkeys)
(define-key summap key (key-binding key (current-local-map))))
@ -6910,10 +6917,11 @@ then we display only bindings that start with that prefix."
(setq-local gnus-agent-summary-mode agent)
(setq-local gnus-draft-mode draft)
(describe-bindings prefix))
(let ((item `((lambda (prefix)
(with-current-buffer ,(current-buffer)
(gnus-article-describe-bindings prefix)))
,prefix)))
(let* ((cb (current-buffer))
(item `(,(lambda (prefix)
(with-current-buffer cb
(gnus-article-describe-bindings prefix)))
,prefix)))
;; Loading `help-mode' here is necessary if `describe-bindings'
;; is replaced with something, e.g. `helm-descbinds'.
(require 'help-mode)
@ -8394,14 +8402,14 @@ url is put as the `gnus-button-url' overlay property on the button."
(defvar gnus-prev-page-map
(let ((map (make-sparse-keymap)))
(define-key map [mouse-2] 'gnus-button-prev-page)
(define-key map "\r" 'gnus-button-prev-page)
(define-key map [mouse-2] #'gnus-button-prev-page)
(define-key map "\r" #'gnus-button-prev-page)
map))
(defvar gnus-next-page-map
(let ((map (make-sparse-keymap)))
(define-key map [mouse-2] 'gnus-button-next-page)
(define-key map "\r" 'gnus-button-next-page)
(define-key map [mouse-2] #'gnus-button-next-page)
(define-key map "\r" #'gnus-button-next-page)
map))
(defun gnus-insert-prev-page-button ()
@ -8705,9 +8713,9 @@ For example:
(defvar gnus-mime-security-button-map
(let ((map (make-sparse-keymap)))
(define-key map "\r" 'gnus-article-push-button)
(define-key map [mouse-2] 'gnus-article-push-button)
(define-key map [down-mouse-3] 'gnus-mime-security-button-menu)
(define-key map "\r" #'gnus-article-push-button)
(define-key map [mouse-2] #'gnus-article-push-button)
(define-key map [down-mouse-3] #'gnus-mime-security-button-menu)
(dolist (c gnus-mime-security-button-commands)
(define-key map (cadr c) (car c)))
map))

View File

@ -894,14 +894,14 @@ simple manner."
["Sort by real name" gnus-group-sort-selected-groups-by-real-name
(not (gnus-topic-mode-p))])
("Mark"
["Mark group" gnus-group-mark-group
["Toggle/Set mark" gnus-group-mark-group
(and (gnus-group-group-name)
(not (memq (gnus-group-group-name) gnus-group-marked)))]
["Unmark group" gnus-group-unmark-group
["Remove mark" gnus-group-unmark-group
(and (gnus-group-group-name)
(memq (gnus-group-group-name) gnus-group-marked))]
["Unmark all" gnus-group-unmark-all-groups gnus-group-marked]
["Mark regexp..." gnus-group-mark-regexp t]
["Remove all marks" gnus-group-unmark-all-groups gnus-group-marked]
["Mark by regexp..." gnus-group-mark-regexp t]
["Mark region" gnus-group-mark-region :active mark-active]
["Mark buffer" gnus-group-mark-buffer t]
["Execute command" gnus-group-universal-argument
@ -1865,7 +1865,7 @@ If FIRST-TOO, the current line is also eligible as a target."
(forward-char (or (cdr (assq 'process gnus-group-mark-positions)) 2))
(eq (char-after) gnus-process-mark)))
(defun gnus-group-mark-group (n &optional unmark no-advance)
(defun gnus-group-mark-group (n &optional unmark no-advance no-toggle)
"Mark the current group."
(interactive "p" gnus-group-mode)
(let ((buffer-read-only nil)
@ -1877,23 +1877,33 @@ If FIRST-TOO, the current line is also eligible as a target."
(beginning-of-line)
(forward-char (or (cdr (assq 'process gnus-group-mark-positions)) 2))
(delete-char 1)
(if unmark
(progn
(setq gnus-group-marked (delete group gnus-group-marked))
(insert-char ?\s 1 t))
(setq gnus-group-marked
(cons group (delete group gnus-group-marked)))
(insert-char gnus-process-mark 1 t)))
(if (and gnus-process-mark-toggle (not no-toggle))
(if (memq group gnus-group-marked)
(gnus-group-mark-update group t)
(gnus-group-mark-update group))
(gnus-group-mark-update group unmark)))
(unless no-advance
(gnus-group-next-group 1))
(cl-decf n))
(gnus-group-position-point)
n))
(defun gnus-group-mark-update (n &optional unmark)
"Set the process mark on current group and update the group line."
(if unmark
(progn
(setq gnus-group-marked
(delete n gnus-group-marked))
(insert-char ?\s 1 t))
(progn
(setq gnus-group-marked
(cons n (delete n gnus-group-marked)))
(insert-char gnus-process-mark 1 t))))
(defun gnus-group-unmark-group (n)
"Remove the mark from the current group."
(interactive "p" gnus-group-mode)
(gnus-group-mark-group n 'unmark)
(gnus-group-mark-group n 'unmark nil t)
(gnus-group-position-point))
(defun gnus-group-unmark-all-groups ()
@ -1910,7 +1920,7 @@ If UNMARK, remove the mark instead."
(let ((num (count-lines beg end)))
(save-excursion
(goto-char beg)
(- num (gnus-group-mark-group num unmark)))))
(- num (gnus-group-mark-group num unmark nil t)))))
(defun gnus-group-mark-buffer (&optional unmark)
"Mark all groups in the buffer.
@ -1935,7 +1945,7 @@ If UNMARK, remove the mark instead."
Return nil if the group isn't displayed."
(if (gnus-group-goto-group group nil test-marked)
(save-excursion
(gnus-group-mark-group 1 'unmark t)
(gnus-group-mark-group 1 'unmark t t)
t)
(setq gnus-group-marked
(delete group gnus-group-marked))
@ -1945,7 +1955,7 @@ Return nil if the group isn't displayed."
"Set the process mark on GROUP."
(if (gnus-group-goto-group group)
(save-excursion
(gnus-group-mark-group 1 nil t))
(gnus-group-mark-group 1 nil t t))
(setq gnus-group-marked (cons group (delete group gnus-group-marked)))))
(defun gnus-group-universal-argument (arg &optional _groups func)

View File

@ -2774,7 +2774,7 @@ gnus-summary-show-article-from-menu-as-charset-%s" cs))))
["Hide marked" gnus-summary-limit-exclude-marks t]
["Show expunged" gnus-summary-limit-include-expunged t])
("Process Mark"
["Set mark" gnus-summary-mark-as-processable t]
["Toggle/Set mark" gnus-summary-mark-as-processable t]
["Remove mark" gnus-summary-unmark-as-processable t]
["Remove all marks" gnus-summary-unmark-all-processable t]
["Invert marks" gnus-uu-invert-processable t]
@ -8247,7 +8247,7 @@ If NOT-MATCHING, excluding articles that have subjects that match a regexp."
(let ((articles (gnus-summary-find-matching
(or header "subject") subject 'all nil nil
not-matching)))
(unless articles
(unless (or articles not-matching)
(error "Found no matches for \"%s\"" subject))
(gnus-summary-limit articles))
(gnus-summary-position-point))))
@ -8318,7 +8318,7 @@ To and Cc headers are checked. You need to include them in
(and (memq a to) a))
cc)
(nconc to cc))))
(unless articles
(unless (or articles not-matching)
(error "Found no matches for \"%s\"" recipient))
(gnus-summary-limit articles))
(gnus-summary-position-point))))
@ -8374,7 +8374,7 @@ in `nnmail-extra-headers'."
(nconc (if (eq to t) nil to)
(if (eq cc t) nil cc)
from))))
(unless articles
(unless (or articles not-matching)
(error "Found no matches for \"%s\"" address))
(gnus-summary-limit articles))
(gnus-summary-position-point))))
@ -8465,7 +8465,7 @@ articles that are younger than AGE days."
(let ((articles (gnus-summary-find-matching
(cons 'extra header) regexp 'all nil nil
not-matching)))
(unless articles
(unless (or articles not-matching)
(error "Found no matches for \"%s\"" regexp))
(gnus-summary-limit articles))
(gnus-summary-position-point))))
@ -10951,10 +10951,14 @@ number of articles marked is returned."
(n (abs n)))
(while (and
(> n 0)
(if unmark
(gnus-summary-remove-process-mark
(gnus-summary-article-number))
(gnus-summary-set-process-mark (gnus-summary-article-number)))
(let ((article (gnus-summary-article-number)))
(if unmark
(gnus-summary-remove-process-mark article)
(if gnus-process-mark-toggle
(if (memq article gnus-newsgroup-processable)
(gnus-summary-remove-process-mark article)
(gnus-summary-set-process-mark article))
(gnus-summary-set-process-mark article))))
(zerop (gnus-summary-next-subject (if backward -1 1) nil t)))
(setq n (1- n)))
(when (/= 0 n)

View File

@ -1112,7 +1112,7 @@ articles in the topic and its subtopics."
["Delete" gnus-topic-delete t]
["Rename..." gnus-topic-rename t]
["Create..." gnus-topic-create-topic t]
["Mark" gnus-topic-mark-topic t]
["Toggle/Set mark" gnus-topic-mark-topic t]
["Indent" gnus-topic-indent t]
["Sort" gnus-topic-sort-topics t]
["Previous topic" gnus-topic-goto-previous-topic t]
@ -1436,7 +1436,7 @@ If PERMANENT, make it stay shown in subsequent sessions as well."
(setcar (cdr (cadr topic)) 'visible)
(gnus-group-list-groups)))))
(defun gnus-topic-mark-topic (topic &optional unmark non-recursive)
(defun gnus-topic-mark-topic (topic &optional unmark non-recursive no-toggle)
"Mark all groups in the TOPIC with the process mark.
If NON-RECURSIVE (which is the prefix) is t, don't mark its subtopics."
(interactive
@ -1450,8 +1450,13 @@ If NON-RECURSIVE (which is the prefix) is t, don't mark its subtopics."
(let ((groups (gnus-topic-find-groups topic gnus-level-killed t nil
(not non-recursive))))
(while groups
(funcall (if unmark 'gnus-group-remove-mark 'gnus-group-set-mark)
(gnus-info-group (nth 1 (pop groups)))))))))
(let ((group (gnus-info-group (nth 1 (pop groups)))))
(if (and gnus-process-mark-toggle (not no-toggle))
(if (memq group gnus-group-marked)
(gnus-group-remove-mark group )
(gnus-group-set-mark group))
(if unmark (gnus-group-remove-mark group)
(gnus-group-set-mark group)))))))))
(defun gnus-topic-unmark-topic (topic &optional _dummy non-recursive)
"Remove the process mark from all groups in the TOPIC.
@ -1462,7 +1467,7 @@ If NON-RECURSIVE (which is the prefix) is t, don't unmark its subtopics."
gnus-topic-mode)
(if (not topic)
(call-interactively 'gnus-group-unmark-group)
(gnus-topic-mark-topic topic t non-recursive)))
(gnus-topic-mark-topic topic t non-recursive t)))
(defun gnus-topic-get-new-news-this-topic (&optional n)
"Check for new news in the current topic."

View File

@ -1183,6 +1183,14 @@ newsgroups."
:group 'gnus-summary-marks
:type 'character)
(defcustom gnus-process-mark-toggle t
"If nil the process mark command only sets the process mark."
:version "28.1"
:group 'gnus-summary
:group 'gnus-group-various
:group 'gnus-group-topic
:type 'boolean)
(defcustom gnus-large-newsgroup 200
"The number of articles which indicates a large newsgroup.
If the number of articles in a newsgroup is greater than this value,

View File

@ -428,8 +428,9 @@ during splitting, which may be slow."
(time-subtract
now
(nnimap-last-command-time nnimap-object))))
(ignore-errors ;E.g. "buffer foo has no process".
(nnimap-send-command "NOOP"))))))))
(with-local-quit
(ignore-errors ;E.g. "buffer foo has no process".
(nnimap-send-command "NOOP")))))))))
(defun nnimap-open-connection (buffer)
;; Be backwards-compatible -- the earlier value of nnimap-stream was

View File

@ -126,29 +126,35 @@ with the current prefix. The files are chosen according to
:group 'help
:version "26.3")
(defun help--symbol-class (s)
"Return symbol class characters for symbol S."
(when (stringp s)
(setq s (intern-soft s)))
(cond ((commandp s)
"c") ; command
((eq (car-safe (symbol-function s)) 'macro)
"m") ; macro
((fboundp s)
"f") ; function
((custom-variable-p s)
"u") ; user option
((boundp s)
"v") ; variable
((facep s)
"a") ; fAce
((and (fboundp 'cl-find-class)
(cl-find-class s))
"t") ; CL type
(" ") ; something else
))
(defun help--symbol-completion-table-affixation (completions)
(mapcar (lambda (c)
(let* ((s (intern c))
(doc (condition-case nil (documentation s) (error nil)))
(doc (and doc (substring doc 0 (string-match "\n" doc)))))
(list c (propertize
(concat (cond ((commandp s)
"c") ; command
((eq (car-safe (symbol-function s)) 'macro)
"m") ; macro
((fboundp s)
"f") ; function
((custom-variable-p s)
"u") ; user option
((boundp s)
"v") ; variable
((facep s)
"a") ; fAce
((and (fboundp 'cl-find-class)
(cl-find-class s))
"t") ; CL type
(" ")) ; something else
" ") ; prefix separator
(concat (help--symbol-class s) " ") ; prefix separator
'face 'completions-annotations)
(if doc (propertize (format " -- %s" doc)
'face 'completions-annotations)
@ -268,7 +274,9 @@ If we can't find the file name, nil is returned."
(let ((docbuf (get-buffer-create " *DOC*"))
(name (if (eq 'var kind)
(concat "V" (symbol-name subr-or-var))
(concat "F" (subr-name (advice--cd*r subr-or-var))))))
(concat "F" (if (symbolp subr-or-var)
(symbol-name subr-or-var)
(subr-name (advice--cd*r subr-or-var)))))))
(with-current-buffer docbuf
(goto-char (point-min))
(if (eobp)
@ -1022,12 +1030,12 @@ it is displayed along with the global value."
(format-prompt "Describe variable" (and (symbolp v) v))
#'help--symbol-completion-table
(lambda (vv)
;; In case the variable only exists in the buffer
;; the command we switch back to that buffer before
;; we examine the variable.
(with-current-buffer orig-buffer
(or (get vv 'variable-documentation)
(and (boundp vv) (not (keywordp vv))))))
(or (get vv 'variable-documentation)
(and (not (keywordp vv))
;; Since the variable may only exist in the
;; original buffer, we have to look for it
;; there.
(buffer-local-boundp vv orig-buffer))))
t nil nil
(if (symbolp v) (symbol-name v))))
(list (if (equal val "")

View File

@ -125,6 +125,9 @@ This variable is expected to be made buffer-local by modes.")
(defvar hl-line-overlay-buffer nil
"Most recently visited buffer in which Hl-Line mode is enabled.")
(defvar hl-line-overlay-priority -50
"Priority used on the overlay used by hl-line.")
;;;###autoload
(define-minor-mode hl-line-mode
"Toggle highlighting of the current line (Hl-Line mode).
@ -152,7 +155,7 @@ line about point in the selected window only."
(defun hl-line-make-overlay ()
(let ((ol (make-overlay (point) (point))))
(overlay-put ol 'priority -50) ;(bug#16192)
(overlay-put ol 'priority hl-line-overlay-priority) ;(bug#16192)
(overlay-put ol 'face hl-line-face)
ol))

View File

@ -1079,8 +1079,11 @@ a new window in the current frame, splitting vertically."
;; Make sure that redisplay is performed, otherwise there can be a
;; bad interaction with code in the window-scroll-functions hook
(redisplay t)
(fit-window-to-buffer nil (when owin (/ (frame-height)
(length (window-list (selected-frame)))))))
(when (buffer-local-value 'ibuffer-auto-mode (window-buffer))
(fit-window-to-buffer
nil (and owin
(/ (frame-height)
(length (window-list (selected-frame))))))))
(defun ibuffer-confirm-operation-on (operation names)
"Display a buffer asking whether to perform OPERATION on NAMES."

View File

@ -50,6 +50,8 @@
;;; Code:
(require 'rfn-eshadow) ; rfn-eshadow-overlay
(require 'simple) ; max-mini-window-lines
(require 'cl-lib)
(defgroup icomplete nil
"Show completions dynamically in minibuffer."
@ -99,6 +101,10 @@ Otherwise this should be a list of the completion tables (e.g.,
"Face used by Icomplete for highlighting first match."
:version "24.4")
(defface icomplete-selected-match '((t :inherit highlight))
"Face used by `icomplete-vertical-mode' for the selected candidate."
:version "24.4")
;;;_* User Customization variables
(defcustom icomplete-prospects-height 2
;; We used to compute how many lines 100 characters would take in
@ -109,7 +115,7 @@ Otherwise this should be a list of the completion tables (e.g.,
:type 'integer
:version "26.1")
(defcustom icomplete-compute-delay .3
(defcustom icomplete-compute-delay .15
"Completions-computation stall, used only with large-number completions.
See `icomplete-delay-completions-threshold'."
:type 'number)
@ -118,7 +124,7 @@ See `icomplete-delay-completions-threshold'."
"Pending-completions number over which to apply `icomplete-compute-delay'."
:type 'integer)
(defcustom icomplete-max-delay-chars 3
(defcustom icomplete-max-delay-chars 2
"Maximum number of initial chars to apply `icomplete-compute-delay'."
:type 'integer)
@ -152,10 +158,6 @@ icompletion is occurring."
"Initial input in the minibuffer when icomplete-mode was activated.
Used to implement the option `icomplete-show-matches-on-no-input'.")
(defun icomplete-pre-command-hook ()
(let ((non-essential t))
(icomplete-tidy)))
(defun icomplete-post-command-hook ()
(let ((non-essential t)) ;E.g. don't prompt for password!
(icomplete-exhibit)))
@ -215,6 +217,29 @@ the default otherwise."
;; We're not at all interested in cycling here (bug#34077).
(minibuffer-force-complete nil nil 'dont-cycle))
;; Apropos `icomplete-scroll', we implement "scrolling icomplete"
;; within classic icomplete, which is "rotating", by contrast.
;;
;; The two variables supporing this are
;; `icomplete--scrolled-completions' and `icomplete--scrolled-past'.
;; They come into play when:
;;
;; - The user invokes commands `icomplete-forward-completions' and
;; `icomplete-backward-completions', thus "manually" scrolling to a
;; given position;
;;
;; - The user re-filters a selection that had already been manually
;; scrolled. The system attempts to keep the previous selection
;; stable in the face of the new filtering. This is mostly done in
;; `icomplete--render-vertical'.
;;
(defvar icomplete-scroll nil
"If non-nil, scroll candidates list instead of rotating it.")
(defvar icomplete--scrolled-completions nil
"If non-nil, tail of completions list manually scrolled to.")
(defvar icomplete--scrolled-past nil
"If non-nil, reverse tail of completions scrolled past.")
(defun icomplete-forward-completions ()
"Step forward completions by one entry.
Second entry becomes the first and can be selected with
@ -223,10 +248,14 @@ Second entry becomes the first and can be selected with
(let* ((beg (icomplete--field-beg))
(end (icomplete--field-end))
(comps (completion-all-sorted-completions beg end))
(last (last comps)))
(when comps
(setcdr last (cons (car comps) (cdr last)))
(completion--cache-all-sorted-completions beg end (cdr comps)))))
(last (last comps)))
(when (consp (cdr comps))
(cond (icomplete-scroll
(push (pop comps) icomplete--scrolled-past)
(setq icomplete--scrolled-completions comps))
(t
(setcdr (last comps) (cons (pop comps) (cdr last)))))
(completion--cache-all-sorted-completions beg end comps))))
(defun icomplete-backward-completions ()
"Step backward completions by one entry.
@ -236,12 +265,16 @@ Last entry becomes the first and can be selected with
(let* ((beg (icomplete--field-beg))
(end (icomplete--field-end))
(comps (completion-all-sorted-completions beg end))
(last-but-one (last comps 2))
(last (cdr last-but-one)))
(when (consp last) ; At least two elements in comps
(setcdr last-but-one (cdr last))
(push (car last) comps)
(completion--cache-all-sorted-completions beg end comps))))
last-but-one)
(cond ((and icomplete-scroll icomplete--scrolled-past)
(push (pop icomplete--scrolled-past) comps)
(setq icomplete--scrolled-completions comps))
((and (not icomplete-scroll)
(consp (cdr (setq last-but-one (last comps 2)))))
;; At least two elements in comps
(push (car (cdr last-but-one)) comps)
(setcdr last-but-one (cdr (cdr last-but-one)))))
(completion--cache-all-sorted-completions beg end comps)))
;;; Helpers for `fido-mode' (or `ido-mode' emulation)
;;;
@ -298,7 +331,8 @@ require user confirmation."
(file-name-directory (icomplete--field-string))))
(current (car completion-all-sorted-completions))
(probe (and dir current
(expand-file-name (directory-file-name current) dir))))
(expand-file-name (directory-file-name current)
(substitute-env-vars dir)))))
(cond ((and probe (file-directory-p probe) (not (string= current "./")))
(icomplete-force-complete))
(t
@ -351,6 +385,7 @@ if that doesn't produce a completion match."
(setq-local icomplete-tidy-shadowed-file-names t
icomplete-show-matches-on-no-input t
icomplete-hide-common-prefix nil
icomplete-scroll (not (null icomplete-vertical-mode))
completion-styles '(flex)
completion-flex-nospace nil
completion-category-defaults nil
@ -449,9 +484,9 @@ Usually run by inclusion in `minibuffer-setup-hook'."
(when (and icomplete-mode (icomplete-simple-completing-p))
(setq-local icomplete--initial-input (icomplete--field-string))
(setq-local completion-show-inline-help nil)
(setq icomplete--scrolled-completions nil)
(use-local-map (make-composed-keymap icomplete-minibuffer-map
(current-local-map)))
(add-hook 'pre-command-hook #'icomplete-pre-command-hook nil t)
(add-hook 'post-command-hook #'icomplete-post-command-hook nil t)
(run-hooks 'icomplete-minibuffer-setup-hook)))
@ -465,7 +500,6 @@ Usually run by inclusion in `minibuffer-setup-hook'."
(setq icomplete--in-region-buffer nil)
(delete-overlay icomplete-overlay)
(kill-local-variable 'completion-show-inline-help)
(remove-hook 'pre-command-hook 'icomplete-pre-command-hook t)
(remove-hook 'post-command-hook 'icomplete-post-command-hook t)
(message nil)))
(when (and completion-in-region-mode
@ -477,12 +511,12 @@ Usually run by inclusion in `minibuffer-setup-hook'."
(unless (memq icomplete-minibuffer-map (cdr tem))
(setcdr tem (make-composed-keymap icomplete-minibuffer-map
(cdr tem)))))
(add-hook 'pre-command-hook 'icomplete-pre-command-hook nil t)
(add-hook 'post-command-hook 'icomplete-post-command-hook nil t)))
(defun icomplete--sorted-completions ()
(or completion-all-sorted-completions
(cl-loop
initially (setq icomplete--scrolled-past nil) ; Invalidate scrolled state
with beg = (icomplete--field-beg)
with end = (icomplete--field-end)
with all = (completion-all-sorted-completions beg end)
@ -593,18 +627,13 @@ resized depends on `resize-mini-windows'."
(add-hook 'icomplete-minibuffer-setup-hook
#'icomplete--vertical-minibuffer-setup)))
(defalias 'fido-vertical-mode 'icomplete-vertical-mode)
;;;_* Completion
;;;_ > icomplete-tidy ()
(defun icomplete-tidy ()
"Remove completions display (if any) prior to new user input.
Should be run in on the minibuffer `pre-command-hook'.
See `icomplete-mode' and `minibuffer-setup-hook'."
(delete-overlay icomplete-overlay))
;;;_ > icomplete-exhibit ()
(defun icomplete-exhibit ()
"Insert Icomplete completions display.
@ -659,13 +688,126 @@ See `icomplete-mode' and `minibuffer-setup-hook'."
deactivate-mark)
;; Do nothing if while-no-input was aborted.
(when (stringp text)
(move-overlay icomplete-overlay (point) (point) (current-buffer))
(move-overlay icomplete-overlay (point-min) (point) (current-buffer))
;; The current C cursor code doesn't know to use the overlay's
;; marker's stickiness to figure out whether to place the cursor
;; before or after the string, so let's spoon-feed it the pos.
(put-text-property 0 1 'cursor t text)
(overlay-put
icomplete-overlay 'before-string
(and icomplete-scroll
(let ((past (length icomplete--scrolled-past)))
(format
"%s/%s "
(1+ past)
(+ past
(safe-length completion-all-sorted-completions))))))
(overlay-put icomplete-overlay 'after-string text))))))))
(defun icomplete--affixate (md prospects)
"Affixate PROSPECTS given completion metadata MD.
Return a list of (COMP PREFIX SUFFIX)."
(let ((aff-fun (or (completion-metadata-get md 'affixation-function)
(plist-get completion-extra-properties :affixation-function)))
(ann-fun (or (completion-metadata-get md 'annotation-function)
(plist-get completion-extra-properties :annotation-function))))
(cond (aff-fun
(funcall aff-fun prospects))
(ann-fun
(mapcar
(lambda (comp)
(let ((suffix (or (funcall ann-fun comp) "")))
(list comp ""
;; The default completion UI adds the
;; `completions-annotations' face if no
;; other faces are present.
(if (text-property-not-all 0 (length suffix) 'face nil suffix)
suffix
(propertize suffix 'face 'completions-annotations)))))
prospects))
(prospects))))
(cl-defun icomplete--render-vertical (comps md &aux scroll-above scroll-below)
;; Welcome to loopapalooza!
;;
;; First, be mindful of `icomplete-scroll' and manual scrolls. If
;; `icomplete--scrolled-completions' and `icomplete--scrolled-past'
;; are:
;;
;; - both nil, there is no manual scroll;
;; - both non-nil, there is a healthy manual scroll the doesn't need
;; to be readjusted (user just moved around the minibuffer, for
;; example)l
;; - non-nil and nil, respectively, a refiltering took place and we
;; need attempt to readjust them to the new filtered `comps'.
(when (and icomplete-scroll
icomplete--scrolled-completions
(null icomplete--scrolled-past))
(cl-loop with preds
for (comp . rest) on comps
when (equal comp (car icomplete--scrolled-completions))
do
(setq icomplete--scrolled-past preds
comps (cons comp rest))
(completion--cache-all-sorted-completions
(icomplete--field-beg)
(icomplete--field-end)
comps)
and return nil
do (push comp preds)
finally (setq icomplete--scrolled-completions nil)))
;; Then, in this pretty ugly loop, collect completions to display
;; above and below the selected one, considering scrolling
;; positions.
(cl-loop with preds = icomplete--scrolled-past
with succs = (cdr comps)
with max-lines = (1- (min
icomplete-prospects-height
(truncate (max-mini-window-lines) 1)))
with max-above = (- max-lines
1
(cl-loop for (_ . r) on comps
repeat (truncate max-lines 2)
while (listp r)
count 1))
repeat max-lines
for neighbour = nil
if (and preds (> max-above 0)) do
(push (setq neighbour (pop preds)) scroll-above)
(cl-decf max-above)
else if (consp succs) collect
(setq neighbour (pop succs)) into scroll-below-aux
while neighbour
finally (setq scroll-below scroll-below-aux))
;; Now figure out spacing and layout
;;
(cl-loop
with selected = (substring (car comps))
initially (add-face-text-property 0 (length selected)
'icomplete-selected-match 'append selected)
with torender = (nconc scroll-above (list selected) scroll-below)
with triplets = (icomplete--affixate md torender)
initially (when (eq triplets torender)
(cl-return-from icomplete--render-vertical
(concat
" \n"
(mapconcat #'identity torender icomplete-separator))))
for (comp prefix) in triplets
maximizing (length prefix) into max-prefix-len
maximizing (length comp) into max-comp-len
finally return
;; Finally, render
;;
(concat
" \n"
(cl-loop for (comp prefix suffix) in triplets
concat prefix
concat (make-string (- max-prefix-len (length prefix)) ? )
concat comp
concat (make-string (- max-comp-len (length comp)) ? )
concat suffix
concat icomplete-separator))))
;;;_ > icomplete-completions (name candidates predicate require-match)
(defun icomplete-completions (name candidates predicate require-match)
"Identify prospective candidates for minibuffer completion.
@ -703,126 +845,126 @@ matches exist."
predicate))
(md (completion--field-metadata (icomplete--field-beg)))
(comps (icomplete--sorted-completions))
(last (if (consp comps) (last comps)))
(base-size (cdr last))
(open-bracket (if require-match "(" "["))
(close-bracket (if require-match ")" "]")))
;; `concat'/`mapconcat' is the slow part.
(if (not (consp comps))
(progn ;;(debug (format "Candidates=%S field=%S" candidates name))
(format " %sNo matches%s" open-bracket close-bracket))
(if last (setcdr last nil))
(let* ((most-try
(if (and base-size (> base-size 0))
(if icomplete-vertical-mode
(icomplete--render-vertical comps md)
(let* ((last (if (consp comps) (last comps)))
;; Save the "base size" encoded in `comps' then
;; removing making `comps' a proper list.
(base-size (prog1 (cdr last)
(if last (setcdr last nil))))
(most-try
(if (and base-size (> base-size 0))
(completion-try-completion
name candidates predicate (length name) md)
;; If the `comps' are 0-based, the result should be
;; the same with `comps'.
(completion-try-completion
name candidates predicate (length name) md)
;; If the `comps' are 0-based, the result should be
;; the same with `comps'.
(completion-try-completion
name comps nil (length name) md)))
(most (if (consp most-try) (car most-try)
(if most-try (car comps) "")))
;; Compare name and most, so we can determine if name is
;; a prefix of most, or something else.
(compare (compare-strings name nil nil
most nil nil completion-ignore-case))
(ellipsis (if (char-displayable-p ?…) "" "..."))
(determ (unless (or (eq t compare) (eq t most-try)
(= (setq compare (1- (abs compare)))
(length most)))
(concat open-bracket
(cond
((= compare (length name))
;; Typical case: name is a prefix.
(substring most compare))
;; Don't bother truncating if it doesn't gain
;; us at least 2 columns.
((< compare (+ 2 (string-width ellipsis))) most)
(t (concat ellipsis (substring most compare))))
close-bracket)))
;;"-prospects" - more than one candidate
(prospects-len (+ (string-width
(or determ (concat open-bracket close-bracket)))
(string-width icomplete-separator)
(+ 2 (string-width ellipsis)) ;; take {…} into account
(string-width (buffer-string))))
(prospects-max
;; Max total length to use, including the minibuffer content.
(* (+ icomplete-prospects-height
;; If the minibuffer content already uses up more than
;; one line, increase the allowable space accordingly.
(/ prospects-len (window-width)))
(window-width)))
;; Find the common prefix among `comps'.
;; We can't use the optimization below because its assumptions
;; aren't always true, e.g. when completion-cycling (bug#10850):
;; (if (eq t (compare-strings (car comps) nil (length most)
;; most nil nil completion-ignore-case))
;; ;; Common case.
;; (length most)
;; Else, use try-completion.
(prefix (when icomplete-hide-common-prefix
(try-completion "" comps)))
(prefix-len
(and (stringp prefix)
;; Only hide the prefix if the corresponding info
;; is already displayed via `most'.
(string-prefix-p prefix most t)
(length prefix))) ;;)
prospects comp limit)
(if (or (eq most-try t) (not (consp (cdr comps))))
(setq prospects nil)
(when (member name comps)
;; NAME is complete but not unique. This scenario poses
;; following UI issues:
;;
;; - When `icomplete-hide-common-prefix' is non-nil, NAME
;; is stripped empty. This would make the entry
;; inconspicuous.
;;
;; - Due to sorting of completions, NAME may not be the
;; first of the prospects and could be hidden deep in
;; the displayed string.
;;
;; - Because of `icomplete-prospects-height' , NAME may
;; not even be displayed to the user.
;;
;; To circumvent all the above problems, provide a visual
;; cue to the user via an "empty string" in the try
;; completion field.
(setq determ (concat open-bracket "" close-bracket)))
;; Compute prospects for display.
(while (and comps (not limit))
(setq comp
(if prefix-len (substring (car comps) prefix-len) (car comps))
comps (cdr comps))
(setq prospects-len
(+ (string-width comp)
(string-width icomplete-separator)
prospects-len))
(if (< prospects-len prospects-max)
(push comp prospects)
(setq limit t))))
(setq prospects (nreverse prospects))
;; Decorate first of the prospects.
(when prospects
(let ((first (copy-sequence (pop prospects))))
(put-text-property 0 (length first)
'face 'icomplete-first-match first)
(push first prospects)))
;; Restore the base-size info, since completion-all-sorted-completions
;; is cached.
(if last (setcdr last base-size))
(if prospects
(concat determ
(if icomplete-vertical-mode " \n" "{")
(mapconcat 'identity prospects (if icomplete-vertical-mode
"\n"
icomplete-separator))
(unless icomplete-vertical-mode
(concat (and limit (concat icomplete-separator ellipsis))
"}")))
(concat determ " [Matched]"))))))
name comps nil (length name) md)))
(most (if (consp most-try) (car most-try)
(if most-try (car comps) "")))
;; Compare name and most, so we can determine if name is
;; a prefix of most, or something else.
(compare (compare-strings name nil nil
most nil nil completion-ignore-case))
(ellipsis (if (char-displayable-p ?…) "" "..."))
(determ (unless (or (eq t compare) (eq t most-try)
(= (setq compare (1- (abs compare)))
(length most)))
(concat open-bracket
(cond
((= compare (length name))
;; Typical case: name is a prefix.
(substring most compare))
;; Don't bother truncating if it doesn't gain
;; us at least 2 columns.
((< compare (+ 2 (string-width ellipsis))) most)
(t (concat ellipsis (substring most compare))))
close-bracket)))
;;"-prospects" - more than one candidate
(prospects-len (+ (string-width
(or determ (concat open-bracket close-bracket)))
(string-width icomplete-separator)
(+ 2 (string-width ellipsis)) ;; take {…} into account
(string-width (buffer-string))))
(prospects-max
;; Max total length to use, including the minibuffer content.
(* (+ icomplete-prospects-height
;; If the minibuffer content already uses up more than
;; one line, increase the allowable space accordingly.
(/ prospects-len (window-width)))
(window-width)))
;; Find the common prefix among `comps'.
;; We can't use the optimization below because its assumptions
;; aren't always true, e.g. when completion-cycling (bug#10850):
;; (if (eq t (compare-strings (car comps) nil (length most)
;; most nil nil completion-ignore-case))
;; ;; Common case.
;; (length most)
;; Else, use try-completion.
(prefix (when icomplete-hide-common-prefix
(try-completion "" comps)))
(prefix-len
(and (stringp prefix)
;; Only hide the prefix if the corresponding info
;; is already displayed via `most'.
(string-prefix-p prefix most t)
(length prefix))) ;;)
prospects comp limit)
(prog1
(if (or (eq most-try t) (and (not icomplete-scroll)
(not (consp (cdr comps)))))
(concat determ " [Matched]")
(when (member name comps)
;; NAME is complete but not unique. This scenario poses
;; following UI issues:
;;
;; - When `icomplete-hide-common-prefix' is non-nil, NAME
;; is stripped empty. This would make the entry
;; inconspicuous.
;;
;; - Due to sorting of completions, NAME may not be the
;; first of the prospects and could be hidden deep in
;; the displayed string.
;;
;; - Because of `icomplete-prospects-height' , NAME may
;; not even be displayed to the user.
;;
;; To circumvent all the above problems, provide a visual
;; cue to the user via an "empty string" in the try
;; completion field.
(setq determ (concat open-bracket "" close-bracket)))
(while (and comps (not limit))
(setq comp
(if prefix-len (substring (car comps) prefix-len) (car comps))
comps (cdr comps))
(setq prospects-len
(+ (string-width comp)
(string-width icomplete-separator)
prospects-len))
(if (< prospects-len prospects-max)
(push comp prospects)
(setq limit t)))
(setq prospects (nreverse prospects))
;; Decorate first of the prospects.
(when prospects
(let ((first (copy-sequence (pop prospects))))
(put-text-property 0 (length first)
'face 'icomplete-first-match first)
(push first prospects)))
(concat determ
"{"
(mapconcat 'identity prospects icomplete-separator)
(concat (and limit (concat icomplete-separator ellipsis))
"}")))
;; Restore the base-size info, since completion-all-sorted-completions
;; is cached.
(if last (setcdr last base-size))))))))
;;; Iswitchb compatibility

View File

@ -39,8 +39,8 @@
(defvar indent-line-function 'indent-relative
"Function to indent the current line.
This function will be called with no arguments.
If it is called somewhere where auto-indentation cannot be done
\(e.g. inside a string), the function should simply return `noindent'.
If it is called somewhere where it cannot auto-indent, the function
should return `noindent' to signal that it didn't.
Setting this function is all you need to make TAB indent appropriately.
Don't rebind TAB unless you really need to.")

View File

@ -404,7 +404,7 @@ A value of nil means highlight all matches shown on the screen."
(integer :tag "Some"))
:group 'lazy-highlight)
(defcustom lazy-highlight-buffer-max-at-a-time 20
(defcustom lazy-highlight-buffer-max-at-a-time 200 ; 20 (bug#48581)
"Maximum matches to highlight at a time (for `lazy-highlight-buffer').
Larger values may reduce Isearch's responsiveness to user input;
smaller values make matches highlight slowly.
@ -412,7 +412,7 @@ A value of nil means highlight all matches in the buffer."
:type '(choice (const :tag "All" nil)
(integer :tag "Some"))
:group 'lazy-highlight
:version "27.1")
:version "28.1")
(defcustom lazy-highlight-buffer nil
"Controls the lazy-highlighting of the full buffer.
@ -3462,10 +3462,6 @@ Can be changed via `isearch-search-fun-function' for special needs."
(if isearch-forward #'re-search-forward #'re-search-backward)
regexp bound noerror count))))
;; This is for when we compile this file during bootstrap, with
;; loaddefs.el still not loaded.
(declare-function multi-isearch-switch-buffer "misearch" ())
(defun isearch-search-string (string bound noerror)
"Search for the first occurrence of STRING or its translation.
STRING's characters are translated using `translation-table-for-input'

View File

@ -482,7 +482,7 @@ without repeating the prefix."
(defun kmacro-view-ring-2nd ()
"Display the current head of the keyboard macro ring."
"Display the second macro in the keyboard macro ring."
(interactive)
(unless (kmacro-ring-empty-p)
(kmacro-display (car (car kmacro-ring)) nil "2nd macro")))

View File

@ -1063,7 +1063,7 @@ or a non-nil `apropos-do-all' argument.
\(fn PATTERN)" t nil)
(defalias 'command-apropos 'apropos-command)
(defalias 'command-apropos #'apropos-command)
(autoload 'apropos-command "apropos" "\
Show commands (interactively callable functions) that match PATTERN.
@ -5339,14 +5339,14 @@ clashes.
\(fn NAME PREFIX &optional FIRST)" nil nil)
(autoload 'comp-clean-up-stale-eln "comp" "\
Given FILE remove all its *.eln files in `comp-eln-load-path'
Given FILE remove all its *.eln files in `native-comp-eln-load-path'
sharing the original source filename (including FILE).
\(fn FILE)" nil nil)
(autoload 'comp-lookup-eln "comp" "\
Given a Lisp source FILENAME return the corresponding .eln file if found.
Search happens in `comp-eln-load-path'.
Search happens in `native-comp-eln-load-path'.
\(fn FILENAME)" nil nil)
@ -5374,7 +5374,7 @@ Native compilation equivalent to `batch-byte-compile'." nil nil)
Like `batch-native-compile', but used for bootstrap.
Generate .elc files in addition to the .eln files.
Force the produced .eln to be outputted in the eln system
directory (the last entry in `comp-eln-load-path').
directory (the last entry in `native-comp-eln-load-path').
If the environment variable 'NATIVE_DISABLED' is set, only byte
compile." nil nil)
@ -5394,7 +5394,7 @@ nil -- Select all files.
a string -- A regular expression selecting files with matching names.
a function -- A function selecting files with matching names.
The variable `comp-async-jobs-number' specifies the number
The variable `native-comp-async-jobs-number' specifies the number
of (commands) to run simultaneously.
\(fn FILES &optional RECURSIVELY LOAD SELECTOR)" nil nil)
@ -7209,6 +7209,12 @@ information on adapting behavior of commands in Delete Selection mode.
\(fn &optional ARG)" t nil)
(autoload 'delete-active-region "delsel" "\
Delete the active region.
If KILLP in not-nil, the active region is killed instead of deleted.
\(fn &optional KILLP)" t nil)
(register-definition-prefixes "delsel" '("del" "minibuffer-keyboard-quit"))
;;;***
@ -9389,6 +9395,26 @@ an EDE controlled project.
;;;### (autoloads nil "edebug" "emacs-lisp/edebug.el" (0 0 0 0))
;;; Generated autoloads from emacs-lisp/edebug.el
(defvar edebug-all-defs nil "\
If non-nil, evaluating defining forms instruments for Edebug.
This applies to `eval-defun', `eval-region', `eval-buffer', and
`eval-current-buffer'. `eval-region' is also called by
`eval-last-sexp', and `eval-print-last-sexp'.
You can use the command `edebug-all-defs' to toggle the value of this
variable. You may wish to make it local to each buffer with
\(make-local-variable \\='edebug-all-defs) in your
`emacs-lisp-mode-hook'.")
(custom-autoload 'edebug-all-defs "edebug" t)
(defvar edebug-all-forms nil "\
Non-nil means evaluation of all forms will instrument for Edebug.
This doesn't apply to loading or evaluations in the minibuffer.
Use the command `edebug-all-forms' to toggle the value of this option.")
(custom-autoload 'edebug-all-forms "edebug" t)
(autoload 'edebug-basic-spec "edebug" "\
Return t if SPEC uses only extant spec symbols.
An extant spec symbol is a symbol that is not a function and has a
@ -10543,6 +10569,26 @@ Encrypt marked files." t nil)
(register-definition-prefixes "epa-file" '("epa-"))
;;;***
;;;### (autoloads nil "epa-ks" "epa-ks.el" (0 0 0 0))
;;; Generated autoloads from epa-ks.el
(autoload 'epa-search-keys "epa-ks" "\
Ask a keyserver for all keys matching QUERY.
The keyserver to be used is specified by `epa-keyserver'.
If EXACT is non-nil (interactively, prefix argument), require
exact matches.
Note that the request may fail if the query is not specific
enough, since keyservers have strict timeout settings.
\(fn QUERY EXACT)" t nil)
(register-definition-prefixes "epa-ks" '("epa-k"))
;;;***
;;;### (autoloads nil "epa-mail" "epa-mail.el" (0 0 0 0))
@ -10758,8 +10804,8 @@ Example usage:
(erc-tls :server \"chat.freenode.net\" :port 6697
:client-certificate
'(\"/data/bandali/my-cert.key\"
\"/data/bandali/my-cert.crt\"))
'(\"/home/bandali/my-cert.key\"
\"/home/bandali/my-cert.crt\"))
\(fn &key (SERVER (erc-compute-server)) (PORT (erc-compute-port)) (NICK (erc-compute-nick)) PASSWORD (FULL-NAME (erc-compute-full-name)) CLIENT-CERTIFICATE)" t nil)
@ -12603,6 +12649,10 @@ Being on a `#include' line pulls in that file.
If optional IN-OTHER-WINDOW is non-nil, find the file in the other window.
If optional IGNORE-INCLUDE is non-nil, ignore being on `#include' lines.
If optional EVENT is non-nil (default `last-nonmenu-event', move
point to the end position of that event before calling the
various ff-* hooks.
Variables of interest include:
- `ff-case-fold-search'
@ -15762,6 +15812,12 @@ When called from lisp, FUNCTION may also be a function object.
\(fn FUNCTION)" t nil)
(autoload 'describe-command "help-fns" "\
Display the full documentation of COMMAND (a symbol).
When called from lisp, COMMAND may also be a function object.
\(fn COMMAND)" t nil)
(autoload 'help-C-file-name "help-fns" "\
Return the name of the C file where SUBR-OR-VAR is defined.
KIND should be `var' for a variable or `subr' for a subroutine.
@ -16076,22 +16132,30 @@ also supported.
There are several ways to change text in hexl mode:
ASCII characters (character between space (0x20) and tilde (0x7E)) are
bound to self-insert so you can simply type the character and it will
insert itself (actually overstrike) into the buffer.
Self-inserting characters are bound to `hexl-self-insert' so you
can simply type the character and it will insert itself (actually
overstrike) into the buffer. However, inserting non-ASCII characters
requires caution: the buffer's coding-system should correspond to
the encoding on disk, and multibyte characters should be inserted
with cursor on the first byte of a multibyte sequence whose length
is identical to the length of the multibyte sequence to be inserted,
otherwise this could produce invalid multibyte sequences. Non-ASCII
characters in ISO-2022 encodings should preferably inserted byte by
byte, to avoid problems caused by the designation sequences before
the actual characters.
\\[hexl-quoted-insert] followed by another keystroke allows you to insert the key even if
it isn't bound to self-insert. An octal number can be supplied in place
of another key to insert the octal number's ASCII representation.
\\[hexl-insert-hex-char] will insert a given hexadecimal value (if it is between 0 and 0xFF)
into the buffer at the current point.
\\[hexl-insert-hex-char] will insert a given hexadecimal value
into the buffer at the current address.
\\[hexl-insert-octal-char] will insert a given octal value (if it is between 0 and 0377)
into the buffer at the current point.
\\[hexl-insert-octal-char] will insert a given octal value
into the buffer at the current address.
\\[hexl-insert-decimal-char] will insert a given decimal value (if it is between 0 and 255)
into the buffer at the current point.
\\[hexl-insert-decimal-char] will insert a given decimal value
into the buffer at the current address..
\\[hexl-mode-exit] will exit `hexl-mode'.
@ -16107,7 +16171,8 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode.
(autoload 'hexl-find-file "hexl" "\
Edit file FILENAME as a binary file in hex dump format.
Switch to a buffer visiting file FILENAME, creating one if none exists,
and edit the file in `hexl-mode'.
and edit the file in `hexl-mode'. The buffer's coding-system will be
no-conversion, unlike if you visit it normally and then invoke `hexl-mode'.
\(fn FILENAME)" t nil)
@ -17195,7 +17260,7 @@ resized depends on `resize-mini-windows'.
(make-obsolete 'iswitchb-mode
"use `icomplete-mode' or `ido-mode' instead." "24.4"))
(register-definition-prefixes "icomplete" '("icomplete-"))
(register-definition-prefixes "icomplete" '("fido-vertical-mode" "icomplete-"))
;;;***
@ -19272,7 +19337,7 @@ It is not recommended to set this variable permanently to anything but nil.")
Uninstall jka-compr.
This removes the entries in `file-name-handler-alist' and `auto-mode-alist'
and `inhibit-local-variables-suffixes' that were added
by `jka-compr-installed'." nil nil)
by `jka-compr-install'." nil nil)
(register-definition-prefixes "jka-compr" '("compression-error" "jka-compr-"))
@ -19437,12 +19502,12 @@ and the return value is the length of the conversion.
;;;### (autoloads nil "kmacro" "kmacro.el" (0 0 0 0))
;;; Generated autoloads from kmacro.el
(global-set-key "\C-x(" 'kmacro-start-macro)
(global-set-key "\C-x)" 'kmacro-end-macro)
(global-set-key "\C-xe" 'kmacro-end-and-call-macro)
(global-set-key [f3] 'kmacro-start-macro-or-insert-counter)
(global-set-key [f4] 'kmacro-end-or-call-macro)
(global-set-key "\C-x\C-k" 'kmacro-keymap)
(global-set-key "\C-x(" #'kmacro-start-macro)
(global-set-key "\C-x)" #'kmacro-end-macro)
(global-set-key "\C-xe" #'kmacro-end-and-call-macro)
(global-set-key [f3] #'kmacro-start-macro-or-insert-counter)
(global-set-key [f4] #'kmacro-end-or-call-macro)
(global-set-key "\C-x\C-k" #'kmacro-keymap)
(autoload 'kmacro-keymap "kmacro" "Keymap for keyboard macro commands." t 'keymap)
(autoload 'kmacro-exec-ring-item "kmacro" "\
@ -19950,28 +20015,28 @@ except that FILTER is not optional.
;;; Generated autoloads from vc/log-edit.el
(autoload 'log-edit "log-edit" "\
Setup a buffer to enter a log message.
The buffer is put in mode MODE or `log-edit-mode' if MODE is nil.
Setup a buffer to enter a VC commit log message.
The buffer is put in mode MODE, or `log-edit-mode' if MODE is nil.
\\<log-edit-mode-map>
If SETUP is non-nil, erase the buffer and run `log-edit-hook'.
Set mark and point around the entire contents of the buffer, so
that it is easy to kill the contents of the buffer with
\\[kill-region]. Once the user is done editing the message,
invoking the command \\[log-edit-done] (`log-edit-done') will
call CALLBACK to do the actual commit.
\\[kill-region]. Once the user is done editing the message, he
or she is expected to invoke the command \\[log-edit-done] (`log-edit-done'),
which will call CALLBACK, a function to do the actual commit.
PARAMS if non-nil is an alist of variables and buffer-local
values to give them in the Log Edit buffer. Possible keys and
associated values:
PARAMS, if non-nil, is an alist of variables and buffer-local
values to give to those variables in the Log Edit buffer. Possible
keys and associated values are:
`log-edit-listfun' -- function taking no arguments that returns the list of
files that are concerned by the current operation (using relative names);
files that are concerned by the current operation (using relative names);
`log-edit-diff-function' -- function taking no arguments that
displays a diff of the files concerned by the current operation.
displays a diff of the files concerned by the current operation.
`vc-log-fileset' -- the VC fileset to be committed (if any).
If BUFFER is non-nil `log-edit' will jump to that buffer, use it
If BUFFER is non-nil, `log-edit' will switch to that buffer, use it
to edit the log message and go back to the current buffer when
done. Otherwise, it uses the current buffer.
done. Otherwise, this function will use the current buffer.
\(fn CALLBACK &optional SETUP PARAMS BUFFER MODE &rest IGNORE)" nil nil)
@ -20511,6 +20576,50 @@ The mail client is taken to be the handler of mailto URLs." nil nil)
;;;### (autoloads nil "mairix" "net/mairix.el" (0 0 0 0))
;;; Generated autoloads from net/mairix.el
(autoload 'mairix-search "mairix" "\
Call Mairix with SEARCH.
If THREADS is non-nil, also display whole threads of found
messages. Results will be put into the default search file.
\(fn SEARCH THREADS)" t nil)
(autoload 'mairix-use-saved-search "mairix" "\
Use a saved search for querying Mairix." t nil)
(autoload 'mairix-edit-saved-searches-customize "mairix" "\
Edit the list of saved searches in a customization buffer." t nil)
(autoload 'mairix-search-from-this-article "mairix" "\
Search messages from sender of the current article.
This is effectively a shortcut for calling `mairix-search' with
f:current_from. If prefix THREADS is non-nil, include whole
threads.
\(fn THREADS)" t nil)
(autoload 'mairix-search-thread-this-article "mairix" "\
Search thread for the current article.
This is effectively a shortcut for calling `mairix-search'
with m:msgid of the current article and enabled threads." t nil)
(autoload 'mairix-widget-search-based-on-article "mairix" "\
Create mairix query based on current article using widgets." t nil)
(autoload 'mairix-edit-saved-searches "mairix" "\
Edit current mairix searches." t nil)
(autoload 'mairix-widget-search "mairix" "\
Create mairix query interactively using graphical widgets.
MVALUES may contain values from current article.
\(fn &optional MVALUES)" t nil)
(autoload 'mairix-update-database "mairix" "\
Call mairix for updating the database for SERVERS.
Mairix will be called asynchronously unless
`mairix-synchronous-update' is t. Mairix will be called with
`mairix-update-options'." t nil)
(register-definition-prefixes "mairix" '("mairix-"))
;;;***
@ -21518,6 +21627,9 @@ Sequence of files visited by multiple file buffers Isearch.")
Set up isearch to search multiple buffers.
Intended to be added to `isearch-mode-hook'." nil nil)
(autoload 'multi-isearch-switch-buffer "misearch" "\
Switch to the next buffer in multi-buffer search." nil nil)
(autoload 'multi-isearch-buffers "misearch" "\
Start multi-buffer Isearch on a list of BUFFERS.
This list can contain live buffers or their names.
@ -24243,7 +24355,7 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
\(fn)" t nil)
(put 'outline-minor-mode-cycle 'safe-local-variable 'booleanp)
(put 'outline-minor-mode-highlight 'safe-local-variable 'booleanp)
(put 'outline-minor-mode-highlight 'safe-local-variable 'symbolp)
(autoload 'outline-minor-mode "outline" "\
Toggle Outline minor mode.
@ -25312,14 +25424,14 @@ Macroexpand EXPRESSION and pretty-print its value.
(autoload 'pp-eval-last-sexp "pp" "\
Run `pp-eval-expression' on sexp before point.
With argument, pretty-print output into current buffer.
With ARG, pretty-print output into current buffer.
Ignores leading comment characters.
\(fn ARG)" t nil)
(autoload 'pp-macroexpand-last-sexp "pp" "\
Run `pp-macroexpand-expression' on sexp before point.
With argument, pretty-print output into current buffer.
With ARG, pretty-print output into current buffer.
Ignores leading comment characters.
\(fn ARG)" t nil)
@ -26996,7 +27108,12 @@ the regexp builder. It displays a buffer named \"*RE-Builder*\"
in another window, initially containing an empty regexp.
As you edit the regexp in the \"*RE-Builder*\" buffer, the
matching parts of the target buffer will be highlighted." t nil)
matching parts of the target buffer will be highlighted.
Case-sensitivity can be toggled with \\[reb-toggle-case]. The
regexp builder supports three different forms of input which can
be set with \\[reb-change-syntax]. More options and details are
provided in the Commentary section of this library." t nil)
(register-definition-prefixes "re-builder" '("re-builder-unload-function" "reb-"))
@ -28016,28 +28133,37 @@ than appending to it. Deletes the message after writing if
;;; Generated autoloads from emacs-lisp/rmc.el
(autoload 'read-multiple-choice "rmc" "\
Ask user a multiple choice question.
PROMPT should be a string that will be displayed as the prompt.
Ask user to select an entry from CHOICES, promting with PROMPT.
This function allows to ask the user a multiple-choice question.
CHOICES is a list of (KEY NAME [DESCRIPTION]). KEY is a
character to be entered. NAME is a short name for the entry to
be displayed while prompting (if there's room, it might be
shortened). DESCRIPTION is an optional longer explanation that
will be displayed in a help buffer if the user requests more
help.
CHOICES should be a list of the form (KEY NAME [DESCRIPTION]).
KEY is a character the user should type to select the entry.
NAME is a short name for the entry to be displayed while prompting
\(if there's no room, it might be shortened).
DESCRIPTION is an optional longer description of the entry; it will
be displayed in a help buffer if the user requests more help. This
help description has a fixed format in columns. For greater
flexibility, instead of passing a DESCRIPTION, the caller can pass
the optional argument HELP-STRING. This argument is a string that
should contain a more detailed description of all of the possible
choices. `read-multiple-choice' will display that description in a
help buffer if the user requests that.
This function translates user input into responses by consulting
the bindings in `query-replace-map'; see the documentation of
that variable for more information. In this case, the useful
bindings are `recenter', `scroll-up', and `scroll-down'. If the
user enters `recenter', `scroll-up', or `scroll-down' responses,
perform the requested window recentering or scrolling and ask
again.
that variable for more information. The relevant bindings for the
purposes of this function are `recenter', `scroll-up', `scroll-down',
and `edit'.
If the user types the `recenter', `scroll-up', or `scroll-down'
responses, the function performs the requested window recentering or
scrolling, and then asks the question again. If the user enters `edit',
the function starts a recursive edit. When the user exit the recursive
edit, the multiple-choice prompt gains focus again.
When `use-dialog-box' is t (the default), this function can pop
up a dialog window to collect the user input. That functionality
requires `display-popup-menus-p' to return t. Otherwise, a
text dialog will be used.
When `use-dialog-box' is t (the default), and the command using this
function was invoked via the mouse, this function pops up a GUI dialog
to collect the user input, but only if Emacs is capable of using GUI
dialogs. Otherwise, the function will always use text-mode dialogs.
The return value is the matching entry from the CHOICES list.
@ -28048,7 +28174,7 @@ Usage example:
(?s \"session only\")
(?n \"no\")))
\(fn PROMPT CHOICES)" nil nil)
\(fn PROMPT CHOICES &optional HELP-STRING)" nil nil)
;;;***
@ -28559,7 +28685,7 @@ For more details, see Info node `(elisp) Extending Rx'.
(function-put 'rx-define 'lisp-indent-function 'defun)
(eval-and-compile (defun rx--pcase-macroexpander (&rest regexps) "A pattern that matches strings against `rx' REGEXPS in sexp form.\nREGEXPS are interpreted as in `rx'. The pattern matches any\nstring that is a match for REGEXPS, as if by `string-match'.\n\nIn addition to the usual `rx' syntax, REGEXPS can contain the\nfollowing constructs:\n\n (let REF RX...) binds the symbol REF to a submatch that matches\n the regular expressions RX. REF is bound in\n CODE to the string of the submatch or nil, but\n can also be used in `backref'.\n (backref REF) matches whatever the submatch REF matched.\n REF can be a number, as usual, or a name\n introduced by a previous (let REF ...)\n construct." (let* ((rx--pcase-vars nil) (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps)))) (nvars (length rx--pcase-vars))) `(and (pred stringp) ,(if (zerop nvars) `(pred (string-match ,regexp)) `(app (lambda (s) (and (string-match ,regexp s) ,(rx--reduce-right (lambda (a b) `(cons ,a ,b)) (mapcar (lambda (i) `(match-string ,i s)) (number-sequence 1 nvars))))) ,(list '\` (rx--reduce-right #'cons (mapcar (lambda (name) (list '\, name)) (reverse rx--pcase-vars))))))))))
(eval-and-compile (defun rx--pcase-macroexpander (&rest regexps) "A pattern that matches strings against `rx' REGEXPS in sexp form.\nREGEXPS are interpreted as in `rx'. The pattern matches any\nstring that is a match for REGEXPS, as if by `string-match'.\n\nIn addition to the usual `rx' syntax, REGEXPS can contain the\nfollowing constructs:\n\n (let REF RX...) binds the symbol REF to a submatch that matches\n the regular expressions RX. REF is bound in\n CODE to the string of the submatch or nil, but\n can also be used in `backref'.\n (backref REF) matches whatever the submatch REF matched.\n REF can be a number, as usual, or a name\n introduced by a previous (let REF ...)\n construct." (let* ((rx--pcase-vars nil) (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps))))) `(and (pred stringp) ,(pcase (length rx--pcase-vars) (0 `(pred (string-match ,regexp))) (1 `(app (lambda (s) (if (string-match ,regexp s) (match-string 1 s) 0)) (and ,(car rx--pcase-vars) (pred (not numberp))))) (nvars `(app (lambda (s) (and (string-match ,regexp s) ,(rx--reduce-right (lambda (a b) `(cons ,a ,b)) (mapcar (lambda (i) `(match-string ,i s)) (number-sequence 1 nvars))))) ,(list '\` (rx--reduce-right #'cons (mapcar (lambda (name) (list '\, name)) (reverse rx--pcase-vars)))))))))))
(define-symbol-prop 'rx--pcase-macroexpander 'edebug-form-spec 'nil)
@ -29934,7 +30060,7 @@ Pop to a buffer with short documentation summary for functions in GROUP.
\(fn GROUP)" t nil)
(register-definition-prefixes "shortdoc" '("alist" "buffer" "define-short-documentation-group" "file" "hash-table" "list" "number" "process" "regexp" "sequence" "shortdoc-" "string" "vector"))
(register-definition-prefixes "shortdoc" '("alist" "buffer" "define-short-documentation-group" "file" "hash-table" "list" "number" "overlay" "process" "regexp" "sequence" "shortdoc-" "string" "vector"))
;;;***
@ -34136,10 +34262,10 @@ match file names at root of the underlying local file system,
like \"/sys\" or \"/C:\".")
(defun tramp-autoload-file-name-handler (operation &rest args) "\
Load Tramp file name handler, and perform OPERATION." (tramp-unload-file-name-handlers) (when tramp-mode (let ((default-directory temporary-file-directory)) (load "tramp" 'noerror 'nomessage))) (apply operation args))
Load Tramp file name handler, and perform OPERATION." (tramp-unload-file-name-handlers) (when tramp-mode (let ((default-directory temporary-file-directory)) (when (bound-and-true-p tramp-archive-autoload) (load "tramp-archive" 'noerror 'nomessage)) (load "tramp" 'noerror 'nomessage))) (apply operation args))
(defun tramp-register-autoload-file-name-handlers nil "\
Add Tramp file name handlers to `file-name-handler-alist' during autoload." (add-to-list 'file-name-handler-alist (cons tramp-autoload-file-name-regexp 'tramp-autoload-file-name-handler)) (put #'tramp-autoload-file-name-handler 'safe-magic t))
Add Tramp file name handlers to `file-name-handler-alist' during autoload." (add-to-list 'file-name-handler-alist (cons tramp-autoload-file-name-regexp #'tramp-autoload-file-name-handler)) (put #'tramp-autoload-file-name-handler 'safe-magic t))
(tramp-register-autoload-file-name-handlers)
(defun tramp-unload-file-name-handlers nil "\
@ -34177,7 +34303,8 @@ It must be supported by libarchive(3).")
(defmacro tramp-archive-autoload-file-name-regexp nil "\
Regular expression matching archive file names." '(concat "\\`" "\\(" ".+" "\\." (regexp-opt tramp-archive-suffixes) "\\(?:" "\\." (regexp-opt tramp-archive-compression-suffixes) "\\)*" "\\)" "\\(" "/" ".*" "\\)" "\\'"))
(defalias 'tramp-archive-autoload-file-name-handler #'tramp-autoload-file-name-handler)
(defun tramp-archive-autoload-file-name-handler (operation &rest args) "\
Load Tramp archive file name handler, and perform OPERATION." (when tramp-archive-enabled (let ((default-directory temporary-file-directory) (tramp-archive-autoload t)) tramp-archive-autoload (apply #'tramp-autoload-file-name-handler operation args))))
(defun tramp-register-archive-file-name-handler nil "\
Add archive file name handler to `file-name-handler-alist'." (when tramp-archive-enabled (add-to-list 'file-name-handler-alist (cons (tramp-archive-autoload-file-name-regexp) #'tramp-archive-autoload-file-name-handler)) (put #'tramp-archive-autoload-file-name-handler 'safe-magic t)))

View File

@ -279,13 +279,17 @@ system, including many technical ones. Examples:
("\\Vdash" ?⊩)
("\\Vert" ?‖)
("\\Vvdash" ?⊪)
("\\above" ?┴)
("\\aleph" ?ℵ)
("\\amalg" ?∐)
("\\angle" ?∠)
("\\aoint" ?∳)
("\\approx" ?≈)
("\\approxeq" ?≊)
("\\asmash" ?⬆)
("\\ast" ?)
("\\asymp" ?≍)
("\\atop" )
("\\backcong" ?≌)
("\\backepsilon" ?∍)
("\\backprime" ?)
@ -294,11 +298,18 @@ system, including many technical ones. Examples:
("\\backslash" ?\\)
("\\barwedge" ?⊼)
("\\because" ?∵)
("\\begin" ?\〖)
("\\below" ?┬)
("\\beth" ?ℶ)
("\\between" ?≬)
("\\bigcap" ?⋂)
("\\bigcirc" ?◯)
("\\bigcup" ?)
("\\bigodot" ?⨀)
("\\bigoplus" ?⨁)
("\\bigotimes" ?⨂)
("\\bigsqcup" ?⨆)
("\\biguplus" ?⨄)
("\\bigstar" ?★)
("\\bigtriangledown" ?▽)
("\\bigtriangleup" ?△)
@ -315,6 +326,7 @@ system, including many technical ones. Examples:
("\\boxminus" ?⊟)
("\\boxplus" ?⊞)
("\\boxtimes" ?⊠)
("\\bra" ?\⟨)
("\\bullet" ?•)
("\\bumpeq" ?≏)
("\\cap" ?∩)
@ -331,7 +343,9 @@ system, including many technical ones. Examples:
("\\circledast" ?⊛)
("\\circledcirc" ?⊚)
("\\circleddash" ?⊝)
("\\close" ?┤)
("\\clubsuit" ?♣)
("\\coint" ?∲)
("\\coloneq" ?≔)
("\\complement" ?∁)
("\\cong" ?≅)
@ -349,8 +363,12 @@ system, including many technical ones. Examples:
("\\dagger" ?†)
("\\daleth" ?ℸ)
("\\dashv" ?⊣)
("\\Dd" ?)
("\\dd" ?)
("\\ddag" ?‡)
("\\ddagger" ?‡)
("\\ddddot" ?⃜)
("\\dddot" ?⃛)
("\\ddots" ?⋱)
("\\diamond" ?⋄)
("\\diamondsuit" ?♢)
@ -363,8 +381,12 @@ system, including many technical ones. Examples:
("\\downdownarrows" ?⇊)
("\\downleftharpoon" ?⇃)
("\\downrightharpoon" ?⇂)
("\\dsmash" ?⬇)
("\\ee" ?)
("\\ell" ?)
("\\emptyset" ?∅)
("\\end" ?\〗)
("\\eqarray" ?█)
("\\eqcirc" ?≖)
("\\eqcolon" ?≕)
("\\eqslantgtr" ?⋝)
@ -414,16 +436,25 @@ system, including many technical ones. Examples:
("\\heartsuit" ?♥)
("\\hookleftarrow" ?↩)
("\\hookrightarrow" ?↪)
("\\hphantom" ?⬄)
("\\hsmash" ?⬌)
("\\iff" ?⇔)
("\\ii" ?)
("\\iiiint" ?⨌)
("\\iiint" ?∭)
("\\iint" ?∬)
("\\imath" ?ı)
("\\in" ?∈)
("\\infty" ?∞)
("\\int" ?∫)
("\\intercal" ?⊺)
("\\jj" ?)
("\\jmath" )
("\\langle" ?⟨) ;; Was ?〈, see bug#12948.
("\\lbrace" ?{)
("\\lbrack" ?\[)
("\\lceil" ?⌈)
("\\ldiv" ?)
("\\ldots" ?…)
("\\le" ?≤)
("\\leadsto" ?↝)
@ -529,16 +560,25 @@ system, including many technical ones. Examples:
("\\nvdash" ?⊬)
("\\nwarrow" ?↖)
("\\odot" ?⊙)
("\\oiiint" ?∰)
("\\oiint" ?∯)
("\\oint" ?∮)
("\\ominus" ?⊖)
("\\oplus" ?⊕)
("\\oslash" ?⊘)
("\\otimes" ?⊗)
("\\overbrace" ?⏞)
("\\overparen" ?⏜)
("\\par" ?)
("\\parallel" ?∥)
("\\partial" ?∂)
("\\perp" ?⊥)
("\\phantom" ?⟡)
("\\pitchfork" ?⋔)
("\\pppprime" ?⁗)
("\\ppprime" ?‴)
("\\pprime" ?″)
("\\prcue" ?≼)
("\\prec" ?≺)
("\\precapprox" ?≾)
("\\preceq" ?≼)
@ -548,12 +588,16 @@ system, including many technical ones. Examples:
("\\prime" ?)
("\\prod" ?∏)
("\\propto" ?∝)
("\\qdrt" ?∜)
("\\qed" ?∎)
("\\quad" ?)
("\\rangle" ?\⟩) ;; Was ?〉, see bug#12948.
("\\ratio" ?)
("\\rbrace" ?})
("\\rbrack" ?\])
("\\rceil" ?⌉)
("\\rddots" ?⋰)
("\\rect" ?▭)
("\\rfloor" ?⌋)
("\\rightarrow" ?→)
("\\rightarrowtail" ?↣)
@ -565,6 +609,8 @@ system, including many technical ones. Examples:
("\\rightrightarrows" ?⇉)
("\\rightthreetimes" ?⋌)
("\\risingdotseq" ?≓)
("\\rrect" ?▢)
("\\sdiv" ?)
("\\rtimes" ?⋊)
("\\sbs" ?)
("\\searrow" ?↘)
@ -577,6 +623,7 @@ system, including many technical ones. Examples:
("\\smallamalg" ?∐)
("\\smallsetminus" ?)
("\\smallsmile" ?⌣)
("\\smash" ?⬍)
("\\smile" ?⌣)
("\\spadesuit" ?♠)
("\\sphericalangle" ?∢)
@ -627,12 +674,16 @@ system, including many technical ones. Examples:
("\\ulcorner" ?⌜)
("\\uparrow" ?↑)
("\\updownarrow" ?↕)
("\\underbar" ?▁)
("\\underbrace" ?⏟)
("\\underparen" ?⏝)
("\\upleftharpoon" ?↿)
("\\uplus" ?⊎)
("\\uprightharpoon" ?↾)
("\\upuparrows" ?⇈)
("\\urcorner" ?⌝)
("\\u{i}" )
("\\vbar" ?│)
("\\vDash" ?⊨)
((lambda (name char)
@ -655,6 +706,7 @@ system, including many technical ones. Examples:
("\\vee" ?)
("\\veebar" ?⊻)
("\\vert" ?|)
("\\vphantom" ?⇳)
("\\wedge" ?∧)
("\\wp" ?℘)
("\\wr" ?≀)

View File

@ -2241,6 +2241,7 @@ Buffers menu is regenerated."
"String to display in buffer listings for buffers not visiting a file.")
(defun menu-bar-select-buffer ()
(declare (obsolete nil "28.1"))
(interactive)
(switch-to-buffer last-command-event))

View File

@ -738,8 +738,11 @@ is described by the variable `mh-variants'."
;; Make a unique list of directories, keeping the given order.
;; We don't want the same MH variant to be listed multiple times.
(cl-loop for dir in (append mh-path mh-sys-path exec-path) do
(setq dir (file-chase-links (directory-file-name dir)))
(cl-pushnew dir list-unique :test #'equal))
;; skip relative dirs, typically "."
(if (file-name-absolute-p dir)
(progn
(setq dir (file-chase-links (directory-file-name dir)))
(cl-pushnew dir list-unique :test #'equal))))
(cl-loop for dir in (nreverse list-unique) do
(when (and dir (file-accessible-directory-p dir))
(let ((variant (mh-variant-info dir)))

View File

@ -741,14 +741,16 @@ If ARGS are provided, then pass MESSAGE through `format-message'."
;; Don't overwrite the face properties the caller has set
(text-properties-at 0 message))
(setq message (apply #'propertize message minibuffer-message-properties)))
(let ((ol (make-overlay (point-max) (point-max) nil t t))
;; A quit during sit-for normally only interrupts the sit-for,
;; but since minibuffer-message is used at the end of a command,
;; at a time when the command has virtually finished already, a C-g
;; should really cause an abort-recursive-edit instead (i.e. as if
;; the C-g had been typed at top-level). Binding inhibit-quit here
;; is an attempt to get that behavior.
(inhibit-quit t))
;; Put overlay either on `minibuffer-message' property, or at EOB.
(let* ((ovpos (minibuffer--message-overlay-pos))
(ol (make-overlay ovpos ovpos nil t t))
;; A quit during sit-for normally only interrupts the sit-for,
;; but since minibuffer-message is used at the end of a command,
;; at a time when the command has virtually finished already, a C-g
;; should really cause an abort-recursive-edit instead (i.e. as if
;; the C-g had been typed at top-level). Binding inhibit-quit here
;; is an attempt to get that behavior.
(inhibit-quit t))
(unwind-protect
(progn
(unless (zerop (length message))
@ -757,6 +759,12 @@ If ARGS are provided, then pass MESSAGE through `format-message'."
;; before or after the string, so let's spoon-feed it the pos.
(put-text-property 0 1 'cursor t message))
(overlay-put ol 'after-string message)
;; Make sure the overlay with the message is displayed before
;; any other overlays in that position, in case they have
;; resize-mini-windows set to nil and the other overlay strings
;; are too long for the mini-window width. This makes sure the
;; temporary message will always be visible.
(overlay-put ol 'priority 1100)
(sit-for (or minibuffer-message-timeout 1000000)))
(delete-overlay ol)))))
@ -778,8 +786,10 @@ and `clear-minibuffer-message' called automatically via
(defvar minibuffer-message-overlay nil)
(defun minibuffer--message-overlay-pos ()
"Return position where `set-minibuffer-message' shall put message overlay."
;; Starting from point, look for non-nil 'minibuffer-message'
"Return position where minibuffer message functions shall put message overlay.
The minibuffer message functions include `minibuffer-message' and
`set-minibuffer-message'."
;; Starting from point, look for non-nil `minibuffer-message'
;; property, and return its position. If none found, return the EOB
;; position.
(let* ((pt (point))
@ -824,7 +834,7 @@ via `set-message-function'."
;; The current C cursor code doesn't know to use the overlay's
;; marker's stickiness to figure out whether to place the cursor
;; before or after the string, so let's spoon-feed it the pos.
(put-text-property 0 1 'cursor 1 message))
(put-text-property 0 1 'cursor t message))
(overlay-put minibuffer-message-overlay 'after-string message)
;; Make sure the overlay with the message is displayed before
;; any other overlays in that position, in case they have
@ -3484,7 +3494,8 @@ between 0 and 1, and with faces `completions-common-part',
(when completions
(let* ((re (completion-pcm--pattern->regex pattern 'group))
(point-idx (completion-pcm--pattern-point-idx pattern))
(case-fold-search completion-ignore-case))
(case-fold-search completion-ignore-case)
last-md)
(mapcar
(lambda (str)
;; Don't modify the string itself.
@ -3493,7 +3504,7 @@ between 0 and 1, and with faces `completions-common-part',
(error "Internal error: %s does not match %s" re str))
(let* ((pos (if point-idx (match-beginning point-idx) (match-end 0)))
(match-end (match-end 0))
(md (cddr (match-data)))
(md (cddr (setq last-md (match-data t last-md))))
(from 0)
(end (length str))
;; To understand how this works, consider these simple

View File

@ -125,14 +125,13 @@
(unless (member elem seen) (push elem res)))))
(nreverse res)))
(defun mpc-intersection (l1 l2 &optional selectfun)
(defun mpc-intersection (l1 l2 selectfun)
"Return L1 after removing all elements not found in L2.
If SELECTFUN is non-nil, elements aren't compared directly, but instead
Elements aren't compared directly, but instead
they are passed through SELECTFUN before comparison."
(when selectfun
(setq l1 (mapcar selectfun l1))
(setq l2 (mapcar selectfun l2)))
(seq-intersection l1 l2))
(seq-intersection l1 l2 (lambda (x y)
(equal (funcall selectfun x)
(funcall selectfun y)))))
(defun mpc-event-set-point (event)
(condition-case nil (posn-set-point (event-end event))
@ -1027,10 +1026,14 @@ If PLAYLIST is t or nil or missing, use the main playlist."
(let ((dir (file-name-directory (cdr (assq 'file info)))))
;; (debug)
(setq pred
(lambda (info)
(and (funcall pred info)
(equal dir (file-name-directory
(cdr (assq 'file info)))))))
;; We want the closure to capture the current
;; value of `pred' and not a reference to the
;; variable itself.
(let ((oldpred pred))
(lambda (info)
(and (funcall oldpred info)
(equal dir (file-name-directory
(cdr (assq 'file info))))))))
(if-let* ((covers '(".folder.png" "cover.jpg" "folder.jpg"))
(cover (cl-loop for file in (directory-files (mpc-file-local-copy dir))
if (member (downcase file) covers)
@ -1057,9 +1060,13 @@ If PLAYLIST is t or nil or missing, use the main playlist."
(when (and (null val) (eq tag 'Title))
(setq val (cdr (assq 'file info))))
(setq pred
(lambda (info)
(and (funcall pred info)
(equal val (cdr (assq ',tag info))))))
;; We want the closure to capture the current
;; value of `pred' and not a reference to the
;; variable itself.
(let ((oldpred pred))
(lambda (info)
(and (funcall oldpred info)
(equal val (cdr (assq tag info)))))))
(cond
((not (and (eq tag 'Date) (stringp val))) val)
;; For "date", only keep the year!

View File

@ -1052,9 +1052,12 @@ variable `msb-menu-cond'."
(msb--split-menus-2 list 0 nil)
list))
(defun msb--select-buffer ()
(interactive)
(switch-to-buffer last-command-event))
(defun msb--make-keymap-menu (raw-menu)
(let ((end 'menu-bar-select-buffer)
(mcount 0))
(let ((mcount 0))
(mapcar
(lambda (sub-menu)
(cond
@ -1063,7 +1066,7 @@ variable `msb-menu-cond'."
(t
(let ((buffers (mapcar (lambda (item)
(cons (buffer-name (cdr item))
(cons (car item) end)))
(cons (car item) 'msb--select-buffer)))
(cdr sub-menu))))
(nconc (list (cl-incf mcount) (car sub-menu)
'keymap (car sub-menu))

View File

@ -47,6 +47,7 @@
;; browse-url-xdg-open freedesktop.org xdg-open
;; browse-url-kde KDE konqueror (kfm)
;; browse-url-elinks Elinks Don't know (tried with 0.12.GIT)
;; eww-browse-url Emacs Web Wowser
;; Browsers can cache Web pages so it may be necessary to tell them to
;; reload the current page if it has changed (e.g., if you have edited
@ -758,7 +759,7 @@ for use in `interactive'."
;;;###autoload
(defun browse-url-of-file (&optional file)
"Ask a WWW browser to display FILE.
"Use a web browser to display FILE.
Display the current buffer's file if FILE is nil or if called
interactively. Turn the filename into a URL with function
`browse-url-file-url'. Pass the URL to a browser using the
@ -773,6 +774,8 @@ interactively. Turn the filename into a URL with function
(cond ((not (buffer-modified-p)))
(browse-url-save-file (save-buffer))
(t (message "%s modified since last save" file))))))
(when (file-remote-p file)
(setq file (file-local-copy file)))
(browse-url (browse-url-file-url file))
(run-hooks 'browse-url-of-file-hook))
@ -793,7 +796,9 @@ Use variable `browse-url-filename-alist' to map filenames to URLs."
;;;###autoload
(defun browse-url-of-buffer (&optional buffer)
"Ask a WWW browser to display BUFFER.
"Use a web browser to display BUFFER.
See `browse-url' for details.
Display the current buffer if BUFFER is nil. Display only the
currently visible part of BUFFER (from a temporary file) if buffer is
narrowed."
@ -842,7 +847,8 @@ If optional arg TEMP-FILE-NAME is non-nil, delete it instead."
;;;###autoload
(defun browse-url-of-region (min max)
"Ask a WWW browser to display the current region."
"Use a web browser to display the current region.
See `browse-url' for details."
(interactive "r")
(save-excursion
(save-restriction
@ -856,14 +862,18 @@ If optional arg TEMP-FILE-NAME is non-nil, delete it instead."
;;;###autoload
(defun browse-url (url &rest args)
"Ask a WWW browser to load URL.
Prompt for a URL, defaulting to the URL at or before point.
Invokes a suitable browser function which does the actual job.
"Open URL using a configurable method.
This will typically (by default) open URL with an external web
browser, but a wide variety of different methods can be used,
depending on the URL type.
The variables `browse-url-browser-function',
`browse-url-handlers', and `browse-url-default-handlers'
determine which browser function to use.
This command prompts for a URL, defaulting to the URL at or
before point.
The additional ARGS are passed to the browser function. See the
doc strings of the actual functions, starting with
`browse-url-browser-function', for information about the
@ -904,8 +914,8 @@ If ARGS are omitted, the default is to pass
;;;###autoload
(defun browse-url-at-point (&optional arg)
"Ask a WWW browser to load the URL at or before point.
Variable `browse-url-browser-function' says which browser to use.
"Open URL at point using a configurable method.
See `browse-url' for details.
Optional prefix argument ARG non-nil inverts the value of the option
`browse-url-new-window-flag'."
(interactive "P")
@ -946,10 +956,11 @@ opposite of the browser kind of `browse-url-browser-function'."
;;;###autoload
(defun browse-url-at-mouse (event)
"Ask a WWW browser to load a URL clicked with the mouse.
The URL is the one around or before the position of the mouse click
but point is not changed. Variable `browse-url-browser-function'
says which browser to use."
"Use a web browser to load a URL clicked with the mouse.
See `browse-url' for details.
The URL is the one around or before the position of the mouse
click but point is not changed."
(interactive "e")
(save-excursion
(mouse-set-point event)
@ -1791,6 +1802,7 @@ external browser instead of the default one."
(funcall browse-url-secondary-browser-function url)
(browse-url url))))
;;;###autoload
(defun browse-url-button-open-url (url)
"Open URL using `browse-url'.
If `current-prefix-arg' is non-nil, use

View File

@ -1156,6 +1156,29 @@ current buffer after passing its contents to the shell command."
(mailcap--async-shell method file))
(funcall method))))
(defun mailcap-view-file (file)
"View FILE according to rules given by the mailcap system.
This normally involves executing some external program to display
the file.
See \"~/.mailcap\", `mailcap-mime-data' and related files and variables."
(interactive "fOpen file with mailcap: ")
(setq file (expand-file-name file))
(mailcap-parse-mailcaps)
(let ((command (mailcap-mime-info
(mailcap-extension-to-mime (file-name-extension file)))))
(unless command
(error "No viewer for %s" (file-name-extension file)))
;; Remove quotes around the file name - we'll use shell-quote-argument.
(while (string-match "['\"]%s['\"]" command)
(setq command (replace-match "%s" t t command)))
(setq command (replace-regexp-in-string
"%s"
(shell-quote-argument (convert-standard-filename file))
command
nil t))
(start-process-shell-command command nil command)))
(provide 'mailcap)
;;; mailcap.el ends here

View File

@ -2502,7 +2502,8 @@ If ARG is given, opens the URL in a new browser window."
'follow-link t
'rcirc-url url
'action (lambda (button)
(browse-url (button-get button 'rcirc-url))))
(browse-url-button-open-url
(button-get button 'rcirc-url))))
;; Record the URL if it is not already the latest stored URL.
(unless (string= url (caar rcirc-urls))
(push (cons url start) rcirc-urls)))))

View File

@ -2048,7 +2048,7 @@ function is meant for debugging purposes."
(put #'tramp-backtrace 'tramp-suppress-trace t)
(defsubst tramp-error (vec-or-proc signal fmt-string &rest arguments)
(defun tramp-error (vec-or-proc signal fmt-string &rest arguments)
"Emit an error.
VEC-OR-PROC identifies the connection to use, SIGNAL is the
signal identifier to be raised, remaining arguments passed to

View File

@ -1808,7 +1808,7 @@ argument is passed to `next-file', which see)."
(defun tags-search (regexp &optional files)
"Search through all files listed in tags table for match for REGEXP.
Stops when a match is found.
To continue searching for next match, use command \\[tags-loop-continue].
To continue searching for next match, use the command \\[fileloop-continue].
If FILES if non-nil should be a list or an iterator returning the
files to search. The search will be restricted to these files.
@ -1834,7 +1834,7 @@ Also see the documentation of the `tags-file-name' variable."
"Do `query-replace-regexp' of FROM with TO on all files listed in tags table.
Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
with the command \\[tags-loop-continue].
with the command \\[fileloop-continue].
For non-interactive use, superseded by `fileloop-initialize-replace'."
(declare (advertised-calling-convention (from to &optional delimited) "27.1"))
(interactive (query-replace-read-args "Tags query replace (regexp)" t t))

View File

@ -650,74 +650,6 @@ Used in the Fortran entry in `hs-special-modes-alist'.")
(define-key map "7" 'fortran-electric-line-number)
(define-key map "8" 'fortran-electric-line-number)
(define-key map "9" 'fortran-electric-line-number)
(easy-menu-define fortran-menu map "Menu for Fortran mode."
`("Fortran"
["Manual" (info "(emacs)Fortran") :active t
:help "Read the Emacs manual chapter on Fortran mode"]
("Customization"
,(custom-menu-create 'fortran)
;; FIXME useless?
["Set" Custom-set :active t
:help "Set current value of all edited settings in the buffer"]
["Save" Custom-save :active t
:help "Set and save all edited settings"]
["Reset to Current" Custom-reset-current :active t
:help "Reset all edited settings to current"]
["Reset to Saved" Custom-reset-saved :active t
:help "Reset all edited or set settings to saved"]
["Reset to Standard Settings" Custom-reset-standard :active t
:help "Erase all customizations in buffer"]
)
"--"
["Comment Region" fortran-comment-region mark-active]
["Uncomment Region"
(fortran-comment-region (region-beginning) (region-end) 1)
mark-active]
["Indent Region" indent-region mark-active]
["Indent Subprogram" fortran-indent-subprogram t]
"--"
["Beginning of Subprogram" fortran-beginning-of-subprogram :active t
:help "Move point to the start of the current subprogram"]
["End of Subprogram" fortran-end-of-subprogram :active t
:help "Move point to the end of the current subprogram"]
("Mark"
:help "Mark a region of code"
["Subprogram" mark-defun t]
["IF Block" fortran-mark-if t]
["DO Block" fortran-mark-do t]
)
["Narrow to Subprogram" narrow-to-defun t]
["Widen" widen t]
"--"
["Temporary Column Ruler" fortran-column-ruler :active t
:help "Briefly display Fortran column numbers"]
;; May not be '72', depending on fortran-line-length, but this
;; seems ok for a menu item.
["72-column Window" fortran-window-create :active t
:help "Set window width to Fortran line length"]
["Full Width Window"
(enlarge-window-horizontally (- (frame-width) (window-width)))
:active (not (window-full-width-p))
:help "Make window full width"]
["Momentary 72-Column Window" fortran-window-create-momentarily
:active t :help "Briefly set window width to Fortran line length"]
"--"
["Break Line at Point" fortran-split-line :active t
:help "Break the current line at point"]
["Join Line" fortran-join-line :active t
:help "Join the current line to the previous one"]
["Fill Statement/Comment" fill-paragraph t]
"--"
["Toggle Auto Fill" auto-fill-mode :selected auto-fill-function
:style toggle
:help "Automatically fill text while typing in this buffer"]
["Toggle Abbrev Mode" abbrev-mode :selected abbrev-mode
:style toggle :help "Expand abbreviations while typing in this buffer"]
["Add Imenu Menu" imenu-add-menubar-index
:active (not (lookup-key (current-local-map) [menu-bar index]))
:included (fboundp 'imenu-add-to-menubar)
:help "Add an index menu to the menu-bar"]))
map)
"Keymap used in Fortran mode.")
@ -2209,6 +2141,81 @@ arg DO-SPACE prevents stripping the whitespace."
(point)))))
"main"))))
;; The menu is defined at the end because `custom-menu-create' is
;; called at load time and will result in (recursively) loading this
;; file otherwise.
(easy-menu-define fortran-menu fortran-mode-map "Menu for Fortran mode."
`("Fortran"
["Manual" (info "(emacs)Fortran") :active t
:help "Read the Emacs manual chapter on Fortran mode"]
("Customization"
,(progn
;; Tell the byte compiler that `features' is lexical.
(with-no-warnings (defvar features))
(let ((features (cons 'fortran features)))
(custom-menu-create 'fortran)))
;; FIXME useless?
["Set" Custom-set :active t
:help "Set current value of all edited settings in the buffer"]
["Save" Custom-save :active t
:help "Set and save all edited settings"]
["Reset to Current" Custom-reset-current :active t
:help "Reset all edited settings to current"]
["Reset to Saved" Custom-reset-saved :active t
:help "Reset all edited or set settings to saved"]
["Reset to Standard Settings" Custom-reset-standard :active t
:help "Erase all customizations in buffer"]
)
"--"
["Comment Region" fortran-comment-region mark-active]
["Uncomment Region"
(fortran-comment-region (region-beginning) (region-end) 1)
mark-active]
["Indent Region" indent-region mark-active]
["Indent Subprogram" fortran-indent-subprogram t]
"--"
["Beginning of Subprogram" fortran-beginning-of-subprogram :active t
:help "Move point to the start of the current subprogram"]
["End of Subprogram" fortran-end-of-subprogram :active t
:help "Move point to the end of the current subprogram"]
("Mark"
:help "Mark a region of code"
["Subprogram" mark-defun t]
["IF Block" fortran-mark-if t]
["DO Block" fortran-mark-do t]
)
["Narrow to Subprogram" narrow-to-defun t]
["Widen" widen t]
"--"
["Temporary Column Ruler" fortran-column-ruler :active t
:help "Briefly display Fortran column numbers"]
;; May not be '72', depending on fortran-line-length, but this
;; seems ok for a menu item.
["72-column Window" fortran-window-create :active t
:help "Set window width to Fortran line length"]
["Full Width Window"
(enlarge-window-horizontally (- (frame-width) (window-width)))
:active (not (window-full-width-p))
:help "Make window full width"]
["Momentary 72-Column Window" fortran-window-create-momentarily
:active t :help "Briefly set window width to Fortran line length"]
"--"
["Break Line at Point" fortran-split-line :active t
:help "Break the current line at point"]
["Join Line" fortran-join-line :active t
:help "Join the current line to the previous one"]
["Fill Statement/Comment" fill-paragraph t]
"--"
["Toggle Auto Fill" auto-fill-mode :selected auto-fill-function
:style toggle
:help "Automatically fill text while typing in this buffer"]
["Toggle Abbrev Mode" abbrev-mode :selected abbrev-mode
:style toggle :help "Expand abbreviations while typing in this buffer"]
["Add Imenu Menu" imenu-add-menubar-index
:active (not (lookup-key (current-local-map) [menu-bar index]))
:included (fboundp 'imenu-add-to-menubar)
:help "Add an index menu to the menu-bar"]))
(provide 'fortran)
;;; fortran.el ends here

View File

@ -473,7 +473,7 @@ buffer `default-directory'."
(1 (if (eq (char-after (match-beginning 1)) ?\0)
`(face nil display ,(match-string 2)))))
;; Hide excessive part of rgrep command
("^find \\(\\. -type d .*\\(?:\\\\)\\|\")\"\\)\\)"
("^find \\(\\(?:-H \\)?\\. -type d .*\\(?:\\\\)\\|\")\"\\)\\)"
(1 (if grep-find-abbreviate grep-find-abbreviate-properties
'(face nil abbreviated-command t))))
;; Hide excessive part of lgrep command
@ -774,25 +774,24 @@ The value depends on `grep-command', `grep-template',
(let ((gcmd (format "%s <C> %s <R>"
grep-program grep-options))
(null (if grep-use-null-device
(format "%s " (null-device))
"")))
(cond ((eq grep-find-use-xargs 'gnu)
(format "%s <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
find-program xargs-program gcmd))
((eq grep-find-use-xargs 'gnu-sort)
(format "%s <D> <X> -type f <F> -print0 | sort -z | \"%s\" -0 %s"
find-program xargs-program gcmd))
((eq grep-find-use-xargs 'exec)
(format "%s <D> <X> -type f <F> -exec %s %s %s%s"
find-program gcmd quot-braces null quot-scolon))
((eq grep-find-use-xargs 'exec-plus)
(format "%s <D> <X> -type f <F> -exec %s %s%s +"
find-program gcmd null quot-braces))
(t
(format "%s <D> <X> -type f <F> -print | \"%s\" %s"
find-program xargs-program gcmd))))))))
;; Save defaults for this host.
(format "%s " (null-device))
"")))
(cond ((eq grep-find-use-xargs 'gnu)
(format "%s -H <D> <X> -type f <F> -print0 | \"%s\" -0 %s"
find-program xargs-program gcmd))
((eq grep-find-use-xargs 'gnu-sort)
(format "%s -H <D> <X> -type f <F> -print0 | sort -z | \"%s\" -0 %s"
find-program xargs-program gcmd))
((eq grep-find-use-xargs 'exec)
(format "%s -H <D> <X> -type f <F> -exec %s %s %s%s"
find-program gcmd quot-braces null quot-scolon))
((eq grep-find-use-xargs 'exec-plus)
(format "%s -H <D> <X> -type f <F> -exec %s %s%s +"
find-program gcmd null quot-braces))
(t
(format "%s -H <D> <X> -type f <F> -print | \"%s\" %s"
find-program xargs-program gcmd))))))))
;; Save defaults for this host.
(setq grep-host-defaults-alist
(delete (assq host-id grep-host-defaults-alist)
grep-host-defaults-alist))

File diff suppressed because it is too large Load Diff

View File

@ -461,7 +461,7 @@ Non-nil means always go to the next Octave code line after sending."
;; For (invalid) code between switch and case.
;; (if (smie-rule-parent-p "switch") 4)
nil))
('(:after . "=") octave-block-offset)))
('(:after . "=") (smie-rule-parent octave-block-offset))))
(defun octave-indent-comment ()
"A function for `smie-indent-functions' (which see)."

View File

@ -285,7 +285,7 @@
(put-text-property (match-beginning 2) (match-end 2)
'syntax-table (string-to-syntax "\""))
(perl-syntax-propertize-special-constructs end)))))
("\\(^\\|[?:.,;=!~({[ \t]\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\s-*\\(?:\\([^])}>= \n\t]\\)\\|\\(?3:=\\)[^>]\\)"
("\\(^\\|[?:.,;=|&!~({[ \t]\\|=>\\)\\([msy]\\|q[qxrw]?\\|tr\\)\\>\\(?:\\s-\\|\n\\)*\\(?:\\([^])}>= \n\t]\\)\\|\\(?3:=\\)[^>]\\)"
;; Nasty cases:
;; /foo/m $a->m $#m $m @m %m
;; \s (appears often in regexps).

View File

@ -1464,7 +1464,7 @@ IGNORES is a list of glob patterns for files to ignore."
;; do that reliably enough, without creating false negatives?
(command (xref--rgrep-command (xref--regexp-to-extended regexp)
files
(file-name-as-directory
(directory-file-name
(file-name-unquote
(file-local-name (expand-file-name dir))))
ignores))

View File

@ -1608,7 +1608,9 @@ prevent a backup for it.) The variable `server-temp-file-regexp' controls
which filenames are considered temporary.
If invoked with a prefix argument, or if there is no server process running,
starts server process and that is all. Invoked by \\[server-edit]."
starts server process and that is all. Invoked by \\[server-edit].
To abort an edit instead of saying \"Done\", use \\[server-edit-abort]."
(interactive "P")
(cond
((or arg
@ -1618,6 +1620,17 @@ starts server process and that is all. Invoked by \\[server-edit]."
(server-clients (apply #'server-switch-buffer (server-done)))
(t (message "No server editing buffers exist"))))
(defun server-edit-abort ()
"Abort editing the current client buffer."
(interactive)
(if server-clients
(mapc (lambda (proc)
(server-send-string
proc (concat "-error "
(server-quote-arg "Aborted by the user"))))
server-clients)
(message "This buffer has no clients")))
(defun server-switch-buffer (&optional next-buffer killed-one filepos
this-frame-only)
"Switch to another buffer, preferably one that has a client.

View File

@ -321,6 +321,15 @@ Thus, this does not include the shell's current directory.")
(defvar shell-dirstack-query nil
"Command used by `shell-resync-dirs' to query the shell.")
(defcustom shell-has-auto-cd nil
"If non-nil, `shell-mode' handles implicit \"cd\" commands.
Implicit \"cd\" is changing the directory if the command is a directory.
You can make this variable buffer-local to change it, per shell-mode instance.
Useful for shells like zsh that has this feature."
:type 'boolean
:group 'shell-directories
:version "28.1")
(defvar shell-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-f" 'shell-forward-command)
@ -836,13 +845,15 @@ Environment variables are expanded, see function `substitute-in-file-name'."
str) ; skip whitespace
(match-end 0)))
(case-fold-search)
end cmd arg1)
end cmd arg1 cmd-subst-fn)
(while (string-match shell-command-regexp str start)
(setq end (match-end 0)
cmd (comint-arguments (substring str start end) 0 0)
arg1 (comint-arguments (substring str start end) 1 1))
(if arg1
(setq arg1 (shell-unquote-argument arg1)))
(if shell-has-auto-cd
(setq cmd-subst-fn (comint-substitute-in-file-name cmd)))
(cond ((string-match (concat "\\`\\(" shell-popd-regexp
"\\)\\($\\|[ \t]\\)")
cmd)
@ -859,7 +870,9 @@ Environment variables are expanded, see function `substitute-in-file-name'."
(string-match (concat "\\`\\(" shell-chdrive-regexp
"\\)\\($\\|[ \t]\\)")
cmd))
(shell-process-cd (comint-substitute-in-file-name cmd))))
(shell-process-cd (comint-substitute-in-file-name cmd)))
((and shell-has-auto-cd (file-directory-p cmd-subst-fn))
(shell-process-cd cmd-subst-fn)))
(setq start (progn (string-match shell-command-separator-regexp
str end)
;; skip again

View File

@ -4217,12 +4217,22 @@ impose the use of a shell (with its need to quote arguments)."
(shell-command-on-region (point) (point) command
output-buffer nil error-buffer)))))))
(defun max-mini-window-lines (&optional frame)
"Compute maximum number of lines for echo area in FRAME.
As defined by `max-mini-window-height'. FRAME defaults to the
selected frame. Result may be a floating-point number,
i.e. include a fractional number of lines."
(cond ((floatp max-mini-window-height) (* (frame-height frame)
max-mini-window-height))
((integerp max-mini-window-height) max-mini-window-height)
(t 1)))
(defun display-message-or-buffer (message &optional buffer-name action frame)
"Display MESSAGE in the echo area if possible, otherwise in a pop-up buffer.
MESSAGE may be either a string or a buffer.
A pop-up buffer is displayed using `display-buffer' if MESSAGE is too long
for maximum height of the echo area, as defined by `max-mini-window-height'
for maximum height of the echo area, as defined by `max-mini-window-lines'
if `resize-mini-windows' is non-nil.
Returns either the string shown in the echo area, or when a pop-up
@ -4261,14 +4271,7 @@ and are used only if a pop-up buffer is displayed."
(cond ((= lines 0))
((and (or (<= lines 1)
(<= lines
(if resize-mini-windows
(cond ((floatp max-mini-window-height)
(* (frame-height)
max-mini-window-height))
((integerp max-mini-window-height)
max-mini-window-height)
(t
1))
(if resize-mini-windows (max-mini-window-lines)
1)))
;; Don't use the echo area if the output buffer is
;; already displayed in the selected frame.
@ -4334,7 +4337,7 @@ current buffer after START.
Optional fifth arg REPLACE, if non-nil, means to insert the
output in place of text from START to END, putting point and mark
around it.
around it. If REPLACE is the symbol `no-mark', don't set the mark.
Optional sixth arg ERROR-BUFFER, if non-nil, specifies a buffer
or buffer name to which to direct the command's standard error
@ -4409,7 +4412,9 @@ characters."
(let ((swap (and replace (< start end))))
;; Don't muck with mark unless REPLACE says we should.
(goto-char start)
(and replace (push-mark (point) 'nomsg))
(when (and replace
(not (eq replace 'no-mark)))
(push-mark (point) 'nomsg))
(setq exit-status
(call-shell-region start end command replace
(if error-file
@ -4420,7 +4425,9 @@ characters."
;; (and shell-buffer (not (eq shell-buffer (current-buffer)))
;; (kill-buffer shell-buffer)))
;; Don't muck with mark unless REPLACE says we should.
(and replace swap (exchange-point-and-mark)))
(when (and replace swap
(not (eq replace 'no-mark)))
(exchange-point-and-mark)))
;; No prefix argument: put the output in a temp buffer,
;; replacing its entire contents.
(let ((buffer (get-buffer-create
@ -5735,7 +5742,8 @@ PROMPT is a string to prompt with."
(complete-with-action action completions string pred)))
nil nil nil
(if history-pos
(cons 'read-from-kill-ring-history (1+ history-pos))
(cons 'read-from-kill-ring-history
(if (zerop history-pos) history-pos (1+ history-pos)))
'read-from-kill-ring-history)))))
(defcustom yank-from-kill-ring-rotate t
@ -5773,8 +5781,9 @@ When called from Lisp, insert STRING like `insert-for-yank' does."
(insert-for-yank string)
(when yank-from-kill-ring-rotate
(let ((pos (seq-position kill-ring string)))
(when pos
(setq kill-ring-yank-pointer (nthcdr pos kill-ring)))))
(if pos
(setq kill-ring-yank-pointer (nthcdr pos kill-ring))
(kill-new string))))
(if (consp arg)
;; Swap point and mark like in `yank' and `yank-pop'.
(goto-char (prog1 (mark t)

View File

@ -1648,7 +1648,8 @@ invoking the new action."
(when so-long--active
(so-long-revert))
;; Invoke the new action.
(let ((so-long--calling t))
(let ((so-long--calling t)
(view-mode-active view-mode))
(so-long--ensure-enabled)
;; ACTION takes precedence if supplied.
(when action
@ -1677,7 +1678,10 @@ invoking the new action."
;; functions need to modify the buffer. We use `inhibit-read-only' to
;; side-step the issue (and likewise in `so-long-revert').
(let ((inhibit-read-only t))
(run-hooks 'so-long-hook)))))
(run-hooks 'so-long-hook))
;; Restore `view-mode'.
(when view-mode-active
(view-mode)))))
(defun so-long-revert ()
"Revert the active `so-long-action' and run `so-long-revert-hook'.

View File

@ -195,6 +195,14 @@ buffer-local wherever it is set."
(list 'progn (list 'defvar var val docstring)
(list 'make-variable-buffer-local (list 'quote var))))
(defun buffer-local-boundp (symbol buffer)
"Return non-nil if SYMBOL is bound in BUFFER.
Also see `local-variable-p'."
(condition-case nil
(buffer-local-value symbol buffer)
(:success t)
(void-variable nil)))
(defmacro push (newelt place)
"Add NEWELT to the list stored in the generalized variable PLACE.
This is morally equivalent to (setf PLACE (cons NEWELT PLACE)),
@ -2476,7 +2484,11 @@ file name without extension.
If TYPE is nil, then any kind of definition is acceptable. If
TYPE is `defun', `defvar', or `defface', that specifies function
definition, variable definition, or face definition only.
Otherwise TYPE is assumed to be a symbol property."
Otherwise TYPE is assumed to be a symbol property.
This function only works for symbols defined in Lisp files. For
symbols that are defined in C files, use `help-C-file-name'
instead."
(if (and (or (null type) (eq type 'defun))
(symbolp symbol)
(autoloadp (symbol-function symbol)))

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