Navigation Menu

Skip to content
This repository has been archived by the owner on Apr 11, 2021. It is now read-only.

Commit

Permalink
Make sure command is a symbol before calling symbol-name
Browse files Browse the repository at this point in the history
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 9d59779
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions autopair.el
Expand Up @@ -497,6 +497,7 @@ A list of four elements is returned:
(setq this-original-command beyond-cua) (setq this-original-command beyond-cua)
;; defer to "paredit-mode" if that is installed and running ;; defer to "paredit-mode" if that is installed and running
(when (and (featurep 'paredit) (when (and (featurep 'paredit)
(symbolp beyond-cua)
(string-match "paredit" (symbol-name beyond-cua))) (string-match "paredit" (symbol-name beyond-cua)))
(setq autopair-action nil)) (setq autopair-action nil))
(let ((cua-delete-selection (not autopair-autowrap)) (let ((cua-delete-selection (not autopair-autowrap))
Expand Down Expand Up @@ -1057,11 +1058,11 @@ by this command. Then place point after the first, indented.\n\n"
(put 'autopair-newline 'delete-selection t) (put 'autopair-newline 'delete-selection t)


(defun autopair-should-autowrap () (defun autopair-should-autowrap ()
(let ((name (symbol-name this-command))) (and autopair-mode
(and autopair-mode (not (eq this-command 'autopair-backspace))
(not (eq this-command 'autopair-backspace)) (symbolp this-command)
(string-match "^autopair" (symbol-name this-command)) (string-match "^autopair" (symbol-name this-command))
(autopair-calculate-wrap-action)))) (autopair-calculate-wrap-action)))


(defadvice cua--pre-command-handler-1 (around autopair-override activate) (defadvice cua--pre-command-handler-1 (around autopair-override activate)
"Don't actually do anything if autopair is about to autowrap. " "Don't actually do anything if autopair is about to autowrap. "
Expand Down

0 comments on commit 9d59779

Please sign in to comment.