Merge remote-tracking branch 'savannah/master' into HEAD
This commit is contained in:
commit
5a8be1719a
213 changed files with 3487 additions and 1201 deletions
|
@ -77,7 +77,7 @@
|
|||
;; 2nd: function to call to get a property value,
|
||||
;; or an index number of C function to decode the value,
|
||||
;; or nil if the value can be directly got from the table.
|
||||
;; 3nd: function to call to put a property value,
|
||||
;; 3rd: function to call to put a property value,
|
||||
;; or an index number of C function to encode the value,
|
||||
;; or nil if the value can be directly stored in the table.
|
||||
;; 4th: function to call to get a description of a property value, or nil
|
||||
|
@ -1177,7 +1177,7 @@ Property value is a symbol `o' (Open), `c' (Close), or `n' (None)."
|
|||
|
||||
(defun unidata-describe-general-category (val)
|
||||
(cdr (assq val
|
||||
'((nil . "Uknown")
|
||||
'((nil . "Unknown")
|
||||
(Lu . "Letter, Uppercase")
|
||||
(Ll . "Letter, Lowercase")
|
||||
(Lt . "Letter, Titlecase")
|
||||
|
|
|
@ -725,7 +725,7 @@ case "${canonical}" in
|
|||
*-apple-darwin* )
|
||||
case "${canonical}" in
|
||||
*-apple-darwin[0-9].*) unported=yes ;;
|
||||
i[3456]86-* | x86_64-* | arm-* ) ;;
|
||||
i[3456]86-* | x86_64-* | arm-* | aarch64-* ) ;;
|
||||
* ) unported=yes ;;
|
||||
esac
|
||||
opsys=darwin
|
||||
|
|
|
@ -461,6 +461,14 @@ Normally, this command undoes the last change, moving point back to
|
|||
where it was before the change. The undo command applies only to
|
||||
changes in the buffer; you can't use it to undo cursor motion.
|
||||
|
||||
On a graphics terminal (including text-mode frames displayed by a
|
||||
terminal emulator, such as @command{xterm}), the easiest way to invoke
|
||||
@code{undo} is with @kbd{C-/}; that doesn't need the Shift key. On a
|
||||
text terminal, @kbd{C-/} does not exist, but in many cases you can type
|
||||
@kbd{C-_} without the Shift key (in effect pressing @kbd{C--}) and it
|
||||
will work anyway, at least with keyboards that produce the US ASCII
|
||||
character set.
|
||||
|
||||
Although each editing command usually makes a separate entry in the
|
||||
undo records, very simple commands may be grouped together.
|
||||
Sometimes, an entry may cover just part of a complex command.
|
||||
|
|
|
@ -697,6 +697,17 @@ forward order after the file name, as in @samp{file|top/middle}. If
|
|||
@code{uniquify-buffer-name-style} is set to @code{nil}, the buffer
|
||||
names simply get @samp{<2>}, @samp{<3>}, etc.@: appended.
|
||||
|
||||
The value of @code{uniquify-buffer-name-style} can be set to a
|
||||
customized function with two arguments @var{base} and
|
||||
@var{extra-strings} where @var{base} is a string and
|
||||
@var{extra-strings} is a list of strings. For example the current
|
||||
implementation for @code{post-forward-angle-brackets} could be:
|
||||
|
||||
@example
|
||||
(defun my-post-forward-angle-brackets (base extra-string)
|
||||
(concat base \"<\" (mapconcat #'identity extra-string \"/\") \">\"))
|
||||
@end example
|
||||
|
||||
Which rule to follow for putting the directory names in the buffer
|
||||
name is not very important if you are going to @emph{look} at the
|
||||
buffer names before you type one. But as an experienced user, if you
|
||||
|
|
|
@ -921,6 +921,7 @@ Manual}). For customizations, see the Custom group @code{time-stamp}.
|
|||
@node Reverting
|
||||
@section Reverting a Buffer
|
||||
@findex revert-buffer
|
||||
@findex revert-buffer-with-fine-grain
|
||||
@cindex drastic changes
|
||||
@cindex reread a file
|
||||
|
||||
|
@ -941,6 +942,19 @@ reverted changes as a single modification to the buffer's undo history
|
|||
aliases to bring the reverted changes back, if you happen to change
|
||||
your mind.
|
||||
|
||||
@vindex revert-buffer-with-fine-grain-max-seconds
|
||||
To revert a buffer more conservatively, you can use the command
|
||||
@code{revert-buffer-with-fine-grain}. This command acts like
|
||||
@code{revert-buffer}, but it tries to be as non-destructive as
|
||||
possible, making an effort to preserve all markers, properties and
|
||||
overlays in the buffer. Since reverting this way can be very slow
|
||||
when you have made a large number of changes, you can modify the
|
||||
variable @code{revert-buffer-with-fine-grain-max-seconds} to
|
||||
specify a maximum amount of seconds that replacing the buffer
|
||||
contents this way should take. Note that it is not ensured that the
|
||||
whole execution of @code{revert-buffer-with-fine-grain} won't take
|
||||
longer than this.
|
||||
|
||||
Some kinds of buffers that are not associated with files, such as
|
||||
Dired buffers, can also be reverted. For them, reverting means
|
||||
recalculating their contents. Buffers created explicitly with
|
||||
|
|
|
@ -573,10 +573,13 @@ command works depend on the major mode.
|
|||
|
||||
@kindex C-h l
|
||||
@findex view-lossage
|
||||
@findex lossage-size
|
||||
If something surprising happens, and you are not sure what you typed,
|
||||
use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} displays your last
|
||||
300 input keystrokes and the commands they invoked. If you see
|
||||
commands that you are not familiar with, you can use @kbd{C-h k} or
|
||||
input keystrokes and the commands they invoked. By default, Emacs
|
||||
stores the last 300 keystrokes; if you wish, you can change this number with
|
||||
the command @code{lossage-size}.
|
||||
If you see commands that you are not familiar with, you can use @kbd{C-h k} or
|
||||
@kbd{C-h f} to find out what they do.
|
||||
|
||||
@kindex C-h e
|
||||
|
|
|
@ -3028,6 +3028,11 @@ point (@code{dired-at-point}).
|
|||
@code{find-file-read-only-other-frame}.
|
||||
@item C-x 5 d @var{directory} @key{RET}
|
||||
@code{ffap-dired-other-frame}, analogous to @code{dired-other-frame}.
|
||||
@kindex C-x t C-f @r{(FFAP)}
|
||||
@item C-x t C-f @var{filename} @key{return}
|
||||
@code{ffap-other-tab}, analogous to @code{find-file-other-tab}.
|
||||
@item C-x t C-r @var{filename} @key{return}
|
||||
@code{ffap-read-only-other-tab}, analogous to @code{find-file-read-only-other-tab}.
|
||||
@item M-x ffap-next
|
||||
Search buffer for next file name or URL, then find that file or URL.
|
||||
@item S-mouse-3
|
||||
|
|
|
@ -1291,6 +1291,12 @@ ways.
|
|||
This abnormal hook holds documentation functions. It acts as a
|
||||
collection of backends for ElDoc. This is what modes should use to
|
||||
register their documentation functions with ElDoc.
|
||||
|
||||
@vindex eldoc-display-truncation-message
|
||||
@item eldoc-display-truncation-message
|
||||
If non-@code{nil} (the default), display a verbose message about how
|
||||
to view a complete documentation (if it has been truncated in the echo
|
||||
area). If @code{nil}, just mark truncated messages with @samp{...}.
|
||||
@end table
|
||||
|
||||
@node Hideshow
|
||||
|
|
|
@ -1977,6 +1977,18 @@ performs case folding and lax-whitespace matching.
|
|||
using the @code{isearch} face. This highlighting can be disabled by
|
||||
setting the variable @code{search-highlight} to @code{nil}.
|
||||
|
||||
@vindex search-highlight-submatches
|
||||
When searching for regular expressions (with @kbd{C-M-s}, for
|
||||
instance), subexpressions receive special highlighting depending on
|
||||
the @code{search-highlight-submatches} variable. If this variable's
|
||||
value is @code{nil}, no special highlighting is done, but if the value
|
||||
is non-@code{nil}, text that matches @samp{\( @dots{} \)} constructs
|
||||
(a.k.a.@: ``subexpressions'') in the regular expression will be
|
||||
highlighted with distinct faces, named @code{isearch-group-@var{n}}.
|
||||
For instance, when searching for @samp{foo-\([0-9]+\)}, the part
|
||||
matched by @samp{[0-9]+} will be highlighted with the
|
||||
@code{isearch-group-1} face.
|
||||
|
||||
@cindex lazy highlighting customizations
|
||||
@vindex isearch-lazy-highlight
|
||||
@cindex @code{lazy-highlight} face
|
||||
|
|
|
@ -596,8 +596,8 @@ and features that react to buffer modifications, use the
|
|||
Execute @var{body} pretending it does not modify the buffer. This
|
||||
includes checking whether the buffer's file is locked (@pxref{File
|
||||
Locks}), running buffer modification hooks (@pxref{Change Hooks}),
|
||||
etc. Note that if @var{body} actually modifies the buffer text, its
|
||||
undo data may become corrupted.
|
||||
etc. Note that if @var{body} actually modifies the buffer text (as
|
||||
opposed to its text properties), its undo data may become corrupted.
|
||||
@end defmac
|
||||
|
||||
@node Modification Time
|
||||
|
|
|
@ -124,6 +124,11 @@ Link to the documentation of a variable; @var{variable} is a string
|
|||
which specifies the name of the variable to describe with
|
||||
@code{describe-variable} when the user invokes this link.
|
||||
|
||||
@item (face-link @var{face})
|
||||
Link to the documentation of a face; @var{face} is a string which
|
||||
specifies the name of the face to describe with @code{describe-face}
|
||||
when the user invokes this link.
|
||||
|
||||
@item (custom-group-link @var{group})
|
||||
Link to another customization group. Invoking it creates a new
|
||||
customization buffer for @var{group}.
|
||||
|
|
|
@ -2182,21 +2182,24 @@ actual line height can never be less than the default.
|
|||
@kindex line-height @r{(text property)}
|
||||
A newline can have a @code{line-height} text or overlay property
|
||||
that controls the total height of the display line ending in that
|
||||
newline.
|
||||
newline. The property value can be one of several forms:
|
||||
|
||||
If the property value is @code{t}, the newline character has no
|
||||
@table @code
|
||||
@item t
|
||||
If the property value is @code{t}, the newline character has no
|
||||
effect on the displayed height of the line---the visible contents
|
||||
alone determine the height. The @code{line-spacing} property,
|
||||
described below, is also ignored in this case. This is useful for
|
||||
tiling small images (or image slices) without adding blank areas
|
||||
between the images.
|
||||
|
||||
If the property value is a list of the form @code{(@var{height}
|
||||
@var{total})}, that adds extra space @emph{below} the display line.
|
||||
First Emacs uses @var{height} as a height spec to control extra space
|
||||
@emph{above} the line; then it adds enough space @emph{below} the line
|
||||
to bring the total line height up to @var{total}. In this case, any
|
||||
value of @code{line-spacing} property for the newline is ignored.
|
||||
@item (@var{height} @var{total})
|
||||
If the property value is a list of the form shown, that adds extra
|
||||
space @emph{below} the display line. First Emacs uses @var{height} as
|
||||
a height spec to control extra space @emph{above} the line; then it
|
||||
adds enough space @emph{below} the line to bring the total line height
|
||||
up to @var{total}. In this case, any value of @code{line-spacing}
|
||||
property for the newline is ignored.
|
||||
@end table
|
||||
|
||||
@cindex height spec
|
||||
Any other kind of property value is a height spec, which translates
|
||||
|
|
|
@ -1425,28 +1425,46 @@ violations of the above requirements. @xref{Initial Options,,,emacs,
|
|||
The GNU Emacs Manual}.
|
||||
|
||||
Using the module @acronym{API}, it is possible to define more complex
|
||||
function and data types: interactive functions, inline functions,
|
||||
macros, etc. However, the resulting C code will be cumbersome and
|
||||
hard to read. Therefore, we recommend that you limit the module code
|
||||
which creates functions and data structures to the absolute minimum,
|
||||
and leave the rest for a Lisp package that will accompany your module,
|
||||
because doing these additional tasks in Lisp is much easier, and will
|
||||
produce a much more readable code. For example, given a module
|
||||
function @code{module-func} defined as above, one way of making an
|
||||
interactive command @code{module-cmd} based on it is with the
|
||||
following simple Lisp wrapper:
|
||||
function and data types: inline functions, macros, etc. However, the
|
||||
resulting C code will be cumbersome and hard to read. Therefore, we
|
||||
recommend that you limit the module code which creates functions and
|
||||
data structures to the absolute minimum, and leave the rest for a Lisp
|
||||
package that will accompany your module, because doing these
|
||||
additional tasks in Lisp is much easier, and will produce a much more
|
||||
readable code. For example, given a module function
|
||||
@code{module-func} defined as above, one way of making a macro
|
||||
@code{module-macro} based on it is with the following simple Lisp
|
||||
wrapper:
|
||||
|
||||
@lisp
|
||||
(defun module-cmd (&rest args)
|
||||
"Documentation string for the command."
|
||||
(interactive @var{spec})
|
||||
(apply 'module-func args))
|
||||
(defmacro module-macro (&rest args)
|
||||
"Documentation string for the macro."
|
||||
(module-func args))
|
||||
@end lisp
|
||||
|
||||
The Lisp package which goes with your module could then load the
|
||||
module using the @code{load} primitive (@pxref{Dynamic Modules}) when
|
||||
the package is loaded into Emacs.
|
||||
|
||||
By default, module functions created by @code{make_function} are not
|
||||
interactive. To make them interactive, you can use the following
|
||||
function.
|
||||
|
||||
@deftypefun void make_interactive (emacs_env *@var{env}, emacs_value @var{function}, emacs_value @var{spec})
|
||||
This function, which is available since Emacs 28, makes the function
|
||||
@var{function} interactive using the interactive specification
|
||||
@var{spec}. Emacs interprets @var{spec} like the argument to the
|
||||
@code{interactive} form. @ref{Using Interactive}, and
|
||||
@pxref{Interactive Codes}. @var{function} must be an Emacs module
|
||||
function returned by @code{make_function}.
|
||||
@end deftypefun
|
||||
|
||||
Note that there is no native module support for retrieving the
|
||||
interactive specification of a module function. Use the function
|
||||
@code{interactive-form} for that. @ref{Using Interactive}. It is not
|
||||
possible to make a module function non-interactive once you have made
|
||||
it interactive using @code{make_interactive}.
|
||||
|
||||
@anchor{Module Function Finalizers}
|
||||
If you want to run some code when a module function object (i.e., an
|
||||
object returned by @code{make_function}) is garbage-collected, you can
|
||||
|
|
|
@ -251,7 +251,8 @@ indicated with @samp{@equiv{}}.
|
|||
|
||||
Many of the examples in this manual print text when they are
|
||||
evaluated. If you execute example code in a Lisp Interaction buffer
|
||||
(such as the buffer @file{*scratch*}), the printed text is inserted into
|
||||
(such as the buffer @file{*scratch*}) by typing @kbd{C-j} after the
|
||||
closing parenthesis of the example, the printed text is inserted into
|
||||
the buffer. If you execute the example by other means (such as by
|
||||
evaluating the function @code{eval-region}), the printed text is
|
||||
displayed in the echo area.
|
||||
|
|
|
@ -316,8 +316,22 @@ input before returning it. However,
|
|||
@code{read-no-blanks-input} (see below), as well as
|
||||
@code{read-minibuffer} and related functions (@pxref{Object from
|
||||
Minibuffer,, Reading Lisp Objects With the Minibuffer}), and all
|
||||
functions that do minibuffer input with completion, discard text
|
||||
properties unconditionally, regardless of the value of this variable.
|
||||
functions that do minibuffer input with completion, remove the @code{face}
|
||||
property unconditionally, regardless of the value of this variable.
|
||||
|
||||
If this variable is non-@code{nil}, most text properties on strings
|
||||
from the completion table are preserved---but only on the part of the
|
||||
strings that were completed.
|
||||
|
||||
@lisp
|
||||
(let ((minibuffer-allow-text-properties t))
|
||||
(completing-read "String: " (list (propertize "foobar" 'data 'zot))))
|
||||
=> #("foobar" 3 6 (data zot))
|
||||
@end lisp
|
||||
|
||||
In this example, the user typed @samp{foo} and then hit the @kbd{TAB}
|
||||
key, so the text properties are only preserved on the last three
|
||||
characters.
|
||||
@end defvar
|
||||
|
||||
@defvar minibuffer-local-map
|
||||
|
@ -2460,9 +2474,10 @@ changes size automatically. In that case the window resizing commands
|
|||
|
||||
@defopt max-mini-window-height
|
||||
This option provides a maximum height for resizing minibuffer windows
|
||||
automatically. A floating-point number specifies a fraction of the
|
||||
frame's height; an integer specifies the maximum number of lines. The
|
||||
default value is 0.25.
|
||||
automatically. A floating-point number specifies the maximum height
|
||||
as a fraction of the frame's height; an integer specifies the maximum
|
||||
height in units of the frame's canonical character height
|
||||
(@pxref{Frame Font}). The default value is 0.25.
|
||||
@end defopt
|
||||
|
||||
Note that the values of the above two variables take effect at display
|
||||
|
|
|
@ -2166,6 +2166,29 @@ Mode line construct for miscellaneous information. By default, this
|
|||
shows the information specified by @code{global-mode-string}.
|
||||
@end defvar
|
||||
|
||||
@defvar mode-line-position-line-format
|
||||
The format used to display line numbers when @code{line-number-mode}
|
||||
(@pxref{Optional Mode Line,,, emacs, The GNU Emacs Manual}) is
|
||||
switched on. @samp{%l} in the format will be replaced with the line
|
||||
number.
|
||||
@end defvar
|
||||
|
||||
@defvar mode-line-position-column-format
|
||||
The format used to display column numbers when
|
||||
@code{column-number-mode} (@pxref{Optional Mode Line,,, emacs, The GNU
|
||||
Emacs Manual}) is switched on. @samp{%c} in the format will be
|
||||
replaced with the column number, and this is zero-based if
|
||||
@code{column-number-indicator-zero-based} is non-@code{nil}, and
|
||||
one-based if @code{column-number-indicator-zero-based} is @code{nil}.
|
||||
@end defvar
|
||||
|
||||
@defvar mode-line-position-column-line-format
|
||||
The format used to display column numbers when both
|
||||
@code{line-number-mode} and @code{column-number-mode} are switched on.
|
||||
See the previous two variables for the meaning of the @samp{%l} and
|
||||
@samp{%c} format specs.
|
||||
@end defvar
|
||||
|
||||
@defvar minor-mode-alist
|
||||
@anchor{Definition of minor-mode-alist}
|
||||
This variable holds an association list whose elements specify how the
|
||||
|
|
|
@ -603,6 +603,11 @@ This function works by calling @code{call-process}, so program output
|
|||
is decoded in the same way as for @code{call-process}.
|
||||
@end defun
|
||||
|
||||
@defun process-lines-ignore-status program &rest args
|
||||
This function is just like @code{process-lines}, but does not signal
|
||||
an error if @var{program} exits with a non-zero exit status.
|
||||
@end defun
|
||||
|
||||
@node Asynchronous Processes
|
||||
@section Creating an Asynchronous Process
|
||||
@cindex asynchronous subprocess
|
||||
|
|
|
@ -2542,7 +2542,7 @@ and replace them, the best way is to write an explicit loop using
|
|||
description of @code{replace-match}.
|
||||
|
||||
However, replacing matches in a string is more complex, especially
|
||||
if you want to do it efficiently. So Emacs provides a function to do
|
||||
if you want to do it efficiently. So Emacs provides two functions to do
|
||||
this.
|
||||
|
||||
@defun replace-regexp-in-string regexp rep string &optional fixedcase literal subexp start
|
||||
|
@ -2564,6 +2564,11 @@ passing the text of the match as its sole argument. It collects the
|
|||
value @var{rep} returns and passes that to @code{replace-match} as the
|
||||
replacement string. The match data at this point are the result
|
||||
of matching @var{regexp} against a substring of @var{string}.
|
||||
@end defun
|
||||
|
||||
@defun replace-in-string fromstring tostring instring
|
||||
This function copies @var{instring} and replaces any occurrences of
|
||||
@var{fromstring} with @var{tostring}.
|
||||
@end defun
|
||||
|
||||
If you want to write a command along the lines of @code{query-replace},
|
||||
|
|
|
@ -256,10 +256,11 @@ look in the standard syntax table to find the syntax of this
|
|||
character.
|
||||
|
||||
@item Generic comment delimiters: @samp{!}
|
||||
Characters that start or end a special kind of comment. @emph{Any}
|
||||
generic comment delimiter matches @emph{any} generic comment
|
||||
delimiter, but they cannot match a comment starter or comment ender;
|
||||
generic comment delimiters can only match each other.
|
||||
(This syntax class is also known as ``comment-fence''.) Characters
|
||||
that start or end a special kind of comment. @emph{Any} generic
|
||||
comment delimiter matches @emph{any} generic comment delimiter, but
|
||||
they cannot match a comment starter or comment ender; generic comment
|
||||
delimiters can only match each other.
|
||||
|
||||
This syntax class is primarily meant for use with the
|
||||
@code{syntax-table} text property (@pxref{Syntax Properties}). You
|
||||
|
@ -268,10 +269,11 @@ first and last characters of the range @code{syntax-table} properties
|
|||
identifying them as generic comment delimiters.
|
||||
|
||||
@item Generic string delimiters: @samp{|}
|
||||
Characters that start or end a string. This class differs from the
|
||||
string quote class in that @emph{any} generic string delimiter can
|
||||
match any other generic string delimiter; but they do not match
|
||||
ordinary string quote characters.
|
||||
(This syntax class is also known as ``string-fence''.) Characters
|
||||
that start or end a string. This class differs from the string quote
|
||||
class in that @emph{any} generic string delimiter can match any other
|
||||
generic string delimiter; but they do not match ordinary string quote
|
||||
characters.
|
||||
|
||||
This syntax class is primarily meant for use with the
|
||||
@code{syntax-table} text property (@pxref{Syntax Properties}). You
|
||||
|
@ -575,6 +577,15 @@ position before @var{end}. However, it should not call
|
|||
@code{syntax-ppss-flush-cache}; so, it is not allowed to call
|
||||
@code{syntax-ppss} on some position and later modify the buffer at an
|
||||
earlier position.
|
||||
|
||||
@strong{Caution:} When this variable is non-@code{nil}, Emacs removes
|
||||
@code{syntax-table} text properties arbitrarily and relies on
|
||||
@code{syntax-propertize-function} to reapply them. Thus if this
|
||||
facility is used at all, the function must apply @strong{all}
|
||||
@code{syntax-table} text properties used by the major mode. In
|
||||
particular, Modes derived from a CC Mode mode must not use this
|
||||
variable, since CC Mode uses other means to apply and remove these
|
||||
text properties.
|
||||
@end defvar
|
||||
|
||||
@defvar syntax-propertize-extend-region-functions
|
||||
|
|
|
@ -3069,7 +3069,7 @@ construct each part with @code{propertize} and then combine them with
|
|||
@code{buffer-substring-no-properties}, which copies text from the
|
||||
buffer but does not copy its properties.
|
||||
|
||||
@findex with-silent-modifications
|
||||
@findex with-silent-modifications, and changes in text properties
|
||||
If you wish to add text properties to a buffer or remove them
|
||||
without marking the buffer as modified, you can wrap the calls above
|
||||
in the @code{with-silent-modifications} macro. @xref{Buffer
|
||||
|
|
|
@ -732,8 +732,8 @@ A @var{property} value can be retrieved by the function
|
|||
@defun dbus-get-property bus service path interface property
|
||||
This function returns the value of @var{property} of @var{interface}.
|
||||
It will be checked at @var{bus}, @var{service}, @var{path}. The
|
||||
result can be any valid D-Bus value, or @code{nil} if there is no
|
||||
@var{property}. Example:
|
||||
result can be any valid D-Bus value. If there is no @var{property},
|
||||
or @var{property} cannot be read, an error is raised. Example:
|
||||
|
||||
@lisp
|
||||
(dbus-get-property
|
||||
|
@ -749,7 +749,7 @@ This function sets the value of @var{property} of @var{interface} to
|
|||
@var{value}. It will be checked at @var{bus}, @var{service},
|
||||
@var{path}. @var{value} can be preceded by a @var{type} symbol. When
|
||||
the value is successfully set, this function returns @var{value}.
|
||||
Otherwise, it returns @code{nil}. Example:
|
||||
Example:
|
||||
|
||||
@lisp
|
||||
(dbus-set-property
|
||||
|
@ -761,10 +761,11 @@ Otherwise, it returns @code{nil}. Example:
|
|||
@end defun
|
||||
|
||||
@defun dbus-get-all-properties bus service path interface
|
||||
This function returns all properties of @var{interface}. It will be
|
||||
checked at @var{bus}, @var{service}, @var{path}. The result is a list
|
||||
of cons. Every cons contains the name of the property, and its value.
|
||||
If there are no properties, @code{nil} is returned. Example:
|
||||
This function returns all readable properties of @var{interface}. It
|
||||
will be checked at @var{bus}, @var{service}, @var{path}. The result
|
||||
is a list of cons cells. Every cons cell contains the name of the
|
||||
property, and its value. If there are no properties, @code{nil} is
|
||||
returned. Example:
|
||||
|
||||
@lisp
|
||||
(dbus-get-all-properties
|
||||
|
@ -782,9 +783,9 @@ If there are no properties, @code{nil} is returned. Example:
|
|||
@defun dbus-get-all-managed-objects bus service path
|
||||
This function returns all objects at @var{bus}, @var{service},
|
||||
@var{path}, and the children of @var{path}. The result is a list of
|
||||
objects. Every object is a cons of an existing path name, and the
|
||||
list of available interface objects. An interface object is another
|
||||
cons, whose car is the interface name and cdr is the list of
|
||||
objects. Every object is a cons cell of an existing path name, and
|
||||
the list of available interface objects. An interface object is
|
||||
another cons, whose car is the interface name and cdr is the list of
|
||||
properties as returned by @code{dbus-get-all-properties} for that path
|
||||
and interface. Example:
|
||||
|
||||
|
@ -1024,12 +1025,19 @@ but different to
|
|||
(dbus-call-method @dots{} :int32 @var{nat-number} :signature @var{string})
|
||||
@end lisp
|
||||
|
||||
The value for a byte D-Bus type can be any integer in the range 0
|
||||
through 255. If a character is used as argument, modifiers
|
||||
represented outside this range are stripped off. For example,
|
||||
@code{:byte ?x} is equal to @code{:byte ?\M-x}, but it is not equal to
|
||||
@code{:byte ?\C-x} or @code{:byte ?\M-\C-x}. Signed and unsigned
|
||||
integer D-Bus types expect a corresponding integer value.
|
||||
The value for a D-Bus byte type can be any natural number. If the
|
||||
number is larger than 255, it is truncated to the least significant
|
||||
byte. For example, @code{:byte 1025} is equal to @code{:byte 1}. If
|
||||
a character is used as argument, modifiers represented outside this
|
||||
range are stripped off. For example, @code{:byte ?x} is equal to
|
||||
@code{:byte ?\M-x}, but it is not equal to @code{:byte ?\C-x} or
|
||||
@code{:byte ?\M-\C-x}.
|
||||
|
||||
Signed and unsigned D-Bus integer types expect a corresponding integer
|
||||
value. A unix file descriptor is restricted to the values 0@dots{}9.
|
||||
|
||||
If typed explicitly, a non-@code{nil} boolean value like
|
||||
@code{:boolean 'symbol} is handled like @code{t} or @code{:boolean t}.
|
||||
|
||||
A D-Bus compound type is always represented as a list. The @sc{car}
|
||||
of this list can be the type symbol @code{:array}, @code{:variant},
|
||||
|
@ -1070,7 +1078,7 @@ elements of this array. Example:
|
|||
(format ; Body.
|
||||
"This is a test notification, raised from\n%S" (emacs-version))
|
||||
'(:array) ; No actions (empty array of strings).
|
||||
'(:array :signature "@{sv@}") ; No hints
|
||||
'(:array :signature "@{sv@}") ; No hints
|
||||
; (empty array of dictionary entries).
|
||||
:int32 -1) ; Default timeout.
|
||||
|
||||
|
@ -1346,6 +1354,8 @@ message arrives, and @var{handler} is called. Example:
|
|||
@cindex method calls, returning
|
||||
@cindex returning method calls
|
||||
|
||||
@c https://wiki.ubuntu.com/DebuggingDBus
|
||||
|
||||
You can offer an own service in D-Bus, which will be visible by other
|
||||
D-Bus clients. See @uref{https://dbus.freedesktop.org/doc/dbus-api-design.html}
|
||||
for a discussion of the design.
|
||||
|
@ -1953,8 +1963,9 @@ appended to the @code{dbus-error}.
|
|||
|
||||
@defspec dbus-ignore-errors forms@dots{}
|
||||
This executes @var{forms} exactly like a @code{progn}, except that
|
||||
@code{dbus-error} errors are ignored during the @var{forms}. These
|
||||
errors can be made visible when @code{dbus-debug} is set to @code{t}.
|
||||
@code{dbus-error} errors are ignored during the @var{forms} (the macro
|
||||
returns @code{nil} then). These errors can be made visible when
|
||||
@code{dbus-debug} is set to non-@code{nil}.
|
||||
@end defspec
|
||||
|
||||
Incoming D-Bus messages are handled as Emacs events, @pxref{Misc
|
||||
|
@ -1981,8 +1992,10 @@ of the D-Bus object emitting the message. @var{interface} and
|
|||
@var{member} denote the message which has been sent.
|
||||
|
||||
@var{handler} is the callback function which has been registered for
|
||||
this message (@pxref{Signals}). When a @code{dbus-event} event
|
||||
arrives, @var{handler} is called with @var{args} as arguments.
|
||||
this message (@pxref{Signals}). @var{args} are the typed arguments as
|
||||
returned from the message. They are passed to @var{handler} without
|
||||
type information, when it is called during event handling in
|
||||
@code{dbus-handle-event}.
|
||||
|
||||
In order to inspect the @code{dbus-event} data, you could extend the
|
||||
definition of the callback function in @ref{Signals}:
|
||||
|
@ -2031,11 +2044,10 @@ This function returns the member name of the D-Bus object @var{event}
|
|||
is coming from. It is either a signal name or a method name.
|
||||
@end defun
|
||||
|
||||
@vindex dbus-show-dbus-errors
|
||||
D-Bus error messages are not propagated during event handling, because
|
||||
it is usually not desired. D-Bus errors in events can be made visible
|
||||
by setting the user option @code{dbus-show-dbus-errors} to
|
||||
non-@code{nil}. They can also be handled by a hook function.
|
||||
D-Bus errors are not propagated during event handling, because it is
|
||||
usually not desired. D-Bus errors in events can be made visible by
|
||||
setting the variable @code{dbus-debug} to non-@code{nil}. They can
|
||||
also be handled by a hook function.
|
||||
|
||||
@defvar dbus-event-error-functions
|
||||
This hook variable keeps a list of functions, which are called when a
|
||||
|
|
|
@ -93,14 +93,20 @@ default one, which is normally called @file{*eww*}.
|
|||
@findex eww-quit
|
||||
@findex eww-reload
|
||||
@findex eww-copy-page-url
|
||||
@findex shr-maybe-probe-and-copy-url
|
||||
@kindex q
|
||||
@kindex w
|
||||
@kindex g
|
||||
If loading the URL was successful the buffer @file{*eww*} is opened
|
||||
and the web page is rendered in it. You can leave EWW by pressing
|
||||
@kbd{q} or exit the browser by calling @kbd{eww-quit}. To reload the
|
||||
web page hit @kbd{g} (@code{eww-reload}). Pressing @kbd{w}
|
||||
(@code{eww-copy-page-url}) will copy the current URL to the kill ring.
|
||||
web page hit @kbd{g} (@code{eww-reload}).
|
||||
|
||||
Pressing @kbd{w} when point is on a link will call
|
||||
@code{shr-maybe-probe-and-copy-url}, which copies this link's
|
||||
@acronym{URL} to the kill ring. If point is not on a link, pressing
|
||||
@kbd{w} calls @code{eww-copy-page-url}, which will copy the current
|
||||
page's URL to the kill ring instead.
|
||||
|
||||
@findex eww-open-in-new-buffer
|
||||
@kindex M-RET
|
||||
|
|
|
@ -11979,6 +11979,11 @@ anything that isn't a newsgroup. This means that no external images
|
|||
will be fetched as a result of reading mail, so that nobody can use
|
||||
web bugs (and the like) to track whether you've read email.
|
||||
|
||||
@vindex gnus-global-groups
|
||||
If you have specific private groups that you want to have treated as
|
||||
if they were public groups, you can add the name of that group to the
|
||||
@code{gnus-global-groups} list.
|
||||
|
||||
Also @pxref{Misc Article} for @code{gnus-inhibit-images}.
|
||||
|
||||
@item gnus-html-cache-directory
|
||||
|
@ -19907,7 +19912,7 @@ Substring matching.
|
|||
Fuzzy matching (@pxref{Fuzzy Matching}).
|
||||
|
||||
@item r
|
||||
Regexp matching
|
||||
Regexp matching.
|
||||
@end table
|
||||
|
||||
@item date
|
||||
|
@ -19935,6 +19940,21 @@ Equal to number.
|
|||
@item >
|
||||
Greater than number.
|
||||
@end table
|
||||
|
||||
@item body-strings
|
||||
|
||||
These match types are available on the @samp{head} and @code{body}
|
||||
``header types''.
|
||||
|
||||
@table @kbd
|
||||
|
||||
@item z
|
||||
Substring matching.
|
||||
|
||||
@item p
|
||||
Regexp matching.
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@item
|
||||
|
@ -19970,7 +19990,8 @@ To make things a bit more complicated, there are shortcuts. If you use
|
|||
a capital letter on either the second or third keys, Gnus will use
|
||||
defaults for the remaining one or two keystrokes. The defaults are
|
||||
``substring'' and ``temporary''. So @kbd{I A} is the same as @kbd{I a s
|
||||
t}, and @kbd{I a R} is the same as @kbd{I a r t}.
|
||||
t}, and @kbd{I a R} is the same as @kbd{I a r t}. (These shortcuts
|
||||
are not available for the body matches.)
|
||||
|
||||
These functions take both the numerical prefix and the symbolic prefix
|
||||
(@pxref{Symbolic Prefixes}). A numerical prefix says how much to lower
|
||||
|
@ -20394,6 +20415,36 @@ key will lead to creation of @file{ADAPT} files.)
|
|||
@end enumerate
|
||||
|
||||
@cindex score file atoms
|
||||
@item score-fn
|
||||
The value of this entry should be one or more user-defined function
|
||||
names in parentheses. Each function will be called in order and the
|
||||
returned value is required to be an integer.
|
||||
|
||||
@example
|
||||
(score-fn (custom-scoring))
|
||||
@end example
|
||||
|
||||
The user-defined function is called with an associative list with the
|
||||
keys @code{number subject from date id refs chars lines xref extra}
|
||||
followed by the article's score before the function is run.
|
||||
|
||||
The following (somewhat contrived) example shows how to use a
|
||||
user-defined function that increases an article's score by 10 if the
|
||||
year of the article's date is also mentioned in its subject.
|
||||
|
||||
@example
|
||||
(defun custom-scoring (article-alist score)
|
||||
(let ((subject (cdr (assoc 'subject article-alist)))
|
||||
(date (cdr (assoc 'date article-alist))))
|
||||
(if (string-match (number-to-string
|
||||
(nth 5 (parse-time-string date)))
|
||||
subject)
|
||||
10)))
|
||||
@end example
|
||||
|
||||
@code{score-fn} entries are permanent and can only be added or
|
||||
modified directly in the @code{SCORE} file.
|
||||
|
||||
@item mark
|
||||
The value of this entry should be a number. Any articles with a score
|
||||
lower than this number will be marked as read.
|
||||
|
|
143
etc/NEWS
143
etc/NEWS
|
@ -85,9 +85,16 @@ useful on systems such as FreeBSD which ships only with "etc/termcap".
|
|||
|
||||
* Changes in Emacs 28.1
|
||||
|
||||
---
|
||||
** Support for the 'strike-through' face attribute on TTY frames.
|
||||
If your terminal's termcap or terminfo database entry has the 'smxx'
|
||||
capability defined, Emacs will now emit the prescribed escape
|
||||
sequences necessary to render faces with the 'strike-through'
|
||||
attribute on TTY frames.
|
||||
|
||||
+++
|
||||
*** Emacs now defaults to UTF-8 instead of ISO-8859-1.
|
||||
This is only for the default, where the user has set no LANG (or
|
||||
This is only for the default, where the user has set no 'LANG' (or
|
||||
similar) variable or environment. This change should lead to no
|
||||
user-visible changes for normal usage.
|
||||
|
||||
|
@ -127,6 +134,17 @@ the mouse cursor is on the scroll bars, fringes, margins, header line,
|
|||
and mode line. ('mwheel-mode' is enabled by default on most graphical
|
||||
displays.)
|
||||
|
||||
---
|
||||
** The default value of 'frame-title-format' and 'icon-title-format' has changed.
|
||||
These variables are used to display the title bar of visible frames
|
||||
and the title bar of an iconified frame. They now show the name of
|
||||
the current buffer and the text "GNU Emacs" instead of the value of
|
||||
'invocation-name'. To get the old behavior back, add the following to
|
||||
your init file:
|
||||
|
||||
(setq frame-title-format '(multiple-frames "%b"
|
||||
("" invocation-name "@" system-name)))
|
||||
|
||||
|
||||
* Editing Changes in Emacs 28.1
|
||||
|
||||
|
@ -175,6 +193,14 @@ Completion of command names now considers obsolete aliases as
|
|||
candidates. Invoking a command via an obsolete alias now mentions the
|
||||
obsolescence fact and shows the new name of the command.
|
||||
|
||||
+++
|
||||
** New command 'revert-buffer-with-fine-grain'.
|
||||
Revert a buffer trying to be as non-destructive as possible,
|
||||
preserving markers, properties and overlays. The new variable
|
||||
'revert-buffer-with-fine-grain-max-seconds' specifies the maximum
|
||||
number of seconds that 'revert-buffer-with-fine-grain' should spend
|
||||
trying to be non-destructive.
|
||||
|
||||
|
||||
* Changes in Specialized Modes and Packages in Emacs 28.1
|
||||
|
||||
|
@ -213,6 +239,9 @@ of the next command to be displayed in a new frame.
|
|||
It's bound to the command 'other-tab-prefix' that requests the buffer
|
||||
of the next command to be displayed in a new tab.
|
||||
|
||||
+++
|
||||
*** New command 'C-x t C-r' to open file read-only in other tab.
|
||||
|
||||
*** The tab bar is frame-local when 'tab-bar-show' is a number.
|
||||
Show/hide the tab bar independently for each frame, according to the
|
||||
value of 'tab-bar-show'.
|
||||
|
@ -302,14 +331,14 @@ details of marking the file at the end of the region.
|
|||
directories with the help of new command 'dired-vc-next-action'.
|
||||
|
||||
+++
|
||||
*** 'dired-jump' and 'dired-jump-other-window' moved from dired-x to dired.
|
||||
*** 'dired-jump' and 'dired-jump-other-window' moved from 'dired-x' to 'dired'.
|
||||
The 'dired-jump' and 'dired-jump-other-window' commands have been
|
||||
moved from the 'dired-x' package to 'dired'. The user option
|
||||
'dired-bind-jump' no longer has any effect and is now obsolete.
|
||||
The commands are now bound to 'C-x C-j' and 'C-x 4 C-j' by default.
|
||||
|
||||
To get the old behavior of 'dired-bind-jump' back and unbind the above
|
||||
keys, add the following to your Init file:
|
||||
keys, add the following to your init file:
|
||||
|
||||
(global-set-key "\C-x\C-j" nil)
|
||||
(global-set-key "\C-x4\C-j" nil)
|
||||
|
@ -345,11 +374,24 @@ tags to be considered as well.
|
|||
|
||||
** Gnus
|
||||
|
||||
+++
|
||||
*** New user option 'gnus-global-groups'.
|
||||
Gnus handles private groups differently from public (i.e., NNTP-like)
|
||||
groups. Most importantly, Gnus doesn't download external images from
|
||||
mail-like groups. This can be overridden by putting group names in
|
||||
'gnus-global-groups': Any group present in that list will be treated
|
||||
like a public group.
|
||||
|
||||
+++
|
||||
*** New scoring types for the Date header.
|
||||
You can now score based on the relative age of an article with the new
|
||||
'<' and '>' date scoring types.
|
||||
|
||||
+++
|
||||
*** User-defined scoring is now possible.
|
||||
The new type is 'score-fn'. More information in the Gnus manual node
|
||||
"(gnus) Score File Format".
|
||||
|
||||
+++
|
||||
*** New backend 'nnselect'.
|
||||
The newly added 'nnselect' backend allows creating groups from an
|
||||
|
@ -461,6 +503,11 @@ authentication mechanism by setting a value for the key 'smtp-auth'.
|
|||
+++
|
||||
*** New command 'describe-keymap' describes keybindings in a keymap.
|
||||
|
||||
+++
|
||||
** New command 'lossage-size'.
|
||||
It allows users to set the maximum number of keystrokes and commands
|
||||
recorded for the purpose of 'view-lossage'.
|
||||
|
||||
---
|
||||
*** The command 'view-lossage' can now be invoked from the menu bar.
|
||||
The menu-bar Help menu now has a "Show Recent Inputs" item under the
|
||||
|
@ -498,9 +545,16 @@ supplied error message.
|
|||
which appends a unique suffix to the Edebug name of the current
|
||||
definition.
|
||||
|
||||
+++
|
||||
** ElDoc
|
||||
|
||||
+++
|
||||
*** New user option 'eldoc-display-truncation-message'.
|
||||
If non-nil (the default), eldoc will display a message saying
|
||||
something like "(Documentation truncated. Use `M-x eldoc-doc-buffer'
|
||||
to see rest" when a message has been truncated. If nil, truncated
|
||||
messages will be marked with just "..." at the end.
|
||||
|
||||
+++
|
||||
*** New hook 'eldoc-documentation-functions'.
|
||||
This hook is intended to be used for registering doc string functions.
|
||||
These functions don't need to produce the doc string right away, they
|
||||
|
@ -508,6 +562,7 @@ may arrange for it to be produced asynchronously. The results of all
|
|||
doc string functions are accessible to the user through the user
|
||||
option 'eldoc-documentation-strategy'.
|
||||
|
||||
+++
|
||||
*** New user option 'eldoc-documentation-strategy'.
|
||||
The built-in choices available for this user option let users compose
|
||||
the results of 'eldoc-documentation-functions' in various ways, even
|
||||
|
@ -814,7 +869,7 @@ background colors or transparency, such as xbm, pbm, svg, png and gif.
|
|||
** EWW
|
||||
|
||||
+++
|
||||
*** New variable 'eww-retrieve-command'.
|
||||
*** New user option 'eww-retrieve-command'.
|
||||
This can be used to download data via an external command. If nil
|
||||
(the default), then 'url-retrieve' is used.
|
||||
|
||||
|
@ -987,10 +1042,30 @@ window after starting). This variable defaults to nil.
|
|||
|
||||
** Miscellaneous
|
||||
|
||||
+++
|
||||
*** Interactive regular expression search now uses faces for sub-groups.
|
||||
E.g., 'C-M-s foo-\([0-9]+\)' will now use the 'isearch-group-1' face
|
||||
on the part of the regexp that matches the sub-expression "[0-9]+".
|
||||
This is controlled by the 'search-highlight-submatches' variable.
|
||||
|
||||
---
|
||||
*** New user option 'reveal-auto-hide'.
|
||||
If non-nil (the default), revealed text is automatically hidden when
|
||||
point leaves the text. If nil, the text is not hidden again. Instead
|
||||
'M-x reveal-hide-revealed' can be used to hide all the revealed text.
|
||||
|
||||
+++
|
||||
*** New user options to control the look of line/column numbers in the mode line.
|
||||
'mode-line-position-line-format' is the line number format (when
|
||||
'line-number-mode' is on), 'mode-line-position-column-format' is
|
||||
the column number format (when 'column-number-mode' is on), and
|
||||
'mode-line-position-column-line-format' is the combined format (when
|
||||
both modes are on).
|
||||
|
||||
+++
|
||||
*** New command 'submit-emacs-patch'.
|
||||
This works along the lines of 'report-emacs-bug', but is more geared
|
||||
towards sending a patch to the Emacs issue tracker.
|
||||
This works like 'report-emacs-bug', but is more geared towards sending
|
||||
patches to the Emacs issue tracker.
|
||||
|
||||
+++
|
||||
*** New minor mode 'button-mode'.
|
||||
|
@ -1103,6 +1178,10 @@ easily bind this menu to 'down-mouse-3' (usually the right mouse button)
|
|||
instead of 'mouse-2' (the default) by customizing the new user option
|
||||
'flyspell-use-mouse-3-for-menu'.
|
||||
|
||||
---
|
||||
*** The current dictionary is now displayed in the minor mode lighter.
|
||||
Clicking the dictionary name changes the current dictionary.
|
||||
|
||||
** Time
|
||||
|
||||
---
|
||||
|
@ -1133,7 +1212,7 @@ The old names are now obsolete.
|
|||
+++
|
||||
*** Property values can be typed explicitly.
|
||||
'dbus-register-property' and 'dbus-set-property' accept now optional
|
||||
type symbols.
|
||||
type symbols. Both functions propagate D-Bus errors.
|
||||
|
||||
+++
|
||||
*** Registered properties can have the new access type ':write'.
|
||||
|
@ -1143,9 +1222,18 @@ type symbols.
|
|||
|
||||
+++
|
||||
*** D-Bus errors, which have been converted from incoming D-Bus error
|
||||
messages, contain the error name of that message now. They can be
|
||||
made visible by setting user variable 'dbus-show-dbus-errors' to
|
||||
non-nil, even if protected by 'dbus-ignore-errors' otherwise.
|
||||
messages, contain the error name of that message now.
|
||||
|
||||
---
|
||||
*** D-Bus events keep the type information of their arguments.
|
||||
|
||||
** CPerl Mode
|
||||
|
||||
---
|
||||
*** The command 'cperl-set-style' offers the new value "PBP".
|
||||
This value customizes Emacs to use the style recommended in Damian
|
||||
Conway's book "Perl Best Practices" for indentation and formatting
|
||||
of conditionals.
|
||||
|
||||
|
||||
* New Modes and Packages in Emacs 28.1
|
||||
|
@ -1179,6 +1267,12 @@ directory instead of the default directory.
|
|||
|
||||
* Incompatible Lisp Changes in Emacs 28.1
|
||||
|
||||
+++
|
||||
** Some properties from completion tables are now preserved.
|
||||
If 'minibuffer-allow-text-properties' is non-nil, doing completion
|
||||
over a table of strings with properties will no longer remove all the
|
||||
properties before returning. This affects things like 'completing-read'.
|
||||
|
||||
** 'equal' no longer examines some contents of window configurations.
|
||||
Instead, it considers window configurations to be equal only if they
|
||||
are 'eq'. To compare contents, use 'compare-window-configurations'
|
||||
|
@ -1281,7 +1375,7 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
|
|||
'semantic-flex-token-start', 'semantic-flex-token-text',
|
||||
'semantic-imenu-bucketize-type-parts',
|
||||
'semantic-imenu-expand-type-parts', 'semantic-imenu-expandable-token',
|
||||
'semantic-init-db-hooks)', 'semantic-init-hooks',
|
||||
'semantic-init-db-hooks', 'semantic-init-hooks',
|
||||
'semantic-init-mode-hooks', 'semantic-java-prototype-nonterminal',
|
||||
'semantic-nonterminal-abstract', 'semantic-nonterminal-full-name',
|
||||
'semantic-nonterminal-leaf', 'semantic-nonterminal-protection',
|
||||
|
@ -1300,6 +1394,18 @@ ledit.el, lmenu.el, lucid.el and old-whitespace.el.
|
|||
|
||||
* Lisp Changes in Emacs 28.1
|
||||
|
||||
+++
|
||||
*** New function 'process-lines-ignore-status'.
|
||||
This is like 'process-lines', but does not signal an error if the
|
||||
return status is non-zero. 'process-lines-handling-status' has also
|
||||
been added, and takes a callback to handle the return status.
|
||||
|
||||
+++
|
||||
*** New function 'replace-in-string'.
|
||||
This function works along the line of 'replace-regexp-in-string', but
|
||||
matching on strings instead of regexps, and does not change the global
|
||||
match state.
|
||||
|
||||
---
|
||||
*** 'ascii' is now a coding system alias for 'us-ascii'.
|
||||
|
||||
|
@ -1336,6 +1442,10 @@ This removes the final remaining trace of old-style backquotes.
|
|||
'emacs_function' and 'emacs_finalizer' for module functions and
|
||||
finalizers, respectively.
|
||||
|
||||
** Module functions can now be made interactive.
|
||||
Use 'make_interactive' to give a module function an interactive
|
||||
specification.
|
||||
|
||||
** Module functions can now install an optional finalizer that is
|
||||
called when the function object is garbage-collected. Use
|
||||
'set_function_finalizer' to set the finalizer and
|
||||
|
@ -1404,6 +1514,12 @@ truncating precision field, such as "%.2a".
|
|||
This can be used to parse RGB color specs in several formats and
|
||||
convert them to a list '(R G B)' of primary color values.
|
||||
|
||||
---
|
||||
** User option 'uniquify-buffer-name-style' can now be a function.
|
||||
This user option can be one of the predefined styles or a function to
|
||||
personalize the uniquified buffer name.
|
||||
|
||||
|
||||
|
||||
* Changes in Emacs 28.1 on Non-Free Operating Systems
|
||||
|
||||
|
@ -1445,6 +1561,9 @@ To turn this on, set the variable 'w32-use-native-image-API' to a
|
|||
non-nil value. Please report any bugs you find while using the native
|
||||
image API via 'M-x report-emacs-bug'.
|
||||
|
||||
---
|
||||
** The user option 'make-pointer-invisible' is now honored on macOS.
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
This file is part of GNU Emacs.
|
||||
|
|
|
@ -622,7 +622,7 @@ same as the 'C-x C-+' and 'C-x C--' commands.
|
|||
This new command (which inserts an <a id="foo">_</a> skeleton) is
|
||||
bound to 'C-c C-c #'.
|
||||
|
||||
** New command 'font-lock-refontify'.
|
||||
** New command 'font-lock-debug-fontify'.
|
||||
This is an interactive convenience function to be used when developing
|
||||
font locking for a mode. It recomputes the font locking data and then
|
||||
re-fontifies the buffer.
|
||||
|
|
13
etc/PROBLEMS
13
etc/PROBLEMS
|
@ -967,6 +967,19 @@ index 5504171..431adf8 100644
|
|||
If you can't modify that file directly, copy it to the directory
|
||||
~/.m17n.d/ (create it if it doesn't exist), and apply the patch.
|
||||
|
||||
** On MS-Windows, some characters display as boxes with hex code.
|
||||
|
||||
Also, some characters could display with wrong fonts.
|
||||
|
||||
This can happen if Emacs was compiled without HarfBuzz support, and/or
|
||||
if the HarfBuzz DLLs are not available at run time. Emacs will then
|
||||
fall back to the Uniscribe as its shaping engine; Uniscribe was
|
||||
deprecated by Microsoft, and sometimes fails to display correctly when
|
||||
modern fonts are used, such as Noto Emoji or Ebrima.
|
||||
|
||||
The solution is to switch to a configuration that uses HarfBuzz as its
|
||||
shaping engine, where these problems don't exist.
|
||||
|
||||
* Internationalization problems
|
||||
|
||||
** M-{ does not work on a Spanish PC keyboard.
|
||||
|
|
|
@ -494,7 +494,6 @@ \section{Kontrola pravopisu}
|
|||
\section{Tagy}
|
||||
|
||||
\key{najít tag (definici)}{M-.}
|
||||
\key{najít další výskyt tagu}{C-u M-.}
|
||||
\metax{zadat soubor s novými tagy}{M-x visit-tags-table}
|
||||
|
||||
\metax{vyhledat reg.\ výraz v~souborech s~tagy}{M-x tags-search}
|
||||
|
|
|
@ -255,7 +255,6 @@ \section{Značky (tags)}
|
|||
příkaz `{\tt etags} {\it vstupní\_soubory}' v příkazovém interpretu.
|
||||
\askip
|
||||
\key{M-.} najdi definici
|
||||
\key{C-u M-.} najdi další výskyt definice
|
||||
\key{M-*} běž tam, odkud byla volána poslední \kbd{M-.}
|
||||
\mkey{M-x tags-query-replace} spusť query-replace na všech souborech
|
||||
zaznamenaných v tabulce značek.
|
||||
|
|
|
@ -497,7 +497,6 @@ \section{Rechtschreibpr\"ufung}
|
|||
\section{Tags}
|
||||
|
||||
\key{Tag finden (Definition)}{M-.}
|
||||
\key{n\"achstes Vorkommen von Tag finden}{C-u M-.}
|
||||
\metax{neue Tagsdatei angeben}{M-x visit-tags-table}
|
||||
|
||||
\metax{regul\"aren Ausdruck in Dateien suchen}{M-x tags-search}
|
||||
|
|
|
@ -500,7 +500,6 @@ \section{V\'erifier l'orthographe}
|
|||
\section{Tags}
|
||||
|
||||
\key{Trouver un tag (une d\'efinition)}{M-.}
|
||||
\key{Passer \`a l'occurrence suivante du tag}{C-u M-.}
|
||||
\metax{Sp\'ecifier un autre fichier de tags}{M-x visit-tags-table}
|
||||
|
||||
\metax{Rechercher dans tous les fichiers des tags}{M-x tags-search}
|
||||
|
|
|
@ -251,7 +251,6 @@ \section{Marqueurs}
|
|||
tel fichier, tapez `{\tt etags} {\it fichier\_entr\'ee}' \`a l'invite du shell.
|
||||
\askip
|
||||
\key{M-.} trouve une d\'efinition
|
||||
\key{C-u M-.} trouve l'occurrence suivante de la d\'efinition
|
||||
\key{M-*} revient o\`u \kbd{M-.} a \'et\'e appel\'e pour la derni\`ere fois
|
||||
\mkey{M-x tags-query-replace} lance query-replace sur tous les
|
||||
fichiers enregistr\'es dans le tableau des marqueurs
|
||||
|
|
|
@ -690,10 +690,8 @@ \section{Przestawianie}
|
|||
\section{Tags}
|
||||
|
||||
%\key{find a tag (a definition)}{M-.}
|
||||
%\key{find next occurrence of tag}{C-u M-.}
|
||||
%\metax{specify a new tags file}{M-x visit-tags-table}
|
||||
\key{znajd/x okre/slenie (definicj/e)}{M-.}
|
||||
\key{znajd/x nast/epne wyst/apienie definicji}{C-u M-.}
|
||||
\metax{podaj nowy plik TAGS}{M-x visit-tags-table}
|
||||
|
||||
%\metax{regexp search on all files in tags table}{M-x tags-search}
|
||||
|
|
|
@ -506,7 +506,6 @@ \section{Verifica{\c{c}}{\~a}o Ortogr{\'a}fica}
|
|||
\section{Tags}
|
||||
|
||||
\key{busca uma tag (uma defini{\c{c}}{\~a}o)}{M-.}
|
||||
\key{encontra a pr{\'o}xima ocorr{\^e}ncia da tag}{C-u M-.}
|
||||
\metax{especifica um novo arquivo de tags}{M-x visit-tags-table}
|
||||
|
||||
\metax{busca por regexp em todos arquivos}{M-x tags-search}
|
||||
|
|
|
@ -511,7 +511,6 @@ \section{Spelling Check}
|
|||
\section{Tags}
|
||||
|
||||
\key{find a tag (a definition)}{M-.}
|
||||
\key{find next occurrence of tag}{C-u M-.}
|
||||
\metax{specify a new tags file}{M-x visit-tags-table}
|
||||
|
||||
\metax{regexp search on all files in tags table}{M-x tags-search}
|
||||
|
@ -562,8 +561,8 @@ \section{Regular Expressions}
|
|||
\key{quote regular expression special character {\it c\/}}{\\{\it c}}
|
||||
\key{alternative (``or'')}{\\|}
|
||||
\key{grouping}{\\( {\rm$\ldots$} \\)}
|
||||
\key{shy grouping}{\\(:? {\rm$\ldots$} \\)}
|
||||
\key{explicit numbered grouping}{\\(:NUM {\rm$\ldots$} \\)}
|
||||
\key{shy grouping}{\\(?: {\rm$\ldots$} \\)}
|
||||
\key{explicit numbered grouping}{\\(?NUM: {\rm$\ldots$} \\)}
|
||||
\key{same text as {\it n\/}th group}{\\{\it n}}
|
||||
\key{at word break}{\\b}
|
||||
\key{not at word break}{\\B}
|
||||
|
|
|
@ -340,7 +340,6 @@ \section{Теги}
|
|||
|
||||
\begin{tabular}{p{\ColWidth}l}
|
||||
найти определение тега & \kbd{M-.} \\
|
||||
найти следующее вхождение тега & \kbd{C-u M-.} \\
|
||||
использовать новый файл с тегами & \kbd{M-x visit-tags-table} \\
|
||||
|
||||
поиск по шаблону по всей таблице тегов & \kbd{M-x tags-search} \\
|
||||
|
|
|
@ -494,7 +494,6 @@ \section{Kontrola pravopisu}
|
|||
\section{Tagy}
|
||||
|
||||
\key{nájsť tag (definíciu)}{M-.}
|
||||
\key{nájsť ďalší výskyt tagu}{C-u M-.}
|
||||
\metax{zadať súbor s novými tagmi}{M-x visit-tags-table}
|
||||
|
||||
\metax{vyhľadať reg.\ výraz v~súboroch s~tagmi}{M-x tags-search}
|
||||
|
|
|
@ -258,7 +258,6 @@ \section{Značky (tags)}
|
|||
príkaz `{\tt etags} {\it vstupné\_súbory}' v príkazovom interprétereri.
|
||||
\askip
|
||||
\key{M-.} nájdi definícu
|
||||
\key{C-u M-.} nájdi ďalší výskyt definície
|
||||
\key{M-*} choď tam, odkiaľ bola volaná posledná \kbd{M-.}
|
||||
\mkey{M-x tags-query-replace} spusti query-replace na všetkých súboroch
|
||||
zaznamenaných v tabuľke značiek.
|
||||
|
|
|
@ -243,7 +243,6 @@ \section{Tags}
|
|||
`{\tt etags} {\it input\_files}' as a shell command.
|
||||
\askip
|
||||
\key{M-.} find a definition
|
||||
\key{C-u M-.} find next occurrence of definition
|
||||
\key{M-*} pop back to where \kbd{M-.} was last invoked
|
||||
\mkey{M-x tags-query-replace} run query-replace on all files
|
||||
recorded in tags table
|
||||
|
|
|
@ -473,6 +473,7 @@ to undo insertion of text.)
|
|||
>> Kill this line with C-k, then type C-/ and it should reappear.
|
||||
|
||||
C-_ is an alternative undo command; it works exactly the same as C-/.
|
||||
On some text terminals, you can omit the shift key when you type C-_.
|
||||
On some text terminals, typing C-/ actually sends C-_ to Emacs.
|
||||
Alternatively, C-x u also works exactly like C-/, but is a little less
|
||||
convenient to type.
|
||||
|
|
|
@ -419,8 +419,9 @@ argument) משום מקישים אותו לפני הפקודה אליה הוא
|
|||
>> גזרו שורה זו עם C-k, אחר־כך הקישו C-/ והיא תופיע שוב.
|
||||
|
||||
C-_ הינה דרך חלופית להפעיל את פקודת הביטול. היא פועלת בדיוק כמו C-/.
|
||||
במקלדות אחדות הקשה על C-/ שולחת ל־Emacs את התו C-_. חלופה נוספת היא
|
||||
C-x u, אם־כי היא פחות נוחה להקשה מספר פעמים בזו אחר זו.
|
||||
במקלדות אחדות אפשר לא ללחוץ על shift כשמקישים C-_.
|
||||
במקלדות אחדות הקשה על C-/ שולחת ל־Emacs את התו C-_.
|
||||
חלופה נוספת היא C-x u, אם־כי היא פחות נוחה להקשה מספר פעמים בזו אחר זו.
|
||||
|
||||
ארגומנט נומרי ל־C-/ או ל־C-_ או ל־C-x u משמש כמספר החזרות על הפקודה.
|
||||
|
||||
|
|
|
@ -1875,7 +1875,7 @@ yylex (void)
|
|||
|
||||
|
||||
/* Actually local to matching_regexp. These variables must be in
|
||||
global scope for the case that `static' get's defined away. */
|
||||
global scope for the case that `static' gets defined away. */
|
||||
|
||||
static char *matching_regexp_buffer, *matching_regexp_end_buf;
|
||||
|
||||
|
|
|
@ -411,6 +411,8 @@ zero, otherwise they start from one."
|
|||
:type 'boolean
|
||||
:group 'mode-line
|
||||
:version "26.1")
|
||||
(make-obsolete-variable 'column-number-indicator-zero-based
|
||||
'mode-line-position-column-format "28.1")
|
||||
|
||||
(defcustom mode-line-percent-position '(-3 "%p")
|
||||
"Specification of \"percentage offset\" of window through buffer.
|
||||
|
@ -431,6 +433,41 @@ displayed in `mode-line-position', a component of the default
|
|||
:group 'mode-line)
|
||||
(put 'mode-line-percent-position 'risky-local-variable t)
|
||||
|
||||
(defcustom mode-line-position-line-format '(" L%l")
|
||||
"Format used to display line numbers in the mode line.
|
||||
This is used when `line-number-mode' is switched on. The \"%l\"
|
||||
format spec will be replaced by the line number."
|
||||
:type '(list string)
|
||||
:version "28.1"
|
||||
:group 'mode-line)
|
||||
|
||||
(defcustom mode-line-position-column-format '(" C%c")
|
||||
"Format used to display column numbers in the mode line.
|
||||
This is used when `column-number-mode' is switched on. The
|
||||
\"%c\" format spec will be replaced by the column number, which
|
||||
is zero-based if `column-number-indicator-zero-based' is non-nil,
|
||||
and one-based if `column-number-indicator-zero-based' is nil."
|
||||
:type '(list string)
|
||||
:version "28.1"
|
||||
:group 'mode-line)
|
||||
|
||||
(defcustom mode-line-position-column-line-format '(" (%l,%c)")
|
||||
"Format used to display combined line/column numbers in the mode line.
|
||||
This is used when `column-number-mode' and `line-number-mode' are
|
||||
switched on. The \"%c\" format spec will be replaced by the
|
||||
column number, which is zero-based if
|
||||
`column-number-indicator-zero-based' is non-nil, and one-based if
|
||||
`column-number-indicator-zero-based' is nil."
|
||||
:type '(list string)
|
||||
:version "28.1"
|
||||
:group 'mode-line)
|
||||
|
||||
(defconst mode-line-position--column-line-properties
|
||||
(list 'local-map mode-line-column-line-number-mode-map
|
||||
'mouse-face 'mode-line-highlight
|
||||
'help-echo "Line number and Column number\n\
|
||||
mouse-1: Display Line and Column Mode Menu"))
|
||||
|
||||
(defvar mode-line-position
|
||||
`((:propertize
|
||||
mode-line-percent-position
|
||||
|
@ -450,38 +487,30 @@ mouse-1: Display Line and Column Mode Menu")))
|
|||
(line-number-mode
|
||||
((column-number-mode
|
||||
(column-number-indicator-zero-based
|
||||
(10 ,(propertize
|
||||
" (%l,%c)"
|
||||
'local-map mode-line-column-line-number-mode-map
|
||||
'mouse-face 'mode-line-highlight
|
||||
'help-echo "Line number and Column number\n\
|
||||
mouse-1: Display Line and Column Mode Menu"))
|
||||
(10 ,(propertize
|
||||
" (%l,%C)"
|
||||
'local-map mode-line-column-line-number-mode-map
|
||||
'mouse-face 'mode-line-highlight
|
||||
'help-echo "Line number and Column number\n\
|
||||
mouse-1: Display Line and Column Mode Menu")))
|
||||
(6 ,(propertize
|
||||
" L%l"
|
||||
'local-map mode-line-column-line-number-mode-map
|
||||
'mouse-face 'mode-line-highlight
|
||||
'help-echo "Line Number\n\
|
||||
mouse-1: Display Line and Column Mode Menu"))))
|
||||
((column-number-mode
|
||||
(column-number-indicator-zero-based
|
||||
(5 ,(propertize
|
||||
" C%c"
|
||||
'local-map mode-line-column-line-number-mode-map
|
||||
'mouse-face 'mode-line-highlight
|
||||
'help-echo "Column number\n\
|
||||
mouse-1: Display Line and Column Mode Menu"))
|
||||
(5 ,(propertize
|
||||
" C%C"
|
||||
'local-map mode-line-column-line-number-mode-map
|
||||
'mouse-face 'mode-line-highlight
|
||||
'help-echo "Column number\n\
|
||||
mouse-1: Display Line and Column Mode Menu")))))))
|
||||
(10
|
||||
(:propertize
|
||||
mode-line-position-column-line-format
|
||||
,@mode-line-position--column-line-properties))
|
||||
(10
|
||||
(:propertize
|
||||
(:eval (replace-in-string
|
||||
"%c" "%C" (car mode-line-position-column-line-format)))
|
||||
,@mode-line-position--column-line-properties)))
|
||||
(6
|
||||
(:propertize
|
||||
mode-line-position-line-format
|
||||
,@mode-line-position--column-line-properties))))
|
||||
(column-number-mode
|
||||
(column-number-indicator-zero-based
|
||||
(6
|
||||
(:propertize
|
||||
mode-line-position-column-format
|
||||
(,@mode-line-position--column-line-properties)))
|
||||
(6
|
||||
(:propertize
|
||||
(:eval (replace-in-string
|
||||
"%c" "%C" (car mode-line-position-column-format)))
|
||||
,@mode-line-position--column-line-properties))))))
|
||||
"Mode line construct for displaying the position in the buffer.
|
||||
Normally displays the buffer percentage and, optionally, the
|
||||
buffer size, the line number and the column number.")
|
||||
|
|
|
@ -439,12 +439,25 @@
|
|||
(math-div (calcFunc-fact (math-float n))
|
||||
(math-mul (calcFunc-fact m)
|
||||
(calcFunc-fact (math-sub n m))))))
|
||||
((math-negp m) 0)
|
||||
((math-negp n)
|
||||
(let ((val (calcFunc-choose (math-add (math-add n m) -1) m)))
|
||||
;; For the extension to negative integer arguments we follow
|
||||
;; M. J. Kronenburg, The Binomial Coefficient for Negative Arguments,
|
||||
;; arXiv:1105.3689v2
|
||||
((and (math-negp n) (not (math-negp m)))
|
||||
;; n<0≤m: (n choose m) = (-1)^m (-n+m-1 choose m)
|
||||
(let ((val (calcFunc-choose (math-add (math-sub m n) -1) m)))
|
||||
(if (math-evenp (math-trunc m))
|
||||
val
|
||||
(math-neg val))))
|
||||
((and (math-negp n) (math-num-integerp n))
|
||||
(if (math-lessp n m)
|
||||
0
|
||||
;; m≤n<0: (n choose m) = (-1)^(n-m) (-m-1 choose n-m)
|
||||
(let ((val (calcFunc-choose (math-sub (math-neg m) 1)
|
||||
(math-sub n m))))
|
||||
(if (math-evenp (math-sub n m))
|
||||
val
|
||||
(math-neg val)))))
|
||||
((math-negp m) 0)
|
||||
((and (math-num-integerp n)
|
||||
(Math-lessp n m))
|
||||
0)
|
||||
|
@ -461,20 +474,23 @@
|
|||
(math-choose-float-iter tm n 1 1)))))))
|
||||
|
||||
(defun math-choose-iter (m n i c)
|
||||
(if (and (= (% i 5) 1) (> i 5))
|
||||
(while (<= i m)
|
||||
(when (and (= (% i 5) 1) (> i 5))
|
||||
(math-working (format "choose(%d)" (1- i)) c))
|
||||
(if (<= i m)
|
||||
(math-choose-iter m (1- n) (1+ i)
|
||||
(math-quotient (math-mul c n) i))
|
||||
c))
|
||||
(setq c (math-quotient (math-mul c n) i))
|
||||
(setq n (1- n))
|
||||
(setq i (1+ i)))
|
||||
c)
|
||||
|
||||
(defun math-choose-float-iter (count n i c)
|
||||
(if (= (% i 5) 1)
|
||||
(while (> count 0)
|
||||
(when (= (% i 5) 1)
|
||||
(math-working (format "choose(%d)" (1- i)) c))
|
||||
(if (> count 0)
|
||||
(math-choose-float-iter (1- count) (math-sub n 1) (1+ i)
|
||||
(math-div (math-mul c n) i))
|
||||
c))
|
||||
(setq c (math-div (math-mul c n) i))
|
||||
(setq n (math-sub n 1))
|
||||
(setq i (1+ i))
|
||||
(setq count (1- count)))
|
||||
c)
|
||||
|
||||
|
||||
;;; Stirling numbers.
|
||||
|
|
|
@ -1018,7 +1018,8 @@
|
|||
(make-string (+ w 2) ?\_))
|
||||
(list 'horiz
|
||||
(if (= h 1)
|
||||
"V"
|
||||
(if (char-displayable-p ?√)
|
||||
"√" "V")
|
||||
(append (list 'vleft (1- a))
|
||||
(make-list (1- h) " |")
|
||||
'("\\|")))
|
||||
|
|
|
@ -234,20 +234,19 @@ All files need the macros from lisp.h!"
|
|||
(let* ((D (car dirs))
|
||||
(ed (expand-file-name D base))
|
||||
(ef (expand-file-name name ed)))
|
||||
(if (file-exists-p ef)
|
||||
(setq ans ef)
|
||||
;; Not in this dir? How about subdirs?
|
||||
(let ((dirfile (directory-files ed t))
|
||||
(moredirs nil)
|
||||
)
|
||||
;; Get all the subdirs.
|
||||
(dolist (DF dirfile)
|
||||
(when (and (file-directory-p DF)
|
||||
(not (string-match "\\.$" DF)))
|
||||
(push DF moredirs)))
|
||||
;; Try again.
|
||||
(setq ans (ede-emacs-find-in-directories name ed moredirs))
|
||||
))
|
||||
(when (file-exists-p ed)
|
||||
(if (file-exists-p ef)
|
||||
(setq ans ef)
|
||||
;; Not in this dir? How about subdirs?
|
||||
(let ((dirfile (directory-files ed t))
|
||||
(moredirs nil))
|
||||
;; Get all the subdirs.
|
||||
(dolist (DF dirfile)
|
||||
(when (and (file-directory-p DF)
|
||||
(not (string-match "\\.$" DF)))
|
||||
(push DF moredirs)))
|
||||
;; Try again.
|
||||
(setq ans (ede-emacs-find-in-directories name ed moredirs)))))
|
||||
(setq dirs (cdr dirs))))
|
||||
ans))
|
||||
|
||||
|
|
|
@ -649,7 +649,7 @@ define-mode-overload\\)\
|
|||
))
|
||||
(when fun
|
||||
;; Do not return FUN IFF the cursor is on FUN.
|
||||
;; Huh? Thats because if cursor is on fun, it is
|
||||
;; Huh? That's because if cursor is on fun, it is
|
||||
;; the current symbol, and not the current function.
|
||||
(if (save-excursion
|
||||
(condition-case nil
|
||||
|
|
|
@ -1245,7 +1245,7 @@ See `semanticdb-find-translate-path' for details on PATH.
|
|||
The argument BRUTISH will be set so that searching includes all tables
|
||||
in the current project.
|
||||
FIND-FILE-MATCH indicates that any time a match is found, the file
|
||||
associated wit that tag should be loaded into a buffer."
|
||||
associated with that tag should be loaded into a buffer."
|
||||
(semanticdb-find-tags-collector
|
||||
(lambda (table tags)
|
||||
(semanticdb-deep-find-tags-by-name-method table name tags))
|
||||
|
@ -1257,7 +1257,7 @@ See `semanticdb-find-translate-path' for details on PATH.
|
|||
The argument BRUTISH will be set so that searching includes all tables
|
||||
in the current project.
|
||||
FIND-FILE-MATCH indicates that any time a match is found, the file
|
||||
associated wit that tag should be loaded into a buffer."
|
||||
associated with that tag should be loaded into a buffer."
|
||||
(semanticdb-find-tags-collector
|
||||
(lambda (table tags)
|
||||
(semanticdb-deep-find-tags-for-completion-method table prefix tags))
|
||||
|
|
|
@ -89,7 +89,7 @@ same major mode as the current buffer.")
|
|||
:documentation "The tags belonging to this table.")
|
||||
(db-refs :initform nil
|
||||
:documentation
|
||||
"List of `semanticdb-table' objects refering to this one.
|
||||
"List of `semanticdb-table' objects referring to this one.
|
||||
These aren't saved, but are instead recalculated after load.
|
||||
See the file semanticdb-ref.el for how this slot is used.")
|
||||
(index :type semanticdb-abstract-search-index
|
||||
|
@ -764,7 +764,7 @@ If a particular major mode wants to search any mode, put the
|
|||
Do not set the value of this variable permanently.")
|
||||
|
||||
(defmacro semanticdb-with-match-any-mode (&rest body)
|
||||
"A Semanticdb search occurring withing BODY will search tags in all modes.
|
||||
"A Semanticdb search occurring within BODY will search tags in all modes.
|
||||
This temporarily sets `semanticdb-match-any-mode' while executing BODY."
|
||||
(declare (indent 0) (debug t))
|
||||
`(let ((semanticdb-match-any-mode t))
|
||||
|
|
|
@ -1069,7 +1069,7 @@ Only in effect if `debug-on-error' is also non-nil."
|
|||
"For SYNTAX, execute FORMS with protection for unterminated syntax.
|
||||
If FORMS throws an error, treat this as a syntax problem, and
|
||||
execute the unterminated syntax code. FORMS should return a position.
|
||||
Irregardless of an error, the cursor should be moved to the end of
|
||||
Regardless of an error, the cursor should be moved to the end of
|
||||
the desired syntax, and a position returned.
|
||||
If `debug-on-error' is set, errors are not caught, so that you can
|
||||
debug them.
|
||||
|
|
|
@ -660,7 +660,7 @@ All non-spacing characters have this function in
|
|||
;; align it at the center of the glyph of the
|
||||
;; enclosing mark hoping that the enclosing mark
|
||||
;; is big enough. We also have to adjust the
|
||||
;; x-offset and width of the mark ifself properly
|
||||
;; x-offset and width of the mark itself properly
|
||||
;; depending on how the glyph is designed.
|
||||
|
||||
;; (non-spacing or not). For instance, when we
|
||||
|
|
|
@ -3560,19 +3560,24 @@ the present value is saved to its :shown-value property instead."
|
|||
(widget-put widget :buttons buttons))
|
||||
|
||||
;; Draw an ordinary `custom-face' widget
|
||||
(let ((opoint (point)))
|
||||
;; Visibility indicator.
|
||||
(push (widget-create-child-and-convert
|
||||
widget 'custom-visibility
|
||||
:help-echo "Hide or show this face."
|
||||
:on "Hide" :off "Show"
|
||||
:on-glyph "down" :off-glyph "right"
|
||||
:action 'custom-toggle-hide-face
|
||||
(not hiddenp))
|
||||
buttons)
|
||||
;; Face name (tag).
|
||||
(insert " " tag)
|
||||
(widget-specify-sample widget opoint (point)))
|
||||
;; Visibility indicator.
|
||||
(push (widget-create-child-and-convert
|
||||
widget 'custom-visibility
|
||||
:help-echo "Hide or show this face."
|
||||
:on "Hide" :off "Show"
|
||||
:on-glyph "down" :off-glyph "right"
|
||||
:action 'custom-toggle-hide-face
|
||||
(not hiddenp))
|
||||
buttons)
|
||||
;; Face name (tag).
|
||||
(insert " ")
|
||||
(push (widget-create-child-and-convert
|
||||
widget 'face-link
|
||||
:button-face 'link
|
||||
:tag tag
|
||||
:action (lambda (&rest _x)
|
||||
(find-face-definition symbol)))
|
||||
buttons)
|
||||
(insert
|
||||
(cond ((eq custom-buffer-style 'face) " ")
|
||||
((string-match-p "face\\'" tag) ":")
|
||||
|
|
|
@ -953,7 +953,7 @@ This function can be used as a value of
|
|||
;; exclusively, we could call the (now unused) argument
|
||||
;; _CALLBACK with hints on how to shorten the string if needed,
|
||||
;; or with multiple usable strings which ElDoc picks according
|
||||
;; to its space contraints.
|
||||
;; to its space constraints.
|
||||
(describe-char-eldoc--format
|
||||
ch
|
||||
(unless (eq eldoc-echo-area-use-multiline-p t)
|
||||
|
|
|
@ -60,24 +60,132 @@ Isolated means that STRING is surrounded by spaces or at the beginning/end
|
|||
of a string followed/prefixed with an space.
|
||||
The regexp capture the preceding blank, STRING and the following blank as
|
||||
the groups 1, 2 and 3 respectively."
|
||||
(format "\\(\\`\\|[ \t]\\)\\(%s\\)\\([ \t]\\|\\'\\)" string))
|
||||
(format "\\(?1:\\`\\|[ \t]\\)\\(?2:%s\\)\\(?3:[ \t]\\|\\'\\)" string))
|
||||
|
||||
(defun dired--star-or-qmark-p (string match &optional keep)
|
||||
(defun dired--star-or-qmark-p (string match &optional keep start)
|
||||
"Return non-nil if STRING contains isolated MATCH or `\\=`?\\=`'.
|
||||
MATCH should be the strings \"?\", `\\=`?\\=`', \"*\" or nil. The latter
|
||||
means STRING contains either \"?\" or `\\=`?\\=`' or \"*\".
|
||||
If optional arg KEEP is non-nil, then preserve the match data. Otherwise,
|
||||
this function changes it and saves MATCH as the second match group.
|
||||
START is the position to start matching from.
|
||||
|
||||
Isolated means that MATCH is surrounded by spaces or at the beginning/end
|
||||
of STRING followed/prefixed with an space. A match to `\\=`?\\=`',
|
||||
isolated or not, is also valid."
|
||||
(let ((regexps (list (dired-isolated-string-re (if match (regexp-quote match) "[*?]")))))
|
||||
(let ((regexp (dired-isolated-string-re (if match (regexp-quote match) "[*?]"))))
|
||||
(when (or (null match) (equal match "?"))
|
||||
(setq regexps (append (list "\\(\\)\\(`\\?`\\)\\(\\)") regexps)))
|
||||
(cl-some (lambda (x)
|
||||
(funcall (if keep #'string-match-p #'string-match) x string))
|
||||
regexps)))
|
||||
(cl-callf concat regexp "\\|\\(?1:\\)\\(?2:`\\?`\\)\\(?3:\\)"))
|
||||
(funcall (if keep #'string-match-p #'string-match) regexp string start)))
|
||||
|
||||
(defun dired--need-confirm-positions (command string)
|
||||
"Search for non-isolated matches of STRING in COMMAND.
|
||||
Return a list of positions that match STRING, but would not be
|
||||
considered \"isolated\" by `dired--star-or-qmark-p'."
|
||||
(cl-assert (= (length string) 1))
|
||||
(let ((start 0)
|
||||
(isolated-char-positions nil)
|
||||
(confirm-positions nil)
|
||||
(regexp (regexp-quote string)))
|
||||
;; Collect all ? and * surrounded by spaces and `?`.
|
||||
(while (dired--star-or-qmark-p command string nil start)
|
||||
(push (cons (match-beginning 2) (match-end 2))
|
||||
isolated-char-positions)
|
||||
(setq start (match-end 2)))
|
||||
;; Now collect any remaining ? and *.
|
||||
(setq start 0)
|
||||
(while (string-match regexp command start)
|
||||
(unless (cl-member (match-beginning 0) isolated-char-positions
|
||||
:test (lambda (pos match)
|
||||
(<= (car match) pos (cdr match))))
|
||||
(push (match-beginning 0) confirm-positions))
|
||||
(setq start (match-end 0)))
|
||||
confirm-positions))
|
||||
|
||||
(defun dired--mark-positions (positions)
|
||||
(let ((markers (make-string
|
||||
(1+ (apply #'max positions))
|
||||
?\s)))
|
||||
(dolist (pos positions)
|
||||
(setf (aref markers pos) ?^))
|
||||
markers))
|
||||
|
||||
(defun dired--highlight-no-subst-chars (positions command mark)
|
||||
(cl-callf substring-no-properties command)
|
||||
(dolist (pos positions)
|
||||
(add-face-text-property pos (1+ pos) 'warning nil command))
|
||||
(if mark
|
||||
(concat command "\n" (dired--mark-positions positions))
|
||||
command))
|
||||
|
||||
(defun dired--no-subst-explain (buf char-positions command mark-positions)
|
||||
(with-current-buffer buf
|
||||
(erase-buffer)
|
||||
(insert
|
||||
(format-message "\
|
||||
If your command contains occurrences of `*' surrounded by
|
||||
whitespace, `dired-do-shell-command' substitutes them for the
|
||||
entire file list to process. Otherwise, if your command contains
|
||||
occurrences of `?' surrounded by whitespace or `%s', Dired will
|
||||
run the command once for each file, substituting `?' for each
|
||||
file name.
|
||||
|
||||
Your command contains occurrences of `%s' that will not be
|
||||
substituted, and will be passed through normally to the shell.
|
||||
|
||||
%s
|
||||
|
||||
(Press ^ to %s markers below these occurrences.)
|
||||
"
|
||||
"`"
|
||||
(string (aref command (car char-positions)))
|
||||
(dired--highlight-no-subst-chars char-positions command mark-positions)
|
||||
(if mark-positions "remove" "add")))))
|
||||
|
||||
(defun dired--no-subst-ask (char nb-occur details)
|
||||
(let ((hilit-char (propertize (string char) 'face 'warning))
|
||||
(choices `(?y ?n ?? ,@(when details '(?^)))))
|
||||
(read-char-from-minibuffer
|
||||
(format-message
|
||||
(ngettext
|
||||
"%d occurrence of `%s' will not be substituted. Proceed? (%s) "
|
||||
"%d occurrences of `%s' will not be substituted. Proceed? (%s) "
|
||||
nb-occur)
|
||||
nb-occur hilit-char (mapconcat #'string choices ", "))
|
||||
choices)))
|
||||
|
||||
(defun dired--no-subst-confirm (char-positions command)
|
||||
(let ((help-buf (get-buffer-create "*Dired help*"))
|
||||
(char (aref command (car char-positions)))
|
||||
(nb-occur (length char-positions))
|
||||
(done nil)
|
||||
(details nil)
|
||||
(markers nil)
|
||||
proceed)
|
||||
(unwind-protect
|
||||
(save-window-excursion
|
||||
(while (not done)
|
||||
(cl-case (dired--no-subst-ask char nb-occur details)
|
||||
(?y
|
||||
(setq done t
|
||||
proceed t))
|
||||
(?n
|
||||
(setq done t
|
||||
proceed nil))
|
||||
(??
|
||||
(if details
|
||||
(progn
|
||||
(quit-window nil details)
|
||||
(setq details nil))
|
||||
(dired--no-subst-explain
|
||||
help-buf char-positions command markers)
|
||||
(setq details (display-buffer help-buf))))
|
||||
(?^
|
||||
(setq markers (not markers))
|
||||
(dired--no-subst-explain
|
||||
help-buf char-positions command markers)))))
|
||||
(kill-buffer help-buf))
|
||||
proceed))
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-diff (file &optional switches)
|
||||
|
@ -772,28 +880,19 @@ prompted for the shell command to use interactively."
|
|||
(dired-read-shell-command "! on %s: " current-prefix-arg files)
|
||||
current-prefix-arg
|
||||
files)))
|
||||
(cl-flet ((need-confirm-p
|
||||
(cmd str)
|
||||
(let ((res cmd)
|
||||
(regexp (regexp-quote str)))
|
||||
;; Drop all ? and * surrounded by spaces and `?`.
|
||||
(while (and (string-match regexp res)
|
||||
(dired--star-or-qmark-p res str))
|
||||
(setq res (replace-match "" t t res 2)))
|
||||
(string-match regexp res))))
|
||||
(let* ((on-each (not (dired--star-or-qmark-p command "*" 'keep)))
|
||||
(no-subst (not (dired--star-or-qmark-p command "?" 'keep)))
|
||||
(confirmations nil)
|
||||
;; Get confirmation for wildcards that may have been meant
|
||||
;; to control substitution of a file name or the file name list.
|
||||
(ok (cond ((not (or on-each no-subst))
|
||||
(error "You can not combine `*' and `?' substitution marks"))
|
||||
((need-confirm-p command "*")
|
||||
(y-or-n-p (format-message
|
||||
"Confirm--do you mean to use `*' as a wildcard? ")))
|
||||
((need-confirm-p command "?")
|
||||
(y-or-n-p (format-message
|
||||
"Confirm--do you mean to use `?' as a wildcard? ")))
|
||||
(t))))
|
||||
(ok (cond
|
||||
((not (or on-each no-subst))
|
||||
(error "You can not combine `*' and `?' substitution marks"))
|
||||
((setq confirmations (dired--need-confirm-positions command "*"))
|
||||
(dired--no-subst-confirm confirmations command))
|
||||
((setq confirmations (dired--need-confirm-positions command "?"))
|
||||
(dired--no-subst-confirm confirmations command))
|
||||
(t))))
|
||||
(cond ((not ok) (message "Command canceled"))
|
||||
(t
|
||||
(if on-each
|
||||
|
@ -804,7 +903,7 @@ prompted for the shell command to use interactively."
|
|||
nil file-list)
|
||||
;; execute the shell command
|
||||
(dired-run-shell-command
|
||||
(dired-shell-stuff-it command file-list nil arg))))))))
|
||||
(dired-shell-stuff-it command file-list nil arg)))))))
|
||||
|
||||
;; Might use {,} for bash or csh:
|
||||
(defvar dired-mark-prefix ""
|
||||
|
@ -2718,12 +2817,6 @@ When called interactively and not on a subdir line, go to this subdir's line."
|
|||
(if (dired-get-subdir) 1 0))))
|
||||
(dired-next-subdir (- arg) no-error-if-not-found no-skip))
|
||||
|
||||
(defun dired-subdir-min ()
|
||||
(save-excursion
|
||||
(if (not (dired-prev-subdir 0 t t))
|
||||
(error "Not in a subdir!")
|
||||
(point))))
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-goto-subdir (dir)
|
||||
"Go to end of header line of DIR in this dired buffer.
|
||||
|
@ -2816,15 +2909,6 @@ Lower levels are unaffected."
|
|||
|
||||
;;; hiding
|
||||
|
||||
(defun dired-unhide-subdir ()
|
||||
(with-silent-modifications
|
||||
(dired--unhide (dired-subdir-min) (dired-subdir-max))))
|
||||
|
||||
(defun dired-subdir-hidden-p (dir)
|
||||
(save-excursion
|
||||
(dired-goto-subdir dir)
|
||||
(dired--hidden-p)))
|
||||
|
||||
;;;###autoload
|
||||
(defun dired-hide-subdir (arg)
|
||||
"Hide or unhide the current subdirectory and move to next directory.
|
||||
|
|
|
@ -2585,6 +2585,21 @@ Otherwise, display it in another buffer."
|
|||
|
||||
;;; Functions for extracting and manipulating file names in Dired buffers.
|
||||
|
||||
(defun dired-unhide-subdir ()
|
||||
(with-silent-modifications
|
||||
(dired--unhide (dired-subdir-min) (dired-subdir-max))))
|
||||
|
||||
(defun dired-subdir-hidden-p (dir)
|
||||
(save-excursion
|
||||
(dired-goto-subdir dir)
|
||||
(dired--hidden-p)))
|
||||
|
||||
(defun dired-subdir-min ()
|
||||
(save-excursion
|
||||
(if (not (dired-prev-subdir 0 t t))
|
||||
(error "Not in a subdir!")
|
||||
(point))))
|
||||
|
||||
(defun dired-get-filename (&optional localp no-error-if-not-filep)
|
||||
"In Dired, return name of file mentioned on this line.
|
||||
Value returned normally includes the directory name.
|
||||
|
@ -2595,10 +2610,17 @@ it occurs in the buffer, and a value of t means construct name relative to
|
|||
Optional arg NO-ERROR-IF-NOT-FILEP means treat `.' and `..' as
|
||||
regular filenames and return nil if no filename on this line.
|
||||
Otherwise, an error occurs in these cases."
|
||||
(let (case-fold-search file p1 p2 already-absolute)
|
||||
(let ((hidden (and dired-subdir-alist
|
||||
(dired-subdir-hidden-p
|
||||
(dired-current-directory))))
|
||||
case-fold-search file p1 p2 already-absolute)
|
||||
(when hidden
|
||||
(dired-unhide-subdir))
|
||||
(save-excursion
|
||||
(if (setq p1 (dired-move-to-filename (not no-error-if-not-filep)))
|
||||
(setq p2 (dired-move-to-end-of-filename no-error-if-not-filep))))
|
||||
(when hidden
|
||||
(dired-hide-subdir 1))
|
||||
;; nil if no file on this line, but no-error-if-not-filep is t:
|
||||
(if (setq file (and p1 p2 (buffer-substring p1 p2)))
|
||||
(progn
|
||||
|
|
|
@ -260,6 +260,7 @@ expression, in which case we want to handle forms differently."
|
|||
"Visit the autoload file for the current buffer, and return its buffer."
|
||||
(let ((enable-local-variables :safe)
|
||||
(enable-local-eval nil)
|
||||
(find-file-hook nil)
|
||||
(delay-mode-hooks t)
|
||||
(file (autoload-generated-file)))
|
||||
;; We used to use `raw-text' to read this file, but this causes
|
||||
|
|
|
@ -335,6 +335,9 @@ or call the function `%s'."))))
|
|||
No problems result if this variable is not bound.
|
||||
`add-hook' automatically binds it. (This is true for all hook variables.)"
|
||||
modefun)))
|
||||
;; Allow using using `M-x customize-variable' on the hook.
|
||||
(put ',hook 'custom-type 'hook)
|
||||
(put ',hook 'standard-value (list nil))
|
||||
|
||||
;; Define the minor-mode keymap.
|
||||
,(unless (symbolp keymap) ;nil is also a symbol.
|
||||
|
|
|
@ -875,7 +875,7 @@ this object."
|
|||
;; Now output readable lisp to recreate this object
|
||||
;; It should look like this:
|
||||
;; (<constructor> <name> <slot> <slot> ... )
|
||||
;; Each slot's slot is writen using its :writer.
|
||||
;; Each slot's slot is written using its :writer.
|
||||
(when eieio-print-indentation
|
||||
(princ (make-string (* eieio-print-depth 2) ? )))
|
||||
(princ "(")
|
||||
|
|
|
@ -67,6 +67,12 @@ If this variable is set to 0, no idle time is required."
|
|||
Changing the value requires toggling `eldoc-mode'."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom eldoc-display-truncation-message t
|
||||
"If non-nil, provide verbose help when a message has been truncated.
|
||||
If nil, truncated messages will just have \"...\" appended."
|
||||
:type 'boolean
|
||||
:version "28.1")
|
||||
|
||||
;;;###autoload
|
||||
(defcustom eldoc-minor-mode-string (purecopy " ElDoc")
|
||||
"String to display in mode line when ElDoc Mode is enabled; nil for none."
|
||||
|
@ -415,7 +421,7 @@ pairs of the form (:KEY VALUE :KEY2 VALUE2...). KEY can be:
|
|||
|
||||
* `:thing', VALUE is a short string or symbol designating what is
|
||||
being reported on. The documentation display engine can elect
|
||||
to remove this information depending on space contraints;
|
||||
to remove this information depending on space constraints;
|
||||
|
||||
* `:face', VALUE is a symbol designating a face to use when
|
||||
displaying `:thing''s value.
|
||||
|
@ -524,10 +530,13 @@ Honor most of `eldoc-echo-area-use-multiline-p'."
|
|||
(cl-return
|
||||
(concat
|
||||
(buffer-substring (point-min) (point))
|
||||
(and truncated
|
||||
(and
|
||||
truncated
|
||||
(if eldoc-display-truncation-message
|
||||
(format
|
||||
"\n(Documentation truncated. Use `%s' to see rest)"
|
||||
(substitute-command-keys "\\[eldoc-doc-buffer]")))))))))
|
||||
(substitute-command-keys "\\[eldoc-doc-buffer]"))
|
||||
"..."))))))))
|
||||
((= available 1)
|
||||
;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too?
|
||||
(with-current-buffer (eldoc-doc-buffer)
|
||||
|
@ -710,7 +719,7 @@ Other third-party strategy functions do not use
|
|||
produce callbacks to feed to `eldoc-documentation-function' and
|
||||
should endeavour to display the docstrings eventually produced."
|
||||
(let* (;; How many callbacks have been created by the strategy
|
||||
;; fucntion and passed to elements of
|
||||
;; function and passed to elements of
|
||||
;; `eldoc-documentation-functions'.
|
||||
(howmany 0)
|
||||
;; How many calls to callbacks we're still waiting on. Used
|
||||
|
|
|
@ -177,6 +177,18 @@ test for `called-interactively' in the command will fail."
|
|||
(cl-assert (not unread-command-events) t)
|
||||
return-value))
|
||||
|
||||
(defmacro ert-simulate-keys (keys &rest body)
|
||||
"Execute BODY with KEYS as pseudo-interactive input."
|
||||
(declare (debug t) (indent 1))
|
||||
`(let ((unread-command-events
|
||||
;; Add some C-g to try and make sure we still exit
|
||||
;; in case something goes wrong.
|
||||
(append ,keys '(?\C-g ?\C-g ?\C-g)))
|
||||
;; Tell `read-from-minibuffer' not to read from stdin when in
|
||||
;; batch mode.
|
||||
(executing-kbd-macro t))
|
||||
,@body))
|
||||
|
||||
(defun ert-run-idle-timers ()
|
||||
"Run all idle timers (from `timer-idle-list')."
|
||||
(dolist (timer (copy-sequence timer-idle-list))
|
||||
|
|
|
@ -205,15 +205,26 @@ NODE and leaving the new node's start there. Return the new node."
|
|||
|
||||
(defun ewoc--refresh-node (pp node dll)
|
||||
"Redisplay the element represented by NODE using the pretty-printer PP."
|
||||
(let ((inhibit-read-only t)
|
||||
(m (ewoc--node-start-marker node))
|
||||
(R (ewoc--node-right node)))
|
||||
;; First, remove the string from the buffer:
|
||||
(delete-region m (ewoc--node-start-marker R))
|
||||
;; Calculate and insert the string.
|
||||
(goto-char m)
|
||||
(funcall pp (ewoc--node-data node))
|
||||
(ewoc--adjust m (point) R dll)))
|
||||
(let* ((m (ewoc--node-start-marker node))
|
||||
(R (ewoc--node-right node))
|
||||
(end (ewoc--node-start-marker R))
|
||||
(inhibit-read-only t)
|
||||
(offset (if (= (point) end)
|
||||
'end
|
||||
(when (< m (point) end)
|
||||
(- (point) m)))))
|
||||
(save-excursion
|
||||
;; First, remove the string from the buffer:
|
||||
(delete-region m end)
|
||||
;; Calculate and insert the string.
|
||||
(goto-char m)
|
||||
(funcall pp (ewoc--node-data node))
|
||||
(setq end (point))
|
||||
(ewoc--adjust m (point) R dll))
|
||||
(when offset
|
||||
(goto-char (if (eq offset 'end)
|
||||
end
|
||||
(min (+ m offset) (1- end)))))))
|
||||
|
||||
(defun ewoc--wrap (func)
|
||||
(lambda (data)
|
||||
|
@ -342,11 +353,10 @@ arguments will be passed to MAP-FUNCTION."
|
|||
((footer (ewoc--footer ewoc))
|
||||
(pp (ewoc--pretty-printer ewoc))
|
||||
(node (ewoc--node-nth dll 1)))
|
||||
(save-excursion
|
||||
(while (not (eq node footer))
|
||||
(if (apply map-function (ewoc--node-data node) args)
|
||||
(ewoc--refresh-node pp node dll))
|
||||
(setq node (ewoc--node-next dll node))))))
|
||||
(while (not (eq node footer))
|
||||
(if (apply map-function (ewoc--node-data node) args)
|
||||
(ewoc--refresh-node pp node dll))
|
||||
(setq node (ewoc--node-next dll node)))))
|
||||
|
||||
(defun ewoc-delete (ewoc &rest nodes)
|
||||
"Delete NODES from EWOC."
|
||||
|
@ -461,9 +471,8 @@ If the EWOC is empty, nil is returned."
|
|||
Delete current text first, thus effecting a \"refresh\"."
|
||||
(ewoc--set-buffer-bind-dll-let* ewoc
|
||||
((pp (ewoc--pretty-printer ewoc)))
|
||||
(save-excursion
|
||||
(dolist (node nodes)
|
||||
(ewoc--refresh-node pp node dll)))))
|
||||
(dolist (node nodes)
|
||||
(ewoc--refresh-node pp node dll))))
|
||||
|
||||
(defun ewoc-goto-prev (ewoc arg)
|
||||
"Move point to the ARGth previous element in EWOC.
|
||||
|
@ -566,9 +575,8 @@ Return nil if the buffer has been deleted."
|
|||
(hf-pp (ewoc--hf-pp ewoc)))
|
||||
(setf (ewoc--node-data head) header
|
||||
(ewoc--node-data foot) footer)
|
||||
(save-excursion
|
||||
(ewoc--refresh-node hf-pp head dll)
|
||||
(ewoc--refresh-node hf-pp foot dll))))
|
||||
(ewoc--refresh-node hf-pp head dll)
|
||||
(ewoc--refresh-node hf-pp foot dll)))
|
||||
|
||||
|
||||
(provide 'ewoc)
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
"^\\s-*(\\(def\\(ine-skeleton\\|ine-generic-mode\\|ine-derived-mode\\|\
|
||||
ine\\(?:-global\\)?-minor-mode\\|ine-compilation-mode\\|un-cvs-mode\\|\
|
||||
foo\\|\\(?:[^icfgv]\\|g[^r]\\)\\(\\w\\|\\s_\\)+\\*?\\)\\|easy-mmode-define-[a-z-]+\\|easy-menu-define\\|\
|
||||
menu-bar-make-toggle\\)"
|
||||
menu-bar-make-toggle\\|menu-bar-make-toggle-command\\)"
|
||||
find-function-space-re
|
||||
"\\('\\|(quote \\)?%s\\(\\s-\\|$\\|[()]\\)")
|
||||
"The regexp used by `find-function' to search for a function definition.
|
||||
|
@ -290,20 +290,10 @@ Interactively, prompt for LIBRARY using the one at or near point."
|
|||
A library name is the filename of an Emacs Lisp library located
|
||||
in a directory under `load-path' (or `find-function-source-path',
|
||||
if non-nil)."
|
||||
(let* ((suffix-regexp (mapconcat
|
||||
(lambda (suffix)
|
||||
(concat (regexp-quote suffix) "\\'"))
|
||||
(find-library-suffixes)
|
||||
"\\|"))
|
||||
(table (cl-loop for dir in (or find-function-source-path load-path)
|
||||
for dir-or-default = (or dir default-directory)
|
||||
when (file-readable-p dir-or-default)
|
||||
append (mapcar
|
||||
(lambda (file)
|
||||
(replace-regexp-in-string suffix-regexp
|
||||
"" file))
|
||||
(directory-files dir-or-default nil
|
||||
suffix-regexp))))
|
||||
(let* ((dirs (or find-function-source-path load-path))
|
||||
(suffixes (find-library-suffixes))
|
||||
(table (apply-partially 'locate-file-completion-table
|
||||
dirs suffixes))
|
||||
(def (if (eq (function-called-at-point) 'require)
|
||||
;; `function-called-at-point' may return 'require
|
||||
;; with `point' anywhere on this line. So wrap the
|
||||
|
|
|
@ -594,7 +594,7 @@ MATCH is the pattern that needs to be matched, of the form:
|
|||
((null (cdr else-alts)) (car else-alts))
|
||||
(t (cons (car match) (nreverse else-alts)))))))
|
||||
((memq match '(:pcase--succeed :pcase--fail)) (cons match match))
|
||||
(t (error "Uknown MATCH %s" match))))
|
||||
(t (error "Unknown MATCH %s" match))))
|
||||
|
||||
(defun pcase--split-rest (sym splitter rest)
|
||||
(let ((then-rest '())
|
||||
|
@ -725,7 +725,7 @@ MATCH is the pattern that needs to be matched, of the form:
|
|||
(pcase--app-subst-match match sym fun nsym))
|
||||
(cdr match))))
|
||||
((memq match '(:pcase--succeed :pcase--fail)) match)
|
||||
(t (error "Uknown MATCH %s" match))))
|
||||
(t (error "Unknown MATCH %s" match))))
|
||||
|
||||
(defun pcase--app-subst-rest (rest sym fun nsym)
|
||||
(mapcar (lambda (branch)
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
;; out.
|
||||
|
||||
;; Q: But how can I then make out the sub-expressions?
|
||||
;; A: Thats where the `sub-expression mode' comes in. In it only the
|
||||
;; A: That's where the `sub-expression mode' comes in. In it only the
|
||||
;; digit keys are assigned to perform an update that will flash the
|
||||
;; corresponding subexp only.
|
||||
|
||||
|
|
|
@ -65,8 +65,13 @@ cannot be handled just by the buffer's syntax-table.
|
|||
The specified function may call `syntax-ppss' on any position
|
||||
before END, but if it calls `syntax-ppss' on some
|
||||
position and later modifies the buffer on some earlier position,
|
||||
then it is its responsability to call `syntax-ppss-flush-cache' to flush
|
||||
the now obsolete ppss info from the cache.")
|
||||
then it is its responsibility to call `syntax-ppss-flush-cache' to flush
|
||||
the now obsolete ppss info from the cache.
|
||||
|
||||
Note: When this variable is a function, it must apply _all_ the
|
||||
`syntax-table' properties needed in the given text interval.
|
||||
Using both this function and other means to apply these
|
||||
properties won't work properly.")
|
||||
|
||||
(defvar syntax-propertize-chunk-size 500)
|
||||
|
||||
|
|
|
@ -400,7 +400,7 @@ DOC is documentation text to insert at the start."
|
|||
e expired key. n never trust. m trust marginally. u trust ultimately.
|
||||
f trust fully (keys you have signed, usually).
|
||||
q trust status questionable. - trust status unspecified.
|
||||
See GPG documentaion for more explanation.
|
||||
See GPG documentation for more explanation.
|
||||
\n"))
|
||||
|
||||
;;;###autoload
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
("EFnet: EU, PL, Warszawa" EFnet "irc.efnet.pl" 6667)
|
||||
("EFnet: EU, RU, Moscow" EFnet "irc.rt.ru" ((6661 6669)))
|
||||
("EFnet: EU, SE, Dalarna" EFnet "irc.du.se" ((6666 6669)))
|
||||
("EFnet: EU, SE, Gothenberg" EFnet "irc.hemmet.chalmers.se" ((6666 7000)))
|
||||
("EFnet: EU, SE, Gothenburg" EFnet "irc.hemmet.chalmers.se" ((6666 7000)))
|
||||
("EFnet: EU, SE, Sweden" EFnet "irc.light.se" 6667)
|
||||
("EFnet: EU, UK, London (carrier)" EFnet "irc.carrier1.net.uk" ((6666 6669)))
|
||||
("EFnet: EU, UK, London (demon)" EFnet "efnet.demon.co.uk" ((6665 6669)))
|
||||
|
|
|
@ -787,9 +787,9 @@ external command."
|
|||
|
||||
;; completions rules for some common UNIX commands
|
||||
|
||||
(defsubst eshell-complete-hostname ()
|
||||
"Complete a command that wants a hostname for an argument."
|
||||
(pcomplete-here (eshell-read-host-names)))
|
||||
(autoload 'pcmpl-unix-complete-hostname "pcmpl-unix")
|
||||
(define-obsolete-function-alias 'eshell-complete-hostname
|
||||
#'pcmpl-unix-complete-hostname "28.1")
|
||||
|
||||
(defun eshell-complete-host-reference ()
|
||||
"If there is a host reference, complete it."
|
||||
|
@ -798,26 +798,7 @@ external command."
|
|||
(when (setq index (string-match "@[a-z.]*\\'" arg))
|
||||
(setq pcomplete-stub (substring arg (1+ index))
|
||||
pcomplete-last-completion-raw t)
|
||||
(throw 'pcomplete-completions (eshell-read-host-names)))))
|
||||
|
||||
(defalias 'pcomplete/ftp 'eshell-complete-hostname)
|
||||
(defalias 'pcomplete/ncftp 'eshell-complete-hostname)
|
||||
(defalias 'pcomplete/ping 'eshell-complete-hostname)
|
||||
(defalias 'pcomplete/rlogin 'eshell-complete-hostname)
|
||||
|
||||
(defun pcomplete/telnet ()
|
||||
(require 'pcmpl-unix)
|
||||
(pcomplete-opt "xl(pcmpl-unix-user-names)")
|
||||
(eshell-complete-hostname))
|
||||
|
||||
(defun pcomplete/rsh ()
|
||||
"Complete `rsh', which, after the user and hostname, is like xargs."
|
||||
(require 'pcmpl-unix)
|
||||
(pcomplete-opt "l(pcmpl-unix-user-names)")
|
||||
(eshell-complete-hostname)
|
||||
(pcomplete-here (funcall pcomplete-command-completion-function))
|
||||
(funcall (or (pcomplete-find-completion-function (pcomplete-arg 1))
|
||||
pcomplete-default-completion-function)))
|
||||
(throw 'pcomplete-completions (pcomplete-read-host-names)))))
|
||||
|
||||
(defvar block-size)
|
||||
(defvar by-bytes)
|
||||
|
|
|
@ -94,36 +94,6 @@ naturally accessible within Emacs."
|
|||
(defalias 'eshell/ff 'find-name-dired)
|
||||
(defalias 'eshell/gf 'find-grep-dired)
|
||||
|
||||
(defun pcomplete/bcc32 ()
|
||||
"Completion function for Borland's C++ compiler."
|
||||
(let ((cur (pcomplete-arg 0)))
|
||||
(cond
|
||||
((string-match "\\`-w\\([^;]+;\\)*\\([^;]*\\)\\'" cur)
|
||||
(pcomplete-here
|
||||
'("ali" "amb" "amp" "asc" "asm" "aus" "bbf" "bei" "big" "ccc"
|
||||
"cln" "cod" "com" "cpt" "csu" "def" "dig" "dpu" "dsz" "dup"
|
||||
"eas" "eff" "ext" "hch" "hid" "ias" "ibc" "ifr" "ill" "nil"
|
||||
"lin" "lvc" "mcs" "mes" "mpc" "mpd" "msg" "nak" "ncf" "nci"
|
||||
"ncl" "nfd" "ngu" "nin" "nma" "nmu" "nod" "nop" "npp" "nsf"
|
||||
"nst" "ntd" "nto" "nvf" "obi" "obs" "ofp" "osh" "ovf" "par"
|
||||
"pch" "pck" "pia" "pin" "pow" "prc" "pre" "pro" "rch" "ret"
|
||||
"rng" "rpt" "rvl" "sig" "spa" "stl" "stu" "stv" "sus" "tai"
|
||||
"tes" "thr" "ucp" "use" "voi" "zdi") (match-string 2 cur)))
|
||||
((string-match "\\`-[LIn]\\([^;]+;\\)*\\([^;]*\\)\\'" cur)
|
||||
(pcomplete-here (pcomplete-dirs) (match-string 2 cur)))
|
||||
((string-match "\\`-[Ee]\\(.*\\)\\'" cur)
|
||||
(pcomplete-here (pcomplete-dirs-or-entries "\\.[Ee][Xx][Ee]\\'")
|
||||
(match-string 1 cur)))
|
||||
((string-match "\\`-o\\(.*\\)\\'" cur)
|
||||
(pcomplete-here (pcomplete-dirs-or-entries "\\.[Oo][Bb][Jj]\\'")
|
||||
(match-string 1 cur)))
|
||||
(t
|
||||
(pcomplete-opt "3456ABCDEHIKLMNOPRSTUVXabcdefgijklnoptuvwxyz"))))
|
||||
(while (pcomplete-here
|
||||
(pcomplete-dirs-or-entries "\\.[iCc]\\([Pp][Pp]\\)?\\'"))))
|
||||
|
||||
(defalias 'pcomplete/bcc 'pcomplete/bcc32)
|
||||
|
||||
(provide 'em-xtra)
|
||||
|
||||
;; Local Variables:
|
||||
|
|
|
@ -51,9 +51,15 @@ similarly to external commands, as far as successful result output."
|
|||
:group 'eshell-util)
|
||||
|
||||
(defcustom eshell-hosts-file "/etc/hosts"
|
||||
"The name of the /etc/hosts file."
|
||||
"The name of the /etc/hosts file.
|
||||
Use `pcomplete-hosts-file' instead; this variable is obsolete and
|
||||
has no effect."
|
||||
:type '(choice (const :tag "No hosts file" nil) file)
|
||||
:group 'eshell-util)
|
||||
;; Don't make it into an alias, because it doesn't really work with
|
||||
;; custom and risks creating duplicate entries. Just point users to
|
||||
;; the other variable, which is less frustrating.
|
||||
(make-obsolete-variable 'eshell-hosts-file nil "28.1")
|
||||
|
||||
(defcustom eshell-handle-errors t
|
||||
"If non-nil, Eshell will handle errors itself.
|
||||
|
@ -127,11 +133,14 @@ function `string-to-number'."
|
|||
(defvar eshell-user-timestamp nil
|
||||
"A timestamp of when the user file was read.")
|
||||
|
||||
(defvar eshell-host-names nil
|
||||
"A cache the names of frequently accessed hosts.")
|
||||
;;; Obsolete variables:
|
||||
|
||||
(defvar eshell-host-timestamp nil
|
||||
"A timestamp of when the hosts file was read.")
|
||||
(define-obsolete-variable-alias 'eshell-host-names
|
||||
'pcomplete--host-name-cache "28.1")
|
||||
(define-obsolete-variable-alias 'eshell-host-timestamp
|
||||
'pcomplete--host-name-cache-timestamp "28.1")
|
||||
(defvar pcomplete--host-name-cache)
|
||||
(defvar pcomplete--host-name-cache-timestamp)
|
||||
|
||||
;;; Functions:
|
||||
|
||||
|
@ -479,37 +488,15 @@ list."
|
|||
|
||||
(defalias 'eshell-user-name 'user-login-name)
|
||||
|
||||
(defun eshell-read-hosts-file (filename)
|
||||
"Read in the hosts from FILENAME, default `eshell-hosts-file'."
|
||||
(let (hosts)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents (or filename eshell-hosts-file))
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward
|
||||
;; "^ \t\\([^# \t\n]+\\)[ \t]+\\([^ \t\n]+\\)\\([ \t]*\\([^ \t\n]+\\)\\)?"
|
||||
"^[ \t]*\\([^# \t\n]+\\)[ \t]+\\([^ \t\n].+\\)" nil t)
|
||||
(push (cons (match-string 1)
|
||||
(split-string (match-string 2)))
|
||||
hosts)))
|
||||
(nreverse hosts)))
|
||||
|
||||
(defun eshell-read-hosts (file result-var timestamp-var)
|
||||
"Read the contents of /etc/hosts for host names."
|
||||
(if (or (not (symbol-value result-var))
|
||||
(not (symbol-value timestamp-var))
|
||||
(time-less-p
|
||||
(symbol-value timestamp-var)
|
||||
(file-attribute-modification-time (file-attributes file))))
|
||||
(progn
|
||||
(set result-var (apply #'nconc (eshell-read-hosts-file file)))
|
||||
(set timestamp-var (current-time))))
|
||||
(symbol-value result-var))
|
||||
|
||||
(defun eshell-read-host-names ()
|
||||
"Read the contents of /etc/hosts for host names."
|
||||
(if eshell-hosts-file
|
||||
(eshell-read-hosts eshell-hosts-file 'eshell-host-names
|
||||
'eshell-host-timestamp)))
|
||||
(autoload 'pcomplete-read-hosts-file "pcomplete")
|
||||
(autoload 'pcomplete-read-hosts "pcomplete")
|
||||
(autoload 'pcomplete-read-host-names "pcomplete")
|
||||
(define-obsolete-function-alias 'eshell-read-hosts-file
|
||||
#'pcomplete-read-hosts-file "28.1")
|
||||
(define-obsolete-function-alias 'eshell-read-hosts
|
||||
#'pcomplete-read-hosts "28.1")
|
||||
(define-obsolete-function-alias 'eshell-read-host-names
|
||||
#'pcomplete-read-host-names "28.1")
|
||||
|
||||
(defsubst eshell-copy-environment ()
|
||||
"Return an unrelated copy of `process-environment'."
|
||||
|
|
|
@ -1926,6 +1926,14 @@ Only intended for interactive use."
|
|||
(ffap--toggle-read-only value)
|
||||
value))
|
||||
|
||||
(defun ffap-read-only-other-tab (filename)
|
||||
"Like `ffap', but put buffer in another tab and mark as read-only.
|
||||
Only intended for interactive use."
|
||||
(interactive (list (ffap-prompter nil " read only other tab")))
|
||||
(let ((value (window-buffer (ffap-other-tab filename))))
|
||||
(ffap--toggle-read-only value)
|
||||
value))
|
||||
|
||||
(defun ffap-alternate-file (filename)
|
||||
"Like `ffap' and `find-alternate-file'.
|
||||
Only intended for interactive use."
|
||||
|
|
|
@ -3070,7 +3070,7 @@ If FUNCTION is nil, then it is not called. (That is a way of saying
|
|||
"\\(?:!DOCTYPE[ \t\r\n]+[^>]*>[ \t\r\n]*<[ \t\r\n]*" comment-re "*\\)?"
|
||||
"[Hh][Tt][Mm][Ll]"))
|
||||
. mhtml-mode)
|
||||
("<!DOCTYPE[ \t\r\n]+[Hh][Tt][Mm][Ll]" . mhtml-mode)
|
||||
("<![Dd][Oo][Cc][Tt][Yy][Pp][Ee][ \t\r\n]+[Hh][Tt][Mm][Ll]" . mhtml-mode)
|
||||
;; These two must come after html, because they are more general:
|
||||
("<\\?xml " . xml-mode)
|
||||
(,(let* ((incomment-re "\\(?:[^-]\\|-[^-]\\)")
|
||||
|
@ -6257,6 +6257,82 @@ an auto-save file."
|
|||
(insert-file-contents file-name (not auto-save-p)
|
||||
nil nil t))))))
|
||||
|
||||
(defvar revert-buffer-with-fine-grain-max-seconds 2.0
|
||||
"Maximum time that `revert-buffer-with-fine-grain' should use.
|
||||
The command tries to preserve markers, properties and overlays.
|
||||
If the operation takes more than this time, a single
|
||||
delete+insert is performed. Actually, this value is passed as
|
||||
the MAX-SECS argument to the function `replace-buffer-contents',
|
||||
so it is not ensured that the whole execution won't take longer.
|
||||
See `replace-buffer-contents' for more details.")
|
||||
|
||||
(defun revert-buffer-insert-file-contents-delicately (file-name _auto-save-p)
|
||||
"Optional function for `revert-buffer-insert-file-contents-function'.
|
||||
The function `revert-buffer-with-fine-grain' uses this function by binding
|
||||
`revert-buffer-insert-file-contents-function' to it.
|
||||
|
||||
As with `revert-buffer-insert-file-contents--default-function', FILE-NAME is
|
||||
the name of the file and AUTO-SAVE-P is non-nil if this is an auto-save file.
|
||||
Since calling `replace-buffer-contents' can take a long time, depending of
|
||||
the number of changes made to the buffer, it uses the value of the variable
|
||||
`revert-buffer-with-fine-grain-max-seconds' as a maximum time to try delicately
|
||||
reverting the buffer. If it fails, it does a delete+insert. For more details,
|
||||
see `replace-buffer-contents'."
|
||||
(cond
|
||||
((not (file-exists-p file-name))
|
||||
(error (if buffer-file-number
|
||||
"File %s no longer exists"
|
||||
"Cannot revert nonexistent file %s")
|
||||
file-name))
|
||||
((not (file-readable-p file-name))
|
||||
(error (if buffer-file-number
|
||||
"File %s no longer readable"
|
||||
"Cannot revert unreadable file %s")
|
||||
file-name))
|
||||
(t
|
||||
(let* ((buf (current-buffer)) ; current-buffer is the buffer to revert.
|
||||
(success
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(widen)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file-name)
|
||||
(let ((temp-buf (current-buffer)))
|
||||
(set-buffer buf)
|
||||
(let ((buffer-file-name nil))
|
||||
(replace-buffer-contents
|
||||
temp-buf
|
||||
revert-buffer-with-fine-grain-max-seconds))))))))
|
||||
;; See comments in revert-buffer-with-fine-grain for an explanation.
|
||||
(defun revert-buffer-with-fine-grain-success-p ()
|
||||
success))
|
||||
(set-buffer-modified-p nil))))
|
||||
|
||||
(defun revert-buffer-with-fine-grain (&optional ignore-auto noconfirm)
|
||||
"Revert buffer preserving markers, overlays, etc.
|
||||
This command is an alternative to `revert-buffer' because it tries to be as
|
||||
non-destructive as possible, preserving markers, properties and overlays.
|
||||
Binds `revert-buffer-insert-file-contents-function' to the function
|
||||
`revert-buffer-insert-file-contents-delicately'.
|
||||
|
||||
With a prefix argument, offer to revert from latest auto-save file. For more
|
||||
details on the arguments, see `revert-buffer'."
|
||||
;; See revert-buffer for an explanation of this.
|
||||
(interactive (list (not current-prefix-arg)))
|
||||
;; Simply bind revert-buffer-insert-file-contents-function to the specialized
|
||||
;; function, and call revert-buffer.
|
||||
(let ((revert-buffer-insert-file-contents-function
|
||||
#'revert-buffer-insert-file-contents-delicately))
|
||||
(revert-buffer ignore-auto noconfirm t)
|
||||
;; This closure is defined in revert-buffer-insert-file-contents-function.
|
||||
;; It is needed because revert-buffer--default always returns t after
|
||||
;; reverting, and it might be needed to report the success/failure of
|
||||
;; reverting delicately.
|
||||
(when (fboundp 'revert-buffer-with-fine-grain-success-p)
|
||||
(prog1
|
||||
(revert-buffer-with-fine-grain-success-p)
|
||||
(fmakunbound 'revert-buffer-with-fine-grain-success-p)))))
|
||||
|
||||
(defun recover-this-file ()
|
||||
"Recover the visited file--get contents from its last auto-save file."
|
||||
(interactive)
|
||||
|
@ -6817,9 +6893,7 @@ We assume the output has the format of `df'.
|
|||
The value of this variable must be just a command name or file name;
|
||||
if you want to specify options, use `directory-free-space-args'.
|
||||
|
||||
A value of nil disables this feature.
|
||||
|
||||
This variable is obsolete; Emacs no longer uses it."
|
||||
A value of nil disables this feature."
|
||||
:type '(choice (string :tag "Program") (const :tag "None" nil))
|
||||
:group 'dired)
|
||||
(make-obsolete-variable 'directory-free-space-program
|
||||
|
|
|
@ -1304,7 +1304,7 @@ downloaded into the agent."
|
|||
;; gnus doesn't waste resources trying to fetch them.
|
||||
|
||||
;; NOTE: I don't do this for smaller gaps (< 100) as I don't
|
||||
;; want to modify the local file everytime someone restarts
|
||||
;; want to modify the local file every time someone restarts
|
||||
;; gnus. The small gap will cause a tiny performance hit
|
||||
;; when gnus tries, and fails, to retrieve the articles.
|
||||
;; Still that should be smaller than opening a buffer,
|
||||
|
|
|
@ -534,6 +534,13 @@ that the symbol of the saver function, which is specified by
|
|||
:group 'gnus-article-saving
|
||||
:type 'regexp)
|
||||
|
||||
(defcustom gnus-global-groups nil
|
||||
"Groups that should be considered like \"news\" groups.
|
||||
This means that images will be automatically loaded, for instance."
|
||||
:type '(repeat string)
|
||||
:version "28.1"
|
||||
:group 'gnus-article)
|
||||
|
||||
;; Note that "Rmail format" is mbox since Emacs 23, but Babyl before.
|
||||
(defcustom gnus-default-article-saver 'gnus-summary-save-in-rmail
|
||||
"A function to save articles in your favorite format.
|
||||
|
@ -7138,7 +7145,8 @@ If given a prefix, show the hidden text instead."
|
|||
"Allows images in newsgroups to be shown, blocks images in all
|
||||
other groups."
|
||||
(if (or (gnus-news-group-p group)
|
||||
(gnus-member-of-valid 'global group))
|
||||
(gnus-member-of-valid 'global group)
|
||||
(member group gnus-global-groups))
|
||||
;; Block nothing in news groups.
|
||||
nil
|
||||
;; Block everything anywhere else.
|
||||
|
|
|
@ -1352,8 +1352,10 @@ For the \"inline\" alternatives, also see the variable
|
|||
gcc)))
|
||||
(insert "Gcc: " (mapconcat 'identity gcc ", ") "\n")))))))
|
||||
|
||||
(defun gnus-summary-resend-message (address n)
|
||||
"Resend the current article to ADDRESS."
|
||||
(defun gnus-summary-resend-message (address n &optional no-select)
|
||||
"Resend the current article to ADDRESS.
|
||||
Uses the process/prefix convention. If NO-SELECT, don't display
|
||||
the message before resending."
|
||||
(interactive
|
||||
(list (message-read-from-minibuffer
|
||||
"Resend message(s) to: "
|
||||
|
@ -1372,6 +1374,7 @@ For the \"inline\" alternatives, also see the variable
|
|||
'posting-style t))
|
||||
(user-full-name user-full-name)
|
||||
(user-mail-address user-mail-address)
|
||||
(group gnus-newsgroup-name)
|
||||
tem)
|
||||
(dolist (style styles)
|
||||
(when (stringp (cadr style))
|
||||
|
@ -1395,11 +1398,18 @@ For the \"inline\" alternatives, also see the variable
|
|||
'(gnus-agent-possibly-do-gcc)
|
||||
'(gnus-inews-do-gcc)))))
|
||||
(dolist (article (gnus-summary-work-articles n))
|
||||
(gnus-summary-select-article nil nil nil article)
|
||||
(with-current-buffer gnus-original-article-buffer
|
||||
(let ((gnus-gcc-externalize-attachments nil)
|
||||
(message-inhibit-body-encoding t))
|
||||
(message-resend address)))
|
||||
(if no-select
|
||||
(with-current-buffer " *nntpd*"
|
||||
(erase-buffer)
|
||||
(gnus-request-article article group)
|
||||
(let ((gnus-gcc-externalize-attachments nil)
|
||||
(message-inhibit-body-encoding t))
|
||||
(message-resend address)))
|
||||
(gnus-summary-select-article nil nil nil article)
|
||||
(with-current-buffer gnus-original-article-buffer
|
||||
(let ((gnus-gcc-externalize-attachments nil)
|
||||
(message-inhibit-body-encoding t))
|
||||
(message-resend address))))
|
||||
(gnus-summary-mark-article-as-forwarded article))))
|
||||
|
||||
;; From: Matthieu Moy <Matthieu.Moy@imag.fr>
|
||||
|
|
|
@ -25,8 +25,6 @@
|
|||
|
||||
;;; Code:
|
||||
|
||||
(eval-when-compile (require 'cl-lib))
|
||||
|
||||
(require 'gnus)
|
||||
(require 'gnus-sum)
|
||||
(require 'gnus-art)
|
||||
|
@ -35,6 +33,7 @@
|
|||
(require 'message)
|
||||
(require 'score-mode)
|
||||
(require 'gmm-utils)
|
||||
(require 'cl-lib)
|
||||
|
||||
(defcustom gnus-global-score-files nil
|
||||
"List of global score files and directories.
|
||||
|
@ -497,6 +496,7 @@ of the last successful match.")
|
|||
("head" -1 gnus-score-body)
|
||||
("body" -1 gnus-score-body)
|
||||
("all" -1 gnus-score-body)
|
||||
(score-fn -1 nil)
|
||||
("followup" 2 gnus-score-followup)
|
||||
("thread" 5 gnus-score-thread)))
|
||||
|
||||
|
@ -1175,14 +1175,19 @@ If FORMAT, also format the current score file."
|
|||
(when format
|
||||
(gnus-score-pretty-print))
|
||||
(when (consp rule) ;; the rule exists
|
||||
(setq rule (mapconcat #'(lambda (obj)
|
||||
(regexp-quote (format "%S" obj)))
|
||||
rule
|
||||
sep))
|
||||
(setq rule (if (symbolp (car rule))
|
||||
(format "(%S)" (car rule))
|
||||
(mapconcat #'(lambda (obj)
|
||||
(regexp-quote (format "%S" obj)))
|
||||
rule
|
||||
sep)))
|
||||
(goto-char (point-min))
|
||||
(re-search-forward rule nil t)
|
||||
;; make it easy to use `kill-sexp':
|
||||
(goto-char (1- (match-beginning 0)))))))
|
||||
(let ((move (if (string-match "(.*)" rule)
|
||||
0
|
||||
-1)))
|
||||
(re-search-forward rule nil t)
|
||||
;; make it easy to use `kill-sexp':
|
||||
(goto-char (+ move (match-beginning 0))))))))
|
||||
|
||||
(defun gnus-score-load-file (file)
|
||||
;; Load score file FILE. Returns a list a retrieved score-alists.
|
||||
|
@ -1232,6 +1237,7 @@ If FORMAT, also format the current score file."
|
|||
(let ((mark (car (gnus-score-get 'mark alist)))
|
||||
(expunge (car (gnus-score-get 'expunge alist)))
|
||||
(mark-and-expunge (car (gnus-score-get 'mark-and-expunge alist)))
|
||||
(score-fn (car (gnus-score-get 'score-fn alist)))
|
||||
(files (gnus-score-get 'files alist))
|
||||
(exclude-files (gnus-score-get 'exclude-files alist))
|
||||
(orphan (car (gnus-score-get 'orphan alist)))
|
||||
|
@ -1567,10 +1573,14 @@ If FORMAT, also format the current score file."
|
|||
(gnus-message
|
||||
7 "Scoring on headers or body skipped.")
|
||||
nil)
|
||||
;; Run score-fn
|
||||
(if (eq header 'score-fn)
|
||||
(setq new (gnus-score-func scores trace))
|
||||
;; Call the scoring function for this type of "header".
|
||||
(setq new (funcall (nth 2 entry) scores header
|
||||
now expire trace)))
|
||||
now expire trace))))
|
||||
(push new news))))
|
||||
|
||||
(when (gnus-buffer-live-p gnus-summary-buffer)
|
||||
(let ((scored gnus-newsgroup-scored))
|
||||
(with-current-buffer gnus-summary-buffer
|
||||
|
@ -1636,6 +1646,30 @@ score in `gnus-newsgroup-scored' by SCORE."
|
|||
(not (string= id "")))
|
||||
(gnus-score-lower-thread thread score)))))
|
||||
|
||||
(defun gnus-score-func (scores &optional trace)
|
||||
(dolist (alist scores)
|
||||
(let ((articles gnus-scores-articles)
|
||||
(entries (assoc 'score-fn alist)))
|
||||
(dolist (score-fn (cdr entries))
|
||||
(let ((score-fn (car score-fn))
|
||||
article-alist score fn-score)
|
||||
(dolist (art articles)
|
||||
(setq article-alist
|
||||
(cl-pairlis
|
||||
'(number subject from date id
|
||||
refs chars lines xref extra)
|
||||
(car art))
|
||||
score (cdr art))
|
||||
(when (integerp (setq fn-score (funcall score-fn
|
||||
article-alist score)))
|
||||
(setcdr art (+ score fn-score)))
|
||||
(setq score (cdr art))
|
||||
(when (and trace
|
||||
(integerp fn-score))
|
||||
(push (cons (car-safe (rassq alist gnus-score-cache))
|
||||
(list score-fn fn-score))
|
||||
gnus-score-trace))))))))
|
||||
|
||||
(defun gnus-score-integer (scores header now expire &optional trace)
|
||||
(let ((gnus-score-index (nth 1 (assoc header gnus-header-index)))
|
||||
entries alist)
|
||||
|
|
|
@ -11537,7 +11537,7 @@ If ALL is non-nil, also mark ticked and dormant articles as read."
|
|||
(gnus-save-hidden-threads
|
||||
(let ((beg (point)))
|
||||
;; We check that there are unread articles.
|
||||
(when (or all (gnus-summary-find-next))
|
||||
(when (or all (gnus-summary-last-article-p) (gnus-summary-find-next))
|
||||
(gnus-summary-catchup all t beg nil t)))))
|
||||
(gnus-summary-position-point))
|
||||
|
||||
|
@ -11806,8 +11806,6 @@ will not be hidden."
|
|||
|
||||
(defun gnus-summary-hide-thread ()
|
||||
"Hide thread subtrees.
|
||||
If PREDICATE is supplied, threads that satisfy this predicate
|
||||
will not be hidden.
|
||||
Returns nil if no threads were there to be hidden."
|
||||
(interactive)
|
||||
(beginning-of-line)
|
||||
|
@ -11828,9 +11826,9 @@ Returns nil if no threads were there to be hidden."
|
|||
(overlay-put ol 'invisible 'gnus-sum)
|
||||
(overlay-put ol 'evaporate t)))
|
||||
(gnus-summary-goto-subject article)
|
||||
;; We moved backward past the start point (invisible thread?)
|
||||
(when (> start (point))
|
||||
(message "Hiding the thread moved us backwards, aborting!")
|
||||
(goto-char (point-max))))
|
||||
(goto-char starteol)))
|
||||
(goto-char start)
|
||||
nil))))
|
||||
|
||||
|
|
|
@ -4843,10 +4843,10 @@ If you always want Gnus to send messages in one piece, set
|
|||
Each line should be no more than 79 characters long."
|
||||
(goto-char (point-min))
|
||||
(while (not (eobp))
|
||||
(when (and (looking-at "[^:]+:")
|
||||
(> (- (line-end-position) (point)) 79))
|
||||
(mail-header-fold-field))
|
||||
(forward-line 1)))
|
||||
(if (and (looking-at "[^:]+:")
|
||||
(> (- (line-end-position) (point)) 79))
|
||||
(goto-char (mail-header-fold-field))
|
||||
(forward-line 1))))
|
||||
|
||||
(defvar sendmail-program)
|
||||
(defvar smtpmail-smtp-server)
|
||||
|
|
|
@ -546,7 +546,7 @@ If MODE is not set, try to find mode automatically."
|
|||
(mm-display-inline-fontify handle 'shell-script-mode))
|
||||
|
||||
(defun mm-display-javascript-inline (handle)
|
||||
"Show JavsScript code from HANDLE inline."
|
||||
"Show JavaScript code from HANDLE inline."
|
||||
(mm-display-inline-fontify handle 'javascript-mode))
|
||||
|
||||
;; id-signedData OBJECT IDENTIFIER ::= { iso(1) member-body(2)
|
||||
|
|
|
@ -1425,7 +1425,7 @@ all. This may very well take some time.")
|
|||
(pop years)))
|
||||
(if years
|
||||
;; Because we might not be limited in years, we must guard against
|
||||
;; infinite loops. Appart from cases like Feb 31, there are probably
|
||||
;; infinite loops. Apart from cases like Feb 31, there are probably
|
||||
;; other ones, (no monday XXX 2nd etc). I don't know any algorithm to
|
||||
;; decide this, so I assume that if we reach 10 years later, the
|
||||
;; schedule is undecidable.
|
||||
|
|
|
@ -211,7 +211,7 @@ By default this is the name of an email header field.")
|
|||
"Search groups in Gnus with assorted search engines."
|
||||
:group 'gnus)
|
||||
|
||||
(make-obsolete-variable 'nnir-summary-line-format "The formating
|
||||
(make-obsolete-variable 'nnir-summary-line-format "The formatting
|
||||
specs previously unique to this variable may now be set in
|
||||
'gnus-summary-line-format." "28.1")
|
||||
|
||||
|
|
|
@ -458,6 +458,7 @@ the variable `message-log-max'."
|
|||
"Display last few input keystrokes and the commands run.
|
||||
For convenience this uses the same format as
|
||||
`edit-last-kbd-macro'.
|
||||
See `lossage-size' to update the number of recorded keystrokes.
|
||||
|
||||
To record all your input, use `open-dribble-file'."
|
||||
(interactive)
|
||||
|
|
|
@ -1034,7 +1034,7 @@ then the specification is returned unchanged."
|
|||
((facep fn)
|
||||
(hfy-face-attr-for-class fn hfy-display-class))
|
||||
;; FIXME: is this necessary? Faces can be symbols, but
|
||||
;; not symbols refering to other symbols?
|
||||
;; not symbols referring to other symbols?
|
||||
((and (symbolp fn)
|
||||
(facep (symbol-value fn)))
|
||||
(hfy-face-attr-for-class
|
||||
|
|
|
@ -956,6 +956,7 @@ This function first looks for a case-sensitive match for NODENAME;
|
|||
if none is found it then tries a case-insensitive match (unless
|
||||
STRICT-CASE is non-nil)."
|
||||
(info-initialize)
|
||||
(setq nodename (info--node-canonicalize-whitespace nodename))
|
||||
(setq filename (Info-find-file filename))
|
||||
;; Go into Info buffer.
|
||||
(or (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
|
||||
|
@ -2684,14 +2685,16 @@ Because of ambiguities, this should be concatenated with something like
|
|||
;;; (setq Info-point-loc
|
||||
;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1))))
|
||||
)
|
||||
(replace-regexp-in-string
|
||||
"[ \n]+" " "
|
||||
(info--node-canonicalize-whitespace
|
||||
(or (and (not (equal (match-string-no-properties 2) ""))
|
||||
(match-string-no-properties 2))
|
||||
;; If the node name is the menu entry name (using `entry::').
|
||||
(buffer-substring-no-properties
|
||||
(match-beginning 0) (1- (match-beginning 1)))))))
|
||||
|
||||
(defun info--node-canonicalize-whitespace (string)
|
||||
(replace-regexp-in-string "[ \t\n]+" " " string))
|
||||
|
||||
;; No one calls this.
|
||||
;;(defun Info-menu-item-sequence (list)
|
||||
;; (while list
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
;;
|
||||
;; D. Sorting and Composition of Smaller Blocks (`ucs-normalize-block-compose-chars')
|
||||
;;
|
||||
;; The block will be split to multiple samller blocks by starter
|
||||
;; The block will be split to multiple smaller blocks by starter
|
||||
;; characters. Each block is sorted, and composed if necessary.
|
||||
;;
|
||||
;; E. Composition of Entire Block (`ucs-normalize-compose-chars')
|
||||
|
|
120
lisp/isearch.el
120
lisp/isearch.el
|
@ -269,6 +269,14 @@ are `word-search-regexp' \(`\\[isearch-toggle-word]'), `isearch-symbol-regexp'
|
|||
"Non-nil means incremental search highlights the current match."
|
||||
:type 'boolean)
|
||||
|
||||
(defcustom search-highlight-submatches t
|
||||
"Whether to highlight regexp subexpressions of the current regexp match.
|
||||
|
||||
The faces used to do the highlights are named `isearch-group-1',
|
||||
`isearch-group-2', and so on."
|
||||
:type 'boolean
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch
|
||||
'((((class color) (min-colors 88) (background light))
|
||||
;; The background must not be too dark, for that means
|
||||
|
@ -3654,6 +3662,98 @@ since they have special meaning in a regexp."
|
|||
;; Highlighting
|
||||
|
||||
(defvar isearch-overlay nil)
|
||||
(defvar isearch-submatches-overlays nil)
|
||||
|
||||
(defface isearch-group-1
|
||||
'((((class color) (background light))
|
||||
(:background "#ff00ff" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "palevioletred3" :foreground "brown4"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (first sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-2
|
||||
'((((class color) (background light))
|
||||
(:background "#d000d0" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#be698f" :foreground "black"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (second sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-3
|
||||
'((((class color) (background light))
|
||||
(:background "#a000a0" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#a06080" :foreground "brown4"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (third sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-4
|
||||
'((((class color) (background light))
|
||||
(:background "#800080" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#905070" :foreground "brown4"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (fourth sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-5
|
||||
'((((class color) (background light))
|
||||
(:background "#600060" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#804060" :foreground "black"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (fifth sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-6
|
||||
'((((class color) (background light))
|
||||
(:background "#500050" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#703050" :foreground "white"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (sixth sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-7
|
||||
'((((class color) (background light))
|
||||
(:background "#400040" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#602050" :foreground "white"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (seventh sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-8
|
||||
'((((class color) (background light))
|
||||
(:background "#300030" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#501050" :foreground "white"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (eighth sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
(defface isearch-group-9
|
||||
'((((class color) (background light))
|
||||
(:background "#200020" :foreground "lightskyblue1"))
|
||||
(((class color) (background dark))
|
||||
(:background "#400040" :foreground "white"))
|
||||
(t (:inverse-video t)))
|
||||
"Face for highlighting Isearch sub-group matches (ninth sub-group)."
|
||||
:group 'isearch
|
||||
:version "28.1")
|
||||
|
||||
|
||||
(defun isearch-highlight (beg end)
|
||||
(if search-highlight
|
||||
|
@ -3664,11 +3764,27 @@ since they have special meaning in a regexp."
|
|||
(setq isearch-overlay (make-overlay beg end))
|
||||
;; 1001 is higher than lazy's 1000 and ediff's 100+
|
||||
(overlay-put isearch-overlay 'priority 1001)
|
||||
(overlay-put isearch-overlay 'face isearch-face))))
|
||||
(overlay-put isearch-overlay 'face isearch-face)))
|
||||
(when (and search-highlight-submatches
|
||||
isearch-regexp)
|
||||
(mapc 'delete-overlay isearch-submatches-overlays)
|
||||
(setq isearch-submatches-overlays nil)
|
||||
(let ((i 0) ov)
|
||||
(while (<= i 9)
|
||||
(when (match-beginning i)
|
||||
(setq ov (make-overlay (match-beginning i) (match-end i)))
|
||||
(overlay-put ov 'face (intern-soft (format "isearch-group-%d" i)))
|
||||
(overlay-put ov 'priority 1002)
|
||||
(push ov isearch-submatches-overlays))
|
||||
(setq i (1+ i))))))
|
||||
|
||||
(defun isearch-dehighlight ()
|
||||
(when isearch-overlay
|
||||
(delete-overlay isearch-overlay)))
|
||||
(delete-overlay isearch-overlay))
|
||||
(when search-highlight-submatches
|
||||
(mapc 'delete-overlay isearch-submatches-overlays)
|
||||
(setq isearch-submatches-overlays nil)))
|
||||
|
||||
|
||||
;; isearch-lazy-highlight feature
|
||||
;; by Bob Glickstein <http://www.zanshin.com/~bobg/>
|
||||
|
|
|
@ -432,14 +432,14 @@ Initialized lazily by `json-encode-string'.")
|
|||
;; string length as our heuristic. See also bug#20154.
|
||||
(if (and (< (length string) json--long-string-threshold)
|
||||
(not (string-match-p (rx json--escape) string)))
|
||||
(concat "\"" string "\"")
|
||||
(concat "\"" (substring-no-properties string) "\"")
|
||||
(with-current-buffer
|
||||
(or json--string-buffer
|
||||
(with-current-buffer (generate-new-buffer " *json-string*")
|
||||
;; This seems to afford decent performance gains.
|
||||
(setq-local inhibit-modification-hooks t)
|
||||
(setq json--string-buffer (current-buffer))))
|
||||
(insert ?\" string)
|
||||
(insert ?\" (substring-no-properties string)) ; see bug#43549
|
||||
(goto-char (1+ (point-min)))
|
||||
(while (re-search-forward (rx json--escape) nil 'move)
|
||||
(let ((char (preceding-char)))
|
||||
|
|
|
@ -274,7 +274,7 @@ error of type `jsonrpc-error'.
|
|||
DEFERRED is passed to `jsonrpc-async-request', which see.
|
||||
|
||||
If CANCEL-ON-INPUT is non-nil and the user inputs something while
|
||||
the functino is waiting, then it exits immediately, returning
|
||||
the function is waiting, then it exits immediately, returning
|
||||
CANCEL-ON-INPUT-RETVAL. Any future replies (normal or error) are
|
||||
ignored."
|
||||
(let* ((tag (cl-gensym "jsonrpc-request-catch-tag")) id-and-timer
|
||||
|
@ -336,7 +336,7 @@ ignored."
|
|||
"Time in seconds before timing out a JSONRPC request.")
|
||||
|
||||
|
||||
;;; Specfic to `jsonrpc-process-connection'
|
||||
;;; Specific to `jsonrpc-process-connection'
|
||||
;;;
|
||||
|
||||
(defclass jsonrpc-process-connection (jsonrpc-connection)
|
||||
|
|
|
@ -924,7 +924,7 @@ The ARG parameter is unused."
|
|||
nil
|
||||
(if kmacro-view-last-item
|
||||
(concat (cond ((= kmacro-view-item-no 2) "2nd")
|
||||
((= kmacro-view-item-no 3) "3nd")
|
||||
((= kmacro-view-item-no 3) "3rd")
|
||||
(t (format "%dth" kmacro-view-item-no)))
|
||||
" previous macro")
|
||||
"Last macro")))
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
(concat "korean-hangul" default-korean-keyboard))))
|
||||
|
||||
(defun quail-hangul-switch-symbol-ksc (&rest ignore)
|
||||
"Swith to/from Korean symbol package."
|
||||
"Switch to/from Korean symbol package."
|
||||
(interactive "i")
|
||||
(and current-input-method
|
||||
(if (string-equal current-input-method "korean-symbol")
|
||||
|
@ -55,7 +55,7 @@
|
|||
(activate-input-method "korean-symbol"))))
|
||||
|
||||
(defun quail-hangul-switch-hanja (&rest ignore)
|
||||
"Swith to/from Korean hanja package."
|
||||
"Switch to/from Korean hanja package."
|
||||
(interactive "i")
|
||||
(and current-input-method
|
||||
(if (string-match "korean-hanja" current-input-method)
|
||||
|
|
|
@ -416,67 +416,73 @@ usually do not have translators for other languages.\n\n")))
|
|||
|
||||
(defun report-emacs-bug-hook ()
|
||||
"Do some checking before sending a bug report."
|
||||
(save-excursion
|
||||
(goto-char (point-max))
|
||||
(skip-chars-backward " \t\n")
|
||||
(and (= (- (point) (point-min))
|
||||
(length report-emacs-bug-orig-text))
|
||||
(string-equal (buffer-substring-no-properties (point-min) (point))
|
||||
report-emacs-bug-orig-text)
|
||||
(error "No text entered in bug report"))
|
||||
;; Warning for novice users.
|
||||
(when (and (string-match "bug-gnu-emacs@gnu\\.org" (mail-fetch-field "to"))
|
||||
(not report-emacs-bug-no-confirmation)
|
||||
(not (yes-or-no-p
|
||||
"Send this bug report to the Emacs maintainers? ")))
|
||||
(with-output-to-temp-buffer "*Bug Help*"
|
||||
(princ (substitute-command-keys
|
||||
(format "\
|
||||
(goto-char (point-max))
|
||||
(skip-chars-backward " \t\n")
|
||||
(and (= (- (point) (point-min))
|
||||
(length report-emacs-bug-orig-text))
|
||||
(string-equal (buffer-substring-no-properties (point-min) (point))
|
||||
report-emacs-bug-orig-text)
|
||||
(error "No text entered in bug report"))
|
||||
;; Warning for novice users.
|
||||
(when (and (string-match "bug-gnu-emacs@gnu\\.org" (mail-fetch-field "to"))
|
||||
(not report-emacs-bug-no-confirmation)
|
||||
(not (yes-or-no-p
|
||||
"Send this bug report to the Emacs maintainers? ")))
|
||||
(with-output-to-temp-buffer "*Bug Help*"
|
||||
(princ (substitute-command-keys
|
||||
(format "\
|
||||
You invoked the command M-x report-emacs-bug,
|
||||
but you decided not to mail the bug report to the Emacs maintainers.
|
||||
|
||||
If you want to mail it to someone else instead,
|
||||
please insert the proper e-mail address after \"To: \",
|
||||
and send the mail again%s."
|
||||
(if report-emacs-bug-send-command
|
||||
(format " using \\[%s]"
|
||||
report-emacs-bug-send-command)
|
||||
"")))))
|
||||
(error "M-x report-emacs-bug was canceled, please read *Bug Help* buffer"))
|
||||
;; Query the user for the SMTP method, so that we can skip
|
||||
;; questions about From header validity if the user is going to
|
||||
;; use mailclient, anyway.
|
||||
(when (or (and (derived-mode-p 'message-mode)
|
||||
(eq message-send-mail-function 'sendmail-query-once))
|
||||
(and (not (derived-mode-p 'message-mode))
|
||||
(eq send-mail-function 'sendmail-query-once)))
|
||||
(sendmail-query-user-about-smtp)
|
||||
(when (derived-mode-p 'message-mode)
|
||||
(setq message-send-mail-function (message-default-send-mail-function))))
|
||||
(or report-emacs-bug-no-confirmation
|
||||
;; mailclient.el does not need a valid From
|
||||
(if (derived-mode-p 'message-mode)
|
||||
(eq message-send-mail-function 'message-send-mail-with-mailclient)
|
||||
(eq send-mail-function 'mailclient-send-it))
|
||||
;; Not narrowing to the headers, but that's OK.
|
||||
(let ((from (mail-fetch-field "From")))
|
||||
(and (or (not from)
|
||||
(message-bogus-recipient-p from)
|
||||
;; This is the default user-mail-address. On today's
|
||||
;; systems, it seems more likely to be wrong than right,
|
||||
;; since most people don't run their own mail server.
|
||||
(string-match (format "\\<%s@%s\\>"
|
||||
(regexp-quote (user-login-name))
|
||||
(regexp-quote (system-name)))
|
||||
from))
|
||||
(not (yes-or-no-p
|
||||
(format-message "Is `%s' really your email address? "
|
||||
from)))
|
||||
(error "Please edit the From address and try again"))))
|
||||
;; Bury the help buffer (if it's shown).
|
||||
(when-let ((help (get-buffer "*Bug Help*")))
|
||||
(when (get-buffer-window help)
|
||||
(quit-window nil (get-buffer-window help))))))
|
||||
(if report-emacs-bug-send-command
|
||||
(format " using \\[%s]"
|
||||
report-emacs-bug-send-command)
|
||||
"")))))
|
||||
(error "M-x report-emacs-bug was canceled, please read *Bug Help* buffer"))
|
||||
;; Query the user for the SMTP method, so that we can skip
|
||||
;; questions about From header validity if the user is going to
|
||||
;; use mailclient, anyway.
|
||||
(when (or (and (derived-mode-p 'message-mode)
|
||||
(eq (message-default-send-mail-function) 'sendmail-query-once))
|
||||
(and (not (derived-mode-p 'message-mode))
|
||||
(eq send-mail-function 'sendmail-query-once)))
|
||||
(setq send-mail-function (sendmail-query-user-about-smtp))
|
||||
(when (derived-mode-p 'message-mode)
|
||||
(setq message-send-mail-function (message-default-send-mail-function))
|
||||
(add-hook 'message-sent-hook
|
||||
(lambda ()
|
||||
(when (y-or-n-p "Save this mail sending choice?")
|
||||
(customize-save-variable 'send-mail-function
|
||||
send-mail-function)))
|
||||
nil t)))
|
||||
(or report-emacs-bug-no-confirmation
|
||||
;; mailclient.el does not need a valid From
|
||||
(eq send-mail-function 'mailclient-send-it)
|
||||
;; Not narrowing to the headers, but that's OK.
|
||||
(let ((from (mail-fetch-field "From")))
|
||||
(when (and (or (not from)
|
||||
(message-bogus-recipient-p from)
|
||||
;; This is the default user-mail-address. On
|
||||
;; today's systems, it seems more likely to
|
||||
;; be wrong than right, since most people
|
||||
;; don't run their own mail server.
|
||||
(string-match (format "\\<%s@%s\\>"
|
||||
(regexp-quote (user-login-name))
|
||||
(regexp-quote (system-name)))
|
||||
from))
|
||||
(not (yes-or-no-p
|
||||
(format-message "Is `%s' really your email address? "
|
||||
from))))
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "^From: " nil t)
|
||||
(error "Please edit the From address and try again"))))
|
||||
;; Bury the help buffer (if it's shown).
|
||||
(when-let ((help (get-buffer "*Bug Help*")))
|
||||
(when (get-buffer-window help)
|
||||
(quit-window nil (get-buffer-window help)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun submit-emacs-patch (subject file)
|
||||
|
|
|
@ -134,7 +134,7 @@ The mail client is taken to be the handler of mailto URLs."
|
|||
character-coding
|
||||
;; Use the external browser function to send the
|
||||
;; message.
|
||||
(browse-url-mailto-function nil))
|
||||
(browse-url-default-handlers nil))
|
||||
;; initialize limiter
|
||||
(setq mailclient-delim-static "?")
|
||||
;; construct and call up mailto URL
|
||||
|
|
|
@ -716,11 +716,13 @@ Point moves to the end of the region."
|
|||
(goto-char e)))))
|
||||
|
||||
(defun rfc2047-fold-field ()
|
||||
"Fold the current header field."
|
||||
"Fold the current header field.
|
||||
Return the new end point."
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(rfc2047-narrow-to-field)
|
||||
(rfc2047-fold-region (point-min) (point-max)))))
|
||||
(rfc2047-fold-region (point-min) (point-max))
|
||||
(point-max))))
|
||||
|
||||
(defun rfc2047-fold-region (b e)
|
||||
"Fold long lines in region B to E."
|
||||
|
|
|
@ -1508,8 +1508,11 @@ manpage command."
|
|||
|
||||
(when delete-buff
|
||||
(if (window-live-p (get-buffer-window Man-buffer t))
|
||||
(quit-restore-window
|
||||
(get-buffer-window Man-buffer t) 'kill)
|
||||
(progn
|
||||
(quit-restore-window
|
||||
(get-buffer-window Man-buffer t) 'kill)
|
||||
;; Ensure that we end up in the correct window.
|
||||
(select-window (old-selected-window)))
|
||||
(kill-buffer Man-buffer)))
|
||||
|
||||
(when message
|
||||
|
|
123
lisp/menu-bar.el
123
lisp/menu-bar.el
|
@ -663,31 +663,63 @@ PROPS are additional properties."
|
|||
:button (:toggle . (and (default-boundp ',fname)
|
||||
(default-value ',fname)))))
|
||||
|
||||
(defmacro menu-bar-make-toggle (name variable doc message help &rest body)
|
||||
(defmacro menu-bar-make-toggle (command variable item-name message help
|
||||
&rest body)
|
||||
"Define a menu-bar toggle command.
|
||||
See `menu-bar-make-toggle-command', for which this is a
|
||||
compatability wrapper. BODY is passed in as SETTING-SEXP in that macro."
|
||||
(declare (obsolete menu-bar-make-toggle-command "28.1"))
|
||||
`(menu-bar-make-toggle-command ,command ,variable ,item-name ,message ,help
|
||||
,(and body
|
||||
`(progn
|
||||
,@body))))
|
||||
|
||||
(defmacro menu-bar-make-toggle-command (command variable item-name message
|
||||
help
|
||||
&optional setting-sexp
|
||||
&rest keywords)
|
||||
"Define a menu-bar toggle command.
|
||||
COMMAND (a symbol) is the toggle command to define.
|
||||
|
||||
VARIABLE (a symbol) is the variable to set.
|
||||
|
||||
ITEM-NAME (a string) is the menu-item name.
|
||||
|
||||
MESSAGE is a format string for the toggle message, with %s for the new
|
||||
status.
|
||||
|
||||
HELP (a string) is the `:help' tooltip text and the doc string first
|
||||
line (minus final period) for the command.
|
||||
|
||||
SETTING-SEXP is a Lisp sexp that sets VARIABLE, or it is nil meaning
|
||||
set it according to its `defcustom' or using `set-default'.
|
||||
|
||||
KEYWORDS is a plist for `menu-item' for keywords other than `:help'."
|
||||
`(progn
|
||||
(defun ,name (&optional interactively)
|
||||
(defun ,command (&optional interactively)
|
||||
,(concat "Toggle whether to " (downcase (substring help 0 1))
|
||||
(substring help 1) ".
|
||||
(substring help 1) ".
|
||||
In an interactive call, record this option as a candidate for saving
|
||||
by \"Save Options\" in Custom buffers.")
|
||||
(interactive "p")
|
||||
(if ,(if body `(progn . ,body)
|
||||
`(progn
|
||||
(if ,(if setting-sexp
|
||||
`,setting-sexp
|
||||
`(progn
|
||||
(custom-load-symbol ',variable)
|
||||
(let ((set (or (get ',variable 'custom-set) 'set-default))
|
||||
(get (or (get ',variable 'custom-get) 'default-value)))
|
||||
(funcall set ',variable (not (funcall get ',variable))))))
|
||||
(message ,message "enabled globally")
|
||||
(message ,message "disabled globally"))
|
||||
;; The function `customize-mark-as-set' must only be called when
|
||||
;; a variable is set interactively, as the purpose is to mark it as
|
||||
;; a candidate for "Save Options", and we do not want to save options
|
||||
;; the user have already set explicitly in his init file.
|
||||
(if interactively (customize-mark-as-set ',variable)))
|
||||
'(menu-item ,doc ,name
|
||||
:help ,help
|
||||
:button (:toggle . (and (default-boundp ',variable)
|
||||
(default-value ',variable))))))
|
||||
(message ,message "enabled globally")
|
||||
(message ,message "disabled globally"))
|
||||
;; `customize-mark-as-set' must only be called when a variable is set
|
||||
;; interactively, because the purpose is to mark the variable as a
|
||||
;; candidate for `Save Options', and we do not want to save options that
|
||||
;; the user has already set explicitly in the init file.
|
||||
(when interactively (customize-mark-as-set ',variable)))
|
||||
'(menu-item ,item-name ,command :help ,help
|
||||
:button (:toggle . (and (default-boundp ',variable)
|
||||
(default-value ',variable)))
|
||||
,@keywords)))
|
||||
|
||||
;; Function for setting/saving default font.
|
||||
|
||||
|
@ -959,10 +991,11 @@ The selected font will be the default on both the existing and future frames."
|
|||
:help "Indicate buffer boundaries in fringe"))
|
||||
|
||||
(bindings--define-key menu [indicate-empty-lines]
|
||||
(menu-bar-make-toggle toggle-indicate-empty-lines indicate-empty-lines
|
||||
"Empty Line Indicators"
|
||||
"Indicating of empty lines %s"
|
||||
"Indicate trailing empty lines in fringe, globally"))
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-indicate-empty-lines indicate-empty-lines
|
||||
"Empty Line Indicators"
|
||||
"Indicating of empty lines %s"
|
||||
"Indicate trailing empty lines in fringe, globally"))
|
||||
|
||||
(bindings--define-key menu [customize]
|
||||
'(menu-item "Customize Fringe" menu-bar-showhide-fringe-menu-customize
|
||||
|
@ -1407,7 +1440,7 @@ mail status in mode line"))
|
|||
(bindings--define-key menu [custom-separator]
|
||||
menu-bar-separator)
|
||||
(bindings--define-key menu [case-fold-search]
|
||||
(menu-bar-make-toggle
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-case-fold-search case-fold-search
|
||||
"Ignore Case"
|
||||
"Case-Insensitive Search %s"
|
||||
|
@ -1438,7 +1471,7 @@ mail status in mode line"))
|
|||
|
||||
(if (featurep 'system-font-setting)
|
||||
(bindings--define-key menu [menu-system-font]
|
||||
(menu-bar-make-toggle
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-use-system-font font-use-system-font
|
||||
"Use System Font"
|
||||
"Use system font: %s"
|
||||
|
@ -1464,13 +1497,15 @@ mail status in mode line"))
|
|||
menu-bar-separator)
|
||||
|
||||
(bindings--define-key menu [debug-on-quit]
|
||||
(menu-bar-make-toggle toggle-debug-on-quit debug-on-quit
|
||||
"Enter Debugger on Quit/C-g" "Debug on Quit %s"
|
||||
"Enter Lisp debugger when C-g is pressed"))
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-debug-on-quit debug-on-quit
|
||||
"Enter Debugger on Quit/C-g" "Debug on Quit %s"
|
||||
"Enter Lisp debugger when C-g is pressed"))
|
||||
(bindings--define-key menu [debug-on-error]
|
||||
(menu-bar-make-toggle toggle-debug-on-error debug-on-error
|
||||
"Enter Debugger on Error" "Debug on Error %s"
|
||||
"Enter Lisp debugger when an error is signaled"))
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-debug-on-error debug-on-error
|
||||
"Enter Debugger on Error" "Debug on Error %s"
|
||||
"Enter Lisp debugger when an error is signaled"))
|
||||
(bindings--define-key menu [debugger-separator]
|
||||
menu-bar-separator)
|
||||
|
||||
|
@ -1483,31 +1518,33 @@ mail status in mode line"))
|
|||
menu-bar-separator)
|
||||
|
||||
(bindings--define-key menu [save-desktop]
|
||||
(menu-bar-make-toggle
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-save-desktop-globally desktop-save-mode
|
||||
"Save State between Sessions"
|
||||
"Saving desktop state %s"
|
||||
"Visit desktop of previous session when restarting Emacs"
|
||||
(require 'desktop)
|
||||
;; Do it by name, to avoid a free-variable
|
||||
;; warning during byte compilation.
|
||||
(set-default
|
||||
'desktop-save-mode (not (symbol-value 'desktop-save-mode)))))
|
||||
(progn
|
||||
(require 'desktop)
|
||||
;; Do it by name, to avoid a free-variable
|
||||
;; warning during byte compilation.
|
||||
(set-default
|
||||
'desktop-save-mode (not (symbol-value 'desktop-save-mode))))))
|
||||
|
||||
(bindings--define-key menu [save-place]
|
||||
(menu-bar-make-toggle
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-save-place-globally save-place-mode
|
||||
"Save Place in Files between Sessions"
|
||||
"Saving place in files %s"
|
||||
"Visit files of previous session when restarting Emacs"
|
||||
(require 'saveplace)
|
||||
;; Do it by name, to avoid a free-variable
|
||||
;; warning during byte compilation.
|
||||
(set-default
|
||||
'save-place-mode (not (symbol-value 'save-place-mode)))))
|
||||
(progn
|
||||
(require 'saveplace)
|
||||
;; Do it by name, to avoid a free-variable
|
||||
;; warning during byte compilation.
|
||||
(set-default
|
||||
'save-place-mode (not (symbol-value 'save-place-mode))))))
|
||||
|
||||
(bindings--define-key menu [uniquify]
|
||||
(menu-bar-make-toggle
|
||||
(menu-bar-make-toggle-command
|
||||
toggle-uniquify-buffer-names uniquify-buffer-name-style
|
||||
"Use Directory Names in Buffer Names"
|
||||
"Directory name in buffer names (uniquify) %s"
|
||||
|
@ -1521,7 +1558,7 @@ mail status in mode line"))
|
|||
(bindings--define-key menu [cua-mode]
|
||||
(menu-bar-make-mm-toggle
|
||||
cua-mode
|
||||
"Use CUA Keys (Cut/Paste with C-x/C-c/C-v)"
|
||||
"Cut/Paste with C-x/C-c/C-v (CUA Mode)"
|
||||
"Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste"
|
||||
(:visible (or (not (boundp 'cua-enable-cua-keys))
|
||||
cua-enable-cua-keys))))
|
||||
|
@ -2448,7 +2485,7 @@ created in the future."
|
|||
(put 'menu-bar-mode 'standard-value '(t))
|
||||
|
||||
(defun toggle-menu-bar-mode-from-frame (&optional arg)
|
||||
"Toggle menu bar on or off, based on the status of the current frame.
|
||||
"Toggle display of the menu bar of the current frame.
|
||||
See `menu-bar-mode' for more information."
|
||||
(interactive (list (or current-prefix-arg 'toggle)))
|
||||
(if (eq arg 'toggle)
|
||||
|
|
|
@ -148,7 +148,7 @@ Use \\<mh-folder-mode-map>\\[mh-widen] to undo this command."
|
|||
"Put all following messages with same subject in sequence 'subject.
|
||||
If arg ALL is t, move to beginning of folder buffer to collect all
|
||||
messages.
|
||||
If arg ALL is nil, collect only messages fron current one on forward.
|
||||
If arg ALL is nil, collect only messages from current one on forward.
|
||||
|
||||
Return number of messages put in the sequence:
|
||||
|
||||
|
@ -198,7 +198,7 @@ It would be desirable to avoid hard-coding this.")
|
|||
|
||||
This function only works with an unthreaded folder. If arg ALL is
|
||||
t, move to beginning of folder buffer to collect all messages. If
|
||||
arg ALL is nil, collect only messages fron current one on
|
||||
arg ALL is nil, collect only messages from current one on
|
||||
forward.
|
||||
|
||||
Return number of messages put in the sequence:
|
||||
|
|
|
@ -307,7 +307,7 @@ The function will expand out parent folders of FOLDER if needed."
|
|||
(mh-speed-toggle))
|
||||
(goto-char (gethash prefix mh-speed-folder-map))))
|
||||
(while suffix-list
|
||||
;; We always need atleast one toggle. We need two if the directory list
|
||||
;; We always need at least one toggle. We need two if the directory list
|
||||
;; is stale since a folder was added.
|
||||
(when (equal prefix (get-text-property (mh-line-beginning-position)
|
||||
'mh-folder))
|
||||
|
|
|
@ -44,12 +44,12 @@
|
|||
(concat
|
||||
(regexp-quote (substring minibuffer-default-prompt-format
|
||||
0 (match-beginning 0)))
|
||||
".*"
|
||||
"\\(.*?\\)"
|
||||
(regexp-quote (substring minibuffer-default-prompt-format
|
||||
(match-end 0))))
|
||||
(regexp-quote minibuffer-default-prompt-format))
|
||||
"\\): ")
|
||||
1)
|
||||
1 (and minibuffer-eldef-shorten-default " [\\2]"))
|
||||
`(("\\( (default\\(?: is\\)? \\(.*\\))\\):? \\'"
|
||||
1 ,(if minibuffer-eldef-shorten-default " [\\2]"))
|
||||
("([^(]+?\\(, default\\(?: is\\)? \\(.*\\)\\)):? \\'" 1)
|
||||
|
|
|
@ -1065,10 +1065,16 @@ in the last `cdr'."
|
|||
(defun completion--replace (beg end newtext)
|
||||
"Replace the buffer text between BEG and END with NEWTEXT.
|
||||
Moves point to the end of the new text."
|
||||
;; The properties on `newtext' include things like
|
||||
;; completions-first-difference, which we don't want to include
|
||||
;; upon insertion.
|
||||
(set-text-properties 0 (length newtext) nil newtext)
|
||||
;; The properties on `newtext' include things like the
|
||||
;; `completions-first-difference' face, which we don't want to
|
||||
;; include upon insertion.
|
||||
(if minibuffer-allow-text-properties
|
||||
;; If we're preserving properties, then just remove the faces
|
||||
;; and other properties added by the completion machinery.
|
||||
(remove-text-properties 0 (length newtext) '(face completion-score)
|
||||
newtext)
|
||||
;; Remove all text properties.
|
||||
(set-text-properties 0 (length newtext) nil newtext))
|
||||
;; Maybe this should be in subr.el.
|
||||
;; You'd think this is trivial to do, but details matter if you want
|
||||
;; to keep markers "at the right place" and be robust in the face of
|
||||
|
|
|
@ -203,13 +203,13 @@ Also see `mouse-wheel-tilt-scroll'."
|
|||
(defvar mouse-wheel-left-event
|
||||
(if (or (featurep 'w32-win) (featurep 'ns-win))
|
||||
'wheel-left
|
||||
(intern "mouse-6"))
|
||||
'mouse-6)
|
||||
"Event used for scrolling left.")
|
||||
|
||||
(defvar mouse-wheel-right-event
|
||||
(if (or (featurep 'w32-win) (featurep 'ns-win))
|
||||
'wheel-right
|
||||
(intern "mouse-7"))
|
||||
'mouse-7)
|
||||
"Event used for scrolling right.")
|
||||
|
||||
(defun mouse-wheel--get-scroll-window (event)
|
||||
|
|
234
lisp/net/dbus.el
234
lisp/net/dbus.el
|
@ -51,6 +51,8 @@
|
|||
(unless (boundp 'dbus-debug)
|
||||
(defvar dbus-debug nil))
|
||||
|
||||
(require 'seq)
|
||||
(require 'subr-x)
|
||||
(require 'xml)
|
||||
|
||||
;;; D-Bus constants.
|
||||
|
@ -160,21 +162,19 @@ See URL `https://dbus.freedesktop.org/doc/dbus-specification.html#standard-inter
|
|||
:link '(custom-manual "(dbus)Top")
|
||||
:version "28.1")
|
||||
|
||||
(defcustom dbus-show-dbus-errors nil
|
||||
"Propagate incoming D-Bus error messages."
|
||||
:version "28.1"
|
||||
:type 'boolean)
|
||||
|
||||
(defconst dbus-error-dbus "org.freedesktop.DBus.Error"
|
||||
"The namespace for default error names.
|
||||
See /usr/include/dbus-1.0/dbus/dbus-protocol.h.")
|
||||
|
||||
(defconst dbus-error-failed (concat dbus-error-dbus ".Failed")
|
||||
"A generic error; \"something went wrong\" - see the error message for more.")
|
||||
|
||||
(defconst dbus-error-access-denied (concat dbus-error-dbus ".AccessDenied")
|
||||
"Security restrictions don't allow doing what you're trying to do.")
|
||||
|
||||
(defconst dbus-error-disconnected (concat dbus-error-dbus ".Disconnected")
|
||||
"The connection is disconnected and you're trying to use it.")
|
||||
|
||||
(defconst dbus-error-failed (concat dbus-error-dbus ".Failed")
|
||||
"A generic error; \"something went wrong\" - see the error message for more.")
|
||||
|
||||
(defconst dbus-error-invalid-args (concat dbus-error-dbus ".InvalidArgs")
|
||||
"Invalid arguments passed to a method call.")
|
||||
|
||||
|
@ -185,6 +185,9 @@ See /usr/include/dbus-1.0/dbus/dbus-protocol.h.")
|
|||
(concat dbus-error-dbus ".PropertyReadOnly")
|
||||
"Property you tried to set is read-only.")
|
||||
|
||||
(defconst dbus-error-service-unknown (concat dbus-error-dbus ".ServiceUnknown")
|
||||
"The bus doesn't know how to launch a service to supply the bus name you wanted.")
|
||||
|
||||
(defconst dbus-error-unknown-interface
|
||||
(concat dbus-error-dbus ".UnknownInterface")
|
||||
"Interface you invoked a method on isn't known by the object.")
|
||||
|
@ -217,17 +220,11 @@ shall be subdirectories of this path.")
|
|||
|
||||
(defmacro dbus-ignore-errors (&rest body)
|
||||
"Execute BODY; signal D-Bus error when `dbus-debug' is non-nil.
|
||||
Signals also D-Bus error when `dbus-show-dbus-errors' is non-nil
|
||||
and a D-Bus error message has arrived. Otherwise, return result
|
||||
of last form in BODY, or all other errors."
|
||||
Otherwise, return result of last form in BODY, or all other errors."
|
||||
(declare (indent 0) (debug t))
|
||||
`(condition-case err
|
||||
(progn ,@body)
|
||||
(dbus-error
|
||||
(when (or dbus-debug
|
||||
(and dbus-show-dbus-errors
|
||||
(= dbus-message-type-error (nth 2 last-input-event))))
|
||||
(signal (car err) (cdr err))))))
|
||||
(dbus-error (when dbus-debug (signal (car err) (cdr err))))))
|
||||
|
||||
(defvar dbus-event-error-functions '(dbus-notice-synchronous-call-errors)
|
||||
"Functions to be called when a D-Bus error happens in the event handler.
|
||||
|
@ -540,6 +537,21 @@ This is an internal function, it shall not be used outside dbus.el."
|
|||
(apply #'dbus-message-internal dbus-message-type-error
|
||||
bus service serial error-name args))
|
||||
|
||||
(defun dbus-check-arguments (bus service &rest args)
|
||||
"Check arguments ARGS by side effect.
|
||||
BUS, SERVICE and ARGS have the same format as in `dbus-call-method'.
|
||||
Any wrong argument triggers a D-Bus error. Otherwise, return t.
|
||||
This is an internal function, it shall not be used outside dbus.el."
|
||||
|
||||
(or (featurep 'dbusbind)
|
||||
(signal 'dbus-error (list "Emacs not compiled with dbus support")))
|
||||
(or (memq bus '(:system :session)) (stringp bus)
|
||||
(signal 'wrong-type-argument (list 'keywordp bus)))
|
||||
(or (stringp service)
|
||||
(signal 'wrong-type-argument (list 'stringp service)))
|
||||
|
||||
(apply #'dbus-message-internal dbus-message-type-invalid bus service args))
|
||||
|
||||
|
||||
;;; Hash table of registered functions.
|
||||
|
||||
|
@ -1016,8 +1028,9 @@ D-Bus message. SERVICE and PATH are the unique name and the
|
|||
object path of the D-Bus object emitting the message. INTERFACE
|
||||
and MEMBER denote the message which has been sent. HANDLER is
|
||||
the function which has been registered for this message. ARGS
|
||||
are the arguments passed to HANDLER, when it is called during
|
||||
event handling in `dbus-handle-event'.
|
||||
are the typed arguments as returned from the message. They are
|
||||
passed to HANDLER without type information, when it is called
|
||||
during event handling in `dbus-handle-event'.
|
||||
|
||||
This function signals a `dbus-error' if the event is not well
|
||||
formed."
|
||||
|
@ -1053,22 +1066,53 @@ formed."
|
|||
(functionp (nth 8 event)))
|
||||
(signal 'dbus-error (list "Not a valid D-Bus event" event))))
|
||||
|
||||
(defun dbus-delete-types (&rest args)
|
||||
"Delete type information from arguments retrieved via `dbus-handle-event'.
|
||||
Basic type arguments (TYPE VALUE) will be transformed into VALUE, and
|
||||
compound type arguments (TYPE VALUE) will be transformed into (VALUE)."
|
||||
(car
|
||||
(mapcar
|
||||
(lambda (elt)
|
||||
(cond
|
||||
((atom elt) elt)
|
||||
((memq (car elt) dbus-compound-types)
|
||||
(mapcar #'dbus-delete-types (cdr elt)))
|
||||
(t (cadr elt))))
|
||||
args)))
|
||||
|
||||
(defun dbus-flatten-types (arg)
|
||||
"Flatten type information from argument retrieved via `dbus-handle-event'.
|
||||
Basic type arguments (TYPE VALUE) will be transformed into TYPE VALUE, and
|
||||
compound type arguments (TYPE VALUE) will be kept as is."
|
||||
(let (result)
|
||||
(dolist (elt arg)
|
||||
(cond
|
||||
((atom elt) (push elt result))
|
||||
((and (not (memq (car elt) dbus-compound-types)))
|
||||
(push (car elt) result)
|
||||
(push (cadr elt) result))
|
||||
(t
|
||||
(push (cons (car elt) (dbus-flatten-types (cdr elt))) result))))
|
||||
(nreverse result)))
|
||||
|
||||
;;;###autoload
|
||||
(defun dbus-handle-event (event)
|
||||
"Handle events from the D-Bus.
|
||||
EVENT is a D-Bus event, see `dbus-check-event'. HANDLER, being
|
||||
part of the event, is called with arguments ARGS.
|
||||
part of the event, is called with arguments ARGS (without type information).
|
||||
If the HANDLER returns a `dbus-error', it is propagated as return message."
|
||||
(interactive "e")
|
||||
(condition-case err
|
||||
(let (result)
|
||||
(let (args result)
|
||||
;; We ignore not well-formed events.
|
||||
(dbus-check-event event)
|
||||
;; Remove type information.
|
||||
(setq args (mapcar #'dbus-delete-types (nthcdr 9 event)))
|
||||
;; Error messages must be propagated.
|
||||
(when (= dbus-message-type-error (nth 2 event))
|
||||
(signal 'dbus-error (nthcdr 9 event)))
|
||||
(signal 'dbus-error args))
|
||||
;; Apply the handler.
|
||||
(setq result (apply (nth 8 event) (nthcdr 9 event)))
|
||||
(setq result (apply (nth 8 event) args))
|
||||
;; Return an (error) message when it is a message call.
|
||||
(when (= dbus-message-type-method-call (nth 2 event))
|
||||
(dbus-ignore-errors
|
||||
|
@ -1160,10 +1204,11 @@ function signals a `dbus-error' if the event is not well formed."
|
|||
BUS defaults to `:system' when nil or omitted. The result is a
|
||||
list of strings, which is nil when there are no activatable
|
||||
service names at all."
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
(or bus :system) dbus-service-dbus
|
||||
dbus-path-dbus dbus-interface-dbus "ListActivatableNames")))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
(or bus :system) dbus-service-dbus
|
||||
dbus-path-dbus dbus-interface-dbus "ListActivatableNames"))))
|
||||
|
||||
(defun dbus-list-names (bus)
|
||||
"Return the service names registered at D-Bus BUS.
|
||||
|
@ -1171,9 +1216,10 @@ The result is a list of strings, which is nil when there are no
|
|||
registered service names at all. Well known names are strings
|
||||
like \"org.freedesktop.DBus\". Names starting with \":\" are
|
||||
unique names for services."
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus "ListNames")))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus "ListNames"))))
|
||||
|
||||
(defun dbus-list-known-names (bus)
|
||||
"Retrieve all services which correspond to a known name in BUS.
|
||||
|
@ -1186,18 +1232,20 @@ A service has a known name if it doesn't start with \":\"."
|
|||
"Return the unique names registered at D-Bus BUS and queued for SERVICE.
|
||||
The result is a list of strings, or nil when there are no queued
|
||||
name owner service names at all."
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus dbus-service-dbus dbus-path-dbus
|
||||
dbus-interface-dbus "ListQueuedOwners" service)))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus dbus-service-dbus dbus-path-dbus
|
||||
dbus-interface-dbus "ListQueuedOwners" service))))
|
||||
|
||||
(defun dbus-get-name-owner (bus service)
|
||||
"Return the name owner of SERVICE registered at D-Bus BUS.
|
||||
The result is either a string, or nil if there is no name owner."
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus dbus-service-dbus dbus-path-dbus
|
||||
dbus-interface-dbus "GetNameOwner" service)))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus dbus-service-dbus dbus-path-dbus
|
||||
dbus-interface-dbus "GetNameOwner" service))))
|
||||
|
||||
(defun dbus-ping (bus service &optional timeout)
|
||||
"Check whether SERVICE is registered for D-Bus BUS.
|
||||
|
@ -1267,10 +1315,11 @@ and PATH must be a valid object path. The last two parameters
|
|||
are strings. The result, the introspection data, is a string in
|
||||
XML format."
|
||||
;; We don't want to raise errors.
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-introspectable "Introspect"
|
||||
:timeout 1000)))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-introspectable "Introspect"
|
||||
:timeout 1000))))
|
||||
|
||||
(defalias 'dbus--parse-xml-buffer
|
||||
(if (libxml-available-p)
|
||||
|
@ -1472,12 +1521,11 @@ If NAME is a `signal' or a `property', DIRECTION is ignored."
|
|||
"Return the value of PROPERTY of INTERFACE.
|
||||
It will be checked at BUS, SERVICE, PATH. The result can be any
|
||||
valid D-Bus value, or nil if there is no PROPERTY, or PROPERTY cannot be read."
|
||||
(dbus-ignore-errors
|
||||
;; "Get" returns a variant, so we must use the `car'.
|
||||
(car
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-properties
|
||||
"Get" :timeout 500 interface property))))
|
||||
;; "Get" returns a variant, so we must use the `car'.
|
||||
(car
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-properties
|
||||
"Get" :timeout 500 interface property)))
|
||||
|
||||
(defun dbus-set-property (bus service path interface property &rest args)
|
||||
"Set value of PROPERTY of INTERFACE to VALUE.
|
||||
|
@ -1487,26 +1535,30 @@ property's access type is not `:write', return VALUE. Otherwise,
|
|||
return nil.
|
||||
|
||||
\(dbus-set-property BUS SERVICE PATH INTERFACE PROPERTY [TYPE] VALUE)"
|
||||
(dbus-ignore-errors
|
||||
;; "Set" requires a variant.
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-properties
|
||||
"Set" :timeout 500 interface property (list :variant args))
|
||||
;; Return VALUE.
|
||||
(or (dbus-get-property bus service path interface property)
|
||||
(if (symbolp (car args)) (cadr args) (car args)))))
|
||||
;; "Set" requires a variant.
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-properties
|
||||
"Set" :timeout 500 interface property (cons :variant args))
|
||||
;; Return VALUE.
|
||||
(condition-case err
|
||||
(dbus-get-property bus service path interface property)
|
||||
(dbus-error
|
||||
(if (string-equal dbus-error-access-denied (cadr err))
|
||||
(car args)
|
||||
(signal (car err) (cdr err))))))
|
||||
|
||||
(defun dbus-get-all-properties (bus service path interface)
|
||||
"Return all properties of INTERFACE at BUS, SERVICE, PATH.
|
||||
The result is a list of entries. Every entry is a cons of the
|
||||
name of the property, and its value. If there are no properties,
|
||||
nil is returned."
|
||||
(dbus-ignore-errors
|
||||
;; "GetAll" returns "a{sv}".
|
||||
(mapcar (lambda (dict)
|
||||
(cons (car dict) (caadr dict)))
|
||||
(dbus-call-method bus service path dbus-interface-properties
|
||||
"GetAll" :timeout 500 interface))))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
;; "GetAll" returns "a{sv}".
|
||||
(mapcar (lambda (dict)
|
||||
(cons (car dict) (caadr dict)))
|
||||
(dbus-call-method bus service path dbus-interface-properties
|
||||
"GetAll" :timeout 500 interface)))))
|
||||
|
||||
(defun dbus-get-this-registered-property (bus _service path interface property)
|
||||
"Return PROPERTY entry of `dbus-registered-objects-table'.
|
||||
|
@ -1570,9 +1622,8 @@ clients from discovering the still incomplete interface.
|
|||
|
||||
\(dbus-register-property BUS SERVICE PATH INTERFACE PROPERTY ACCESS \
|
||||
[TYPE] VALUE &optional EMITS-SIGNAL DONT-REGISTER-SERVICE)"
|
||||
(let ((signature "s") ;; FIXME: For the time being.
|
||||
;; Read basic type symbol.
|
||||
(type (when (symbolp (car args)) (pop args)))
|
||||
(let (;; Read basic type symbol.
|
||||
(type (when (keywordp (car args)) (pop args)))
|
||||
(value (pop args))
|
||||
(emits-signal (pop args))
|
||||
(dont-register-service (pop args)))
|
||||
|
@ -1590,6 +1641,9 @@ clients from discovering the still incomplete interface.
|
|||
(signal 'wrong-type-argument (list "Value type invalid" value))))))
|
||||
(unless (consp value)
|
||||
(setq value (list type value)))
|
||||
(setq value (if (member (car value) dbus-compound-types)
|
||||
(list :variant value) (cons :variant value)))
|
||||
(dbus-check-arguments bus service value)
|
||||
|
||||
;; Add handlers for the three property-related methods.
|
||||
(dbus-register-method
|
||||
|
@ -1613,10 +1667,7 @@ clients from discovering the still incomplete interface.
|
|||
;; changed_properties.
|
||||
(if (eq access :write)
|
||||
'(:array: :signature "{sv}")
|
||||
`(:array
|
||||
(:dict-entry
|
||||
,property
|
||||
,(if type (list :variant type value) (list :variant value)))))
|
||||
`(:array (:dict-entry ,property ,value)))
|
||||
;; invalidated_properties.
|
||||
(if (eq access :write)
|
||||
`(:array ,property)
|
||||
|
@ -1627,8 +1678,7 @@ clients from discovering the still incomplete interface.
|
|||
(let ((key (list :property bus interface property))
|
||||
(val
|
||||
(cons
|
||||
(list
|
||||
nil service path (list access emits-signal signature value))
|
||||
(list nil service path (list access emits-signal value))
|
||||
(dbus-get-other-registered-properties
|
||||
bus service path interface property))))
|
||||
(puthash key val dbus-registered-objects-table)
|
||||
|
@ -1639,12 +1689,13 @@ clients from discovering the still incomplete interface.
|
|||
(defun dbus-property-handler (&rest args)
|
||||
"Default handler for the \"org.freedesktop.DBus.Properties\" interface.
|
||||
It will be registered for all objects created by `dbus-register-property'."
|
||||
(let ((bus (dbus-event-bus-name last-input-event))
|
||||
(service (dbus-event-service-name last-input-event))
|
||||
(path (dbus-event-path-name last-input-event))
|
||||
(method (dbus-event-member-name last-input-event))
|
||||
(interface (car args))
|
||||
(property (cadr args)))
|
||||
(let* ((last-input-event last-input-event)
|
||||
(bus (dbus-event-bus-name last-input-event))
|
||||
(service (dbus-event-service-name last-input-event))
|
||||
(path (dbus-event-path-name last-input-event))
|
||||
(method (dbus-event-member-name last-input-event))
|
||||
(interface (car args))
|
||||
(property (cadr args)))
|
||||
(cond
|
||||
;; "Get" returns a variant.
|
||||
((string-equal method "Get")
|
||||
|
@ -1662,13 +1713,11 @@ It will be registered for all objects created by `dbus-register-property'."
|
|||
"Property \"%s\" at path \"%s\" is not readable" property path)))
|
||||
;; Return the result. Since variant is a list, we must embed
|
||||
;; it into another list.
|
||||
(t (list (if (memq (car (nth 3 object)) dbus-compound-types)
|
||||
(list :variant (nth 3 object))
|
||||
(cons :variant (nth 3 object))))))))
|
||||
(t (list (nth 2 object))))))
|
||||
|
||||
;; "Set" expects the same type as registered. FIXME: Implement!
|
||||
;; "Set" needs the third typed argument from `last-input-event'.
|
||||
((string-equal method "Set")
|
||||
(let* ((value (caar (nth 2 args)))
|
||||
(let* ((value (dbus-flatten-types (nth 11 last-input-event)))
|
||||
(entry (dbus-get-this-registered-property
|
||||
bus service path interface property))
|
||||
(object (car (last (car entry)))))
|
||||
|
@ -1681,12 +1730,10 @@ It will be registered for all objects created by `dbus-register-property'."
|
|||
`(:error ,dbus-error-property-read-only
|
||||
,(format-message
|
||||
"Property \"%s\" at path \"%s\" is not writable" property path)))
|
||||
(t (unless (consp value)
|
||||
(setq value (list (car (nth 3 object)) value)))
|
||||
(puthash (list :property bus interface property)
|
||||
(t (puthash (list :property bus interface property)
|
||||
(cons (append
|
||||
(butlast (car entry))
|
||||
;; Reuse ACCESS, EMITS-SIGNAL and TYPE.
|
||||
;; Reuse ACCESS and EMITS-SIGNAL.
|
||||
(list (append (butlast object) (list value))))
|
||||
(dbus-get-other-registered-properties
|
||||
bus service path interface property))
|
||||
|
@ -1698,7 +1745,7 @@ It will be registered for all objects created by `dbus-register-property'."
|
|||
;; changed_properties.
|
||||
(if (eq :write (car object))
|
||||
'(:array: :signature "{sv}")
|
||||
`(:array (:dict-entry ,property (:variant ,value))))
|
||||
`(:array (:dict-entry ,property ,value)))
|
||||
;; invalidated_properties.
|
||||
(if (eq :write (car object))
|
||||
`(:array ,property)
|
||||
|
@ -1719,11 +1766,7 @@ It will be registered for all objects created by `dbus-register-property'."
|
|||
(consp object)
|
||||
(not (eq :write (car object))))
|
||||
(push
|
||||
(list :dict-entry
|
||||
(car (last key))
|
||||
(if (memq (car (nth 3 object)) dbus-compound-types)
|
||||
(list :variant (nth 3 object))
|
||||
(cons :variant (nth 3 object))))
|
||||
(list :dict-entry (car (last key)) (nth 2 object))
|
||||
result))))))
|
||||
dbus-registered-objects-table)
|
||||
;; Return the result, or an empty array. An array must be
|
||||
|
@ -1773,10 +1816,11 @@ and \"org.freedesktop.DBus.Properties.GetAll\", which is slow."
|
|||
(let ((result
|
||||
;; Direct call. Fails, if the target does not support the
|
||||
;; object manager interface.
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-objectmanager
|
||||
"GetManagedObjects" :timeout 1000))))
|
||||
(let (dbus-debug)
|
||||
(dbus-ignore-errors
|
||||
(dbus-call-method
|
||||
bus service path dbus-interface-objectmanager
|
||||
"GetManagedObjects" :timeout 1000)))))
|
||||
|
||||
(if result
|
||||
;; Massage the returned structure.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue