From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Subversion of user chosen major mode by Emacs. [Was: My usage of imenu is broken.] Date: Wed, 29 May 2024 15:41:45 +0300 Message-ID: <86y17sssc6.fsf@gnu.org> References: <86r0dmtbk2.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6287"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed May 29 14:42:49 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sCIdk-0001Pg-PR for ged-emacs-devel@m.gmane-mx.org; Wed, 29 May 2024 14:42:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCIcr-0000Tz-Dc; Wed, 29 May 2024 08:41:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCIco-0000SF-9n for emacs-devel@gnu.org; Wed, 29 May 2024 08:41:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCIcm-0006iJ-GS; Wed, 29 May 2024 08:41:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=AAyJN8/LmHmukwvyR0yZ8/8SwgcymZm87RQ0D5RHcqA=; b=LireqNAqsbFl VB5qPMBv76aIRYWOxffVH5O2iDTcAmuWh0Abl3f/sfkPCvpAmv2rFKDzibDG1TQqn8ZVqF3ymDW41 WBAdhjH1wepkW8XKTA3HetX7aOqKcwUuVyGos0HYe06gfz9mQCdTl1XRIcIsXexVafv8BZMIigrS2 +hsdbDBnX6Efv97iKcaokU5Bc6zMCneHh66SGxqo5tonm1T5/OUfAHkc9iXYY+JgrbjG1u98uRg8V kE4ZtYdWsx5w0tEw3Ty3dEu9LvRVGXbsRHyGoHYWltQh/yS+E9q0EOLeLhlhUqcvGavCLpe6bxrON hwNE4H81we/Dz8C2gbqTZw==; In-Reply-To: (message from Alan Mackenzie on Wed, 29 May 2024 11:16:44 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319686 Archived-At: > Date: Wed, 29 May 2024 11:16:44 +0000 > Cc: Eli Zaretskii , emacs-devel@gnu.org > From: Alan Mackenzie > > As I said, when I did M-x revert-buffer yesterday, Emacs changed my > major mode from C Mode to c-ts-mode. This is clearly unacceptable. Please show a minimal recipe, starting from "emacs -Q", where reverting a buffer changes from c-mode to c-ts-mode. As a general rule, revert-buffer does not guarantee the major mode will remain the same, not by default. It calls normal-mode, so if anything has changed in automatic determination of the mode, you will get a different mode. This is by design.