Stefan Monnier [Sun, 14 Mar 2021 15:35:55 +0000 (11:35 -0400)]
Revert "* lisp/calendar/appt.el (appt-activate): Set the local `write-file-functions`"
This reverts commit 587a97bcb23bc6ea429ab790efa03f2260a9bca8.
We really do want to affect the global part of the hook.
Reported by Gabriel <gabriel376@hotmail.com>.
Juri Linkov [Sun, 14 Mar 2021 09:29:31 +0000 (11:29 +0200)]
* lisp/tab-bar.el: Tab groups can be displayed with tab-bar-format-tabs-groups
* lisp/tab-bar.el (tab-bar-format): Turn defvar into defcustom.
Add :options and force-mode-line-update in :set.
(tab-bar--format-tab): New function refactored from tab-bar-format-tabs.
(tab-bar-format-tabs): Move most of code to tab-bar--format-tab and call it.
(tab-bar-tab-group-format-function): New defcustom.
(tab-bar-tab-group-format-default): New function.
(tab-bar--format-tab-group, tab-bar-format-tabs-groups): New functions.
(tab-bar-format-align-right, tab-bar-format-global): Shorten id.
(tab-bar-change-tab-group): Add refs to tab-bar-format in docstring.
* lisp/tab-line.el: Add face for group-tab (bug#47118)
(tab-line-tab-face-functions): Add choice for 'tab-line-tab-face-group'.
(tab-line-tab-group): New face.
(tab-line-tabs-buffer-groups): Set alist key 'group-tab' for group tabs.
(tab-line-tab-face-group): New function to set face for group tabs.
Juri Linkov [Sat, 13 Mar 2021 21:33:14 +0000 (23:33 +0200)]
Separate values 'override' and 'append' in 'outline-minor-mode-highlight'
* lisp/outline.el (outline-font-lock-keywords): Handle 'override' and 'append'
separately.
(outline-minor-mode-highlight): Separate values 'override' and 'append'.
(outline-minor-mode-highlight-buffer): Go to match-beginning
before checking '(point)'.
Eli Zaretskii [Sat, 13 Mar 2021 15:00:15 +0000 (17:00 +0200)]
Fix rare redisplay glitches when image has been removed from display
* src/dispnew.c (update_window): Make sure all glyph rows below
the last visible one are marked as invalid, even when the loop
which "updates the rest of the lines" didn't examine the last
visible row. (Bug#47093)
Stefan Kangas [Sat, 13 Mar 2021 14:17:24 +0000 (15:17 +0100)]
Adjust colors of help-key-binding face for readability
* lisp/faces.el (help-key-binding): Adjust colors for improved
readability, and use a flat :box for highlighting (with negative
:line-width height to avoid any vertical resizing of the minibuffer).
This was discussed in:
https://lists.gnu.org/r/emacs-devel/2021-03/msg00535.html
Glenn Morris [Fri, 12 Mar 2021 16:41:03 +0000 (08:41 -0800)]
Skip recent undo tests in batch mode for now
* test/lisp/simple-tests.el (simple-tests--undo-in-region):
Split into separate test. Skip in batch mode for now.
(simple-tests--undo-equiv-table): Skip in batch mode for now.
Stefan Monnier [Fri, 12 Mar 2021 16:32:42 +0000 (11:32 -0500)]
* lisp/cedet/{*.el,ede/*.el}: Use lexical-binding
Remove a few redundant `:group` arguments as well.
* lisp/cedet/ede.el: Use lexical-binding.
Don't load `ede/files` at compile-time.
(ede-speedbar): Declare function.
(ede-load-project-file): Allow `rootreturn` to be a reference rather
than a symbol.
(ede-initialize-state-current-buffer): Pass `ROOT` as a reference
rather than a symbol to `ede-directory-get-open-project` and
`ede-load-project-file` so we don't need to make it dynamically scoped.
(ede-flush-deleted-projects): Avoid `add-to-list` on a local var.
* lisp/cedet/ede/files.el: Use lexical-binding.
(ede-directory-get-open-project): Allow `rootreturn` to be a reference
rather than a symbol.
(ede-project-root-directory): Remove unused var `root`.
(ede-expand-filename-impl): Remove unused vars `path` and `proj`.
* lisp/cedet/cedet-idutils.el: Use lexical-binding.
(cedet-idutils-search): Remove always-nil variable `scopeflags`.
* lisp/cedet/data-debug.el: Use lexical-binding.
(data-debug-insert-overlay-button, data-debug-insert-overlay-list-button)
(data-debug-insert-buffer-button, data-debug-insert-buffer-list-button)
(data-debug-insert-process-button): Remove always-nil variable `tip`.
(data-debug-insert-ring-button): Remove unused var `ringthing`.
(data-debug-insert-widget-properties): Remove unused var `type`.
* lisp/cedet/semantic.el: Use lexical-binding.
(semantic-mode): Strength-reduce `eval` to `symbol-value`.
* lisp/cedet/ede/custom.el: Use lexical-binding.
(ede-project-sort-targets): Remove unused vars `count`, `current`, and
`order`.
* lisp/cedet/ede/pconf.el: Use lexical-binding.
(ede-proj-configure-synchronize): Remove unused var `add-missing`.
* lisp/cedet/ede/pmake.el (ede-proj-makefile-garbage-patterns):
Simplify via η-reduction.
(ede-proj-makefile-dependencies): Use `seq-some` rather than `eval+or`.
* lisp/cedet/ede/proj-elisp.el: Use lexical-binding.
(project-compile-target): Remove unused var `elc`.
(ede-update-version-in-source): Remove unused var `match`.
(project-compile-target): Declare function `cedet-update-autoloads`
from file we don't have.
* lisp/cedet/cedet-cscope.el: Use lexical-binding.
* lisp/cedet/cedet-files.el: Use lexical-binding.
* lisp/cedet/cedet-global.el: Use lexical-binding.
* lisp/cedet/cedet.el: Use lexical-binding.
* lisp/cedet/ede/auto.el: Use lexical-binding.
* lisp/cedet/ede/autoconf-edit.el: Use lexical-binding.
* lisp/cedet/ede/config.el: Use lexical-binding.
* lisp/cedet/ede/cpp-root.el: Use lexical-binding.
* lisp/cedet/ede/detect.el: Use lexical-binding.
* lisp/cedet/ede/generic.el: Use lexical-binding.
* lisp/cedet/ede/linux.el: Use lexical-binding.
* lisp/cedet/ede/locate.el: Use lexical-binding.
* lisp/cedet/ede/makefile-edit.el: Use lexical-binding.
* lisp/cedet/ede/proj-info.el: Use lexical-binding.
* lisp/cedet/ede/proj-obj.el: Use lexical-binding.
* lisp/cedet/ede/proj-prog.el: Use lexical-binding.
* lisp/cedet/ede/proj-shared.el: Use lexical-binding.
* lisp/cedet/ede/proj.el: Use lexical-binding.
* lisp/cedet/ede/shell.el: Use lexical-binding.
* lisp/cedet/ede/simple.el: Use lexical-binding.
* lisp/cedet/ede/source.el: Use lexical-binding.
* lisp/cedet/ede/speedbar.el: Use lexical-binding.
* lisp/cedet/ede/util.el: Use lexical-binding.
* doc/lispref/display.texi (Image Descriptors): Document it.
* lisp/image.el (image-transform-smoothing): New user option.
(create-image): Use it.
(image--default-smoothing): New function.
Yuan Fu [Wed, 3 Mar 2021 14:50:15 +0000 (09:50 -0500)]
Map redo records for undo in region to 'undo-in-region
* lisp/simple.el (undo-equiv-table): Add explaination for
undo-in-region, undo to the beginning of undo list and null undo.
(undo): If equiv is 'undo-in-region, empty or t, set pending-undo-list
to t. If the redo is undo-in-region, map buffer-undo-list to
'undo-in-region instead of t, if it is an identity mapping, map to
'empty.
(undo-make-selective-list): Only continue when ulist is a proper list.
* test/lisp/simple-tests.el (simple-tests--undo): Add test for
undo-only in region.
(simple-tests--sans-leading-nil): New helper function.
(simple-tests--undo-equiv-table): New test for 'undo-equiv-table'.
Stefan Monnier [Thu, 11 Mar 2021 19:32:42 +0000 (14:32 -0500)]
* lisp/mail/: Use lexical-binding
Remove some redundant `:group` args as well.
* lisp/mail/supercite.el: Use lexical-binding.
(completer-disable): Declare var.
(sc-set-variable): Don't rely on dynbind to access `help` variable.
* lisp/mail/mail-extr.el: Use lexical-binding.
(mail-extract-address-components): Avoid use of dynamic scoping to
refer to local vars.
* lisp/mail/mailabbrev.el: Use lexical-binding.
(mail-abbrev-make-syntax-table): Rename `_` variable to `syntax-_`.
* lisp/mail/mailheader.el: Use lexical-binding.
(headers): Don't declare as dynbound globally.
(mail-header-set, mail-header-merge): Declare `headers` as dynbound
locally, instead. Mark those functions as obsolete.
(mail-header-format): Use `alist-get` instead of `mail-header`.
* lisp/mail/binhex.el (binhex-decode-region-external): Remove always-nil
var `firstline`.
* lisp/mail/emacsbug.el: Use lexical-binding.
(report-emacs-bug): Remove always-nil var `message-end-point`.
* lisp/mail/rmail-spam-filter.el: Use lexical-binding.
(bbdb/mail_auto_create_p): Declare variable.
* lisp/mail/rmail.el (rmail-get-new-mail): Remove always-nil var
`delete-files`.
* lisp/mail/rmailout.el: Use lexical-binding.
(rmail-output-read-file-name): Remove unused var `err`.
(rmail-convert-to-babyl-format): Remove unused var `count`.
(rmail-output-as-mbox): Remove unused vars `from` and `date`.
* lisp/mail/rmailsort.el: Use lexical-binding.
(rmail-sort-messages): Remove unused var `msginfo`.
* lisp/mail/rfc822.el: Use lexical-binding.
* lisp/mail/rmailedit.el: Use lexical-binding.
* lisp/mail/mailclient.el: Use lexical-binding.
* lisp/mail/blessmail.el: Use lexical-binding.
* lisp/mail/mail-hist.el: Use lexical-binding.
* lisp/mail/rmailkwd.el: Use lexical-binding.
* lisp/mail/rmailmsc.el: Use lexical-binding.
* lisp/mail/uce.el: Use lexical-binding.
* lisp/mail/unrmail.el: Use lexical-binding.
Juri Linkov [Thu, 11 Mar 2021 19:05:12 +0000 (21:05 +0200)]
* lisp/tab-bar.el (tab-bar--current-tab-find): New function.
(tab-bar-close-other-tabs, tab-bar-close-group-tabs): Use it.
(tab-bar--history-pre-change): Rename from
'tab-bar-history--pre-change' to follow naming convention.
(tab-bar-history-mode): Use renamed 'tab-bar--history-pre-change'.
This functionality was broken by commit 3d5e31eceb9dc1fb62b2b2,
the problem being that we end up considering as distinct the events
`down-double-mouse-1` and `double-down-mouse-1`.
Reported by Eyal Soha <eyalsoha@gmail.com>
(mouse--click-1-maybe-follows-link): Make sure the last element of
the list passed to `event-convert-list` is indeed a "basic" event.
Stefan Monnier [Thu, 11 Mar 2021 06:14:30 +0000 (01:14 -0500)]
* lisp/gnus/nnmh.el (nnmh-newsgroup-articles): Declare var
Reported by Barry Fishman <barry@ecubist.org>.
Along the way, I checked other variables which are similarly let-bound
to nil and then read with any intervening assignment, which found
another similar case of missing `defvar`s plus a bit of dead code.
* lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal):
Remove constant nil var `beg`.
* lisp/gnus/gnus-search.el (gnus-search-query-parse-kv):
Remove constant nil var `return`.
* lisp/gnus/gnus-start.el (gnus-ask-server-for-new-groups):
Remove constant nil var `group`.
(gnus-killed-assoc, gnus-marked-assoc, gnus-newsrc-assoc): Declare vars.
* lisp/gnus/gnus-sum.el (gnus-compute-read-articles):
Remove constant nil var `first`.
* lisp/gnus/nnbabyl.el (nnbabyl-request-accept-article):
Remove constant nil var `beg`.
* lisp/gnus/nnfolder.el (nnfolder-possibly-change-group):
Remove constant nil var `inf`.
* lisp/gnus/nnrss.el (nnrss-request-article):
Remove constant nil var `err`.
Juri Linkov [Wed, 10 Mar 2021 18:09:23 +0000 (20:09 +0200)]
* lisp/tab-bar.el (tab-bar-close-group-tabs): New command.
(tab-close-group): New alias.
(tab-bar-close-other-tabs): Rewrite to fix old bug where regardless of
the returned value from tab-bar-tab-prevent-close-functions,
only one tab was retained.
Juri Linkov [Wed, 10 Mar 2021 17:57:48 +0000 (19:57 +0200)]
* lisp/tab-bar.el: 'C-x t G' (tab-group) assigns a group name to the tab.
* lisp/tab-bar.el (tab-bar--tab, tab-bar--current-tab): Add tab group if any.
(tab-bar-change-tab-group): New command.
(display-buffer-in-new-tab): Handle tab-group alist entry.
(tab-group): New alias.
(tab-prefix-map): Bind "G" to 'tab-group'.
Stefan Kangas [Wed, 10 Mar 2021 02:29:50 +0000 (03:29 +0100)]
Use 'help-key-binding' face in userlock.el
* lisp/userlock.el (userlock--fontify-key): New function.
(ask-user-about-lock, ask-user-about-lock-help,
(ask-user-about-supersession-threat)
(ask-user-about-supersession-help): Add face 'help-key-binding' to
displayed keys.
Dmitry Gutov [Wed, 10 Mar 2021 01:08:29 +0000 (03:08 +0200)]
(project-switch-commands): Remove the ###autoload instruction
* lisp/progmodes/project.el (project-switch-commands):
Remove the ###autoload instruction. It's unnecessary and can
cause surprises in some circumstances (bug#46986).
Paul Eggert [Tue, 9 Mar 2021 19:22:59 +0000 (11:22 -0800)]
Port alternate signal stack to upcoming glibc 2.34
* src/sysdep.c (sigsegv_stack): Increase size to 64 KiB and align
it to max_align_t. This copies from Gnulib’s c-stack.c, and works
around a portability bug in draft glibc 2.34, which no longer
defines SIGSTKSZ when _GNU_SOURCE is defined.
Juri Linkov [Tue, 9 Mar 2021 17:27:31 +0000 (19:27 +0200)]
* lisp/tab-bar.el (tab-bar-select-tab): Set window-state-put WINDOW arg to nil
WINDOW arg nil will always create a new window regardless of the value
returned by 'frame-root-window' that is nondeterministic - it returns
an internal window when there are more than 1 window on the frame/tab,
otherwise it returns a live window that was reused between different tabs
(bug#46904)
(tab-prefix-map): Bind "u" to 'tab-undo'.
smerge-vc-next-conflict: Move to conflict markers more reliably
* lisp/vc/smerge-mode.el (smerge-vc-next-conflict): Search for a
conflict marker if call to (vc-find-conflicted-file) haven't resulted in
a jump to one. And remove `buffer` variable that becomes unused.
Stefan Monnier [Mon, 8 Mar 2021 15:11:22 +0000 (10:11 -0500)]
* lisp/net/*.el: Use lexical-binding
Also remove some redundant `:group` arguments.
* lisp/net/eudc-export.el: Use lexical-binding.
(eudc-create-bbdb-record): Use `cl-progv` and `apply` to avoid `eval`.
* lisp/net/eudc-hotlist.el: Use lexical-binding.
* lisp/net/eudc.el (eudc-print-attribute-value): Use `funcall` to avoid
`eval`.
* lisp/net/eudcb-bbdb.el: Use lexical-binding.
(eudc-bbdb-filter-non-matching-record): Use `funcall` to avoid `eval`.
Move `bbdb-val` binding to avoid `setq`.
Use `seq-some` instead of `eval+or`.
(eudc-bbdb-format-record-as-result): Use `dolist` and `pcase`.
Use `funcall` to avoid `eval`.
(eudc-bbdb-query-internal): Simplify a bit.
* lisp/net/eudcb-ldap.el: Use lexical-binding.
(eudc-ldap-get-host-parameter): Use `defalias` to avoid `eval-and-compile`.
* lisp/net/telnet.el: Use lexical-binding.
* lisp/net/quickurl.el: Use lexical-binding.
* lisp/net/newst-ticker.el: Use lexical-binding.
* lisp/net/newst-reader.el: Use lexical-binding.
* lisp/net/goto-addr.el: Use lexical-binding.
* lisp/net/gnutls.el: Use lexical-binding.
* lisp/net/eudcb-macos-contacts.el: Use lexical-binding.
* lisp/net/eudcb-mab.el: Use lexical-binding.
* lisp/net/net-utils.el: Use lexical-binding.
(finger): Remove unused var `found`.
Fix structure of condition object in nested 'ert-fail'.
See the test 'ert-test-fail' for the expected structure.
* lisp/emacs-lisp/ert.el (ert--should-signal-hook): Condition list
should be (SYMBOL . DATA), not (SYMBOL DATA).
* test/lisp/emacs-lisp/ert-tests.el (ert-test-fail-inside-should): Fix
unit test.
Mauro Aranda [Mon, 8 Mar 2021 11:11:38 +0000 (08:11 -0300)]
Make checkdoc--next-docstring use the doc-string-elt property
This follows from a fix for Bug#46918 and a discussion to use
doc-string-elt:
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00232.html
* lisp/emacs-lisp/checkdoc.el (checkdoc--next-docstring): Check for a
non-nil doc-string-elt property, instead of hard-coding the
supported symbols. Use that property to position point at the
doc-string.
Stefan Kangas [Mon, 8 Mar 2021 02:29:42 +0000 (03:29 +0100)]
Add new face 'help-key-binding' for keybindings in help
* lisp/faces.el (help-key-binding): New face.
* lisp/help.el
(help-for-help): Rename from 'help-for-help-internal'. Use
'substitute-command-keys' syntax.
(help): Make into alias for 'help-for-help'.
(help-for-help-internal): Make into obsolete alias for
'help-for-help'.
(help--key-description-fontified): New function to add the
'help-key-binding' face.
(help-key-description, substitute-command-keys)
(describe-map-tree, help--describe-command)
(help--describe-translation, describe-map):
* lisp/help-fns.el (help-fns--key-bindings, describe-mode):
Use above new function.
* lisp/isearch.el (isearch-help-for-help-internal): Use
`substitute-command-keys' syntax.
* lisp/help-macro.el (make-help-screen): Use
'substitute-command-keys' and 'help--key-description-fontified'.
Simplify.
* src/keymap.c (describe_key_maybe_fontify): New function to add
the 'help-key-binding' face to keybindings.
(describe_vector): Use above new keybinding.
(syms_of_keymap) <Qfont_lock_face, Qhelp_key_binding>: New
DEFSYMs.
(fontify_key_properties): New static variable.
* lisp/tooltip.el (tooltip-show): Avoid overriding faces in
specified tooltip text.
* test/lisp/help-tests.el (with-substitute-command-keys-test):
Don't test for text properties.
(help-tests-substitute-command-keys/add-key-face)
(help-tests-substitute-command-keys/add-key-face-listing):
New tests.
Dmitry Gutov [Mon, 8 Mar 2021 02:25:15 +0000 (04:25 +0200)]
Speed up xref rendering for matches on very long lines
* lisp/progmodes/xref.el (xref--insert-xrefs): Cut up the current
line into pieces here for multiple matches's summaries, so that
xref--insert-xrefs can do less work (bug#46859).
(xref--insert-xrefs): Do less work.
(xref--outdated-p):
Update accordingly to how the summary creation logic changed.
(xref--buf-pairs-iterator): Update to the new calling convention.
(xref-location-column): Effectively rename back to
xref-file-location-column since the generic version is now unused.
* test/lisp/progmodes/xref-tests.el
(xref-matches-in-directory-finds-two-matches-on-the-same-line)
(xref-matches-in-directory-finds-an-empty-line-regexp-match):
Adjust to the xref-location-column change.
(xref-matches-in-files-trims-summary-for-matches-on-same-line):
New test.
* test/lisp/progmodes/xref-resources/file1.txt:
Change contents slightly to test the new xref--outdated-p code.
Dmitry Gutov [Mon, 8 Mar 2021 00:44:24 +0000 (02:44 +0200)]
Xref test improvements
* test/lisp/progmodes/xref-tests.el
(xref--xref-file-name-display-is-abs):
Fix not to rely on the default value.
(xref-matches-in-files-includes-matches-from-all-the-files):
New test.