[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
buffer-name in find-file-hook
From: |
Joe Bloggs |
Subject: |
buffer-name in find-file-hook |
Date: |
Wed, 03 Sep 2008 15:43:07 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
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?
- buffer-name in find-file-hook,
Joe Bloggs <=