Tim Harper <[email protected]> writes: > Hey Štěpán, > > I integrated your changes and made an "official" project: > > http://github.com/timcharper/vimpulse-surround.el
Cool. > Thanks for your corrections, many good ones in there! Oh yeah, I thought they were all good! Turns out they weren't... a fix attached, sorry. Štěpán
>From dd3e3d2c71de1295904a2ad74d2998270fdd813f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0t=C4=9Bp=C3=A1n=20N=C4=9Bmec?= <[email protected]> Date: Sat, 24 Jul 2010 22:33:33 +0200 Subject: [PATCH] A few more minor fixes. Including a major one -- a bug introduced by my previous misreading of `vimpulse-surround-pairs'. --- vimpulse-surround.el | 31 +++++++++++++++---------------- 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/vimpulse-surround.el b/vimpulse-surround.el index 8a20113..693b2a3 100644 --- a/vimpulse-surround.el +++ b/vimpulse-surround.el @@ -1,4 +1,4 @@ -;;; vimpulse-surround.el --- emulates surround.vim, for vimpulse +;;; vimpulse-surround.el --- emulate surround.vim in Vimpulse ;; Copyright (C) 2010 Tim Harper ;; @@ -38,16 +38,16 @@ :group 'vimpulse) (defcustom vimpulse-surround-pairs - '((")" ("(" . ")")) - ("(" ("( " . " )")) - ("]" ("[" . "]")) - ("[" ("[ " . " ]")) - ("}" ("{" . "}")) - ("{" ("{ " . " }")) - ("#" ("#{" . "}"))) + '((")" . ("(" . ")")) + ("(" . ("( " . " )")) + ("]" . ("[" . "]")) + ("[" . ("[ " . " ]")) + ("}" . ("{" . "}")) + ("{" . ("{ " . " }")) + ("#" . ("#{" . "}"))) "Alist of surround items. -Each item is of the form (TRIGGER (LEFT . RIGHT)), all strings. -Does not apply to delete surround, change surround." +Each item is of the form (TRIGGER . (LEFT . RIGHT)), all strings. +This only affects inserting pairs, not deleting or changing them." :group 'vimpulse-surround :type '(repeat (cons (regexp :tag "Key") (symbol :tag "Surround pair")))) @@ -118,10 +118,10 @@ It triggers `vimpulse-change'. Nothing to see here, move along.") output)) (defun vimpulse-surround-zap-whitespace (direction boundary) - (let ((looking-at-space? (if (= direction 1) - (lambda () (looking-at "[ \t]")) - (lambda () (looking-back "[ \t]"))))) - (while (and (funcall looking-at-space?) (not (= (point) boundary))) + (let ((pred (if (= direction 1) + 'looking-at + 'looking-back))) + (while (and (funcall pred "[ \t]") (not (= (point) boundary))) (delete-char direction) (when (= direction 1) (setq boundary (1- boundary)))))) @@ -166,8 +166,7 @@ Prompt for a range. If the range returned is detected to be a surround range, dispatch to `vimpulse-surround-change'. Otherwise, dispatch to `vimpulse-change'." (interactive) - - (let (*vimpulse-surrounding*) + (let (*vimpulse-surrounding*) (when (not beg) (let ((range (vimpulse-range))) (setq beg (car range) end (cadr range)))) -- 1.7.1
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
