From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.emacs.help Subject: Re: How to prevent Emacs from translating beginning of file path into "~"? Date: Fri, 10 Apr 2015 11:22:33 +0200 Message-ID: <20150410092233.GA1875@tuxteam.de> References: <55277571.4060106@arlsoft.com> <83bniwv2bv.fsf@gnu.org> <20150410084946.GA32197@tuxteam.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1428657783 3158 80.91.229.3 (10 Apr 2015 09:23:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Apr 2015 09:23:03 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Yuri Khan Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 10 11:22:53 2015 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 1YgV9G-0007YE-Np for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2015 11:22:50 +0200 Original-Received: from localhost ([::1]:38252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgV9G-0004AZ-2T for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Apr 2015 05:22:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgV95-00049m-ID for help-gnu-emacs@gnu.org; Fri, 10 Apr 2015 05:22:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YgV92-0005yd-57 for help-gnu-emacs@gnu.org; Fri, 10 Apr 2015 05:22:39 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:56613 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YgV91-0005y9-UI for help-gnu-emacs@gnu.org; Fri, 10 Apr 2015 05:22:36 -0400 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1YgV8z-0000XE-RC; Fri, 10 Apr 2015 11:22:33 +0200 In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 5.199.139.25 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:103625 Archived-At: -----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, 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-----