all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Advising functions and major-mode?
@ 2008-10-13  9:34 Tyler Spivey
  2008-10-13 14:53 ` Lennart Borgman (gmail)
  0 siblings, 1 reply; 2+ messages in thread
From: Tyler Spivey @ 2008-10-13  9:34 UTC (permalink / raw)
  To: help-gnu-emacs

Hello. I am trying to get this (simplified example) to work, and would
like to know what is happening.
(defadvice list-buffers (after test pre act)
(message "%s" major-mode))

Here is what I think should happen, and what is happening.
1. I have set pop-up-windows to nil.
2. When this advice runs, it should print "Buffer-menu-mode". Instead,
it prints the mode of whatever I was in before entering list-buffers.

Is this just a case of the buffer not changing before redisplay or
something like that runs, or have I uncovered a bug?
I've tried adding force-mode-line-update, force-window-update, and
redisplay to the advice before the message, but no luck.

I'm running GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, GTK+ Version
2.12.11) of 2008-09-27 on arch1.


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

* Re: Advising functions and major-mode?
  2008-10-13  9:34 Advising functions and major-mode? Tyler Spivey
@ 2008-10-13 14:53 ` Lennart Borgman (gmail)
  0 siblings, 0 replies; 2+ messages in thread
From: Lennart Borgman (gmail) @ 2008-10-13 14:53 UTC (permalink / raw)
  Cc: help-gnu-emacs

Tyler Spivey wrote:
> Hello. I am trying to get this (simplified example) to work, and would
> like to know what is happening.
> (defadvice list-buffers (after test pre act)
> (message "%s" major-mode))
> 
> Here is what I think should happen, and what is happening.
> 1. I have set pop-up-windows to nil.
> 2. When this advice runs, it should print "Buffer-menu-mode". Instead,
> it prints the mode of whatever I was in before entering list-buffers.
> 
> Is this just a case of the buffer not changing before redisplay or
> something like that runs, or have I uncovered a bug?

When list-buffers normal code has finished you are back in the buffer
where you started.

> I've tried adding force-mode-line-update, force-window-update, and
> redisplay to the advice before the message, but no luck.
> 
> I'm running GNU Emacs 23.0.60.1 (x86_64-unknown-linux-gnu, GTK+ Version
> 2.12.11) of 2008-09-27 on arch1.
> 




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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-13  9:34 Advising functions and major-mode? Tyler Spivey
2008-10-13 14:53 ` Lennart Borgman (gmail)

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.