unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: MBR <mbr@arlsoft.com>
To: help-gnu-emacs@gnu.org
Subject: How to prevent Emacs from translating beginning of file path into "~"?
Date: Fri, 10 Apr 2015 03:02:09 -0400	[thread overview]
Message-ID: <55277571.4060106@arlsoft.com> (raw)

The Emacs command ^x-^f (find-file) fills the mini-buffer with the full 
path to the current directory and then waits for you to type the 
filename.  I often I find it a useful way to copy the current directory 
to the system's clipboard so I can paste the path into some other 
application.  For example, in Emacs I'll type:

    ^x-^f (put path to current directory into mini-buffer)
    ^a             (go to beginning of line)
    ^k             (kill from beginning to end of mini-buffer, with the
    side effect of putting that string into the system clipboard)
    ^g             (cancel out of mini-buffer)

At this point I can paste the path into any non-Emacs application by 
typing CMD-v (in OS-X) or CTRL-v (in Windows or Linux).

But there's a problem. Current versions of Emacs (I'm currently running 
Emacs 24.3.1 under OS-X) try to be smart and replace the beginning of 
the path with "~" if it matches the logged in user's home directory.  
Unfortunately, some applications don't understand paths that begin with "~".

Is it possible to configure Emacs to put the full path (beginning with 
"/") into the mini-buffer, rather than just the path from the home 
directory (beginning with "~")?

        Mark Rosenthal
        mbr@arlsoft.com




             reply	other threads:[~2015-04-10  7:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  7:02 MBR [this message]
2015-04-10  8:01 ` How to prevent Emacs from translating beginning of file path into "~"? Eli Zaretskii
2015-04-10  8:49   ` tomas
2015-04-10  9:16     ` Yuri Khan
2015-04-10  9:22       ` tomas
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=55277571.4060106@arlsoft.com \
    --to=mbr@arlsoft.com \
    --cc=help-gnu-emacs@gnu.org \
    /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).