all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* how to make dired-do-rename more friendly?
@ 2003-11-20  2:52 leo
  2003-11-20  6:22 ` Eli Zaretskii
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: leo @ 2003-11-20  2:52 UTC (permalink / raw)


hi there

i use dired a lot and rename works ok, but it would be handy to copy the
existing name by default into the minibuffer or at least do it with a quick
mini-buffer key stroke.

example: sitting on the file
  /Users/leo/my-text-with-a-long-name
i invoke dired-do-rename (by key "R") and get a minibuffer just with:
  /Users/leo/
and i want some easy to get to
   /Users/leo/my-text-with-a-long-name
so that i can quickly change it to:
   /Users/leo/my-text-with-a-long-name-two

at the moment it might quite some tab-completion if you have other files
with names like my-other-text, my-text-other, my-text-with-other, etc...

any ideas? are there some custom-vars or hidden key-stroke which could be
helpful? or is there an additional package recommendable?

thanks a lot, leo

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

* Re: how to make dired-do-rename more friendly?
  2003-11-20  2:52 how to make dired-do-rename more friendly? leo
@ 2003-11-20  6:22 ` Eli Zaretskii
  2003-11-20  6:53 ` Dryice Liu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2003-11-20  6:22 UTC (permalink / raw)


> From: "leo" <halloleo@noospaam.myrealbox.com>
> Newsgroups: gnu.emacs.help
> Date: Thu, 20 Nov 2003 13:52:50 +1100
> 
> i use dired a lot and rename works ok, but it would be handy to copy the
> existing name by default into the minibuffer or at least do it with a quick
> mini-buffer key stroke.
> 
> example: sitting on the file
>   /Users/leo/my-text-with-a-long-name
> i invoke dired-do-rename (by key "R") and get a minibuffer just with:
>   /Users/leo/
> and i want some easy to get to
>    /Users/leo/my-text-with-a-long-name

Did you try to press the DownArrow key or M-n?

The node "Minibuffer History" in the Emacs manual will tell you more
useful stuff about this and related commands and features.

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

* Re: how to make dired-do-rename more friendly?
  2003-11-20  2:52 how to make dired-do-rename more friendly? leo
  2003-11-20  6:22 ` Eli Zaretskii
@ 2003-11-20  6:53 ` Dryice Liu
  2003-11-20 10:20 ` Harry Putnam
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Dryice Liu @ 2003-11-20  6:53 UTC (permalink / raw)


"leo" <halloleo@noospaam.myrealbox.com> wrote:

> example: sitting on the file
>   /Users/leo/my-text-with-a-long-name
> i invoke dired-do-rename (by key "R") and get a minibuffer just with:
>   /Users/leo/
> and i want some easy to get to
>    /Users/leo/my-text-with-a-long-name
> so that i can quickly change it to:
>    /Users/leo/my-text-with-a-long-name-two
>

solution 1:
w , R, C-y

solution 2:
check out wdired.el at
http://groups.google.com/groups?as_ugroup=gnu.emacs.sources&as_q=wdired


-- 
Dryice Liu

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

* Re: how to make dired-do-rename more friendly?
  2003-11-20  2:52 how to make dired-do-rename more friendly? leo
  2003-11-20  6:22 ` Eli Zaretskii
  2003-11-20  6:53 ` Dryice Liu
@ 2003-11-20 10:20 ` Harry Putnam
  2003-11-20 18:06   ` Harry Putnam
       [not found]   ` <mailman.353.1069356131.399.help-gnu-emacs@gnu.org>
  2003-11-20 18:39 ` Kevin Rodgers
       [not found] ` <mailman.322.1069327365.399.help-gnu-emacs@gnu.org>
  4 siblings, 2 replies; 8+ messages in thread
From: Harry Putnam @ 2003-11-20 10:20 UTC (permalink / raw)


"leo" <halloleo@noospaam.myrealbox.com> writes:

> example: sitting on the file
>   /Users/leo/my-text-with-a-long-name
> i invoke dired-do-rename (by key "R") and get a minibuffer just with:
>   /Users/leo/
> and i want some easy to get to
>    /Users/leo/my-text-with-a-long-name
> so that i can quickly change it to:
>    /Users/leo/my-text-with-a-long-name-two

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)))
  
  (require 'macro)
  (put 'narrow-to-region 'disabled nil)

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

* Re: how to make dired-do-rename more friendly?
  2003-11-20 10:20 ` Harry Putnam
