Skip to content

Instantly share code, notes, and snippets.

@YoungFrog
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YoungFrog/d7db1fb00e30ef93e9d7 to your computer and use it in GitHub Desktop.
Save YoungFrog/d7db1fb00e30ef93e9d7 to your computer and use it in GitHub Desktop.
(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