1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-12-28 10:56:57 +00:00

Agenda: Catch error when no mark is set

Bernt Hansen writes:

> When org-agenda-diary-file is set to a special org file for diary
> entries and transient mark mode is enabled 'i' in the agenda fails
> with 'mark is not active now'
>
> My workaround for this is C-SPC to set the mark anywhere legal in the
> agenda display (ie not on the first or last line) and then hit 'i'
> to insert my diary entries.
This commit is contained in:
Carsten Dominik 2009-11-20 12:29:03 +01:00
parent ee3e435843
commit d7ef0bbd72
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2009-11-20 Carsten Dominik <carsten.dominik@gmail.com>
* org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure
hat checking for the mark does not throw an error.
* org.el (org-sort-entries-or-items): Make sure that the final
entry has a newline before doing the sorting.

View File

@ -6667,7 +6667,7 @@ The cursor may be at a date in the calendar, or in the Org agenda."
d2 (car calendar-mark-ring))
(setq d1 (calendar-gregorian-from-absolute
(get-text-property (point-at-bol) 'day))
d2 (and (mark)
d2 (and (ignore-errors (mark))
(save-excursion
(goto-char (mark))
(setq dp (get-text-property (point-at-bol) 'day)))