From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.bugs Subject: bug#22348: 24.5; Mode hooks doesn't run as expected if the major mode of a new buffer is determined by the default major mode Date: Wed, 13 Jan 2016 05:05:50 +0100 Message-ID: <87lh7u2kf5.fsf@web.de> References: <87wprg2snf.fsf@linux-qg7d.fritz.box> <3f8u3vhhvl.fsf@fencepost.gnu.org> <5694330C.8080602@pointsman.de> <1jio2z7lm9.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1452658043 23193 80.91.229.3 (13 Jan 2016 04:07:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Jan 2016 04:07:23 +0000 (UTC) Cc: Rolf Ade , 22348@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Jan 13 05:07:12 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aJCiG-0003kA-8q for geb-bug-gnu-emacs@m.gmane.org; Wed, 13 Jan 2016 05:07:12 +0100 Original-Received: from localhost ([::1]:35257 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJCiC-0002cE-08 for geb-bug-gnu-emacs@m.gmane.org; Tue, 12 Jan 2016 23:07:08 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJCi9-0002c9-93 for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2016 23:07:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJCi6-0004o3-3V for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2016 23:07:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJCi5-0004nz-Vi for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2016 23:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aJCi5-0007I8-KA for bug-gnu-emacs@gnu.org; Tue, 12 Jan 2016 23:07:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Heerdegen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 13 Jan 2016 04:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22348-submit@debbugs.gnu.org id=B22348.145265796427950 (code B ref 22348); Wed, 13 Jan 2016 04:07:01 +0000 Original-Received: (at 22348) by debbugs.gnu.org; 13 Jan 2016 04:06:04 +0000 Original-Received: from localhost ([127.0.0.1]:47717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJChA-0007Gk-07 for submit@debbugs.gnu.org; Tue, 12 Jan 2016 23:06:04 -0500 Original-Received: from mout.web.de ([212.227.15.3]:53965) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aJCh8-0007GF-1g for 22348@debbugs.gnu.org; Tue, 12 Jan 2016 23:06:02 -0500 Original-Received: from drachen.dragon ([92.77.162.209]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0MOAmi-1aDiWC2alo-005ay3; Wed, 13 Jan 2016 05:05:52 +0100 In-Reply-To: <1jio2z7lm9.fsf@fencepost.gnu.org> (Glenn Morris's message of "Mon, 11 Jan 2016 18:16:30 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:R+6wMVVlRg1gt2xai7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ugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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:111572 Archived-At: Glenn Morris writes: > I'm saying the solution is probably as simple as: > > --- a/src/buffer.c > +++ b/src/buffer.c > @@ -1999,7 +1999,7 @@ the current buffer's major mode. */) > /* To select a nonfundamental mode, > select the buffer temporarily and then call the mode function. */ > > - record_unwind_protect (save_excursion_restore, save_excursion_save ()); > + record_unwind_current_buffer (); > > Fset_buffer (buffer); > call0 (function); I can confirm that this fixes the issue. Michael.