unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Joe Bloggs <who@cares.invalid>
To: help-gnu-emacs@gnu.org
Subject: buffer-name in find-file-hook
Date: Wed, 03 Sep 2008 15:43:07 +0100	[thread overview]
Message-ID: <87bpz5waro.fsf@DEBLAP1.BeNet> (raw)

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?


             reply	other threads:[~2008-09-03 14:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 14:43 Joe Bloggs [this message]
2008-09-03 15:38 ` buffer-name in find-file-hook 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

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=87bpz5waro.fsf@DEBLAP1.BeNet \
    --to=who@cares.invalid \
    --cc=help-gnu-emacs@gnu.org \
    /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).