mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
yas--document-symbol: reindent
This commit is contained in:
parent
46c378d738
commit
21914cfe32
@ -65,23 +65,26 @@
|
|||||||
;; 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-]+" #'(lambda (match)
|
"[A-Z][A-Z-]+"
|
||||||
(setq match (downcase match))
|
#'(lambda (match)
|
||||||
(format (if (member match args)
|
(setq match (downcase match))
|
||||||
"=%s=" "/%s/")
|
(format (if (member match args)
|
||||||
match))
|
"=%s=" "/%s/")
|
||||||
|
match))
|
||||||
body t)
|
body t)
|
||||||
body (replace-regexp-in-string "`\\([a-z-]+\\)'" #'(lambda (match)
|
body (replace-regexp-in-string
|
||||||
(let* ((name (downcase (match-string 1 match)))
|
"`\\([a-z-]+\\)'"
|
||||||
(sym (intern name)))
|
#'(lambda (match)
|
||||||
(if (and (or (boundp sym)
|
(let* ((name (downcase (match-string 1 match)))
|
||||||
(fboundp sym))
|
(sym (intern name)))
|
||||||
(save-match-data
|
(if (and (or (boundp sym)
|
||||||
(string-match "^yas-" name)))
|
(fboundp sym))
|
||||||
(format "[[#%s][=%s=]]"
|
(save-match-data
|
||||||
name name)
|
(string-match "^yas-" name)))
|
||||||
(format "=%s=" name))))
|
(format "[[#%s][=%s=]]"
|
||||||
body))
|
name name)
|
||||||
|
(format "=%s=" name))))
|
||||||
|
body))
|
||||||
;; output the paragraph
|
;; output the paragraph
|
||||||
;;
|
;;
|
||||||
(concat-lines heading
|
(concat-lines heading
|
||||||
|
Loading…
x
Reference in New Issue
Block a user