help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to make dired-do-rename more friendly?


From: Jari Aalto+mail.emacs
Subject: Re: how to make dired-do-rename more friendly?
Date: Sun, 25 Jan 2004 21:17:21 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/20.7 (windows-nt) (i386-*-nt5.0.2195)

* Thu 2003-11-20 Harry Putnam <reader@newsguy.com> gnu.emacs.help
* 
<http://groups.google.com/groups?oi=djq&as_umsgid=%3Cmailman.322.1069327365.399.help-gnu-emacs@gnu.org>
| "leo" <halloleo@noospaam.myrealbox.com> writes:
| 
| I picked this code up in this group long ago... no longer remember
| its author.  But it does what you describe.  I use it all the time.
| 
| WARNING: Being one of the lisp impaired... I'm not sure what all this
| does  USE AT YOUR OWN RISK.
|  
|   (defadvice dired-mark-read-file-name (around tiad act)
|     "Instead of asking directory, offer full filename for editing.
|   This advice is enabled only upon request."
|     (if (and dir (string-match "/" dir))
|         (setq dir (dired-get-filename)))
|     ad-do-it)
|                  
|   (defadvice dired-do-rename  (around joc-tiad-dired-rename act)
|     "Offer editing the current filename.
|   Without this advice you don't get the old filename for editing.
|   Activates advice 'dired-mark-read-file-name 'my 'around during call."
|     (let* ((ADVICE 'dired-mark-read-file-name))
|       (ad-enable-advice ADVICE 'around 'tiad)
|       (ad-activate ADVICE)
|       ad-do-it
|       (ad-disable-advice ADVICE 'around 'tiad)
|       (ad-activate ADVICE)))

:-) This code is from advice collection library (tinyadvice.el)
For more information http://tiny-tools.sourceforge.net/ 


Jari





reply via email to

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