* lisp/progmodes/perl-mode.el (perl-mode-abbrev-table): Merge defvar
into the definition.
(perl-font-lock-keywords-1, perl-font-lock-keywords-2): Avoid obsolete
font-lock face vars.
* lisp/vc/ediff.el (ediff-current-file): Add optional
startup-hooks argument, so that the user can write wrapper
commands with more finely customized behavior (bug#77323).
Cleanup initialization of the syntax tables, while we're at it.
* lisp/textmodes/reftex.el (reftex-syntax-table)
(reftex-syntax-table-for-bib): Move initialization into the declaration.
(reftex--prepare-syntax-tables): Delete function.
(reftex-mode): Delete call to it.
(reftex-TeX-master-file): Handle the case where `TeX-master` holds
a buffer (e.g. because of `reftex-find-duplicate-labels`).
Consolidate the two cases where we prompt the user.
* lisp/textmodes/reftex.el (reftex--get-buffer-identifier)
(reftex--get-directory, reftex--abbreviate-name)
(reftex--get-basename, reftex--get-truename): New helper
functions that handle both files and buffer objects.
(reftex--remove-buffer-from-master-index): New helper function.
(reftex-tie-multifile-symbols): Support non-file buffers, using
the above.
(reftex-TeX-master-file): Return current buffer when no file.
(reftex-access-scan-info): Remove check requiring file buffers.
(reftex-access-parse-file, reftex-check-parse-consistency): Skip
for non-file buffers.
(reftex-select-external-document): Use new helper function.
(reftex-locate-file): Return buffer objects directly.
(reftex-get-file-buffer-force): Handle buffer objects and
special 'buffer:' strings.
* lisp/textmodes/reftex-global.el (reftex-create-tags-file): Add
error handling for non-file buffers. Leave TAGS unsupported in
non-file buffers.
(reftex-find-duplicate-labels)
(reftex-isearch-switch-to-next-file): Use new helper functions
that handle both files and buffer objects.
(reftex-isearch-switch-to-next-file): Use equal rather than
string= to compare strings/buffers.
* lisp/textmodes/reftex-index.el (reftex-display-index)
(reftex-index-change-entry): Use new helper functions.
(reftex-index-visit-phrases-buffer): Add error handling for
non-file buffers. Leave phrases unsupported in non-file
buffers.
* lisp/textmodes/reftex-parse.el (reftex-do-parse)
(reftex-parse-from-file): Add support for non-file buffers.
(reftex-all-document-files, reftex-where-am-I)
(reftex-notice-new): Use new helper functions.
* lisp/textmodes/reftex-ref.el (reftex-label-info-update):
Support non-file buffers.
(reftex-label-info, reftex-replace-prefix-escapes, reftex-label)
(reftex-replace-prefix-escapes, reftex-offer-label-menu): Use
new helper functions.
* lisp/textmodes/reftex-sel.el (reftex-insert-docstruct): Use
new helper function.
* lisp/textmodes/reftex-toc.el (reftex-toc)
(reftex-recenter-toc-when-idle): Support non-file buffers.
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib)
(reftex-get-bibfile-list): Use new helper functions.
* lisp/textmodes/reftex-global.el
(reftex-save-all-document-buffers, reftex-ensure-write-access):
Ignore non-file buffers.
* lisp/textmodes/reftex-parse.el (reftex-all-document-files):
For non-file objects, do not apply relative path transformation.
* test/lisp/textmodes/reftex-tests.el
(reftex-all-used-citation-keys-buffer)
(reftex-renumber-simple-labels-buffer): New tests for operations
on non-file buffers.
RefTeX historically assumed that the buffers it operates on
visit files. To handle non-file buffers:
Modify reftex-TeX-master-file so that it returns the buffer
object itself (as suggested by Stefan Monnier). Modify each
caller to handle buffer objects, aided by some helper functions
added to reftex.el. Replace 'string=' by 'equal' in places.
Use buffer-base-buffer, where appropriate, to handle indirect
buffers (file and non-file).
TAGS files and phrases buffers remain unsupported for non-file
buffers.
* lisp/textmodes/html-ts-mode.el
(html-ts-mode): Avoid the warning if the html language library is not
installed.
Avoids warning if html language library is not installed
when trying to associate mode with filename patterns.
* lisp/textmodes/html-ts-mode.el: Revert the last changes.
Avoids warning if any of the html, javascript, css language libraries
are not installed when attempting to associate mode with filename
templates.
* lisp/net/tramp-sh.el (tramp-readlink-file-truename): New defconst.
(tramp-bundle-read-file-names): Use new %m and %q format specifiers.
(tramp-sh-handle-file-truename): Use `tramp-readlink-file-truename'.
(tramp-bundle-read-file-names, tramp-get-remote-readlink): Simplify.
(tramp-expand-script): Add format specifiers %m and %q for test
commands. Addapt readlink call.
Reported by Stacey Marshall <stacey.marshall@gmail.com>.
* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--defun-type-regexp): New
variable (backported from master).
(typescript-ts-mode--defun-predicate): New function.
(typescript-ts-base-mode): Use new predicate.
* doc/emacs/misc.texi (Saving Emacs Sessions): Replace
documentation of the long-deleted user option
'desktop-clear-preserve-buffers-regexp' with documentation of
'desktop-clear-preserve-buffers'.
Problem: In Ruby we can define a nested module/class the safe
way (in the sense, if the parent module does not exist, it will
define it:
module M
module N
end
end
If M already exists, we can also write:
module M::N; end
With the later notation, the tag generated by etags will be M::N.
When browsing the code, using xref-find-definitions when the point
is on N, will not be able to find the definition of N because the
implicit tag name is M::N.
This is the same problem with nested classes or even some rare
allowed definitions like explicitely defining a module/class from
the global namespace:
class ::A; end
Solution: We need to give an explicit tag name. To achieve this,
on module/class definition we truncate the name to the last found
column.
* lib-src/etags.c (Ruby_functions): Support "::" in module
definitions.
* test/manual/etags/README: Update instructions.
* test/manual/etags/ruby-src/test1.ru: Add identifiers with "::".
* test/manual/etags/CTAGS.good:
* test/manual/etags/CTAGS.good_crlf:
* test/manual/etags/CTAGS.good_update:
* test/manual/etags/ETAGS.good_1:
* test/manual/etags/ETAGS.good_2:
* test/manual/etags/ETAGS.good_3:
* test/manual/etags/ETAGS.good_4:
* test/manual/etags/ETAGS.good_5:
* test/manual/etags/ETAGS.good_6:
* test/manual/etags/ETAGS.good_7: Adapt expected results to the
change. (Bug#77421)
Copyright-paperwork-exempt: yes
* src/editfns.c (Freplace_region_contents): Redo slightly to
pacify gcc -Wclobbered, by hoisting the eassume out of SCHARS and
into the caller later, where it’ll do more good anyway.
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Recover the changes
made in commit 4764261681 and accidentally undone by a later merge of
commit 63adf9dcf5.
* src/xdisp.c (display_line): Remove incomplete glyph sequence of
the last multi-column character, if not all of its glyphs fit in
the marginal area. (Bug#77452)
* src/xdisp.c (note_mode_line_or_margin_highlight): Remove
correction of DX and DY due to image slices, as this is now done
in 'mode_line_string'.
* src/dispnew.c (mode_line_string): Make DX and DY account for
image slices. (Bug#77429)
* lisp/cus-edit.el (custom-variable-state)
(custom-variable-mark-to-reset-standard): Use `custom--standard-value-p`.
* lisp/custom.el (custom--standard-value-p): New function.
(customize-mark-to-save, custom-push-theme, enable-theme): Use it.
* lisp/help-fns.el (describe-variable): Use `custom--standard-value`.
Extracted from `customize-mark-to-save` by with `ignore-errors`
replaced by `with-demoted-errors`.
* lisp/subr.el (function-get): Signal an error if given a non-symbol
for consistency with 'get'.
* test/lisp/subr-tests.el (subr-butlast): Test for the above.
* lisp/treesit.el (treesit-replace-font-lock-feature-settings):
Check the query language in addition to checking the feature.
(treesit-font-lock-fontify-region): Use treesit-font-lock-setting-*
accessors.
* lisp/treesit-x.el (treesit-generic-mode-setup): Append new
font-lock rules to an existing treesit-font-lock-settings
possibly inherited from the parent.
(treesit-generic-mode-setup): Use treesit-merge-font-lock-feature-list
to merge with an existing feature list inherited from the parent.
(liquid-generic-ts-mode): New treesit generic mode.
(alpinejs-generic-ts-setup): New treesit generic setup.
Since vc-resolve-conflicts is referenced in backend files, which only
require vc at runtime, move it to vc-hooks to avoid a void
variable error. (Bug#3860)
* lisp/vc/vc.el (vc-resolve-conflicts): Move from here...
* lisp/vc/vc-hooks.el (vc-resolve-conflicts): ...to here.
Fix two cases of links where the on-line manual is one document but the
manual is split into separate documents for printing:
* doc/emacs/package.texi (Fetching Package Sources): fix printed link to
"Preparing Patches" to point to separate document.
* doc/emacs/vc1-xtra.texi (Preparing Patches): fix printed link to
"Directory Variables" to point to separate document.
* src/xdisp.c (note_mode_line_or_margin_highlight): Fix coordinates
for image slices wrt ':map' keyword when the image is on the mode
line or header line. (Bug#77429)
* lisp/net/tramp-adb.el (tramp-adb-handle-file-executable-p):
Check also for sticky bit.
(tramp-adb-handle-file-readable-p): Simplify.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-file-executable-p):
Check also for sticky bit. Force `file-attributes' check.
* lisp/net/tramp-sh.el (tramp-sh-handle-file-executable-p):
Check also for sticky bit.
(tramp-sh-handle-file-readable-p)
(tramp-sh-handle-file-writable-p): Simplify.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-file-executable-p):
Check also for sticky bit.
(tramp-sudoedit-handle-file-readable-p)
(tramp-sudoedit-handle-file-writable-p): Simplify.
* lisp/net/tramp.el (tramp-use-file-attributes): Fix docstring.
(tramp-handle-file-readable-p, tramp-handle-file-writable-p):
Force `file-attributes' check. Use `file-truename' for symbolic links.
(tramp-check-cached-permissions): New optional argument FORCE.
Fix symlink check. Check also for sticky bit. (Bug#77402)
* test/lisp/net/tramp-tests.el
(tramp-test20-file-modes-without-file-attributes)
(tramp-test21-file-links-without-file-attributes): New tests.
Fix suggested by Rudi Schlatte <rudi@constantly.at>.
* lisp/speedbar.el (speedbar-frame-or-window): Added an additional check
to see if 'speedbar-buffer' is still alive (bug#77405).
The default safety level is 1. Restoring the default safety level to
1 after it was temporarily 0 should reset byte-compile-delete-errors
to nil, its default level. Failing to do that resulted in
miscompilation of code in highly-parallel builds.
* lisp/emacs-lisp/cl-macs.el (cl--do-proclaim): Change
'byte-compile-delete-errors' to become t only at 'safety' level 0, not
levels 1 or 2.
(cherry picked from commit 53a5dada41)
* lisp/textmodes/reftex.el (reftex--suppress-nonfile-error): New
variable.
(reftex-TeX-master-file): Don't signal error in non-file buffer.
(AUCTeX bug#76615)
* test/lisp/emacs-lisp/cl-macs-tests.el (mystruct)
(cl-lib-struct-accessors): Use ":read-only" instead of ":readonly".
* test/lisp/emacs-lisp/cl-lib-tests.el (cl-lib-struct-accessors):
Test using `setf' on read-only accessor to make sure the correct keyword
is used.
* lisp/emacs-lisp/cl-macs.el (cl-with-accessors): New macro.
* doc/misc/cl.texi (Structures): Mention the new macro.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-lib-struct-with-accessors):
New Test.
* etc/NEWS (New macro 'cl-with-accessors'.): Mention the macro.
This macro is useful when making repeated use of a structures accessor
functions, such as reading from a slot and then writing to a slot. It
is similar to 'with-slots' from EIEIO, but uses accessor functions
instead of slot names.
* lisp/window.el (window-deletable-p): Add tab logic that returns
the symbol 'tab' for a set of predefined conditions.
(window--delete): Call 'tab-bar-close-tab' when 'window-deletable-p'
returns the symbol 'tab'.
(quit-restore-window): Remove tab logic and merge it with frame logic.
* test/lisp/tab-bar-tests.el (tab-bar-tests-close-other-tabs-default)
(tab-bar-tests-close-other-tabs-with-arg): Clean up tabs afterwards.
(tab-bar-tests-quit-restore-window): New test.
* lisp/language/japan-util.el (japanese-replace-region): Allow
STRING to be a character in addition to a string. Un-obsolete
it.
(japanese-katakana-region, japanese-hiragana-region)
(japanese-hankaku-region, japanese-zenkaku-region): Call
'japanese-replace-region' instead of 'replace-region-contents'.
(Bug#77397)