auctex-devel
[Top][All Lists]
Advanced

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

Re: Onwards to lexical binding (attempt 1)


From: Arash Esbati
Subject: Re: Onwards to lexical binding (attempt 1)
Date: Sat, 05 Sep 2020 22:50:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50

Hi Tassilo,

Tassilo Horn <tsdh@gnu.org> writes:

> Tassilo Horn <tsdh@gnu.org> writes:
>
>> We still have such issues in tex.el with the variable `file' and some
>> others.
>
> I've done that now, too.  I still can run LaTeX and call the Evince
> viewer (TeX-evince-sync-view and TeX-pdf-tools-sync-view don't rely on
> `file' anymore but use `TeX-active-master' as suggested by Al Haji-Ali),
> so it seems I haven't broken everything [but possibly something I didn't
> test]...

Many thanks for doing this.  I agree, we should take the step towards
lexical binding.  Should all style files also go in this direction?

I can silence some other compiler warnings in tex.el with this small
patch:

    diff --git a/tex.el b/tex.el
    index 41e41502..c797e286 100644
    --- a/tex.el
    +++ b/tex.el
    @@ -107,6 +107,7 @@
     ;; Others:
     (defvar tex--prettify-symbols-alist)   ; tex-mode.el
     (defvar Info-file-list-for-emacs)      ; info.el
    +(defvar dbus-debug)                     ; dbusbind.c and dbus.el

     (defgroup TeX-file nil
       "Files used by AUCTeX."
    @@ -3618,11 +3619,11 @@ Unless optional argument COMPLETE is non-nil, ``: 
'' will be appended."
            (TeX-parse-argument optional (car args))
           (TeX-parse-argument optional args))))

    -(defun TeX-arg-literal (optional &rest args)
    +(defun TeX-arg-literal (_optional &rest args)
       "Insert its arguments ARGS into the buffer.
     Used for specifying extra syntax for a macro.  The compatibility
     argument OPTIONAL is ignored."
    -  (apply 'insert args))
    +  (apply #'insert args))


 ;;; Font Locking

I'm not sure about this warning:

    In toplevel form:
    tex.el:2023:1: Warning: Unused lexical argument `viewer' Disable showing
        Disable logging

which applies to

    (defun TeX-source-specials-view-expand-options (&optional viewer)
      "Return source specials command line option for viewer command.
    The return value depends on the values of
    `TeX-source-correlate-mode' and
    `TeX-source-correlate-method-active'.  If those are nil or not
    `source-specials' respectively, an empty string will be
    returned."
      (if (and TeX-source-correlate-mode
               (eq (TeX-source-correlate-method-active) 'source-specials))
          (concat TeX-source-specials-view-position-flags
                  (when (TeX-source-correlate-server-enabled-p)
                    (concat " " TeX-source-specials-view-editor-flags)))
        ""))

Is prefixing viewer with _ also the solution here?  I'm not familiar
with the usage of this function.

Other warnings from latex.el can be fixed easily.

Best, Arash



reply via email to

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