Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: mic-paren.el 3.10 available

6 views
Skip to first unread message

Thien-Thi Nguyen

unread,
Jul 26, 2012, 12:19:28 AM7/26/12
to rffl...@gmail.com, help-gn...@gnu.org
[NB: CC updated; we use the "sources" list to post/announce source code.]

() rffl...@gmail.com
() Wed, 25 Jul 2012 14:54:57 -0700 (PDT)

As I use Viper, a Vim-emulation mode, I looked into the customization
group mic-paren-matching, hoping to find a way to emulate the way Vim
uses to highlight parentheses. I found nothing. Do you confirm it
is so?

No, but that's not saying much -- i don't use Vim. FWIW, my mic-paren
usage is very simple:

http://www.gnuvola.org/software/personal-elisp/dist/lisp/low-stress/turn-on-mic-paren.el

Basically, since Vim uses both a bar cursor and a block cursor,
depending on context it highilights sometimes the parenthesis before
the cursor and sometimes the one after the cursor.

Could you please give an example or point to one on the net?

--
Thien-Thi Nguyen GPG key: 4C807502

........... please send technical questions to mailing lists ...........
. .... .
. NB: ttn at glug dot org is not me .
. (and has not been since 2007 or so) .
. ACCEPT NO SUBSTITUTES :-D .

rffl...@gmail.com

unread,
Jul 26, 2012, 11:22:52 AM7/26/12
to gnu.ema...@googlegroups.com, help-gn...@gnu.org
On 07/26/2012 05:19 AM, Thien-Thi Nguyen wrote:> [NB: CC updated; we use the "sources" list to post/announce source code.]
>
> () Wed, 25 Jul 2012 14:54:57 -0700 (PDT)
>
> As I use Viper, a Vim-emulation mode, I looked into the customization
> group mic-paren-matching, hoping to find a way to emulate the way Vim
> uses to highlight parentheses. I found nothing. Do you confirm it
> is so?
>
> No, but that's not saying much -- i don't use Vim. FWIW, my mic-paren
> usage is very simple:
>
> http://www.gnuvola.org/software/personal-elisp/dist/lisp/low-stress/turn-on-mic-paren.el
>
> Basically, since Vim uses both a bar cursor and a block cursor,
> depending on context it highilights sometimes the parenthesis before
> the cursor and sometimes the one after the cursor.
>
> Could you please give an example or point to one on the net?
>

Thank you for your prompt reply.

I thought that firing up Vim and checking out its behaviour first hand would have been worth a hundred words, but asking an Emacs user to use Vim is rude, isn't it? ;-)

Jokes apart, I would have liked to record and link a explanatory video, but I wasn't able to install any desktop recorder on my PC. I'll have to rely on words.

Vim matches brackets in two ways, depending on whether you are typing text or moving around, as typing text and moving around are two different modes in Vim.
When you are moving around, Vim matches the bracket after point. This behaviour is crucial because, while moving around, you can't go beyond the last character on the line: if such character were a bracket, you would not be able to match it.

When you are typing text, Vim matches:
- the bracket after point, if there is one;
- otherwise the bracket before point, if there is one.

Also, Vim always highlights both brackets.

Try it with this snippet (trailing whitespace is intentional):

( (()) )
[ [[]] ]

Vim also instantly highlights all mismatched closing parentheses, while ignoring square brackets and curly brackets, at least while editing Lisp code - which is the only code I edit in Vim - but I think that such behaviour is beyond the goals of mic-paren anyway.

I've noticed that mic-paren ignores curly brackets. This is intentional, I suppose, as mic-paren targets Lisp code, but if it were able to match curly brackets as well, then it would be useful in other programming modes.

Have a nice day.

Raffaele Ricciardi

unread,
Jul 26, 2012, 12:34:30 PM7/26/12
to
I've also noticed that mic-paren matches closing parentheses in comments
with opening parentheses in code, while still matching the correct
closing parentheses in code.

Tested on GNU Emacs 24.1:
- emacs -Q
- (load "mic-paren.el")
- M-x paren-activate
- test snippet:

( ; )
)

Raffaele Ricciardi

unread,
Jul 26, 2012, 12:34:56 PM7/26/12
to

Raffaele Ricciardi

unread,
Jul 26, 2012, 12:35:20 PM7/26/12
to

rffl...@gmail.com

unread,
Jul 26, 2012, 11:38:56 AM7/26/12
to help-gn...@gnu.org
I've also noticed that mic-paren wrongly matches closing parentheses in comment with opening parentheses in code, while still correcly matching closing parentheses in code.

rffl...@gmail.com

unread,
Jul 26, 2012, 11:38:56 AM7/26/12
to gnu.ema...@googlegroups.com, help-gn...@gnu.org

rffl...@gmail.com

unread,
Jul 26, 2012, 11:22:52 AM7/26/12
to help-gn...@gnu.org
On 07/26/2012 05:19 AM, Thien-Thi Nguyen wrote:> [NB: CC updated; we use the "sources" list to post/announce source code.]
>
> () Wed, 25 Jul 2012 14:54:57 -0700 (PDT)
>
> As I use Viper, a Vim-emulation mode, I looked into the customization
> group mic-paren-matching, hoping to find a way to emulate the way Vim
> uses to highlight parentheses. I found nothing. Do you confirm it
> is so?
>
> No, but that's not saying much -- i don't use Vim. FWIW, my mic-paren
> usage is very simple:
>
> http://www.gnuvola.org/software/personal-elisp/dist/lisp/low-stress/turn-on-mic-paren.el
>
> Basically, since Vim uses both a bar cursor and a block cursor,
> depending on context it highilights sometimes the parenthesis before
> the cursor and sometimes the one after the cursor.
>
> Could you please give an example or point to one on the net?
>

0 new messages