unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Tramp and `dired-listing-switches'
@ 2023-12-07 14:50 Emanuel Berg
  2023-12-08  9:35 ` Michael Albinus
  2023-12-18  3:44 ` Emanuel Berg
  0 siblings, 2 replies; 24+ messages in thread
From: Emanuel Berg @ 2023-12-07 14:50 UTC (permalink / raw)
  To: emacs-devel

I'd like one setting for `dired-listing-switches' locally on
Debian and one remotely with Tramp, on an OpenBSD system.

If I use Tramp with the Debian setting (below), and list files
on the remote server I don't get any listing since the options
does not compute on what is another ls(1), not GNU ls but the BSD
(OpenBSD?) one.

[ OT: I never understood if all BSDs use the same toolchain or
  if they have different tools as well, if anyone knows that? ]

Anyway, I wrote this to cycle between sets of
`dired-listing-switches' options. Optimally, it would be done
automatically so one don't have to strike the command.
Maybe one can use `tramp-bsd-unames' and
`tramp-check-remote-uname' to automate it.

Cycling the sets works, but I don't know if that method is the
cleanest way to do it. It uses a lexical let-closure and
`setf', `cdr' and `last' to make it circular.

Also, after cycling, how can I revert the the dired buffer?
`revert-buffer' doesn't seem to do it, nothing happens, but
cycling the option, then killing the buffer and revisiting
it, works. Files are displayed with the new set in play.

(setq dired-listing-switches
  "-AGlX --group-directories-first -I \"*.meta\" -I \"#*#\" -I \"*.elc\"")

(let*((dired-ls-opts (list dired-listing-switches "-Al"))
      (_ (setf (cdr (last dired-ls-opts)) dired-ls-opts)) )
  (defun dired-ls-opts-cycle ()
    (interactive)
    (setq dired-listing-switches (pop dired-ls-opts)) )
  (declare-function dired-ls-opts-cycle nil)
  (defalias 'lc #'dired-ls-opts-cycle) )

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2024-01-09  5:22 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-07 14:50 Tramp and `dired-listing-switches' Emanuel Berg
2023-12-08  9:35 ` Michael Albinus
2023-12-08 11:59   ` Eli Zaretskii
2023-12-08 12:08     ` Michael Albinus
2023-12-10 11:43       ` Michael Albinus
2023-12-12 20:07         ` Emanuel Berg
2023-12-13  7:13           ` Michael Albinus
2023-12-17 20:05             ` Emanuel Berg
2023-12-18  9:11               ` Michael Albinus
2023-12-17 20:23             ` Emanuel Berg
2023-12-09 14:29   ` Emanuel Berg
2023-12-09 15:33     ` tomas
2023-12-09 15:49       ` Emanuel Berg
2023-12-09 16:10         ` Emanuel Berg
2023-12-09 16:53           ` Emanuel Berg
2023-12-09 17:12             ` Emanuel Berg
2023-12-09 16:14         ` Emanuel Berg
2023-12-09 17:39         ` Michael Albinus
2023-12-10  5:23           ` Emanuel Berg
2023-12-10 11:25         ` Benjamin Riefenstahl
2023-12-10 11:48           ` tomas
2023-12-12 20:15             ` Emanuel Berg
2023-12-18  3:44 ` Emanuel Berg
2024-01-09  5:22   ` Emanuel Berg

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).