emacs-devel
[Top][All Lists]
Advanced

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

Re: electric-pair-mode as a minor mode?


From: João Távora
Subject: Re: electric-pair-mode as a minor mode?
Date: Sat, 28 Mar 2015 23:09:26 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin)

address@hidden (João Távora) writes:
> Stefan Monnier <address@hidden> writes:
>
>>> I like my syntax-table to understand to know as much as possible, so
>>> that other commands can dwim. Perhaps I'll try a message-mode hack to
>>> make blockquotes and smileys comment syntax. That should bring the 90%
>>> to 99%...
>>    > foo far bla (blibli
>>    Here's my answer to that.
>
> I haven't tested, because I don't have time to learn about implementing

Actually, I just tested, I find, even as I'm writing this message, that

   (modify-syntax-entry ?> "<   " message-mode-syntax-table)
   (modify-syntax-entry ?\n ">   " message-mode-syntax-table)
   (modify-syntax-entry ?\" "\"    " message-mode-syntax-table)
   (add-hook 'message-mode-hook
             (lambda () (setq-local parse-sexp-ignore-comments t)))

Works reasonably well for handling cited text. The only issue I'm seeing
is that single ?> in my code snippet that is erroneously interpreted as
a comment starter. Perhaps there's a way to fix that (two-char-long
comment sequences?), but I find it rare enough.

J




reply via email to

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