--- /usr/share/emacs/site-lisp/org-mode/org-remember.el 2009-03-13 10:00:34.000000000 -0400 +++ org-remember.el 2009-06-08 15:43:04.708905961 -0400 @@ -740,10 +740,14 @@ (replace-match "")) (goto-char (point-max)) (beginning-of-line 1) - (while (looking-at "[ \t]*$\\|##.*") - (delete-region (1- (point)) (point-max)) - (beginning-of-line 1)) (catch 'quit + (while (looking-at "[ \t]*$\\|##.*") + ;; Abort on empty buffer + (if (= (point) (point-min)) + (throw 'quit nil) + (previous-line))) + (end-of-line 1) ; end of last nonblank line + (delete-region (point) (point-max)) (if org-note-abort (throw 'quit nil)) (let* ((visitp (org-bound-and-true-p org-jump-to-target-location)) (previousp (and (member current-prefix-arg '((16) 0))