From 572c73d50b5521b4a56eae7b00ae6c7e61582e06 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Fri, 26 Feb 2016 16:59:39 -0500 Subject: [PATCH] Avoid error in case this-command isn't a symbol. Fixes #664. * yasnippet.el (yas--skip-and-clear-field-p): Only get `delete-selection' property of `this-command' when it's a symbol. --- yasnippet.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yasnippet.el b/yasnippet.el index 69d6b26ab..b68389fd6 100644 --- a/yasnippet.el +++ b/yasnippet.el @@ -3390,9 +3390,9 @@ BEG, END and LENGTH like overlay modification hooks." (= (point) (yas--field-start field)) (require 'delsel) ;; `yank' sets `this-command' to t during execution. - (let ((clearp (get (if (commandp this-command) this-command - this-original-command) - 'delete-selection))) + (let* ((command (if (commandp this-command) this-command + this-original-command)) + (clearp (if (symbolp command) (get command 'delete-selection)))) (when (and (not (memq clearp '(yank supersede kill))) (functionp clearp)) (setq clearp (funcall clearp))) -- 2.39.2