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

Commit

Permalink
* fix `autopair-skip-whitespace'
Browse files Browse the repository at this point in the history
git-svn-id: https://autopair.googlecode.com/svn/trunk@32 56c4f94e-c24a-11de-a250-c7f789e21d83
  • Loading branch information
joaotavora committed Mar 31, 2010
1 parent 3322ec7 commit 0de0c1b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions autopair.el
Expand Up @@ -7,7 +7,7 @@
;; X-URL: http://autopair.googlecode.com
;; URL: http://autopair.googlecode.com
;; EmacsWiki: AutoPairs
;; Version: 0.3
;; Version: 0.4
;; Revision: $Rev$ ($LastChangedDate$)

;; This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -98,6 +98,8 @@
;; If you find the paren-blinking annoying, turn `autopair-blink' to
;; nil.
;;
;; For lisp-programming you might also like `autopair-skip-whitespace'.
;;
;; For further customization have a look at `autopair-dont-pair',
;; `autopair-handle-action-fns' and `autopair-extra-pair'.
;;
Expand Down Expand Up @@ -446,6 +448,12 @@ A list of four elements is returned:
This is also done in an optimistic \"try-to-balance\" fashion.")

(defvar autopair-skip-whitespace nil
"If non-nil also skip over whitespace when skipping closing delimiters.
This will be most useful in lisp-like languages where you want
lots of )))))....")

(defvar autopair-blink (if (boundp 'blink-matching-paren)
blink-matching-paren
t)
Expand All @@ -454,9 +462,6 @@ This is also done in an optimistic \"try-to-balance\" fashion.")
(defvar autopair-blink-delay 0.1
"Autopair's blink-the-delimiter delay.")

(defvar autopair-skip-whitespace nil
"If non-nil attempt to skip whitespace before closing delimiters.")

(defun autopair-document-bindings (&optional fallback-keys)
(concat
"Works by scheduling possible autopair behaviour, then calls
Expand Down Expand Up @@ -790,7 +795,7 @@ returned) and uplisting stops there."
(let ((skipped 0))
(when autopair-skip-whitespace
(setq skipped (save-excursion (skip-chars-forward "\s\n\t"))))
(when (eq last-input-event (char-after (point)))
(when (eq last-input-event (char-after (+ (point) skipped)))
(unless (zerop skipped) (autopair-blink (+ (point) skipped)))
(delete-char (1+ skipped))
(autopair-blink-matching-open))))
Expand Down

0 comments on commit 0de0c1b

Please sign in to comment.