unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Harry Putnam <reader@newsguy.com>
Subject: Re: how to make dired-do-rename more friendly?
Date: Thu, 20 Nov 2003 04:20:37 -0600	[thread overview]
Message-ID: <m37k1vqr2i.fsf@newsguy.com> (raw)
In-Reply-To: bphal5$nsk$1@otis.netspace.net.au

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

  parent reply	other threads:[~2003-11-20 10:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m37k1vqr2i.fsf@newsguy.com \
    --to=reader@newsguy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).