* lisp/emacs-lisp/edebug.el (edebug-remove-instrumentation):
Prompt the user for what functions to remove instrumentation from
a la cancel-edebug-on-entry (bug#38195).
* time-stamp.el (time-stamp-string-preprocess): Change new format for
numeric time zone from %:z to %5z to match format-time-string better.
(time-stamp-format): Document support for numeric time zone.
See discussion in bug#32931.
* NEWS: Mention time-stamp-format %5z.
Otherwise we would lose things like C-r (isearch-backward) when doing
simple stuff like non-icomplete pp-eval-expression.
* lisp/icomplete.el (icomplete--fido-mode-setup): Restrict setup
to when icomplete-mode really kicks in.
(tab-line-tabs-buffer-list): New function.
(tab-line-tabs-mode-buffers, tab-line-tabs-buffer-groups):
Call tab-line-tabs-mode-buffers.
(tab-line-tabs-buffer-groups): Add 'close' function that uses
kill-buffer instead of bury-buffer that makes no sense here.
(tab-line-format): Don't show the close button when a tab
has no 'close' function or buffer.
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Support tabs with 'buffer' properties.
(tab-line-close-tab): Call 'close' function when defined.
* lisp/dired.el (dired-dwim-target): Add choices
dired-dwim-target-next and dired-dwim-target-recent.
* lisp/dired-aux.el (dired-dwim-target-next)
(dired-dwim-target-recent): New functions.
(dired-dwim-target-directories): Call either of them.
* doc/emacs/dired.texi (Operating on Files): Mention new
preferences in dired-dwim-target.
* lisp/international/titdic-cnv.el (tit-process-header):
In generated doc strings, escape \, ", ', and ` properly.
Currently only ' appears but we might as well future-proof this.
* lisp/progmodes/verilog-mode.el (verilog-read-decls): Fix to skip
over base64-encoded protected data while reading AUTO declarations.
Reported by Berend Ozceri.
(verilog-auto-inst-port, verilog-auto-inst-vector): Support 'unsigned'
in `verilog-auto-inst-vector'. Reported by Jeff Riley.
(verilog-read-decls): Fix to ignore `line in AUTOINST, git
bug18. Reported by Berend Ozceri.
(verilog-library-extensions): Support .va /.vah/.sva/.svah file
extensions to load verilog-mode for Verilog-AMS. Reported by Shareef
Jalloq.
(verilog-read-sub-decls-expr): Fix AUTOOUTPUT etc misparsing Verilog
casts, bug1526. Reported by Udi Finkelstein.
* doc/lispref/numbers.texi (Float Basics):
* doc/misc/cl.texi (Implementation Parameters):
* lisp/emacs-lisp/cl-lib.el (cl-most-positive-float)
(cl-least-positive-float)
(cl-least-positive-normalized-float, cl-float-epsilon)
(cl-float-negative-epsilon):
Document IEEE floating point better. Don’t suggest that Emacs
might use some floating-point format other than IEEE format, as
Emacs currently assumes IEEE in several places and there seems
little point in removing those assumptions.
* lisp/autorevert.el (auto-revert-handler): Use 'minibuffer-message'
instead of 'message'. Call it from the original window's buffer
that in case of the minibuffer should be current, so
minibuffer-message could add a message to it. (Bug#34614)
* lisp/emacs-lisp/ert-x.el (ert--make-message-advice): Add nil to
the list of values to not use for format-message, because
minibuffer-message calls 'message' with nil argument, and tests fail.
* lisp/man.el (Man-bgproc-sentinel): Postpone displaying the message
and deleting the buffer until exiting the code block with
with-current-buffer. Use minibuffer-message to display message
to handle possibly active minibuffer.
* lisp/subr.el (do-after-load-evaluation): Use minibuffer-message
to not obscure a possibly active minibuffer.
* lisp/minibuffer.el (minibuffer-message):
Record message in the *Messages* buffer.
* lisp/files.el (hack-local-variables-confirm):
Use read-char-from-minibuffer instead of read-char-choice.
Remove special handling of original window scrolling
that is now supported in the minibuffer. This fixes
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg01020.html
(files--ask-user-about-large-file): Use read-char-from-minibuffer
instead of read-char-choice.
* lisp/simple.el (read-char-history):
Rename from read-char-from-minibuffer-history. (Bug#38076)
(read-char-from-minibuffer-insert-char):
Rename from read-char-from-minibuffer-self-insert.
(read-char-from-minibuffer-map-hash): New defconst.
(read-char-from-minibuffer-insert-other): New command.
(read-char-from-minibuffer): Add optional args CHARS and HISTORY.
(zap-to-char): Use 'read-char-history as HISTORY arg of
read-char-from-minibuffer.
* lisp/emacs-lisp/map-ynp.el (read-answer): Use sit-for instead of sleep-for.
Replace short answer history yes-or-no-p-history with read-char-history.
* doc/lispref/minibuf.texi (Yes-or-No Queries): Update the fact
that y-or-n-p uses the minibuffer.
* lisp/subr.el (y-or-n-p-history-variable): New variable.
(y-or-n-p-map): New keymap.
(y-or-n-p-insert-y, y-or-n-p-insert-n, y-or-n-p-insert-other):
New commands.
(y-or-n-p): Rewrite to use read-from-minibuffer and make-composed-keymap
with y-or-n-p-map and query-replace-map.
* lisp/minibuffer.el (with-minibuffer-selected-window): New macro.
(minibuffer-recenter-top-bottom, minibuffer-scroll-up-command)
(minibuffer-scroll-down-command, minibuffer-scroll-other-window):
(minibuffer-scroll-other-window-down): New commands.
(minibuffer-local-map): Remap recenter/scroll symbols to their
minibuffer wrappers: recenter-top-bottom to minibuffer-recenter-top-bottom.
* src/window.c (Fother_window_for_scrolling): Use 'lambda' value for
MINIBUF arg of Fnext_window, so minibuffer-scroll-other-window and
minibuffer-scroll-other-window-down doesn't try to scroll the
minibuffer window.
* lisp/international/mule-cmds.el (select-safe-coding-system):
Treat no-conversion-multibyte that came from find-auto-coding
the same as no-conversion for the purposes of encoding. The
same logic that considers no-conversion always safe should do
the same with no-conversion-multibyte. (Bug#38155)
* lisp/icomplete.el (icomplete-fido-kill)
(icomplete-fido-delete-char, icomplete-fido-ret)
(icomplete-fido-backward-updir): Rename from icomplete-magic-ido-*
versions.
(icomplete-fido-mode-map): Use new command names.
* lisp/progmodes/cc-mode (c-font-lock-fontify-region): Widen in this function,
to ensure that the CC Mode font locking mechanism can examine characters
outside the given region.
This fixes bug #4192.
* etc/NEWS: Add a new entry.
* lisp/progmodes/cc-defs.el (c-font-lock-flush): New macro.
* lisp/progmodes/cc-cmds.el (c-toggle-comment-style): On toggling the comment
style, invoke c-font-lock-flush when c-mark-wrong-style-of-comment is non-nil,
to cause that marking to be done instead on the other style of comment.
* lisp/progmodes/cc-fonts.el (c-maybe-font-lock-wrong-style-comments): New
function.
(c-cpp-matchers): Call c-maybe-font-lock-wrong-style-comments when
appropriate.
* lisp/progmodes/cc-vars.el (c-mark-wrong-style-of-comment): New customizable
option.
* doc/misc/cc-mode.texi (top level, Indentation Commands, Guessing the Style,
Custom Macros): For some opening quote marks, correct '' to ``.
(Minor Modes): Add an xref to the new page "Wrong Comment Style" in a
footnote.
(Wrong Comment Style): New page.
* lisp/simple.el (goto-history-element)
(next-history-element): Fix quoting of "future history".
* doc/lispref/minibuf.texi (Minibuffer Commands)
(Text from Minibuffer): Add index entry and cross-reference
for "future history". (Bug#38026)
Since we use `url-handler-mode` to deal with URLs, `read-file-name`
works just as well, with the added benefit that it interacts correctly
with packages that rebind `read-file-name-function`, such as Helm.
(ffap-read-url-internal, ffap-read-file-or-url-internal): Remove, unused.
* lisp/icomplete.el (icomplete-completions): Don't use ellipsis when
truncating determ in fido-mode. Highlight the center part of
determ with icomplete-first-match.
This is the way the basic completion styles work. This fixes
candidate highlighting in icomplete.
* lisp/minibuffer.el (completion-pcm--hilit-commonality): Apply
faces to 'face property, not font-lock-face.
This reverts commit 49fc040077.
It turns out that the fix for a minor aesthetical annoyance
caused much more serious bugs: bug#31038, bug#35726, Bug#37097,
Allow not to kill buffers when pdbtracking session is finished.
Pdbtracking session considered finished judging from the user input.
* lisp/progmodes/python.el (python-pdbtrack-kill-buffers): New
customizable variable.
(python-pdbtrack-set-tracked-buffer): Use it.
(python-pdbtrack-unset-tracked-buffer)
(python-pdbtrack-tracking-finish): New functions.
(python-pdbtrack-continue-command, python-pdbtrack-exit-command):
New customizable variables.
(python-pdbtrack-process-sentinel): New function. Finish
pdbtracking session when process is killed.
(python-pdbtrack-prev-command-continue): New variable.
(python-pdbtrack-comint-input-filter-function): New function.
Finish pdbtracking session based on commands sent to pdb.
(python-pdbtrack-comint-output-filter-function): Unset/set
tracking buffer if looking at pdb prompt; finish pdbtracking
session if filename of current stack frame starts with
"<" e.g. "<stdin>".
(python-pdbtrack-comint-output-filter-function): Don't override
overlay-arrow-string.
(python-pdbtrack-setup-tracking): New function.
(inferior-python-mode): Use it.
(python-pdbtrack-stacktrace-info-regexp): Default value is changed.
Must also match lines with filename like "<stdin>" and "<string>".
* etc/NEWS: Mention python-pdbtrack-kill-buffers
* lisp/net/ange-ftp.el (ange-ftp-repaint-minibuffer): Use empty message.
(ange-ftp-quote-string): Unquote the string.
(ange-ftp-substitute-in-file-name, ange-ftp-access-file)
(ange-ftp-copy-directory, ange-ftp-make-symbolic-link)
(ange-ftp-add-name-to-file): New defuns. Set 'ange-ftp property.
(ange-ftp-real-substitute-in-file-name)
(ange-ftp-real-copy-directory): New defuns.
(ange-ftp-file-name-as-directory): Care about `non-essential'.
(ange-ftp-file-attributes): Handle ID-STRING.
(ange-ftp-copy-file-internal, ange-ftp-rename-file)
(ange-ftp-make-directory): Improve error handling.
(ange-ftp-insert-directory): Initialize SWITCHES if they are nil.
* test/lisp/net/tramp-tests.el (ange-ftp-make-backup-files): Declare.
(tramp-test39-make-nearby-temp-file, tramp--test-ange-ftp-p): New defun.
(tramp-test05-expand-file-name-relative)
(tramp-test06-directory-file-name, tramp-test10-write-region)
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test17-insert-directory)
(tramp-test26-file-name-completion)
(tramp-test37-make-auto-save-file-name)
(tramp-test38-find-backup-file-name)
(tramp--test-special-characters): Use it.
* lisp/emacs-lisp/package.el (package--ensure-package-menu-mode):
Extract function to warn about incorrect major mode...
(package-menu-toggle-hiding, package-menu-refresh)
(package-menu-execute): ...from here.
(package-menu--mark-upgrades-1): And here, but move call...
(package-menu-mark-upgrades): ...here instead.
(package-menu-hide-package, package-menu-mark-delete)
(package-menu-mark-install, package-menu-mark-unmark)
(package-menu-quick-help, package-menu-get-status)
(package-menu-filter-by-keyword, package-menu-filter-by-name)
(package-menu-clear-filter): Add call to new function. (Bug#37891)
(dired-rename-file): Call vc-rename-file when dired-vc-rename-file is non-nil.
* lisp/vc/vc.el (vc-rename-file): Allow renaming added files.
Call vc-file-clearprops on new file too for the case when
old and new files were renamed to each other back and forth.
https://lists.gnu.org/archive/html/emacs-devel/2019-11/msg00069.html
* lisp/tab-line.el (tab-line-tabs-buffer-group-function)
(tab-line-tabs-buffer-group-sort-function)
(tab-line-tabs-buffer-groups-sort-function): New defvars.
(tab-line-tabs-buffer-group-name): Rename from
tab-line-tabs-buffer-groups--name and use tab-line-tabs-buffer-group-function.
(tab-line-tabs-buffer-groups): Use tab-line-tabs-buffer-groups-sort-function
and tab-line-tabs-buffer-group-sort-function.
(tab-line-new-tab): Let bind tab-line-tabs-buffer-groups to
mouse-buffer-menu-mode-groups.
This will allow js.el to work after maintenance changes in CC Mode, e.g. the
fix to bug #11165.
* lisp/progmodes/js.el (top level): Create a CC Mode derived language called
js-mode and based on Java Mode.
(js-mode): call c-init-language-vars for js-mode. Remove the direct settings
of several CC Mode language variables which are now defined through the
derived language mechanism. Call c-set-style and set up the needed style
variables c-block-comment-prefix and c-comment-prefix-regexp.
* time-stamp.el: Implement %:z as expanding to the numeric time zone
offset, to address the feature request of bug#32931. Do not document it
yet, to discourage compatibility problems in mixed Emacs 26 and Emacs 27
environments. Documentation will be added in a subsequent release at
least two years later. (We cannot yet use %z for numeric time zone
because in Emacs 26 it was documented to do something else.)
* time-stamp-tests.el (time-stamp-test-format-time-zone): expand this
test and break it into two tests, time-stamp-test-format-time-zone-name
and time-stamp-test-format-time-zone-offset.
* lisp/emacs-lisp/package.el (package-menu--refresh-archives): Rename
from duplicated name package-menu--refresh. (Bug#38084)
(package-menu-mode, list-packages): Use new name.
* lisp/emacs-lisp/package.el (package--activated): New variable to
avoid changing value of defcustom 'package-enable-at-startup'.
(package-initialize): Don't set 'package-enable-at-startup'.
(package-initialize, package-activate-all): Set 'package--activated'
instead of 'package-enable-at-startup'.
(package--initialized): Add doc string.
* lisp/startup.el (command-line): Check if 'package--activated' is
non-nil before activating packages.
* doc/lispref/package.texi (Packaging Basics): Update docs.
* lisp/emacs-lisp/package.el (package-menu--refresh): Rename from
'package-menu-refresh', make internal and non-interactive.
(package-menu-mode-map, package-menu-mode-menu, package-menu-mode)
(list-packages): Use the above. (Bug#35504)
(package-menu-refresh): Redefine as obsolete fuction alias for
'revert-buffer'.
* doc/emacs/package.texi (Package Menu): Document it.
* etc/NEWS: Announce it.
Suggested by Drew Adams.
* lisp/frame.el
(next-multiframe-window): Define as obsolete alias for...
(next-window-any-frame): ...new function name.
(previous-multiframe-window): Define as obsolete alias for...
(previous-window-any-frame): ...new function name. (Bug#12436)
* lisp/term/ns-win.el (global-map): Use new command name.
* doc/emacs/windows.texi (Other Window): Document it.
* etc/NEWS: Announce it.
Also don't send :error field on non-errors.
* lisp/jsonrpc.el (jsonrpc--reply): Don't send :result and :error
if none supplied.
(Version): Bump to 1.0.8
* lisp/tab-line.el (tab-line-tabs-function): Add option
tab-line-tabs-buffer-groups.
(tab-line-tabs-buffer-groups): New defvar defaulted to
mouse-buffer-menu-mode-groups.
(tab-line-tabs-buffer-groups--name, tab-line-tabs-buffer-groups):
New functions.
(tab-line-format): Support tabs in the format '(tab (name . "name") ...)'.
(tab-line-select-tab): Move part of code to tab-line-select-tab-buffer.
(tab-line-select-tab-buffer): New function.
(tab-line-tab-current): Rename from tab-line-tab-selected.
* lisp/net/network-stream.el
(network-stream-use-client-certificates): New user option.
(open-network-stream): If 'network-stream-use-client-certificates'
is t, and the user hasn't specified :client-certificate, do
certificate lookups via 'auth-source'.
(network-stream-certificate): Only return key and certificate
files that exist.
* doc/lispref/processes.texi (Network): Document new
client-certificate behavior.
* etc/NEWS: Document 'network-stream-use-client-certificates'.
(files.el subr.el): Fix some grammar errors in doc strings and comments.
(frame.c fringe.c image.c xfns.c xterm.c): Fix some English grammar
errors in doc strings.
* lisp/tab-bar.el (tab-bar-history-limit): Increase to 10 since wc
is not saved to the desktop file anymore, so doesn't affect its size.
(tab-bar-history--pre-change, tab-bar--history-change):
Store wc before possibly entering the minibuffer.
* lisp/tab-bar.el (frameset-filter-tabs): New function
added to 'frameset-filter-alist' for frame parameter 'tabs'.
(tab-bar--tab): Remove ws-bl/ws-bbl that are not needed because
frameset doesn't save frame buffer-list to desktop anyway.
(tab-bar-select-tab): Remove ws-bl/ws-bbl related code.
* lisp/emacs-lisp/seq.el (seq-reduce): Add autoload cookie.
* lisp/cus-edit.el (custom-group--draw-horizontal-line): New
function to draw horizontal lines which handles a non-nil value of
'truncate-lines'. (Bug#25308)
(custom-group-value-create): Use it.
Co-authored-by: Jonas Bernoulli <jonas@bernoul.li>
* lisp/international/mule-diag.el (describe-font): This function
can be used on unloaded fonts, so remove that restriction from the
doc string (bug#16815). Also allow completion over all fonts on
the system.
* src/font.c (Ffont_info): Ditto for the doc string.
Eglot, a third-party package which uses Flymake, has its own
diagnostic types such as 'eglot-error', 'eglot-warning', etc... While
not being too long, they will not fit in the type column of the "list
all diagnostics" buffer. This commit allows diagnostic types to have
user-defined names and also assigns names to the default categories.
* doc/misc/flymake.texi (Flymake error types): Describe
flymake-type-name prop.
* lisp/progmodes/flymake.el (flymake--diagnostics-buffer-entries):
Use type names.
(flymake-error, flymake-warning, flymake-note): Give these
diagnostic categories default type names.
This fixes bug #10149.
* lisp/progmodes/cc-fonts.el (c-font-lock-single-decl) Limit the search by
c-go-up-list-backwards to 500 non-literal characters.
* lisp/faces.el (set-face-font):
* doc/emacs/frames.texi (Fonts):
* doc/lispref/display.texi (Face Attributes)
(Attribute Functions): Clarify and correct the documentation
of set-face-font and related descriptions of font
specifications. (Bug#14647)
* lisp/icomplete.el (rfn-eshadow): Require it.
(icomplete-tidy-shadowed-file-names): New variable.
(icomplete-exhibit): Use icomplete-tidy-shadowed-file-names.
If there is no minibuffer input, but the user has already cycled some
pre-calculated completions, we should be calling
minibuffer-force-complete-and-exit instead of
minibuffer-complete-and-exit. The former is guaranteed to be fast in
this situation and yields the desired "selected" completion, while the
latter will just give us the default, ignoring all the cycling of
icomplete-{forward|backward}-completions.
* lisp/icomplete.el (icomplete-force-complete-and-exit): Add
comments and fix for empty input but some completions calculated.
* lisp/emacs-lisp/package.el (package-buffer-info): Don't signal an
error when the "footer line" is missing. Warn only. (Bug#26490)
* etc/NEWS: Announce it.
* lisp/progmodes/compile.el: Make ant regexp accept filenames that may
occur on Cygwin (like c:/test) and optional additional severity level
after task name.
* etc/compilation.txt: Add sample.
* lisp/cedet/semantic/texi.el (semantic-analyze-possible-completions),
lisp/cedet/srecode/srt-mode.el (semantic-analyze-possible-completions),
lisp/cedet/semantic/bovine/make.el (semantic-analyze-possible-completions):
Add `flags` arg.
* lisp/cedet/semantic/grammar.el (semantic-analyze-possible-completions):
Add `flags` arg. Reverse the found prefix.
(semantic-ctxt-current-class-list): Include token tags as things to
appear in non-lisp context.
'mouse-drag-region' leaves the region active around the dragged text,
so a straight undo did not revert the entire operation. To remedy
this, inhibit undo-in-region when the last command was
mouse-drag-region. (Method suggested by Stefan Monnier.)
* lisp/mouse.el (undo-drag-region): Set the undo-inhibit-region property.
* lisp/simple.el (undo): Inhibit undo-in-region if the last command
had the undo-inhibit-region property set.
* doc/lispref/symbols.texi (Standard Properties):
* doc/lispref/text.texi (Undo): Document undo-inhibit-region.
* etc/NEWS: Announce the property.
* lisp/font-lock.el (font-lock-set-defaults): Ensure that the font
lock variables are buffer-local even when nil, so that they're
copied correctly by mhtml mode when changing sub-modes (bug#33937).
* lisp/progmodes/sh-script.el (sh-syntax-propertize-function):
Tweak previous \ #foo change to work on all quoted characters, but
check that the backslash itself is not backslashed. Regexp from
Stefan Monnier.
* lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
Check, that `tramp-password-save-function' is a function.
* lisp/net/tramp-smb.el (tramp-smb-handle-file-system-info):
Check, that there is a share.
* lisp/net/tramp.el (outline-regexp): Declare.
(tramp-get-debug-buffer): Let-bind `signal-hook-function'.
* test/lisp/net/tramp-tests.el (tramp-test04-substitute-in-file-name):
Skip some tests for Emacs 24 and 25; they let Emacs crash.
This adds create/snapshot bindings to the stash button even when there
are no stashes, and extends the stash menu bindings.
* etc/NEWS: Announce the bindings.
* lisp/vc/vc-git.el (vc-git-stash-shared-map): New keymap. Holds
shared bindings between stash button and stash list.
(vc-git-stash-map): Inherit from vc-git-stash-shared-map.
(vc-git-stash-button-map): New keymap. Holds button bindings,
inherit from vc-git-stash-shared-map.
(vc-git-stash-shared-help, vc-git-stash-list-help): New
defconsts. Abstract out list/button help texts.
(vc-git--make-button-text): Set keymap property to
vc-git-stash-button-map.
(vc-git-make-stash-button): Use vc-git-stash-shared-help.
(vc-git-stash-menu-map): Add items for vc-git-stash and
vc-git-stash-snapshot.
(vc-git-dir-extra-headers): Use vc-git-stash-list-help and
vc-git-stash-shared-help. Add vc-git-stash and
vc-git-stash-snapshot bindings to text shown when there are no stashes.
* lisp/dired.el (dired-font-lock-keywords): Font-lock symlinks
differently based on whether they point at a directory or not
(bug#17064). Based on code from Michael Heerdegen.
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1):
\url{http://foo.org/bar%zot} shouldn't be fontified as having a
comment, so make the tex-verbatim face overwrite the
already-applied syntactical comment bits (bug#37134).
* lisp/vc/vc-git.el (vc-git-stash-map): Give `vc-git-stash' a
keystroke, because it's a useful command.
When there are no stashes, there's no way to use that keystroke (since
it's only bound on the stash lines), so perhaps that should also be
fixed somehow.
* lisp/progmodes/m4-mode.el (m4-font-lock-keywords): "dnl"
comments should override any previous syntax-based highlighting
(37132). This makes "dnl foo#bar" be highlighted correctly.
* lisp/emacs-lisp/syntax.el (syntax-ppss): Move the description of
the return value from...
* src/syntax.c (Fparse_partial_sexp): ... here because
`syntax-ppss' is what's called over the place, and jumping through
an indirection to get to the value description is inconvenient.
* lisp/simple.el (read-char-from-minibuffer-history):
Rename from read-char-with-history--history.
(read-char-from-minibuffer-map):
Rename from read-char-with-history--map.
(read-char-from-minibuffer): Rename from read-char-with-history.
(read-char-from-minibuffer-self-insert): New command.
(zap-to-char): Use read-char-from-minibuffer.
* lisp/simple.el (read-char-with-history): Reimplement based on
read-from-minibuffer.
* lisp/simple.el (read-char-with-history--map): New variable
(bug#10477).
* lisp/tab-bar.el (tab-bar--tab): Store additionally point-marker,
frame parameters buffer-list and buried-buffer-list, both for wc and ws.
Use seq-filter.
(tab-bar-select-tab): Restore point-marker after restoring
window-configuration. Also restore frame parameters buffer-list
and buried-buffer-list both for window-configuration and window-state.
(tab-bar-history-limit, tab-bar-history--minibuffer-depth): New variables.
(tab-bar-history-current): Rename from tab-bar-history--pre-change.
(tab-bar-history--pre-change): Set tab-bar-history-current.
(tab-bar--history-change): Use seq-take for tab-bar-history-limit.
(tab-bar-history-back, tab-bar-history-forward): Restore point-marker.
(tab-bar-list-noselect): Use seq-remove.
* lisp/emacs-lisp/seq.el (seq-take, seq-filter): Add autoload cookie.
* doc/lispref/errors.texi (Standard Errors): Mention the new error.
* lisp/files.el (auto-mode-alist): Add a bunch of image suffixes
to the list (bug#37972) based on the output from "gm convert -list
format" (i.e., graphicsmagick).
* lisp/image-mode.el (image-mode): Rewrite to possibly notify the
user about image-use-external-converter.
(image-mode--setup-mode): Factor out into own function and don't
run under `condition-case' as there's nothing here that should
error.
* lisp/image.el (unknown-image-type): New error.
(image-type): Signal that error so that image-mode can offer
sensible feedback to the user.
(completion-metadata): Always return a fresh new cons cell.
(completion--nth-completion): Don't bother calling adjust-metadata
if the result won't be used.
(completion-pcm--hilit-commonality): Revert recent change which had
removed support for `completions-first-difference` in `substring` and
`partial-completion` styles.
(completion--flex-adjust-metadata): Treat the arg as immutable.
Sometimes, when finding files with icomplete-mode, backward-deleting
the previous word or sexp (to move up a directory) doesn't actually
refresh the file list of the new directory. Forcing redisplay in
icomplete-exhibit misteriously fixes the problem.
* lisp/icomplete.el (icomplete-exhibit): Add call to redisplay.
This tries (not particularly hard) to emulate Ido's magic C-k, C-d,
RET and DEL. For now, the new commands have to be explicitly added to
an active map by the user, using something like this:
(let ((imap icomplete-minibuffer-map))
(define-key imap (kbd "C-k") 'icomplete-magic-ido-kill)
(define-key imap (kbd "C-d") 'icomplete-magic-ido-delete-char)
(define-key imap (kbd "RET") 'icomplete-magic-ido-ret)
(define-key imap (kbd "DEL") 'icomplete-magic-ido-backward-updir))
* lisp/icomplete.el (icomplete-magic-ido-kill)
(icomplete-magic-ido-delete-char, icomplete-magic-ido-ret)
(icomplete-magic-ido-backward-updir): New commands.
* lisp/tab-bar.el (tab-bar-history--pre-change): Store also minibuffer-depth.
(tab-bar-history-change): Check stored minibuffer-depth for zero.
(tab-bar-history-mode): Use prefix -- for internal functions.
* lisp/progmodes/python.el (python-rx): Use `rx-let' instead of
`rx-constituents'. This allows for some slight redundancy reduction,
since `rx-let' definitions are expanded inside `not' (bug#37849).
Reorder some `or' forms for more efficient matching.
* lisp/erc/erc.el (erc-hide-current-message-p): Make
erc-channel-hide-list work (bug#37879) by getting matching on the
channel name instead of the ERC client name.
* lisp/gnus/gnus-cus.el (gnus-group-customize): Decoding is
superfluous here -- everything is utf-8 already.
(gnus-group-customize-done): Don't double-encode the text (bug#37901).
* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
`tramp-encoding-command-interactive' must be the last command-line
switch, at least for bash. (Bug#37953)
Copyright-paperwork-exempt: yes
* lisp/tab-bar.el (tab-bar-back-button, tab-bar-forward-button):
New variables.
(tab-bar-make-keymap-1): Show these buttons in tab-bar-history-mode.
(tab-bar--tab): Add history-back and history-forward.
(tab-bar-select-tab): Restore history-back and history-forward.
(tab-bar-history-omit, tab-bar-history-back)
(tab-bar-history-forward, tab-bar-history-pre-change): New variables.
(tab-bar-history-pre-change, tab-bar-history-change)
(tab-bar-history-back, tab-bar-history-forward)
(tab-bar-history-mode): New functions.
This is so minibuffer.el can make use of cl-generic
* lisp/minibuffer.el (minibuffer-local-completion-map):
Move switch-to-completions bindings here from...
* lisp/simple.el (minibuffer-local-completion-map): ... here.
* time-stamp.el (time-stamp-time-zone): Support customization with
an integer offset (a new possible value of the ZONE argument to
format-time-string in Emacs 27).
Update the safe-local-variable predicate from string-or-null-p
(describing time-stamp-time-zone's domain before 2015) to new
predicate time-stamp-zone-type-p (describing the current domain).
* time-stamp-tests.el (time-stamp-test-helper-zone-type-p): New test.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print):
Don't use count-screen-lines, as it is unreliable when lines
are truncated and the region ends before a newline (the root
cause is in vertical-motion, but is very hard to fix there).
Instead, use vertical-motion directly, as the problems with
counting/not counting the newline that ends the region are not
relevant to what we need in this function, which is simply the
number of the current window line. (Bug#37941)
Often, when using icomplete with icomplete-show-matches-on-no-input
and commands like C-h f, icomplete-exhibit will take a long time (like
several seconds) to show all the completions.
However, if there is a non-nil default value, like when the C-h f is
performed exactly on a function name, the minibuffer prompt will
reflect that immediately. If the user immediately presses RE
(icomplete-force-complete-and-exit) we take that to mean "use the
default" and avoid the long wait.
As an extra performance tweak, this commit also removes an unneeded
call to icomplete-exhibit in icomplete-minibuffer-setup.
* lisp/icomplete.el (icomplete-force-complete-and-exit): Short-circuit
possibility of non-nil minibuffer-default.
(icomplete-minibuffer-setup): No need to explicitly icomplete-exhibit
here since icomplete-post-command-hook will call it unconditionally.
* lisp/net/tramp.el (tramp-call-process): `result' can also be nil.
* test/lisp/net/tramp-tests.el (tramp--test-timeout-handler):
Improve trace format.
The previous algorithm had two problems: it considered non-matches in
the beginning and end of the string as matching "holes" and failed to
penalize larger holes, making flex-score-match-tightness only
effective in some corner cases.
The new formula, which is described in code and in pseudo-code in the
comments, fixes these problems.
As a result, by default, C-h f flex now correctly bubbles up
"company-search-flex-regexp" to the top, in front of "file-exists-p".
With a flex-score-match-tightness smaller than 1.0, the situation is
reversed.
* lisp/minibuffer.el (flex-score-match-tightness): Adjust default
value. Improve docstring example.
(completion-pcm--hilit-commonality): Improve example. Remove unused
variable. Improve algorithm.
* doc/emacs/dired.texi (Operating on Files): Document behavior change.
* lisp/dired-aux.el (dired-dwim-target-directories): New function.
(dired-dwim-target-directory, dired-dwim-target-defaults): Use it
to get the most recently used window instead of the next window (bug#35385).
* lisp/dired.el (dired-dwim-target): Doc fix.
* test/lisp/dired-tests.el: Remove unnecessary require and pacify
byte-compiler.
* lisp/tab-line.el (tab-line-tabs-function): Turn defvar into defcustom
with default of tab-line-tabs-window-buffers.
(tab-line-tabs-mode-buffers): New function.
(tab-line-tabs-window-buffers): Rename from tab-line-tabs.
(tab-line-select-tab, tab-line-switch-to-prev-tab)
(tab-line-switch-to-next-tab): Handle the value tab-line-tabs-window-buffers
of tab-line-tabs-function specially.
(tab-line-mode): Rename from global-tab-line-mode and change scope
to buffer-local.
(global-tab-line-mode): New globalized-minor-mode.
(tab-line-mode--turn-on): New function.
(tab-line-exclude-modes): New defcustom.
(tab-line-exclude): New buffer-local variable.
https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00988.html
* lisp/dired.el (dired-mark-pop-up): Set tab-line-exclude to nil.
Don't set tab-line-format. (Bug#37699)
* lisp/speedbar.el (speedbar-mode): Set tab-line-exclude to nil.
Don't set tab-line-format.
(tab-recent): Alias to tab-bar-switch-to-recent-tab.
(tab-bar--tab-index-recent): New internal function.
(tab-bar-close-tab-select): Add new default option 'recent'.
(tab-bar-close-tab): Handle it.
* lisp/emacs-lisp/seq.el (seq-sort-by, seq-remove): Add autoload.
* lisp/tab-bar.el (tab-bar-close-last-tab-choice): New custom
variable.
(tab-bar-close-tab): Handle closing the last tab specially, referring to
tab-bar-close-last-tab-choice.
The previous commit titled "Rework face hints for partial-string
completion styles" contained a potentially controversial
backwards-incompatible change to this face's default value.
* lisp/minibuffer.el (completions-common-part): Restore empty
default value.
* lisp/textmodes/reftex-cite.el (reftex-figure-out-cite-format):
Extend regexp to match additional cite commands from biblatex.sty.
* lisp/textmodes/reftex-dcr.el (reftex-view-crossref): Extend
regexp to match additional cite commands from biblatex.sty and
reference commands from cleveref.sty.
* lisp/textmodes/reftex-ref.el (reftex-format-special): Be
case-sensitive when checking the actual reference macro against
\ref. This avoids infloop when \Ref is chosen.
Don't use completions-first-difference for the 'substring', 'flex' and
'partial-completion' styles, since there can be really no reasonable
definition of a "first" difference there.
Make completions-common-part inherit from 'underline' so that it is
useful by default for all completion styles.
* lisp/minibuffer.el (completions-common-part): Adjust
description and change default value.
(completions-first-difference): Ajust docstring.
(completion-pcm--hilit-commonality): Don't use
completions-first-difference.
This commit re-does the now-reverted commit with the same title. That
version relied on generic functions, which cannot be used yet in files
such as lisp/minibuffer.el. This version uses a symbol property
completion--adjust-metadata instead.
The new facility allows completion styles to have a say in metadata
properties such as cycle-sort-function and display-sort-function.
This is especially useful for completion styles such as 'flex', which
generally produce many matches, including some potentially "obscure"
ones. The default sorting strategy would often bubble the latter to
the top of the list.
The sorting function for 'flex' considers pre-computed matching scores
and is thus much better than the default for this particular style.
Additionally, it overrides the completion table's cycle-sort-function
or display-sort-function properties if they exist, although it still
uses them to pre-sort the result, so that they are still relevant for
resolving ties.
* lisp/minibuffer.el (completion--nth-completion)
(completion--flex-adjust-metadata): New helper.
(flex): Put completion--adjust-metadata property.
The new facility, realized in the completion-adjust-metadata-for-style
generic, allows completion styles to have a say in metadata properties
such as cycle-sort-function and display-sort-function. This is
especially useful for completion styles such as 'flex', which
generally produce many matches, including some potentially "obscure"
ones. The default sorting strategy would often bubble the latter
to the top of the list.
The sorting function for 'flex' considers pre-computed matching scores
and is thus much better than the default for this particular style.
Additionally, it overrides the completion table's cycle-sort-function
or display-sort-function properties if they exist, although it still
uses them to pre-sort the result, so that they are still relevant for
resolving ties.
* lisp/minibuffer.el (completion--nth-completion): Call
completion-adjust-metadata-for-style.
(completion-adjust-metadata-for-style): New generic.
(completion-adjust-metadata-for-style 'flex): New method.
The functions image-scroll-down, image-scroll-up, image-next-line, and
image-previous-line now return pixel values instead of multiples of
character height as of commit 9c66b09950.
* lisp/doc-view.el (doc-view-scroll-up-or-next-page):
(doc-view-scroll-down-or-previous-page):
(doc-view-next-line-or-next-page):
(doc-view-previous-line-or-previous-page):
(doc-view-insert-image): Adapt to image-scroll-up/down and
image-next/previous-line now returning pixel values instead of
multiples of character heights. Fixes bug#37874.
* lisp/progmodes/cc-cmds.el (c-guess-fill-prefix): When determining a new
block comment prefix (i.e. there isn't one already there to copy), and that
prefix is hard up against a comment closer, ensure there are at least two
spaces before the closer.
(c-indent-new-comment-line): Amend the strategy for ensuring that point isn't
left hard up against the comment closer after M-j.
* lisp/gnus/gnus-sum.el (gnus-thread-hide-subtree): Make the
"Non-nil" predicate do what it's supposed to (i.e., return non-nil
on non-nil values (excepting predicates)) (bug#37916).
Mostly renaming functions by adding `mode-local--` to their name
and leaving an obsolete alias behind, just in case.
(define-child-mode): Make obsolete.
(mode-local--set-parent): Rename from set-mode-local-parent.
(mode-local--new-bindings): Rename from new-mode-local-bindings.
Use `obarray-make`.
(mode-local--activate-bindings): Rename from activate-mode-local-bindings.
(mode-local--deactivate-bindings): Rename from
deactivate-mode-local-bindings.
(make-obsolete-overload): Rename properties with a `mode-local--` prefix.
Adjust all users.
(mode-local--overload-obsoleted-by): Rename from overload-obsoleted-by.
(mode-local--overload-that-obsolete): Rename from overload-that-obsolete.
(mode-local--function-overload-p): Rename from function-overload-p.
(mode-local-read-function): Mark obsolete.
(mode-local--overload-docstring-extension): Rename from
overload-docstring-extension.
(mode-local--describe-overload): Rename from describe-mode-local-overload.
* lisp/cedet/semantic/fw.el (semantic-install-function-overrides):
Remove unused `mode` argument.
* lisp/cedet/semantic/grammar-wy.el (semantic-grammar-wy--install-parser):
* lisp/cedet/semantic/bovine/grammar.el (bovine-grammar-mode):
* lisp/cedet/semantic/texi.el (semantic-default-texi-setup):
* lisp/cedet/semantic/wisent/grammar.el (wisent-grammar-setupcode-builder)
(wisent-grammar-mode):
* lisp/cedet/semantic/html.el (semantic-default-html-setup):
Make the `semantic-` prefix explicit to ease grep search.
(html-helper-mode): Remove obsolete setting.
* lisp/cedet/semantic/wisent/javascript.el: Fix js-mode/javascript-mode
mixup so we don't need define-child-mode any more.
(semantic-get-local-variables, semantic-ctxt-current-symbol)
(semantic-tag-protection, semantic-analyze-scope-calculate-access):
Use `js-mode` rather than `javascript-mode` as the mode name since
that's the real mode's name.
* lisp/cedet/semantic/wisent/python.el (python-2-mode, python-3-mode):
Remove child declaration for non-existing modes.
* lisp/cedet/srecode/map.el (srecode-map-validate-file-for-mode): Simplify.
(with-mode-local-symbol, with-mode-local, setq-mode-local)
(defvar-mode-local, defconst-mode-local)
(define-overloadable-function, define-mode-local-override):
Use `declare` for indent and edebug specs.
(xref-mode-local-find-overloadable-regexp): Simplify regexp.
(mode-local-setup-edebug-specs): Delete.
(edebug-setup-hook): Don't use any more.
* lisp/tab-bar.el (tab-bar-new-tab-to): Rename from tab-bar-new-tab.
Add optional arg TO-INDEX.
(tab-bar-new-tab): New implementation to use relative ARG.
(tab-new-to): Alias to tab-bar-new-tab-to.
* lisp/tab-bar.el (tab-bar-move-tab-to): Rename from tab-bar-swap-tabs.
Change logic to push the moved tab between existing tabs.
(tab-bar-move-tab): Call tab-bar-move-tab-to instead of tab-bar-swap-tabs.
(tab-move-to): Rename alias from tab-swap.
* lisp/tab-bar.el (tab-bar-closed-tabs): New variable.
(tab-bar-close-tab): Add closed tab to tab-bar-closed-tabs.
Disable tab-bar-mode on closing the last tab.
(tab-bar-close-other-tabs): Add all closed tabs to tab-bar-closed-tabs.
(tab-bar-undo-close-tab): New command.
(tab-undo): Alias to tab-bar-undo-close-tab.
Completion tables are not supposed to signal errors:
emacs -q
M-x semantic-mode
; visit a file supported by semantic, such as a C file
; put cursor in a blank space
M-x completion-at-point
It will error with: "Nothing to complete"
(semantic-analyze-possible-completions): Return nil instead of
signaling errors.
* lisp/erc/erc-goodies.el (erc-possibly-scroll-to-bottom): New
function.
(scrolltobottom): Add to erc-insert-done-hook.
* lisp/erc/erc.el (erc-insert-done-hook): New hook (bug#11697).
(erc-display-line-1): Use it.