@ 2003-11-20 18:06   ` Harry Putnam
       [not found]   ` <mailman.353.1069356131.399.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Harry Putnam @ 2003-11-20 18:06 UTC (permalink / raw)


Harry Putnam <reader@newsguy.com> writes:

>   (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)))

OOOPs a couple of ringers slipped in there.  These last two are
something else.

>   (require 'macro)
>   (put 'narrow-to-region 'disabled nil)

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

* Re: how to make dired-do-rename more friendly?
  2003-11-20  2:52 how to make dired-do-rename more friendly? leo
                   ` (2 preceding siblings ...)
  2003-11-20 10:20 ` Harry Putnam
@ 2003-11-20 18:39 ` Kevin Rodgers
       [not found] ` <mailman.322.1069327365.399.help-gnu-emacs@gnu.org>
  4 siblings, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2003-11-20 18:39 UTC (permalink / raw)


leo wrote:

> hi there
> 
> i use dired a lot and rename works ok, but it would be handy to copy the
> existing name by default into the minibuffer or at least do it with a quick
> mini-buffer key stroke.
> 
> example: sitting on the file
>   /Users/leo/my-text-with-a-long-name
> i invoke dired-do-rename (by key "R") and get a minibuffer just with:
>   /Users/leo/
> and i want some easy to get to
>    /Users/leo/my-text-with-a-long-name
> so that i can quickly change it to:
>    /Users/leo/my-text-with-a-long-name-two

C-k
R
C-y

-- 
Kevin Rodgers

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

* Re: how to make dired-do-rename more friendly?
       [not found]   ` <mailman.353.1069356131.399.help-gnu-emacs@gnu.org>
@ 2003-11-21  5:05     ` leo
  0 siblings, 0 replies; 8+ messages in thread
From: leo @ 2003-11-21  5:05 UTC (permalink / raw)


cool i'll try that out!

btw: thanks for all they info!

leo

"Harry Putnam" <reader@newsguy.com> wrote in message
news:mailman.353.1069356131.399.help-gnu-emacs@gnu.org...
> Harry Putnam <reader@newsguy.com> writes:
>
> >   (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)))
>
> OOOPs a couple of ringers slipped in there.  These last two are
> something else.
>
> >   (require 'macro)
> >   (put 'narrow-to-region 'disabled nil)
>
>
>
>

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

* Re: how to make dired-do-rename more friendly?
       [not found] ` <mailman.322.1069327365.399.help-gnu-emacs@gnu.org>
@ 2004-01-25 19:17   ` Jari Aalto+mail.emacs
  0 siblings, 0 replies; 8+ messages in thread
From: Jari Aalto+mail.emacs @ 2004-01-25 19:17 UTC (permalink / raw)


* 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

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

end of thread, other threads:[~2004-01-25 19:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-11-20  2:52 how to make dired-do-rename more friendly? leo
2003-11-20  6:22 ` Eli Zaretskii
2003-11-20  6:53 ` Dryice Liu
2003-11-20 10:20 ` Harry Putnam
2003-11-20 18:06   ` Harry Putnam
     [not found]   ` <mailman.353.1069356131.399.help-gnu-emacs@gnu.org>
2003-11-21  5:05     ` leo
2003-11-20 18:39 ` Kevin Rodgers
     [not found] ` <mailman.322.1069327365.399.help-gnu-emacs@gnu.org>
2004-01-25 19:17   ` Jari Aalto+mail.emacs

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.