Sean Whitton [Sun, 18 Sep 2022 21:47:23 +0000 (14:47 -0700)]
Add support for user edits to VC command arguments
* lisp/vc/vc-dispatcher.el (vc-pre-command-functions): New hook.
(vc-want-edit-command-p): New variable.
(vc-do-command): If vc-want-edit-command-p is non-nil, prompt the user
to edit the VC command & arguments before execution. Run the new hook.
(vc-do-async-command): Use the new hook to insert into BUFFER the
command that's next to be run.
* lisp/vc/vc-git.el (vc-git--pushpull): Drop prompting code. Bind
vc-want-edit-command-p so that vc-do-command handles the prompting.
Use the new hook to update compile-command with the edited command.
* lisp/vc/vc.el (vc-print-branch-log): A non-nil prefix argument now
means vc-want-edit-command-p is bound to a non-nil value (bug#57807).
Stefan Kangas [Wed, 21 Sep 2022 12:22:26 +0000 (14:22 +0200)]
; Explicitly declare linum-mode obsolete
* lisp/obsolete/linum.el (linum-mode, global-linum-mode):
Explicitly declare obsolete to warn the user, and recommend using
'display-line-numbers-mode' instead.
Suggested by Philip Kaludercic <philipk@posteo.net>.
* lisp/image-file.el (image-file-name-regexp): Treat
`image-file-name-regexps' as a list of regexps (as documented) in
addition to a regexp string (bug#57971).
Po Lu [Wed, 21 Sep 2022 11:31:45 +0000 (19:31 +0800)]
Small adjustments to precision pixel scrolling
* lisp/pixel-scroll.el
(pixel-scroll-precision-interpolation-factor): Adjust for
increased accuracy.
(pixel-scroll-precision-interpolate): Slightly decrease accuracy
in exchange for consing less floats.
(pixel-scroll-interpolate-down, pixel-scroll-interpolate-up):
Fix usage of function.
Po Lu [Wed, 21 Sep 2022 11:24:06 +0000 (19:24 +0800)]
Improve scroll interpolation in pixel-s-precision-mode
* lisp/pixel-scroll.el (pixel-scroll-precision-interpolate): New
arg FACTOR. Use it to determine the interpolation factor if
non-nil. Also, clear scroll remainder if direction changes, and
determine deltas based on the absolute amount of time passed.
(bug#57967)
(pixel-scroll-interpolate-down, pixel-scroll-interpolate-up):
Pass factor of 0 to scroll exactly 1 page.
* lisp/mail/emacsbug.el (report-emacs-bug, submit-emacs-patch):
Adjust callers.
(emacs-build-description): Rename from
`emacs-bug--system-description' and make into a command.
Robert Pluim [Wed, 21 Sep 2022 07:12:53 +0000 (09:12 +0200)]
Fix substitute-command-keys for global binding lookup
The previous change forgot to account for the (rare) case of doing a
lookup for a global binding when a specific keymap is in force.
* lisp/help.el (substitute-command-keys): Redo lookup in global map if
lookup in specific map fails.
*
test/lisp/help-tests.el (help-tests-substitute-command-keys/keymap-change):
Add testcase for specific map overriding advertised-binding.
Juri Linkov [Wed, 21 Sep 2022 06:42:55 +0000 (09:42 +0300)]
* lisp/outline.el: More improvements for buttons/margins (bug#57813)
(outline-minor-mode-use-margins): Don't use for modes derived from help-mode
that are handled by 'outline-minor-mode-use-buttons'.
(outline-open, outline-close, outline-close-rtl): Use image height
proportional to font height of 0.8em.
(outline-minor-mode): Remove overlays 'outline-button' and 'outline-margin',
and move such overlay removal after the call of 'outline-show-all'
that might trigger overlay addition.
* doc/misc/rcirc.texi (Dealing with Bridge Bots): Document new feature.
* etc/NEWS: Mention the new feature.
* lisp/net/rcirc.el (rcirc-markup-text-functions): Add new markup function
(rcirc-pseudo-nicks): Add new local variable.
(rcirc-channel-nicks): Use 'rcirc-pseudo-nicks' for nick completion.
(rcirc-bridge-bot-alist): Add new user option.
(rcirc-bridged-nick): Add new face.
(rcirc-markup-bridge-bots): Add new function.
Michael Albinus [Tue, 20 Sep 2022 16:35:57 +0000 (18:35 +0200)]
; Minor Tramp cleanups
* lisp/net/tramp.el (tramp-build-remote-file-name-spec-regexp):
Handle the `simplified' syntax better.
(tramp-handle-file-name-case-insensitive-p): Do not unquote candidate.
Juri Linkov [Tue, 20 Sep 2022 16:11:58 +0000 (19:11 +0300)]
* lisp/outline.el: Bind margin mouse event to cycle outlines (bug#57813)
(outline-minor-mode): In mode keymap bind
'right/left-margin mouse-1' to outline-cycle, and
'right/left-margin S-mouse-1' to outline-cycle-buffer.
(outline-hide-subtree, outline-show-subtree): Add save-excursion
to keep point unmoved after mouse click.
(outline-cycle): Add optional arg 'event' like in
outline-hide-subtree and outline-show-subtree, and
add save-excursion to keep point unmoved after mouse click.
(outline--make-button-overlay, outline--make-margin-overlay):
Put overlay property 'evaporate' to t.
(outline--insert-open-button, outline--insert-close-button):
Remove temporary attempts to bind margin-local mouse events.
would use the global advertised-binding for `undo', even though
there's a binding in `undo-repeat-map', which is highly
counter-intuitive. Now the binding is looked up in the specified
keymap first.
* lisp/help.el (substitute-command-keys): Restrict the initial key
lookup to the specified keymap (if there is one). (Bug#51384)
As discussed in
https://lists.gnu.org/r/auctex/2022-08/msg00004.html
AUCTeX installs its own advice to redefine `tex-mode`, and that
advice used to take precedence before commit 6075a7c5ae3fa456cd.
Get fewer false positives for :keyword and &options
* lisp/emacs-lisp/lisp-mode.el (lisp-mode--search-key): New
function to check more carefully for start of :keywords and
&options (bug#51574).
(lisp-fdefs): Use it.
F. Jason Park [Wed, 7 Sep 2022 02:09:54 +0000 (19:09 -0700)]
Bury new ERC buffers by default
* lisp/erc/erc.el (erc-join-buffer): Change default value to `bury'.
(erc-setup-buffer): Make `window-noselect' behave more like its
description and abstain from ever replacing the current buffer.
* test/lisp/erc/erc-scenarios-base-reconnect.el
(erc-scenarios-common-base-reconnect-options): Update helper to handle
new default value for option `erc-join-buffer'.
(erc-scenarios-base-reconnect-options--buffer): Update and rename
function `erc-scenarios-base-reconnect-options--default'.
(erc-scenarios-base-reconnect-options--default): Update and rename
function `erc-scenarios-base-reconnect-options--bury'.
* etc/ERC-NEWS: Update existing display-buffers section for 5.5.
(Bug#51753)
F. Jason Park [Thu, 7 Jul 2022 02:57:11 +0000 (19:57 -0700)]
Offer to regexp-quote new items in erc-match commands
* lisp/erc/erc-match.el (erc-match-quote-when-adding) Add new option
to quote new items added to match lists.
(erc-add-entry-to-list): Add optional `alt' parameter indicating
whether to flip the behavior indicated by
`erc-match-quote-when-adding'.
(erc-add-pal, erc-add-fool, erc-add-keyword, erc-add-dangerous-host):
Pass universal arg to `erc-add-entry-to-list' as `alt' argument.
(erc-match-pal-p, erc-match-fool-p, erc-match-keyword-p,
erc-match-dangerous-host-p): Don't bother matching when list is nil.
* lisp/erc/erc.el (erc-list-match (lst str): Join input list as regexp
union instead of looping over items.
* etc/ERC-NEWS: Update misc-UX section for 5.5.
* test/lisp/erc/erc-match-tests.el: New file. (Bug#56450)
F. Jason Park [Wed, 17 Aug 2022 07:00:53 +0000 (00:00 -0700)]
Stabilize channels variant of erc-reuse-buffers test
* lisp/erc/erc-networks.el (erc-networks--id-sort-buffers): Use
`buffer-local-value' instead of `with-current-buffer'.
* test/lisp/erc/erc-scenarios-base-reuse-buffers.el
(erc-scenarios-common--base-reuse-buffers-channel-buffers): Wait for
buffers to be created by server-initiated JOINs.
(erc-scenarios-base-reuse-buffers-channel-buffers--disabled): Remove
`:unstable' tag.
Juri Linkov [Mon, 19 Sep 2022 19:35:51 +0000 (22:35 +0300)]
* lisp/outline.el (outline-minor-mode-use-margins): New user option.
(outline--use-margins, outline--use-buttons, outline--use-rtl):
New buffer-local internal variables.
(outline-open, outline-close): Move :ascent center to default of define-icon.
Use ASCII-art for text. Fix docstring and help-echo.
(outline-close-rtl, outline-open-in-margins)
(outline-close-in-margins, outline-close-rtl-in-margins): New icon
definitions.
(outline-minor-mode-highlight-buffer): Remove outline--insert-open-button
since initial outline--fix-up-all-buttons is added now to outline-minor-mode.
(outline-minor-mode): Set buffer-local outline--use-buttons,
outline--use-margins and outline--use-rtl. Show/hide margins for
outline--use-margins. Add hook after-change-functions for editable buffers.
Move outline--fix-up-all-buttons for both cases: font-lock and non-font-lock.
(outline--use-buttons-p): Remove function.
(outline--make-button-overlay): Use outline--use-rtl icon outline-close-rtl.
(outline--make-margin-overlay): New function.
(outline--insert-open-button, outline--insert-close-button): Add optional
arg 'use-margins'.
(outline--fix-up-all-buttons): Call outline--insert-close-button
and outline--insert-open-button with arg outline--use-margins.
(outline-cycle-buffer): Remove outline--fix-up-all-buttons
that is already called from outline-flag-region.
* lisp/emacs-lisp/icons.el (icons--create): Handle keywords :rotation
and :ascent with the default value 'center (bug#57813).
perl-mode: / is a regexp match if there's nothing before it
* lisp/progmodes/perl-mode.el (perl-syntax-propertize-function):
A "/" that starts the first statement is a regexp match. (Bug#997)
* test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-997): New
test.
The max-lisp-eval-depth limit is sufficient to prevent unbounded stack
growth including the specbind stack; simplify matters for the user by
not having them to worry about two different limits. This change
turns max-specpdl-size into a harmless variable with no effects,
to keep existing code happy.
Stefan Kangas [Mon, 19 Sep 2022 14:54:19 +0000 (16:54 +0200)]
Allow nil value for filter-buffer-substring-function
* lisp/simple.el
(filter-buffer-substring): Support a nil value to be more resilient.
(filter-buffer-substring-function): Doc fix; improve and update for
above change.
Stefan Kangas [Mon, 19 Sep 2022 14:02:28 +0000 (16:02 +0200)]
Support imenu in emacs-news-mode
* lisp/outline.el (outline-imenu-generic-expression): New variable
broken out from...
(outline-mode): ...here.
* lisp/textmodes/emacs-news-mode.el (emacs-news--mode-common): Use
above new variable to add imenu support.
Philipp Stephani [Mon, 19 Sep 2022 11:34:51 +0000 (13:34 +0200)]
Improve check for misleading 'cl-case' cases (Bug#57915).
* lisp/emacs-lisp/cl-macs.el (cl-case): Check that the case is of the
form (quote FOO), not just (quote).
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-no-warning): New unit test.
Stefan Kangas [Mon, 19 Sep 2022 09:39:00 +0000 (11:39 +0200)]
Prefer DE specific commands to set wallpaper
* lisp/image/wallpaper.el (wallpaper--default-commands): Rearrange
order to prioritize desktop environment specific commands before
general Wayland commands like "wbg" or even "swaybg". (Bug#57781)
Po Lu [Mon, 19 Sep 2022 01:35:58 +0000 (09:35 +0800)]
Fix GC protection of scroll bar windows
* src/xterm.c (x_atom_refs): Add _EMACS prefix to
vendor-specific scroll-bar atoms.
(handle_one_xevent): Unprotect windows immediately upon
receiving an _EMACS_SCROLLBAR event, instead of waiting for the
event to be put on the keyboard buffer. Reported by martin
rudalics <rudalics@gmx.at>.
Display a help message when building Emacs failed.
* Makefile.in (actual-all): New target, replacing the former 'all'
target.
(advice-on-failure, sanity-check): New targets.
(all): Use the new targets.
(bootstrap-all): New target, identical to 'all' but meant for the
'bootstrap' target in GNUmakefile.
(actual-bootstrap): New target, replacing the former 'bootstrap'
target. Use the 'actual-all' target instead of the 'all' target.
(bootstrap): Use the new targets.
* GNUmakefile (bootstrap): Use the new 'bootstrap-all' target.