From: "Stefan Monnier" <monnier+gnu/emacs@rum.cs.yale.edu>
Cc: Stefan Monnier <monnier+gnu/emacs@rum.cs.yale.edu>
Subject: Re: Suggestion for hl-line.el
Date: Thu, 15 May 2003 11:50:46 -0400 [thread overview]
Message-ID: <200305151550.h4FFokqA023107@rum.cs.yale.edu> (raw)
In-Reply-To: sgdsmrg49oi.fsf@occarina.pna.cwi.nl
> > Well, if it's up to me... I like the idea of one local mode that is
> > governed by a hl-line-sticky-flag variable and one non-sticky global
> > mode that is implemented directly. I guess nobody will want to use a
> > sticky global mode.
>
> I committed this change. If you like, you could take a look and see
> how bad I messed up. (I'd appreciate it.)
Since you asked for it ;-)
- Use present tense in the ChangeLog message (I've just changed it).
- Replace (1+ (line-end-position)) with (line-beginning-position 2)
(I know this was already in the code before, but I just noticed it).
- I hate code duplication so I'd have kept a single highlight and a single
unhighlight function. Basically, I'd have aimed for something like:
(define-minor-mode global-hl-line-mode
"foo"
(setq-default hl-line-mode global-hl-line-mode)
(if global-hl-line-mode
(progn
(add-hook 'pre-command-hook #'hl-line-unhighlight)
(add-hook 'post-command-hook #'hl-line-highlight))
(global-hl-line-unhighlight)
(remove-hook 'pre-command-hook #'hl-line-unhighlight)
(remove-hook 'post-command-hook #'hl-line-highlight)))
- Ideally, doing M-x global-hl-line-mode and then M-x hl-line-mode
should give you hl-line in all buffers except the current one.
Merging the global and local mode may not be as simple as
I make it out to be, tho, especially w.r.t. the hl-line-overlay
(which I wouldn't `make-variable-buffer-local' but would
rather `make-local-variable' in hl-line-mode).
This said, thank you for writing it,
Stefan
next prev parent reply other threads:[~2003-05-15 15:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-07 12:33 Suggestion for hl-line.el Lute Kamstra
2003-05-07 14:46 ` Stefan Monnier
2003-05-08 7:00 ` Lute Kamstra
2003-05-08 14:48 ` Stefan Monnier
2003-05-09 11:59 ` Lute Kamstra
2003-05-15 13:32 ` Lute Kamstra
2003-05-15 15:50 ` Stefan Monnier [this message]
2003-05-16 10:07 ` Lute Kamstra
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200305151550.h4FFokqA023107@rum.cs.yale.edu \
--to=monnier+gnu/emacs@rum.cs.yale.edu \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).