GNU bug report logs - #11929
24.1.50; Globalized minor mode turn-on function is called twice for each opened file

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dmitry Gutov <dgutov@HIDDEN>; dated Fri, 13 Jul 2012 04:31:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 13 Jul 2012 04:30:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Jul 13 00:30:33 2012
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
To: bug-gnu-emacs@HIDDEN
Subject: 24.1.50; Globalized minor mode turn-on function is called twice for
	each opened file
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-Debbugs-Envelope-To: submit
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




Acknowledgement sent to Dmitry Gutov <dgutov@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#11929; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 31 Oct 2014 17:00:04 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.