all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: chad <yandros@MIT.EDU>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
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	[thread overview]
Message-ID: <7CEBB461-93C5-4A30-B896-64A2C632367F@mit.edu> (raw)
In-Reply-To: <jwvfw64sgoa.fsf-monnier+emacs@gnu.org>


On 26 Sep 2012, at 13:01, Stefan Monnier <monnier@iro.umontreal.ca> 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                                                                                                                                                                             
find them generally useful for hooks I've been running with the                                                                                                                                                                               
following small patch to hl-line.el for several months, following                                                                                                                                                                            
the pattern in autofill and flyspell.              

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)))
  
+ 
+ ;;;###autoload
+ (defun turn-on-hl-line ()
+   "Unconditionally turn on highlight-line mode."
+   (hl-line-mode 1))
+ 
+ ;;;###autoload
+ (defun turn-off-hl-line ()
+   "Unconditionally turn off highlight-line mode."
+   (hl-line-mode -1))
+ 
+ (custom-add-option 'dired-mode-hook 'turn-on-hl-line)
+ 
+ 
  (defun hl-line-highlight ()
    "Activate the Hl-Line overlay on the current line."
    (if hl-line-mode	; Might be changed outside the mode function.




  parent reply	other threads:[~2012-09-26 21:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-06 16:21 PATCH: num3-mode for highlighting groups of digits in long numbers Michal Nazarewicz
2012-09-06 17:23 ` Lars Ingebrigtsen
2012-09-06 21:22 ` Stefan Monnier
2012-09-25 20:40   ` Michal Nazarewicz
2012-09-26  1:07     ` Stefan Monnier
2012-09-26 12:27       ` Michal Nazarewicz
2012-09-26 12:56         ` Noah Lavine
2012-09-26 13:06           ` Michal Nazarewicz
2012-09-26 14:58             ` Lennart Borgman
2012-09-26 20:02               ` Stefan Monnier
2012-09-26 20:01             ` Stefan Monnier
2012-09-26 21:33               ` Michal Nazarewicz
2012-09-26 21:44                 ` Stefan Monnier
2012-09-26 23:33                   ` Michal Nazarewicz
2012-09-26 21:36               ` chad [this message]
2012-09-26 21:47                 ` turn-on/off-*MODE* Stefan Monnier
2012-09-26 21:59               ` PATCH: num3-mode for highlighting groups of digits in long numbers felix
2012-09-06 23:18 ` Jambunathan K
2012-09-06 23:41   ` felix
2012-09-07  1:14   ` Michal Nazarewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7CEBB461-93C5-4A30-B896-64A2C632367F@mit.edu \
    --to=yandros@mit.edu \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.