From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francis Moreau Newsgroups: gmane.emacs.help Subject: Re: Customize dired buffer names Date: Sun, 17 Jan 2010 12:43:05 -0800 (PST) Organization: http://groups.google.com Message-ID: <0cfacf1c-983e-4d4f-8e20-c3dca8356a1b@m3g2000yqf.googlegroups.com> References: <2dcdf560-2617-4a5f-b5f6-92584fc7c9f5@e27g2000yqd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1263764488 7326 80.91.229.12 (17 Jan 2010 21:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jan 2010 21:41:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 17 22:41:21 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NWcs4-0002p5-SG for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 22:41:21 +0100 Original-Received: from localhost ([127.0.0.1]:56585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWcs5-0008HP-Cd for geh-help-gnu-emacs@m.gmane.org; Sun, 17 Jan 2010 16:41:21 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!postnews.google.com!m3g2000yqf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-NNTP-Posting-Host: 82.235.205.153 Original-X-Trace: posting.google.com 1263760985 32424 127.0.0.1 (17 Jan 2010 20:43:05 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 17 Jan 2010 20:43:05 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m3g2000yqf.googlegroups.com; posting-host=82.235.205.153; posting-account=ekTE0goAAADiVCThPmo4ph0C5bTUhQOx User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.249.43 Safari/532.5, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:176210 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:71281 Archived-At: On 17 jan, 00:09, Juri Linkov wrote: > > I'd like to change the way that the dired buffers got their names. > > > For now it's juste the name of the directory, but I'd like to add > > "" as prefix for example. > > > Is it possible ? > > I use the following snippet to name dired buffers with absolute names: > > (add-hook 'dired-after-readin-hook > =A0 =A0 =A0 =A0 =A0 (lambda () > =A0 =A0 =A0 =A0 =A0 =A0 ;; Name dired buffers by absolute directory names= . > =A0 =A0 =A0 =A0 =A0 =A0 ;; Use `generate-new-buffer-name' for vc-director= y > =A0 =A0 =A0 =A0 =A0 =A0 ;; which creates duplicate buffers. > =A0 =A0 =A0 =A0 =A0 =A0 (rename-buffer (generate-new-buffer-name dired-di= rectory)) > =A0 =A0 =A0 =A0 =A0 =A0 )) > > You could use something like > > =A0 (rename-buffer (concat "" (directory-file-name dired-directory= ))) Ok, I'll do that. Thanks both for your suggestions.