[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: wish for tramp
From: |
Michael Albinus |
Subject: |
Re: wish for tramp |
Date: |
Fri, 18 Apr 2008 17:44:48 +0200 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (hpux) |
address@hidden writes:
> Michael,
Hi Tom,
> When in a dired and I mark some files and then do a "w"
> (copy-filename-as-kill), I get the list of names added to the kill ring.
> If I go on then to do a "0-w", I get the list
> including the full path. But I invariably don't want the
> "ssh:/address@hidden:" as part of the names. I want just the path as if I
> was on that machine. Know what I mean?
> The same when I have the cursor on the directory at the top of the dired
> and I hit the "w". I want just the path without the remote part.
>
> Can this already be done? Would you consider adding this if it isn't there
> now?
Tramp cannot change it, because dired-copy-filename-as-kill uses
standard filename operations. But you could advice this function:
(defadvice dired-copy-filename-as-kill
(after tw-advice-dired-copy-filename-as-kill () activate)
"Use only localname of remote files in kill ring."
(when (stringp ad-return-value)
(kill-new
(mapconcat
(lambda (x) (or (file-remote-p x 'localname) x))
(split-string ad-return-value)
" ")
'replace)))
This needs Emacs 23, because of the additional parameter of
file-remote-p. If you run Emacs 22 + Tramp 2.1, you must call
tramp-handle-file-remote-p instead.
> thanks!
> tom
Best regards, Michael.
- wish for tramp, twurgl, 2008/04/18
- Re: wish for tramp,
Michael Albinus <=