1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-21 20:13:29 -08:00
Commit graph

180578 commits

Author SHA1 Message Date
Juri Linkov
464e1a5a81 * src/term.c (append_glyph): Fix wide character handling in margins columns.
Use 'it->pixel_width' for 'it->margin_column' and 'nglyphs'.
Also fix 'glyph->padding_p' (bug#80025).
2025-12-31 09:44:17 +02:00
Juri Linkov
3ff8f30f83 Make variables 'left-margin-columns' and 'right-margin-columns' buffer-local
* src/xdisp.c (handle_single_display_spec): Use FIXNATP for margin column.
Also use 'Vleft_margin_columns' instead of 'Fsymbol_value' (bug#80025).
(left-margin-columns, right-margin-columns): Use Fmake_variable_buffer_local.
2025-12-30 20:08:07 +02:00
Juri Linkov
996b2304e5 Fix term.c:append_glyph for wide character margin column indicators
* src/term.c (append_glyph): Add 'handled_column' variable
and use it on existing code instead of immediately returning
after adding margin column glyph (bug#80025).
2025-12-30 20:01:40 +02:00
Juri Linkov
9522f4c79e Support multi-character margin indicators (bug#80025)
* src/term.c (append_glyph):
* src/xdisp.c (append_glyph, produce_image_glyph):
Increment it->margin_column to handle multi-char margin indicators.
2025-12-29 19:25:12 +02:00
Juri Linkov
ea3d05394c Add new variables 'left-margin-columns' and 'right-margin-columns' (bug#80025)
* src/xdisp.c (left-margin-columns, right-margin-columns): New variables.
(handle_single_display_spec): Find the column number that
corresponds to the position of the column symbol in these variables.

* lisp/outline.el (outline--create-button-icons):
Add the symbol 'outline' to margin column spec.
(outline-minor-mode): Add/remove the symbol 'outline' to/from
'left-margin-columns' and 'right-margin-columns'.

* lisp/progmodes/flymake.el (flymake--bs-display):
Add the symbol 'flymake' to margin column spec.
(flymake--restore-margins): Remove the symbol 'outline' from
'left-margin-columns' and 'right-margin-columns'.
(flymake--resize-margins): Add the symbol 'outline' to
'left-margin-columns' and 'right-margin-columns'.

* lisp/progmodes/hideshow.el (hs--make-indicators-overlays):
Add the symbol 'hideshow' to margin column spec.
(hs-minor-mode): Add/remove the symbol 'outline' to/from
'left-margin-columns'.
2025-12-29 19:19:45 +02:00
Juri Linkov
7dd94923ef Add the same margin-column handling for term and image glyphs (bug#80025)
* src/term.c (append_glyph):
* src/xdisp.c (produce_image_glyph):
Copy the margin-column random-access indexing with space-padding
from 'append_glyph' in xdisp.c.  Also copy code from the end of these
functions before return after handling the margin column.
2025-12-22 09:27:34 +02:00
Juri Linkov
1c55ea07fa Initial implementation of column-based margin indicators (bug#80025)
* src/dispextern.h (it): Add 'margin_column' field.

* src/xdisp.c (handle_single_display_spec): Parse margin column
specification '(margin left-margin COLUMN)' and set the column
to 'it->margin_column'.
(append_glyph): Support random-access indexing of margin column,
padding with spaces when the required column is beyond the used area.
2025-12-21 09:32:32 +02:00
Eli Zaretskii
040374be2d ; Avoid compilation warnings in xwidget.c on macOS
* src/xwidget.c (Fxwidget_perform_lispy_event): Avoid compiler
warnings about set but not used variables.  (Bug#80044)
2025-12-21 08:15:55 +02:00
Eli Zaretskii
fd1b597781 ; 'standard-display-unicode-special-glyphs': Doc fix
* lisp/disp-table.el (standard-display-unicode-special-glyphs):
Describe in the doc string how to customize the glyphs.  (Bug#80043)
2025-12-21 07:53:51 +02:00
Eli Zaretskii
28a3e3d983 ; Fix a typo in a project.el test (bug#79809)
* test/lisp/progmodes/project-tests.el
(project-vc-supports-project-in-different-dir): Fix typo in version.
2025-12-21 07:37:41 +02:00
Dmitry Gutov
66069812be project-vc-supports-project-in-different-dir: Tune the expectation for 'find'
* test/lisp/progmodes/project-tests.el
(project-vc-supports-project-in-different-dir):
Account for difference in behavior when failing over to 'find'
(comments in bug#79809).
2025-12-21 04:05:06 +02:00
Jens Schmidt
bc30310f87 Add query-replace-read-transpose-from-to
Provide a command to easily swap FROM and TO arguments in a query
replace operation.

* lisp/replace.el (query-replace-read-transpose-from-to): New function.
(query-replace-read-map): New keymap.
(query-replace-read-from): Use new keymap to read from minibuffer.
(read-regexp-map): Inherit from 'query-replace-read-map'.
(query-replace-read-from, query-replace-read-to): Fix parameter
references in doc strings.
* etc/NEWS: Document the change.  (Bug#79835)
2025-12-20 21:10:06 +02:00
Juri Linkov
9ad5953dd3 Handle non-leaf nodes with Eglot text properties in 'M-x imenu'
* lisp/imenu.el (imenu--flatten-index-alist): Add special handling
of the text property 'breadcrumb-region' added by 'eglot-imenu'.
Add non-leaf nodes with these text properties to the flat index alist.
(imenu--parentify-index-alist): New function.
(imenu-choose-buffer-index): For the case when imenu-flatten is nil,
use 'imenu--parentify-index-alist' to add separate ".." to non-leaf nodes
when the first node of 'index-alist' has Eglot text properties (bug#79980).
2025-12-20 20:50:57 +02:00
Jens Schmidt
0aabe62b64 Improve handling of non-ASCII characters in 'transpose-regions'
* src/editfns.c (Ftranspose_regions): Separate code related to character
semantics from that related to byte semantics and in that way leverage
optimizations for regions of equal length with respect to both
semantics.  Move and update comments dating back to the initial
implementation.
* test/src/editfns-tests.el (editfns-tests--transpose-regions-tests)
(editfns-tests--transpose-regions-markups)
(editfns-tests--transpose-regions): New test and accompanying variables.
2025-12-20 13:23:29 -05:00
Jens Schmidt
875e42d501 Fix byte-vs-char length issue in 'transpose-regions'
* src/editfns.c (Ftranspose_regions): Calculate length of range between
regions both in units of bytes and characters and use these values as
appropriate.
2025-12-20 13:23:21 -05:00
Elías Gabriel Pérez
e93a9a9057 hideshow: Support nested comment block in 'hs-hide-level-recursive'
bug#80009

* doc/emacs/programs.texi (Hideshow): Update documentation.
* lisp/progmodes/hideshow.el (hs-hide-level-recursive): Rework.
(hs-get-first-block-on-line): Minor changes.
(hs--add-indicators, hs-hide-comments-when-hiding-all)
(hs-minor-mode-menu, hs-hide-level, hs-cycle): Update code.
* test/lisp/progmodes/hideshow-tests.el
(hideshow-hide-levels-with-comments-1): New test.
2025-12-20 20:09:41 +02:00
Stéphane Marks
c989d096f1 Add vtable buffer slot (bug#79982)
This solves for background vtable mutations, i.e., updates
initiated from buffers other than the vtable buffer, and for
buffer-adjusted string-pixel-width computations.

* lisp/emacs-lisp/vtable.el (vtable): New '-buffer' slot.
(vtable-buffer, vtable-set-buffer): New function.
(vtable-update-object, vtable-remove-object)
(vtable-insert-object): Wrap operation with the vtable buffer.
(vtable--insert): Split from old 'vtable-insert'.
(vtable-insert): Insert table and record the buffer.
(vtable--insert-line, vtable--insert-header-line): Use
'vtable-buffer' for pixel-width computation.
(vtable--limit-string, vtable--char-width): Pass buffer to
'string-pixel-width'.
(vtable-revert): New optional table argument.
(vtable--alter-column-width, vtable-revert-command)
(vtable-sort-by-current-column): Call 'vtable-revert' with the
table.

* test/lisp/emacs-lisp/vtable-tests.el
(vtable-tests--make-no-header-2-object-table): New helper
function.
(test-vstable-compute-columns): Correct typo in test name.  Use
new helper function.
(test-vtable-unique-buffer)
(test-vtable-non-current-buffer-insert-object)
(test-vtable-non-current-buffer-remove-object)
(test-vtable-non-current-buffer-update-object)
(test-vtable--limit-string-with-face-remapped-buffer): New test.
2025-12-20 18:23:25 +02:00
Martin Rudalics
cf2e676eca Don't change visibility of tty root frames (Bug#80032)
* src/frame.c (Fmake_frame_visible, Fmake_frame_invisible):
* doc/lispref/frames.texi (Visibility of Frames): Don't change
visibility of tty root frames.  (Bug#80032)
2025-12-20 15:12:39 +01:00
Eli Zaretskii
69ca26996c ; Update lisp/ldefs-boot.el 2025-12-20 08:43:09 -05:00
Jostein Kjønigsen
e3883144ae csharp-mode: Fix fontification of catch-expressions
* lisp/progmodes/csharp-mode.el
(csharp-ts-mode--font-lock-settings): Improve specificity
of selectors.  Don't let type-selector bleed into
name-selector.  (Bug#80038)
2025-12-20 15:12:50 +02:00
Rudolf Adamkovič
985e942d1c hi-lock: Use active region for default values in more places
* lisp/hi-lock.el (hi-lock-line-face-buffer, hi-lock-face-buffer)
(hi-lock-face-phrase-buffer): Use the new function
`hi-lock-read-regexp' to read font-lock patterns, mirroring
`hi-lock-read-face-name' used to read face names.  For end users,
all three functions now get the default value from the active
region, rather than just `hi-lock-face-buffer'.
(hi-lock-read-regexp): Extract font-lock pattern reading
functionality from `hi-lock-face-buffer' into this function, to
mirror how faces are read with `hi-lock-read-face-name' and to
promote reuse.  (Bug#79976)
2025-12-20 14:21:42 +02:00
Michael Albinus
9e16010686 Fix problem in Tramp completion
* lisp/net/tramp.el (tramp-completion-handle-expand-file-name):
Expand FILENAME also when it is absolute.  (Bug#80031)
2025-12-20 08:58:26 +01:00
Eli Zaretskii
54eae320f5 ; * lisp/vc/vc-git.el (vc-git-registered): Fix remote files (bug#80035). 2025-12-20 09:47:39 +02:00
Paul Eggert
4d11449c96 Revert to simpler (and we hope faster) TAGGEDP
Suggested by Mattias Engdegård (bug#80021#17).
* src/lisp.h (lisp_h_FIXNUMP, lisp_h_TAGGEDP):
Go back to the simpler (X&7) == TAG approach for checking object tags.
This reverses my commit ccdb08ef4e
“Improve performance of CONSP, FIXNUMP, etc.”
dated 2018-08-25 13:39:18 -0700,
though it keeps the TAGGEDP function the older commit introduced.
Although the older commit improved performance on its circa 2010
platform, when I ran today’s ‘make -C lisp compile-always’
benchmark on Ubuntu 25.10 which uses gcc (Ubuntu 15.2.0-4ubuntu4)
on an circa-2021 Intel Xeon W-1350, this patch makes the
‘make -C lisp compile-always’ benchmark 3.1% faster.  Although the
patch unfortunately also makes the Emacs text segment 0.6% larger,
in this case speed and simplicity beat text size in importance.
2025-12-19 09:10:31 -08:00
Gerd Möllmann
a6c2ae3a3f Don't make tty child frames visible when selected (bug#80020)
* src/frame.c (do_switch_frame): Don't change visibility of tty
child frames.
(Fraise_frame): Doc string fix.
2025-12-19 14:12:33 +01:00
João Távora
cfb4bace26 ; Eglot: mention relativePatternSupport in /etc/EGLOT-NEWS
* etc/EGLOT-NEWS (Changes to upcoming Eglot): Mention
relativePatternSupport.
2025-12-19 09:43:53 +00:00
Eli Zaretskii
4fe28df3cd ; * lisp/progmodes/project.el (vc-git-project-list-files): Fix a typo. 2025-12-19 09:56:58 +02:00
Paul Eggert
5e6df127a9 Fix ‘make compile-always’ with native compilation
Without the fix, ‘make compile-always’ failed nearly immediately
in a native compilation build, with ‘ELC+ELN
emacs-lisp/loaddefs-gen.elc’ outputting “Error: file-missing
("Cannot open load file" "No such file or directory" "comp")...”.
* lisp/Makefile.in (compile-always):
Build ../src first, since the ‘find ... -delete’ removes files
needed by ‘make compile’.
2025-12-18 22:17:45 -08:00
Paul Eggert
f6f85dd3be Remove stray references to $(LOADDEFS)
They became obsolete some time ago.
* lisp/Makefile.in (compile, compile-one-process):
Don’t depend on $(LOADDEFS).
2025-12-18 22:17:45 -08:00
Dmitry Gutov
976e3d3d51 Merge remote-tracking branch 'origin/master' 2025-12-19 02:52:29 +02:00
João Távora
4cc4c9cffc ; Eglot: fix oversight and add back essential delete-dups
Else will make a number of file-notify descriptors proportional to
the number of files in a directory (though this doesn't apply to
out-of-root watchers).

* lisp/progmodes/eglot.el (eglot--watch-globs): Tweak.
2025-12-19 00:48:38 +00:00
João Távora
ee481d30f9 Eglot: remove "face" suffix for semtok-specific faces
* lisp/progmodes/eglot.el (eglot--semtok-define-things)
(eglot--semtok-decode-token): Remove "face" suffix for semtok faces.
2025-12-19 00:48:38 +00:00
Dmitry Gutov
500f1478f7 Re-introduce fallback to 'find' for extra ignores with older Git
* lisp/progmodes/project.el (vc-git-project-list-files):
Fall back to 'find' when Git is older than 1.13 and EXTRA-IGNORES
is non-nil (bug#79809).
2025-12-19 02:47:36 +02:00
Dmitry Gutov
de5b8c70fb Revert "vc-git-project-list-files: Restore support for Git < 2.13"
This reverts commit 821c0d36df.

Despite re-enacting what the modern Git versions seem to do under the
covers, the effect is not the same: filtering works differently.
2025-12-19 02:26:59 +02:00
Sean Whitton
83e8acf19a ; * etc/NEWS: Fix last change. 2025-12-18 21:51:15 +00:00
Sean Whitton
f9172be29a Make VC-Dir's 'd' able to delete unregistered files
* lisp/vc/vc.el (vc-delete-file): Simplify.
* lisp/vc/vc-dir.el (vc-dir-delete-file): Handle deleting
unregistered files, too.
(vc-dir-menu-map, vc-dir-mode-map): Replace bindings for
vc-dir-clean-files with ones for vc-dir-delete-file.
* doc/emacs/maintaining.texi (VC Directory Commands):
* etc/NEWS: Document the bindings change.
2025-12-18 21:46:49 +00:00
Sean Whitton
1cd6428bce ; * lisp/vc/vc-dir.el (vc-dir-menu-map): Delete obsolete comment. 2025-12-18 21:43:57 +00:00
João Távora
998584eaad Eglot: fallback to project-files if no 'find' available (bug#79809)
When find-based directory listing fails, fallback to project-files
strategy for robustness.

* lisp/progmodes/eglot.el (eglot--watch-globs): Inline directory
listing and add error handling with fallback.  Rename BASE-PATH to DIR,
add IN-ROOT parameter.
(eglot--list-directories): Delete
(eglot-register-capability): Adjust caller, group by both DIR and
IN-ROOT.
2025-12-18 17:04:01 +00:00
Sean Whitton
bd6bb96220 vc-diff-internal: Call into backend with old current buffer
* lisp/vc/vc.el (vc-diff-internal): Call into the backend with
the original current buffer, not BUFFER (see bug#80005).
2025-12-18 17:01:57 +00:00
Sean Whitton
94aab3b602 ; * lisp/vc/vc-git.el (vc-git-region-history): Fix backend name. 2025-12-18 13:06:19 +00:00
Sean Whitton
495843d9eb ; cond* docs: Update match* operator name to cdr-ignore (bug#79998). 2025-12-18 10:48:12 +00:00
Dmitry Gutov
75a1403ff3 Fix "No such file or directory" "vc-nil" in project-files
* lisp/progmodes/project.el (project-files):
Fix vc-nil backend error (bug#80013).
2025-12-18 03:48:58 +02:00
F. Jason Park
22719d64e9 ; Tweak failing autojoin display-context test for ERC
* test/lisp/erc/erc-scenarios-join-display-context.el
(erc-scenarios-join-display-context--errors): Attempt to indirectly fix
a reoccurring failure on EMBA.  Instead of asserting the membership of
`erc-join--requested-channels', have the client attempt to manually join
an autojoined channel previously denied by an error response.  But this
time assert that the display context for the now successfully joined
channel doesn't indicate it originated from the autojoin module.
* test/lisp/erc/resources/base/gapless-connect/barnet.eld: Increase
timeout.
* test/lisp/erc/resources/join/buffer-display/mode-context.eld: Update
accordingly.
2025-12-17 17:36:42 -08:00
Dmitry Gutov
821c0d36df vc-git-project-list-files: Restore support for Git < 2.13
* lisp/progmodes/project.el (vc-git-project-list-files):
Restore support for Git < 2.13 (discussed in bug#79809).
2025-12-18 01:43:28 +02:00
Sean Whitton
7425e33287 New M-RET, M-p, M-n commands in Log View mode
* lisp/vc/log-view.el (log-view-msg-and-diff-next)
(log-view-msg-and-diff-prev, log-view-display-entry-and-diff):
New commands.
(log-view-mode-map): Bind them.
* doc/emacs/maintaining.texi (VC Change Log):
* etc/NEWS: Document them.
2025-12-17 13:22:39 +00:00
Sean Whitton
7844710e87 log-view-toggle-entry-display: Don't deactivate the mark
* lisp/vc/log-view.el (log-view-toggle-entry-display): Bind
inhibit-read-only instead of buffer-read-only.  Bind
deactivate-mark to nil.
2025-12-17 13:21:37 +00:00
Sean Whitton
6d7ff7478f ; Log View beg and end of defun functions: Style improvements. 2025-12-17 13:20:50 +00:00
Eli Zaretskii
b7601bfb70 Fix 'mode-line-format-right-align' in Olivetti mode
* lisp/bindings.el (mode--line-format-right-align): Account for
the left fringe.  (Bug#80019)
2025-12-17 15:14:25 +02:00
Sean Whitton
0c7420fe38 ; * lisp/bookmark.el (bookmark-after-load-file-hook): Fix quotation. 2025-12-17 12:43:00 +00:00
Liu Hui
f26068dac7 calendar-mode-line-format: Fix regexp
* lisp/calendar/calendar.el (calendar-mode-line-format): Replace
'*' with '\\*'.
(calendar-get-buffer, calendar-exit):
* lisp/calendar/diary-lib.el (diary-mark-entries): Improve
comment and doc string.
2025-12-17 12:43:00 +00:00