mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
New public function yas-maybe-expand-abbrev-key-filter
* yasnippet.el (yas-maybe-expand-abbrev-key-filter): Renamed from yas--maybe-expand-key-filter.
This commit is contained in:
parent
0f05a7555a
commit
fb253ac607
10
yasnippet.el
10
yasnippet.el
@ -623,13 +623,19 @@ override bindings from other packages (e.g., `company-mode')."
|
|||||||
|
|
||||||
(defvar yas--condition-cache-timestamp nil)
|
(defvar yas--condition-cache-timestamp nil)
|
||||||
|
|
||||||
(defun yas--maybe-expand-key-filter (cmd)
|
(defun yas-maybe-expand-abbrev-key-filter (cmd)
|
||||||
|
"Return CMD if there is an expandable snippet at point.
|
||||||
|
This function is useful as a `:filter' to a conditional key
|
||||||
|
definition."
|
||||||
(when (let ((yas--condition-cache-timestamp (current-time)))
|
(when (let ((yas--condition-cache-timestamp (current-time)))
|
||||||
(yas--templates-for-key-at-point))
|
(yas--templates-for-key-at-point))
|
||||||
cmd))
|
cmd))
|
||||||
|
|
||||||
|
(define-obsolete-function-alias 'yas--maybe-expand-key-filter
|
||||||
|
#'yas-maybe-expand-abbrev-key-filter "0.14")
|
||||||
|
|
||||||
(defconst yas-maybe-expand
|
(defconst yas-maybe-expand
|
||||||
'(menu-item "" yas-expand :filter yas--maybe-expand-key-filter)
|
'(menu-item "" yas-expand :filter yas-maybe-expand-abbrev-key-filter)
|
||||||
"A conditional key definition.
|
"A conditional key definition.
|
||||||
This can be used as a key definition in keymaps to bind a key to
|
This can be used as a key definition in keymaps to bind a key to
|
||||||
`yas-expand' only when there is a snippet available to be
|
`yas-expand' only when there is a snippet available to be
|
||||||
|
Loading…
x
Reference in New Issue
Block a user