[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible to hook into Emacs's buffer name generation?
From: |
Sean McAfee |
Subject: |
Re: Possible to hook into Emacs's buffer name generation? |
Date: |
Sun, 20 Feb 2011 15:37:49 -0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) |
Leo <sdl.web@gmail.com> 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 "<component-x.y.z>"
>> 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.