From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Newsgroups: gmane.emacs.bugs Subject: bug#9214: `fundamental-mode-hook' not run when setting up `fundamental-mode' under certain circumstances; Info documentation incorrect Date: Sun, 29 Jan 2012 17:34:27 +0100 Message-ID: <87pqe2zcvg.fsf@gmail.com> References: <87wrex4ejy.fsf@gmail.com> <87k44c3yg7.fsf@gnu.org> <87wr8bzic0.fsf@gmail.com> <87obtnqo9w.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1327854910 1861 80.91.229.3 (29 Jan 2012 16:35:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 Jan 2012 16:35:10 +0000 (UTC) Cc: Chong Yidong , 9214@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jan 29 17:35:08 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RrXiZ-0006tR-V2 for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jan 2012 17:35:04 +0100 Original-Received: from localhost ([::1]:43932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrXiZ-0002HL-HG for geb-bug-gnu-emacs@m.gmane.org; Sun, 29 Jan 2012 11:35:03 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrXiV-0002Gf-8D for bug-gnu-emacs@gnu.org; Sun, 29 Jan 2012 11:35:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrXiU-0005Zj-3n for bug-gnu-emacs@gnu.org; Sun, 29 Jan 2012 11:34:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrXiU-0005ZX-28 for bug-gnu-emacs@gnu.org; Sun, 29 Jan 2012 11:34:58 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1RrXiY-0003hW-07 for bug-gnu-emacs@gnu.org; Sun, 29 Jan 2012 11:35:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?=C5=A0t=C4=9Bp=C3=A1n_?= =?UTF-8?Q?N=C4=9Bmec?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 29 Jan 2012 16:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9214 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9214-submit@debbugs.gnu.org id=B9214.132785488614205 (code B ref 9214); Sun, 29 Jan 2012 16:35:01 +0000 Original-Received: (at 9214) by debbugs.gnu.org; 29 Jan 2012 16:34:46 +0000 Original-Received: from localhost ([127.0.0.1]:44000 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrXiI-0003h4-8v for submit@debbugs.gnu.org; Sun, 29 Jan 2012 11:34:46 -0500 Original-Received: from mail-ee0-f44.google.com ([74.125.83.44]:61799) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1RrXiF-0003go-3x for 9214@debbugs.gnu.org; Sun, 29 Jan 2012 11:34:44 -0500 Original-Received: by eekc1 with SMTP id c1so1869279eek.3 for <9214@debbugs.gnu.org>; Sun, 29 Jan 2012 08:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:content-transfer-encoding; bh=izdsnXki0gXozqiRjpqEXn/af6ayxWiCzT2sLyA/074=; b=kDLvWYnccJkcCjTMzi4RsBIVBtDWJxb/sXVrScd6Hq8kPogdV+X2Fn1tTLeX0ayIrC xxMICQgTNl2vlKzLerPeid0TtGbTblxkT7ZUMFJp9+W6q72SEjRaUqQ5/NqkRNEmXeec 0UbAGCnUl7e+1MgvL2QhjGn4YGTBXQScCaolE= Original-Received: by 10.213.31.141 with SMTP id y13mr2268759ebc.49.1327854872682; Sun, 29 Jan 2012 08:34:32 -0800 (PST) Original-Received: from localhost (176.119.broadband10.iol.cz. [90.177.119.176]) by mx.google.com with ESMTPS id n56sm60457864eeh.6.2012.01.29.08.34.29 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 Jan 2012 08:34:30 -0800 (PST) In-Reply-To: (Juanma Barranquero's message of "Sun, 29 Jan 2012 02:44:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:56201 Archived-At: On Sun, 29 Jan 2012 02:44:27 +0100 Juanma Barranquero wrote: > On Sun, Jan 29, 2012 at 02:40, Chong Yidong wrote: > >> Or use after-change-major-mode-hook. > > The OP's use case > > (with-current-buffer (get-buffer-create "f-m-test-buf") > major-mode) > > does not run after-change-major-mode-hook, I think. Exactly. I need a way to run code for _any_ new buffer (I don't really need to run the code for temporary buffers which never get any user interaction, but I don't think there is a way to set those apart), no matter how it is created. Is that really so much to ask? If so, I suppose a `display-buffer-functions' hook as proposed by Juanma on emacs-devel just now[1] would be something I could make do with (the problem with that solution would be that I only need to run the code once when the buffer is created, but I guess testing a variable every time a buffer is displayed isn't worse than running useless code for never-displayed temporary buffers). `after-change-major-mode-hook' is what I use, but it is not run for new default-moded buffers, even when I setq-default `major-mode' to something else than `fundamental-mode' (maybe because `major-mode' is only used when the buffer is created by `find-file'? The `major-mode' docstring needs some clarification in that respect). [1] --=20 =C5=A0t=C4=9Bp=C3=A1n