surround.vim vimpulse extension

Štěpán Němec stepnem at gmail.com
Sat Jul 24 00:28:37 CEST 2010


Tim Harper <timcharper at gmail.com> writes:

> Did anybody else use surround.vim?
>
> I've missed it ever since I switched to Emacs. Finally, last night, I
> got up the energy to hack something together:
>
> http://gist.github.com/487846

Hey, this is nice, thanks! I've been somewhat missing surround.vim, too,
but haven't got up the energy. ;-)

It's late here and the energy is *cough* still lacking, but while
reading your code, I've fixed some (of what seemed to me to be) typos
and style issues. The result of my reading is attached.

A few comments on that matter:
- docstrings: Section D.6 of the Elisp manual (Appendix) is the canonical
  reference here.
- Using asterisks for *variables* is also discouraged, but I left it as
  is, because it is actually a nice and sensible convention ;-P
  (disregarding the fact that Elisp is not sensible and all variables
  are dynamic) and this is just a hack so far anyway.
- You used the `map' function provided by the cl package, but didn't `require'
  it; but you actually don't need cl at all -- you can (should) use `mapcar'
  instead, and simpler versions of both `push' and `pop' are defined in
  subr.el.
- I wonder why you were setting the KILLFLAG arg to `delete-char'. Is saving
  random characters on the kill ring really your intention?
- In `vimpulse-surround-pairs' docstring you say: "This only has effect on
  creating new surround pairs, not deleting them." I have no idea what you
  mean here, could you try to explain it some more?

> Things that work:
>
> * Changes surrounding enclosures
> * add surrounding enclosures
> * delete sounding enclosures
>
> Not working yet:
>
> * Surround region with a tag
> * non-visual surrounding of regions (IE: ysiw")
> * repeat surround modifications
>
> I'm not extremely happy with my approach on how I'm looking into the
> delete/change commands. Basically, I'm hijacking them in doing an
> advise (as in defadvice) approach.
>
> Feedback welcome, but mostly, I hope this is enjoyed by somebody else.

It surely is, thanks again and good night,

Štěpán

-------------- next part --------------
A non-text attachment was scrubbed...
Name: vimpulse-surround.el
Type: application/emacs-lisp
Size: 7534 bytes
Desc: not available
Url : https://lists.ourproject.org/pipermail/implementations-list/attachments/20100724/e3f381ee/attachment-0001.bin 


More information about the implementations-list mailing list