auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Spell checking of macros


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] Spell checking of macros
Date: Mon, 11 Jul 2016 11:39:43 +0200

Hi Arash,

2016-07-11 11:19 GMT+02:00 Arash Esbati <address@hidden>:
> Hi Mosè,
>
> Mosè Giordano <address@hidden> writes:
>
>> 2016-07-08 19:11 GMT+02:00 Arash Esbati <address@hidden>:
>>> Hi Mosè,
>>>
>>> Mosè Giordano <address@hidden> writes:
>>>
>>>> Thanks for your work!  Some questions:
>>>>
>>>> * why all those `eval-when-compile'?
>>>
>>> The final regexp which goes into byte-compiled file is built with:
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> (defvar TeX-ispell-skip-cmds-one-arg-regexp
>>>   (eval-when-compile
>>>     (concat "\\\\"
>>>             (regexp-opt (TeX-ispell-sort-skip-cmds-list 1) t)))
>>>   "Regexp of LaTeX commands with one argument to be skipped.")
>>> --8<---------------cut here---------------end--------------->8---
>>
>> Ok, then why this regexp is built with `eval-when-compile'?
>
> I wanted to implement a trick mentioned in regexp-opt.el:
>
> ;; Since this package was written to produce efficient regexps, not regexps
> ;; efficiently, it is probably not a good idea to in-line too many calls in
> ;; your code, unless you use the following trick with `eval-when-compile':
> ;;
> ;; (defvar definition-regexp
> ;;   (eval-when-compile
> ;;     (concat "^("
> ;;             (regexp-opt '("defun" "defsubst" "defmacro" "defalias"
> ;;                           "defvar" "defconst") t)
> ;;             "\\>")))
> ;;
> ;; The `byte-compile' code will be as if you had defined the variable thus:
> ;;
> ;; (defvar definition-regexp
> ;;   "^(\\(def\\(alias\\|const\\|macro\\|subst\\|un\\|var\\)\\)\\>")

Ok, fine.

> Do you have any specific concern about using `eval-when-compile' here?

I have the impression that currently AUCTeX doesn't require to be
compiled.  My understanding is that with this change compilation would
become practically mandatory (at least in order to exploit this
feature), is it correct?  In any case, I guess that everyone is
compiling the package (for example, Debian provides a source-only
AUCTeX package, but the files are compiled right after installation),
so this change wouldn't hurt many people.

Bye,
Mosè



reply via email to

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