Joao Tavora
386e84fdde
fix: make-snippet can be a function
2013-10-20 12:40:23 +01:00
Joao Tavora
0daac695e2
add: clear unmodified fields when inserting text at the beginning
2013-10-20 12:28:03 +01:00
Joao Tavora
54e93b60e9
add: broader tests, already catch many expansion errors
2013-10-19 17:20:51 +01:00
Joao Tavora
2db4102fda
fixup: guess I need to close snippet-objects after all
2013-10-19 17:20:25 +01:00
Joao Tavora
76bc40fd03
fix: properly handle snippet and mirror markers with `snippet--open-object'
...
* also snippet--close-object is apparently not needed
* don't call the mirror transforms when field-text is null, just
return empty string. also zero-length fields considered to have a
null field-text, not the empty string.
* correctly place markers when inserting objects
2013-10-19 15:31:24 +01:00
Joao Tavora
d43f42186d
refactor: store prev' and
next' in all objects, not prev-field' and
next-field'
2013-10-19 01:40:44 +01:00
Joao Tavora
67ddacd916
refactor: snippet--[open|close]-markers take objects not markers
2013-10-19 01:17:27 +01:00
Joao Tavora
62c40c50b9
fix: better take a list rather than &rest args in make-snippet
2013-10-19 00:56:35 +01:00
Joao Tavora
b682f6bcac
refactor: snippet--object struct included in fields and mirrors
2013-10-19 00:46:56 +01:00
Joao Tavora
4149acbaae
fix: prefix cl-lib functions with cl and wrap long lines
2013-10-19 00:27:17 +01:00
Joao Tavora
ccf3579344
fix: require cl-lib instead of cl
2013-10-18 14:40:37 +01:00
Joao Tavora
c5276642b8
refactor: do away with snippet--form-[mirror/field]-p, use pcase and cleaner loops
2013-10-18 14:40:01 +01:00
Joao Tavora
9927e08d89
add: another little test
2013-10-17 18:50:59 +01:00
Joao Tavora
55eaf62fd3
fix: order of edebug subforms in &or matters
2013-10-17 13:14:53 +01:00
Joao Tavora
0adcad2190
add: ert-based test-suite
2013-10-17 12:17:11 +01:00
Joao Tavora
b4bf8bbd33
new: make-snippet makes an anonymous snippet lambda
...
bug: apparently broke edebug though
2013-10-17 12:16:54 +01:00
Joao Tavora
6039bc667f
fix: provide a simple edebug spec for define-snippet
2013-10-16 19:05:04 +01:00
Joao Tavora
26065ae4f5
fix: don't require lexical-binding to call transforms with field text
2013-10-16 19:05:03 +01:00
Joao Tavora
33c696516a
fix: correctly allow functions as snippet forms
...
also make define-snippet expand directly to a defun
2013-10-16 19:05:02 +01:00
Joao Tavora
123f204d20
fix: slightly terser loop syntax
2013-10-16 19:05:01 +01:00
Joao Tavora
d2717d47fd
fix: set local variables correctly, i.e. dont set lexical-binding here
2013-10-16 19:04:59 +01:00
Joao Tavora
e00c7e2661
fix: respect 80 column rule mostly
2013-10-16 19:04:58 +01:00
João Távora
6c3e0294dd
Merge pull request #412 from npostavs/less-narrow
...
Wait till after content insertion to narrow
2013-10-14 09:28:42 -07:00
Noam Postavsky
5c76a0fda2
test middle-of-buffer snippet insertion
2013-10-14 11:48:04 -04:00
João Távora
3bb1515046
Merge pull request #409 from npostavs/font-lock
...
Fix yas--font-lock-keywords
2013-10-14 08:46:18 -07:00
Joao Tavora
3446300c1f
new: tests go in separate file, minor cleanup in snippet.el
2013-10-14 15:49:34 +01:00
Joao Tavora
2d0a1b831d
fix: possibly fragile fix for zero-length field/mirror bug
2013-10-14 15:12:06 +01:00
Joao Tavora
1f1edb6d4e
wip: fix the overlay-moving bug, but zero-length mirrors/fields still a problem
2013-10-14 15:09:20 +01:00
Noam Postavsky
51e9e8e53c
wait till after content insertion to narrow
...
Fixes #404 without inhibiting change hooks.
2013-10-14 10:00:45 -04:00
Noam Postavsky
6997922011
Revert "inhibit change hooks during (insert content)"
...
This reverts commit 90d4cae1b1bbfacc612e73444f1e5a723ae4036e.
2013-10-14 09:57:11 -04:00
Joao Tavora
002d524a32
wip: still buggy, but inching closer
2013-10-14 14:54:08 +01:00
Joao Tavora
7849ffcec5
fix: don't use universal-argument-num-events
2013-10-14 10:26:34 +01:00
Joao Tavora
6268cc26b3
add: test for issue #404
2013-10-14 10:25:38 +01:00
Noam Postavsky
90d4cae1b1
inhibit change hooks during (insert content)
...
`yas-expand-snippet' narrows to a 0 size region before doing (insert
content), this confuses cc-mode's before-change-functions that
invalidate some cached information. Binding `inhibit-modification-hooks'
to `t' prevents calling these functions.
Fixes #404 .
2013-10-14 01:05:29 -04:00
Joao Tavora
0919fa6575
fix: oops, big bug, mirrors and fields have to be made then initialized
2013-10-14 01:58:53 +01:00
Noam Postavsky
f21ddd1b2e
remove redundant font-lock-keywords
...
`lisp-font-lock-keywords' is identical to `lisp-font-lock-keywords1',
`lisp-font-lock-keywords2' is a superset of `lisp-font-lock-keywords1'.
2013-10-13 18:00:00 -04:00
Noam Postavsky
79f3656b3e
fix font-lock-keywords syntax
...
The syntax is (MATCHER . FACENAME) (note the dot).
2013-10-13 17:55:58 -04:00
Joao Tavora
21986d92fd
fix: need to intern marker symbols somewhere, otherwise they won't match
2013-10-13 22:27:25 +01:00
Joao Tavora
5d93e83375
add: insertion works nicely and seems i have simplified the marker mechanism
2013-10-13 21:52:35 +01:00
Joao Tavora
fc1c3632b6
wip: still inoperative, but much better macros, support parent fields
2013-10-12 15:47:43 +01:00
Joao Tavora
f00509a696
wip: a distilled snippet engine
2013-10-12 00:17:37 +01:00
João Távora
d963c41a14
Closes #406 : correct docstring for yas-extra-modes
2013-10-10 00:02:39 +01:00
João Távora
13cfdbc164
fix: remove references to dropdown-list.el in Rakefile
2013-10-10 00:00:22 +01:00
João Távora
1aac5fc273
Merge pull request #407 from dongxiong/patch-1
...
Update manual.mdown
2013-10-09 15:57:43 -07:00
dongxiong
88531271f1
Update manual.mdown
...
file name error
2013-10-03 12:09:26 +08:00
João Távora
3ec62aba0d
fix: please older emacsen, don't use LETREC after all
...
also fix some compiler warnings
2013-09-07 18:55:37 +01:00
João Távora
78c52fdf5c
fix: shoosh warning with LETREC instead of LET
2013-09-02 12:01:24 +01:00
João Távora
ce50b3dbfa
Closes #318 : Don't use CL-LABELS for backward compatibility with older emacsen
2013-09-02 11:55:55 +01:00
João Távora
a7d40ed14a
Closes #318 : correctly implement YAS--MODES-TO-ACTIVATE
...
- simpler and got rid of YAS--ALL-PARENTS
- also got rid of YAS/MODE-SYMBOL backward compatibility hack
2013-08-31 23:48:19 +01:00
João Távora
ddaf9a9f5c
Fix: cleanup yasnippet-tests.el
...
- add edebug-form-specs
- replace "yas/" with "yas-"
- yas/ert => yas-batch-run-tests
2013-08-31 23:48:00 +01:00