mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
markup suffixed variable names, eg SUBEXPth
This commit is contained in:
parent
582e3680b6
commit
0a9885eb62
@ -61,17 +61,20 @@
|
|||||||
(format "*WARNING*: no doc for symbol =%s=" symbol)))
|
(format "*WARNING*: no doc for symbol =%s=" symbol)))
|
||||||
(case-fold-search nil))
|
(case-fold-search nil))
|
||||||
;; do some transformations on the body:
|
;; do some transformations on the body:
|
||||||
;; ARG becomes =arg=
|
;; ARGxxx becomes @<code>arg@</code>xxx
|
||||||
;; FOO becomes /foo/
|
;; FOO becomes /foo/
|
||||||
;; `bar' becomes [[#bar][=bar=]]
|
;; `bar' becomes [[#bar][=bar=]]
|
||||||
(setq body (replace-regexp-in-string
|
(setq body (replace-regexp-in-string
|
||||||
"\\<[A-Z][A-Z-]+\\>"
|
"\\<\\([A-Z][-A-Z0-9]+\\)\\(\\sw+\\)?\\>"
|
||||||
#'(lambda (match)
|
#'(lambda (match)
|
||||||
(setq match (downcase match))
|
(let* ((match1 (downcase (match-string 1 match)))
|
||||||
(format (if (member match args)
|
(suffix (match-string 2 match))
|
||||||
"=%s=" "/%s/")
|
(fmt (cond
|
||||||
match))
|
((member match1 args) "@<code>%s@</code>")
|
||||||
body t)
|
((null suffix) "/%s/"))))
|
||||||
|
(if fmt (format fmt match1)
|
||||||
|
match)))
|
||||||
|
body t t 1)
|
||||||
body (replace-regexp-in-string
|
body (replace-regexp-in-string
|
||||||
"`\\([a-z-]+\\)'"
|
"`\\([a-z-]+\\)'"
|
||||||
#'(lambda (match)
|
#'(lambda (match)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user