1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 14:30:50 -08:00
Commit graph

2395 commits

Author SHA1 Message Date
Eli Zaretskii
521e06d3ef Merge from origin/emacs-30
53aac6aecd ; Improve documentation of commands that split current wi...
2025-10-18 06:15:46 -04:00
Eli Zaretskii
53aac6aecd ; Improve documentation of commands that split current window
* doc/emacs/sending.texi (Sending Mail):
* doc/emacs/dired.texi (Dired Enter, Dired Visiting):
* doc/emacs/maintaining.texi (Old Revisions)
(Change Log Commands, Looking Up Identifiers):
* doc/emacs/windows.texi (Displaying Buffers):
* doc/emacs/files.texi (Visiting): Add cross-references to where
user options are described which control how windows are split.

* lisp/mail/sendmail.el (mail-other-window):
* lisp/gnus/message.el (message-mail-other-window)
(message-news-other-window):
* lisp/replace.el (occur-mode-goto-occurrence-other-window):
* lisp/vc/vc.el (vc-revision-other-window):
* lisp/vc/vc-dir.el (vc-dir-find-file-other-window):
* lisp/progmodes/xref.el (xref-find-definitions-other-window):
* lisp/simple.el (compose-mail-other-window)
(clone-indirect-buffer-other-window):
* lisp/vc/add-log.el (add-change-log-entry-other-window):
* lisp/view.el (view-file-other-window)
(view-buffer-other-window):
* lisp/window.el (switch-to-buffer-other-window):
* lisp/files.el (find-file-other-window)
(find-file-read-only-other-window)
(find-alternate-file-other-window):
* lisp/dired.el (dired-other-window)
(dired-mouse-find-file-other-window)
(dired-find-file-other-window, dired-jump-other-window): Mention
in the doc strings how to control the way the current window is
split.
2025-10-18 10:47:29 +03:00
Sean Whitton
208241aa83 Update VC-Dir contents upon revert-buffer
* lisp/vc/vc-hooks.el (vc-after-revert): New function.
(after-revert-hook): Add it.
2025-10-16 17:19:43 +01:00
Stefan Monnier
39d711696a (remote-shell-program): Simplify
* lisp/files.el (remote-shell-program): Don't bother looking
for the full file name of the `ssh` executable, since all users
end up looking it up in `load-path` anyway.
2025-10-15 16:30:59 -04:00
Sean Whitton
b5cf0786a2 New command vc-kill-other-working-tree-buffers
* lisp/vc/vc.el (vc-kill-other-working-tree-buffers): New
command.
* lisp/vc/vc-hooks.el (vc-prefix-map): Bind it.
* doc/emacs/vc1-xtra.texi (Other Working Trees):
* etc/NEWS: Document it.
2025-10-01 20:51:57 +01:00
Jostein Kjønigsen
6b42b974ce 'nxml-mode': add schema for .NET SLNX files.
SLNX is a new XML-based file-format for .NET based solutions, replacing
the older proprietary SLN file-format.

Unlike SLN-files, it is merge-friendly and expected to become the new
de-facto standard for working with .NET projects.  This commit adds
support for SLNX-schema to 'nxml-mode'.

The schme provided has been synthesized using the official XSD-schema
definition:
https://github.com/microsoft/vs-solutionpersistence/blob/main/src/Microsoft.VisualStudio.SolutionPersistence/Serializer/Xml/Slnx.xsd

This schema was then converted to RNG using XSDtoRNG.xsl:
https://github.com/epiasini/XSDtoRNG

The RNG schema was then converted to RNC using the trang CLI-tool:
https://relaxng.org/jclark/trang.html

* etc/schema/dotnet-slnx.rnc: New file.
* etc/schema/schemas.xml: Add Slnx schema.

