From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.emacs.help Subject: Re: Is it possible to have a global minor mode disabled whenever a certain major mode is enabled? Date: Tue, 20 Jul 2010 06:42:10 +1200 Message-ID: <4C449C82.5070902@no8wireless.co.nz> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF4CE4E58B464120B2E5E3D50" X-Trace: dough.gmane.org 1279564940 16572 80.91.229.12 (19 Jul 2010 18:42:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 19 Jul 2010 18:42:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 19 20:42:17 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OavI9-0000Rx-6x for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jul 2010 20:42:17 +0200 Original-Received: from localhost ([127.0.0.1]:43142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OavI8-0007kE-M4 for geh-help-gnu-emacs@m.gmane.org; Mon, 19 Jul 2010 14:42:16 -0400 Original-Received: from [140.186.70.92] (port=43853 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OavHh-0007k3-Ko for help-gnu-emacs@gnu.org; Mon, 19 Jul 2010 14:41:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OavHg-0002IG-K7 for help-gnu-emacs@gnu.org; Mon, 19 Jul 2010 14:41:49 -0400 Original-Received: from jersey.rurallink.co.nz ([114.134.15.197]:36503 helo=smtp.rurallink.co.nz) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OavHg-0002ET-3q for help-gnu-emacs@gnu.org; Mon, 19 Jul 2010 14:41:48 -0400 Original-Received: from 114-134-6-5.rurallink.co.nz ([114.134.6.5] helo=[192.168.2.102]) by smtp.rurallink.co.nz with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1OavHB-0001d5-OD for help-gnu-emacs@gnu.org; Tue, 20 Jul 2010 06:41:18 +1200 User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100329) In-Reply-To: X-Enigmail-Version: 0.95.0 X-Rurallink-Authenticated-User: aidalgol@no8wireless.co.nz X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:74206 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF4CE4E58B464120B2E5E3D50 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable James Gregory wrote: > I have a global minor mode (highlight-symbol) that conflicts with a > major mode (js2-mode). I have seen an alternative implementation of > highlight symbol that doesn't conflict, but it has some issues of its > own. I would rather just disable highlight-symbol whenever js2-mode is > loaded, but I can't work out how to do this. >=20 > I have some code like this in my init files: >=20 > [snip] >=20 > But though the hook at the end is called, highlight-symbol is still > switched on in js2-mode buffers. I guess this might be because the > global minor mode is enabled after js2-mode has already loaded? Or > some other load-order issue. According to the Emacs manual, major-mode hooks are run as the *last* ste= p of initialisation, so I'm not sure why this isn't working for you. I have a= n idea that may or may not be helpful: if highlight-symbol can run hooks, h= ave it detect the major mode of the current buffer and disable itself. If th= at doesn't work, then, as a rather crude hack, you could have your js2-mode = hook run after a short delay, but that would be unreliable, as it's time depen= dent. HTH, Aidan --------------enigF4CE4E58B464120B2E5E3D50 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkxEnIkACgkQjyzTRvYJmaXkDgCfQ5rSwqkL9fZCqYV8jHW+AN6v l3wAn1N5jni5xfrY0aP18DaKezRMnMlL =Oc6Z -----END PGP SIGNATURE----- --------------enigF4CE4E58B464120B2E5E3D50--