unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* is there any hook like switch-buffer-hook or change-buffer-hook?
@ 2004-08-27  0:48 Vektor
  2004-08-27  6:29 ` Joakim Hove
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Vektor @ 2004-08-27  0:48 UTC (permalink / raw)


i want to do something when i switch among buffers, but i don't find
variable like switch-buffer-hook or change-buffer-hook.

or there is another way to do such a thing?

thanks in advance.

-- 
Remove all XYZ from my email to get the real one.

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
  2004-08-27  0:48 is there any hook like switch-buffer-hook or change-buffer-hook? Vektor
@ 2004-08-27  6:29 ` Joakim Hove
  2004-08-28  5:41   ` Vektor
  2004-08-27  7:23 ` Sandip Chitale
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Joakim Hove @ 2004-08-27  6:29 UTC (permalink / raw)



Vektor <XYZvektorXYZ@XYZyeahXYZ.net> writes:

> i want to do something when i switch among buffers, but i don't find
> variable like switch-buffer-hook or change-buffer-hook.

I dont know for sure, but a quick check of: M-x apropos 'buffer.*hook'
revealed nothing.

> or there is another way to do such a thing?

Maybe you could try to advise the set-buffer or switch-to-buffer
functions. See the section "Advising Functions" in the Elisp (info)
manual.


HTH - Joakim


-- 
Joakim Hove
hove AT ift uib no
+47 (55 5)8 27 90
http://www.ift.uib.no/~hove/

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
  2004-08-27  0:48 is there any hook like switch-buffer-hook or change-buffer-hook? Vektor
  2004-08-27  6:29 ` Joakim Hove
@ 2004-08-27  7:23 ` Sandip Chitale
  2004-08-27 10:04   ` Eli Zaretskii
       [not found]   ` <mailman.325.1093601689.1998.help-gnu-emacs@gnu.org>
  2004-08-27 12:51 ` Johan Bockgård
  2004-08-27 16:18 ` Stefan Monnier
  3 siblings, 2 replies; 8+ messages in thread
From: Sandip Chitale @ 2004-08-27  7:23 UTC (permalink / raw)


List of hook variables:

How did I get these?
C-h v TAB gives me list of all variables. Then I filtered words with word 'hook' in them.
See if you find one you need.

