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: David Kastrup
Subject: Re: [AUCTeX-devel] Spell checking of macros
Date: Mon, 11 Jul 2016 11:50:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Mosè Giordano <address@hidden> writes:

> 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?

No.  It will interpret just fine, only slower.  Which is basically the
expectation for loading uncompiled code anyway, though usually most of
the savings from compilation are expected more on run time than load
time.

-- 
David Kastrup



reply via email to

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