emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mode line: 1) indicate region size, if active; 2) highlight column # if


From: Drew Adams
Subject: mode line: 1) indicate region size, if active; 2) highlight column # if > limit
Date: Wed, 6 Jun 2007 10:36:25 -0700

>     I'm not sure what's so good about this, since "(561,2)" needs just as
>     much space as "L561 C2" and seems less consistent.
>
> I think I thought it would be more natural as a way to state
> two-dimensional coordinates.
>
> Would people please install the patch in the trunk and in Emacs 22?


I made this suggestion last September (subject: `size-indication-mode'
tweak), to which Richard replied "It might be a good idea, but let's not
think about it now."

How about now? See attached image.

1. The size indicated is the region size when the region is active.

2. This size indicator gets the region face, to show this (green, in image).

3. The line and column indicator is highlighted (red, in image) when the
cursor passes a user-defined limit. (This version still uses the
(line#,column#) format.)


> Sent: Thursday, September 14
> After the release:
> How about considering this minor tweak to `size-indication-mode'?
> The doc string would also need to be updated accordingly.
>
> The idea is this: Whenever the region is active in transient-mark
> mode, the size indication shows the size of the region, not the
> size of the buffer.
>
> The implementation change is trivial - just use this for the
> `size-indication-mode' part of `mode-line-position':
>
> (size-indication-mode
>  (8 ,(propertize
>       (if (and transient-mark-mode mark-active)
>           (format " %d chars" (abs (- (mark t) (point))))
>         " of %I")
>       'face (and transient-mark-mode mark-active 'region)
>       'help-echo help-echo)))
>
> where help-echo is bound as usual.
>
> FYI - This library does that, as well as highlighting the column
> number when
> the current column is greater than a given limit (option):
> (http://www.emacswiki.org/cgi-bin/wiki/modeline-posn.el)

Attachment: modeline-posn.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]