mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-24 21:32:52 +00:00
Abort remember if the remember buffer is empty
Following a report by Ryan C. Thompson
This commit is contained in:
parent
737757a5fd
commit
28e95ee828
|
@ -1,5 +1,8 @@
|
|||
2009-06-08 Carsten Dominik <carsten.dominik@gmail.com>
|
||||
|
||||
* org-remember.el (org-remember-handler): Abort remember if the
|
||||
buffer is empty.
|
||||
|
||||
* org-src.el (org-edit-src-content-indentation): New option.
|
||||
(org-edit-src-exit): Apply extra indentation.
|
||||
|
||||
|
|
|
@ -788,11 +788,11 @@ See also the variable `org-reverse-note-order'."
|
|||
(replace-match ""))
|
||||
(goto-char (point-max))
|
||||
(beginning-of-line 1)
|
||||
(while (looking-at "[ \t]*$\\|##.*")
|
||||
(while (and (looking-at "[ \t]*$\\|##.*") (> (point) 1))
|
||||
(delete-region (1- (point)) (point-max))
|
||||
(beginning-of-line 1))
|
||||
(catch 'quit
|
||||
(if org-note-abort (throw 'quit nil))
|
||||
(if org-note-abort (throw 'quit t))
|
||||
(let* ((visitp (org-bound-and-true-p org-jump-to-target-location))
|
||||
(backup-file
|
||||
(and buffer-file-name
|
||||
|
@ -802,6 +802,16 @@ See also the variable `org-reverse-note-order'."
|
|||
(string-match "^remember-[0-9]\\{4\\}"
|
||||
(file-name-nondirectory buffer-file-name))
|
||||
buffer-file-name))
|
||||
|
||||
(dummy
|
||||
(unless (string-match "\\S-" (buffer-string))
|
||||
(message "Nothing to remember")
|
||||
(and backup-file
|
||||
(ignore-errors
|
||||
(delete-file backup-file)
|
||||
(delete-file (concat backup-file "~"))))
|
||||
(set-buffer-modified-p nil)
|
||||
(throw 'quit t)))
|
||||
(previousp (and (member current-prefix-arg '((16) 0))
|
||||
org-remember-previous-location))
|
||||
(clockp (equal current-prefix-arg 2))
|
||||
|
|
Loading…
Reference in a new issue