From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sean McAfee Newsgroups: gmane.emacs.help Subject: Re: Possible to hook into Emacs's buffer name generation? Date: Sun, 20 Feb 2011 15:37:49 -0800 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1298245248 16249 80.91.229.12 (20 Feb 2011 23:40:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 20 Feb 2011 23:40:48 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 21 00:40:42 2011 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.69) (envelope-from ) id 1PrItH-0006v2-Ri for geh-help-gnu-emacs@m.gmane.org; Mon, 21 Feb 2011 00:40:36 +0100 Original-Received: from localhost ([127.0.0.1]:46494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrItH-0007S3-DG for geh-help-gnu-emacs@m.gmane.org; Sun, 20 Feb 2011 18:40:35 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.supernews.com!news.supernews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Sun, 20 Feb 2011 17:37:50 -0600 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:b1wPFbfp0luMaCD2+svXkto1Ko4= Original-Lines: 18 Original-X-Trace: sv3-rs2JggpdQHzOJlI4Tf4KTmUBX42u1iNxB8D/h902HxeG+fUGUDpMk/pDkMkXd6YD/dTeUAK+1TIn7ns!iCjyUAu+lHni8/cnt2HNKsEpQW2bJzSs15xK9iKnokZM+wK4NG/d82c5zqw= Original-X-Complaints-To: www.supernews.com/docs/abuse.html X-DMCA-Complaints-To: www.supernews.com/docs/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1913 Original-Xref: usenet.stanford.edu gnu.emacs.help:185110 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:79271 Archived-At: Leo writes: > On 2011-02-18 08:28 +0800, Sean McAfee wrote: >> I thought it might be cool to have Emacs automatically name buffers that >> are visiting files in my repository with a trailing "" >> when I open them, where component-x.y.z is simply the closest directory >> name above the file that matches that pattern. > Maybe you can build on top of uniquify.el? I hadn't known of uniquify, but after some experimentation it seems not to offer everything I'd like. In particular, I want a trailing component-x.y.z on the buffer name even when I'm not already visiting the same file in a different directory. uniquify only steps in when there's a name conflict. I wrote a short find-file hook to fix the buffer name, so it's not that big a deal.