mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 13:13:03 +00:00
Prevent disabling errors from recent yas-current-syntaxes
logic
* yasnippet.el (yas--templates-for-key-at-point): Don't error since this function is called very frequently on TAB. Use new `yas--warning'. (yas--warning): New function.
This commit is contained in:
parent
e60e8b5551
commit
f7ef023ebb
@ -1243,7 +1243,7 @@ Returns (TEMPLATES START END). This function respects
|
|||||||
'again)
|
'again)
|
||||||
(setq methods (cdr methods))))
|
(setq methods (cdr methods))))
|
||||||
(t
|
(t
|
||||||
(error "[yas] invalid element in `yas-key-syntaxes'")))
|
(yas--warning "Warning invalid element %s in `yas-key-syntaxes'" method)))
|
||||||
(setq templates
|
(setq templates
|
||||||
(mapcan #'(lambda (table)
|
(mapcan #'(lambda (table)
|
||||||
(yas--fetch table (buffer-substring-no-properties (point)
|
(yas--fetch table (buffer-substring-no-properties (point)
|
||||||
@ -4366,6 +4366,11 @@ object satisfying `yas--field-p' to restrict the expansion to.")))
|
|||||||
(when (> yas-verbosity level)
|
(when (> yas-verbosity level)
|
||||||
(message "%s" (apply #'yas--format message args))))
|
(message "%s" (apply #'yas--format message args))))
|
||||||
|
|
||||||
|
(defun yas--warning (format-control &rest format-args)
|
||||||
|
(let ((msg (apply #'format format-control format-args)))
|
||||||
|
(display-warning 'yasnippet msg :warning)
|
||||||
|
(yas--message 1 msg)))
|
||||||
|
|
||||||
(defun yas--format (format-control &rest format-args)
|
(defun yas--format (format-control &rest format-args)
|
||||||
(apply #'format (concat "[yas] " format-control) format-args))
|
(apply #'format (concat "[yas] " format-control) format-args))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user