Browse files

Make sure command is a symbol before calling symbol-name

Calling symbol-name on command when it is a lambda expression causes
problem.  Current change fix this problem.
  • Loading branch information...
tkf committed Jun 7, 2012
1 parent edb5292 commit 9d59779d753b73d546c9891cf3402b2fbb2c0d70
Showing with 6 additions and 5 deletions.
  1. +6 −5 autopair.el
@@ -497,6 +497,7 @@ A list of four elements is returned:
(setq this-original-command beyond-cua)
;; defer to "paredit-mode" if that is installed and running
(when (and (featurep 'paredit)
+ (symbolp beyond-cua)
(string-match "paredit" (symbol-name beyond-cua)))
(setq autopair-action nil))
(let ((cua-delete-selection (not autopair-autowrap))
@@ -1057,11 +1058,11 @@ by this command. Then place point after the first, indented.\n\n"
(put 'autopair-newline 'delete-selection t)
(defun autopair-should-autowrap ()
- (let ((name (symbol-name this-command)))
- (and autopair-mode
- (not (eq this-command 'autopair-backspace))
- (string-match "^autopair" (symbol-name this-command))
- (autopair-calculate-wrap-action))))
+ (and autopair-mode
+ (not (eq this-command 'autopair-backspace))
+ (symbolp this-command)
+ (string-match "^autopair" (symbol-name this-command))
+ (autopair-calculate-wrap-action)))
(defadvice cua--pre-command-handler-1 (around autopair-override activate)
"Don't actually do anything if autopair is about to autowrap. "

0 comments on commit 9d59779

Please sign in to comment.