all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: rfflrccrd@gmail.com
To: gnu.emacs.help@googlegroups.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: mic-paren.el 3.10 available
Date: Thu, 26 Jul 2012 08:22:52 -0700 (PDT)	[thread overview]
Message-ID: <9a1f1ccf-2c1b-49f8-acc4-5965226c21e7@googlegroups.com> (raw)
In-Reply-To: <mailman.5631.1343276384.855.help-gnu-emacs@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.



  parent reply	other threads:[~2012-07-26 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.4875.1342444601.855.gnu-emacs-sources@gnu.org>
     [not found] ` <2b42c9ad-dbde-41ce-90c5-caef9568a18e@googlegroups.com>
2012-07-26  4:19   ` mic-paren.el 3.10 available Thien-Thi Nguyen
     [not found]   ` <mailman.5631.1343276384.855.help-gnu-emacs@gnu.org>
2012-07-26 15:22     ` rfflrccrd [this message]
2012-07-26 15:38     ` rfflrccrd
     [not found]     ` <mailman.5668.1343316187.855.help-gnu-emacs@gnu.org>
2012-07-26 16:34       ` Raffaele Ricciardi
2012-07-26 16:34       ` Raffaele Ricciardi
2012-07-26 16:35       ` Raffaele Ricciardi
     [not found] <87d33vc0cq.fsf@zigzag.favinet>
     [not found] ` <m2k3reyhl1.fsf@gmail.com>
     [not found]   ` <87wqvesrq5.fsf@zigzag.favinet>
     [not found]     ` <m2k3rcmuci.fsf@gmail.com>
     [not found]       ` <87bocosf6d.fsf@zigzag.favinet>
     [not found]         ` <m2d2x4mdct.fsf@gmail.com>
     [not found]           ` <jwv1udjdfqc.fsf-monnier+emacs@gnu.org>
     [not found]             ` <m1y5frahyj.fsf@gmail.com>
     [not found]               ` <jwvfw1zbte6.fsf-monnier+emacs@gnu.org>
     [not found]                 ` <87obgipuhu.fsf@zigzag.favinet>
     [not found]                   ` <m28v7j5503.fsf@gmail.com>
     [not found]                     ` <m238xov1ah.fsf@gmail.com>
2013-02-21  6:31                       ` Thien-Thi Nguyen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a1f1ccf-2c1b-49f8-acc4-5965226c21e7@googlegroups.com \
    --to=rfflrccrd@gmail.com \
    --cc=gnu.emacs.help@googlegroups.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 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.