diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2023-12-10 12:26:38 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2023-12-10 12:26:38 +0100 |
commit | 1d5028ad0414cad458aac1102d3612e4956068c5 (patch) | |
tree | 569d961db658812f9f6e054f818779966de72ec7 /lisp | |
parent | 213d30b3eaad4ffbe9685005ecc92201ab8cb806 (diff) |
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'.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/dired-x.el | 3 | ||||
-rw-r--r-- | lisp/dired.el | 10 | ||||
-rw-r--r-- | lisp/files-x.el | 6 | ||||
-rw-r--r-- | lisp/files.el | 4 | ||||
-rw-r--r-- | lisp/man.el | 2 | ||||
-rw-r--r-- | lisp/net/ange-ftp.el | 3 |
6 files changed, 18 insertions, 10 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 04b3c783084..e094c0b4ca7 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -613,7 +613,8 @@ you can relist single subdirs using \\[dired-do-redisplay]." (insert " " (directory-file-name (file-name-directory default-directory)) ":\n")) - (dired-mode dirname (or switches dired-listing-switches)) + (dired-mode + dirname (or switches (connection-local-value dired-listing-switches))) (setq mode-name "Virtual Dired" revert-buffer-function 'dired-virtual-revert dired-subdir-alist nil) diff --git a/lisp/dired.el b/lisp/dired.el index 36ca54efc37..33e38ed2c1c 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -75,7 +75,9 @@ each option. On systems such as MS-DOS and MS-Windows, which use `ls' emulation in Lisp, some of the `ls' switches are not supported; see the doc string of -`insert-directory' in `ls-lisp.el' for more details." +`insert-directory' in `ls-lisp.el' for more details. + +For remote Dired buffers, this option supports connection-local values." :type 'string :group 'dired) @@ -1383,7 +1385,8 @@ The return value is the target column for the file names." ;; is passed in directory name syntax ;; if it was the name of a directory at all. (file-name-directory dirname))) - (or switches (setq switches dired-listing-switches)) + (or switches + (setq switches (connection-local-value dired-listing-switches))) (if mode (funcall mode) (dired-mode dir-or-list switches)) ;; default-directory and dired-actual-switches are set now @@ -2714,7 +2717,8 @@ Keybindings: (expand-file-name (if (listp dired-directory) (car dired-directory) dired-directory))) - (setq-local dired-actual-switches (or switches dired-listing-switches)) + (setq-local dired-actual-switches + (or switches (connection-local-value dired-listing-switches))) (setq-local font-lock-defaults '(dired-font-lock-keywords t nil nil beginning-of-line)) (setq-local desktop-save-buffer 'dired-desktop-buffer-misc-data) diff --git a/lisp/files-x.el b/lisp/files-x.el index b2a9cf9bc5e..467981f3f8f 100644 --- a/lisp/files-x.el +++ b/lisp/files-x.el @@ -928,8 +928,10 @@ earlier in the `setq-connection-local'. The return value of the ;;;###autoload (defmacro connection-local-value (variable &optional application) "Return connection-local VARIABLE for APPLICATION in `default-directory'. -If VARIABLE does not have a connection-local binding, the value -is the default binding of the variable." +If APPLICATION is nil, the value of +`connection-local-default-application' is used. +If VARIABLE does not have a connection-local binding, the return +value is the default binding of the variable." (unless (symbolp variable) (signal 'wrong-type-argument (list 'symbolp variable))) `(let (connection-local-variables-alist file-local-variables-alist) diff --git a/lisp/files.el b/lisp/files.el index 1cdcec23b11..f87e7807301 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -7087,7 +7087,7 @@ auto-save file, if that is more recent than the visited file." (when (window-live-p window) (quit-restore-window window 'kill))))) (with-current-buffer standard-output - (let ((switches dired-listing-switches)) + (let ((switches (connection-local-value dired-listing-switches))) (if (file-symlink-p file) (setq switches (concat switches " -L"))) ;; Use insert-directory-safely, not insert-directory, @@ -7139,7 +7139,7 @@ Then you'll be asked about a number of files to recover." ;; hook. (dired-mode-hook (delete 'dired-omit-mode dired-mode-hook))) (dired (concat auto-save-list-file-prefix "*") - (concat dired-listing-switches " -t"))) + (concat (connection-local-value dired-listing-switches) " -t"))) (use-local-map (nconc (make-sparse-keymap) (current-local-map))) (define-key (current-local-map) "\C-c\C-c" 'recover-session-finish) (save-excursion diff --git a/lisp/man.el b/lisp/man.el index 3efa29d7aad..1a5512c74f4 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -579,7 +579,7 @@ Otherwise, the value is whatever the function (defun Man-shell-file-name () "Return a proper shell file name, respecting remote directories." (or ; This works also in the local case. - (with-connection-local-variables shell-file-name) + (connection-local-value shell-file-name) "/bin/sh")) (defun Man-header-file-path () diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 3d64b7976b3..4e4db34a78d 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -2850,7 +2850,8 @@ NO-ERROR, if a listing for DIRECTORY cannot be obtained." (ange-ftp-switches-ok dired-actual-switches)) (and (boundp 'dired-listing-switches) (ange-ftp-switches-ok - dired-listing-switches)) + (connection-local-value + dired-listing-switches))) "-al") t no-error) (gethash directory ange-ftp-files-hashtable))))) |