diff options
author | 2023-12-12 08:53:30 -0800 | |
---|---|---|
committer | 2023-12-12 08:53:30 -0800 | |
commit | 2a582684868382939f5c9251804c44e4db0b5764 (patch) | |
tree | efa9b802ba65ff44dd2f4367ff23150d35c1c226 /oni-yasnippet.el | |
parent | 023282133f3676ea29b958899993f4a72d801fef (diff) | |
download | emacs-config-2a582684868382939f5c9251804c44e4db0b5764.tar.gz emacs-config-2a582684868382939f5c9251804c44e4db0b5764.zip |
Don't fail if a snippet can't be found
On my laptop the ‘mode-table’ is nil and causes the other function calls to
fail. I'm not quite sure why this happens, but this shouldn't fail the
operation.
Diffstat (limited to 'oni-yasnippet.el')
-rw-r--r-- | oni-yasnippet.el | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/oni-yasnippet.el b/oni-yasnippet.el index 1e4d7f2..584d909 100644 --- a/oni-yasnippet.el +++ b/oni-yasnippet.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: local -;; Version: 2023.0712.232619 +;; Version: 2023.1212.085307 ;; Package-Requires: (yasnippet yasnippet-snippets diminish) ;; This program is free software; you can redistribute it and/or modify @@ -36,11 +36,11 @@ (defun oni-yasnippet-remove-snippet-by-name (name mode) "Remove the snippet NAME from MODE's snippet tables." - (let* ((mode-table (gethash mode yas--tables)) - (uuidhash-table (yas--table-uuidhash mode-table)) - (hash-table (yas--table-hash mode-table)) - (snippet (gethash name uuidhash-table)) - (key (yas--template-key snippet))) + (and-let* ((mode-table (gethash mode yas--tables)) + (uuidhash-table (yas--table-uuidhash mode-table)) + (hash-table (yas--table-hash mode-table)) + (snippet (gethash name uuidhash-table)) + (key (yas--template-key snippet))) (remhash key hash-table) (remhash name uuidhash-table))) |