unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* buffer-name in find-file-hook
@ 2008-09-03 14:43 Joe Bloggs
  2008-09-03 15:38 ` Joost Kremers
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Joe Bloggs @ 2008-09-03 14:43 UTC (permalink / raw
  To: help-gnu-emacs

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?


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-14 21:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).