after-init-hook
after-revert-hook
after-save-hook
after-setting-font-hook
align-load-hook
apropos-mode-hook
auto-image-file-mode-hook
auto-save-hook
before-init-hook
before-make-frame-hook
before-revert-hook
browse-url-of-file-hook
bytecomp-load-hook
c++-mode-hook
c-initialization-hook
c-mode-common-hook
c-mode-hook
c-prepare-bug-report-hooks
c-special-indent-hook
calendar-load-hook
calendar-move-hook
change-major-mode-hook
clone-buffer-hook
color-theme-mode-hook
comint-exec-hook
comint-mode-hook
command-hook-internal
compilation-mode-hook
completion-setup-hook
custom-define-hook
custom-mode-hook
cvs-dired-use-hook
desktop-delay-hook
desktop-save-hook
diary-display-hook
diary-hook
dired-after-readin-hook
dired-before-readin-hook
dired-load-hook
dired-mode-hook
disabled-command-hook
dtd-mode-hooks
ecb-activate-before-layout-draw-hook
ecb-activate-before-new-frame-created-hook
ecb-activate-hook
ecb-deactivate-hook
ecb-post-command-hooks
ecb-unhighlight-hook-called
echo-area-clear-hook
edebug-setup-hook
ediff-after-session-group-setup-hook
ediff-after-setup-control-frame-hook
ediff-after-setup-windows-hook
ediff-before-session-group-setup-hooks
ediff-before-setup-control-frame-hook
ediff-before-setup-hook
ediff-before-setup-windows-hook
ediff-cleanup-hook
ediff-display-help-hook
ediff-keymap-setup-hook
ediff-load-hook
ediff-meta-buffer-keymap-setup-hook
ediff-mode-hook
ediff-prepare-buffer-hook
ediff-quit-hook
ediff-quit-merge-hook
ediff-quit-session-group-hook
ediff-registry-setup-hook
ediff-select-hook
ediff-show-registry-hook
ediff-show-session-group-hook
ediff-startup-hook
ediff-suspend-hook
ediff-unselect-hook
eieio-hook
electric-help-mode-hook
emacs-lisp-mode-hook
emacs-startup-hook
exit-language-environment-hook
find-file-hooks
find-file-not-found-hooks
find-tag-hook
first-change-hook
font-lock-mode-hook
global-font-lock-mode-hook
hack-local-variables-hook
help-mode-hook
hs-hide-hook
idl-mode-hook
imenu-after-jump-hook
inferior-lisp-mode-hook
inhibit-modification-hooks
inhibit-point-motion-hooks
initial-calendar-window-hook
input-method-activate-hook
input-method-after-insert-chunk-hook
input-method-inactivate-hook
isearch-mode-end-hook
isearch-mode-hook
java-mode-hook
jde-bug-minor-mode-hook
jde-compile-finish-hook
jde-db-mode-hook
jde-dbs-debugger-hook
jde-entering-java-buffer-hook
jde-mode-hook
jde-package-load-hook
jde-project-hooks
jde-run-mode-hook
kill-buffer-hook
kill-emacs-hook
lisp-interaction-mode-hook
lisp-mode-hook
list-diary-entries-hook
local-write-file-hooks
log-view-mode-hook
makefile-mode-hook
mark-diary-entries-hook
menu-bar-update-hook
minibuffer-exit-hook
minibuffer-setup-hook
mouse-leave-buffer-hook
nongregorian-diary-listing-hook
nongregorian-diary-marking-hook
objc-mode-hook
outline-view-change-hook
pike-mode-hook
post-command-hook
post-command-idle-hook
pre-abbrev-expand-hook
pre-command-hook
print-diary-entries-hook
quail-activate-hook
quickurl-reread-hook-postfix
recentf-load-hook
recentf-mode-hook
rmail-delete-message-hook
rmail-get-new-mail-hook
rmail-mode-hook
rmail-quit-hook
rmail-show-message-hook
scheme-mode-hook
semantic-after-partial-cache-change-hook
semantic-after-toplevel-bovinate-hook
semantic-after-toplevel-cache-change-hook
semantic-auto-parse-mode-hook
semantic-before-toplevel-bovination-hook
semantic-before-toplevel-cache-flush-hook
semantic-change-hooks
semantic-clean-token-hooks
semantic-dirty-token-hooks
semantic-init-db-hooks
semantic-init-hooks
semantic-no-reparse-needed-change-hook
semantic-pre-clean-token-hooks
semantic-reparse-needed-change-hook
semantic-show-dirty-mode-hook
semantic-show-unmatched-syntax-mode-hook
semantic-summary-mode-hook
semantic-unmatched-syntax-hook
semanticdb-hooks
semanticdb-mode-hooks
semanticdb-save-database-hooks
semanticdb-semantic-init-hook-overload
senator-minor-mode-hook
session-after-load-save-file-hook
session-before-save-hook
set-language-environment-hook
show-paren-mode-hook
signal-hook-function
speedbar-before-delete-hook
speedbar-before-popup-hook
speedbar-load-hook
speedbar-mode-hook
speedbar-reconfigure-keymaps-hook
speedbar-scanner-reset-hook
speedbar-timer-hook
speedbar-vc-in-control-hook
speedbar-vc-path-enable-hook
speedbar-visiting-file-hook
speedbar-visiting-tag-hook
suspend-hook
suspend-resume-hook
swbuff-load-hook
temp-buffer-resize-mode-hook
temp-buffer-setup-hook
temp-buffer-show-hook
term-setup-hook
texinfo-mode-hook
text-mode-hook
today-invisible-calendar-hook
today-visible-calendar-hook
tool-bar-mode-hook
unify-8859-on-decoding-mode-hook
unify-8859-on-encoding-mode-hook
vc-before-checkin-hook
vc-checkin-hook
vc-checkout-hook
vc-log-after-operation-hook
vc-logentry-check-hook
vhdl-mode-hook
which-function-mode-hook
window-configuration-change-hook
window-setup-hook
write-contents-hooks
write-file-hooks

