Mosè Giordano <[email protected]> writes:

> Hi Arash,
>
> 2016-07-12 10:25 GMT+02:00 Arash Esbati <[email protected]>:
>> Arash Esbati <[email protected]> writes:
>>
>>> I'm thinking about writing a function like this to catch this kind of
>>> arguments:
>>>
>>>     (defun TeX-ispell-tex-arg-end (&optional arg1 arg2)
>>>       (condition-case nil
>>>           (progn
>>>             (while (looking-at "[ \t\n]*\\[") (forward-sexp))
>>>             (forward-sexp (or arg1 1))
>>>             (while (looking-at "[ \t\n]*\\[") (forward-sexp))
>>>             (forward-sexp (or arg2 1)))
>>>         (error
>>>          (message "Error skipping s-expressions at point %d." (point))
>>>          (beep)
>>>          (sit-for 2))))
>>>
>>> and do ("tabular[*xy]" TeX-ispell-tex-arg-end).
>>
>> Following up myself again, I implemented a function
>> `TeX-ispell-tex-arg-end' to deal with constructs like:
>>
>>     \raisebox{2em}[1em][1em]{text} or
>>     \begin{tabularx}{300pt}{|p{3cm}|>{\raggedright}X|c|S|} etc.
>>
>> I'd like to apply the attached patch.  I would appreciate any comments
>> before doing this.
>
> It looks overall good to me, but note that error messages *do not* end
> with a period (see `error`'s docstring) and you should replace the
> `message' function with `format' (and I don't think `beep' is needed).

Uh, no?

    error is a compiled Lisp function in ‘subr.el’.

    (error STRING &rest ARGS)

    Signal an error, making a message by passing args to ‘format-message’.
    In Emacs, the convention is that error messages start with a capital
    letter but *do not* end with a period.  Please follow this convention
    for the sake of consistency.

    Note: (error "%s" VALUE) makes the message VALUE without
    interpreting format characters like ‘%’, ‘`’, and ‘'’.

You don't want to have format-message called twice.  So just use

         (error "Error skipping s-expressions at point %d." (point))

Do other errors actually output the value of point?  Seems a bit strange
to me, but that's a different problem.

-- 
David Kastrup

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

Reply via email to