all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* unobstrusive way to show indentation
@ 2012-01-12 16:10 Le Wang
  2012-01-12 16:12 ` Le Wang
  2012-01-12 16:35 ` Stephen J. Turnbull
  0 siblings, 2 replies; 5+ messages in thread
From: Le Wang @ 2012-01-12 16:10 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 670 bytes --]

Hi,

How difficult would it be to implement some way to show indentation levels
in an unobstrusive way?  Sublime text and other modern editors do this by
drawing a thin vertical line down from (back-to-indentation).  I find it
really helpful when reading code.  This stackoverflow question clarifies
what I'm after, although I didn't ask it.  I find this really helpful when
reading a piece of code with many block levels, especially since the
standard indentation level for ruby is 2 spaces.

I guess it can be faked by changing the face of that column, but that would
be more obstrusive than a thin line.  Maybe there is another solution I
haven't thought of?

-- 
Le

[-- Attachment #2: Type: text/html, Size: 722 bytes --]

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

* Re: unobstrusive way to show indentation
  2012-01-12 16:10 unobstrusive way to show indentation Le Wang
@ 2012-01-12 16:12 ` Le Wang
  2012-01-12 16:39   ` Drew Adams
  2012-01-12 16:35 ` Stephen J. Turnbull
  1 sibling, 1 reply; 5+ messages in thread
From: Le Wang @ 2012-01-12 16:12 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 878 bytes --]

Oops.
http://stackoverflow.com/questions/8836336/sublime-text-2-like-block-highlighting-in-emacs

On Fri, Jan 13, 2012 at 12:10 AM, Le Wang <l26wang@gmail.com> wrote:

> Hi,
>
> How difficult would it be to implement some way to show indentation levels
> in an unobstrusive way?  Sublime text and other modern editors do this by
> drawing a thin vertical line down from (back-to-indentation).  I find it
> really helpful when reading code.  This stackoverflow question clarifies
> what I'm after, although I didn't ask it.  I find this really helpful when
> reading a piece of code with many block levels, especially since the
> standard indentation level for ruby is 2 spaces.
>
> I guess it can be faked by changing the face of that column, but that
> would be more obstrusive than a thin line.  Maybe there is another solution
> I haven't thought of?
>
> --
> Le
>



-- 
Le

[-- Attachment #2: Type: text/html, Size: 1322 bytes --]

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

* unobstrusive way to show indentation
  2012-01-12 16:10 unobstrusive way to show indentation Le Wang
  2012-01-12 16:12 ` Le Wang
@ 2012-01-12 16:35 ` Stephen J. Turnbull
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen J. Turnbull @ 2012-01-12 16:35 UTC (permalink / raw)
  To: Le Wang; +Cc: emacs-devel

Le Wang writes:

 > I guess it can be faked by changing the face of that column, but that would
 > be more obstrusive than a thin line.

In XEmacs you can use a background pixmap; make the pixmap a thin line
and there you go.  ISTR Emacs supports background pixmaps too, so this
should be possible, but I can't help you with the code since the APIs
are rather different.



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

* RE: unobstrusive way to show indentation
  2012-01-12 16:12 ` Le Wang
@ 2012-01-12 16:39   ` Drew Adams
  2012-01-13  3:31     ` Tim Connors
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2012-01-12 16:39 UTC (permalink / raw)
  To: 'Le Wang', emacs-devel

> How difficult would it be to implement some way to show
> indentation levels in an unobstrusive way?  Sublime text
> and other modern editors do this by drawing a thin
> vertical line down from (back-to-indentation).  I find it
> really helpful when reading code.  This stackoverflow
> question clarifies what I'm after, although I didn't ask it.
> I find this really helpful when reading a piece of code
> with many block levels, especially since the standard
> indentation level for ruby is 2 spaces.
>		
> I guess it can be faked by changing the face of that column,
> but that would be more obstrusive than a thin line.  Maybe
> there is another solution I haven't thought of? 
>
http://stackoverflow.com/questions/8836336/sublime-text-2-like-block-highlightin
g-in-emacs

It's not quite the same thing, but you get a similar benefit from the features
mentioned here:

http://www.emacswiki.org/emacs/HighlightCurrentColumn
http://www.emacswiki.org/emacs/VlineMode

Vline can use a thin line (or a face). Column-marker highlighting stays put
(doesn't move with the cursor), and you can highlight any number of columns, but
it uses a face, not a thin line.




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

* RE: unobstrusive way to show indentation
  2012-01-12 16:39   ` Drew Adams
@ 2012-01-13  3:31     ` Tim Connors
  0 siblings, 0 replies; 5+ messages in thread
From: Tim Connors @ 2012-01-13  3:31 UTC (permalink / raw)
  To: Drew Adams; +Cc: emacs-devel, 'Le Wang'

On Thu, 12 Jan 2012, Drew Adams wrote:

> > How difficult would it be to implement some way to show
> > indentation levels in an unobstrusive way?  Sublime text
> > and other modern editors do this by drawing a thin
> > vertical line down from (back-to-indentation).  I find it
> > really helpful when reading code.  This stackoverflow
> > question clarifies what I'm after, although I didn't ask it.
> > I find this really helpful when reading a piece of code
> > with many block levels, especially since the standard
> > indentation level for ruby is 2 spaces.
...
> http://stackoverflow.com/questions/8836336/sublime-text-2-like-block-highlightin
> g-in-emacs
...
> http://www.emacswiki.org/emacs/HighlightCurrentColumn
> http://www.emacswiki.org/emacs/VlineMode
...

Thanks.  Found vline a bit slow though - slowed down cursor movement a lot
despite adjusting timer values (which seemed to be ignored - but maybe I
was meant to touch them before initialising the library).  But
col-highlight is neat enough.

Looks like sublime does it quite nicely.  I wonder if someone with more
elisp-fu than myself wants to go ahead and try to reproduce it :)

-- 
Tim Connors



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

end of thread, other threads:[~2012-01-13  3:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12 16:10 unobstrusive way to show indentation Le Wang
2012-01-12 16:12 ` Le Wang
2012-01-12 16:39   ` Drew Adams
2012-01-13  3:31     ` Tim Connors
2012-01-12 16:35 ` Stephen J. Turnbull

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.