"Vektor" <XYZvektorXYZ@XYZyeahXYZ.net> wrote in message news:cgm0pk$muj$1@quimby.gnus.org...
> i want to do something when i switch among buffers, but i don't find
> variable like switch-buffer-hook or change-buffer-hook.
>
> or there is another way to do such a thing?
>
> thanks in advance.
>
> --
> Remove all XYZ from my email to get the real one.

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
  2004-08-27  7:23 ` Sandip Chitale
@ 2004-08-27 10:04   ` Eli Zaretskii
       [not found]   ` <mailman.325.1093601689.1998.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2004-08-27 10:04 UTC (permalink / raw)


> From: "Sandip Chitale" <sandipchitale@yahoo.com>
> Date: Fri, 27 Aug 2004 00:23:08 -0700
> 
> List of hook variables:
> 
> How did I get these?
> C-h v TAB gives me list of all variables. Then I filtered words with word 'hook' in them.

What's wrong with "M-x apropos-variable RET"?

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
  2004-08-27  0:48 is there any hook like switch-buffer-hook or change-buffer-hook? Vektor
  2004-08-27  6:29 ` Joakim Hove
  2004-08-27  7:23 ` Sandip Chitale
@ 2004-08-27 12:51 ` Johan Bockgård
  2004-08-27 16:18 ` Stefan Monnier
  3 siblings, 0 replies; 8+ messages in thread
From: Johan Bockgård @ 2004-08-27 12:51 UTC (permalink / raw)


Vektor <XYZvektorXYZ@XYZyeahXYZ.net> writes:

> i want to do something when i switch among buffers, but i don't find
> variable like switch-buffer-hook or change-buffer-hook.

http://groups.google.com/groups?selm=9409030443.AA01162@mole.gnu.ai.mit.edu

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
  2004-08-27  0:48 is there any hook like switch-buffer-hook or change-buffer-hook? Vektor
                   ` (2 preceding siblings ...)
  2004-08-27 12:51 ` Johan Bockgård
@ 2004-08-27 16:18 ` Stefan Monnier
  3 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2004-08-27 16:18 UTC (permalink / raw)


> i want to do something when i switch among buffers, but i don't find
> variable like switch-buffer-hook or change-buffer-hook.

I suspect that you don't really understand what is "a buffer
switch" seen from elisp's point of view (i.e. that you have your own idea
of what is a "buffer switch" but that Emacs would have to read your mind
in order to know when those things happen and when they don't).

So could you explain exactly what you want to do?


        Stefan

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
       [not found]   ` <mailman.325.1093601689.1998.help-gnu-emacs@gnu.org>
@ 2004-08-27 20:49     ` Sandip Chitale
  0 siblings, 0 replies; 8+ messages in thread
From: Sandip Chitale @ 2004-08-27 20:49 UTC (permalink / raw)


"Eli Zaretskii" <eliz@gnu.org> wrote in message
news:mailman.325.1093601689.1998.help-gnu-emacs@gnu.org...
> > From: "Sandip Chitale" <sandipchitale@yahoo.com>
> > Date: Fri, 27 Aug 2004 00:23:08 -0700
> >
> > List of hook variables:
> >
> > How did I get these?
> > C-h v TAB gives me list of all variables. Then I filtered words with
word 'hook' in them.
>
> What's wrong with "M-x apropos-variable RET"?
>
Nothing. I simply did not know about it. Thanks for the info.

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

* Re: is there any hook like switch-buffer-hook or change-buffer-hook?
  2004-08-27  6:29 ` Joakim Hove
@ 2004-08-28  5:41   ` Vektor
  0 siblings, 0 replies; 8+ messages in thread
From: Vektor @ 2004-08-28  5:41 UTC (permalink / raw)


I have consult the elisp info and find this IS exactly what I need now.
Thank you again for the useful information.

Joakim Hove <hove@ift.uib.no> writes:

> Maybe you could try to advise the set-buffer or switch-to-buffer
> functions. See the section "Advising Functions" in the Elisp (info)
> manual.
>

-- 
Remove all XYZ from my email to get the real one.

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

end of thread, other threads:[~2004-08-28  5:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-27  0:48 is there any hook like switch-buffer-hook or change-buffer-hook? Vektor
2004-08-27  6:29 ` Joakim Hove
2004-08-28  5:41   ` Vektor
2004-08-27  7:23 ` Sandip Chitale
2004-08-27 10:04   ` Eli Zaretskii
     [not found]   ` <mailman.325.1093601689.1998.help-gnu-emacs@gnu.org>
2004-08-27 20:49     ` Sandip Chitale
2004-08-27 12:51 ` Johan Bockgård
2004-08-27 16:18 ` Stefan Monnier

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).