X-Loop: help-debbugs@HIDDEN Subject: bug#11929: 24.1.50; Globalized minor mode turn-on function is called twice for each opened file Resent-From: Dmitry Gutov <dgutov@HIDDEN> Original-Sender: debbugs-submit-bounces <at> debbugs.gnu.org Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Fri, 13 Jul 2012 04:31:01 +0000 Resent-Message-ID: <handler.11929.B.134215383332399 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 11929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 11929 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.134215383332399 (code B ref -1); Fri, 13 Jul 2012 04:31:01 +0000 Received: (at submit) by debbugs.gnu.org; 13 Jul 2012 04:30:33 +0000 Received: from localhost ([127.0.0.1]:38003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1SpXWT-0008QV-1F for submit <at> debbugs.gnu.org; Fri, 13 Jul 2012 00:30:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44417) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from <dgutov@HIDDEN>) id 1SpXWR-0008QN-2c for submit <at> debbugs.gnu.org; Fri, 13 Jul 2012 00:30:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <dgutov@HIDDEN>) id 1SpXR0-0001wn-P2 for submit <at> debbugs.gnu.org; Fri, 13 Jul 2012 00:24:55 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:48669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dgutov@HIDDEN>) id 1SpXR0-0001we-LZ for submit <at> debbugs.gnu.org; Fri, 13 Jul 2012 00:24:54 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54027) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <dgutov@HIDDEN>) id 1SpXQz-0003I9-LZ for bug-gnu-emacs@HIDDEN; Fri, 13 Jul 2012 00:24:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <dgutov@HIDDEN>) id 1SpXQy-0001wJ-El for bug-gnu-emacs@HIDDEN; Fri, 13 Jul 2012 00:24:53 -0400 Received: from forward2.mail.yandex.net ([77.88.46.7]:40180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <dgutov@HIDDEN>) id 1SpXQy-0001wD-2A for bug-gnu-emacs@HIDDEN; Fri, 13 Jul 2012 00:24:52 -0400 Received: from smtp2.mail.yandex.net (smtp2.mail.yandex.net [77.88.46.102]) by forward2.mail.yandex.net (Yandex) with ESMTP id 8F9DD12A3E8F for <bug-gnu-emacs@HIDDEN>; Fri, 13 Jul 2012 08:24:50 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342153490; bh=yP8QMO/MCMR+LRGwNVAcDNp5A7Ost0WKd/84apNgvBU=; h=Message-ID:Date:From:MIME-Version:To:Subject:Content-Type: Content-Transfer-Encoding; b=QmUK0pqSTq7YQdG0C37ZMoytGRW0mhopPL9M3LMVbWWfFnmT3fT2Cdnfl5YPlTdEm uEWb+OV25qOXi4IKlic3qFppS3H93szuSqbh0L60Xe6n73kujofSH6AWsEG0W1OW9B wzH0qoBEkgol5NIwYsefck9Xp0+dwVzu89yE8Djc= Received: from smtp2.mail.yandex.net (localhost [127.0.0.1]) by smtp2.mail.yandex.net (Yandex) with ESMTP id 7D117E2031C for <bug-gnu-emacs@HIDDEN>; Fri, 13 Jul 2012 08:24:50 +0400 (MSK) Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp2.mail.yandex.net (nwsmtp/Yandex) with ESMTP id OnY4kZwL-OoYeOOrX; Fri, 13 Jul 2012 08:24:50 +0400 X-Yandex-Rcpt-Suid: bug-gnu-emacs@HIDDEN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1342153490; bh=yP8QMO/MCMR+LRGwNVAcDNp5A7Ost0WKd/84apNgvBU=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Content-Transfer-Encoding; b=lfD3YIePGZRqVjPQu4nV9uIdqkQftin2P+a1Pr61cbr7oNtAMrvwFaxHIomZcioEP 7qy8JfrZ79S6bSCmRN1v8zmNIYPinBT2scd04A09HU8arSb2iFJkyLGDTPHKTozcTk WbFryPVgQJdCAjIZ3d3lZTdqO0n+BoHOkyjKSoSY= Message-ID: <4FFFA314.5030509@HIDDEN> Date: Fri, 13 Jul 2012 08:24:52 +0400 From: Dmitry Gutov <dgutov@HIDDEN> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.2 (------) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Sender: debbugs-submit-bounces <at> debbugs.gnu.org Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org X-Spam-Score: -6.2 (------) I raised the topic on help-gnu-emacs previously, but hadn't received an answer: http://lists.gnu.org/archive/html/help-gnu-emacs/2012-07/msg00174.html How to reproduce. 1. Define the minor mode: (define-minor-mode foo-mode "" :lighter "") (defun turn-on-foo-mode () (message "buffer %s major mode %s" (buffer-name) major-mode) (foo-mode 1)) (define-globalized-minor-mode global-foo-mode foo-mode turn-on-foo-mode) 2. Turn on the global mode. 3. Open any file, look at the *Messages* buffer. It will contain something like this: buffer init.el major mode fundamental-mode buffer init.el major mode emacs-lisp-mode If the buffer is going to be immediately switched to another mode, there's no point in calling the turn-on function in the default mode. I think this behavior is buggy. --Dmitry In GNU Emacs 24.1.50.1 (i386-mingw-nt6.1.7601) of 2012-07-11 on SOL Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --with-gcc (3.4) --cflags -IH:/Apps/System/gnuwin32/include' Important settings: value of $EMACSDATA: C:/Users/gutov/vc/emacs-master/etc value of $EMACSDOC: C:/Users/gutov/vc/emacs-master/etc value of $EMACSLOADPATH: C:/Users/gutov/vc/emacs-master/site-lisp;C:/Users/gutov/vc/emacs-master/../site-lisp;C:/Users/gutov/vc/emacs-master/lisp;C:/Users/gutov/vc/emacs-master/leim value of $EMACSPATH: C:/Users/gutov/vc/emacs-master/bin value of $LANG: RU locale-coding-system: cp1251 default enable-multibyte-characters: t
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Dmitry Gutov <dgutov@HIDDEN> Subject: bug#11929: Acknowledgement (24.1.50; Globalized minor mode turn-on function is called twice for each opened file) Message-ID: <handler.11929.B.134215383332399.ack <at> debbugs.gnu.org> References: <4FFFA314.5030509@HIDDEN> X-Gnu-PR-Message: ack 11929 X-Gnu-PR-Package: emacs Reply-To: 11929 <at> debbugs.gnu.org Date: Fri, 13 Jul 2012 04:31:01 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-gnu-emacs@HIDDEN If you wish to submit further information on this problem, please send it to 11929 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 11929: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11929 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#11929: 24.1.50; Globalized minor mode turn-on function is called twice for each opened file Resent-From: Lars Ingebrigtsen <larsi@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-gnu-emacs@HIDDEN Resent-Date: Sat, 17 Aug 2019 22:00:02 +0000 Resent-Message-ID: <handler.11929.B11929.156607916519415 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 11929 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Dmitry Gutov <dgutov@HIDDEN> Cc: 11929 <at> debbugs.gnu.org Received: via spool by 11929-submit <at> debbugs.gnu.org id=B11929.156607916519415 (code B ref 11929); Sat, 17 Aug 2019 22:00:02 +0000 Received: (at 11929) by debbugs.gnu.org; 17 Aug 2019 21:59:25 +0000 Received: from localhost ([127.0.0.1]:56977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1hz6jM-000535-VS for submit <at> debbugs.gnu.org; Sat, 17 Aug 2019 17:59:25 -0400 Received: from quimby.gnus.org ([80.91.231.51]:56008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <larsi@HIDDEN>) id 1hz6jJ-00052t-OD for 11929 <at> debbugs.gnu.org; Sat, 17 Aug 2019 17:59:23 -0400 Received: from [50.225.213.182] (helo=sandy) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <larsi@HIDDEN>) id 1hz6jF-0004LF-TC; Sat, 17 Aug 2019 23:59:20 +0200 From: Lars Ingebrigtsen <larsi@HIDDEN> References: <4FFFA314.5030509@HIDDEN> Date: Sat, 17 Aug 2019 14:59:14 -0700 In-Reply-To: <4FFFA314.5030509@HIDDEN> (Dmitry Gutov's message of "Fri, 13 Jul 2012 08:24:52 +0400") Message-ID: <87blwnlah9.fsf@HIDDEN> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dmitry Gutov <dgutov@HIDDEN> writes: > 1. Define the minor mode: > > (define-minor-mode foo-mode "" :lighter "") > > (defun turn-on-foo-mode () > (message "buffer %s major mode %s" (buffer-name) major-mode) > (foo-mode 1)) > > (define-gl [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Dmitry Gutov <dgutov@HIDDEN> writes: > 1. Define the minor mode: > > (define-minor-mode foo-mode "" :lighter "") > > (defun turn-on-foo-mode () > (message "buffer %s major mode %s" (buffer-name) major-mode) > (foo-mode 1)) > > (define-globalized-minor-mode global-foo-mode foo-mode turn-on-foo-mode) > > 2. Turn on the global mode. > > 3. Open any file, look at the *Messages* buffer. > It will contain something like this: > > buffer init.el major mode fundamental-mode > buffer init.el major mode emacs-lisp-mode > > If the buffer is going to be immediately switched to another mode, > there's no point in calling the turn-on function in the default mode. > I think this behavior is buggy. If I understand you correctly, you don't think that buffers should first be opened in `fundamental-mode', and then the "real" major mode, because this means that globalised minor modes get switched on twice? I agree that this seems like surprising behaviour, but I think it's been this way since forever, so perhaps it should just be documented? I'm not sure where, though... in the `define-globalized-minor-mode' doc string, perhaps? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no
Received: (at control) by debbugs.gnu.org; 10 Jan 2024 11:36:45 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 10 06:36:45 2024 Received: from localhost ([127.0.0.1]:42281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1rNWt3-00063E-0Q for submit <at> debbugs.gnu.org; Wed, 10 Jan 2024 06:36:45 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]:48360) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <stefankangas@HIDDEN>) id 1rNWt1-00062w-IY for control <at> debbugs.gnu.org; Wed, 10 Jan 2024 06:36:43 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-555bd21f9fdso4571745a12.0 for <control <at> debbugs.gnu.org>; Wed, 10 Jan 2024 03:36:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704886590; x=1705491390; darn=debbugs.gnu.org; h=to:subject:message-id:date:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=upA5Y+A5GaD1sS8qIu8Vfgv7NiYj/goYhDOvSc1O8ns=; b=PARjuuoiITSwfnoTYALYzvTg38ctEaOjeOLgGvXP0iWlNcygyGO3jSgrKa3d0l2/Ge yoaZVn8NA0vC0/9eZNklBHHJiW3GeeQzppDt9xWmNNyCTooxV7vRdHP5FbXihSF79Zzv fTDCut6KKVJEnjXon/vwloZnrbU36sVHMTHFlde8A6s9vjue2Oc/fw+JdJO2qKH/o7ja BMsjpY8zw/x2lmVSj4g6tUl4EBvKB2yCd3m7+gU/pptb2HH7P61WmL8RrmdnFxhDdckY e1NE1OZNtfwmoj8vXLhxV7/7VVFxv7jMIxWazR0pxNXD+/kyFPpZVn5kQbbW96nfirhr MRRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704886590; x=1705491390; h=to:subject:message-id:date:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=upA5Y+A5GaD1sS8qIu8Vfgv7NiYj/goYhDOvSc1O8ns=; b=sPmtzc68VAHrJm3g6Dmrlw2HNFhIeQXv6XFJke8mk2IhT3jiNsFM6lXvN3kOQmskb4 kIfH00oxeSzWHpilGlNLgXY3XfBYnCQr3f3NqjgrF8YyKErvolGmPGZRfEACXyW8vqyk WuZdIWxx3oZPqQ9eXrLNFOmDVYGP+1V/Lrv+3PiK3Mr+WiMUbuLKP5kwxLbFdicW/Wij blolOCYSe4gOEZhKnUXNWFkwsPS5HnYcb8xop/ikehsZSGN4lxXG+holC7/anMMSGECP cB/5Db07ZFvcJ2SKS4LB5FFEg0Rc0qgwDjtOLRpeDvjUMEwPvDJZQb0QHQcKSs2/gqP8 7/bQ== X-Gm-Message-State: AOJu0Yw8iXLZkpToPZQ1cub9+9kGFYWC3blssjh7n3pDStjSE2XXF51/ 7PGbnSpxuW2pKi477KvSIrPVeWlaooYR3uqVp681Ih+bHNnd6g== X-Google-Smtp-Source: AGHT+IFt7MI2S2dc0Zxt30DBqkJoRID3DLLNON63KyPSJIJ539Pt3uobY5nIrAVevKd36T197e3e7xG2iDEm7PM7tzg= X-Received: by 2002:aa7:c403:0:b0:555:11da:fff3 with SMTP id j3-20020aa7c403000000b0055511dafff3mr354477edq.33.1704886589687; Wed, 10 Jan 2024 03:36:29 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 10 Jan 2024 03:36:29 -0800 From: Stefan Kangas <stefankangas@HIDDEN> MIME-Version: 1.0 Date: Wed, 10 Jan 2024 03:36:29 -0800 Message-ID: <CADwFkmnnnKny8FrCdOxckxTHNwALJbsoc8cvsfpOz_cEhFEcnQ@HIDDEN> Subject: control message for bug #11929 To: control <at> debbugs.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) severity 11929 minor quit
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.