From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tyler Spivey Newsgroups: gmane.emacs.help Subject: Advising functions and major-mode? Date: Mon, 13 Oct 2008 02:34:07 -0700 Message-ID: <877i8ckfe8.fsf@pcdesk.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1223904943 18004 80.91.229.12 (13 Oct 2008 13:35:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Oct 2008 13:35:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Oct 13 15:36:40 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KpNb8-0003LZ-DV for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Oct 2008 15:36:34 +0200 Original-Received: from localhost ([127.0.0.1]:39021 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KpNa3-0002LT-G7 for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Oct 2008 09:35:27 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe10.iad.POSTED!7564ea0f!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:nljxQhiROlos4f15kZAWcUYN/is= Original-Lines: 17 Original-NNTP-Posting-Host: 70.68.146.221 Original-X-Complaints-To: internet.abuse@sjrb.ca Original-X-Trace: newsfe10.iad 1223890445 70.68.146.221 (Mon, 13 Oct 2008 09:34:05 UTC) Original-NNTP-Posting-Date: Mon, 13 Oct 2008 09:34:05 UTC Original-Xref: news.stanford.edu gnu.emacs.help:163385 X-Mailman-Approved-At: Mon, 13 Oct 2008 09:33:17 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:58732 Archived-At: 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.