Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use lexical-binding #1167

Closed
monnier opened this issue Jun 28, 2023 · 2 comments
Closed

Use lexical-binding #1167

monnier opened this issue Jun 28, 2023 · 2 comments

Comments

@monnier
Copy link
Collaborator

monnier commented Jun 28, 2023

The recent bug#64315 that some Yasnippet users bumped into was an Emacs bug but would have been avoided if Yasnippet had updated its code to use lexical-binding.

I pushed a few patches to the scratch/yasnippet branch of git://git.sv.gnu.org/emacs/elpa.git which does the "usual" update of code to use lexical-binding, cl-lib, advice-add, ...

@monnier
Copy link
Collaborator Author

monnier commented Oct 17, 2023

Ping?

commit 52a1c5031912243c791c55e0fe345d04f219b507
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Sun Aug 13 15:45:23 2023 -0400

    * yasnippet.el (debug-ignored-errors): Don't modify it
    
    (debug-ignored-errors): Remove left over code that became obsolete with
    commit 175e0a3a102c22.
    (yas--read-lisp): Fix code generation.
    (yas-exception): Use `define-error`.

commit 58c92ba3933e9ef4d3c686894ca813d7506a03c8
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 11:05:33 2023 -0400

    * yasnippet.el: Cosmetic changes
    
    Prefer #' to quote function names.
    (yas-after-exit-snippet-hook, yas-before-expand-snippet-hook)
    (yas-after-reload-hook): A hook is not a function, but a symbol
    containing functions.  Fix doc accordingly.
    (yas-define-snippets, yas-longest-key-from-whitespace)
    (yas--field-parse-create): Make the doc fit within 80 columns.
    (yas-skip-and-clear-or-delete-char): Fix ordering between `declare` and
    `interactive`.

commit 043c52a5a91815703d40f5d5ec2766bfc304aeb4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 11:04:14 2023 -0400

    * yasnippet.el (yas-minor-mode-map): Don't bind to `tab`

commit 009322196cfaaff55272bbd341c03f6c5facf83e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 10:54:23 2023 -0400

    * yasnippet-debug.el: Use `advice-add` i.s.o `defadvice`.
    
    Now that we use `add-function`, we may as well avoid using the deprecated
    `defadvice`
    
    (cl-flet): Remove confusing `cl-flet` fallback, always provided by `cl-lib`.
    (yas--snippet-parse-create, yas--commit-snippet):
    Use `advice-add` i.s.o `defadvice`.

commit e9915301086b8ec868c14a0c32412ce75c81d15e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 10:49:15 2023 -0400

    * yasnippet.el: Use `add-function` and remove left-over debug code
    
    Instead of using `setq` and storing the old value in
    `yas--original-auto-fill-function`, use `add-function`.
    This makes it virtually impossible for a bug like #873/#919 to appear.
    Remove the left-over debug code we had added to try and track down
    #873/#919.
    
    This requires bumping the dependency on Emacs≥24.4.
    
    (yas--original-auto-fill-function, yas--watch-auto-fill-backtrace):
    Delete variables.
    (yas--watch-auto-fill): Delete function.  Don't add it to variable watchers.
    (yas--auto-fill-wrapper): Use `add-function`.
    (yas-minor-mode): Use `remove-function`.
    (yas--auto-fill): Adjust its calling convention for use with `:around`
    in `add-function`.  Remove left-over debug code.
    (yas--post-command-handler): Remove left-over debug code.

commit 97002af846e1d3751b75da2e4a7bf931b540e18e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 10:39:54 2023 -0400

    * yasnippet.el: Use `lexical-binding`

commit b09ab9841959abff8cccb5eddff4677b4dad9fa8
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 10:36:13 2023 -0400

    * yasnippet-tests.el: Minor cosmetic changes
    
    Use utf-8 rather than latin-1.
    Prefer #' to quote function names.
    (special-mode): Remove backward compatibility code which never worked
    since it uses `fundamental` which doesn't exist).

commit 6e4de312cf7c2339df47e7af7a156d1480316df4
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 10:32:22 2023 -0400

    * doc/yas-doc-helper.el: Use `cl-lib` and `lexical-binding`
    
    Also silence compiler warnings.

commit 946b27ddcae541aac1e1c0465fc4422e7e53f56c
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Date:   Wed Jun 28 10:30:21 2023 -0400

    * .gitignore: Add patterns for ELPA-generated files

@monnier
Copy link
Collaborator Author

monnier commented Oct 27, 2023

Merged, thanks

@monnier monnier closed this as completed Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant