unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Ideas for hl-line-mode
@ 2011-09-30  2:40 Dave Abrahams
  2011-09-30  6:59 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Abrahams @ 2011-09-30  2:40 UTC (permalink / raw)
  To: emacs-devel


I just realized that there are a whole bunch of modes where the
horizontal position of the cursor just doesn't matter, and that these
correspond almost exactly to where I want hl-line-mode active.  In these
modes would also want to make the cursor very close to the color of the
highlight.  It would be nice if emacs had a way for modes to represent
that they're "vertical-position-only modes" so that this sort of thing
could be set up programmatically.

Thoughts?

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-09-30  2:40 Ideas for hl-line-mode Dave Abrahams
@ 2011-09-30  6:59 ` Eli Zaretskii
  2011-09-30 14:17   ` Dave Abrahams
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2011-09-30  6:59 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-devel

> From: Dave Abrahams <dave@boostpro.com>
> Date: Thu, 29 Sep 2011 22:40:21 -0400
> 
> I just realized that there are a whole bunch of modes where the
> horizontal position of the cursor just doesn't matter, and that these
> correspond almost exactly to where I want hl-line-mode active.  In these
> modes would also want to make the cursor very close to the color of the
> highlight.  It would be nice if emacs had a way for modes to represent
> that they're "vertical-position-only modes" so that this sort of thing
> could be set up programmatically.

