From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nikolaj Schumacher Newsgroups: gmane.emacs.help Subject: Re: buffer-name in find-file-hook Date: Sun, 14 Sep 2008 23:10:54 +0200 Message-ID: References: <87bpz5waro.fsf@DEBLAP1.BeNet> <873ak5qa40.fsf@DEBLAP1.BeNet> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1221426685 16308 80.91.229.12 (14 Sep 2008 21:11:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2008 21:11:25 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Joe Bloggs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Sep 14 23:12:21 2008 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 1KeytI-0005YI-Do for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 23:12:20 +0200 Original-Received: from localhost ([127.0.0.1]:56133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KeysH-00056V-JB for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Sep 2008 17:11:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Keys0-00056Q-P8 for help-gnu-emacs@gnu.org; Sun, 14 Sep 2008 17:11:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Keyrz-00056E-3o for help-gnu-emacs@gnu.org; Sun, 14 Sep 2008 17:10:59 -0400 Original-Received: from [199.232.76.173] (port=47683 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Keyry-00056B-TW for help-gnu-emacs@gnu.org; Sun, 14 Sep 2008 17:10:58 -0400 Original-Received: from dd18200.kasserver.com ([85.13.138.168]:43950) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Keyry-0005aw-Nf for help-gnu-emacs@gnu.org; Sun, 14 Sep 2008 17:10:58 -0400 Original-Received: from thursday (BAH549e.bah.pppool.de [77.135.84.158]) by dd18200.kasserver.com (Postfix) with ESMTP id ACA1418027C40; Sun, 14 Sep 2008 23:11:01 +0200 (CEST) In-Reply-To: <873ak5qa40.fsf@DEBLAP1.BeNet> (Joe Bloggs's message of "Fri\, 12 Sep 2008 23\:21\:03 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:57586 Archived-At: Joe Bloggs wrote: > Nikolaj Schumacher writes: > >> Joe Bloggs 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