From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: chad Newsgroups: gmane.emacs.devel Subject: turn-on/off-*MODE* (was: Re: PATCH: num3-mode for highlighting groups of digits in long numbers) Date: Wed, 26 Sep 2012 14:36:04 -0700 Message-ID: <7CEBB461-93C5-4A30-B896-64A2C632367F@mit.edu> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.1 \(1498\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1348695377 16194 80.91.229.3 (26 Sep 2012 21:36:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2012 21:36:17 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 26 23:36:22 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TGzHK-0006xJ-Eb for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2012 23:36:22 +0200 Original-Received: from localhost ([::1]:36846 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGzHF-0003Yz-D6 for ged-emacs-devel@m.gmane.org; Wed, 26 Sep 2012 17:36:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGzH9-0003Wb-ME for emacs-devel@gnu.org; Wed, 26 Sep 2012 17:36:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TGzH8-00069L-Np for emacs-devel@gnu.org; Wed, 26 Sep 2012 17:36:11 -0400 Original-Received: from dmz-mailsec-scanner-6.mit.edu ([18.7.68.35]:46513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TGzH8-000690-Ez for emacs-devel@gnu.org; Wed, 26 Sep 2012 17:36:10 -0400 X-AuditID: 12074423-b7fab6d0000008f9-46-50637548324a Original-Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id BF.B1.02297.84573605; Wed, 26 Sep 2012 17:36:08 -0400 (EDT) Original-Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q8QLa8GN009742; Wed, 26 Sep 2012 17:36:08 -0400 Original-Received: from [10.0.0.162] ([12.198.236.170]) (authenticated bits=0) (User authenticated as yandros@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q8QLa4CC016281 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 26 Sep 2012 17:36:06 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.1498) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrGIsWRmVeSWpSXmKPExsUixCmqretRmhxgsLPV2uLxgiesFt9+bWV2 YPJom2bmsf7NXqYApigum5TUnMyy1CJ9uwSujFVHmxkLdvNVrLizkb2BcS5HFyMnh4SAicSF U9eYIGwxiQv31rN1MXJxCAnsY5R4cOEFK4SzgVGie20rE4SzkkmiZ9lZVpAWZgEtiRv/XgIl ODh4BfQkVnXzgISFBTIlHq6fzwgSZhOQAZqqARLmBFo27dpxRhCbRUBV4viBdhaIKeISP+72 QU3Ulli28DUziM0rYCUx8XUDI8TaA0wS2xb+BUuICOhKnPgGcYKEgKzEvRe/2SYwCs5CctEs hItmIRm7gJF5FaNsSm6Vbm5iZk5xarJucXJiXl5qka6ZXm5miV5qSukmRlDwsrso72D8c1Dp EKMAB6MSD+8H2+QAIdbEsuLK3EOMkhxMSqK8xwuAQnxJ+SmVGYnFGfFFpTmpxYcYJTiYlUR4 n2UlBQjxpiRWVqUW5cOkpDlYlMR5r6Xc9BcSSE8sSc1OTS1ILYLJynBwKEnwRpcADRUsSk1P rUjLzClBSDNxcIIM5wEaXgNSw1tckJhbnJkOkT/FqCglzutcDJQQAElklObB9cKSyytGcaBX hHk9QNp5gIkJrvsV0GAmoMFLN4FcXVySiJCSamAMEUt8/1C7K/myhlxi6XHvi/n1he2LTi1r SE4OefpQ/nFpw+eIzMcuddxX/x4XtHc/VXtQZpvEmYTCsLvVZ0pjEysePX0YKjbJ9N++2etE XyinLL061+nNZmaGiaJ1e1nm6CfOPNJdofZRP+y+59KUi7syjXs3zN3d8WzjpX/n X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 18.7.68.35 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153608 Archived-At: On 26 Sep 2012, at 13:01, Stefan Monnier = wrote: > - Removed turn-on-num3-mode since (num3-mode) does the same anyway. > I do see that when num3-mode is already enabled (turn-on-num3-mode) = did > nothing whereas (num3-mode) will call font-lock-fontify-buffer but if > that's a problem, we should fix num3-mode. Is there a general guideline for when to add or not add these? I = = = =20 find them generally useful for hooks I've been running with the = = = =20 following small patch to hl-line.el for several months, following = = = =20 the pattern in autofill and flyspell. =20 Thanks, *Chad *** 155,160 **** --- 155,174 ---- (remove-hook 'change-major-mode-hook #'hl-line-unhighlight t) (remove-hook 'pre-command-hook #'hl-line-unhighlight t))) =20 +=20 + ;;;###autoload + (defun turn-on-hl-line () + "Unconditionally turn on highlight-line mode." + (hl-line-mode 1)) +=20 + ;;;###autoload + (defun turn-off-hl-line () + "Unconditionally turn off highlight-line mode." + (hl-line-mode -1)) +=20 + (custom-add-option 'dired-mode-hook 'turn-on-hl-line) +=20 +=20 (defun hl-line-highlight () "Activate the Hl-Line overlay on the current line." (if hl-line-mode ; Might be changed outside the mode function.