summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-07-09 18:14:19 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-07-09 18:14:19 +0200
commit9ce6541ac9710933beca7f9944087fe4849d5ae9 (patch)
tree133344956b38933f504071bfa114fc712296f43c /lisp/dired.el
parent2870a72d0d6675e189457394ac421bd8e5ab4561 (diff)
downloademacs-9ce6541ac9710933beca7f9944087fe4849d5ae9.tar.gz
emacs-9ce6541ac9710933beca7f9944087fe4849d5ae9.tar.bz2
emacs-9ce6541ac9710933beca7f9944087fe4849d5ae9.zip
Further cleanup for file locks
* doc/misc/tramp.texi (Top, Configuration): Adapt node name for file locks. (Auto-save File Lock and Backup): Rename node name and section title. Add file-lock to @cindex. Describe file locks. * lisp/dired.el (dired-trivial-filenames): Add lock files. (dired-font-lock-keywords): Move files suffixed with `completion-ignored-extensions' up. Add lock files to these checks. * lisp/net/tramp.el (tramp-get-lock-file, tramp-handle-unlock-file): Use `when-let' (tramp-lock-file-info-regexp): Rename from `tramp-lock-file-contents-regexp'. (tramp-handle-file-locked-p, tramp-handle-lock-file): Adapt callees. (tramp-handle-lock-file): Set file modes of lockname. * src/buffer.c (Frestore_buffer_modified_p): * src/fileio.c (write_region): * src/insdel.c (prepare_to_modify_buffer_1): Call Flock_file. * src/filelock.c (Qmake_lock_file_name): Declare symbol. (make_lock_file_name): Use it. Don't check Fboundp, it doesn't work for interned symbols. (lock_file): Return a Lisp_Object. Don't check create_lockfiles. Remove MSDOS version of the function. (Flock_file): Check create_lockfiles. (Flock_buffer): Call Flock_file. * src/lisp.h (lock_file): Remove. * test/lisp/shadowfile-tests.el (shadow-test08-shadow-todo) (shadow-test09-shadow-copy-files): Let-bind `create-lockfiles'. * test/lisp/net/tramp-tests.el (create-lockfiles): Don't set it globally. (tramp-test39-lock-file): Check also for `set-visited-file-name'.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el50
1 files changed, 26 insertions, 24 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 9ddd2c542dc..fb353a92e45 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -163,7 +163,7 @@ always set this variable to t."
:type 'boolean
:group 'dired-mark)
-(defcustom dired-trivial-filenames (purecopy "\\`\\.\\.?\\'\\|\\`#")
+(defcustom dired-trivial-filenames (purecopy "\\`\\.\\.?\\'\\|\\`\\.?#")
"Regexp of files to skip when finding first file of a directory.
A value of nil means move to the subdir line.
A value of t means move to first file."
@@ -615,6 +615,31 @@ Subexpression 2 must end right before the \\n.")
(list dired-re-dir
'(".+" (dired-move-to-filename) nil (0 dired-directory-face)))
;;
+ ;; Files suffixed with `completion-ignored-extensions'.
+ '(eval .
+ ;; It is quicker to first find just an extension, then go back to the
+ ;; start of that file name. So we do this complex MATCH-ANCHORED form.
+ (list (concat
+ "\\(" (regexp-opt completion-ignored-extensions)
+ "\\|#\\|\\.#.+\\)$")
+ '(".+" (dired-move-to-filename) nil (0 dired-ignored-face))))
+ ;;
+ ;; Files suffixed with `completion-ignored-extensions'
+ ;; plus a character put in by -F.
+ '(eval .
+ (list (concat "\\(" (regexp-opt completion-ignored-extensions)
+ "\\|#\\|\\.#.+\\)[*=|]$")
+ '(".+" (progn
+ (end-of-line)
+ ;; If the last character is not part of the filename,
+ ;; move back to the start of the filename
+ ;; so it can be fontified.
+ ;; Otherwise, leave point at the end of the line;
+ ;; that way, nothing is fontified.
+ (unless (get-text-property (1- (point)) 'mouse-face)
+ (dired-move-to-filename)))
+ nil (0 dired-ignored-face))))
+ ;;
;; Broken Symbolic link.
(list dired-re-sym
(list (lambda (end)
@@ -659,29 +684,6 @@ Subexpression 2 must end right before the \\n.")
(list dired-re-special
'(".+" (dired-move-to-filename) nil (0 'dired-special)))
;;
- ;; Files suffixed with `completion-ignored-extensions'.
- '(eval .
- ;; It is quicker to first find just an extension, then go back to the
- ;; start of that file name. So we do this complex MATCH-ANCHORED form.
- (list (concat "\\(" (regexp-opt completion-ignored-extensions) "\\|#\\)$")
- '(".+" (dired-move-to-filename) nil (0 dired-ignored-face))))
- ;;
- ;; Files suffixed with `completion-ignored-extensions'
- ;; plus a character put in by -F.
- '(eval .
- (list (concat "\\(" (regexp-opt completion-ignored-extensions)
- "\\|#\\)[*=|]$")
- '(".+" (progn
- (end-of-line)
- ;; If the last character is not part of the filename,
- ;; move back to the start of the filename
- ;; so it can be fontified.
- ;; Otherwise, leave point at the end of the line;
- ;; that way, nothing is fontified.
- (unless (get-text-property (1- (point)) 'mouse-face)
- (dired-move-to-filename)))
- nil (0 dired-ignored-face))))
- ;;
;; Explicitly put the default face on file names ending in a colon to
;; avoid fontifying them as directory header.
(list (concat dired-re-maybe-mark dired-re-inode-size dired-re-perms ".*:$")