Skip to content
Browse files

Merge pull request #1 from tkf/safer-symbol-name

bugfix: Make sure command is a symbol before calling symbol-name
  • Loading branch information...
2 parents a2d3e89 + 9d59779 commit c6a1122502d6156007d3335e0f67d463827ac5c0 @capitaomorte committed
Showing with 6 additions and 5 deletions.
  1. +6 −5 autopair.el
11 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 c6a1122

Please sign in to comment.
Something went wrong with that request. Please try again.