mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
Make the environment of elisp evaluation more friendly to (current-column)
This commit is contained in:
parent
1ad8d82ac9
commit
de67b5802f
@ -430,6 +430,7 @@ a list of modes like this to help the judgement."
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(save-match-data
|
||||
(widen)
|
||||
(format "%s" (eval (read string))))))
|
||||
(error (format "(error in elisp evaluation: %s)"
|
||||
(error-message-string err)))))
|
||||
@ -620,6 +621,9 @@ will be deleted before inserting template."
|
||||
;; Step 3: evaluate all backquotes
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "`\\([^`]*\\)`" nil t)
|
||||
;; go back so that (current-column) in elisp code evaluation
|
||||
;; will calculate to a meaningful value
|
||||
(goto-char (match-beginning 0))
|
||||
(replace-match (yas/eval-string (match-string-no-properties 1))
|
||||
t t))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user