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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -