[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11929: 24.1.50; Globalized minor mode turn-on function is called twi

From: Dmitry Gutov
Subject: bug#11929: 24.1.50; Globalized minor mode turn-on function is called twice for each opened file
Date: Fri, 13 Jul 2012 08:24:52 +0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

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.


In GNU Emacs (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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]