emacs-devel
[Top][All Lists]
Advanced

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

Package to highlight Lisp parens inconsistent with indentation


From: Barry OReilly
Subject: Package to highlight Lisp parens inconsistent with indentation
Date: Sun, 15 Dec 2013 18:54:54 -0500

> I'm writing a color-parens minor mode that will fontify parens if
> they are inconsistent with indentation. For example:
>
>    (if region
>        (setq beg (min jit-lock-start (car region))
>        end (max jit-lock-end (cdr region))))

I have the package to a point that I think is ready to consider for
ELPA.

To test its performance, I took the large cc-engine.el file and moved
the first top level close paren to the end of the file. I've found
redisplay is generally slower scrolling EOB to BOB, so I did that
holding the page-up key. The pages were redisplayed and viewable as I
did so.

>>> insert a "display only" close-paren (with suitable coloring).

>> There's probably less potential to cause user confusion if it
>> colors existing parens rather than color parens that are not
>> really a part of the file content.

> But if that existing paren is before window-start, the user won't
> see it.

It won't matter. If the open paren is not visible, the user can't draw
a conclusion about what indentation implies about the close paren's
location.

Also, I dislike breaking "what I see [in the buffer] is what I get [in
the file]" if I can at all help it.

That said, it wouldn't be too hard for someone to extend what I wrote
to highlight the line rather than the parens. So as to not foreclose
that possibility, a better name than "color-parens" might be in order.

Given how "fly" is used in some other packages, maybe "flylisp" is
descriptive and appropriately general? Are there other ideas?

I've attached the source code for consideration. Thank you.

Attachment: color-parens.el
Description: Text Data


reply via email to

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