auctex-devel
[Top][All Lists]
Advanced

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

Re: Updating xparse.el


From: Arash Esbati
Subject: Re: Updating xparse.el
Date: Sun, 28 Jun 2020 22:50:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50

Hi Keita,

Ikumi Keita <ikumi@ikumi.que.jp> writes:

>>>>>> Arash Esbati <arash@gnu.org> writes:

> I have no knowledge about xparse.sty, so I'll comment on very minor
> aspects.

Me either, but many thanks for your comments on lisp :-)

>> (defun LaTeX-xparse-macro-parse (type)
>>   "Process parsed macro and environment definitions.
>> TYPE is one of the symobols mac or env."
>>   (dolist (xcmd (if (eq type 'mac)
>>                  (LaTeX-xparse-macro-list)
>>                (LaTeX-xparse-environment-list)))
>>     (let ((name (car xcmd))
>>        (spec (cadr xcmd))
>>        args opt-star opt-token)
>>       (with-temp-buffer
>>      (with-syntax-table LaTeX-mode-syntax-table
>
> Since we are working in temporal buffer, we need not use
> `with-syntax-table'. Just (set-syntax-table LaTeX-mode-syntax-table)
> would be enough.

True, I changed that.

>>        (goto-char (point-min))
>>        (save-excursion
>>          (insert (replace-regexp-in-string "[ \t\r\n%]" "" spec)))
>
> Maybe it's a bit efficient to do in the order of `insert' followed by
> `goto-char' without `save-excursion' :-)

I changed this one as well.  Now I have 2 (goto-char (point-min)), one
before and one after the (insert ...)  I admit that the first one is
probably not needed.

>>     ;; Fully-expandable document commands
>>     '("DeclareExpandableDocumentCommand"
>>       TeX-arg-define-macro "Argument specification" t)
>
> It seems that other "Expandable" variants should be added as well.

Upps, thanks for catching this.  I confess I didn't look after the
macros provided by the package.  I've pushed that change to AUCTeX repo.

Best, Arash



reply via email to

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