* lisp/files.el (auto-mode-alist): Add association for SLNX files.
(Bug#79379)
2025-09-06 12:27:29 +03:00
Eli Zaretskii
467c75893c ; Fix defcustom type
* lisp/files.el (lock-file-name-transforms): Fix the 'defcustom'
type.  (Bug#79322)
2025-08-30 13:22:05 +03:00
Eli Zaretskii
8e9277042c Use better temporary file names under 'file-precious-flag'
* lisp/files.el (basic-save-buffer-2): Use a more meaningful
temporary file name under 'file-precious-flag'.  (Bug#79252)

* etc/NEWS: Announce the change in behavior.
2025-08-23 15:09:31 +03:00
Eli Zaretskii
210bcf1366 ; * lisp/files.el (revert-buffer-in-progress): Fix compiler warning. 2025-08-09 16:56:32 +03:00
Michael Albinus
1fc4bb1fea Rename variables *-in-progress-p to *-in-progress
* doc/lispref/backups.texi (Reverting): Fix variable names
revert-buffer-in-progress and auto-revert-buffer-in-progress.

* etc/NEWS: Fix variable names revert-buffer-in-progress and
auto-revert-buffer-in-progress.
Presentational fixes and improvements.

* lisp/autorevert.el (auto-revert-buffer-in-progress): Rename.
(auto-revert-handler, auto-revert-buffer): Use renamed variables.

* lisp/dired-x.el (dired-omit-expunge):
Use `auto-revert-buffer-in-progress'.

* lisp/files.el (revert-buffer-in-progress): Rename.
(revert-buffer-in-progress-p): Declare obsolete.
(after-find-file, revert-buffer):
* lisp/saveplace.el (save-place-find-file-hook)
(save-place-dired-hook):
* lisp/vc/vc-git.el (vc-git-command, vc-git--out-ok):
* lisp/vc/vc.el (vc-diff-internal):
Use `revert-buffer-in-progress'.

* lisp/net/tramp-sh.el (tramp-sh-handle-vc-registered): Suppress warning.
2025-08-09 14:21:23 +02:00
Martin Rudalics
ca07819af7 ; * lisp/files.el (find-file-noselect): Fix doc-string typo. 2025-08-06 09:29:41 +02:00
Eli Zaretskii
0c77c5edfd Merge from origin/emacs-30
477335a10b ; Fix documentation of 'find-file-noselect'
9e3720bbb1 * doc/misc/gnus.texi (Category Syntax): Update gnus-agent...
456f44a7b3 ; Improve documentation of change hooks
f20d5e63bc ; * lisp/image.el (image-supported-file-p): Doc fix (bug#...
8ec2ddebdd ; Update documentation of GC in ELisp manual
57a9798c22 Prefer "tls" to "ssl" in documentation
2025-08-02 11:13:41 -04:00
Eli Zaretskii
477335a10b ; Fix documentation of 'find-file-noselect'
* doc/lispref/files.texi (Visiting Functions):
* lisp/files.el (find-file-noselect): Document that NOWARN non-nil
also bypasses the file's last change verification.  (Bug#79127)
2025-08-02 17:33:15 +03:00
Juri Linkov
87ea884748 Minor image-convert file types related changes (bug#79109)
* lisp/files.el (auto-mode-alist): Add ".avif" to the list of
image file types supported by 'image-convert'.
Remove duplicate entry for ".webp" that was added at the top
in the list of natively supported image types.

* lisp/image.el (imagemagick-enabled-types): Add AVIF and
WEBP (the latest for the case when native libs are not installed).

* lisp/image/image-converter.el (image-converter--converters):
Add "-layers merge" to the imagemagick convert command line.
2025-07-29 09:42:21 +03:00
Michael Albinus
5a7a12d792 Add function exec-suffixes
* doc/lispref/processes.texi (Subprocess Creation):
Add function exec-suffixes.

* etc/NEWS: New function 'exec-suffixes'.
Presentational fixes and improvements.

* lisp/files-x.el (exec-suffixes): New defun.  (Bug#78886)

* lisp/files.el (executable-find): Use function `exec-suffixes'.

* lisp/net/tramp-integration.el
(tramp-connection-local-default-system-variables): Add also
`exec-suffixes'.

* lisp/net/tramp-smb.el (tramp-smb-maybe-open-connection): Use
default values of `path-separator', `null-device' and
`exec-suffixes'.
(tramp-smb-connection-local-default-system-variables):
New defconst.  Add it to connection-local profiles.
2025-07-22 17:47:38 +02:00
Paul Eggert
b282cb98e4 Avoid syscall in dir-locals--all-files
* lisp/files.el (dir-locals--all-files):
Omit an unnecessary call to file-directory-p.
2025-07-16 11:45:23 -07:00
Paul Eggert
2074951c2a Avoid some syscalls in locate-dominating-file
* lisp/files.el (locate-dominating-file): Do not call
file-directory-p each time through a loop ascending the directory
hierarchy, as the file must be a directory after the first loop
iteration.  Instead, call file-directory-p just once, before the
loop starts, and do this only if the file name is not already that
of a directory.
2025-07-16 11:45:23 -07:00
Paul Eggert
b911029f96 Fix (find-file "/dev/null")
* lisp/files.el (find-file-noselect-1): When the file exists,
propagate any errors signaled by insert-file-contents,
instead of propagating them only when the file is unreadable.
This way, (find-file "/dev/null") gives a sensible diagnostic
"not a regular file" instead of the nonsense
"Maximum buffer size exceeded".
2025-07-13 21:09:39 -07:00
Eli Zaretskii
131cde2f86 Merge from origin/emacs-30
6299eb0fe5 bug#78901: [PATCH] js-ts-mode: Fix auto-mode-alist regexp
982938363a Merge branch 'emacs-30' of git.sv.gnu.org:/srv/git/emacs ...
e68ad70af6 Fix 'insert-directory' in Turkish language-environment
f805f51373 Fix job control in remote shell
039ad15373 ; * doc/emacs/package.texi (Package Statuses): Clarify "n...
2025-06-28 06:57:19 -04:00
Eli Zaretskii
e68ad70af6 Fix 'insert-directory' in Turkish language-environment
* lisp/files.el (insert-directory-clean, insert-directory): Use
case-sensitive search for "//DIRED//" and similar strings.
(Bug#78894)
2025-06-25 12:17:59 -04:00
Pip Cet
f69b822fb0 Print a message when failing to recover a file
* lisp/files.el (recover-session-finish): Call 'message' rather than
evaluating a string and a variable without using the result.
2025-06-10 14:11:58 +00: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
Eli Zaretskii
1224e5fd96 ; * lisp/files.el (revert-buffer-restore-functions): Doc fix (bug#78124). 2025-04-29 21:28:01 +03:00
Eli Zaretskii
4858d81848 ; * lisp/files.el (revert-buffer-restore-functions): Doc fix. 2025-04-29 09:39:34 +03:00
Sean Whitton
d047a89e76 vc-diff: Delete redundant call to vc-maybe-buffer-sync
This call is redundant with the subsequent call to
vc-buffer-sync-fileset.  I believe this call to
vc-maybe-buffer-sync was reintroduced by accident -- the
changeset adding the call to vc-buffer-sync-fileset deleted a
call to vc-sync-fileset in the same place.

* lisp/vc/vc.el (vc-diff): Delete redundant call to
vc-maybe-buffer-sync.
* lisp/files.el (find-buffer-visiting): Note in docstring that
this function only ever returns base buffers.
2025-04-27 11:52:53 +08:00
Eli Zaretskii
e0c7b6e31e Fix warning messages about lexbind cookie in subdirs.el
* lisp/files.el (internal--get-default-lexical-binding): Don't log
a warning message when lexbind warning is disabled, and
'display-warning' is unavailable or signals an error.
2025-04-13 16:35:49 +03:00
Stefan Monnier
7ff674d712 (internal--get-default-lexical-binding): Be more failsafe
* lisp/files.el (internal--get-default-lexical-binding): Try and
avoid signaling an error.  Make it easier to suppress the
warning for a specific file.
2025-04-08 13:10:30 -04:00
Stefan Monnier
19257efbf7 lisp/files.el (internal--get-default-lexical-binding): Buttonize the M-x 2025-04-07 23:24:21 -04:00
Stefan Monnier
9dc6177206 lisp/files.el (internal--get-default-lexical-binding): Handle nested loads 2025-04-07 22:48:01 -04:00
Stefan Monnier
9f25d46568 (Fload, Feval_buffer): Emit a warning when lexbind is unset (bug#74145)
This emits a warning at run-time rather than at compile time.

* src/lread.c (get_lexical_binding): New function.
(Fload, Feval_buffer): Use it.
(syms_of_lread): New var `internal--get-default-lexical-binding-function`.
* lisp/files.el: Set it.
(internal--get-default-lexical-binding): New function.
2025-04-07 21:41:35 -04:00
Stefan Monnier
468c2aebae Replace uses of replace-buffer-contents
* lisp/vc/vc.el (vc-diff-restore-buffer):
* lisp/progmodes/python.el (python--do-isort):
* lisp/progmodes/eglot.el (eglot--apply-text-edits):
* lisp/files.el (revert-buffer-insert-file-contents-delicately):
* lisp/json.el (json-pretty-print): Use `replace-region-contents`.
2025-03-29 17:49:49 -04:00
Eli Zaretskii
cedefabfcf ; Fix last change
* lisp/files.el (auto-mode-alist):
* etc/NEWS: Fix last change.  (Bug#77138)
2025-03-29 13:22:11 +03:00
Konstantin Kharlamov
891f51fe11 Add major mode for highlighting npmrc files (Bug#77138)
* etc/NEWS: mention the new mode.
* lisp/textmodes/conf-mode.el (conf-npmrc-mode-syntax-table): New
variable.
* lisp/textmodes/conf-mode.el (conf-npmrc-mode): New major mode
derived from conf-mode for highlighting .npmrc files.
* lisp/files.el (auto-mode-alist): Associate the new mode with .npmrc
files.
2025-03-29 13:19:04 +03: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
Juri Linkov
7016d1c8e3 * lisp/files.el (save-some-buffers-action-alist): Fix 'view-mode'.
Use 'view-mode-enter' instead of 'view-buffer' to ignore the 'special'
mode-class that prevents some modes from binding 'q' to 'exit-action'
that should call 'exit-recursive-edit' (bug#76745).
2025-03-19 21:09:10 +02: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
Eli Zaretskii
a6abb88fdc ; * lisp/files.el (executable-find): Doc fix. 2025-03-12 14:53:03 +02:00
Sean Whitton
22db8a2c2a Merge from origin/emacs-30
2029104605 Correct some outdated docs for hack-local-variables
2025-03-12 10:09:45 +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
2029104605 Correct some outdated docs for hack-local-variables
* doc/lispref/variables.texi (File Local Variables):
<hack-local-variables>: Say that it applies directory-local
variables too.  Add a cross-reference.
(Directory Local Variables): Document dir-local-variables-alist.
* lisp/files.el (hack-local-variables): Say that it always puts
into effect directory-local variables.
2025-03-12 10:05:32 +08: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
Eli Zaretskii
59d1aac49d Document return values of the various read-* functions
* lisp/textmodes/string-edit.el (read-string-from-buffer):
* lisp/simple.el (read-from-kill-ring, read-shell-command)
(read-signal-name):
* lisp/replace.el (read-regexp-case-fold-search):
* lisp/auth-source.el (read-passwd):
* lisp/subr.el (read-key, read-number):
* lisp/minibuffer.el (read-file-name, read-no-blanks-input):
* lisp/international/mule-cmds.el (read-multilingual-string):
* lisp/language/japan-util.el (read-hiragana-string):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-mode, read-file-local-variable-value):
* lisp/faces.el (read-face-font, read-face-name):
* lisp/simple.el (read-extended-command):
* lisp/env.el (read-envvar-name):
* lisp/files.el (read-directory-name):
* lisp/faces.el (read-color):
* lisp/international/mule-diag.el (read-charset):
* lisp/emacs-lisp/map-ynp.el (read-answer):
* src/coding.c (Fread_coding_system)
(Fread_non_nil_coding_system):
* src/minibuf.c (Fread_command, Fread_from_minibuffer):
* src/lread.c (Fread_char, Fread_char_exclusive, Fread_event): Doc
fixes.
2025-03-09 15:02:39 +02:00
Stefan Monnier
504bdce731 (set-auto-mode--find-matching-alist-entry): Fix bug#75961
* lisp/files.el (set-auto-mode--find-matching-alist-entry): Run the
MODE found in (REGEXP MODE t) before we replace it with something else.

* test/lisp/files-tests.el (files-tests--bug75961): New test.
2025-02-16 11:51:22 -05:00
Stefan Monnier
300bae4f7c Fix some uses of %s for non-strings/names
* lisp/files.el (normal-mode, set-auto-mode--apply-alist):
* lisp/gnus/nnimap.el (nnimap-command):
* lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-type):
Prefer %S over %s for arbitrary sexps and lists.
2025-02-14 11:25:52 -05:00
Stefan Kangas
069c8ff6d5 Improve read-directory-name docstring
* lisp/files.el (read-directory-name): Improve docstring to be more
similar to that of 'read-file-name', and refer back to it where
appropriate.
2025-02-13 08:47:10 +01:00
Joseph Turner
3f1d84d593 Add optional PREDICATE argument to read-directory-name
* lisp/files.el (read-directory-name): Add optional PREDICATE argument.
* doc/lispref/minibuf.texi (Reading File Names): Document above change.
(Bug#66224)
2025-02-13 08:32:28 +01:00
Eli Zaretskii
d58fe6619f Merge from origin/emacs-30
ba27193895 ; * etc/NEWS: Fix wording.
fdc6842a44 Remove bookmark fringe marks when deleting all bookmarks
3bccd04c5c Improve wording in symbols.texi
6441b9ea7a Fix typo in Gnus manual
87be3aa149 eglot: Allow omnisharp binary to be capitalized "OmniSharp"
5485ea6aef Do not set `trusted-content` in major modes
d11488fd6f ; * lisp/subr.el (sit-for): Doc fix.

# Conflicts:
#	etc/NEWS
2025-02-01 07:40:19 -05:00
Stefan Kangas
bf97946d7d Merge branch 'scratch/no-purespace' into 'master' 2025-02-01 04:56:52 +01:00
Stefan Kangas
5485ea6aef Do not set trusted-content in major modes
* lisp/progmodes/elisp-mode.el (lisp-interaction-mode):
* lisp/ielm.el (inferior-emacs-lisp-mode): Do not set `trusted-content.
* lisp/ielm.el (ielm):
* lisp/simple.el (get-scratch-buffer-create): Set `trusted-content` here
instead.
* lisp/files.el (trusted-content): Doc fix; warn against setting this
option to :all in a major or mode mode.
Problem reported by Max Nikulin <manikulin@gmail.com>.
2025-01-31 01:50:22 +01:00
Stefan Monnier
4fada67748 (hack-one-local-variable): Refine last patch (bug#74964)
* lisp/files.el (hack-local-variables--inhibit-eval): Rename from
`hack-local-variables--inhibit`.
(hack-one-local-variable): Skip only those eval forms we're already
in the process of evaluating.
2025-01-17 08:43:50 -05:00