From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Bloggs Newsgroups: gmane.emacs.help Subject: buffer-name in find-file-hook Date: Wed, 03 Sep 2008 15:43:07 +0100 Message-ID: <87bpz5waro.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 1220456524 10760 80.91.229.12 (3 Sep 2008 15:42:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Sep 2008 15:42:04 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 03 17:42:59 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 1KauUI-0004Kq-1z for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 17:41:42 +0200 Original-Received: from localhost ([127.0.0.1]:39477 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KauTI-0000FO-Oy for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Sep 2008 11:40:40 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail Original-NNTP-Posting-Date: Wed, 03 Sep 2008 09:43:07 -0500 Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Cancel-Lock: sha1:ZJxy2EhSTaywpTyYjg92RzMthcA= Original-Lines: 17 X-Usenet-Provider: http://www.giganews.com Original-X-Trace: sv3-2d0qmi3aveOFnmAaQU04e8m/+lQ/oinfG5zMyAIdEwFfyupbTowxtXvdySsTNFdELF5AQO2UQLhPA0r!ZZJtQxC6qhxS9XEn8SZ2PrPBftUKHze8Mdl0lF4q4Vt3dB0XXqen Original-X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/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.39 Original-Xref: news.stanford.edu gnu.emacs.help:161885 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:57227 Archived-At: 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. Here is the function: ;; hook for re-hiding regions when new file is opened (defun hide-region-find-file-hook () (dolist (current hide-region-overlays) (if (eq (buffer-name) (car current)) etc... the problem is that the 'if' statement never evaluates to true. I tried debugging in edebug, and both (buffer-name) and (car current) evaluate to the same string, but for some reason the 'if' statement evaluates to 'nil'. I have used the same construct in another function that is called from within the buffer, and it works fine. Can anyone help?