auctex-devel
[Top][All Lists]
Advanced

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

Use of lexical binding plus various other things


From: Stefan Monnier
Subject: Use of lexical binding plus various other things
Date: Mon, 22 Mar 2021 23:02:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

I pushed to the branch `scratch/auctex-lexbind` of the `elpa.git`
repository a series of 10 patches which convert all of AUCTeX to use
lexical binding, and includes various other more or less
cosmetic changes.

The commit log is below, the overall patch is too large to be worth
including here.

Please try it out and let me know if you find problems.
Also, feel free to merge any or all parts into AUCTeX's upstream, thanks.


        Stefan


commit f8b4d2a9fede599eef619dfeabff7d716d71e250
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 22:56:59 2021 -0400

    Use UTF-8 for all ELisp files
    
    UTF-8 is the default encoding used for ELisp files nowadays, so
    convert the few remaining exceptions.
    
    * tests/japanese/preview-latex.el:
    * tex-jp.el: Remove `coding:` cookie and re-encode into utf-8.

commit 7f10390369ccb82ac19247e5f1eb2c93d6c763a1
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 22:53:55 2021 -0400

    Prefer lexical closures over hand-built lambda forms
    
    now that we have lexical-binding, we can use closures, which have the
    advantage over `(lambda ...) of allowing the byte-compiler to compile
    the code, and also makes it possible to Edebug it.
    
    * preview.el (preview-gs-close, preview-gs-flag-error)
    (preview-scale-from-face, preview-gs-flag-error)
    (preview-scale-from-face, preview-disabled-string)
    (preview-buffer-restore, preview-place-preview)
    (preview-reinstate-preview, preview-cache-preamble)
    (preview-generate-preview, preview-report-bug):
    * toolbar-x.el (toolbarx-emacs-mount-popup-menu):
    * tex.el (TeX-mode-specific-command-menu): Replace `(lambda...) with 
closures.

commit 89e707e9d72831c3bfdf41c2274d04c1d4aa797a
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 22:36:40 2021 -0400

    Activate lexical-binding everywhere
    
    Also, add an underscore at the beginning of unused arguments to
     silence warnings.
    
    * bib-cite.el (bib-highlight-mouse): Remove unused vars `extent`
    and `local-extent-list`.
    
    * latex.el (LaTeX-label): Remove unused var `label`.
    (LaTeX-math-mode-map): Move before first use.
    
    * preview.el (preview-start-dvipng, preview-start-dvips):
    Remove unused var `file`.
    
    * tex-fold.el (TeX-fold-macro-nth-arg): Remove unused var `close-string`.
    (TeX-fold-hide-item): Remove unused var `face`.
    
    * tex-font.el (tex-font-lock-keywords-2): Remove unused var `type`.
    
    * tex-info.el (Texinfo-mark-section): Remove unused var `is-beg-section`.
    
    * toolbar-x.el (toolbarx-test-toolbar-type): Remove unused vars
    `all-but-def-opts` and `all-opts`; remove always-t var `good-jobs`.

commit 7eea3ffbac235dd5423587b5406aeb25a997c00d
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 22:20:25 2021 -0400

    Miscellaneous minor changes
    
    Move to the next line arguments that are easy to misread.
    Fix some commenting style to obey `outline-minor-mode`.
    
    * README: Prefer HTTPS over HTTP/FTP for gnu.org sites.
    
    * bib-cite.el (bib-find-next): Simplify.
    
    * latex.el: Use a non-nil default value for `LaTeX-label-function`
    so RefTeX can override it with `add-function`.
    (LaTeX-label--default): New function, extracted from `LaTeX-label`.
    (LaTeX-label): Use it.
    (LaTeX-label-function): Use it as default value.
    
    * toolbar-x.el (toolbarx-emacs-mount-popup-menu): Make the control&data
    flow a bit simpler.
    (toolbarx-test-image-type, toolbarx-process-dropdown-group):
    Use `car-safe` and strength-reduce `eval` to `symbol-value`.
    
    * style/dinbrief.el: Remove redundant comment.
    
    * style/kpfonts.el (<toplevel>): Simplify.
    
    * style/latexinfo.el (LaTeXinfo-mode-map): Move initialization into
    the declaration.
    
    * style/url.el (TeX-arg-urlstyle):
    * style/prosper.el (LaTeX-prosper-slide-style-prompt):
    Completion tables can be lists of strings.
    
    * style/tikz.el (TeX-TikZ-single-macro-arg): Strength-reduce `eval` to
    `apply`.

commit ed126762f6b3f811f3c58abb3eec7a240200cf56
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 21:58:01 2021 -0400

    Remove some XEmacs and old-Emacs code
    
    Remove uses of `easy-menu-add` and `easy-menu-remove` which have
    always been no-op in Emacs and are declared obsolete in Emacs-28.
    
    * bib-cite.el (bib-cite-setup-highlight-mouse-keymap): Remove Emacs-19 code.
    
    * tex-buf.el (TeX-region-create): Remove use of variable
    `font-lock-maximum-size` declared obsolete in Emacs-24.
    
    * toolbar-x.el: Remove left over code from XEmacs compatibility.
    Remove XEmacs-only `:toolbar` and `:dropdown-toolbar` as well
    `:insert` which was only used to select Emacs-only or XEmacs-only entries.
    (toolbarx-default-toolbar-meaning-alist): Replace all uses of
    `[Emacs-only XEmacs-only]` vectors with the `Emacs-only` form.

commit 333ae25863dc8d6c358ff588cf9614fddfed7912
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 21:14:57 2021 -0400

    Don't quote `lambda`

commit 78c09ee4590a14bc25424fa8e2b609c74cb499c5
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 21:12:21 2021 -0400

    Remove some redundant `:group` arguments

commit 6e60f0329d9a027187e8258360417f974d247d31
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 19:22:48 2021 -0400

    Use #' rather than ' to quote functions
    
    This helps track down typos, references to functions which don't exist
    any more, as well as references to obsolete functions.

commit 60c12f8876c93459d146c9a6c93c09ca116a5f2b
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 18:55:12 2021 -0400

    * font-latex.el (font-latex-make-built-in-keywords): Make it a macro
    
    This lets us expose the code it generates to the compiler without
    having to call `byte-compile` explicitly.  It also reduces the reliance
    on `eval`, saving the souls of many kitten along the way.
    
    (font-latex-built-in-keyword-classes): Define it at compile-time as well.
    (font-latex-keywords-1, font-latex-keywords-2):
    Move their definition to `font-latex-make-built-in-keywords`.
    (font-latex-keyword-matcher): Define it at compile-time as well.
    (font-latex--make-match-defun): Rename from `font-latex-make-match-defun`.
    Define it at compile-time as well.  Return the function definition (as
    the docstring suggests) rather than evaluating it.
    (font-latex-make-user-keywords): Adjust call to it.
    (<toplevel>): Don't manually call the byte-compiler.

commit ee87fa5a59845c40ea8ed91a65eb67c472dfd832
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Mon Mar 22 18:41:56 2021 -0400

    * font-latex.el (font-latex-make-built-in-keywords): Reorder defs
    
    Move definition of `font-latex-match-*-make` after the `defvar`s of
    the vars it uses.




reply via email to

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