From: tomas@tuxteam.de
To: Yuri Khan <yuri.v.khan@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: How to prevent Emacs from translating beginning of file path into "~"?
Date: Fri, 10 Apr 2015 11:22:33 +0200 [thread overview]
Message-ID: <20150410092233.GA1875@tuxteam.de> (raw)
In-Reply-To: <CAP_d_8UGeAB32XBS_n89p+2fv3zDK+Aa1Csq8cNX50Na3ONqMA@mail.gmail.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, Apr 10, 2015 at 03:16:07PM +0600, Yuri Khan wrote:
> On Fri, Apr 10, 2015 at 2:49 PM, <tomas@tuxteam.de> wrote:
>
> > What can be modified too is the value copied to the kill ring
> > (mumble mumble "clipboard" mumble) when the current buffer has
> > no obvious file name -- I'm doing "" here
>
> Might be beneficial to use dired-directory for dired buffers.
Yep. Nice idea. Expanded version:
(defun copy-current-filename-as-kill ()
(interactive)
(let ((filename (or buffer-file-name
dired-directory)))
(kill-new
(or (and filename
(expand-file-name filename))
""))))
Just extend the (or ...) to taste for more cases :-)
Thanks
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAlUnllkACgkQBcgs9XrR2kYyEACfVbmdPmhhRjAh0vDFrL4l4VFB
QhIAn2FiUIxdCTiKHhKQVqQpR+cbtTZn
=8YHw
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2015-04-10 9:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-10 7:02 How to prevent Emacs from translating beginning of file path into "~"? MBR
2015-04-10 8:01 ` Eli Zaretskii
2015-04-10 8:49 ` tomas
2015-04-10 9:16 ` Yuri Khan
2015-04-10 9:22 ` tomas [this message]
2015-04-11 5:35 ` Xavier Maillard
2015-04-11 5:48 ` tomas
2015-04-10 12:31 ` Stefan Monnier
2015-04-11 21:37 ` MBR
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=20150410092233.GA1875@tuxteam.de \
--to=tomas@tuxteam.de \
--cc=help-gnu-emacs@gnu.org \
--cc=yuri.v.khan@gmail.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).