Hi Arash,

2016-07-11 11:19 GMT+02:00 Arash Esbati <[email protected]>:
> Hi Mosè,
>
> Mosè Giordano <[email protected]> writes:
>
>> 2016-07-08 19:11 GMT+02:00 Arash Esbati <[email protected]>:
>>> Hi Mosè,
>>>
>>> Mosè Giordano <[email protected]> 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è

_______________________________________________
auctex-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex-devel

Reply via email to