summaryrefslogtreecommitdiff
path: root/lisp/files.el
Commit message (Collapse)AuthorAgeFilesLines
* Handle case-insensitivity for safe-local-variable-directories.Antero Mejr2023-05-121-1/+4
| | | | | | | | | | | * lisp/emacs-lisp/files.el (hack-local-variables-filter): Use 'file-equal-p' when checking 'safe-local-variable-directories'. * doc/lispref/variables.texi (File Local Variables): Remove sentences in 'safe-local-variable-directories' description about case-sensitivity and trailing slash behaviors. * doc/emacs/custom.texi (Safe File Variables): Remove sentence about 'safe-local-variable-directories' trailing slash behavior. (Bug#61901)
* ; Fix last changeEli Zaretskii2023-05-111-1/+4
| | | | | | | * lisp/files.el (safe-local-variable-directories): * doc/lispref/variables.texi (File Local Variables): * doc/emacs/custom.texi (Safe File Variables): Fix wording of documentation in last change. (Bug#61901)
* Add safe-local-variable-directories variable.Antero Mejr2023-05-111-5/+29
| | | | | | | | | | | | | | | | | 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)
* Display unlock-file warning only when file locks are enabledMichael Albinus2023-04-041-1/+1
| | | | | | | | | | | * 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.
* Merge from origin/emacs-29Stefan Kangas2023-03-051-5/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | 836044f329a Fix c-ts-mode preproc directive indentation 64980a59b65 ; * lisp/files.el (hack-local-variables): Fix typo in the... a7cd125d490 More robustly unspoof HOME in Eglot tests (bug#61637) 6c66dbd02c7 Turn on Eglot inlay hints by default 246f5b541c5 Update ts modes missed in 4c16fd3a512 to use column-0 0bfba49ca7c Robustify Eglot for "transient" projects ea5fd375bb2 Fix documentation of 'normal-mode' in buffers that don't ... 4c16fd3a512 Change tree-sitter indent anchor 'point-min' to 'column-0' f47b3930158 Fix go-ts-mode multi-line string indentation (bug#61923) e0bf2da3db6 ; More accurate doc strings for 'window-at' and 'window-a...
| * ; * lisp/files.el (hack-local-variables): Fix typo in the doc string.Eli Zaretskii2023-03-041-1/+1
| |
| * Fix documentation of 'normal-mode' in buffers that don't visit filesEli Zaretskii2023-03-041-5/+13
| | | | | | | | | | | | | | | | * lisp/files.el (normal-mode): * lisp/subr.el (run-mode-hooks): * doc/emacs/modes.texi (Choosing Modes): Mention the caveat with 'normal-mode' in buffers not visiting files. (Bug#61925) * lisp/files.el (hack-local-variables): Doc fix.
* | Merge from origin/emacs-29Stefan Kangas2023-02-241-4/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | b0cbd5590b2 Eglot: simplify inlay hints implementation with jit-lock 91e24c5b5a6 Eglot: update inlay hints on window configuration changes 79fead1709f ; Fix a typo in a doc string in c-ts-common.el (bug#61736). a0b273ef300 ; Clarify documentation of 'file-modes-number-to-symbolic' 5c2be6a2632 ; Fix recently-added doc strings in eglot.el e3be0dbf85c Eglot: display completion label when safe 5286111ea1f Improve documentation of VC commands, including in Dired 990f4027131 * doc/emacs/maintaining.texi: More mentions of marked fil...
| * ; Clarify documentation of 'file-modes-number-to-symbolic'Eli Zaretskii2023-02-231-4/+7
| | | | | | | | | | | | * 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)
* | Merge from origin/emacs-29Stefan Kangas2023-02-181-1/+12
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1769a588300 Fix some uses of 'use-dialog-box' deef41a8259 Fix hi-lock-tests when 'use-dialog-box' is non-nil 5093a534960 Fix regression due to change in face sort order by 'face-... 3e747630999 * lisp/files.el (file-equal-p): Work around Haiku stat bug. 13fd7667f9c ; * src/treesit.c: Improve sectioning. a40b1745d4a (project-vc-backend-markers-alist): Add entry for vc-got 18e96ed7c8a project.el: Extract backend->marker association for a defvar 0a5615669a4 Don't completely clip into visible range in treesit_recor... 5b34fc07085 * lisp/treesit.el (treesit-node-at): Update docstring (bu... 1c7d7623781 ; Minor copyedit of NEWS wrt *-ts-modes 09fad246de8 * lisp/calc/calc.el (calc-mode): Improve docstring. 8aad8d75aa9 ; Improve and update documentation of native compilation d6e4f243720 Merge 'emacs-29' into 'feature/inhibit-native-comp-cleanup' a555abc56d5 Fix order of faces in 'face-list' b44a7ff85dc Allow 'icon-title-format' to have the value t f1f571e72ae Add electric indent for preproc directives 83af806ab7c Rename 'emacs-news-toggle-tag' to 'emacs-news-cycle-tag' 5bc88b3b175 Add menu to news-mode 40f4bc4e0aa ; Avoid installing VC package dependencies multiple times 1c9d81a2b42 Attempt to recognise if a VC package has no Elisp files 2550e8bb0b0 Fix mule-tests under en_US.UTF-8 locale 32795309939 Move block closer above declaration_list rule (bug#61531) b18754bb179 Minor improvements in c-ts-mode and docs 3c6b726a7b4 Add super node as a keyword 1917c51fe68 ; Prevent ERC-induced false positive in JUnit report b16965ef7e6 Delete perplexing paragraph from Gnus manual 43c62a4732d ; Fix typo fdac69b45e6 ; Auto-commit of loaddefs files. 7678b7e46f2 Eglot: check server capability before sending didSave (bu... a3a1ef7bd5e Fix rust-ts-mode type and module highlighting (Bug#61302) 477aa047ee7 rust-ts-mode: Highlight variable reassignments 5206a551c16 Improve backward compatibility of save-restriction accd88d5545 Don't indent template_string contents (bug#61503) d97a3839967 csharp-ts-mode: fontify compiler directives (bug#61512) 420d2cae846 Update to Transient v0.3.7-209-gdab1dfa a3751b5d0c1 ; Raise an error if a VC package checkout is empty 6a32ba8b69c ; Fix the installation of dependencies for VC packages 4eac80fcc39 ; Prepare to update ERC version to 5.5 4f099a72173 ; Remove failing erc-reuse-buffers test ce4a066ed1e * Generate trampolines in a temporary directory if no oth... 4bb27a5ca93 ; Minor docs copyedits 13bcff3da5c Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... 3d572ae0d50 Rename with/without-narrowing to with/without-restriction d806b0e33cf * lisp/repeat.el: Rename internal function and variable (... 1a64f326e0a * Fix previous change 95692f6754c Rename native-comp-deferred-compilation-deny-list 8d8464bd5a9 Rename native-comp-deferred-compilation into native-comp-... 5d0912f1445 Rename comp-enable-subr-trampolines into native-comp-enab... dd8b720ee74 ; * etc/NEWS: Fix typos. 909bd04cf5f ; * lisp/calendar/lunar.el: Add comments. (bug#61460) 10f2aedea9a ; * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): delete ... abfd00e5c02 * lisp/emacs-lisp/comp.el (native-comp-never-optimize-fun... 1795839babc Support `comp-enable-subr-trampolines' as string value 865758130a1 ; * admin/git-bisect-start: Update failing commits b948d0d7efe Merge branch 'scratch/fix-locked-narrowing' b6e2799aa1c * Some more `inhibit-native-compile' clean-up dcb2379a463 Minor improvements to labeled narrowing c0681cd3477 Revert "Add new variable 'inhibit-native-compilation'" 3969a34fa1b Revert "Rename to inhibit-automatic-native-compilation" 4297039bd13 Save and restore the absence of narrowing locks 2956e54b1dd Add an extensive test for labeled (locked) narrowing 79ce185ad13 Update the documentation about labeled (locked) narrowing a6cd4553d48 Rename two long line optimizations variables 0d73e4aa261 Add specific symbols for narrowings d8438e2bb44 Add 'without-narrowing' macro 97314447e60 Make 'narrowing-lock' and 'narrowing-unlock' internal a4aa32bdfff Fix 'save-restriction' for narrowing locks
| * * lisp/files.el (file-equal-p): Work around Haiku stat bug.Po Lu2023-02-181-1/+12
| |
* | Fix 'hack-local-variables' when EOL conversion is inhibitedEli Zaretskii2023-02-061-1/+3
| | | | | | | | | | | | * lisp/files.el (hack-local-variables--find-variables): Replace CRs with newlines only if the original buffer is under explicit selective-display. (Bug#61321)
* | ; Fix documentation of 'kill-matching-buffers-no-ask'Eli Zaretskii2023-01-211-9/+12
| | | | | | | | | | | | | | * etc/NEWS: Fix wording of 'kill-matching-buffers-no-ask's entry. * lisp/files.el (kill-matching-buffers) (kill-matching-buffers-no-ask): Doc fix.
* | Add new command `kill-matching-buffers-no-ask' (bug#60714)Andrea Corallo2023-01-201-0/+9
| | | | | | | | | | * lisp/files.el (kill-matching-buffers-no-ask): New function. * etc/NEWS: Announce `kill-matching-buffers-no-ask'.
* | Merge from origin/emacs-29Stefan Kangas2023-01-191-7/+13
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | db727873803 ruby-ts-mode: Use font-lock-constant-face for true/false/nil 819719330ad (ruby-ts--indent-rules): Add a rule for continuation of a... 94b9cbf96fb (ruby-ts--parent-call-or-bol): Handle more cases with nes... ba33b83ce4b (ruby-ts--statement-container-regexp): Remove "parenthesi... f2bedf695c1 ruby-ts-mode: Handle indent in parenless calls much close... 758ac5eabbe Fix split-window-below for the case when split-window-kee... 8e9783b4ce4 Rebind in read-regexp-map ‘M-c’ to ‘M-s c’ compatible wit... 78f93d92b28 * lisp/vc/vc-dir.el: Make keys ‘% m’ and ‘* %’ compatible... dc3f85fd4b0 Use proper types for Eshell warnings 6a8338a8bc8 ; Avoid byte-compiler warning in cc-fonts.el. 9186be20aeb ; Clarify doc strings of some functions in files.el bd5ef3ef95e Improve the documentation of 'auto-mode-alist' search 1798ff5a663 ; Fix minor mistakes in documentation faee7e1f1bd ; * lisp/treesit.el (treesit-font-lock-fontify-region): M... 24f0dfd3731 Revert "Revert "Add c-or-c++-ts-mode (bug#59613)"" ac3bc775b6f Make it harder to misactivate tree-sitter font-lock fast ... bdd82fa7977 ; * src/treesit.c: Remove unused boilerplate. 343b9b3dfe3 ruby-ts-mode: Obey the option ruby-method-call-indent 045404d1aac ruby-ts-mode: Obey the option ruby-after-operator-indent 300ca6ac372 ruby-ts-mode: Fix indent after operator or conditional ac5516bd7d5 ruby-ts-mode: Fix/change indentation of a continuation me... 5e2e68a0c2d ruby-ts-mode: Fix indent inside parenthesized_expr and el... 9ed9ff4690a ruby-ts-mode: Fix the rules for hanging arrays and hashes c4f0b6ccea1 Add more detail about how to invoke Eshell commands dbac923b9df CC Mode: On removal of "typedef", remove pertinent types ... 56d69c2fc47 ; Relax timeouts for failing ERC test 183e7492702 Don't preserve non-module minor modes in erc-open 7b8322f6285 Use correct buffer for local-module vars in erc-open 7b13422298a ; Avoid plist-get as generalized var in erc-compat 09e9d7c7496 Fix display of warnings on w32 console bd094207c76 Fix buffer-list-update-hook for indirect buffers 9e7a5d58eea ; Fix tree-sitter indent anchor preset 7c61a304104 Fix treesit-node-first-child-for-pos (bug#60127) b36cc7e7bbb ; * src/treesit.c (Ftreesit_induce_sparse_tree): Minor ch... # Conflicts: # etc/NEWS
| * ; Clarify doc strings of some functions in files.elEli Zaretskii2023-01-181-7/+13
| | | | | | | | | | * lisp/files.el (file-name-sans-extension, file-name-extension) (file-name-sans-versions): Doc fixes. (Bug#60929)
* | Merge from origin/emacs-29Stefan Kangas2023-01-151-3/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9f5008b9b2a Improve error message from sqlite-mode.el 73b304bb740 ; Fix last change: remove unused @anchor. d2efee31edb ; Update htmlfontify documentation 72d2604d1fd Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/... cf311826841 ; * lisp/files.el (insert-directory-wildcard-in-dir-p): D... 3fa10f6e54d ; Add more c-ts-mode indent and filling tests 25a5575f161 Fix c-ts-mode block comment indentation (bug#60270) 252b2c01af0 Fix c-ts-mode label indent 189d976dbae Fix statement indent for c-ts-mode (bug#59686) (bug#60280) c78e19d99c0 Allow offset in tree-sitter indent rules to be functions d13a329acff ; Minor change in c-ts-mode--indent-styles d428d510664 Support filling line comments in c-ts-mode f02998939c6 ; Fix c-ts-mode filling b365a7cc32e Fix expansion of wildcards in ls-lisp.el b5e0260f425 Fix messages displayed when diary is shown
| * ; * lisp/files.el (insert-directory-wildcard-in-dir-p): Doc fix.Eli Zaretskii2023-01-151-3/+6
| |
* | Add remote-file-name-inhibit-delete-by-moving-to-trashMichael Albinus2023-01-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/emacs/files.texi (Misc File Ops): * doc/lispref/files.texi (Changing Files): * doc/misc/tramp.texi (Frequently Asked Questions): * etc/NEWS: Explain remote-file-name-inhibit-delete-by-moving-to-trash. * lisp/files.el (remote-file-name-inhibit-delete-by-moving-to-trash): New defcustom. (Bug#60460) * lisp/net/ange-ftp.el (ange-ftp-delete-file): * lisp/net/tramp.el (tramp-skeleton-delete-directory): Handle `remote-file-name-inhibit-delete-by-moving-to-trash'. (tramp-skeleton-delete-file): New defmacro. * lisp/net/tramp-adb.el (tramp-adb-handle-delete-file): * lisp/net/tramp-fuse.el (tramp-fuse-handle-delete-file): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-delete-file): * lisp/net/tramp-sh.el (tramp-sh-handle-delete-file): * lisp/net/tramp-smb.el (tramp-smb-handle-delete-file): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-delete-file): Use it. * lisp/net/tramp-crypt.el (tramp-crypt-handle-delete-directory) (tramp-crypt-handle-delete-file): Rearrange. * lisp/net/tramp-fuse.el (tramp-fuse-handle-delete-directory): Use `tramp-skeleton-delete-directory'. * test/lisp/net/tramp-tests.el (remote-file-name-inhibit-delete-by-moving-to-trash): Declare. (tramp-test07-file-exists-p, tramp-test14-delete-directory) (tramp-test48-unload): Extend tests.
* | Add new SI prefixes R, Q in other placesPaul Eggert2023-01-061-3/+3
| | | | | | | | | | | | | | | | | | * lisp/dired-x.el (dired-x--string-to-number, dired-mark-sexp): * lisp/dired.el (dired-re-inode-size): * lisp/files.el (directory-listing-before-filename-regexp): * src/xdisp.c (power_letter): * src/xdisp.c: Include stdint.h. Check that the prefixes suffice for ptrdiff_t.
* | Merge from origin/emacs-29Stefan Kangas2023-01-051-3/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | 92f753dc190 ; * etc/NEWS: Fix wording in last change. cef875f6c51 ; * etc/NEWS: Instructions for builds without tree-sitter... 8d530ca6542 ; Fix documentation of y-or-n-p/yes-or-no-p c18878ee0a2 Fix bug in Tramp multi-hop 7eed8e050a9 * lisp/files.el (find-sibling-rules): Fix docstring. 6b5831c6964 Tree-sitter doc fixes (bug#60524) 651927ac391 ; Fix function reference in comment in c-ts-mode.el (bug#... c786afcbb9f Fontify C++ function definitions in c-ts-mode (bug#60529) # Conflicts: # etc/NEWS
| * * lisp/files.el (find-sibling-rules): Fix docstring.Michael Albinus2023-01-041-3/+3
| |
* | Merge from origin/emacs-29Eli Zaretskii2023-01-011-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | cae528457c ; Add 2023 to copyright years. b394359261 Improve documentation of 'isearch-open-overlay-temporary' ab3210e709 Document 'use-package' in the 2 main manuals # Conflicts: # etc/refcards/ru-refcard.tex # lib/explicit_bzero.c # m4/explicit_bzero.m4
| * ; Add 2023 to copyright years.Eli Zaretskii2023-01-011-1/+1
| |
* | Merge from origin/emacs-29Stefan Kangas2022-12-281-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | db96b1282f9 * lisp/help.el: Use 'C-h C-q' to toggle 'help-quick' wind... 489865c21e4 ; Improve markup of long key sequences d42c2668cf3 ; * etc/NEWS: Fix wording of a recently edited entry. 7a0eaee1980 * lisp/isearch.el: Small fixes. b69bffeec05 * lisp/vc/diff-mode.el (diff-minor-mode-prefix): Replace ... 9263847ab76 ; * etc/NEWS: Move the paragraph with 'C-u RET' closer to... 62fb2dc37da * doc/emacs/display.texi (Text Scale): Improve section ab... 70480d3b6b7 * lisp/repeat.el (repeat-echo-function): Suggest 'add-fun... fd48201ffe7 * lisp/tab-line.el (tab-line-cache-key-default): More cac... b1646602602 * etc/package-keyring.gpg: Update with new key c0be51389eb ; Yet another declare-function to avoid treesit-related w... 8676bec51de ; * lisp/treesit.el (treesit--simple-imenu-1): Doc fix; w... 2ddc480f441 Warn of absent networks module in ERC 19d00fab9aa Avoid "already compiled" warning in erc-compat 2d8f7b66bcc ; Fix one more treesit byte-compilation warning. 2d0a9214863 ; Avoid treesit-related byte-compiler warnings 8503b370be1 (python--treesit-settings): Remove duplicate matcher b464e6c490b Make last change of w32 GUI dialogs conditional and rever... eedc9d79aed Fix tree-sitter typos 248c13dcfe1 Update tree-sitter major modes to use the new Imenu facility b39dc7ab27a Add tree-sitter helper functions for Imenu ba1ddea9dab Fix treesit--things-around (bug#60355) 7512b9025a1 ; * lisp/treesit.el (treesit-traverse-parent): Remove alias. 5326b041982 Improve treesit-node-top-level and treesit-parent-until 637f5b164f2 ; Add "src" to the heuristic sub-directory heuristic 8ab6df0c9fd ; * lisp/epa-ks.el (epa-ks-do-key-to-fetch): Fix 'when' u... 2b55a48d3e3 * src/w32menu.c (simple_dialog_show): Use MB_YESNOCANCEL ... 8b8b7915679 ; Improve documentation of TAB/SPC indentation 624e3822110 ; Improve doc strings of some new faces 41f12e1019b ; * lisp/elide-head.el (elide-head): Doc fix to silence c... e3b4cd0ac1d ; * lisp/htmlfontify.el (hfy-text-p): Fix whitespace. 1b4dc4691c1 Fix htmlfontify.el command injection vulnerability. 1fe4b98b4d5 Improve support for Scheme R6RS and R7RS libraries (bug#5... 2347f37f677 ; * test/src/treesit-tests.el: remove dead store (bytecom... a6d961ae2fd Add a new tree-sitter query predicate 'pred' 835a80dcc48 ; Fix tree-sitter defun tests a14821d6151 Improve gnutls-min-prime-bits docstring b14bbd108e4 Improve handling of tab-bar height. 669160d47b2 ; * nt/INSTALL.W64: More fixes and updates. 26b2ec7cb8c Simplify last change (bug#60311) 082fc6e3088 Fix 'json-available-p' on MS-Windows 6c86faec29e loaddefs-gen: Group results by absolute file name d90d7d15f2f ; Fix vindexes in parsing.texi eb268728376 Fix imenu for c-ts-mode (bug#60296) 8f68b6497ee Clean up python-ts-mode font-lock features 28f26b11a1e Add comment indent and filling to other tree-sitter major... c6b02826450 ; Remove unused function in c-ts-mode 6e52a9fcadc ; * doc/lispref/modes.texi (Parser-based Font Lock): Mino... 2bcd1e9a99d ; * doc/lispref/parsing.texi (Retrieving Nodes): Add notice. 7c7950fe006 Add maintainer stub for tree-sitter files cf327766226 ; * doc/lispref/parsing.texi (Using Parser): Remove delet... # Conflicts: # etc/NEWS # lisp/progmodes/c-ts-mode.el # lisp/progmodes/typescript-ts-mode.el # lisp/treesit.el
| * Improve support for Scheme R6RS and R7RS libraries (bug#54704)Rudolf Adamkovič2022-12-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | * etc/NEWS (Scheme mode): Document improved file-type auto-detection and Imenu support for R6RS and R7RS Scheme libraries. * lisp/files.el (auto-mode-alist): Associate the '.sls' (R6RS Scheme Library Source) and '.sld' (R7RS Scheme Library Definition) file name extensions with the Scheme mode. * lisp/progmodes/scheme.el (scheme-imenu-generic-expression): Make Imenu recognize the members nested (and so indented) inside of 'library' (R6RS) or 'define-library' (R7RS) forms.
* | Assume make-directory handler follows new APIPaul Eggert2022-12-241-29/+24
|/ | | | | | | | | | | Suggested by Michael Albinus (Bug#58919#56). * lisp/files.el (files--ensure-directory): Omit recently-added arg MKDIR, since it is now always make-directory again. All uses changed. (make-directory): Assume the make-directory handler follows the new API where it yields non-nil if DIR already exists. This reverts some of the recent changes in this area, and simplifies this funciton.
* Remove file-exists-in-trash-pPaul Eggert2022-12-171-11/+3
| | | | | | * lisp/files.el (file-exists-in-trash-p): Remove, as this name is not suitable for users. All uses replaced by file-attributes, which is good enough here.
* Don’t assume make-directory handler returns nilPaul Eggert2022-12-171-1/+6
| | | | | * lisp/files.el (make-directory): Ignore what the make-directory handler returns, as its return value was not documented in Emacs 28.
* Fix copy-directory bug when dest dir existsPaul Eggert2022-12-171-7/+12
| | | | | | | | | | * lisp/files.el (copy-directory): Set ‘follow’ depending on whether we made the directory, not based on a guess that is sometimes wrong. When NEWNAME is a directory name and COPY-CONTENTS is nil, do not object merely because the adjusted NEWNAME is already a directory. (Bug#58919). * test/lisp/files-tests.el (files-tests-copy-directory): Test for the bug.
* make-directory now returns t if dir already existsPaul Eggert2022-12-171-28/+30
| | | | | | | | | | | | | | | This new feature will help fix a copy-directory bug (Bug#58919). Its implementation does not rely on make-directory handlers supporting the new feature, as it no longer uses a make-directory handler H in any way other than (funcall H DIR), thus using only the intersection of the old and new behavior for handlers. This will give us time to fix handlers at our leisure. * lisp/files.el (files--ensure-directory): New arg MKDIR. All uses changed. (files--ensure-directory, make-directory): Return non-nil if DIR is already a directory. All uses changed. * test/lisp/files-tests.el (files-tests-make-directory): Test new return-value convention.
* Fix moving to trash files that overwrite dangling symlinks thereEli Zaretskii2022-12-161-3/+11
| | | | | | * lisp/files.el (file-exists-in-trash-p): New function. (move-file-to-trash): Use it instead of 'file-exists-p' when testing whether the file exist in the trash. (Bug#59986)
* ; Typo fixes in etc/NEWS and lisp/ filesJuanma Barranquero2022-11-291-1/+1
|
* Extend memory-info for remote systemsMichael Albinus2022-11-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * doc/lispref/files.texi (Magic File Names): Add memory-info. * doc/lispref/internals.texi (Garbage Collection): memory-info can also retrieve values from remote systems. * etc/NEWS: Document changes in memory-info. Fix typos. * lisp/files.el (warn-maybe-out-of-memory): Ensure local memory info. * lisp/net/tramp.el (tramp-handle-memory-info): New defun. (tramp-file-name-for-operation) * lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist): * lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist): * lisp/net/tramp-crypt.el (tramp-crypt-file-name-handler-alist): * lisp/net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): * lisp/net/tramp-rclone.el (tramp-rclone-file-name-handler-alist): * lisp/net/tramp-sh.el (tramp-sh-file-name-handler-alist): * lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist): * lisp/net/tramp-sshfs.el (tramp-sshfs-file-name-handler-alist) * lisp/net/tramp-sudoedit.el (tramp-sudoedit-file-name-handler-alist): Add 'memory-info'. * lisp/net/tramp-sshfs.el (tramp-sshfs-handle-exec-path): Let-bind `process-file-side-effects'. * src/alloc.c (Fmemory_info): Support remote systems. (Qmemory_info): Declare. * test/lisp/net/tramp-tests.el (tramp-test31-memory-info): New test.
* Add new SI prefixesMattias Engdegård2022-11-241-1/+1
| | | | | | | | | * lisp/calc/calc-units.el (math-unit-prefixes): * lisp/files.el (file-size-human-readable): Add ronna, quetta, ronto and quecto. (We get the future IEC binary prefixes Ri and Qi (robi and quebi) in `file-size-human-readable` for free.)
* Fix trashing of symlink that points at a directoryMike Kupfer2022-11-241-1/+2
| | | | | * lisp/files.el (move-file-to-trash): Redefine is-directory so that it is false for symlinks.
* Fix cross-filesystem directory trashing (Bug#58721)Mike Kupfer2022-11-241-2/+19
| | | | | | * lisp/files.el (move-file-to-trash): When trashing a directory with the same name as something that's already in the trash, copy it into the trash folder and then delete it, rather than using rename-file.
* ; Fix typosStefan Kangas2022-11-181-1/+1
|
* Pacify recent unused/ignored lexvar warningsBasil L. Contovounesios2022-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Lexvars with special names like 'ignored' or 'unused' are no longer treated specially. * lisp/ansi-color.el (ansi-color-process-output): * lisp/cus-edit.el (customize-apropos-options): * lisp/cus-theme.el (customize-create-theme): * lisp/dired-aux.el (dired-hide-all): * lisp/emacs-lisp/crm.el (crm--choose-completion-string): * lisp/emacs-lisp/tabulated-list.el (tabulated-list-revert): * lisp/ido.el (ido-choose-completion-string): * lisp/international/mule-diag.el (describe-font-internal): * lisp/mail/sendmail.el (sendmail-user-agent-compose): * lisp/progmodes/fortran.el (fortran-uncomment-region): * lisp/progmodes/prolog.el (prolog-inferior-guess-flavor): * lisp/progmodes/ruby-mode.el (ruby-indent-line, ruby-indent-exp): * lisp/url/url.el (url-mm-callback): * lisp/xwidget.el (xwidget-webkit-history-reload): Prepend an underscore to unused function parameter names. * lisp/emacs-lisp/cconv.el (cconv--dummy-var): Remove unused constant. * lisp/files.el (hack-local-variables-filter): Remove unused lexvar.
* Rename `file-attribute-file-number' to `file-attribute-file-identifier'Michael Albinus2022-10-141-5/+6
| | | | | | | | | | | | * doc/lispref/files.texi (File Attributes): * etc/NEWS: * lisp/files.el (find-buffer-visiting, find-file-noselect) (set-visited-file-name, basic-save-buffer) (file-attribute-file-identifier): * lisp/startup.el (normal-top-level-add-subdirs-to-load-path): * lisp/eshell/em-unix.el (eshell-shuffle-files): * src/dired.c (Ffile_attributes): Rename `file-attribute-file-number' to `file-attribute-file-identifier'.
* ; Fix recent change in documentation of "device number"Eli Zaretskii2022-10-141-5/+7
| | | | | | | | | | | * src/dired.c (Ffile_attributes): * lisp/files.el (buffer-file-number, file-attribute-file-number): Fix wording of the doc strings. * etc/NEWS: * doc/lispref/buffers.texi (Buffer File Name): * doc/lispref/files.texi (File Attributes): Fix a typo and wording. (Bug#58446)
* Clarify structure of file-attribute's device numberMichael Albinus2022-10-131-9/+15
| | | | | | | | | | | | | | | | | | | | * doc/lispref/buffers.texi (Buffer File Name): Fix description of buffer-file-number. * doc/lispref/files.texi (File Attributes): Clarify type of device number. Describe file-attribute-file-number. (Bug#58446) * etc/NEWS: Mention file-attribute-file-number. * lisp/files.el (buffer-file-number, file-attribute-device-number) (file-attribute-collect): Fix docstring. (file-attribute-file-number): New defsubst. (find-buffer-visiting, find-file-noselect) (set-visited-file-name, basic-save-buffer): * lisp/startup.el (normal-top-level-add-subdirs-to-load-path): * lisp/eshell/em-unix.el (eshell-shuffle-files): Use it. * src/dired.c (Ffile_attributes): Fix docstring.
* Merge from origin/emacs-28Stefan Kangas2022-10-091-3/+4
|\ | | | | | | 32ef7550ed ; Improve documentation of 'file-in-directory-p'
| * ; Improve documentation of 'file-in-directory-p'Eli Zaretskii2022-10-081-3/+4
| | | | | | | | | | | | | | | | | | * lisp/files.el (file-in-directory-p): Clarify doc string. * doc/lispref/files.texi (Truenames): Move the documentation of 'file-in-directory-p' from here... (Contents of Directories): ...to here. Add index entries. (Bug#58364)
* | ; * lisp/files.el (find-file-noselect): Minor simplification.Stefan Kangas2022-10-051-10/+9
| |
* | files.el (major-mode-remap-alist): New custom var (bug#58075)Stefan Monnier2022-10-031-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/files.el (major-mode-remap-alist): New custom var. (set-auto-mode--last): New var. (set-auto-mode-0): Obey `major-mode-remap-alist`. * doc/emacs/modes.texi (Choosing Modes): Document `major-mode-remap-alist`. * lisp/progmodes/cperl-mode.el: Recommend the use of `major-mode-remap-alist` over the crude `defalias` solution. * lisp/textmodes/tex-mode.el (tex--guess-mode): Simplify. (tex--redirect-to-submode): Obey `major-mode-remap-alist`.
* | * lisp/files.el (after-find-file): Use substitute-command-keys.Stefan Kangas2022-10-021-1/+2
| |
* | Fix rename-visited-file when renaming to a directory nameLars Ingebrigtsen2022-09-301-0/+8
| | | | | | | | | | * lisp/files.el (rename-visited-file): Allow renaming to a directory file name (bug#58182).
* | * lisp/files.el (auto-mode-alist): Add entry for ".mailmap".Stefan Kangas2022-09-281-0/+1
| |
* | * lisp/files.el (file-backup-file-names): Don't burp if dir doesn't existStefan Monnier2022-09-271-10/+11
| |