My favorites | Sign in
Project Logo
             
New issue | Search
for
| Advanced search | Search tips
Issue 12: Handle escape properly
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  pluskid
Type-Enhancement
Priority-Medium


Sign in to add a comment
 
Reported by pluskid, Mar 20, 2008
I'm wondering the current way to handle escapes ($, ` and \) may cause
problems in some cases. Try a better way.
Comment 1 by pluskid, Feb 27, 2009
There's more problems to fix:

quote
<-----------------------------
Also, you haven't provided any way of including a } inside default
text. If it's just literal the field ends right there - and a
preceding backslash just shows up in the field rather than protecting
the }.

It's also a problem if elisp in the default *produces* a }, though
the program can contain a } character without a problem as long as
it doesn't.

If I make a snippet called test containing
Test ${1:\sometexthing{}morestuff} Snippet
it expands to
Test \sometexthing{morestuff} Snippet,
where the field stops after the { character.

The problem is a bit different with elisp.
Test ${1:`"}"`} Snippet
expands to
Test ${1:}} Snippettest
with everything from the $ onwards
in grey, and the status line saying
"Error in post-command-hook: (wrong-type-argument overlayp nil)"

This is also the result with the template
Test ${1:`(make-string 1 125)`}Snippet
so it's not the parsing before the elisp is executed, and to be sure
Test ${1:`(progn "}" "Silly")`} Snippet
expands normally to
Test Silly Snippet

Looking at the code a bit I see all `` are expanded
before you even try to locate the tab stops, so that
makes sense, and maybe a } inside a transform would
give you lexical problems again.

Well, I don't know much elisp and it's getting late
so I can't fix that now. I hope the patches are useful.
------------------------------->
Sign in to add a comment

Hosted by Google Code