From MAILER-DAEMON Wed Aug 17 18:12:28 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QtoLc-00010M-HT
	for mharc-bug-global@gnu.org; Wed, 17 Aug 2011 18:12:28 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60701)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jani@nikula.org>) id 1QtbZZ-0000IV-LS
	for bug-global@gnu.org; Wed, 17 Aug 2011 04:34:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jani@nikula.org>) id 1QtbZY-0002Bp-Dn
	for bug-global@gnu.org; Wed, 17 Aug 2011 04:34:01 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:32963)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jani@nikula.org>) id 1QtbZY-0002Bf-BJ
	for bug-global@gnu.org; Wed, 17 Aug 2011 04:34:00 -0400
Received: by vxj3 with SMTP id 3so771253vxj.0
	for <bug-global@gnu.org>; Wed, 17 Aug 2011 01:33:59 -0700 (PDT)
Received: by 10.52.112.130 with SMTP id iq2mr734589vdb.137.1313570038857;
	Wed, 17 Aug 2011 01:33:58 -0700 (PDT)
Received: from doommachine (bensakone.com [92.243.29.139])
	by mx.google.com with ESMTPS id q2sm612140vcb.47.2011.08.17.01.33.56
	(version=TLSv1/SSLv3 cipher=OTHER);
	Wed, 17 Aug 2011 01:33:57 -0700 (PDT)
Date: Wed, 17 Aug 2011 11:33:54 +0300 (EEST)
From: Jani Nikula <jani@nikula.org>
To: bug-global@gnu.org
Subject: gtags.el: run mode hooks as the last thing
Message-ID: <alpine.DEB.2.00.1108171113250.2880@qbbzznpuvar>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.169
X-Mailman-Approved-At: Wed, 17 Aug 2011 18:12:26 -0400
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Aug 2011 08:34:02 -0000


Hi -

After the changes in the default key and mouse mappings in the recent 
versions of gtags.el, the mode hooks are no longer the last thing run when 
entering the mode. If I wanted to have gtags-suggested-key-mapping t, but 
disable or modify some key mapping in a hook, it would not be possible. 
It's a minor thing, but I think the correct order would be as in the patch 
below.

BR,
Jani.


--- gtags.orig	2011-08-17 11:07:47.982839234 +0300
+++ gtags.el	2011-08-17 11:08:34.582839262 +0300
@@ -688,7 +688,6 @@
    (setq gtags-mode
        (if (null forces) (not gtags-mode)
          (> (prefix-numeric-value forces) 0)))
-  (run-hooks 'gtags-mode-hook)
    ; Suggested key mapping
    (if gtags-suggested-key-mapping
        (progn
@@ -712,6 +711,7 @@
              (define-key gtags-mode-map [mouse-3] 'gtags-pop-stack)
              (define-key gtags-mode-map [mouse-2] 'gtags-find-tag-by-event)))
    )
+  (run-hooks 'gtags-mode-hook)
  )

  ;; make gtags select-mode
@@ -737,7 +737,6 @@
    (setq gtags-current-buffer (current-buffer))
    (goto-char (point-min))
    (message "[GTAGS SELECT MODE] %d lines" (count-lines (point-min) (point-max)))
-  (run-hooks 'gtags-select-mode-hook)
    ; Mouse key mapping
    (if gtags-suggested-key-mapping
        (progn
@@ -748,6 +747,7 @@
              (define-key gtags-select-mode-map [mouse-3] 'gtags-pop-stack)
              (define-key gtags-select-mode-map [mouse-2] 'gtags-select-tag-by-event)))
    )
+  (run-hooks 'gtags-select-mode-hook)
  )

  (provide 'gtags)


From MAILER-DAEMON Wed Aug 17 20:02:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qtq3x-0006PZ-Tf
	for mharc-bug-global@gnu.org; Wed, 17 Aug 2011 20:02:21 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53005)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1Qtq3u-0006O6-Sp
	for bug-global@gnu.org; Wed, 17 Aug 2011 20:02:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1Qtq3t-0002RP-MR
	for bug-global@gnu.org; Wed, 17 Aug 2011 20:02:18 -0400
Received: from msa101lp.auone-net.jp ([222.3.140.164]:46510)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1Qtq3t-0002R5-6M
	for bug-global@gnu.org; Wed, 17 Aug 2011 20:02:17 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa101lp.auone-net.jp (au one net msa) with ESMTP id 3A08F18C038;
	Thu, 18 Aug 2011 09:02:13 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p7I02DW4002236;
	Thu, 18 Aug 2011 09:02:13 +0900 (JST)
Message-Id: <201108180002.p7I02DW4002236@tamacom.com>
To: Jani Nikula <jani@nikula.org>
Subject: Re: gtags.el: run mode hooks as the last thing
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <alpine.DEB.2.00.1108171113250.2880@qbbzznpuvar>
In-reply-to: Message from Jani Nikula <jani@nikula.org> of "Wed,
	17 Aug 2011 11:33:54 +0300."
	<alpine.DEB.2.00.1108171113250.2880@qbbzznpuvar>
Date: Thu, 18 Aug 2011 09:02:13 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.164
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Aug 2011 00:02:20 -0000

Hi
You are right. I was my mistake.
It will be fixed in the next release.
Thank you.
> 
> Hi -
> 
> After the changes in the default key and mouse mappings in the recent 
> versions of gtags.el, the mode hooks are no longer the last thing run when 
> entering the mode. If I wanted to have gtags-suggested-key-mapping t, but 
> disable or modify some key mapping in a hook, it would not be possible. 
> It's a minor thing, but I think the correct order would be as in the patch 
> below.
> 
> BR,
> Jani.
> 
> 
> --- gtags.orig	2011-08-17 11:07:47.982839234 +0300
> +++ gtags.el	2011-08-17 11:08:34.582839262 +0300
> @@ -688,7 +688,6 @@
>     (setq gtags-mode
>         (if (null forces) (not gtags-mode)
>           (> (prefix-numeric-value forces) 0)))
> -  (run-hooks 'gtags-mode-hook)
>     ; Suggested key mapping
>     (if gtags-suggested-key-mapping
>         (progn
> @@ -712,6 +711,7 @@
>               (define-key gtags-mode-map [mouse-3] 'gtags-pop-stack)
>               (define-key gtags-mode-map [mouse-2] 'gtags-find-tag-by-event)))
>     )
> +  (run-hooks 'gtags-mode-hook)
>   )
> 
>   ;; make gtags select-mode
> @@ -737,7 +737,6 @@
>     (setq gtags-current-buffer (current-buffer))
>     (goto-char (point-min))
>     (message "[GTAGS SELECT MODE] %d lines" (count-lines (point-min) (point-max)))
> -  (run-hooks 'gtags-select-mode-hook)
>     ; Mouse key mapping
>     (if gtags-suggested-key-mapping
>         (progn
> @@ -748,6 +747,7 @@
>               (define-key gtags-select-mode-map [mouse-3] 'gtags-pop-stack)
>               (define-key gtags-select-mode-map [mouse-2] 'gtags-select-tag-by-event)))
>     )
> +  (run-hooks 'gtags-select-mode-hook)
>   )
> 
>   (provide 'gtags)
> 
> _______________________________________________
> Bug-global mailing list
> Bug-global@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-global
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


