in emacs-lisp, how to position point in middle of text string? -
in emacs-lisp, how position point in middle of text string? i'd cursor wind %s
in following function:
(defun web-research () (interactive) (insert "#+begin_quote\n\n%s\n#+end_quote\n") (org-mac-chrome-insert-frontmost-url) )
there many options. e.g.,
(defun web-research () (interactive) (insert "#+begin_quote\n\n%s\n#+end_quote\n") (search-backward "%") (org-mac-chrome-insert-frontmost-url))
or
(defun web-research () (interactive) (insert "#+begin_quote\n\n") (let ((p (point))) (insert "\n\n#+end_quote\n") (org-mac-chrome-insert-frontmost-url) (goto-char p))
or
(defun web-research () (interactive) (insert "#+begin_quote\n\n%s") (save-excursion (insert "\n#+end_quote\n")) (org-mac-chrome-insert-frontmost-url))
imo second best.
Comments
Post a Comment