Commit 7a161dc6 authored by Andrea Corallo's avatar Andrea Corallo

Merge remote-tracking branch 'savahnna/master' into HEAD

parents 79ed9038 9f01ce63
Pipeline #6193 failed with stage
in 118 minutes and 42 seconds
......@@ -63,7 +63,7 @@ also possible to use a command like
However, we prefer the 'git format-patch' method with attachment, as
doing so delivers patches in the correct and easily-recognizable format
more reliably, and makes the job of applying the patches easier and less
error-prone. It also allows to send patches whose author is someone
error-prone. It also allows sending patches whose author is someone
other than the email sender.
Once the cumulative amount of your submissions exceeds about 15 lines
......
......@@ -1630,6 +1630,10 @@ characters are actually defined by this map.
@item
@vindex mode-specific-map
@code{mode-specific-map} is for characters that follow @kbd{C-c}.
@item
@vindex project-prefix-map
@code{project-prefix-map} is for characters that follow @kbd{C-x p},
used for project-related commands (@pxref{Projects}).
@end itemize
@node Local Keymaps
......@@ -2252,10 +2256,13 @@ as a function from Lisp programs.
When Emacs is started, it normally tries to load a Lisp program from
an @dfn{initialization file}, or @dfn{init file} for short. This
file, if it exists, specifies how to initialize Emacs for you.
If the file @file{~/.config/emacs/init.el} exists, it is used as the
init file; otherwise Emacs may look at @file{~/.emacs.el},
@file{~/.emacs}, @file{~/.emacs.d/init.el}, or other locations.
@xref{Find Init}.
Traditionally, file @file{~/.emacs} is used as the init file, although
Emacs also looks at @file{~/.emacs.el}, @file{~/.emacs.d/init.el},
@file{~/.config/emacs/init.el}, or other locations. @xref{Find Init}.
You may find it convenient to have all your Emacs configuration in one
directory, in which case you should use @file{~/.emacs.d/init.el} or
the XDG-compatible @file{~/.config/emacs/init.el}.
You can use the command line switch @samp{-q} to prevent loading
your init file, and @samp{-u} (or @samp{--user}) to specify a
......@@ -2661,23 +2668,21 @@ library. @xref{Hooks}.
@subsection How Emacs Finds Your Init File
Emacs normally finds your init file in a location under your home
directory. @xref{Init File}. By default this location is
@file{~/.emacs.d/init.el} where @file{~/} stands for your home directory.
This default can be overridden as described below.
directory. @xref{Init File}.
Emacs looks for your init file
using the filenames @file{~/.emacs.el}, @file{~/.emacs}, or
@file{~/.emacs.d/init.el}; you can choose to use any one of these
names. (Note that only the locations directly in your home directory
have a leading dot in the location's basename.)
Emacs looks for your init file using the filenames @file{~/.emacs.el},
@file{~/.emacs}, or @file{~/.emacs.d/init.el} in that order; you can
choose to use any one of these names. (Note that only the locations
directly in your home directory have a leading dot in the location's
basename.)
Emacs can also look in an XDG-compatible location for @file{init.el},
the default is the directory @file{~/.config/emacs}. This can be
overriden by setting @env{XDG_CONFIG_HOME} in your environment, its
value replaces @file{~/.config} in the name of the default XDG init
file. However @file{~/.emacs.d} and @file{~/.emacs} are always
preferred if they exist, which means that you must delete or rename
them in order to use the XDG location.
file. However @file{~/.emacs.d}, @file{~/.emacs}, and
@file{~/.emacs.el} are always preferred if they exist, which means
that you must delete or rename them in order to use the XDG location.
Note also that if neither the XDG location nor @file{~/.emacs.d}
exist, then Emacs will create @file{~/.emacs.d} (and therefore use it
......
......@@ -1584,7 +1584,9 @@ sequences}, with the @code{escape-glyph} face. For instance,
character code @code{U+0098} (octal 230) is displayed as @samp{\230}.
If you change the buffer-local variable @code{ctl-arrow} to
@code{nil}, the @acronym{ASCII} control characters are also displayed
as octal escape sequences instead of caret escape sequences.
as octal escape sequences instead of caret escape sequences. (You can
also request that raw bytes be shown in hex, @pxref{Display Custom,
display-raw-bytes-as-hex}.)
@vindex nobreak-char-display
@cindex non-breaking space
......
......@@ -857,6 +857,12 @@ Customizing VC
* CVS Options:: Options for CVS.
@end ifnottex
Projects
* Project File Commands:: Commands for handling project files.
* Project Buffer Commands:: Commands for handling project buffers.
* Switching Projects:: Switching between projects.
Change Logs
* Change Log Commands:: Commands for editing change log files.
......
......@@ -1657,12 +1657,43 @@ the project back-end. For example, the VC back-end doesn't consider
``ignored'' files (@pxref{VC Ignore}) to be part of the project.
@menu
* Project File Commands:: Commands for handling project files.
* Switching Projects:: Switching between projects.
* Project File Commands:: Commands for handling project files.
* Project Buffer Commands:: Commands for handling project buffers.
* Switching Projects:: Switching between projects.
@end menu
@node Project File Commands
@subsection Project File Commands
@subsection Project Commands That Operate on Files
@table @kbd
@item C-x p f
Visit a file that belongs to the current project
(@code{project-find-file}).
@item C-x p g
Find matches for a regexp in all files that belong to the current
project (@code{project-find-regexp}).
@item M-x project-search
Interactively search for regexp matches in all files that belong to
the current project.
@item C-x p r
Perform query-replace for a regexp in all files that belong to the
current project (@code{project-query-replace-regexp}).
@item C-x p d
Run Dired in the current project's root directory
(@code{project-dired}).
@item C-x p v
Run @code{vc-dir} in the current project's root directory
(@code{project-vc-dir}).
@item C-x p s
Start an inferior shell in the current project's root directory
(@code{project-shell}).
@item C-x p e
Start Eshell in the current project's root directory
(@code{project-eshell}).
@item C-x p c
Run compilation in the current project's root directory
(@code{project-compile}).
@end table
Emacs provides commands for handling project files conveniently.
This subsection describes these commands.
......@@ -1676,25 +1707,26 @@ doesn't seem to belong to a recognizable project, these commands
prompt you for the project directory.
@findex project-find-file
The command @code{project-find-file} is a convenient way of visiting
files (@pxref{Visiting}) that belong to the current project. Unlike
@kbd{C-x C-f}, this command doesn't require to type the full file name
of the file to visit, you can type only the file's base name (i.e.,
omit the leading directories). In addition, the completion candidates
considered by the command include only the files belonging to the
current project, and nothing else. If there's a file name at point,
this command offers that file as the default to visit.
The command @kbd{C-x p f} (@code{project-find-file}) is a convenient
way of visiting files (@pxref{Visiting}) that belong to the current
project. Unlike @kbd{C-x C-f}, this command doesn't require to type
the full file name of the file to visit, you can type only the file's
base name (i.e., omit the leading directories). In addition, the
completion candidates considered by the command include only the files
belonging to the current project, and nothing else. If there's a file
name at point, this command offers that file as the default to visit.
@findex project-find-regexp
The command @code{project-find-regexp} is similar to @code{rgrep}
(@pxref{Grep Searching}), but it searches only the files that belong
to the current project. The command prompts for the regular
expression to search, and pops up an Xref mode buffer with the search
results, where you can select a match using the Xref mode commands
(@pxref{Xref Commands}). When invoked with a prefix argument, this
command additionally prompts for the base directory from which to
start the search; this allows, for example, to limit the search only
to project files under a certain subdirectory of the project root.
The command @kbd{C-x p g} (@code{project-find-regexp}) is similar to
@code{rgrep} (@pxref{Grep Searching}), but it searches only the files
that belong to the current project. The command prompts for the
regular expression to search, and pops up an Xref mode buffer with the
search results, where you can select a match using the Xref mode
commands (@pxref{Xref Commands}). When invoked with a prefix
argument, this command additionally prompts for the base directory
from which to start the search; this allows, for example, to limit the
search only to project files under a certain subdirectory of the
project root.
@findex project-search
@kbd{M-x project-search} is an interactive variant of
......@@ -1706,7 +1738,7 @@ matched file. To find the rest of the matches, type @w{@kbd{M-x
fileloop-continue @key{RET}}}.
@findex project-query-replace-regexp
@kbd{M-x project-query-replace-regexp} is similar to
@kbd{C-x p r} (@code{project-query-replace-regexp}) is similar to
@code{project-search}, but it prompts you for whether to replace each
match it finds, like @code{query-replace} does (@pxref{Query
Replace}), and continues to the next match after you respond. If your
......@@ -1714,40 +1746,85 @@ response causes Emacs to exit the query-replace loop, you can later
continue with @w{@kbd{M-x fileloop-continue @key{RET}}}.
@findex project-dired
The command @code{project-dired} opens a Dired buffer
(@pxref{Dired}) listing the files in the current project's root
The command @kbd{C-x p d} (@code{project-dired}) opens a Dired
buffer (@pxref{Dired}) listing the files in the current project's root
directory.
@findex project-vc-dir
The command @code{project-vc-dir} opens a VC Directory buffer
(@pxref{VC Directory Mode}) listing the version control statuses of
the files in a directory tree under the current project's
root directory.
The command @kbd{C-x p v} (@code{project-vc-dir}) opens a VC
Directory buffer (@pxref{VC Directory Mode}) listing the version
control statuses of the files in a directory tree under the current
project's root directory.
@findex project-shell
The command @code{project-shell} starts a shell session
(@pxref{Shell}) in a new buffer with the current project's root as the
working directory.
The command @kbd{C-x p s} (@code{project-shell}) starts a shell
session (@pxref{Shell}) in a new buffer with the current project's
root as the working directory.
@findex project-eshell
The command @code{project-eshell} starts an Eshell session in a new
buffer with the current project's root as the working directory.
@xref{Top,Eshell,Eshell, eshell, Eshell: The Emacs Shell}.
The command @kbd{C-x p e} (@code{project-eshell}) starts an Eshell
session in a new buffer with the current project's root as the working
directory. @xref{Top,Eshell,Eshell, eshell, Eshell: The Emacs Shell}.
@findex project-compile
The command @kbd{C-x p c} (@code{project-compile}) runs compilation
(@pxref{Compilation}) in the current project's root directory.
@node Project Buffer Commands
@subsection Project Commands That Operate on Buffers
@table @kbd
@item C-x p b
Switch to another buffer belonging to the current project
(@code{project-switch-to-buffer}).
@item C-x p k
Kill all live buffers that belong to the current project
(@code{project-kill-buffers}).
@end table
@findex project-switch-to-buffer
Working on a project could potentially involve having many buffers
visiting files that belong to the project, and also buffers that
belong to the project, but don't visit any files (like the
@file{*compilation*} buffer created by @code{project-compile}). The
command @kbd{C-x p b} (@code{project-switch-to-buffer}) helps you
switch between buffers that belong to the current project by prompting
for a buffer to switch and considering only the current project's
buffers as candidates for completion.
@findex project-kill-buffers
@vindex project-kill-buffers-ignores
When you finish working on the project, you may wish to kill all the
buffers that belong to the project, to keep your Emacs session
smaller. The command @kbd{C-x p k} (@code{project-kill-buffers})
accomplishes that: it kills all the buffers that belong to the current
project, except if @code{project-kill-buffers-ignores} tells
otherwise.
@node Switching Projects
@subsection Switching Projects
@table @kbd
@item C-x p p
Run an Emacs command for another project (@code{project-switch-project}).
@end table
@findex project-switch-project
@vindex project-switch-commands
Commands that operate on project files (@pxref{Project File
Commands}) will conveniently prompt you for a project directory when
no project is current. When you are inside a project but you want to
operate on a different project, the command
@code{project-switch-project} can be used.
This command prompts you to choose a directory among known project
roots, and then displays the menu of available commands to operate on
the chosen project. The variable @code{project-switch-commands}
controls which commands are available in the menu, and by which keys
they are invoked.
no project is current. When you are inside some project, but you want
to operate on a different project, use the @kbd{C-x p p} command
(@code{project-switch-project}). This command prompts you to choose a
directory among known project roots, and then displays the menu of
available commands to operate on the project you choose. The variable
@code{project-switch-commands} controls which commands are available
in the menu, and which key invokes each command.
@vindex project-list-file
The variable @code{project-list-file} names the file in which Emacs
records the list of known projects. It defaults to the file
@file{projects} in @code{user-emacs-directory} (@pxref{Find Init}).
@node Change Log
@section Change Logs
......
......@@ -707,6 +707,10 @@ the Emacs process. (This is useful primarily in batch operation; see
If @var{exit-data} is a string, its contents are stuffed into the
terminal input buffer so that the shell (or whatever program next reads
input) can read them.
If @var{exit-data} is neither an integer nor a string, or is omitted,
that means to use the (system-specific) exit status which indicates
successful program termination.
@end deffn
@cindex SIGTERM
......
......@@ -337,7 +337,8 @@ Verify OpenPGP cleartext signed messages in the current buffer.
@kindex C-c C-e C-s
@kindex C-c C-e s
@findex epa-mail-sign
Compose a signed message from the current buffer.
Compose a signed message from the current buffer, using your default
key. With a prefix argument, select the key to use interactively.
@item C-c C-e C-e and C-c C-e e
@kindex C-c C-e C-e
......@@ -352,6 +353,8 @@ key in the recipient list, use @samp{encrypt-to} option in
addresses using the @code{epa-mail-aliases} list. You can also
use that option to ignore specific recipients for encryption purposes.
With prefix argument, asks you to select the recipients interactively,
whether to sign, and which key(s) to sign with.
@end table
@node Encrypting/decrypting gpg files, , Mail-mode integration, Commands
......
......@@ -684,7 +684,7 @@ Binding,,, elisp, The Emacs Lisp Reference Manual}) to be active.
msg)
into diags
finally (funcall report-fn diags)))
(flymake-log :warning "Cancelling obsolete check %s"
(flymake-log :warning "Canceling obsolete check %s"
proc))
;; Cleanup the temporary buffer used to hold the
;; check's output.
......
......@@ -502,21 +502,31 @@ information, see the related entry about 'shr-browse-url' above.
*** New user option 'project-vc-merge-submodules'.
*** Previously used project directories are now suggested by
all commands that prompt for a project directory.
*** Project commands now have their own history.
Previously used project directories are now suggested by all commands
that prompt for a project directory.
+++
*** New prefix keymap 'project-prefix-map'.
Key sequences that invoke project-related commands start with the
prefix 'C-x p'. Type "C-x p C-h" to show the full list.
+++
*** New commands 'project-dired', 'project-vc-dir', 'project-shell',
'project-eshell'. These commands run Dired/VC-Dir and Shell/Eshell in
a project's root directory, respectively.
*** New command 'project-compile', which runs compilation.
+++
*** New command 'project-compile'.
This command runs compilation in the current project's root
directory.
+++
*** New command 'project-switch-project'.
This command lets you "switch" to another project and run a project
command chosen from a dispatch menu.
+++
*** New user option 'project-list-file'.
** json.el
......@@ -566,8 +576,8 @@ appropriate values for those two variables. There are three guessing
mechanisms so far: based on version control information of the current
buffer's file, based on newsgroup/mail-folder name and several news
and mail message headers in Gnus buffers, and based on IRC channel and
server in rcirc buffers. All mechanisms are extensible with custom
rules, see the variables 'bug-reference-setup-from-vc-alist',
network in rcirc and ERC buffers. All mechanisms are extensible with
custom rules, see the variables 'bug-reference-setup-from-vc-alist',
'bug-reference-setup-from-mail-alist', and
'bug-reference-setup-from-irc-alist'.
......
......@@ -270,7 +270,7 @@ doing before changing the value.
+++
** Native GnuTLS connections can now use client certificates.
Previously, this support was only available when using the external
'gnutls-cli' command. Call 'open-network-stream' with
'gnutls-cli' or 'starttls' command. Call 'open-network-stream' with
':client-certificate t' to trigger looking up of per-server
certificates via 'auth-source'.
......
......@@ -415,15 +415,17 @@ not altered with an escape sequence.")
;;;_ , Widget element formatting
;;;_ = allout-item-icon-keymap
(defvar allout-item-icon-keymap
(let ((km (make-sparse-keymap)))
(let ((km (make-sparse-keymap))
(as-parent (if (current-local-map)
(make-composed-keymap (current-local-map)
(current-global-map))
(current-global-map))))
;; The keymap parent is reset on the each local var when mode starts.
(set-keymap-parent km as-parent)
(dolist (digit '("0" "1" "2" "3"
"4" "5" "6" "7" "8" "9"))
(define-key km digit 'digit-argument))
(define-key km "-" 'negative-argument)
;; (define-key km [(return)] 'allout-tree-expand-command)
;; (define-key km [(meta return)] 'allout-toggle-torso-command)
;; (define-key km [(down-mouse-1)] 'allout-item-button-click)
;; (define-key km [(down-mouse-2)] 'allout-toggle-torso-event-command)
;; Override underlying mouse-1 and mouse-2 bindings in icon territory:
(define-key km [(mouse-1)] (lambda () (interactive) nil))
(define-key km [(mouse-2)] (lambda () (interactive) nil))
......@@ -433,17 +435,16 @@ not altered with an escape sequence.")
km)
"General tree-node key bindings.")
(make-variable-buffer-local 'allout-item-icon-keymap)
;;;_ = allout-item-body-keymap
(defvar allout-item-body-keymap
(let ((km (make-sparse-keymap))
(local-map (current-local-map)))
;; (define-key km [(control return)] 'allout-tree-expand-command)
;; (define-key km [(meta return)] 'allout-toggle-torso-command)
;; XXX We need to reset this per buffer's mode; we do so in
;; allout-widgets-mode.
(if local-map
(set-keymap-parent km local-map))
(as-parent (if (current-local-map)
(make-composed-keymap (current-local-map)
(current-global-map))
(current-global-map))))
;; The keymap parent is reset on the each local var when mode starts.
(set-keymap-parent km as-parent)
km)
"General key bindings for the text content of outline items.")
(make-variable-buffer-local 'allout-item-body-keymap)
......@@ -456,6 +457,7 @@ not altered with an escape sequence.")
(set-keymap-parent km allout-item-icon-keymap)
km)
"Keymap used in the item cue area - the space between the icon and headline.")
(make-variable-buffer-local 'allout-cue-span-keymap)
;;;_ = allout-escapes-category
(defvar allout-escapes-category nil
"Symbol for category of text property used to hide escapes of prefix-like
......@@ -566,8 +568,13 @@ outline hot-spot navigation (see `allout-mode')."
(add-to-invisibility-spec '(allout-torso . t))
(add-to-invisibility-spec 'allout-escapes)
(if (current-local-map)
(set-keymap-parent allout-item-body-keymap (current-local-map)))
(let ((as-parent (if (current-local-map)
(make-composed-keymap (current-local-map)
(current-global-map))
(current-global-map))))
(set-keymap-parent allout-item-body-keymap as-parent)
;; allout-cue-span-keymap uses allout-item-icon-keymap as parent.
(set-keymap-parent allout-item-icon-keymap as-parent))
(add-hook 'allout-exposure-change-functions
'allout-widgets-exposure-change-recorder nil 'local)
......@@ -677,7 +684,7 @@ outline hot-spot navigation (see `allout-mode')."
(setplist 'allout-cue-span-category nil)
(put 'allout-cue-span-category 'evaporate t)
(put 'allout-cue-span-category
'modification-hooks '(allout-body-modification-handler))
'modification-hooks '(allout-graphics-modification-handler))
(put 'allout-cue-span-category 'local-map allout-cue-span-keymap)
(put 'allout-cue-span-category 'mouse-face widget-button-face)
(put 'allout-cue-span-category 'pointer 'arrow)
......@@ -988,6 +995,7 @@ Generally invoked via `allout-exposure-change-functions'."
;; have to distinguish between concealing and exposing so that, eg,
;; `allout-expose-topic's mix is handled properly.
handled-expose
handled-conceal
covered
deactivate-mark)
......@@ -1594,7 +1602,10 @@ We return the item-widget corresponding to the item at point."
(if is-container
(progn (widget-put item-widget :is-container t)
(setq reverse-siblings-chart (list 1)))
(goto-char (widget-apply parent :actual-position :from))
(let ((parent-position (widget-apply parent
:actual-position :from)))
(when parent-position
(goto-char parent-position)))
(if (widget-get parent :is-container)
;; `allout-goto-prefix' will go to first non-container item:
(allout-goto-prefix)
......@@ -1994,8 +2005,7 @@ reapplying this method will rectify the glyphs."
;; NOTE: most of the cue-area
(when (not (widget-get item-widget :is-container))
(let* ((cue-start (or (widget-get item-widget :distinctive-end)
(widget-get item-widget :icon-end)))
(let* ((cue-start (widget-get item-widget :icon-end))
(body-start (widget-get item-widget :body-start))
;(expanded (widget-get item-widget :expanded))
;(has-subitems (widget-get item-widget :has-subitems))
......@@ -2050,19 +2060,22 @@ Optional FORCE means force reassignment of the region property."
;;;_ > allout-widgets-undecorate-region (start end)
(defun allout-widgets-undecorate-region (start end)
"Eliminate widgets and decorations for all items in region from START to END."
(let ((next start)
widget)
(let (done next widget
(end (or end (point-max))))
(save-excursion
(goto-char start)
(while (< (setq next (next-single-char-property-change next
'display
(current-buffer)
end))
end)
(goto-char next)
(when (setq widget (allout-get-item-widget))
;; if the next-property/overly progression got us to a widget:
(allout-widgets-undecorate-item widget t))))))
(while (not done)
(when (and (allout-on-current-heading-p)
(setq widget (allout-get-item-widget)))
(if widget
(allout-widgets-undecorate-item widget t)))
(goto-char (setq next
(next-single-char-property-change (point)
'display
(current-buffer)
end)))
(if (>= next end)
(setq done t))))))
;;;_ > allout-widgets-undecorate-text (text)
(defun allout-widgets-undecorate-text (text)
"Eliminate widgets and decorations for all items in TEXT."
......@@ -2389,7 +2402,7 @@ The elements of LIST are not copied, just the list structure itself."
;;;_ : provide
(provide 'allout-widgets)
;;;_. Local emacs vars.
;;;_ , Local variables:
;;;_ , allout-layout: (-1 : 0)
;;;_ , End:
;;;_ . Local emacs vars.
;;;_ , Local variables:
;;;_ , allout-layout: (-1 : 0)
;;;_ , End:
......@@ -1774,7 +1774,8 @@ Bookmark names preceded by a \"*\" have annotations.
\\[bookmark-bmenu-show-annotation] -- show the annotation, if it exists, for the current bookmark
in another buffer.
\\[bookmark-bmenu-show-all-annotations] -- show the annotations of all bookmarks in another buffer.
\\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark."
\\[bookmark-bmenu-edit-annotation] -- edit the annotation for the current bookmark.
\\[bookmark-bmenu-search] -- incrementally search for bookmarks."
(setq truncate-lines t)
(setq buffer-read-only t))
......
......@@ -2429,7 +2429,7 @@ the United States."
(if (and (memq last-command-event '(?@ ?o ?h ?\' ?m))
(string-match " " calc-hms-format))
(insert " "))
(if (and (eq this-command last-command)
(if (and (memq last-command '(calcDigit-start calcDigit-key))
(eq last-command-event ?.))
(progn
(require 'calc-ext)
......
......@@ -2102,11 +2102,12 @@ and `face'."
(insert " "))
(widget-put widget :children children))))
(defun custom-magic-reset (widget)
(defun custom-magic-reset (widget &optional buffer)
"Redraw the :custom-magic property of WIDGET."
(let ((magic (widget-get widget :custom-magic)))
(when magic
(widget-value-set magic (widget-value magic)))))
(with-current-buffer (or buffer (current-buffer))
(widget-value-set magic (widget-value magic))))))
;;; The `custom' Widget.
......@@ -2217,7 +2218,7 @@ and `face'."
;; commands like `M-u' (that work on a region in the buffer)
;; will upcase the wrong part of the buffer, since more text has
;; been inserted before point.
(run-with-idle-timer 0.0 nil #'custom-magic-reset widget)
(run-with-idle-timer 0.0 nil #'custom-magic-reset widget (current-buffer))
(apply 'widget-default-notify widget args))))
(defun custom-redraw (widget)
......
......@@ -709,6 +709,9 @@
(integer (if integer-is-first arg1 arg2))
(other (if integer-is-first arg2 arg1)))
(list (if (eq integer 1) '1+ '1-) other)))
;; (+ x y z) -> (+ (+ x y) z)
((= (length args) 3)
`(+ ,(byte-optimize-plus `(+ ,(car args) ,(cadr args))) ,@(cddr args)))
;; not further optimized
((equal args (cdr form)) form)
(t (cons '+ args)))))
......@@ -737,6 +740,9 @@
((and (null (cdr args))
(numberp (car args)))
(- (car args)))
;; (- x y z) -> (- (- x y) z)
((= (length args) 3)
`(- ,(byte-optimize-minus `(- ,(car args) ,(cadr args))) ,@(cddr args)))
;; not further optimized
((equal args (cdr form)) form)
(t (cons '- args))))))
......@@ -764,6 +770,10 @@
((null args) 1)
;; (* n) -> n, where n is a number
((and (null (cdr args)) (numberp (car args))) (car args))
;; (* x y z) -> (* (* x y) z)
((= (length args) 3)
`(* ,(byte-optimize-multiply `(* ,(car args) ,(cadr args)))
,@(cddr args)))
;; not further optimized
((equal args (cdr form)) form)
(t (cons '* args)))))
......
......@@ -5,7 +5,7 @@
;; Author: Noah Friedman <friedman@splode.com>
;; Keywords: extensions
;; Created: 1995-10-06
;; Version: 1.5.0
;; Version: 1.6.0
;; Package-Requires: ((emacs "26.3"))
;; This is a GNU ELPA :core package. Avoid functionality that is not
......@@ -340,16 +340,32 @@ Also store it in `eldoc-last-message' and return that value."
;; for us, but do note that the last-message will be gone.
(setq eldoc-last-message nil))))
;; Decide whether now is a good time to display a message.
(defun eldoc-display-message-p ()
"Return non-nil when it is appropriate to display an ElDoc message."
(and (eldoc-display-message-no-interference-p)
;; If this-command is non-nil while running via an idle
;; timer, we're still in the middle of executing a command,
;; e.g. a query-replace where it would be annoying to
;; overwrite the echo area.
(not this-command)
(eldoc--message-command-p last-command)))
(defvar-local eldoc--last-request-state nil
"Tuple containing information about last ElDoc request.")
(defun eldoc--request-state ()
"Compute information to store in `eldoc--last-request-state'."
(list (current-buffer) (buffer-modified-tick) (point)))
(defun eldoc--request-docs-p (request-state)
"Return non-nil when it is appropriate to request docs.
REQUEST-STATE is a candidate for `eldoc--last-request-state'"
(and
;; FIXME: The original idea behind this function is to protect the
;; Echo area from ElDoc interference, but since that is only one of