Commit graph

8053 commits

Author SHA1 Message Date
Paul Nelson
03fc0e0fd5 Add RefTeX support for non-file buffers
* 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.
2025-04-04 14:37:33 -04:00
Eli Zaretskii
12b06992df ; Fix last change. 2025-04-03 09:12:07 +03:00
Laurent Stacul
8db310ce8b Fix etags for Ruby module definitions with ::
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
2025-04-03 08:50:59 +03:00
Stefan Kangas
a4ec9ca129 function-put: signal error with non-symbol
* 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.
2025-04-01 21:25:33 +02:00
Earl Hyatt
6f311883d2 Fix typo in test of read-only cl-defstruct slot.
* 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.
2025-03-31 14:34:28 -04:00
Earl Hyatt
e04d1dafc7 Add cl-with-accessors
* 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.
2025-03-31 14:29:48 -04:00
Juri Linkov
a97a61b630 Improve logic of tab handling when quitting windows (bug#71386)
* 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.
2025-03-31 20:40:17 +03:00
Pip Cet
67e34f0ed8 Respect narrowed buffers when parsing JSON (bug#77325)
* src/json.c (Fjson_insert): Simplify 'memcpy' argument.
(Fjson_parse_buffer): Only read to ZV, not all the way to Z.
* test/src/json-tests.el (with-all-gap-positions-in-temp-buffer):
New macro.
(json-parse-buffer/restricted): New test.
2025-03-30 11:52:07 +00:00
Stefan Monnier
57da44fa70 src/insdel.c (adjust_markers_for_replace): Fix insertion case
test/src/editfns-tests.el (editfns-tests--insert-via-replace): New test
2025-03-29 17:49:49 -04:00
Stefan Monnier
7c82cc8b97 (replace-region-contents): Improve and promote (bug#76313)
Swap the role of `replace-region-contents` and `replace-buffer-contents`,
so `replace-region-contents` is the main function, implemented in C,
and `replace-buffer-contents` is a mere wrapper (marked as obsolete).
Also remove the need to rely on narrowing and on describing the
new text as a function.
Finally, allow MAX-SECS==0 to require a cheap replacement, and
add an INHERIT argument.

* src/editfns.c: Include `coding.h`.
(Freplace_region_contents): Rename from `Freplace_buffer_contents`.
Change calling convention to that of `replace-region-contents`.
Add more options for the SOURCE argument.  Add INHERIT argument.
Skip the costly algorithm if MAX-SECS is 0.
* src/insdel.c (replace_range): Allow NEW to be a buffer.

* lisp/subr.el (replace-buffer-contents): New implementation.
* lisp/emacs-lisp/subr-x.el (replace-region-contents): Delete.

* doc/lispref/text.texi (Replacing): Document new API for
`replace-region-contents`.  Remove documentation of
`replace-buffer-contents`.

* test/src/editfns-tests.el (replace-buffer-contents-1)
(replace-buffer-contents-2, replace-buffer-contents-bug31837):
Use `replace-region-contents`.
(editfns--replace-region): Delete.
(editfns-tests--replace-region): Use `replace-region-contents`.
Adds tests for new types of SOURCE args.
2025-03-29 17:49:05 -04:00
Stefan Kangas
dd0dd87e3a New function 'hash-table-contains-p'
This function tests whether a given key is present in a hash table.
Emacs Lisp has long lacked a standard way to do this, leading users to
write one of:

    (not (eq (gethash key table 'missing) 'missing))
or
    (gethash key table)

This idiom is error-prone (when 'missing' or 'nil' are valid values),
and it obscures intent.  The new function avoids such pitfalls,
improves readability, and makes the intent explicit:

    (hash-table-contains-p key table)

The name 'hash-table-contains-p' exists in other Lisp dialects (e.g.,
SRFI-125), and follows the precedent of 'seq-contains-p'.  Other
alternatives considered include `hash-table-has-key-p` and
`hash-table-key-exists-p`, but none were clearly better.

This was previously discussed in 2018, and all comments were positive,
but the proposed patch (implementing it in C) was never pushed:
https://lists.gnu.org/r/emacs-devel/2018-02/msg00424.html

* lisp/subr.el (hash-table-contains-p): New function.
* lisp/emacs-lisp/shortdoc.el (hash-table):
* doc/lispref/hash.texi (Other Hash): Document the new function.
* test/lisp/subr-tests.el (hash-table-contains-p): New test.
2025-03-29 14:59:36 +01:00
Michael Albinus
8a986e7075 tramp-tests cleanup
* test/lisp/net/tramp-tests.el (tramp-test26-file-name-completion)
(tramp-test26-interactive-file-name-completion): Adapt tests.
2025-03-28 19:26:23 +01:00
Eli Zaretskii
3d5def2677 ; Fix OOM kill in ert-tests
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Mark it 'unstable', as it
might run out of memory on GNU/Linux and on Windows.
2025-03-26 14:31:41 +02:00
Eli Zaretskii
f1715f6411 ; Fix 'ert-tests' on MS-Windows
* test/lisp/emacs-lisp/ert-tests.el
(ert-test-run-tests-batch-expensive): Skip the test on MS-Windows.
2025-03-26 14:22:30 +02:00
Philipp Stephani
2d278a0f2e Use numeric time zone suffix in ERT explainer.
This is more robust since the time zone name is system-dependent.

* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): Use numeric time
zone suffix.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p):
Adapt test.
2025-03-26 03:32:46 +01:00
Michael Albinus
56248fad53 * test/lisp/gnus/message-tests.el (message-default-buffer-type): New test. 2025-03-25 19:48:06 +01:00
Michael Albinus
d6c7a77465 * test/infra/Dockerfile.emba (emacs-tree-sitter): Add gowork grammar. 2025-03-25 09:28:43 +01:00
Philipp Stephani
8be7e98557 Add an ERT explainer for 'time-equal-p'.
* lisp/emacs-lisp/ert.el (ert--explain-time-equal-p): New explainer
function.

* test/lisp/emacs-lisp/ert-tests.el (ert-test-explain-time-equal-p): New
test.
2025-03-25 00:12:20 +01:00
Stefan Kangas
4194d5af45 New test for function-get
* test/lisp/subr-tests.el (subr-tests-function-get): New test.
2025-03-24 21:20:36 +01:00
Stefan Kangas
5830d1fa65 Add basic and low-level tests for hash tables
* test/src/fns-tests.el (test-hash-table)
(test-hash-table-wrong-keywords, test-remhash, test-clrhash)
(test-hash-table-p, test-hash-table-count, test-maphash)
(test-copy-hash-table): New tests.
2025-03-24 00:57:47 +01:00
Andrea Corallo
d565a6747a Fix a nativecomp type propagation bug (bug#74771)
* lisp/emacs-lisp/comp.el (comp--add-cond-cstrs): Don't emit negated
cstr.
* test/src/comp-tests.el (comp-tests-type-spec-tests): Add a test.
2025-03-23 17:33:27 +01:00
shipmints
81c21d89ed Ensure .dir-locals-2.el behavior as documented (bug#75890)
* lisp/files.el
(dir-locals--all-files): New &optional 'base-el-only' argument.
(dir-locals--base-file): New function.
(dir-locals-find-file): 'locate-dominating-file' only for the base
.dir-locals.el.

* test/lisp/files-tests.el
(files-test-dir-locals-2-solo): New test.
* test/lisp/files-resources/dir-locals-2-solo: New test support.
(files-test-dir-locals-2-paired): New test.
* test/lisp/files-resources/dir-locals-and-2: New test support.
2025-03-22 16:47:27 -04:00
Paul Eggert
25d7575358 Remove ctags program
Remove our old ctags and suggest Universal Ctags instead.
This fixes a FIXME in lib-src/Makefile.in and speeds up compilation
quite a bit on my older CPU when I compile with	--enable-gcc-warnings.
It also lessens installation and runtime footprint. (Bug#76322)
* .gitignore: Remove lib-src/ctags.
* admin/authors.el (authors-renamed-files-alist): Remove ctags.1.
* admin/check-man-pages: ctags.1 is no longer a special case.
* admin/quick-install-emacs (PUBLIC_LIBSRC_BINARIES): Remove ctags.
* cross/Makefile.in (LIBSRC_BINARIES): Remove lib-src/ctags.
* doc/man/ctags.1, lib-src/ctags.c: Remove.
* java/Makefile.in (CROSS_LIBSRC_BINS): Remove ctags.
* lib-src/Makefile.in (INSTALLABLES): Remove ctags${EXEEXT}.
(ctags${EXEEXT}): Remove.
* lib-src/etags.c (CTAGS): Remove.  All uses replaced by ...
(ctags): ... this new static var.
(STDIN): Remove macro.  All uses replaced by new STDIN_OPTION constant.
(CTAGS_OPTION, STDIN_OPTION): New contants.
(longopts): New --ctags option.
(ctags_default_C_help): New constant,
to override default_C_help at runtime.
(default_C_help): Now always the etags version.
(C_LANG_NAMES_INDEX): New macro.
(print_language_names): Do not assume etags.
(PROGRAM_NAME): Remove.  All uses removed.
(print_help): Document --ctags if PRINT_UNDOCUMENTED_OPTIONS_HELP.
(main): Support new --ctags option, and support all [ce]tags options.
* test/manual/etags/Makefile (CTAGS_PROG):
Now etags --ctags, since there is no longer a ctags.
2025-03-22 11:57:29 -07:00
Michael Albinus
172e35afce Tramp: Improve handling of cyclic symlinks
* lisp/net/tramp-sh.el (tramp-sh-handle-file-ownership-preserved-p):
Add FIXME.

* lisp/net/tramp.el (tramp-skeleton-file-exists-p)
(tramp-handle-file-directory-p): Protect against cyclic symlinks.

* test/lisp/net/tramp-tests.el (tramp-test18-file-attributes)
(tramp-test21-file-links): Adapt tests.
2025-03-22 09:52:22 +01:00
john muhl
60e9195984 ; Fix 'lua-ts-mode' tests (Bug#77102)
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Remove unintended use of tabs and make indentation settings
buffer local.
2025-03-20 15:35:09 +02:00
David Ponce
b1db48c0fc Fix `string-pixel-width' with alternate text properties
Fix possible wrong result of `string-pixel-width' with alternate
and default properties.  Create new regression tests.
* lisp/emacs-lisp/subr-x.el (string-pixel-width): Like for
`face-remapping-alist', use in work buffer the value of
`char-property-alias-alist' and `default-text-properties'
local to the passed buffer, to correctly compute pixel width.
(Bug#77042)

* test/lisp/misc-tests.el: Add tests for `string-pixel-width'.
2025-03-20 14:55:23 +02:00
Stefan Monnier
5432331a62 indent.erts (Code): Don't modify the global state
* test/lisp/progmodes/java-ts-mode-resources/indent.erts (Code):
Use `setq-local` and correspondingly move the remaining
assignment after activating the major mode.
2025-03-19 15:53:37 -04:00
Michael Albinus
f6632114fe ; Tramp: fixes resulting from test campaign
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Handle symlinks.

* lisp/net/tramp-sshfs.el (tramp-sshfs-handle-process-file):
STDERR is not implemented.

* lisp/net/tramp.el (tramp-skeleton-process-file): Raise a warning
if STDERR is not implemented.
(tramp-handle-shell-command):
Respect `async-shell-command-display-buffer'.

* test/lisp/net/tramp-tests.el (tramp-test28-process-file): Adapt test.
2025-03-19 14:40:54 +01:00
john muhl
be2b5a7148 ; Fix 'java-ts-mode' tests (Bug#77070)
* test/lisp/progmodes/java-ts-mode-resources/indent.erts:
Set 'indent-tabs-mode' later.
2025-03-17 16:48:22 +02:00
Yuan Fu
93cd55f40e
Use c-ts-common baseline rule in java-ts-mode (bug#75154)
Use it for function parameters.

* lisp/progmodes/java-ts-mode.el:
(java-ts-mode--standalone-predicate): New function.
(java-ts-mode--indent-rules): Comment out rules for function
parameters and statements, and add
c-ts-common-baseline-indent-rule as fallback.
(java-ts-mode): Setup.
(java-ts-mode--first-line-on-multi-line-string): Mark BOL as
unused.
* test/lisp/progmodes/java-ts-mode-resources/indent.erts:
New test.
2025-03-16 22:44:05 -07:00
Jens Schmidt
7f2e4508ce Correctly unload variable aliases.
* src/eval.c (Finternal_delete_indirect_variable): Add function.
* lisp/loadhist.el (loadhist-unload-element): Use it for variable
aliases.
* test/src/eval-tests.el (eval-tests--internal-delete-indirect-variable):
Test function `internal-delete-indirect-variable'.
* test/lisp/loadhist-tests.el (loadhist-test-unload-feature-alias):
* test/lisp/loadhist-resources/loadhist--alias.el: Test unloading of
features that define variable aliases.  (Bug#76748)
2025-03-16 12:52:40 -04:00
Michael Albinus
b8104dadbf Tramp: Handle symlinks to non-existing targets better
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Don't use the truename.

* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file): Refactor.  Handle
symlinks.  (Bug#76678)

* lisp/net/tramp-smb.el (tramp-smb-errors): Add string.
(tramp-smb-handle-copy-file, tramp-smb-handle-rename-file):
Refactor.

* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Don't use the truename.  Handle symlinks.

* lisp/net/tramp.el (tramp-barf-if-file-missing): Accept also symlinks.
(tramp-skeleton-file-exists-p): Handle non-existing symlink targets.
(tramp-skeleton-set-file-modes-times-uid-gid): Fix typo.

* test/lisp/net/tramp-tests.el (vc-handled-backends):
Suppress only if noninteractive.
(tramp-test11-copy-file, tramp-test12-rename-file)
(tramp-test18-file-attributes, tramp-test21-file-links)
(tramp--test-check-files): Adapt tests.
2025-03-16 14:17:38 +01:00
Po Lu
5d02ca181d ; New bisect' argument to ats-execute-tests-batch'
* test/infra/android/test-controller.el
(ats-execute-tests-batch): New argument `bisect'.
2025-03-16 20:14:34 +08:00
Stefan Kangas
33cc5427cb Add :set attribute to winner-dont-bind-my-keys
* lisp/winner.el (winner--set-dont-bind-my-keys): New function.
(winner-dont-bind-my-keys): Allow setting with setopt.
(winner-mode-map): Use defvar-keymap.
* test/lisp/winner-tests.el: New file.
2025-03-15 04:06:31 +01:00
Tomas Nordin
4980287e08 Teach diff-apply-hunk to handle hunks with empty context
* lisp/vc/diff-mode.el (diff-find-source-location):
Consider the case when there is no diff context above or below
edited lines.  (bug#72556)

* test/lisp/vc/diff-mode-tests.el: Add tests for undoing hunks
from diffs with addtions only in the beginning or end of the
source file.
2025-03-15 04:54:11 +02:00
john muhl
af5a75a0bd ; Fix 'diff-mode' tests (Bug#77014)
* test/lisp/vc/diff-mode-resources/git.patch: Restore missing space.
2025-03-14 19:58:35 +01:00
Yuan Fu
f2f1fb7fe0
Merge from origin/emacs-30
defc55bb6f Fix treesit-parser-create behavior regarding indirect buf...
20ac26e675 ; Fix with-delayed-message docstring metavars.
04034cd9ce Fix 'dired-movement-style' in Dired when subdirs are shown
f8443dffc1 ; * lisp/register.el (register-use-preview): Doc fix (bug...
f729828bcf ; Add texinfo reference to GNU Coding Standards.
a6abb88fdc ; * lisp/files.el (executable-find): Doc fix.

# Conflicts:
#	src/treesit.c
2025-03-13 20:18:03 -07:00
john muhl
1528d31564 Simplify and improve indent rules in 'lua-ts-mode'
* lisp/progmodes/lua-ts-mode.el (c-ts-common): Require it.
(lua-ts-mode): Set 'c-ts-common' variables.
(lua-ts--simple-indent-rules): Replace custom indent rules for
tables, arguments and parameters with
'c-ts-common-baseline-indent-rule'.
Improve consistency of indentation for IIFEs and nested functions.
(lua-ts--variable-declaration-continuation)
(lua-ts--variable-declaration-continuation-anchor): Reformat.
(lua-ts--comment-first-sibling-matcher)
(lua-ts--first-child-matcher, lua-ts--first-real-sibling-anchor)
(lua-ts--function-definition-p, lua-ts--g-g-g-parent)
(lua-ts--g-g-parent, lua-ts--nested-function-argument-matcher)
(lua-ts--nested-function-block-include-matcher)
(lua-ts--nested-function-block-matcher)
(lua-ts--nested-function-end-argument-matcher)
(lua-ts--nested-function-end-matcher)
(lua-ts--nested-function-last-function-matcher)
(lua-ts--top-level-function-call-matcher): Remove.
* test/lisp/progmodes/lua-ts-mode-resources/indent.erts:
Update tests.  (Bug#76986)
2025-03-13 10:09:38 +02:00
Stefan Kangas
b51fb2e107 Fix loading follow.el
* lisp/follow.el (follow-mode-prefix-key): Avoid changing
follow-mode-map before it is defined.  (Bug#76977)
* test/lisp/follow-tests.el: New file.
2025-03-13 08:14:36 +01:00
Sean Whitton
2aef2951c0 ; Replace "Elisp" with "Lisp" or "Emacs Lisp" in some places
* configure.ac (libgccjit_not_found_err)
(libgccjit_dev_not_found_err):
* doc/lispref/elisp.texi (Top):
* doc/lispref/functions.texi (What Is a Function):
* doc/lispref/parsing.texi (Parsing Program Source)
(Tree-sitter C API):
* doc/misc/gnus.texi (The Gnus Registry):
* etc/TODO:
* lisp/auth-source.el (auth-source-search):
* lisp/cedet/semantic/bovine/el.el (emacs-lisp-mode):
* lisp/editorconfig.el
(editorconfig-get-local-variables-functions):
* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper):
* lisp/net/tramp-message.el (tramp-debug-font-lock-keywords):
* src/frame.c (do_switch_frame):
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test): Say "Lisp"
not "Elisp".
* lisp/progmodes/peg.el (peg-translate-exp): Say "Emacs Lisp"
not "Elisp".
2025-03-12 10:24:22 +08:00
Sean Whitton
99852fb867 Merge from origin/emacs-30
894b0e3a2f ; Adapt comment in tramp.el
cc87717fa0 Add keyword placeholder to tramp.el
7d0d61d854 Rewrite ERT manual introduction
b2f124f2a8 ; cperl-mode.el: Don't misinterpret exec_fcn as keyword exec
59d1aac49d Document return values of the various read-* functions
2025-03-12 10:09:09 +08:00
Sean Whitton
60c0524ad2 Fix capitalization ELisp -> Elisp
* configure.ac (libgccjit_not_found_err)
(libgccjit_dev_not_found_err):
* doc/emacs/buffers.texi (List Buffers):
* doc/lispref/elisp.texi (Tree-sitter C API):
* doc/lispref/functions.texi (What Is a Function):
* doc/lispref/parsing.texi (Parsing Program Source)
(Tree-sitter C API):
* doc/misc/gnus.texi (The Gnus Registry):
* etc/DEBUG:
* etc/NEWS:
* etc/NEWS.25:
* etc/NEWS.26:
* etc/NEWS.28:
* etc/NEWS.30:
* etc/TODO:
* lib-src/emacsclient.c (print_help_and_exit):
* lisp/auth-source.el (auth-source-search):
* lisp/cedet/semantic/bovine/el.el (emacs-lisp-mode):
* lisp/cedet/semantic/wisent/comp.el
(wisent-automaton-lisp-form):
* lisp/cedet/srecode/el.el (srecode-semantic-apply-tag-to-dict):
* lisp/editorconfig.el
(editorconfig-get-local-variables-functions):
* lisp/emacs-lisp/bindat.el (bindat-type):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/emacs-lisp/cconv.el (cconv-make-interpreted-closure):
* lisp/emacs-lisp/cl-macs.el (cl--labels-convert):
* lisp/emacs-lisp/lisp-mode.el (lisp-fdefs)
(lisp-fill-paragraphs-as-doc-string):
* lisp/emacs-lisp/macroexp.el (macroexp--fgrep):
* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper):
* lisp/emacs-lisp/re-builder.el:
* lisp/erc/erc-button.el (erc-emacswiki-lisp-url):
* lisp/help-fns.el
(help-fns--describe-function-or-command-prompt):
* lisp/menu-bar.el (menu-bar-search-documentation-menu):
* lisp/net/tramp-message.el (tramp-debug-font-lock-keywords):
* lisp/org/org-capture.el (org-capture):
* lisp/org/org.el (org-category, org-todo):
* lisp/org/ox.el (org-export-async-start):
* lisp/progmodes/elisp-mode.el (emacs-lisp-mode):
* lisp/progmodes/peg.el (peg-translate-exp):
* lisp/progmodes/ruby-ts-mode.el:
* lisp/woman.el (woman-mode, woman-parse-numeric-arg):
* src/chartab.c (map_char_table_for_charset):
* src/fns.c (extract_data_from_object):
* src/frame.c (do_switch_frame):
* src/keyboard.c (make_lispy_event):
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-&key-arguments):
* test/lisp/emacs-lisp/shortdoc-tests.el
(shortdoc-help-fns-examples-function-test):
* test/manual/etags/c-src/emacs/src/keyboard.c
(make_lispy_event): Fix capitalization ELisp -> Elisp.
2025-03-12 09:38:33 +08:00
F. Jason Park
3db65ff5cb Suppress log module when inserting date stamps in ERC
* lisp/erc/erc-log.el (erc-truncate-buffer-on-save): Use
`make-obsolete-variable' because `erc-truncate-buffer-on-save' is an
option, not a function.  Already mentioned in etc/ERC-NEWS.
(erc-logging-enabled): Return nil if `log' appears in the `erc--skip'
msg prop.
* lisp/erc/erc-stamp.el (erc-stamp--defer-date-insertion-on-post-modify):
Add `log' to `erc--skip' msg prop.  This tells the log module to defer
advancing the `erc-last-saved-position' marker until after stamps have
been inserted, thus ensuring they're included in logs when
`erc-log-write-after-insert' is non-nil.
* test/lisp/erc/erc-scenarios-log.el
(erc-scenarios-log--save-buffer-in-logs/truncate-on-save): Suppress
warning for `erc-truncate-buffer-on-save'.
(erc-scenarios-log--write-after-insert): New test.  (Bug#76875)
2025-03-11 18:28:38 -07:00
Stefan Monnier
40d8650d51 (Freplace_buffer_contents): Preserve markers more carefully
Use `replace_range` rather than `delete+insert`.

* src/insdel.c (replace_range): Allow NEW to specify a chunk
of buffer text.
* src/editfns.c (Freplace_buffer_contents): Use it.
* test/src/editfns-tests.el (replace-buffer-contents-1): Remove
incorrect check which happened to succeed because point was not
preserved carefully enough.  Make the replacement text share a bit
more content to make the test a bit more strict.
(editfns-tests--replace-region): Doesn't fail any more.
2025-03-11 17:16:21 -04:00
Stefan Kangas
8ea65ac642 ; Temporarily disable proced tests on macOS (Bug#76898)
* test/lisp/proced-tests.el (proced-format-test, proced-update-test)
(proced-revert-test, proced-color-test): Disable tests on macOS.
2025-03-11 01:03:50 +01:00
Stefan Monnier
c4a2823166 (makefile-dependency-regex): Fix bug#76759
* lisp/progmodes/make-mode.el (makefile-dependency-regex):
Decompose the regexp to be more understandable, and then change
it so the target part can't accidentally match a TAB.

* test/lisp/progmodes/make-mode-tests.el (make-mode-tests--bug17400):
New test.
2025-03-09 22:07:39 -04:00
Stefan Kangas
731af8747c ; Fix byte-compiler warning 2025-03-09 18:29:01 +01:00
Stefan Kangas
ce03bf252a Make second arg to defvar-local optional
This change allows declaring a variable both special
and buffer-local like so:

    (defvar-local foo)

* lisp/subr.el (defvar-local): Make second argument optional.
* test/lisp/subr-tests.el (subr-test-defvar-local): New test.
* doc/lispref/variables.texi (Creating Buffer-Local): Document above change.
* etc/NEWS:

* lisp/mb-depth.el (minibuffer-depth-overlay):
* lisp/minibuf-eldef.el (minibuf-eldef-initial-input)
(minibuf-eldef-initial-buffer-length)
(minibuf-eldef-showing-default-in-prompt, minibuf-eldef-overlay):
* lisp/misc.el (list-dynamic-libraries--loaded-only-p):
* lisp/simple.el (minibuffer-history-isearch-message-overlay): Use
above new one-argument form of 'defvar-local'.
2025-03-09 18:24:22 +01:00
Stefan Kangas
87db670d04 Make locate-user-emacs-file accept a list too
This can be used to migrate to a new name, while also keeping
backwards-compatible support for an old name.

* lisp/files.el (locate-user-emacs-file): Accept a list as the
NEW-NAME argument.
* test/lisp/files-tests.el (files-test-locate-user-emacs-file): New
test for the above.
2025-03-09 18:24:21 +01:00
Stefan Kangas
9c6e8589ee Add test for 'locate-user-emacs-file'
* test/lisp/files-tests.el
(files-test-locate-user-emacs-file): New test.
2025-03-09 18:24:21 +01:00