Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix warning: reference to free variable `autopair-mode' #13

Merged
merged 1 commit into from

3 participants

@ptpt

The free variable autopair-mode is referenced in autopairs-global-mode-emacs24-hack, so autopair-mode should be defined before the hack.

@krismolendyke

Thanks! Any reason this can't be merged, @capitaomorte?

@capitaomorte capitaomorte merged commit d2346ce into capitaomorte:master
@capitaomorte
Owner

Sorry, this pull request slipped through somehow. Looks ok, you moved the define-minor-mode up some lines right? I think it's ok...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 23, 2012
This page is out of date. Refresh to see the latest.
Showing with 20 additions and 20 deletions.
  1. +20 −20 autopair.el
View
40 autopair.el
@@ -332,6 +332,26 @@ For now, simply returns `last-command-event'"
;; minor mode and global mode
;;
;;;###autoload
+(define-minor-mode autopair-mode
+ "Automagically pair braces and quotes like in TextMate."
+ nil " pair" nil
+ (cond (autopair-mode
+ ;; Setup the dynamic emulation keymap, i.e. sets `autopair-emulation-alist'
+ ;;
+ (autopair-set-emulation-bindings)
+ (add-to-list 'emulation-mode-map-alists 'autopair-emulation-alist 'append)
+ ;; Init important vars
+ ;;
+ (setq autopair-action nil)
+ (setq autopair-wrap-action nil)
+ ;; Add the post command handler
+ ;;
+ (add-hook 'post-command-hook 'autopair-post-command-handler nil 'local))
+ (t
+ (set (make-local-variable 'autopair-emulation-alist) nil)
+ (remove-hook 'post-command-hook 'autopair-post-command-handler 'local))))
+
+;;;###autoload
(define-globalized-minor-mode autopair-global-mode autopair-mode autopair-on)
(when (eval-when-compile (>= emacs-major-version 24))
@@ -370,26 +390,6 @@ We want this advice to only kick in the *second* call to
autopair-dont-activate)
(autopair-mode 1))))
-;;;###autoload
-(define-minor-mode autopair-mode
- "Automagically pair braces and quotes like in TextMate."
- nil " pair" nil
- (cond (autopair-mode
- ;; Setup the dynamic emulation keymap, i.e. sets `autopair-emulation-alist'
- ;;
- (autopair-set-emulation-bindings)
- (add-to-list 'emulation-mode-map-alists 'autopair-emulation-alist 'append)
- ;; Init important vars
- ;;
- (setq autopair-action nil)
- (setq autopair-wrap-action nil)
- ;; Add the post command handler
- ;;
- (add-hook 'post-command-hook 'autopair-post-command-handler nil 'local))
- (t
- (set (make-local-variable 'autopair-emulation-alist) nil)
- (remove-hook 'post-command-hook 'autopair-post-command-handler 'local))))
-
(defun autopair-set-emulation-bindings ()
"Setup keymap MAP with keybindings based on the major-mode's
syntax table and the local value of `autopair-extra-pairs'."
Something went wrong with that request. Please try again.