[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: occur-hook changing the current buffer
From: |
Juanma Barranquero |
Subject: |
Re: occur-hook changing the current buffer |
Date: |
Wed, 22 Jun 2005 13:10:31 +0200 |
> Emacs can't, and shouldn't try to, protect against random crap in hooks,
Excuse me if I find this quite funny.
emacs -Q
C-x b test RET
aaaa RET
bbbb RET
bbbb RET
cccc RET
C-x 2
C-x o
M-x ielm RET
;; define hook in ielm
(add-hook 'occur-hook
'(lambda ()
(let ((w (get-buffer-window "*Occur*")))
(message "Before: B(%S), W(%S)" (current-buffer)
(selected-window))
(fit-window-to-buffer w)
(message "After : B(%S), W(%S)" (current-buffer)
(selected-window)))))
C-x o
M-x occur RET
bbbb RET
=> Buffer test is read-only
=> *Messages* has:
Before: B(#<buffer *Occur*>), W(#<window 3 on test>)
After : B(#<buffer test>), W(#<window 3 on test>)
What's exactly "crappy" about the hook function? I don't see anything
in `fit-window-to-buffer 'docs that suggest it should produce this
effect...
--
/L/e/k/t/u
- Re: occur-hook changing the current buffer, (continued)
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/23
- Re: occur-hook changing the current buffer, Juri Linkov, 2005/06/26
- Re: occur-hook changing the current buffer, Juanma Barranquero, 2005/06/27
- Re: occur-hook changing the current buffer, Richard M. Stallman, 2005/06/27
- Re: occur-hook changing the current buffer, Werner LEMBERG, 2005/06/27
- Re: occur-hook changing the current buffer, Juri Linkov, 2005/06/27
- Re: occur-hook changing the current buffer, Werner LEMBERG, 2005/06/28
- Re: occur-hook changing the current buffer, Richard M. Stallman, 2005/06/28
- Re: occur-hook changing the current buffer, Werner LEMBERG, 2005/06/29
- Re: occur-hook changing the current buffer, Richard M. Stallman, 2005/06/29
- Re: occur-hook changing the current buffer,
Juanma Barranquero <=
Re: occur-hook changing the current buffer, Richard M. Stallman, 2005/06/22