From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: How to make Emacs paths in the minibuffer start at root (/) instead of $HOME (~)? Date: 26 Mar 2014 01:23:18 GMT Message-ID: References: <5331C7DB.4070907@arlsoft.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1395797107 22249 80.91.229.3 (26 Mar 2014 01:25:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Mar 2014 01:25:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 26 02:25:17 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WScaj-0007q4-4a for geh-help-gnu-emacs@m.gmane.org; Wed, 26 Mar 2014 02:25:17 +0100 Original-Received: from localhost ([::1]:45121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WScai-0007qk-P6 for geh-help-gnu-emacs@m.gmane.org; Tue, 25 Mar 2014 21:25:16 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-X-Trace: individual.net amfkaPBbHdERETQur+jAcAsW/UrqSNWjokJqVXVoy+v+cBMxgS Cancel-Lock: sha1:VYu1EtJh30XfqVJjFa7NZxAqM4k= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:204492 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96762 Archived-At: Christopher Howard wrote: > I'm not a guru, but I would think you could get a similiar result > writing an interactive lisp function. Just looking at the docs, I was > thinking > > (expand-file-name (pwd)) > > with a function around that to save it for pasting. Only problem is > that, apparently, the `pwd' function includes other junk in the string > along with the expanded file name. Any thoughts from the real > gurus...? Well, `pwd' really only does (message "Directory %s" default-directory) so (expand-file-name default-directory) should do the trick. Putting it in the kill ring (which should normally make it available for pasting outside Emacs) is not difficult either: (kill-new (expand-file-name default-directory)) Wrap it in an interactive function: (defun my-copy-pwd () "Copy the current directory to the kill ring." (interactive) (kill-new (expand-file-name default-directory))) And assign it to a key: (global-set-key "C-c p" 'my-copy-pwd) There ya go! -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)