1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 11:50:51 -08:00
Commit graph

94470 commits

Author SHA1 Message Date
Eli Zaretskii
d29d4a1d7b ; * lisp/comint.el: Fix wording of last change. 2024-04-18 13:45:22 +03:00
Augusto Stoffel
11b1610c72 Obsolete comint-osc symbols moved to ansi-osc.el
* lisp/comint.el (comint-osc-handlers)
(comint-osc-directory-tracker, comint-osc-hyperlink-handler)
(comint-osc-hyperlink, comint-osc-hyperlink-map): Mark as
obsolete.  (Bug#70375)
2024-04-18 13:43:43 +03:00
Siddharth Sharma
f66820d877 Add YANG LSP support to Eglot
* lisp/progmodes/eglot.el (eglot-server-programs): Add
'yang-language-server' and 'json-ts-mode'.  (Bug#70364)

Copyright-paperwork-exempt: yes
2024-04-18 13:34:31 +03:00
Eli Zaretskii
c7bcda4ac5 ; Minor change in last commit
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Rearrange features to keep alphabetical order.  (Bug#70362)
2024-04-18 13:30:20 +03:00
Noah Peart
9055dad65d Add font-locking for Go built-in functions in go-ts-mode
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings):
Add font-locking for Go built-in functions to 'go-ts-mode'.
(Bug#70362)
2024-04-18 13:28:28 +03:00
Eli Zaretskii
f6c20ed5d5 ; Fix last change
* lisp/url/url-util.el (url-build-query-string): Move to after the
definition of 'url-query-key-value-allowed-chars'.
2024-04-18 13:08:23 +03:00
Dagfinn Ilmari Mannsåker
40629706b1 Avoid unnecessary escaping in 'url-build-query-string'
* lisp/url/url-util.el (url-query-key-value-allowed-chars):
New defconst.
(url-build-query-string): Use it to escape only those
characters that need it in keys and values.
* test/lisp/url/url-util-tests.el (url-util-tests): Add
new test cases.  (Bug#70312)
2024-04-18 13:04:13 +03:00
Elias G. B. Perez
3c4f6c78b4 Flymake support for indicating errors in margin
Add optional support for display flymake error in margin,
this allow displaying error indicators in both graphical and
terminal frames.
* doc/misc/flymake.texi (Customizable variables)
(Flymake error types): Document new margin indicator.
* etc/NEWS: Announce the new Flymake user option for margin
indicators.
* lisp/progmodes/flymake.el (flymake-indicator-type)
(flymake-margin-indicators-string, flymake-autoresize-margins)
(flymake-margin-indicator-position): New user options.
(flymake--original-margin-width): Add buffer-local variable for
store original buffer margin width.
(flymake-error, flymake-warning, flymake-note): Use new margin
value.
(flymake--indicator-overlay-spec): Rework and Rename from
flymake--fringe-overlay-spec.
(flymake--resize-margins): Add new function for resize margin
width.
(flymake--highlight-line, flymake-mode): Rework.
2024-04-18 12:08:33 +03:00
Eli Zaretskii
bb9d81d514 Fix sending input to SQL when point is not at EOB
* lisp/progmodes/sql.el (sql-send-string): Move point to EOB
before sending input to the SQL process.  Suggested by Gary Hollis
<ghollisjr@gmail.com>.  (Bug#69420)
2024-04-18 11:53:26 +03:00
Juri Linkov
b585fb8171 * lisp/tab-line.el: Use the new keyword :key for 'sort'.
(tab-line-tabs-fixed-window-buffers): Use :key for 'sort'.
Rename the window parameter 'tab-line-fixed-window-buffers'
to shorter 'tab-line-buffers'.  Add '(tab-line-buffers . writable)
to window-persistent-parameters.
2024-04-18 09:36:18 +03:00
Augusto Stoffel
3cdd86b8af Propagate 'lexical-binding' value to pp buffers
See bug#70137.

* lisp/emacs-lisp/pp.el (pp-display-expression): Set lexical-binding to
match the value in the calling buffer.
2024-04-17 17:02:11 -04:00
Theodor Thornhill
0dbd9ed046 Document earlier change in eglot-report-progress
* lisp/progmodes/eglot.el (eglot-report-progress): Document the changed
behavior.
* etc/EGLOT-NEWS (https): Mention the change.
2024-04-17 20:42:23 +02:00
Stefan Monnier
c15c9f4de6 (conf-toml-recognize-section): Fix bug#70383
* lisp/textmodes/conf-mode.el (conf-toml-recognize-section): Move
point, like font-lock matchers are expected to do.
2024-04-17 14:30:10 -04:00
Stefan Monnier
fcee1bf07b eglot.el: Remove accidentally included debugging code
* lisp/progmodes/eglot.el (eglot--signal-textDocument/didChange):
Remove leftover debug message.
2024-04-17 14:01:35 -04:00
Juri Linkov
4dd3288569 * lisp/emacs-lisp/icons.el (define-icon): Add 'doc-string' to 'declare'. 2024-04-17 21:01:14 +03:00
Juri Linkov
230eecf12a New keymap tab-line-mode-map and new tab order on tab-line (bug#69993)
* lisp/tab-line.el (tab-line-new-button-functions): New variable.
(tab-line-tabs-function): Change the default value from
'tab-line-tabs-window-buffers' to the new option
'tab-line-tabs-fixed-window-buffers'.
(tab-line-tabs-buffer-group-sort-function): Change the default
value from nil to 'tab-line-tabs-buffer-group-sort-by-name'.
(tab-line-tabs-buffer-group-sort-by-name): New function.
(tab-line-tabs-fixed-window-buffers): New function.
(tab-line-format-template): Use 'tab-line-new-button-functions'.
(tab-line-mode-map, tab-line-switch-repeat-map): New keymaps.
2024-04-17 20:56:10 +03:00
Stephen Berman
91333dacfa Allow tabbing between widgets to skip inactive widgets (bug#70413)
* doc/misc/widget.texi (Widgets and the Buffer, Customization):
Document it.

* etc/NEWS: Announce it.

* lisp/wid-edit.el (widget-skip-inactive): New user option.
(widget-tabable-at): Use it.
2024-04-17 19:33:24 +02:00
Stefan Monnier
523aca13a4 * lisp/emacs-lisp/track-changes.el: Fix trailer 2024-04-17 10:57:11 -04:00
Stefan Monnier
3660c51736 track-changes.el: Fix last change for early use
* lisp/emacs-lisp/track-changes.el (track-changes--recover-from-error):
Don't burp if there have been fewer than 20 keystrokes since Emacs start.
2024-04-17 09:04:12 -04:00
Juri Linkov
ada429c375 * lisp/emacs-lisp/lisp.el (forward-sexp-function): Set back to nil.
(forward-sexp): Revert back to checking 'forward-sexp-function'
for nil (bug#70426).
2024-04-17 09:53:02 +03:00
Stefan Monnier
a33ab7565e track-changes.el: Minor changes for version 1.0
Arrange for the library to be usable on older Emacsen, which
includes reducing the noise when `before/after-change-functions`
are badly paired or missing.
Also, since the signal function receives the distance (for `:disjoint`),
we don't need `track-changes--disjoint-threshold`: the signal
function can simply do nothing when the distance is smaller than
the threshold it wants to use.

* lisp/emacs-lisp/track-changes.el: Prepare header for ELPA.
(track-changes--tracker, track-changes--state): Don't use `:noinline`,
so as to be compatible with Emacs<27.
(track-changes-record-errors): New variable.
(track-changes--recover-from-error): Use it.  Record only the last 20
keys and the last 50 stack frames in the error log.
(track-changes--disjoint-threshold): Delete variable.
(track-changes--before): Don't use it any more.

* lisp/progmodes/eglot.el (eglot--track-changes-signal):
Coalesce disjoint changes nearer than what used to be coalesced because of
`track-changes--disjoint-threshold`.
2024-04-16 21:57:05 -04:00
Stefan Monnier
484b097909 (cl-defstruct): Improve handling of unknown options
Until now `cl-defstruct` signaled an error when encountering an
unknown option.  It's easy to code and it does the job, but it
doesn't give good location info in the compiler's output,
and it makes it more painful to use not-yet-supported options.
So just signal a warning instead.

* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Warn about unknown
options, instead of signaling an error.
2024-04-16 21:17:47 -04:00
Eric Abrahamsen
2141caca30 ; Improvements to PEG documentation (second attempt)
* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.
2024-04-16 17:26:47 -07:00
Mattias Engdegård
9a673c6914 Revert "; Improvements to PEG documentation"
This reverts commit 930c578c10.
Looks like an editing mistake ate a large part of the text.
2024-04-16 11:59:20 +02:00
Po Lu
f5e0fb11db Fix touch screen hscroll when initiated from widgets
* lisp/wid-edit.el (widget-button--check-and-call-button):
Return to the position of point during the tracking loop if a
touch event is canceled.
2024-04-16 15:40:13 +08:00
Juri Linkov
cdd37ba4e8 Support prefix argument for switching tabs in tab-line-mode
* lisp/tab-line.el (tab-line-select-tab-buffer): Optimize.
(tab-line-switch-cycling): Enable by default like in tab-bar-mode.
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab):
Add a prefix argument ARG and support it for switching tabs.
Improve docstring.
2024-04-16 09:40:15 +03:00
Noah Peart
b33fb3b69c
Add font-locking for operators in go-ts-mode (bug#70361)
* lisp/progmodes/go-ts-mode.el (go-ts-mode--font-lock-settings): Add
font-locking rule for Go operators.
2024-04-15 21:31:51 -07:00
Eric Abrahamsen
930c578c10 ; Improvements to PEG documentation
* doc/lispref/peg.texi: Make more use of defmac/defmacro, and try to
clarify the relationships between the various macros and functions.
* lisp/progmodes/peg.el (peg-parse): Remove claim that PEXS can also be
a single list of rules.
2024-04-15 20:14:50 -07:00
Stefan Monnier
3ac1a7b6fe (track-changes-fetch): Fix nested use case
* lisp/emacs-lisp/track-changes.el (track-changes-fetch):
Don't presume that if there's nothing to do we're on
`track-changes--clean-trackers`.
2024-04-15 16:06:54 -04:00
Stefan Monnier
5fda398fb3 (track-changes--before): Fix bug#70396
* lisp/emacs-lisp/track-changes.el (track-changes--before):
Widen the buffer before accessing it with positions
potentially outside the beg..end region.
2024-04-15 15:53:48 -04:00
Eli Zaretskii
a80a5d42d3 Fix display of @xref documentation in Info
* lisp/info.el (Info--dont-hide-references): New variable.
(Info-fontify-node): Use 'Info--dont-hide-references' to disable
hiding "*Note" or showing "See" instead of it in select nodes.
(Bug#70382)
2024-04-15 15:47:39 +03:00
Martin Rudalics
9a79db506e Make 'buffer-last-name' work better after 'find-alternate-file' (Bug#68235)
* lisp/files.el (find-alternate-file): Before killing the previous
buffer, try to restore its name and filenames (Bug#68235).
2024-04-15 11:17:51 +02:00
Dmitry Gutov
55a200d707 ; Capitalize 'project' in project-name's docstring 2024-04-15 05:29:59 +03:00
Juri Linkov
568c174135 Add 'forward-sexp-default-function' to be used by 'treesit-forward-sexp'
* lisp/emacs-lisp/lisp.el (forward-sexp-default-function):
New function with body from 'forward-sexp' (bug#68993).
(forward-sexp-function): Change the default value from nil to
'forward-sexp-default-function'.
(forward-sexp): Use either 'forward-sexp-function' or
'forward-sexp-default-function'.

* lisp/treesit.el (treesit-forward-sexp): In nodes of type 'text'
fall back to 'forward-sexp-default-function'.  Improve docstring.

* doc/lispref/positions.texi (List Motion): Fix pxref.
2024-04-14 19:22:01 +03:00
Mattias Engdegård
616af56579 ; * lisp/emacs-lisp/macroexp.el (macroexp--expand-all): less consing 2024-04-14 11:51:17 +02:00
Earl Hyatt
7add47337b Add command 'list-keyboard-macros' that works like 'list-buffers'.
The command 'list-keyboard-macros' allows editing and re-arranging
macros using 'tabulated-list-mode'.  Existing keyboard macros can be
duplicated or deleted.  Macro counters and counter formats can take new
values read from the minibuffer.  Macro keys can be edited using
'edit-kbd-macro'.

* doc/emacs/kmacro.texi (Kmacro Menu): Document the new command
and the menu's commands.
* etc/NEWS (Kmacro Menu Mode): Mention the new mode and command.
* lisp/kmacro.el (kmacro-menu-mark, kmacro-menu-marked)
(kmacro-menu-flagged): Add faces for marks and flags.
* lisp/kmacro.el (kmacro-menu-mode-map, kmacro-menu-mode): Add mode
and map.
* lisp/kmacro.el (list-keyboard-macros, kmacro-menu): Add command.
* lisp/kmacro.el (kmacro-menu--deletion-flags, kmacro-menu--marks)
(kmacro-menu--id-kmacro, kmacro-menu--id-position, kmacro-menu--kmacros)
(kmacro-menu--refresh, kmacro-menu--map-ids, kmacro-menu--replace-all)
(kmacro-menu--replace-at, kmacro-menu--query-revert, kmacro-menu--assert-row)
(kmacro-menu--propertize-keys, kmacro-menu--do-region)
(kmacro-menu--marks-exist-p): Add utility functions of mode
and commands.
* lisp/kmacro.el (kmacro-menu-mark, kmacro-menu-flag-for-deletion)
(kmacro-menu-unmark, kmacro-menu-unmark-backward)
(kmacro-menu-unmark-all): Add commands for marks and flags.
* lisp/kmacro.el (kmacro-menu-do-flagged-delete, kmacro-menu-do-copy)
(kmacro-menu-do-delete): Add commands that modify the ring.
* lisp/kmacro.el (kmacro-menu-edit-position, kmacro-menu-transpose)
(kmacro-menu-edit-format, kmacro-menu-edit-counter)
(kmacro-menu-edit-keys, kmacro-menu-edit-column): Add commands that
modify a keyboard macro.
2024-04-14 12:39:17 +03:00
Alan Mackenzie
b2842b25bf CC Mode: Don't start fontifying in the middle of an identifier
This fixes bug#70367.

* lisp/progmodes/cc-mode.el (c-fl-decl-start): After searching
backwards for the end of the previous statement, check whether
or not we found it.
2024-04-14 08:21:56 +00:00
Arash Esbati
845246093f Recognize multicite macros from biblatex
* lisp/textmodes/reftex-cite.el (reftex-all-used-citation-keys):
Match the citation keys used with multicite macros provided by
biblatex.  (bug#38249)

* test/lisp/textmodes/reftex-tests.el
(reftex-all-used-citation-keys): Adjust test accordingly.
2024-04-13 22:33:24 +02:00
Stefan Monnier
7b94c6b00b peg-tests.el: Fix test failures
* lisp/progmodes/peg.el (peg-parse): Refine heuristic since unknown
terminals are resolved at run-time rather than compile-time now.
(peg--macroexpand) <stack-action>: Avoid generating a `let` with an
empty body.
(peg--translate-rule-body): Adjust to name change of
`macroexp-warn-and-return` and the fact that it's always available.

* test/lisp/progmodes/peg-tests.el (peg-parse-string):
Add `indent` declaration.
(peg-test): Check that the compiler emits the warnings we expect.
2024-04-13 15:35:46 -04:00
Stefan Monnier
17e26cf57e (define-globalized-minor-mode): Require the use of run-mode-hooks
When `define-globalized-minor-mode` was introduced (Emacs-22),
`run-mode-hooks` was brand new, so we could not expect all major
modes to use it and we had to rely on brittle workarounds to try
and approximate `after-change-major-mode-hook`.

These workarounds have undesirable side effects, and (we hope)
they're not needed any more now that virtually all major modes
have been changed to use `run-mode-hooks` (or
`define-derived-mode`).

* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Rely only on `after-change-major-mode-hook`, remove the "cmhh"
[typo for the intended "cmmh", BTW] workaround.

* doc/lispref/modes.texi (Mode Hooks): Clarify the importance of
`after-change-major-mode-hook` w.r.t `define-globalized-minor-mode`.
(Defining Minor Modes): Rewrite the explanation of which buffers
are affected, including adjusting it to the fact that
`fundamental-mode` has used run `run-mode-hooks` for last 10 years.
2024-04-13 10:31:28 -04:00
Stefan Monnier
3f7e26e2be (define-globalized-minor-mode): Fix bug#58888
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode) <MODE-cmhh>:
Try and detect well-behaved modes so they're not affected by
those which require the cmhh hack.
2024-04-13 10:10:19 -04:00
Stefan Monnier
d67e08d6c3 Merge branch 'track-changes' 2024-04-13 09:44:12 -04:00
Stefan Monnier
d7a83e23d4 lisp/emacs-lisp/track-changes.el: New file (bug#70077)
This new package provides an API that is easier to use right than
our `*-change-functions` hooks.

The patch includes changes to `diff-mode.el` and `eglot.el` to
make use of this new package.

* lisp/emacs-lisp/track-changes.el: New file.
* test/lisp/emacs-lisp/track-changes-tests.el: New file.
* doc/lispref/text.texi (Tracking changes): New subsection.

* lisp/progmodes/eglot.el: Require `track-changes`.
(eglot--virtual-pos-to-lsp-position): New function.
(eglot--track-changes): New var.
(eglot--managed-mode): Use `track-changes-register` i.s.o
`after/before-change-functions` when available.
(eglot--track-changes-signal): New function, partly extracted from
`eglot--after-change`.
(eglot--after-change): Use it.
(eglot--track-changes-fetch): New function.
(eglot--signal-textDocument/didChange): Use it.

* lisp/vc/diff-mode.el: Require `track-changes`.
Also require `easy-mmode` before the `eval-when-compile`s.
(diff-unhandled-changes): Delete variable.
(diff-after-change-function): Delete function.
(diff--track-changes-function): Rename from `diff-post-command-hook`
and adjust to new calling convention.
(diff--track-changes): New variable.
(diff--track-changes-signal): New function.
(diff-mode, diff-minor-mode): Use it with `track-changes-register`.
2024-04-13 09:43:11 -04:00
Phil Sainty
f950621e6a ; Additional fixup for truncation of long lines in compilation buffers
* lisp/progmodes/compile.el
(compilation--insert-abbreviated-line): Handle long lines that end
in a newline.  (Bug#70236)

The fix in commit 8f93cba324 resulted in
the previous "Don't hide the final newline" code causing an off-by-one
error.  With the new code the value of point is what is wanted in both
cases.
2024-04-14 01:00:05 +12:00
Eli Zaretskii
adbcf268bc Merge from origin/emacs-29
f0300fb059 ; Tweak "(emacs)Bug Reference" formatting/wording.
ea62a14ea3 Fix display of vscrolled windows
4cefa3c0b1 ; * doc/emacs/files.texi (Backup): Clarify "saving" (bug#...
db7b571aaa ; Improve documentation of 'world-clock'
6a0bb7beae * doc/emacs/misc.texi (emacsclient Options): Suggest forw...
859b4227e3 Update go-ts-mode to support latest tree-sitter-go grammar
407e85ce13 Fix c++-ts-mode defun navigation (bug#65885)
aca5064f12 ; Fix last change.
55aab2d471 ; * etc/PROBLEMS: An entry about focus issues with XFCE (...
19cee16576 ; * doc/emacs/misc.texi (emacsclient Options): Fix typo. ...
2a41b6ba51 ; * src/filelock.c (Flock_file): Doc fix (bug#70216).
2024-04-13 07:37:13 -04:00
Philip Kaludercic
6c721af9c8 Allow 'help-quick' to use a non-global keymap
* lisp/help.el (help-quick-sections): Mention
'help-quick-use-map' in docstring.
(help-quick-use-map): Add new variable, defaulting to the
global-map.
(help-quick): Use new variable.
2024-04-13 10:21:43 +02:00
Philip Kaludercic
5f6834ab97 ; Fix typo in 'help-quick-sections' docstring 2024-04-13 10:21:43 +02:00
john muhl
d5d61618c8 Mark Flymake regions more accurately in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (lua-ts-flymake-luacheck): Use
the end position provided by Luacheck rather than relying on
'thing-at-point' to guess where the end should be.  (Bug#70167)
2024-04-13 11:11:18 +03:00
Eli Zaretskii
71f8b2c324 Fix Icalendar export with ISO dates
* lisp/calendar/icalendar.el (icalendar--datestring-to-isodate):
Accept dashes in ISO-style numeric dates.  Patch by Erwan Hingant
<erwan.hingant@mailo.com>. (Bug#69894)

* test/lisp/calendar/icalendar-tests.el
(icalendar--datestring-to-isodate): Add a test for dashes in
ISO-style numeric dates.
2024-04-13 10:52:55 +03:00
Stefan Monnier
648b7bf7e2 (emacs-lisp-mode-syntax-table): Fix bug#24542
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode-syntax-table):
Remove `p` from the flags of `@`.
2024-04-12 13:28:45 -04:00