Does

   (eq (get major-mode 'mode-class) 'special)

do what you want?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-09-30  6:59 ` Eli Zaretskii
@ 2011-09-30 14:17   ` Dave Abrahams
  2011-09-30 15:01     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Abrahams @ 2011-09-30 14:17 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


on Fri Sep 30 2011, Eli Zaretskii <eliz-AT-gnu.org> wrote:

>> From: Dave Abrahams <dave@boostpro.com>
>
>> Date: Thu, 29 Sep 2011 22:40:21 -0400
>> 
>> I just realized that there are a whole bunch of modes where the
>> horizontal position of the cursor just doesn't matter, and that these
>> correspond almost exactly to where I want hl-line-mode active.  In these
>> modes would also want to make the cursor very close to the color of the
>> highlight.  It would be nice if emacs had a way for modes to represent
>> that they're "vertical-position-only modes" so that this sort of thing
>> could be set up programmatically.
>
> Does
>
>    (eq (get major-mode 'mode-class) 'special)
>
> do what you want?

Cool, I was hoping someone would point out an existing facility I didn't
know about...

Oh, interesting.  It's probably a very good heuristic, though I'm not
sure the description of this mode-class as "only for specially-prepared
text" really implies that horizontal position is irrelevant.

I'll try using it and see how it goes.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-09-30 14:17   ` Dave Abrahams
@ 2011-09-30 15:01     ` Eli Zaretskii
  2011-09-30 18:54       ` Rasmus Pank Roulund
  2011-09-30 21:53       ` Dave Abrahams
  0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2011-09-30 15:01 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-devel

> From: Dave Abrahams <dave@boostpro.com>
> Cc: emacs-devel@gnu.org
> Date: Fri, 30 Sep 2011 10:17:25 -0400
> 
> > Does
> >
> >    (eq (get major-mode 'mode-class) 'special)
> >
> > do what you want?
> 
> Cool, I was hoping someone would point out an existing facility I didn't
> know about...
> 
> Oh, interesting.  It's probably a very good heuristic, though I'm not
> sure the description of this mode-class as "only for specially-prepared
> text" really implies that horizontal position is irrelevant.

If you provide a list of those modes which you are interested in, we
could see whether the fact they are `special' is a coincidence or
something else.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-09-30 15:01     ` Eli Zaretskii
@ 2011-09-30 18:54       ` Rasmus Pank Roulund
  2011-09-30 21:53       ` Dave Abrahams
  1 sibling, 0 replies; 10+ messages in thread
From: Rasmus Pank Roulund @ 2011-09-30 18:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Dave Abrahams, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Dave Abrahams <dave@boostpro.com>
>> Cc: emacs-devel@gnu.org
>> Date: Fri, 30 Sep 2011 10:17:25 -0400
>> 
>> > Does
>> >
>> >    (eq (get major-mode 'mode-class) 'special)
>> >
>> > do what you want?
>> 
>> Cool, I was hoping someone would point out an existing facility I didn't
>> know about...
>> 
>> Oh, interesting.  It's probably a very good heuristic, though I'm not
>> sure the description of this mode-class as "only for specially-prepared
>> text" really implies that horizontal position is irrelevant.
>
> If you provide a list of those modes which you are interested in, we
> could see whether the fact they are `special' is a coincidence or
> something else.

It's a very good idea with a more general approach to this.  At the
moment I have the following in my .gnus:

#+begin_src emacs-lisp
(add-hook 'gnus-summary-mode-hook 'my-setup-hl-line)
(add-hook 'gnus-group-mode-hook 'my-setup-hl-line)

(defun my-setup-hl-line ()
  (hl-line-mode 1)
  (setq cursor-type nil))
#+end_src

–Rasmus

-- 
Sent from my Emacs




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-09-30 15:01     ` Eli Zaretskii
  2011-09-30 18:54       ` Rasmus Pank Roulund
@ 2011-09-30 21:53       ` Dave Abrahams
  2011-10-01  6:57         ` Eli Zaretskii
  1 sibling, 1 reply; 10+ messages in thread
From: Dave Abrahams @ 2011-09-30 21:53 UTC (permalink / raw)
  To: emacs-devel


on Fri Sep 30 2011, Eli Zaretskii <eliz-AT-gnu.org> wrote:

>> From: Dave Abrahams <dave@boostpro.com>
>
>> Cc: emacs-devel@gnu.org
>> Date: Fri, 30 Sep 2011 10:17:25 -0400
>> 
>> > Does
>> >
>> >    (eq (get major-mode 'mode-class) 'special)
>> >
>> > do what you want?
>> 
>> Cool, I was hoping someone would point out an existing facility I didn't
>> know about...
>> 
>> Oh, interesting.  It's probably a very good heuristic, though I'm not
>> sure the description of this mode-class as "only for
>> specially-prepared text" really implies that horizontal position is
>> irrelevant.
>
> If you provide a list of those modes which you are interested in, we
> could see whether the fact they are `special' is a coincidence or
> something else.

I'm interested in all present and future modes.  I don't see anything in
the manual that suggests the two sets in question will be/should be/are
identical.

Anyway, thanks; it's a start.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-09-30 21:53       ` Dave Abrahams
@ 2011-10-01  6:57         ` Eli Zaretskii
  2011-10-01 17:37           ` Dave Abrahams
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2011-10-01  6:57 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-devel

> From: Dave Abrahams <dave@boostpro.com>
> Date: Fri, 30 Sep 2011 17:53:13 -0400
> 
> > If you provide a list of those modes which you are interested in, we
> > could see whether the fact they are `special' is a coincidence or
> > something else.
> 
> I'm interested in all present and future modes.

I was asking about those modes where you'd like to see hl-line-mode
active.

> I don't see anything in the manual that suggests the two sets in
> question will be/should be/are identical.

From the ELisp manual:

   * If this mode is appropriate only for specially-prepared text
     produced by the mode itself (rather than by the user typing at the
     keyboard or by an external file), then the major mode command
     symbol should have a property named `mode-class' with value
     `special', put on as follows:

          (put 'funny-mode 'mode-class 'special)

     [...] Modes such as Dired, Rmail, and Buffer List use this feature.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-10-01  6:57         ` Eli Zaretskii
@ 2011-10-01 17:37           ` Dave Abrahams
  2011-10-01 17:58             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Dave Abrahams @ 2011-10-01 17:37 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


on Sat Oct 01 2011, Eli Zaretskii <eliz-AT-gnu.org> wrote:

>> From: Dave Abrahams <dave@boostpro.com>
>
>> Date: Fri, 30 Sep 2011 17:53:13 -0400
>> 
>> > If you provide a list of those modes which you are interested in, we
>> > could see whether the fact they are `special' is a coincidence or
>> > something else.
>> 
>> I'm interested in all present and future modes.
>
> I was asking about those modes where you'd like to see hl-line-mode
> active.
>
>> I don't see anything in the manual that suggests the two sets in
>> question will be/should be/are identical.
>
> From the ELisp manual:
>
>    * If this mode is appropriate only for specially-prepared text
>      produced by the mode itself (rather than by the user typing at the
>      keyboard or by an external file), then the major mode command
>      symbol should have a property named `mode-class' with value
>      `special', put on as follows:
>
>           (put 'funny-mode 'mode-class 'special)
>
>      [...] Modes such as Dired, Rmail, and Buffer List use this feature.

Exactly my point.  I read that text, and it doesn't suggest to me that
horizontal position will be irrelevant in those modes.  Consider an
Emacs tic-tac-toe game, for example.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-10-01 17:37           ` Dave Abrahams
@ 2011-10-01 17:58             ` Eli Zaretskii
  2011-10-01 18:25               ` Dave Abrahams
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2011-10-01 17:58 UTC (permalink / raw)
  To: Dave Abrahams; +Cc: emacs-devel

> From: Dave Abrahams <dave@boostpro.com>
> Cc: emacs-devel@gnu.org
> Date: Sat, 01 Oct 2011 13:37:40 -0400
> 
> I read that text, and it doesn't suggest to me that horizontal
> position will be irrelevant in those modes.

That's why I asked you to define "modes in which horizontal position
is irrelevant".

> Consider an Emacs tic-tac-toe game, for example.

Does it belong to the modes where you want hl-line-mode on or off?
Why?



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Ideas for hl-line-mode
  2011-10-01 17:58             ` Eli Zaretskii
@ 2011-10-01 18:25               ` Dave Abrahams
  0 siblings, 0 replies; 10+ messages in thread
From: Dave Abrahams @ 2011-10-01 18:25 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel


on Sat Oct 01 2011, Eli Zaretskii <eliz-AT-gnu.org> wrote:

>> From: Dave Abrahams <dave@boostpro.com>
>
>> Cc: emacs-devel@gnu.org
>> Date: Sat, 01 Oct 2011 13:37:40 -0400
>> 
>> I read that text, and it doesn't suggest to me that horizontal
>> position will be irrelevant in those modes.
>
> That's why I asked you to define "modes in which horizontal position
> is irrelevant".

Sorry, I didn't understand that you were asking for a definition.

The distinction is: modes in which the effects of any command invoked
(other than horizontal cursor movement commands) are determined solely
by the current line that point is on and are unaffected by the current
column.

>> Consider an Emacs tic-tac-toe game, for example.
>
> Does it belong to the modes where you want hl-line-mode on or off?

off (actually I also want to massively de-emphasize the cursor in that
set of modes)

> Why?

because in that mode, presumably, you'd be able to hit `SPC' on a square
of the board and get an "X" or "O" in that square, and several squares
are lined up horizontally on the same line in tic-tac-toe.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-10-01 18:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-30  2:40 Ideas for hl-line-mode Dave Abrahams
2011-09-30  6:59 ` Eli Zaretskii
2011-09-30 14:17   ` Dave Abrahams
2011-09-30 15:01     ` Eli Zaretskii
2011-09-30 18:54       ` Rasmus Pank Roulund
2011-09-30 21:53       ` Dave Abrahams
2011-10-01  6:57         ` Eli Zaretskii
2011-10-01 17:37           ` Dave Abrahams
2011-10-01 17:58             ` Eli Zaretskii
2011-10-01 18:25               ` Dave Abrahams

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).