Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(let ((buf (get-buffer-create "*scratch*"))
(text "\n;; ===\n"))
(when (get-buffer-window buf)
(message "Buffer is shown in some window"))
(with-current-buffer buf
(message "p/pm: %s/%s" (point) (point-max))
(if (eq (point) (point-max))
(insert text)
(save-excursion
(goto-char (point-max))
(insert text)))
(message "p/pm: %s/%s" (point) (point-max))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment