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: Stefan Monnier
Subject: Re: electric-pair-mode as a minor mode?
Date: Sun, 12 Apr 2015 07:56:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

>> I think in the case of the smiley regexps, rather than mark them as
>> comments, it's better to only change the parenthesis's syntax to be
>> "punctuation".
> Since Lars hasn't responded yet, here's an updated patch that addresses
> the issues discussed so far.  OK to install?

[ Hmm.... I'd really like Lars's input on this.
  But it looks OK to me.  ]

> +        (smiley-regexp (regexp-opt '(":-)" ":)"
> +                                     ":-(" ":("
> +                                     ";-)" ";)"))))

This list (and/or regexp) should be moved to a variable.

> +    (goto-char beg)
> +    (while (search-forward-regexp citation-regexp
> +                                  end 'noerror)
> +      (let ((start (match-beginning 0))
> +            (end (match-end 0)))
> +        (add-text-properties start (1+ start)
> +                             '(syntax-table (11 . nil)))

I'd recommend you use the string for of syntax-specifiers, as in
(string-to-syntax "<").  These are evaluated at compile-time, so
it's efficient.

> +  (setq-local parse-sexp-lookup-properties t)

This one is not needed.  The syntax-propertize code should set it for
you already.


        Stefan



reply via email to

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