tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp listing switches


From: Leo
Subject: Re: tramp listing switches
Date: Tue, 16 Jan 2007 16:31:00 +0000
User-agent: No Gnus v0.6, Emacs/22.0.92.2 (2007-01-10), Fedora 6 gnu/linux

On 2007-01-16, Kai Grossjohann said:

> Leo <address@hidden> writes:
>
>> I try to open a remote file in a freebsd system and 'ls' does not
>> support a lot of 'ls' options in GNU systems. But my
>> dired-listing-switches is set to '-ahvl'. I am wondering if I can
>> change the listing options for just tramp. Thanks.
>
> I'm not aware of built-in functionality for doing this.  I'm sure it's
> possible, but I guess it involves diving into the dired code.
>
> The question is whether you can add code to dired-mode-hook that looks
> at the variable default-directory and sets dired-listing-switches.
>
> Hm.  M-x apropos-variable RET dired.*hook RET...  Ah, there is
> dired-before-readin-hook which is executed earlier.  If you're lucky,
> it works to put the code there.
>

Following your suggestion, I add these

(add-hook 'dired-before-readin-hook 'sdl:test)
(defun sdl:test ()
  (let ((path default-directory))
      (when (file-remote-p path)
          (set-buffer (cdr (assoc path dired-buffers)))
          (set (make-local-variable 'dired-listing-switches) "-al"))))

I can verify dired-listing-switches has been changed to "-al" but I am
still getting the same error:

,----
| /ssh:cssa:/users/home/cssa-cam/web/cookbook:
| ls: illegal option -- v
| usage: ls [-ABCFGHILPRSTUWZabcdfghiklmnopqrstuwx1] [file ...]
`----

Although,

,----
| dired-listing-switches is a variable defined in `dired.el'.
| Its value is "-al"
| Local in buffer cookbook; global value is "-ahvl"
`----

Ideas?

> If it works, it may be useful to provide code with Tramp that makes
> this more convenient for users, perhaps even with a method to set
> different listing switches for different remote hosts or somesuch.
>
> Yet another idea is to install the gnuls port on the remote system.  I
> think there is code in Tramp to automatically find gnuls, if
> avaiable.  (When looking for the "ls" program, it actually searches
> not only "ls" but also "gls" and "gnuls" I think.)
>
> Please let us know your findings.
>
> Kai

-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]