Subject: Re: bug#23749: 24.3.50; can't make the cursor to the end of a buffer when that buffer is visible
From: Noam Postavsky <[email-masked]>
To: Samuel Lê <[email-masked]>
Cc: [email-masked]
Date: Sun, 12 Jun 2016 11:51:31 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Cool, could be compacted a little:

(defun insert-into-buffer (buffer text)
  (with-current-buffer buffer
    (beginning-of-line)
    (insert text)
    (let ((buffer-window (get-buffer-window)))
      (if buffer-window
          (set-window-point buffer-window (point-max))
        (goto-char (point-max))))))