unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Michael Reilly <pmr@pajato.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: Another neat Eclipse'ism
Date: Sat, 21 Jun 2008 07:32:33 -0400	[thread overview]
Message-ID: <485CE6D1.2010006@pajato.com> (raw)
In-Reply-To: <jwvfxr89nrw.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>>> While I try to do most of my editing from Emacs, occasionally I will
>>>> find myself using the Eclipse Java editor.  One of the more convenient
>>>> niceties, in the absence of auto-fill-mode, is having the print-margin
>>>> displayed.  This is a useful feature in its own right, i.e. show a 1
>>>> pixel background line in Emacs where the right margin is set.
>>>> Needless to say, I have not a clue how to implement it.
>>> Not 100% the same but there is column-marker-mode available (search the
>>> emacswiki).  It will highlight a given column iff the line is at least
>>> that long.
>> FWIW, column-marker.el is pretty cool but it pales by comparison to the
>> approach used in Eclipse.   The Eclipse solution is barely noticeable
>> whereas the Emacs highlighting solution is very much in your face. If truth
>> be told I like the merged notion of having multiple such column indicators
>> that can be tailored by width and face.  I have a strong hunch they will
>> need to be implemented at the C level.  I wonder how to do that ... and if
>> this is an itch I want to scratch right about now ...
> 
> All the Elisp-level approaches are just hacks.  You might be able to get
> reasonably far at the Elisp level, depending on your tolerance to pain.
> 
> But one question remains: for what is this meant?  If it's for
> `fill-column', then there's a problem with variable-width fonts since
> in that case fill-column has a variable pixel position.

Good question and very good point.  And this is where I get kind of
stuck in moving any further.  The answer to the question, if it is
one, may ramble but I'll try.  And the point about variable width
fonts means that the solution is by necessity either limited to
fixed-width fonts (more likely) or fairly complex.

About six months ago I started a Java, Eclipse based, project inside a
very loose organization --- little or no standards and a lot of ugly
existing code to fix/enhance or otherwise grok.  I also started using
a pair of 1920x1200 resolution monitors.  My preference is to keep the
width of code lines around 80 characters so that if and when they are
ever printed they look reasonable and to minimize the need to scroll.
That put me in a minority of one.  Most of the existing code seemed to
have been written by people who felt that entire methods should
consist of a single line of code ... well a slight exaggeration but it
makes the point.  Fixing this code in Emacs is a piece of cake between
C-x = and auto fill mode but in Eclipse it was a pain until I
discovered the existence of the print margin facility.  When using
Eclipse it serves as a constant and gentle reminder (mostly because it
is only 1 pixel wide and does not alter the existing text) of where
the (mostly imaginary) boundary is.

Because of the large monitors I started to keep a full screen instance
of Emacs running split vertically.  It was doing this that keyed off
the desire to have that low intensity margin indication.  With such a
large amount of screen real estate it is "nice" to know where the
boundary is but hardly necessary.

Then I read about column-marker.el where it mentions that some
languages with fixed column constraints, like Fortran, still are used.
This is where multiple, variable (pixel) width, faceable column
indicators make even more sense.  But useful enough to want to start
hacking at the graphics level?  I've another hunch that the solution
is platform dependent.  Certainly toolkit dependent which makes it a
lot of work for not a lot of bang.  In Eclipse it is easier because of
SWT.  If a solution was doable in a day or so with not a lot of risk
about breaking other code it might be worth pursuing.  I'm guessing
this is not the case.

So in a nutshell, my interest is less associated with fill-column and 
more closely related to showing grid-lines in a table or print margins 
in wysiwyg editor.

I think the solution for variable width fonts has to be distance based
and not so much a particular column number, i.e. more complicated
already.

> Personally, I use a much simpler solution: I use my right window border
> as "vertical column".  It has worked for as long as I remember (even
> under xterm) and it saves screen real estate.

This has the consequence of either having text off screen or folded
with ugly fringe arrows.  Both are past my pain threshold.  But I'll
confess that at one point I did think of using this solution.  It
certainly does work.

Thanks,

-pmr





  reply	other threads:[~2008-06-21 11:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19  7:58 Another neat Eclipse'ism Paul Michael Reilly
2008-06-19  9:15 ` David Hansen
2008-06-19 15:27   ` Drew Adams
2008-06-20 14:11   ` Paul Michael Reilly
2008-06-20 14:41     ` Stefan Monnier
2008-06-21 11:32       ` Paul Michael Reilly [this message]
2008-06-21 11:44         ` Lennart Borgman (gmail)
2008-06-21 18:22         ` Stefan Monnier
2008-06-20 16:44     ` Drew Adams
2008-06-21 11:36       ` Paul Michael Reilly
2008-06-21 12:32         ` Lennart Borgman (gmail)
2008-06-21 16:03         ` Drew Adams

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=485CE6D1.2010006@pajato.com \
    --to=pmr@pajato.com \
    --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 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).