* lisp/files.el (basic-save-buffer-2): Call 'set-file-modes' to
try to make the file writable, even if
'set-file-extended-attributes' succeeded. (Bug#66546)
* lisp/files.el (find-alternate-file-dont-kill-client): New var.
(find-alternate-file): Bind it to a special value when invoking
kill-buffer-hook.
* lisp/server.el (server-delete-client): If NOFRAME is
'dont-kill-client', don't kill the client and its terminals.
(server-buffer-done): Pass 'find-alternate-file-dont-kill-client'
to 'server-delete-client'. (Bug#65277)
* lisp/org/ob-tangle.el (org-babel-interpret-file-mode):
Repair parts of regexp that should only match +, - and =.
* lisp/files.el (file-modes-symbolic-to-number):
Fix the same error in a doc string; this seems to be where
the mistake originated.
* doc/lispref/files.texi (Reading from Files): Document new
`if-regular' value of REPLACE.
* etc/NEWS: Announce the new value.
* lisp/files.el (basic-save-buffer-2): Demote errors saving
backup files, since FIFOs cannot be copied.
(revert-buffer-insert-file-contents--default-function): Supply
`if-regular' instead of t as REPLACE.
* src/fileio.c (selinux_enabled_p): New function.
(Fcopy_file, Ffile_selinux_context, Fset_file_selinux_context):
Call that function to ascertain if SELinux applies to a file.
(read_non_regular): Don't assume `emacs_fd_read' always returns
int.
(Finsert_file_contents): If REPLACE is if-regular and FILENAME
is a special non-seekable file, fall back to erasing the buffer
before inserting the contents of that file.
(syms_of_fileio) <Qif_regular>: New symbol.
* src/fileio.c (Fdelete_file_internal): Expand file name here, as
all primitives must.
(internal_delete_file): Adjust to the fact that Fdelete_file was
renamed.
* lisp/files.el (delete-file): Don't expand-file-name here, as
the called primitives already do. Fix typo in doc string.
src/fileio.c: (delete-file-internal) Renamed from delete-file,
parallel to delete-directory-internal; policy
code moved to Lisp.
src/files.el: (delete-file) New function, holds policy logic.
calls delete-file-internal.
This is a pure refactoring step, delete-file's behavior is
unchanged. But the C core is a little simpler now.
This bug happened because rmail.el relied on 'revert-buffer' to
return non-nil when it succeeds to revert, but a recent change
in 'revert-buffer' broke that promise in Emacs 29.1.
* lisp/files.el (revert-buffer--default, revert-buffer): Doc fix.
(revert-buffer): Return whatever 'revert-buffer-function' returns.
(Bug#65071)
Previously, uniquify--create-file-buffer-advice would use the filename
of the buffer to calculate what the buffer's basename should be. Now
that gets passed in from create-file-buffer, which lets us fix several
bugs:
1. before this patch, if a buffer happened to be named the same thing
as directory in its default-directory, the buffer would get renamed
with a directory separator according to uniquify-trailing-separator-p.
2. buffers with a leading space should get a leading |, as described
by create-file-buffer's docstring; before this patch, uniquify would
remove that leading |.
* lisp/dired.el (dired-internal-noselect): Pass a directory name to
create-file-buffer.
* lisp/files.el (create-file-buffer): Do uniquify-trailing-separator-p
handling if passed a directory filename. (bug#62732)
* lisp/uniquify.el (uniquify-item):
(uniquify-rationalize-file-buffer-names, uniquify-rationalize,
uniquify-get-proposed-name, uniquify-rationalize-conflicting-sublist):
Remove uniquify-trailing-separator-p handling.
(uniquify--create-file-buffer-advice): Take new basename argument and
use it, instead of recalculating the basename from the filename.
* lisp/files.el (file-remote-p):
* doc/lispref/files.texi (Magic File Names): Document 'never' for
CONNECTED argument.
* lisp/net/tramp.el (tramp-handle-file-remote-p): Handle CONNECTED
value of 'never'.
* lisp/eshell/esh-ext.el (eshell-explicit-remote-commands): New
option.
(eshell-ext-initialize): Apply 'eshell-handle-remote-command' when
requested.
(eshell-handle-remote-command): New function.
(eshell-remote-command): Reimplement this function and dispatch to
'eshell-external-command', which can handle remote processes on its
own.
* test/lisp/eshell/esh-ext-tests.el
(esh-ext-test/explicitly-remote-command)
(esh-ext-test/explicitly-local-command): New tests.
* doc/misc/eshell.texi (Remote Access): Document explicitly-remote
commands.
* etc/NEWS: Announce this change.
* doc/lispref/files.texi (Testing Accessibility): Clarify the
value of remote-file-name-access-timeout.
* etc/NEWS: Clarify the value of remote-file-name-access-timeout.
* lisp/files.el (remote-file-name-access-timeout): Adapt docstring.
* lisp/net//tramp.el (with-tramp-timeout): Ensure, that the
timeout is a positive number, or nil.
(tramp-handle-access-file): Simplify code.
This variable can be set to automatically load risky dir-local
variables from a list of trusted directories.
* lisp/emacs-lisp/files.el (safe-local-variable-directories,
hack-local-variables-filter, hack-local-variables-confirm): New
variable and associated logic.
* test/lisp/files-tests.el
(files-tests-safe-local-variable-directories): Add tests for same.
* doc/emacs/custom.texi (Safe File Variables): Add documentation for
same.
* doc/lispref/variables.texi (File Local Variables): Add documentation
for same.
* etc/NEWS (Lisp Changes in Emacs 30.1): Add news entry for
same. (Bug#61901)
* lisp/files.el (remote-file-name-inhibit-locks): Fix docstring.
* lisp/userlock.el (userlock--handle-unlock-error):
Display warning only when `create-lockfiles' is non-nil. (Bug#62614)
* lisp/net/tramp.el (tramp-handle-unlock-file): Raise a warning
only when `create-lockfiles' is non-nil or
`remote-file-name-inhibit-locks' is nil.
836044f329 Fix c-ts-mode preproc directive indentation
64980a59b6 ; * lisp/files.el (hack-local-variables): Fix typo in the...
a7cd125d49 More robustly unspoof HOME in Eglot tests (bug#61637)
6c66dbd02c Turn on Eglot inlay hints by default
246f5b541c Update ts modes missed in 4c16fd3a51 to use column-0
0bfba49ca7 Robustify Eglot for "transient" projects
ea5fd375bb Fix documentation of 'normal-mode' in buffers that don't ...
4c16fd3a51 Change tree-sitter indent anchor 'point-min' to 'column-0'
f47b393015 Fix go-ts-mode multi-line string indentation (bug#61923)
e0bf2da3db ; More accurate doc strings for 'window-at' and 'window-a...
* java/org/gnu/emacs/EmacsService.java (checkContentUri):
Improve debug output.
* lisp/files.el (basic-save-buffer): Check whether or not file
itself exists before checking for the existence of the directory
containing it.
* src/android.c (android_open): Don't forget to set errno after
open_content_uri fails.
b0cbd5590b Eglot: simplify inlay hints implementation with jit-lock
91e24c5b5a Eglot: update inlay hints on window configuration changes
79fead1709 ; Fix a typo in a doc string in c-ts-common.el (bug#61736).
a0b273ef30 ; Clarify documentation of 'file-modes-number-to-symbolic'
5c2be6a263 ; Fix recently-added doc strings in eglot.el
e3be0dbf85 Eglot: display completion label when safe
5286111ea1 Improve documentation of VC commands, including in Dired
990f402713 * doc/emacs/maintaining.texi: More mentions of marked fil...
* doc/lispref/files.texi (Changing Files):
* lisp/files.el (file-modes-number-to-symbolic): Clarify the
confusion with "symbolic" forms of file modes. (Bug#61709)