Commit graph

2307 commits

Author SHA1 Message Date
Michael Albinus
0218fb2143 Adapt file-remote-p doc
* doc/lispref/files.texi (Magic File Names): Adapt file-remote-p.

* lisp/files.el (file-remote-p): Adapt docstring.
2024-07-19 18:29:49 +02:00
Daniel Martín
ec1e300a21 Fix reference from buffer-stale-function docstring
* lisp/files.el (buffer-stale-function): Fix reference to a
non-existent Info node in doc string.  (Bug#72049)
2024-07-11 07:45:07 +03:00
Stefan Kangas
5cf8d60e0d Capitalize "Dired" and "Lisp" in docstrings
* lisp/desktop.el (desktop-no-desktop-file-hook):
* lisp/dired-x.el (dired-mark-sexp):
* lisp/dired.el (dired-make-directory-clickable)
(dired-map-over-marks, dired-file-name-at-point)
(dired-save-positions, dired-buffers-for-dir)
(dired-buffers-for-dir-or-subdir, dired-fun-in-all-buffers)
(dired-remove-entry, dired-delete-entry, dired-jump):
* lisp/files.el (save-buffer):
* lisp/find-dired.el (find-ls-option):
* lisp/hilit-chg.el:
* lisp/locate.el (locate-mode):
* lisp/msb.el (msb-dired-item-handler, msb-sort-by-directory):
* lisp/printing.el (pr-ps-printer-alist, pr-ps-utility-alist):
* lisp/uniquify.el (uniquify-trailing-separator-p):
* lisp/wdired.el (wdired, wdired-change-to-dired-mode, wdired-exit):
* lisp/woman.el (woman-dired-define-keys, woman-dired-find-file):
Capitalize "Dired" and "Lisp" in docstrings.  Found with checkdoc.
2024-07-10 00:36:19 +02:00
Juri Linkov
b249f022f1 * lisp/files.el (insert-directory): Quote switches in wildcard case.
Use shell-quote-wildcard-pattern on the switches string split by
split-string-and-unquote.  This helps to quote such switches as
"--block-size='1" (bug#71935).
2024-07-07 09:57:34 +03:00
Juri Linkov
8911d53ce5 Fix uses of 'dired-omit-mode' (bug#71905)
* lisp/dired.el (dired-jump): Disable dired-omit-mode with -1.

* lisp/files.el (recover-session): Disable dired-omit-mode
explicitly afterwards instead of modifying dired-mode-hook
that fails when it contains a lambda.
2024-07-07 09:52:01 +03:00
Eli Zaretskii
d190cb0e88 Fix file-name detection in Dired under -F
* lisp/files.el (insert-directory-clean): Support all the symbols
appended to file names by the -F/--classify option of 'ls'.  See
https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg00366.html
for the details.
2024-07-05 13:58:11 +03:00
Stefan Monnier
8253228d55 (hack-dir-local-get-variables-functions): New hook
Make it possible to provide more dir-local variables, such as
done by the Editorconfig package.

* lisp/files.el (hack-dir-local--get-variables): Make arg optional.
(hack-dir-local-get-variables-functions): New hook.
(hack-dir-local-variables): Run it instead of calling
`hack-dir-local--get-variables`.

* doc/lispref/variables.texi (Directory Local Variables):
Document the new hook.
2024-06-09 00:20:50 -04:00
Juri Linkov
a525cfb3af New variable 'revert-buffer-restore-functions' (bug#69511)
* doc/lispref/backups.texi (Reverting):
Add documentation for 'revert-buffer-restore-functions'.

* lisp/files.el (revert-buffer-restore-functions): New variable.
(revert-buffer-restore-read-only): New function.
(revert-buffer): Use 'revert-buffer-restore-functions' with
the default value 'revert-buffer-restore-read-only' (bug#69511).

* lisp/buff-menu.el (Buffer-menu-mode): Add hook
'revert-buffer-restore-functions' to restore
outline-minor-mode highlighting.
2024-06-03 19:55:47 +03:00
Stefan Kangas
69a9fdd6bb Use scheme-mode for the Guile init file
* lisp/files.el (auto-mode-alist): Use `scheme-mode` for the Guile
init file (~/.guile).
2024-05-29 23:29:44 +02:00
Alan Mackenzie
0999c64fa8 Correct and clarify two doc strings in lisp/files.el
lisp/files.el (major-mode-remap-alist)
(major-mode-remap-defaults): Correct and clarify the doc
strings.
2024-05-28 20:12:17 +00:00
Andrea Corallo
6e1bb713f6 Change 'type' declaration to 'ftype'
* lisp/window.el (get-lru-window, get-largest-window)
(one-window-p): Update function type declaration.
* lisp/subr.el (ignore, error, zerop, fixnump, bignump, lsh)
(last, eventp, mouse-movement-p, log10, memory-limit)
(internal-pop-keymap): Likewise.
* lisp/simple.el (count-lines, mark, string-empty-p): Likewise.
* lisp/files.el (parse-colon-path): Likewise.
* lisp/env.el (getenv): Likewise.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt): Likewise.
* lisp/emacs-lisp/lisp.el (buffer-end): Likewise.
* lisp/emacs-lisp/comp.el (comp--final): Likewise.
* lisp/custom.el (custom-variable-p): Likewise.
* lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Rename 'type'
-> 'ftype'.
2024-05-14 11:17:25 +02:00
Andrea Corallo
da8b06bd61 Merge branch 'lisp-func-type-decls' into 'master' 2024-05-02 17:06:07 +02:00
Ihor Radchenko
bf00762745 Improve performance of `file-truename' (bug#70036)
* lisp/files.el (file-truename): Avoid repetitive calls to
`file-name-nondirectory'.  These calls contribute
significantly to CPU time.  See the benchmarks in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70036#47
2024-05-02 12:39:39 +03:00
Andrea Corallo
fa0bf96837 Move lisp function arg type declarations to the functions itself
* lisp/emacs-lisp/comp-common.el (comp-primitive-type-specifiers):
Remove type declaration of lisp functions.
* lisp/window.el (get-lru-window, get-largest-window)
(one-window-p): Declare type.
* lisp/subr.el (ignore, error, zerop, fixnump, bignump, lsh)
(last, eventp, mouse-movement-p, log10, memory-limit)
(interactive-p): Likewise.
* lisp/simple.el (count-lines, mark, lax-plist-get): Likewise.
* lisp/files.el (parse-colon-path): Likewise.
* lisp/env.el (getenv): Likewise.
* lisp/emacs-lisp/regexp-opt.el (regexp-opt): Likewise.
* lisp/emacs-lisp/lisp.el (buffer-end): Likewise.
* lisp/emacs-lisp/comp.el (comp-hint-fixnum, comp-hint-cons): Likewise.
* lisp/custom.el (custom-variable-p): Likewise.
2024-04-29 19:27:28 +02:00
Michael Albinus
956821672e Support remote trash-directory
* doc/misc/tramp.texi (Frequently Asked Questions): Describe how
to manipulate trash-directory.
Explain tramp-inhibit-errors-if-setting-file-attributes-fail.

* lisp/files.el (move-file-to-trash): Use connection-local value
of `trash-directory'.  (Bug#70421)
2024-04-23 13:54:09 +02:00
Juri Linkov
d51b0d2ebe * lisp/files.el (find-alternate-file): Fix the order of restoring buffer.
Swap the order of restoring original buffer's file names and
restoring original's buffer name with 'rename-buffer' (bug#68235).
2024-04-22 09:45:40 +03:00
Martin Rudalics
9a79db506e Make 'buffer-last-name' work better after 'find-alternate-file' (Bug#68235)
* lisp/files.el (find-alternate-file): Before killing the previous
buffer, try to restore its name and filenames (Bug#68235).
2024-04-15 11:17:51 +02:00
Eli Zaretskii
cd60fa42f6 Merge from origin/emacs-29
7a5d7be52c org--confirm-resource-safe: Fix prompt when prompting in ...
2bc865ace0 org-file-contents: Consider all remote files unsafe
6f9ea396f4 org-latex-preview: Add protection when `untrusted-content...
937b9042ad * lisp/gnus/mm-view.el (mm-display-inline-fontify): Mark ...
ccc188fcf9 * lisp/files.el (untrusted-content): New variable.
befa9fcaae org-macro--set-templates: Prevent code evaluation
3221d8d461 * admin/authors.el (authors-aliases): Add ignored authors.
8d8253f899 * etc/NEWS: Update for Emacs 29.3
2024-03-30 04:35:24 -04:00
Ihor Radchenko
ccc188fcf9 * lisp/files.el (untrusted-content): New variable.
The new variable is to be used when buffer contents comes from untrusted
source.
2024-03-24 08:39:27 -04:00
Stefan Monnier
9422a67374 (set-auto-mode): Streamline to fix bug#67795
The old code tested if the mode function is `fboundp` but in an
inconsistent way and without paying attention to
`major-mode-remap`.

* lisp/files.el (set-auto-mode-0): Return `:keep` rather than nil if
the mode was already set.  And emit a warning when the mode function
doesn't exist.
(set-auto-mode): Remove checks that the mode function exists now that
`set-auto-mode-0` does it for us.  Adjust to the new return values of
that function, and simplify the code using a big `or` instead of
a sequence of steps each setting&testing `done`.
(hack-local-variables--find-variables): Use `major-mode-remap`
when skipping the "mode:" entries that specify modes we don't have.
Also, when (eq handle-mode t), don't bother building a list of results
only to return a single element in the end.
2024-03-14 22:15:41 -04:00
Stefan Monnier
454a55dbd9 (dir-locals-collect-variables): Avoid spurious safety warnings
* lisp/files.el (dir-locals-collect-variables): Silence warnings for
extra parents' variables.
2024-03-09 10:29:06 -05:00
Stefan Monnier
2b5d43081a (major-mode-remap(-defaults)): New var and function (bug#69191)
While `major-mode-remap-alist` provides a way for users to indicate the
major mode of their choice, we need a similar variable for the
use of packages.

This patch adds a new `major-mode-remap-defaults` and changes various
packages to obey it or make use of it.
I think it nicely cleans the regexp duplication between CC-mode and
`c-ts-mode.el` and also makes it easier/cleaner for users to override
the changes made by `*-ts-mode.el`.

* lisp/files.el (major-mode-remap-defaults): New variable.
(major-mode-remap): New function.
(set-auto-mode-0): Use it.
* doc/lispref/modes.texi (Auto Major Mode): Document them.

* lisp/textmodes/tex-mode.el (tex--redirect-to-submode):
Use `major-mode-remap`.
(major-mode-remap-defaults): Set it to remap AUCTeX modes by default.
* lisp/progmodes/ruby-ts-mode.el (auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/progmodes/c-ts-mode.el (c-or-c++-ts-mode): Use `major-mode-remap`.
(auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/org/ox.el (org-export-to-buffer): Modernize docstring accordingly.
* lisp/progmodes/cc-mode.el (c-or-c++-mode):
* lisp/org/ox-latex.el (org-latex-export-as-latex):
* lisp/org/ox-koma-letter.el (org-koma-letter-export-as-latex):
* lisp/org/ox-beamer.el (org-beamer-export-as-latex):
Use `major-mode-remap` when available.
2024-03-03 23:58:18 -05:00
Eli Zaretskii
170c655792 Merge from origin/emacs-29
ae80192d97 ; * src/buffer.c (Fmake_indirect_buffer): Doc fix.
2549eabc97 Fix typos in vnvni.el.
647cecc853 ; * lisp/vc/vc.el (vc-clone): Fix wording of doc string.
383ccf6d51 Avoid assertion violations in bidi.c
b7cef701cb * lisp/files.el (hack-one-local-variable): Use `set-auto-...
0530800175 Fix infinite recursion in gdb-mi.el
2024-03-02 03:43:14 -05:00
Stefan Monnier
b7cef701cb * lisp/files.el (hack-one-local-variable): Use set-auto-mode-0
This fixes bug#69373.
2024-02-25 11:35:44 -05:00
Kévin Le Gouguec
c64e650fb3 Support shebang lines with amended environment
For bug#64939.

* lisp/files.el (auto-mode-interpreter-regexp): Account for possible
VARIABLE=[VALUE] operands.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Add an example from the coreutils manual.
2024-02-17 10:31:47 +02:00
Kévin Le Gouguec
ecb9641ecb Support more complex env invocations in shebang lines
This is not an exact re-implementation of what env accepts, but
hopefully it should be "good enough".

Example of known limitation: we assume that arguments for
--long-options will be set with '=', but that is not
necessarily the case.  '--unset' (mandatory argument) can be
passed as '--unset=VAR' or '--unset VAR', but
'--default-signal' (optional argument) requires an '=' sign.

For bug#64939.

* lisp/files.el (auto-mode-interpreter-regexp): Account for
supplementary arguments passed beside -S/--split-string.
* test/lisp/files-tests.el (files-tests-auto-mode-interpreter):
Test some of these combinations.
2024-02-17 10:31:14 +02:00
Eli Zaretskii
59b849d1ea Run 'read-only-mode-hook' when visiting a file that is not writable
* lisp/files.el (after-find-file): Run 'read-only-mode-hook'
when the visited file is not writable.  (Bug#68648)
2024-02-10 10:35:18 +02:00
Eli Zaretskii
8fc7e8c2b0 ; * lisp/files.el (hack-local-variables--find-variables): Fix comment. 2024-02-03 18:09:35 +02:00
João Távora
c2aaa8f15a Process read-symbol-shorthands from longest to shortest (bug#67390)
This ensures that overlapping shorthands are handled correctly and
consistently even if specified out-of-order by the user.

* doc/lispref/symbols.texi (Shorthands): Describe shorthand sort
order.

* lisp/files.el (hack-local-variables--find-variables): Specially
handle read-symbol-shorthands.
2024-02-03 08:40:03 -06:00
João Távora
5e4a0a29fa Make sure read-symbol-shorthands is permanently local
bug#63480, bug#67390

* lisp/files.el (permanently-enabled-local-variables): Add
  read-symbol-shorthands.
2024-02-03 08:40:03 -06:00
Augusto Stoffel
c12166de38 Use auth-info-mode for non-hidden authinfo and netrc files
* files.el (auto-mode-alist): Match non-hidden authinfo and netrc
files, since it is reasonable to store passwords in
~/.emacs.d/authinfo.gpg or a similarly named file.  (Bug#66241)
2024-01-10 23:07:09 +01:00
Po Lu
ecf08f0621 Merge from savannah/emacs-29
dc4e6b1329 ; Update copyright years in more files
64b3777631 ; Run set-copyright from admin.el
8e1c56ae46 ; Add 2024 to copyright years

# Conflicts:
#	doc/misc/modus-themes.org
#	doc/misc/texinfo.tex
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	etc/themes/modus-operandi-theme.el
#	etc/themes/modus-themes.el
#	etc/themes/modus-vivendi-theme.el
#	lib/alloca.in.h
#	lib/binary-io.h
#	lib/c-ctype.h
#	lib/c-strcasecmp.c
#	lib/c-strncasecmp.c
#	lib/careadlinkat.c
#	lib/cloexec.c
#	lib/close-stream.c
#	lib/diffseq.h
#	lib/dup2.c
#	lib/filemode.h
#	lib/fpending.c
#	lib/fpending.h
#	lib/fsusage.c
#	lib/getgroups.c
#	lib/getloadavg.c
#	lib/gettext.h
#	lib/gettime.c
#	lib/gettimeofday.c
#	lib/group-member.c
#	lib/malloc.c
#	lib/md5-stream.c
#	lib/md5.c
#	lib/md5.h
#	lib/memmem.c
#	lib/memrchr.c
#	lib/nanosleep.c
#	lib/save-cwd.h
#	lib/sha1.c
#	lib/sig2str.c
#	lib/stdlib.in.h
#	lib/strtoimax.c
#	lib/strtol.c
#	lib/strtoll.c
#	lib/time_r.c
#	lib/xalloc-oversized.h
#	lisp/auth-source-pass.el
#	lisp/emacs-lisp/lisp-mnt.el
#	lisp/emacs-lisp/timer.el
#	lisp/info-look.el
#	lisp/jit-lock.el
#	lisp/loadhist.el
#	lisp/mail/rmail.el
#	lisp/net/ntlm.el
#	lisp/net/webjump.el
#	lisp/progmodes/asm-mode.el
#	lisp/progmodes/project.el
#	lisp/progmodes/sh-script.el
#	lisp/textmodes/flyspell.el
#	lisp/textmodes/reftex-toc.el
#	lisp/textmodes/reftex.el
#	lisp/textmodes/tex-mode.el
#	lisp/url/url-gw.el
#	m4/alloca.m4
#	m4/clock_time.m4
#	m4/d-type.m4
#	m4/dirent_h.m4
#	m4/dup2.m4
#	m4/euidaccess.m4
#	m4/fchmodat.m4
#	m4/filemode.m4
#	m4/fsusage.m4
#	m4/getgroups.m4
#	m4/getloadavg.m4
#	m4/getrandom.m4
#	m4/gettime.m4
#	m4/gettimeofday.m4
#	m4/gnulib-common.m4
#	m4/group-member.m4
#	m4/inttypes.m4
#	m4/malloc.m4
#	m4/manywarnings.m4
#	m4/mempcpy.m4
#	m4/memrchr.m4
#	m4/mkostemp.m4
#	m4/mktime.m4
#	m4/nproc.m4
#	m4/nstrftime.m4
#	m4/pathmax.m4
#	m4/pipe2.m4
#	m4/pselect.m4
#	m4/pthread_sigmask.m4
#	m4/readlink.m4
#	m4/realloc.m4
#	m4/sig2str.m4
#	m4/ssize_t.m4
#	m4/stat-time.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/stdio_h.m4
#	m4/stdlib_h.m4
#	m4/stpcpy.m4
#	m4/strnlen.m4
#	m4/strtoimax.m4
#	m4/strtoll.m4
#	m4/time_h.m4
#	m4/timegm.m4
#	m4/timer_time.m4
#	m4/timespec.m4
#	m4/unistd_h.m4
#	m4/warnings.m4
#	nt/configure.bat
#	nt/preprep.c
#	test/lisp/register-tests.el
2024-01-02 10:28:14 +08:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Eli Zaretskii
06f2bb9c24 ; * lisp/files.el (find-buffer-visiting): Fix whitespace of last change. 2023-12-30 13:04:58 +02:00
Ihor Radchenko
46a93aa7b0 find-buffer-visiting: Fix test breakage introduced in b7a737ef49
* lisp/files.el (find-buffer-visiting): Fix code branch checking for
buffers referring to the same file number.  We should check the found
buffer with the file number, not current.

Link: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#412
2023-12-30 13:02:05 +02:00
Ihor Radchenko
b7a737ef49 Improve performance of `find-buffer-visiting' (bug#66117)
* src/buffer.c (Fget_truename_buffer): Expose `get_truename_buffer' to
Elisp.
(Ffind_buffer): New subr searching for a live buffer with a given
value of buffer-local variable.
(syms_of_buffer): Register the new added subroutines.
* src/filelock.c (lock_file): Use the new `Fget_truename_buffer' name.
* src/lisp.h:
* test/manual/etags/c-src/emacs/src/lisp.h: Remove no-longer-necessary
extern declarations for `get_truename_buffer'.
* lisp/files.el (find-buffer-visiting): Refactor, using subroutines to
search for buffers instead of slow manual Elisp iterations.
2023-12-30 09:53:46 +02:00
Stefan Monnier
2a8e6c8c84 (require-with-check): New function (bug#67696)
* lisp/files.el (require-with-check): New function.
* lisp/progmodes/eglot.el: Use it (and prefer #' to quote function names).
2023-12-29 11:17:51 -05:00
Stefan Monnier
93dea9288a Merge branch 'no-ls-lisp-advice' 2023-12-21 09:37:12 -05:00
Stefan Monnier
62bf0b7a57 Merge commit 'new-fix-for-bug-60819' 2023-12-20 18:36:26 -05:00
Visuwesh
c4541a3577 Offer to show diff against auto-save in recover-file
* lisp/files.el (recover-file): Show diff against the selected auto
save file.  (Bug#52242)

* doc/emacs/files.texi (Recover): Document the new feature.

* etc/NEWS: Announce the new feature.
2023-12-16 14:34:55 +02:00
Michael Albinus
1d5028ad04 dired-listing-switches handles connection-local values if exist
* doc/emacs/dired.texi (Dired Enter):
* doc/misc/tramp.texi (Frequently Asked Questions):
* etc/NEWS: 'dired-listing-switches' handles connection-local
values if exist.

* doc/lispref/variables.texi (Applying Connection Local Variables):
Fix decription of connection-local-default-application.

* lisp/dired.el (dired-listing-switches): Adapt docstring.
(dired-internal-noselect, dired-mode):
* lisp/dired-x.el (dired-virtual):
* lisp/files.el (recover-file, recover-session):
* lisp/net/ange-ftp.el (ange-ftp-get-files): Use connection-local
value of `dired-listing-switches'.

* lisp/files-x.el (connection-local-value): Adapt docstring.

* lisp/man.el (Man-shell-file-name): Use `connection-local-value'.
2023-12-10 12:26:38 +01:00
Stefan Monnier
29957969e5 (insert-directory): Remove ls-lisp advice
Rather than have `ls-lisp` advise `insert-directory`, make
`insert-directory` call `ls-lisp.el` code directly when needed.

* lisp/files.el (files--use-insert-directory-program-p): New function.
(insert-directory): Use it to delegate to `ls-lisp--insert-directory`
when applicable.

* lisp/ls-lisp.el (ls-lisp--insert-directory): Remove `orig-fun` arg.
Don't test `ls-lisp-use-insert-directory-program` or check for a magic
file name handler; it is now the caller's responsibility.
(insert-directory): Don't add advice any more.

* lisp/dired.el (ls-lisp-use-insert-directory-program): Don't declare it.
(dired-insert-directory): Use `files--use-insert-directory-program-p` instead.
(dired-use-ls-dired): Adjust docstring to refer to
`insert-directory-program` rather than "ls".
2023-12-09 23:45:56 -05:00
Stefan Monnier
6cc1418fc3 (file-expand-wildcards): Handle patterns ending in "/"
The bug was encountered via the ls-lisp advice on Dired but
it actually affects all uses of `file-expand-wildcards`,
so better fix it there.

* lisp/files.el (file-expand-wildcards): Fix bug#60819.
* lisp/ls-lisp.el (ls-lisp--dired): Undo commit b365a7cc32.
* test/lisp/files-tests.el (files-tests--expand-wildcards): New test.
2023-12-09 19:49:33 -05:00
Stefan Monnier
1da0fccc64 * lisp/files.el (file-expand-wildcards): Fix sorting of subdirs
E.g. (file-expand-wildcards "/u*/*m*")
returned ("/usr/games" "/u/dummy" "/u/monnier" "/u/omnibook-disk")
instead of ("/u/dummy" "/u/monnier" "/u/omnibook-disk" "/usr/games").
2023-12-09 18:42:36 -05:00
Kévin Le Gouguec
53bd2d57f3 Recognize shebang lines that pass '-S/--split-string' to 'env'
* etc/NEWS: announce the change.

* lisp/files.el (auto-mode-interpreter-regexp): Add optional '-S'
switch to the ignored group capturing the env invocation.
Allow multiple spaces between #!, interpreter and first argument:
empirically, Linux's 'execve' accepts that.  (Bug#66902)

* test/lisp/files-tests.el (files-tests--check-shebang): New helper to
generate a temporary file with a given interpreter line, and assert
that the mode picked by 'set-auto-mode' is derived from an expected
mode.  Write the 'should' form so that failure reports include useful
context; for example:

    (ert-test-failed
     ((should
       (equal (list shebang actual-mode) (list shebang expected-mode)))
      :form
      (equal ("#!/usr/bin/env -S make -f" fundamental-mode)
	     ("#!/usr/bin/env -S make -f" makefile-mode))
      :value nil :explanation
      (list-elt 1 (different-atoms fundamental-mode makefile-mode))))

* test/lisp/files-tests.el (files-tests-auto-mode-interpreter): New
test; exercise some aspects of 'interpreter-mode-alist'.
2023-11-19 11:05:26 +02:00
Stefan Monnier
492920dd5b Use new derived-mode-all/set-parents functions.
Try and avoid using the `derived-mode-parent` property directly
and use the new API functions instead.

* lisp/emacs-lisp/derived.el (define-derived-mode):
Use `derived-mode-set-parent`.

* lisp/loadhist.el (unload--set-major-mode):
* lisp/info-look.el (info-lookup-select-mode):
* lisp/ibuf-ext.el (ibuffer-list-buffer-modes):
* lisp/files.el (dir-locals--get-sort-score):
* lisp/emacs-lisp/cl-generic.el (cl--generic-derived-specializers):
Use `derived-mode-all-parents`.
2023-11-08 23:24:35 -05:00
dalanicolai
95d56b92a6 Fix 'locate-dominating-file' when FILE is not a directory.
* lisp/files.el (locate-dominating-file): Handle FILE that is not
a directory.  (Bug#66542)
2023-10-25 16:12:24 +03:00
Jens Schmidt
8d2a04f4c0 Better handle errors when writing r-o files without backup
* lisp/files.el (basic-save-buffer-2): Restore file permissions when
writing read-only files without backup fails.  (Bug#66546)
2023-10-25 15:56:39 +03:00
Eli Zaretskii
484fc70a7a Fix "C-0 C-x C-s" with write-protected files
* 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)
2023-10-16 14:17:57 +03:00
Michael Albinus
1677a65554 Merge from origin/emacs-29
dc8b336d02 * lisp/files.el (file-name-non-special): Handle quoted ti...
2023-10-14 09:38:17 +02:00