* lisp/tab-bar.el (tab-bar-tab-post-open-functions,
tab-bar-tab-prevent-close-functions, tab-bar-tab-pre-close-functions):
New defcustoms
(tab-bar-new-tab-to, tab-bar-close-tab): Use new defcustoms
This contrasts with the previous state where no such functions got called.
This fixes bug #38406.
* lisp/progmodes/cc-cmds.el (c--unsafe-post-self-insert-hook-functions): New
variable.
(c--call-post-self-insert-hook-more-safely-1): New function.
(c--call-post-self-insert-hook-more-safely): New macro.
(c-electric-pound, c-electric-brace, c-electric-slash, c-electric-star)
(c-electric-semi&comma, c-electric-colon, c-electric-lt-gt, c-electric-paren):
Invoke c--call-post-self-insert-hook-more-safely (which calls most of the hook
post-self-insert-hook) at the end of each of the commands.
* lisp/simple.el (default-font-height, default-font-width)
(default-line-height): Say in the doc strings that the default
face these functions use is for the currently selected frame.
* doc/lispref/display.texi (Attribute Functions)
(Low-Level Font): Document more clearly the dependence of the
results of 'face-font', 'default-font-width', and
'default-font-height' on the frame's definition of the default
face.
`completion-pcm--hilit-commonality` so that these faces doesn't
override possible already existing faces in other UIs.
* lisp/minibuffer.el (completion-pcm--hilit-commonality): Use
`add-face-text-property` instead of `put-text-property`.
* lisp/org/org-agenda.el (org-agenda-filter):
Fix unescaped literal ‘+’ in regexp. Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00215.html
* lisp/org/org.el (org-clone-subtree-with-time-shift):
Fix a regexp typo that mishandled strings like ‘\1d’,
reported by the same emaikl.
* lisp/progmodes/verilog-mode.el (verilog-inject-inst):
Omit unnecessary ‘?’ in regexp. Reported by Mattias Engdegård in:
https://lists.gnu.org/r/emacs-devel/2019-12/msg00217.html
* lisp/simple.el (minibuffer-history-values): New function, should be
used to access the minibuffer input history variable when the
minibuffer might be active. If the variable is buffer-local, the
previous buffer's value will be used.
(goto-history-element): Use the new function to access the minibuffer
history.
(minibuffer-history-isearch-wrap): Use the new function to access the
minibuffer history.
* src/minibuf.c (read_minibuf): Switch to previous buffer temporarily
before updating history list (Bug#38317).
(read-from-minibuffer): Extend documentation to mention that the
result of using the command will be added to the history list by
default.
* doc/lispref/minibuf.texi (Minibuffer History): Mention the
possibility of using a buffer-local variable as history.
* etc/NEWS: Announce changes.
(tab-bar--tab): Use float-time instead of integer.
This improves correct detection of recent tabs switched within 1 sec.
(tab-bar--current-tab, tab-bar--current-tab-index)
(tab-bar--tab-index, tab-bar--tab-index-by-name)
(tab-bar--tab-index-recent): Add optional arg FRAME.
(tab-bar-move-tab-to-frame): Add with-selected-frame for tab-bar-close-tab.
(tab-bar--reusable-frames): New function.
(tab-bar-get-buffer-tab): Add index to the found tab.
(display-buffer-in-tab): Use `tab-name' entry instead of `name'.
Add `reusable-frames' entry. (bug#38354)
Although 'push' returns the modified list, it isn't actually
documented to do so, so don't rely on it.
* lisp/emacs-lisp/rx.el (rx--translate-any): Add progn.
* lisp/gnus/message.el (message-sendmail-envelope-from): Change default.
(message--sendmail-envelope-from): New function.
(message-sendmail-envelope-from): Use it.
* lisp/mail/emacsbug.el (report-emacs-bug): Use it.
This fixes bug#38458 where a final `point` in the pattern prevented
the expected normal behavior of point moving after the completion
of the final implicit `any`.
(completion-pcm--find-all-completions)
(completion-substring--all-completions): Use it.
(completion-basic--pattern): Don't both removing "" any more.
(completion-basic-try-completion): Use it as well as
`completion-basic--pattern`.
For example, (any digit digit) should produce "[[:digit:]]",
not "[[:digit:][:digit:]]".
* lisp/emacs-lisp/rx.el (rx--translate-any): Deduplicate character classes.
* test/lisp/emacs-lisp/rx-tests.el (rx-any): Add test case.
* lisp/window.el (window-state-buffers): New function.
* lisp/tab-bar.el (tab-bar-get-buffer-tab): New function.
* lisp/emacs-lisp/seq.el (seq-some): Add autoload cookie.
* lisp/desktop.el (desktop-buffers-not-to-save-function): New variable.
(desktop-save-buffer-p): Use it.
* lisp/ibuf-ext.el (ibuffer-generate-filter-groups): Use
`cl-destructuring-bind' instead of `cl-multiple-value-bind', as we
don't want to assume how multiple-values are implemented, and we
know a list is being returned anyway. Suggested by Stefan Monnier.
* lisp/ibuf-ext.el (ibuffer-mark-by-content-regexp): Use `cl-dolist'
instead of `cl-some' to avoid a run-time dependency on cl-lib that
triggers an unreported bug similar to bug#38430.
* lisp/ibuf-ext.el (ibuffer-generate-filter-groups): Don't call
`cl-values-list'. Our implementation of that function just
checks that its argument is a list, and then returns it. In
this specific case, the argument is guaranteed to be a list.
Make the rectangular selection work better with
display-line-numbers-mode and side-by-side windows.
Also make the mouse track the text cursor in a consistent way.
* lisp/mouse.el (mouse--rectangle-track-cursor): Added constant.
(mouse-drag-region-rectangle): Take the line-number width into
account, and use window-relative columns. Track either the cursor or
rectangle corner with more care.
Use setq to set buffer-local values of truncate-lines and buffer-undo-list.
This will prevent leaking of let-bound values to buffer-local values
of the minibuffer.
* lisp/subr.el (read-char-from-minibuffer-insert-other)
(y-or-n-p-insert-other): Use discard-input in case of user mistake.
(do-after-load-evaluation): Add discard-input before calling 'message',
so in case of the active minibuffer, calling minibuffer-message will allow
sit-for to wait the complete timeout, because discard-input will discard
all initial events that prevent sit-for from waiting during startup.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00581.html
In particular, with these unterminated quotes on each of two adjacent lines,
the following text was spuriously fontified with string face.
* lisp/progmodes/cc-defs.el
(c-search-backward-char-property-with-value-on-char): New macro.
* lisp/progmodes/cc-mode.el (c-clear-string-fences): Check whether there is an
unmatched quote at a lower buffer position which should match the current
quote, rather than wrongly assuming the latter is unmatched and marking it
with a punctuation syntax.
(c-font-lock-fontify-region): Ensure all pertinent parts of the buffer have
string fence properties applied before performing any syntactic operations on
it; in particular, this applies to a quote at an earlier buffer position which
"matches" one inside the region about to be fontified.
* lisp/image.el (image-increase-size, image-decrease-size):
Add optional arg position.
(image-mouse-increase-size, image-mouse-decrease-size):
Use '(point-marker)' for arg position.
(image--get-image): Use get-char-property from position if non-nil,
and its buffer.
(image--get-imagemagick-and-warn, image--change-size):
Add optional arg position.