1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 13:10:57 -08:00
Commit graph

14062 commits

Author SHA1 Message Date
Phil Sainty
1e1eef5fb0 Subsume string-try-completion' into string-common-prefix' 2025-06-29 00:07:18 +12:00
Phil Sainty
7123c9497e fixup! Add functions string-common-prefix' and string-try-completion' 2025-06-09 00:00:24 +12:00
Phil Sainty
accfe19887 Add functions string-common-prefix' and string-try-completion'
* lisp/subr.el: (string-common-prefix, string-try-completion):
New functions.

* lisp/emacs-lisp/shortdoc.el:
* doc/lispref/strings.texi:
* doc/lispref/minibuf.texi:
* etc/NEWS:
Documentation.
2025-06-08 23:20:20 +12:00
Eli Zaretskii
c5e54fef67 Merge from origin/emacs-30
cd57a05542 ; * etc/PROBLEMS: Improve the item about 'C-S-u' in PGTK ...
2025-06-07 06:59:29 -04:00
Eli Zaretskii
bed490f0f2 ; Fix last change (bug#78396)
* lisp/paren.el (show-paren-not-in-comments-or-strings):
* etc/NEWS:
* doc/emacs/programs.texi (Matching): Fix wording and punctuation
in doc string, defcustom tags, manual, and NEWS.
2025-06-07 13:32:41 +03:00
Elías Gabriel Pérez
12397e3eb0 Add option for not highlight parens inside comments or strings
* lisp/paren.el (show-paren-not-in-comments-or-strings):
New user option.  (Bug#78396)
(show-paren-function): Enclose code in 'catch' function.
* etc/NEWS: Announce changes.
* doc/emacs/programs.texi (Matching): Document new option.
2025-06-07 13:23:31 +03:00
Eli Zaretskii
0bc2a5a2c1 ; Fix last change (bug#77945)
* lisp/faces.el (face-all-attributes):
* etc/NEWS: Reformat and fix wording in documentation.
2025-06-07 12:43:39 +03:00
shipmints
13fa74b73c Add optional inherit argument to 'face-all-attributes' (bug#77945)
* lisp/faces.el (face-all-attributes): Add 'inherit' argument
and pass to 'face-attribute'.
2025-06-07 12:39:49 +03:00
Sean Whitton
ac4869c712 VC: Deprecate log-incoming and log-outgoing backend functions
* lisp/vc/vc-git.el (vc-git-incoming-revision):
Inline vc-git--fetch-incoming.
(vc-git--fetch-incoming, vc-git-log-incoming)
(vc-git-log-outgoing): Delete.
* lisp/vc/vc-hg.el (vc-hg-mergebase):
* lisp/vc/vc.el (vc-default-log-incoming)
(vc-default-log-outgoing): New functions.
* lisp/vc/vc.el:
* etc/NEWS: Document the deprecation.
2025-06-06 09:53:32 +01:00
Eli Zaretskii
6d0a71af9a ; * etc/NEWS: Call out incompatible change in 'date-to-time'. 2025-06-05 11:09:36 +03:00
Eli Zaretskii
cd57a05542 ; * etc/PROBLEMS: Improve the item about 'C-S-u' in PGTK build. 2025-06-02 18:34:21 +03:00
Dmitry Gutov
f0bec20ac5 project-remember-project: Support calling it interactively
* lisp/progmodes/project.el (project-remember-project):
Support interactive invocation (bug#78099) and react with
appropriate messages when called so, depending on the blacklist.
2025-05-29 22:27:38 +03:00
Sean Whitton
f9b311464d New user option vc-dir-hide-up-to-date-on-revert
* lisp/vc/vc-dir.el (vc-dir-hide-up-to-date-on-revert):
New defcustom.
(vc-dir-revert-buffer-function): Use it.
* etc/NEWS: Document it.
2025-05-29 12:53:51 +01:00
Martin Rudalics
433a031d24 Have 'delete-frame' delete initial daemon frame only if FORCE is non-nil
* src/frame.c (delete_frame): Delete initial daemon frame only
if FORCE is non-nil (Bug#78583).
(Fdelete_frame): Rewrite doc-string to mention that it can
delete an initial daemon frame if and only if FORCE is non-nil.
* etc/NEWS:
* doc/lispref/frames.texi (Deleting Frames): Mention that
'delete-frame' can delete an initial daemon frame if and only if
FORCE is non-nil.
2025-05-29 11:33:28 +02:00
Juri Linkov
10e023c15c * lisp/tab-line.el (tab-line-close-other-tabs): New command.
(tab-line-tab-context-menu): Bind 'tab-line-close-other-tabs'
to the menu item "Close other tabs".
Suggested by pinmacs <pinmacs@cas.cat>.
2025-05-25 19:45:05 +03:00
Eli Zaretskii
ad217dcc46 Merge from origin/emacs-30
661fa578d5 Adapt Tramp version in customize-package-emacs-version-alist
0045a56d55 ; * ChangeLog.5: Delete entry for minor change.
1136aed6dc ; Update ChangeLog and AUTHORS for Emacs 30.2
2025-05-24 06:46:32 -04:00
Eli Zaretskii
da174e4a15 ; Fix documentation of a recent commit
* etc/NEWS:
* doc/lispref/loading.texi (How Programs Do Loading): Document the
new variable and function.

* src/lread.c (load-path-filter-function):
* lisp/startup.el (load-path-filter-cache-directory-files)
(load-path-filter--cache): Doc fixes.
2025-05-24 10:23:11 +03:00
Vincenzo Pupillo
676f12c65f Support Rust compiler messages in compile mode (bug#70794).
* etc/compilation.txt: Add examples of Rust compiler error, warning and
note messages.
* lisp/progmodes/compile.el
(compilation-error-regexp-alist-alist): Add Rust regexps for error,
warning and note messages.
* test/lisp/progmodes/compile-tests.el
(compile-tests--test-regexps-data): Add new test cases.
(compile-test-error-regexps): Increase expected errors.
2025-05-22 11:53:34 +02:00
Juri Linkov
87fa5f565d * lisp/tab-line.el (tab-line-move-tab-forward): New command.
(tab-line-move-tab-backward): New command.
(tab-line-mode-map): Bind 'C-x M-<left>' to
'tab-line-move-tab-backward' and 'C-x M-<right>' to
'tab-line-move-tab-forward'.
(tab-line-switch-repeat-map): Bind 'M-<left>' to
'tab-line-move-tab-backward' and 'M-<right>' to
'tab-line-move-tab-forward'.
Suggested by pinmacs <pinmacs@cas.cat>.
2025-05-20 21:30:38 +03:00
Eli Zaretskii
1136aed6dc ; Update ChangeLog and AUTHORS for Emacs 30.2
* etc/AUTHORS:
^ ChangeLog.5: Update.
2025-05-18 05:25:35 -04:00
Elías Gabriel Pérez
8b6e1d8435 Prettify and improve hideshow (bug#78234)
Buttonize the ellipsis and optionally display in the ellipsis
the total number of hidden lines.
* lisp/progmodes/hideshow.el (hs-display-lines-hidden): New
user option.
(hs-ellipsis): New face.
(hs-make-overlay): Tweak.
(hs--get-ellipsis): New function.
* doc/emacs/programs.texi (Hideshow): Update documentation.
* etc/NEWS: Announce changes.
2025-05-17 12:10:03 +03:00
Eli Zaretskii
3b2b0424cf ; Fix last change
* lisp/pulse.el (pulse-faces, pulse-face-duration):
* etc/NEWS: Fix documentation of last change.  (Bug#77715)
2025-05-17 11:57:43 +03:00
Elías Gabriel Pérez
b25139a532 New pulse functions for pulse faces and new file for ring bell fns
These new pulse functions allow pulse any defined face briefly.
The new file contains functions intended to be used in
`ring-bell-function' as alternatives to `visible-bell'.
* lisp/pulse.el (pulse-face-duration): New user option.
(pulse-flash-face): New function.
* lisp/ring-bell-fns.el (flash-face-attributes)
(flash-face-faces): New user options.
(flash-face-bell-function, flash-echo-area-bell-function):
New functions.  (bug#77715)

* etc/NEWS: Announce changes
2025-05-17 11:49:19 +03:00
Sean Whitton
45627ca7cc New top-level buffer-local value functions
* src/eval.c (local_toplevel_binding)
(Fbuffer_local_toplevel_value, Fset_buffer_local_toplevel_value)
(syms_of_eval): New functions.
* doc/lispref/variables.texi (Default Value):
* lisp/subr.el (setq-local):
* etc/NEWS: Document them.
* test/lisp/emacs-lisp/lisp-tests.el
(core-elisp-tests-4-toplevel-values): New test.
* lisp/progmodes/xref.el (xref--show-xref-buffer)
(xref-show-definitions-buffer-at-bottom):
* lisp/vc/vc-dispatcher.el (vc-setup-buffer):
Use set-buffer-local-toplevel-value.
2025-05-15 13:40:04 +01:00
Manuel Giraud
825d64aa57 Scroll with mouse wheel in calendar (bug#78298)
* lisp/calendar/calendar.el (calendar-mode-map): Add scrolling
with mouse wheel.
* etc/NEWS: Announce the change.
2025-05-14 21:07:14 +03:00
Stefan Monnier
8a19c249f8 simple.el (delete-trailing-whitespace-mode): New minor mode (bug#78264)
Partly motivated by bug#78097.

* lisp/simple.el (delete-trailing-whitespace-if-possible): New function.
(delete-trailing-whitespace-mode): New minor mode.

* lisp/editorconfig.el (editorconfig-trim-whitespaces-mode):
Change default to `delete-trailing-whitespace-mode`.
(editorconfig--get-trailing-ws): Simplify accordingly.
(editorconfig--add-hook-safe-p): Delete function.  Don't touch
`safe-local-eval-function` any more.
2025-05-12 12:39:16 -04:00
Manuel Giraud
013ed9799e Fall back eww-switch-to-buffer' to eww'
* lisp/net/eww.el (eww-switch-to-buffer): When no EWW buffers
exist, call `eww' instead.
(eww-list-buffers): Do not pop to *eww buffers* when there is no
EWW buffers.  (Bug#77967)
2025-05-10 12:46:28 +03:00
Sean Whitton
8e02537d0b New vc-async-checkin user option
* lisp/vc/vc.el (vc-async-checkin): New option.
(vc-checkin): Don't use with-vc-properties on or display
messages around asynchronous checkins.
* lisp/vc/vc-git.el (vc-git-checkin):
* lisp/vc/vc-hg.el (vc-hg-checkin, vc-hg-checkin-patch): Perform
an async checkin operation when vc-async-checkin is non-nil.
* doc/emacs/vc1-xtra.texi (General VC Options):
* etc/NEWS: Document the new option.

* lisp/vc/vc-dispatcher.el (vc-wait-for-process-before-save):
New function.
(vc-set-async-update): If the current buffer visits a file, call
vc-refresh-state.
* lisp/vc/vc-hg.el (vc-wait-for-process-before-save): Autoload.
(vc-hg--async-command, vc-hg--async-buffer, vc-hg--command-1):
New utilities, partially factored out of vc-hg-command.
(vc-hg-merge-branch): Use vc-hg--async-command, thereby newly
respecting vc-hg-global-switches.
2025-05-09 10:52:06 +01:00
Manuel Giraud
0469f41ac2 Recenter for the calendar (bug#78205)
* lisp/calendar/cal-move.el (calendar-recenter-last-op): New
variable to track last recenter operation.
(calendar-recenter): New command to recenter the calendar.
* lisp/calendar/calendar.el (calendar-mode-map): Keybinding for
this command.
* doc/emacs/calendar.texi (Scroll Calendar): Document this
command.
* etc/NEWS: Announce this command.
2025-05-08 12:45:09 +03:00
Stefan Monnier
1590a2b3d5 Merge branch 'cl-types' 2025-05-07 14:56:49 -04:00
Stefan Monnier
839d29b81f lisp/register.el (register-read-with-preview-traditional): Use PRED 2025-05-07 13:56:20 -04:00
Juri Linkov
5fee8a0433 ; * etc/NEWS: Add 'comment-setup-function'. 2025-05-07 09:45:36 +03:00
Yuan Fu
1897da0b59
Add line-column tracking for tree-sitter
Add line-column tracking for tree-sitter parsers.  Copied from
comments in treesit.c:

   Technically we had to send tree-sitter the line and column
   position of each edit.  But in practice we just send it dummy
   values, because tree-sitter doesn't use it for parsing and
   mostly just carries the line and column positions around and
   return it when e.g. reporting node positions[1].  This has
   been working fine until we encountered grammars that actually
   utilizes the line and column information for
   parsing (Haskell)[2].

   [1] https://github.com/tree-sitter/tree-sitter/issues/445
   [2] https://github.com/tree-sitter/tree-sitter/issues/4001

   So now we have to keep track of line and column positions and
   pass valid values to tree-sitter.  (It adds quite some
   complexity, but only linearly; one can ignore all the linecol
   stuff when trying to understand treesit code and then come
   back to it later.)  Eli convinced me to disable tracking by
   default, and only enable it for languages that needs it.  So
   the buffer starts out not tracking linecol.  And when a
   parser is created, if the language is in
   treesit-languages-require-line-column-tracking, we enable
   tracking in the buffer, and enable tracking for the parser.
   To simplify things, once a buffer starts tracking linecol, it
   never disables tracking, even if parsers that need tracking
   are all deleted; and for parsers, tracking is determined at
   creation time, if it starts out tracking/non-tracking, it
   stays that way, regardless of later changes to
   treesit-languages-require-line-column-tracking.

   To make calculating line/column positons fast, we store
   linecol caches for begv, point, and zv in the
   buffer (buf->ts_linecol_cache_xxx); and in the parser object,
   we store linecol cache for visible beg/end of that parser.

   In buffer editing functions, we need the linecol for
   start/old_end/new_end, those can be calculated by scanning
   newlines (treesit_linecol_of_pos) from the buffer point
   cache, which should be always near the point.  And we usually
   set the calculated linecol of new_end back to the buffer
   point cache.

   We also need to calculate linecol for the visible_beg/end for
   each parser, and linecol for the buffer's begv/zv, these
   positions are usually far from point, so we have caches for
   all of them (in either the parser object or the buffer).
   These positions are far from point, so it's inefficient to
   scan newlines from point to there to get up-to-date linecol
   for them; but in the same time, because they're far and
   outside the changed region, we can calculate their change in
   line and column number by simply counting how much newlines
   are added/removed in the changed
   region (compute_new_linecol_by_change).

* doc/lispref/parsing.texi (Using Parser): Mention line-column
tracking in manual.
* etc/NEWS: Add news.
* lisp/treesit.el:
(treesit-languages-need-line-column-tracking): New variable.
* src/buffer.c: Include treesit.h (for TREESIT_EMPTY_LINECOL).
(Fget_buffer_create):
(Fmake_indirect_buffer): Initialize new buffer fields.
(Fbuffer_swap_text): Add new buffer fields.
* src/buffer.h (ts_linecol): New struct.
(buffer): New buffer fields.
(BUF_TS_LINECOL_BEGV):
(BUF_TS_LINECOL_POINT):
(BUF_TS_LINECOL_ZV):
(SET_BUF_TS_LINECOL_BEGV):
(SET_BUF_TS_LINECOL_POINT):
(SET_BUF_TS_LINECOL_ZV): New inline functions.
* src/casefiddle.c (casify_region): Record linecol info.
* src/editfns.c (Fsubst_char_in_region):
(Ftranslate_region_internal):
(Ftranspose_regions): Record linecol info.
* src/insdel.c (insert_1_both):
(insert_from_string_1):
(insert_from_gap_1):
(insert_from_buffer):
(replace_range):
(del_range_2): Record linecol info.
* src/treesit.c (TREESIT_BOB_LINECOL):
(TREESIT_EMPTY_LINECOL):
(TREESIT_TS_POINT_1_0): New constants.
(treesit_debug_print_linecol):
(treesit_buf_tracks_linecol_p):
(restore_restriction_and_selective_display):
(treesit_count_lines):
(treesit_debug_validate_linecol):
(treesit_linecol_of_pos):
(treesit_make_ts_point):
(Ftreesit_tracking_line_column_p):
(Ftreesit_parser_tracking_line_column_p): New functions.
(treesit_tree_edit_1): Accept real TSPoint and pass to
tree-sitter.
(compute_new_linecol_by_change): New function.
(treesit_record_change_1): Rename from treesit_record_change,
handle linecol if tracking is enabled.
(treesit_linecol_maybe): New function.
(treesit_record_change): New wrapper around
treesit_record_change_1 that handles some boilerplate and sets
buffer state.
(treesit_sync_visible_region): Handle linecol if tracking is
enabled.
(make_treesit_parser): Setup parser's linecol cache if tracking
is enabled.
(Ftreesit_parser_create): Enable tracking if the parser's
language requires it.
(Ftreesit__linecol_at):
(Ftreesit__linecol_cache_set):
(Ftreesit__linecol_cache): New functions for debugging and
testing.
(syms_of_treesit): New variable
Vtreesit_languages_require_line_column_tracking.
* src/treesit.h (Lisp_TS_Parser): New fields.
(TREESIT_BOB_LINECOL):
(TREESIT_EMPTY_LINECOL): New constants.
* test/src/treesit-tests.el (treesit-linecol-basic):
(treesit-linecol-search-back-across-newline):
(treesit-linecol-col-same-line):
(treesit-linecol-enable-disable): New tests.
* src/lisp.h: Declare display_count_lines.
* src/xdisp.c (display_count_lines): Remove static keyword.
2025-05-03 22:14:03 -07:00
Eli Zaretskii
3bf5a1cda7 Merge from origin/emacs-30
1f998d11a5 ; * doc/misc/ert.texi (erts files): Improve indexing.
52183c9596 ; * lisp/battery.el (battery-status-function): Doc fix.
dc3e79a80e ; * etc/DEBUG: Grammar fix.
7d02ffe87b ; * lisp/international/mule.el (define-coding-system): Do...
2025-05-03 06:26:31 -04:00
Sean Whitton
6b11687555 New user option native-comp-async-on-battery-power
* lisp/emacs-lisp/comp-run.el
(native-comp-async-on-battery-power): New option.
(battery-status-function): Declare.
(native--compile-skip-on-battery-p): New function.
(comp--run-async-workers): Call it.
* etc/NEWS: Announce the new option.
2025-05-02 12:04:26 +08:00
Sean Whitton
dc3e79a80e ; * etc/DEBUG: Grammar fix. 2025-05-02 10:26:08 +08:00
Sean Whitton
343f0c44f3 New this-command buffer display action alist entry
* lisp/subr.el (buffer-match-p): New this-command cons cell
condition to implement new this-command buffer display action
alist entry (bug#78082).
* lisp/window.el (display-buffer):
* doc/lispref/windows.texi (Buffer Display Action Alists):
* etc/NEWS: Document the new buffer display action alist entry.
2025-05-01 20:56:36 +08:00
Philip Kaludercic
d6755ff1e1
Allow selecting what to copy when installing a local package
* lisp/emacs-lisp/package.el (package-unpack, package-dir-info):
Check the marked files if in a Dired buffer, and otherwise
fallback on the previous behaviour or if there was no selection.
(package-install-from-buffer): Document the feature.
* etc/NEWS: Mention the change.

(Bug#78017)
2025-04-30 23:40:16 +02:00
Eli Zaretskii
6bb3c6f9e1 Merge from origin/emacs-30
cc5b1a01a2 ; * doc/misc/efaq-w32.texi (Location of init file): Fix a...
6c2aaedfce Fix compilation errors in emacsclient.c with MinGW GCC 15
d56e5ba97e ; * etc/DEBUG: Add link to GCC bug #78685.
80cbd1e31c ; Fix key notation in Introduction to Emacs Lisp
1224e5fd96 ; * lisp/files.el (revert-buffer-restore-functions): Doc ...
79e7eeb329 ; Improve documentation of 'format-time-string'
2838b64fc8 ; * lisp/textmodes/text-mode.el (text-mode-variant): Fix ...
9adb05422e ; Improve obsolescence of 'text-mode-variant'
4858d81848 ; * lisp/files.el (revert-buffer-restore-functions): Doc ...
2a8e223b8d ; Mention early-init file in Emacs FAQ for Windows
14c707b42d ; Isearch: Fix key bindings in docstrings
2025-04-30 07:14:23 -04:00
Sean Whitton
d56e5ba97e ; * etc/DEBUG: Add link to GCC bug #78685. 2025-04-30 17:12:50 +08:00
Robert Pluim
9b560a54c3 Fix custom type of 'flymake-show-diagnostics-at-end-of-line'
*
lisp/progmodes/flymake.el (flymake-show-diagnostics-at-end-of-line):
Add 'fancy' value to custom type.

* etc/NEWS: "variable" -> "user option".

(Bug#78148)
2025-04-30 10:52:28 +02:00
João Távora
7ae275f04c Eglot: improve diagnostic-reporting performance
After a change in the buffer has occured, it is often the case
that Flymake is quicker to ask for diagnostics than the server
is to supply them to us.  If we're still stuck with old outdated
diagnostics, don't forward them to Flymake, even if it eagerly
asks us for them.

* etc/EGLOT-NEWS (Changes in upcoming Eglot): Announce changes.

* lisp/progmodes/eglot.el
(eglot--diagnostics): Rework.
(eglot--report-to-flymake): Also take version.
(eglot-handle-notification textDocument/publishDiagnostics)
(eglot--managed-mode)
(eglot-flymake-backend): Tweak call to eglot--report-to-flymake.
2025-04-29 12:23:06 +01:00
Sean Whitton
b9886bb206 New log-edit-maybe-show-diff option for log-edit-hook
* lisp/vc/log-edit.el (log-edit-maybe-show-diff): New function.
(log-edit-hook): Add it as an option.
(log-edit-diff-function):
* etc/NEWS: Document it.
2025-04-29 09:40:51 +08:00
João Távora
0262e3e158 Flymake: Experimental 'fancy' flymake-show-diagnostics-at-end-of-line
* doc/misc/flymake.texi (Customizable variables): Describe new
flymake-show-diagnostics-at-end-of-line.

* etc/NEWS: Mention 'flymake-show-diagnostics-at-end-of-line'.

* lisp/progmodes/flymake.el
(flymake-show-diagnostics-at-end-of-line): Update docstring.

* lisp/progmodes/flymake.el (flymake--eol-overlay-summary):
Rework.  Move to separate section.
(flymake--update-eol-overlays): Rework.  Use 'display'.  Move to
separate section.
(flymake--eol-draw-fancy-1, flymake--eol-draw-fancy): New helpers.
(flymake-end-of-line-diagnostics-face): Remove box.
2025-04-27 13:03:19 +01:00
Sean Whitton
925ac2ef70 Mark vc-dav.el as obsolete (bug#77626)
* lisp/vc/vc-dav.el: Move from here ...
* lisp/obsolete/vc-dav.el: ... to here (bug#77626).
Add Obsolete-since header.
* etc/NEWS: Announce the obsoletion.
2025-04-27 12:30:41 +08:00
Eli Zaretskii
86211172e3 Merge from origin/emacs-30
1f520db97b * doc/emacs/files.texi (Time Stamp Customization): Typo.
d824b66c24 ; * doc/emacs/search.texi (Isearch Yank): Improve flow.
62b284f915 ; * etc/DEBUG: Say that debugging code compiled w/ -Og ca...
49ea1f64c7 ; Improve documentation of 'modifier-bar-mode'
a975232c0f ; * doc/emacs/programs.texi (Matching): Fix wording (bug#...
29142dab31 ; * doc/misc/efaq-w32.texi (MinGW-w64): Fix punctuation (...
4cd4a801d8 ; * java/res/README: Note origin of emacs_wrench.png.
2025-04-26 10:57:33 -04:00
Paul Nelson
f808f637f5 Add "forward history" support for some debuggers
* lisp/progmodes/gud.el (gud-query-cmdline): Add an optional
default-list parameter to allow passing a list of "forward
history" suggestions to the minibuffer.
(perldb, pdb, guiler): Use buffer file name to suggest a default
debugging command via "forward history".

* doc/emacs/building.texi (Starting GUD): Document the new
feature.

(Bug#77989)
2025-04-26 16:21:21 +03:00
Jonas Bernoulli
7bb648eb80 mode-line-modes-delimiters: New option 2025-04-26 10:22:00 +02:00
Michael Albinus
a4bff57551 * etc/NEWS: Presentational fixes and improvements. 2025-04-26 09:46:16 +02:00
Eli Zaretskii
52b68f6054 ; * etc/NEWS: Fix a typo (bug#78068). 2025-04-26 09:55:39 +03:00