unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nikolaj Schumacher <me@nschum.de>
To: Joe Bloggs <who@cares.invalid>
Cc: help-gnu-emacs@gnu.org
Subject: Re: buffer-name in find-file-hook
Date: Sun, 14 Sep 2008 23:10:54 +0200	[thread overview]
Message-ID: <m27i9eh1r5.fsf@nschum.de> (raw)
In-Reply-To: <873ak5qa40.fsf@DEBLAP1.BeNet> (Joe Bloggs's message of "Fri\, 12 Sep 2008 23\:21\:03 +0100")

Joe Bloggs <who@cares.invalid> wrote:

> Nikolaj Schumacher <me@nschum.de> writes:
>
>> Joe Bloggs <who@cares.invalid> wrote:
>>
>>> Hi, I am writing a function to add to find-file-hook for hiding text
>>> regions saved in a list. I need to know the buffer-name of the opened
>>> file, so that I can compare it with the buffer names of the saved
>>> regions.
>>
>> Why are you using the buffer name?  Wouldn't it be better to use
>> something more unique, i.e. the file name?
>>
>>
>> regards,
>> Nikolaj Schumacher
>
> I figured that I may want to move the file, but still keep the hidden
> regions.

Unfortunately files of the same name (say "README") will then also share
the same hidden regions.  On the other hand, buffers can be renamed or
"uniquified" and lose settings.

Maybe you could generate a hash to catch renamed files.


regards,
Nikolaj Schumacher




      reply	other threads:[~2008-09-14 21:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 14:43 buffer-name in find-file-hook Joe Bloggs
2008-09-03 15:38 ` Joost Kremers
2008-09-03 15:44   ` Joe Bloggs
2008-09-03 17:57 ` Nikolaj Schumacher
     [not found] ` <mailman.18339.1220464668.18990.help-gnu-emacs@gnu.org>
2008-09-12 22:21   ` Joe Bloggs
2008-09-14 21:10     ` Nikolaj Schumacher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m27i9eh1r5.fsf@nschum.de \
    --to=me@nschum.de \
    --cc=help-gnu-emacs@gnu.org \
    --cc=who@cares.invalid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).