auctex-devel
[Top][All Lists]
Advanced

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

Re: master 6b5f00bf: Unquote lambdas in font-latex.el & tex-bar.el; add


From: David Kastrup
Subject: Re: master 6b5f00bf: Unquote lambdas in font-latex.el & tex-bar.el; add some FIXMEs
Date: Tue, 30 Aug 2022 11:54:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Tassilo Horn <tsdh@gnu.org> writes:

> Arash Esbati <arash@gnu.org> writes:
>
>> After this change, the compiler says:
>>
>>   In toplevel form:
>>   tex-bar.el:481:34: Warning: reference to free variable
>>   `LaTeX-symbols-active-menuitem'
>>
>> Is anybody familiar with this code in order to pacify this?
>>
>>   git grep LaTeX-symbols-active-menuitem
>>
>> doesn't show anything useful.
>
> And neither does it seem to be generated by `LaTeX-install-toolbar'.  So
> it's probably a bug which Stefan's change caught.
>
> And when I enable latex-symbols-experimental in customize for
> TeX-bar-LaTeX-buttons and then run LaTeX-install-toolbar, I get this
> error:
>
> Debugger entered--Lisp error: (wrong-type-argument sequencep \,)
>   #f(compiled-function (&rest ignore) #<bytecode -0x1ff31a58ef856dbb>)()
>   toolbarx-eval-function-or-symbol(#f(compiled-function (&rest ignore) 
> #<bytecode -0x1ff31a58ef856dbb>) #<subr 
> F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_8>)
>   toolbarx-test-string-or-nil(#f(compiled-function (&rest ignore) #<bytecode 
> -0x1ff31a58ef856dbb>))
>   toolbarx-emacs-add-button(...)
>   toolbarx-emacs-refresh-process-button-or-insert-list(...)
>   toolbarx-emacs-refresh(nil)
>   toolbarx-refresh(nil)
>   toolbarx-install-toolbar(...)
>   LaTeX-install-toolbar()
>   funcall-interactively(LaTeX-install-toolbar)
>   command-execute(LaTeX-install-toolbar record)
>   execute-extended-command(nil "LaTeX-install-toolbar" nil)
>   funcall-interactively(execute-extended-command nil "LaTeX-install-toolbar" 
> nil)
>   command-execute(execute-extended-command)
>
>
> The byte-code of the erroring function is:
>
> byte code:
>   doc:   ...
>   args: (&rest rest)
> 0       constant  "Turn "
> 1       varref    LaTeX-symbols-toolbar-visible-flag
> 2       goto-if-nil 1
> 5       constant  "off "
> 6       goto      2
> 9:1     constant  "on "
> 10:2    constant  "the toolbar of LaTeX symbols (current class: "
> 11      varref    LaTeX-symbols-active-menuitem
> 12      sub1      
> 13      constant  (\, list-strings)      ; <=== Error here!
> 14      nth       
> 15      constant  ")"
> 16      concatN   5
> 18      return    
>
>
> That's this :help function in LaTeX-symbols-toolbar-switch-contents:
>
>        :help ,(lambda (&rest _ignore)
>                 (concat "Turn "
>                         (if LaTeX-symbols-toolbar-visible-flag "off " "on ")
>                         "the toolbar of LaTeX symbols (current class: "
>                         (nth (1- LaTeX-symbols-active-menuitem)
>                              (quote ,list-strings))
>                         ")")))
>
> The list-strings variable is let-bound around the complete defconst
> LaTeX-symbols-toolbar-switch-contents.  I guess it should become
> (quote ("foo" "bar" "baz")) instead of (quote \, list-strings).  Stefan,
> what's the issue here?

This looks like it should rather rely on lexical-binding being t and
write

       :help (lambda (&rest _ignore)
               (concat "Turn "
                       (if LaTeX-symbols-toolbar-visible-flag "off " "on ")
                       "the toolbar of LaTeX symbols (current class: "
                       (nth (1- LaTeX-symbols-active-menuitem)
                            list-strings)
                       ")")))


-- 
David Kastrup



reply via email to

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