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: Mon, 01 Aug 2011 12:22:09 +0200 Message-ID: <87wrex4ejy.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1312194474 13721 80.91.229.12 (1 Aug 2011 10:27:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2011 10:27:54 +0000 (UTC) To: 9214@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 01 12:27:47 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qnpir-000460-Qe for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Aug 2011 12:27:46 +0200 Original-Received: from localhost ([::1]:48220 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnpiq-0004vh-T1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Aug 2011 06:27:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnpio-0004va-Ig for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2011 06:27:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnpin-0004em-Ax for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2011 06:27:42 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnpin-0004ei-84 for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2011 06:27:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Qnpj7-0007Sd-TC; Mon, 01 Aug 2011 06:28:02 -0400 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-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Aug 2011 10:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 9214 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.131219443528622 (code B ref -1); Mon, 01 Aug 2011 10:28:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Aug 2011 10:27:15 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QnpiM-0007Ra-I4 for submit@debbugs.gnu.org; Mon, 01 Aug 2011 06:27:15 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QnpiJ-0007RS-Q7 for submit@debbugs.gnu.org; Mon, 01 Aug 2011 06:27:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnphx-0004Eb-4A for submit@debbugs.gnu.org; Mon, 01 Aug 2011 06:26:50 -0400 Original-Received: from lists.gnu.org ([140.186.70.17]:53073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnphx-0004EX-2f for submit@debbugs.gnu.org; Mon, 01 Aug 2011 06:26:49 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:38177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnphw-0004ui-3w for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2011 06:26:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qnphv-0004EL-8e for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2011 06:26:48 -0400 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:53984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qnphv-0004ED-45 for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2011 06:26:47 -0400 Original-Received: by fxg9 with SMTP id 9so5635293fxg.0 for ; Mon, 01 Aug 2011 03:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=b46MdLMWOrDKcXPlKxTwLY8NXIm3fUee20Tonxb9Vnc=; b=XJ9HyWwJTbPSA2Csaq6Y7rItOZKWoQK3iScZeE0JF+4vjg6Goe+DSkKisU+mdbs6Fs hj5hP+OOYhcUSTmYnaem0WSWfE3TsqgNEyIetnXoQnd/hdfYYr1iWflOUz+Ct/WcZh1q QieujYTiJysAGPenmQwQjuqJQa2D3PdzL67e8= Original-Received: by 10.223.57.136 with SMTP id c8mr2527724fah.21.1312194405853; Mon, 01 Aug 2011 03:26:45 -0700 (PDT) Original-Received: from localhost (176.119.broadband10.iol.cz [90.177.119.176]) by mx.google.com with ESMTPS id b14sm1582424fab.19.2011.08.01.03.26.43 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 01 Aug 2011 03:26:44 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 01 Aug 2011 06:28:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) 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:49753 Archived-At: (emacs-version) "GNU Emacs 24.0.50.6 (i686-pc-linux-gnu) of 2011-01-15 on headley" Steps to reproduce: ------------------- emacs -Q (defvar f-m-hook-run 0) (add-hook 'fundamental-mode-hook (lambda () (setq f-m-hook-run (1+ f-m-hook-run)))) (with-current-buffer (get-buffer-create "f-m-test-buf") major-mode) ;=3D> fundamental-mode f-m-hook-run ;=3D> 0 (with-current-buffer (get-buffer-create "f-m-test-buf") (fundamental-mode) major-mode) ;=3D> fundamental-mode f-m-hook-run ;=3D> 1 A related problem: (info "(elisp)Auto Major Mode") states: -- Command: fundamental-mode Fundamental mode is a major mode that is not specialized for anything in particular. Other major modes are defined in effect by comparison with this one--their definitions say what to change, starting from Fundamental mode. The `fundamental-mode' function does _not_ run any mode hooks; you're not supposed to customize it. (If you want Emacs to behave differently in Fundamental mode, change the _global_ state of Emacs.) Which is incorrect, as the recipe above shows (the hook _is_ run when `fundamental-mode' is called explicitly). --=20 =C5=A0t=C4=9Bp=C3=A1n