Mercurial > emacs
comparison lisp/org/org-remember.el @ 96044:c1ef445563bb
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-colview.el (org-columns-next-allowed-value): Bug fix.
* org-colview-xemacs.el (org-columns-next-allowed-value): Bug fix.
* org-agenda.el (org-agenda-get-closed): Get the end time into the
agenda prefix as well.
* org-publish.el (org-publish-org-index): Make a properly indented
list.
* org.el (org-calendar-agenda-action-key): New option.
(org-get-cursor-date): New function.
(org-mark-entry-for-agenda-action): New command.
(org-overriding-default-time): New variable.
(org-read-date): Respect `org-overriding-default-time'.
* org-remember.el (org-remember-apply-template): Respect the
ovverriding default time.
* org-agenda.el (org-agenda-action-marker): New variable.
(org-agenda-action): New command.
(org-agenda-do-action): New function.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-schedule, org-deadline): Protect scheduled and
deadline tasks against changes that accidently remove the
repeater. Also show a message with the new date when done.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-beginning-of-line): Cater for the case when there
are tags but no headline text.
(org-align-tags-here): Convert to tabs only when indent-tabs-mode
it set.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-mhe.el (org-mhe-get-message-folder-from-index): Make sure
the return value is nil instead of "nil" when there is no match.
* org-exp.el (org-insert-centered): Use fill-column instead of
80.
(org-export-as-ascii): Use string-width to measure the width of
the heading.
* org.el (org-diary-to-ical-string): No longer kill buffer
FROMBUF, this is now done by the caller.
* org-exp.el (org-print-icalendar-entries): Move the call to
`org-diary-to-ical-string' out of the loop, and kill the buffer
afterwords.
* org-remember.el (org-remember-visit-immediately): Position
cursor after moving to the note.
(org-remember-apply-template): Use a text property to record the
cursor position.
(org-remember-handler): Align tags after pasting the note.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-bbdb.el (org-bbdb-follow-anniversary-link): New function.
* org-agenda.el (org-agenda-open-link): If there is an
org-bbdb-name property in the current line, jump to that bbdb
entry.
* org-bbdb.el (org-bbdb-anniversaries): Add the bbdb-name as a
text property, so that the agenda knows where this entry comes
from.
* org-agenda.el (org-agenda-clock-in): Fixed bug in the
interaction between clocking-in from the agenda, and automatic
task state switching.
* org-macs.el (org-with-point-at): Bug fix in macro defintion.
* org.el (org-beginning-of-line, org-end-of-line): Make sure the
zmacs-region stays after this command in XEmacs.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-scan-tags): Allow new values for ACTION parameter.
* org-remember.el (org-remember-templates): Fix bug in
customization type definition.
* org.el (org-map-entries): New function.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-agenda.el (org-agenda-skip-comment-trees): New option.
(org-agenda-skip): Respect `org-agenda-skip-comment-trees'.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-remember.el (org-jump-to-target-location): New variable.
(org-remember-apply-template): Set
`org-remember-apply-template' if requested by template.
(org-remember-handler): Start an idle timer to jump to
remember location.
* org-exp.el (org-get-current-options): Add the FILETAGS setting.
* org.el (org-set-regexps-and-options): Fix bug with parsing of
file tags.
(org-get-tags-at): Add the content of `org-file-tags'.
* org-exp.el (org-export-handle-comments): Fix bug with several
comment lines after each other.
(org-number-to-roman, org-number-to-counter): New functions.
(org-export-section-number-format): New option.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-exp.el (org-export-protect-examples): Catch the case of a
missing end_example line.
* org.el (org-set-regexps-and-options): Set `org-file-properties' and
`org-file-tags' to nil.
* org-colview.el (org-columns-next-allowed-value): Handle next
argument NTH to directly select a value.
* org-colview-xemacs.el (org-columns-next-allowed-value): Handle next
argument NTH to directly select a value.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-agenda.el (org-agenda-scheduled-leaders): Fix docstring.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-columns-ellipses): New option.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-colview.el (org-columns-add-ellipses): New function.
(org-columns-compact-links): New function.
(org-columns-cleanup-item): Call `org-columns-compact-links'.
(org-columns-display-here): Call `org-agenda-columns-cleanup-item'
when in agenda.
(org-columns-edit-value): Fixed bug with editing values from
agenda column view.
(org-columns-redo): Also redo the agenda itself.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-agenda.el (org-agenda-columns-remove-prefix-from-item): New
option.
* org-colview.el (org-agenda-columns-cleanup-item): New function.
* org-exp.el (org-export-ascii-preprocess): Renamed from
`org-export-ascii-clean-string'.
(org-export-kill-licensed-text)
(org-export-define-heading-targets)
(org-export-handle-invisible-targets)
(org-export-target-internal-links)
(org-export-remove-or-extract-drawers)
(org-export-remove-archived-trees)
(org-export-protect-quoted-subtrees)
(org-export-protect-verbatim, org-export-protect-examples)
(org-export-select-backend-specific-text)
(org-export-mark-blockquote-and-verse)
(org-export-remove-comment-blocks-and-subtrees)
(org-export-handle-comments, org-export-mark-radio-links)
(org-export-remove-special-table-lines)
(org-export-normalize-links)
(org-export-concatenate-multiline-links)
(org-export-concatenate-multiline-emphasis): New functions,
obtained from spliiting the export preprocessor.
* org-table.el (org-table-recalculate): Improve error message if
the row number is invalid.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-archive.el (org-archive-save-context-info): Fix bugs in
customization setup and docstring.
* org-exp.el (org-export-html-style): Changed the size of in the
<pre> element to 90%.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-find-src-example-start): Function removed.
(org-edit-src-find-region-and-lang): New function.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-edit-src-exit): New function.
(org-exit-edit-mode): New minor mode.
* org-exp.el (org-export-preprocess-string): Fix bug with removing
comment-like lines from protected examples.
* org.el (org-edit-src-example, org-find-src-example-start)
(org-protect-source-example, org-edit-special): New functions.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-publish.el (org-publish-project-alist): Fix typo in
docstring.
(org-publish-project-alist): Handle :index-title property.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-export-latex.el (org-export-as-latex): Make sure region
bounds are correct. Parse subtree properties relating to export.
* org-exp.el (org-export-add-options-to-plist): New function.
(org-infile-export-plist): Use `org-export-add-options-to-plist'.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-default-properties): Add EXPORT_FILE_NAME and
EXPORT_TITLE.
* org-exp.el (org-export-get-title-from-subtree)
(org-export-as-ascii, org-export-as-html): Make sure the original
region-beginning and region-end are used, even after moving
point.
(org-export-get-title-from-subtree): Also try the EXPORT_TITLE
property.
* org-remember.el (org-remember-last-stored-marker): New variable.
(org-remember-goto-last-stored): Use `org-goto-marker-or-bmk'.
(org-remember-handler): Also use marker to remember
last-stored position.
* org.el (org-goto-marker-or-bmk): New function.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-file-properties): Renamed from `org-local-properties'.
(org-scan-tags): Take file tags into account.
(org-tags-match-list-sublevels): Default changed to t.
* org-exp.el (org-export-as-html): Close paragraph after a
footnote.
* org.el (org-update-parent-todo-statistics): New function.
* org-exp.el (org-icalendar-store-UID): New option.
(org-icalendar-force-UID): Option removed.
(org-print-icalendar-entries): IMplement UIDs.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-mhe.el (org-mhe-follow-link): Fix bug in mhe searches.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-faces.el (org-column): Document how this face is being used
and why sometimes the background faces shine through.
* org-mhe.el (org-mhe-follow-link): Improve handling of searches.
* org-publish.el (org-publish-attachment): Create publishing
directory if it does not yet exist.
* org-table.el (org-calc-default-modes): Change default number
format to (float 8).
* org.el (org-olpath-completing-read): New function.
(org-time-clocksum-format): New option.
(org-minutes-to-hh:mm-string): Use `org-time-clocksum-format'.
* org-clock.el (org-clock-display, org-clock-out)
(org-update-mode-line): Use `org-time-clocksum-format'.
* org-colview-xemacs.el (org-columns-number-to-string): Use
`org-time-clocksum-format'.
* org-colview.el (org-columns-number-to-string): Use
`org-time-clocksum-format'.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-id.el: New file, move from contrib to core.
* org-exp.el (org-icalendar-force-UID): New option.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-exp.el (org-print-icalendar-entries): Make sure DTEND is
shifted by one day if theere is a date range without an end
time.
* org.el (org-try-structure-completion): New function.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-set-font-lock-defaults): Improve fontification of
description lists.
(org-insert-item): Handle description lists.
(org-adaptive-fill-function): Improve auto indentation in
description lists.
* org-exp.el (org-export-as-html, org-export-preprocess-string):
Implement VERSE environment.
(org-export-preprocess-string): Implement the COMMENT
environment.
* org-export-latex.el (org-export-latex-preprocess): Implement
VERSE environment.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-jsinfo.el (org-infojs-opts-table): Add entry for FIXED_TOC
option.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-table.el (orgtbl-to-tsv, orgtbl-to-csv): New functions.
* org.el (org-quote-csv-field): New functions.
* org-table.el (org-table-export-default-format): Remove :splice
from default format, we get the same effect by not specifying
:tstart and :tend.
(org-table-export): Improve setup, distinguish better between
interactive and non-interactive use, allow specifying the format
on the fly, better protection against wrong file names.
(orgtbl-to-generic): Fix documentation. Do not require :tstart
and :tend when :splice is omitted.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-clock.el (org-clock-select-task): Make sure the selection
letters are 1-9 and A-Z, no special characters.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-exp.el (org-export-htmlize): New group.
(org-export-htmlize-output-type)
(org-export-htmlize-css-font-prefix): New options.
(org-export-htmlize-region-for-paste): New function.
(org-export-htmlize-generate-css): New command.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-set-visibility-according-to-property): New function.
(org-ctrl-c-ctrl-c): Do not restart org-mode, just get the options
and compute the regular expressions, and update font-lock.
(org-property-re): Allow a dash in property names.
* org-archive.el (org-extract-archive-file): Insert the file name
without the path into the format, to allow the location format to
contain a subdirectory.
* org-agenda.el (org-agenda-post-command-hook): If point is at end
of buffer, and the `org-agenda-type' property undefined, use the
value from the character before.
* org.el (org-add-planning-info): Don't let indentation for
would-be timestamp become extra whitespace at the end of headline.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-remove-double-quotes, org-file-contents): New
functions.
* org-exp.el (org-infile-export-plist): Also parse the
contents of #+SETUPFILE files, recursively.
* org.el (org-set-regexps-and-options): Also parse the
contents of #+SETUPFILE files, recursively.
* org-exp.el (org-export-handle-include-files): New function.
(org-export-preprocess-string): Call
`org-export-handle-include-files'.
* org.el (org-delete-property-globally)
(org-delete-property, org-set-property): Ignore case during
completion.
(org-set-property): Use `org-completing-read' instead of
`completing-read'.
* org.el (org-complete-expand-structure-template): New,
experimental function.
(org-structure-template-alist): New, experimental option.
(org-complete): Call `org-complete-expand-structure-template'.
2008-06-17 Bastien Guerry <bzg@altern.org>
* org-export-latex.el (org-export-latex-preprocess): Added
support for blockquotes.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-read-date-analyze): Catch the case where only a
weekday is given.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-set-font-lock-defaults): Make the description
tag bold.
* org-exp.el (org-export-as-html, org-close-li): Implement
description lists.
2008-06-17 Jason Riedy <jason@acm.org>
* org-table.el (*orgtbl-default-fmt*): New variable.
(orgtbl-format-line): Use the value of *orgtbl-default-fmt*
when there is no other fmt available.
(orgtbl-to-generic): Allow an explicitly nil :tstart or
:tend to suppress the appropriate string.
(orgtbl-to-orgtbl): New function for translating to another orgtbl
table.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.el (org-read-date-analyze): "." as an alias for "+0" in
read date.
* org-clock.el (org-clock-save-markers-for-cut-and-paste):
New function.
* org-agenda.el (org-agenda-save-markers-for-cut-and-paste):
New function.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-clock.el (org-clock-find-position): Don't include notes
into clock drawer.
* org-archive.el (org-archive-subtree): No longer remove an
extra line after cutting the subtree. `org-cut-subtree' already
takes care of this.
* org-remember.el (org-remember-handler): Only kill the target
buffer if it does not contain the running clock.
* org.el (org-markers-to-move): New variable.
(org-save-markers-in-region, org-check-and-save-marker)
(org-reinstall-markers-in-region): New function.
(org-move-subtree-down, org-copy-subtree): Remember relative
marker positions before cutting.
(org-move-subtree-down, org-paste-subtree): Restore relative
marker positions after pasting.
* org-remember.el (org-remember-clock-out-on-exit): New option.
(org-remember-finalize): Clock out only if the setting in
`org-remember-clock-out-on-exit' requires it.
(org-remember-handler): Do the cleanup in the buffer, to make sure
that the clock marker remains in tact.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-clock.el (org-clock-goto): Widen buffer if necessary.
(org-clock-in): Make sure that also tasks outside the narrowed
region will be clocked in correctly.
(org-clock-insert-selection-line): Widen the buffer so that we can
find the correct task heading.
* org.el (org-base-buffer): New function.
* org-exp.el (org-icalendar-cleanup-string): Make sure ',"
and ";" are escaped.
(org-print-icalendar-entries): Also apply
`org-icalendar-cleanup-string' to the headline, not only to the
summary property.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org-exp.el (org-export-preprocess-hook): New hook.
(org-export-preprocess-string): Call
`org-export-preprocess-hook'.
* org.el (org-font-lock-hook): New variable.
(org-font-lock-hook): New function.
(org-set-font-lock-defaults): Call `org-font-lock-hook'.
2008-06-17 Carsten Dominik <dominik@science.uva.nl>
* org.texi: Modify license to no longer include back- and front
cover matters.
(Using the mapping API): New section.
(Agenda column view): New section.
(Moving subtrees): Document archiving to the archive
sibling.
(Agenda commands): Document columns view in the agenda.
(Using the property API): Document the API for
multi-valued properties.
author | Carsten Dominik <dominik@science.uva.nl> |
---|---|
date | Tue, 17 Jun 2008 15:22:00 +0000 |
parents | dd60c92dc99e |
children | 60149c696033 |
comparison
equal
deleted
inserted
replaced
96043:a678c02d0c40 | 96044:c1ef445563bb |
---|---|
3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | 3 ;; Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Carsten Dominik <carsten at orgmode dot org> | 5 ;; Author: Carsten Dominik <carsten at orgmode dot org> |
6 ;; Keywords: outlines, hypermedia, calendar, wp | 6 ;; Keywords: outlines, hypermedia, calendar, wp |
7 ;; Homepage: http://orgmode.org | 7 ;; Homepage: http://orgmode.org |
8 ;; Version: 6.02b | 8 ;; Version: 6.05a |
9 ;; | 9 ;; |
10 ;; This file is part of GNU Emacs. | 10 ;; This file is part of GNU Emacs. |
11 ;; | 11 ;; |
12 ;; GNU Emacs is free software: you can redistribute it and/or modify | 12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
13 ;; it under the terms of the GNU General Public License as published by | 13 ;; it under the terms of the GNU General Public License as published by |
48 "Options concerning interaction with remember.el." | 48 "Options concerning interaction with remember.el." |
49 :tag "Org Remember" | 49 :tag "Org Remember" |
50 :group 'org) | 50 :group 'org) |
51 | 51 |
52 (defcustom org-remember-store-without-prompt t | 52 (defcustom org-remember-store-without-prompt t |
53 "Non-nil means, `C-c C-c' stores remember note without further promts. | 53 "Non-nil means, `C-c C-c' stores remember note without further prompts. |
54 In this case, you need `C-u C-c C-c' to get the prompts for | 54 It then uses the file and headline specified by the template or (if the |
55 note file and headline. | 55 themplate does not specify them) by the variables `org-default-notes-file' |
56 and `org-remember-default-headline'. To force prompting anyway, use | |
57 `C-u C-c C-c' to file the note. | |
58 | |
56 When this variable is nil, `C-c C-c' gives you the prompts, and | 59 When this variable is nil, `C-c C-c' gives you the prompts, and |
57 `C-u C-c C-c' triggers the fasttrack." | 60 `C-u C-c C-c' triggers the fasttrack." |
58 :group 'org-remember | 61 :group 'org-remember |
59 :type 'boolean) | 62 :type 'boolean) |
60 | 63 |
97 by `org-default-notes-file'. If the file name is not an absolute path, | 100 by `org-default-notes-file'. If the file name is not an absolute path, |
98 it will be interpreted relative to `org-directory'. | 101 it will be interpreted relative to `org-directory'. |
99 | 102 |
100 An optional fifth element can specify the headline in that file that should | 103 An optional fifth element can specify the headline in that file that should |
101 be offered first when the user is asked to file the entry. The default | 104 be offered first when the user is asked to file the entry. The default |
102 headline is given in the variable `org-remember-default-headline'. | 105 headline is given in the variable `org-remember-default-headline'. When |
103 | 106 this element is `top' or `bottom', the note will be placed as a level-1 |
104 An optional sixth element specifies the contexts in which the user can | 107 entry at the beginning or end of the file, respectively. |
105 select the template. This element can be either a list of major modes | 108 |
106 or a function. `org-remember' will first check whether the function | 109 An optional sixth element specifies the contexts in which the template |
107 returns `t' or if we are in any of the listed major modes, and select | 110 will be offered to the user. This element can be a list of major modes |
108 the template accordingly. | 111 or a function, and the template will only be offered if `org-remember' |
112 is called from a mode in the list, or if the function returns t. | |
113 Templates that specify t or nil for the context will be always be added | |
114 to the list of selectable templates. | |
109 | 115 |
110 The template specifies the structure of the remember buffer. It should have | 116 The template specifies the structure of the remember buffer. It should have |
111 a first line starting with a star, to act as the org-mode headline. | 117 a first line starting with a star, to act as the org-mode headline. |
112 Furthermore, the following %-escapes will be replaced with content: | 118 Furthermore, the following %-escapes will be replaced with content: |
113 | 119 |
115 A default value and a completion table ca be specified like this: | 121 A default value and a completion table ca be specified like this: |
116 %^{prompt|default|completion2|completion3|...} | 122 %^{prompt|default|completion2|completion3|...} |
117 %t time stamp, date only | 123 %t time stamp, date only |
118 %T time stamp with date and time | 124 %T time stamp with date and time |
119 %u, %U like the above, but inactive time stamps | 125 %u, %U like the above, but inactive time stamps |
120 %^t like %t, but prompt for date. Similarly %^T, %^u, %^U | 126 %^t like %t, but prompt for date. Similarly %^T, %^u, %^U. |
121 You may define a prompt like %^{Please specify birthday}t | 127 You may define a prompt like %^{Please specify birthday |
122 %n user name (taken from `user-full-name') | 128 %n user name (taken from `user-full-name') |
123 %a annotation, normally the link created with org-store-link | 129 %a annotation, normally the link created with org-store-link |
124 %i initial content, the region active. If %i is indented, | 130 %i initial content, the region active. If %i is indented, |
125 the entire inserted text will be indented as well. | 131 the entire inserted text will be indented as well. |
126 %c content of the clipboard, or current kill ring head | 132 %c current kill ring head |
133 %x content of the X clipboard | |
134 %^C Interactive selection of which kill or clip to use | |
135 %^L Like %^C, but insert as link | |
127 %^g prompt for tags, with completion on tags in target file | 136 %^g prompt for tags, with completion on tags in target file |
128 %^G prompt for tags, with completion all tags in all agenda files | 137 %^G prompt for tags, with completion all tags in all agenda files |
129 %:keyword specific information for certain link types, see below | 138 %:keyword specific information for certain link types, see below |
130 %[pathname] insert the contents of the file given by `pathname' | 139 %[pathname] insert the contents of the file given by `pathname' |
131 %(sexp) evaluate elisp `(sexp)' and replace with the result | 140 %(sexp) evaluate elisp `(sexp)' and replace with the result |
132 %! Store this note immediately after filling the template | 141 %! Store this note immediately after filling the template |
142 %& Visit note immediately after storing it | |
133 | 143 |
134 %? After completing the template, position cursor here. | 144 %? After completing the template, position cursor here. |
135 | 145 |
136 Apart from these general escapes, you can access information specific to the | 146 Apart from these general escapes, you can access information specific to the |
137 link type that is created. For example, calling `remember' in emails or gnus | 147 link type that is created. For example, calling `remember' in emails or gnus |
162 :tag "enabled" | 172 :tag "enabled" |
163 (list :value ("" ?a "\n" nil nil nil) | 173 (list :value ("" ?a "\n" nil nil nil) |
164 (string :tag "Name") | 174 (string :tag "Name") |
165 (character :tag "Selection Key") | 175 (character :tag "Selection Key") |
166 (string :tag "Template") | 176 (string :tag "Template") |
167 (choice | 177 (choice :tag "Destination file" |
168 (file :tag "Destination file") | 178 (file :tag "Specify") |
169 (const :tag "Prompt for file" nil)) | 179 (const :tag "Use `org-default-notes-file'" nil)) |
170 (choice | 180 (choice :tag "Destin. headline" |
171 (string :tag "Destination headline") | 181 (string :tag "Specify") |
172 (const :tag "Selection interface for heading")) | 182 (const :tag "Use `org-remember-default-headline'" nil) |
173 (choice | 183 (const :tag "Level 1 at beginning of file" top) |
174 (const :tag "Use by default" nil) | 184 (const :tag "Level 1 at end of file" bottom)) |
185 (choice :tag "Context" | |
186 (const :tag "Use in all contexts" nil) | |
175 (const :tag "Use in all contexts" t) | 187 (const :tag "Use in all contexts" t) |
176 (repeat :tag "Use only if in major mode" | 188 (repeat :tag "Use only if in major mode" |
177 (symbol :tag "Major mode")) | 189 (symbol :tag "Major mode")) |
178 (function :tag "Perform a check against function"))))) | 190 (function :tag "Perform a check against function"))))) |
191 | |
192 (defcustom org-remember-clock-out-on-exit 'query | |
193 "Non-nil means, stop the clock when exiting a clocking remember buffer. | |
194 This only applies if the clock is running in the remember buffer. If the | |
195 clock is not stopped, it continues to run in the storage location. | |
196 Instead of nil or t, this may also be the symbol `query' to prompt the | |
197 user each time a remember buffer with a running clock is filed away. " | |
198 :group 'org-remember | |
199 :type '(choice | |
200 (const :tag "Never" nil) | |
201 (const :tag "Always" t) | |
202 (const :tag "Query user" query))) | |
203 | |
179 | 204 |
180 (defvar annotation) ; from remember.el, dynamically scoped in `remember-mode' | 205 (defvar annotation) ; from remember.el, dynamically scoped in `remember-mode' |
181 (defvar initial) ; from remember.el, dynamically scoped in `remember-mode' | 206 (defvar initial) ; from remember.el, dynamically scoped in `remember-mode' |
182 | 207 |
183 ;;;###autoload | 208 ;;;###autoload |
201 UP/DOWN=headline TAB=cycle visibility [Q]uit RET/<left>/<right>=Store | 226 UP/DOWN=headline TAB=cycle visibility [Q]uit RET/<left>/<right>=Store |
202 RET on headline -> Store as sublevel entry to current headline | 227 RET on headline -> Store as sublevel entry to current headline |
203 RET at beg-of-buf -> Append to file as level 2 headline | 228 RET at beg-of-buf -> Append to file as level 2 headline |
204 <left>/<right> -> before/after current headline, same headings level") | 229 <left>/<right> -> before/after current headline, same headings level") |
205 | 230 |
231 (defvar org-jump-to-target-location nil) | |
206 (defvar org-remember-previous-location nil) | 232 (defvar org-remember-previous-location nil) |
207 (defvar org-force-remember-template-char) ;; dynamically scoped | 233 (defvar org-force-remember-template-char) ;; dynamically scoped |
208 | 234 |
209 ;; Save the major mode of the buffer we called remember from | 235 ;; Save the major mode of the buffer we called remember from |
210 (defvar org-select-template-temp-major-mode nil) | 236 (defvar org-select-template-temp-major-mode nil) |
287 "Initialize *remember* buffer with template, invoke `org-mode'. | 313 "Initialize *remember* buffer with template, invoke `org-mode'. |
288 This function should be placed into `remember-mode-hook' and in fact requires | 314 This function should be placed into `remember-mode-hook' and in fact requires |
289 to be run from that hook to function properly." | 315 to be run from that hook to function properly." |
290 (if org-remember-templates | 316 (if org-remember-templates |
291 (let* ((entry (org-select-remember-template use-char)) | 317 (let* ((entry (org-select-remember-template use-char)) |
318 (ct (or org-overriding-default-time (org-current-time))) | |
292 (tpl (car entry)) | 319 (tpl (car entry)) |
293 (plist-p (if org-store-link-plist t nil)) | 320 (plist-p (if org-store-link-plist t nil)) |
294 (file (if (and (nth 1 entry) (stringp (nth 1 entry)) | 321 (file (if (and (nth 1 entry) (stringp (nth 1 entry)) |
295 (string-match "\\S-" (nth 1 entry))) | 322 (string-match "\\S-" (nth 1 entry))) |
296 (nth 1 entry) | 323 (nth 1 entry) |
298 (headline (nth 2 entry)) | 325 (headline (nth 2 entry)) |
299 (v-c (and (> (length kill-ring) 0) (current-kill 0))) | 326 (v-c (and (> (length kill-ring) 0) (current-kill 0))) |
300 (v-x (or (org-get-x-clipboard 'PRIMARY) | 327 (v-x (or (org-get-x-clipboard 'PRIMARY) |
301 (org-get-x-clipboard 'CLIPBOARD) | 328 (org-get-x-clipboard 'CLIPBOARD) |
302 (org-get-x-clipboard 'SECONDARY))) | 329 (org-get-x-clipboard 'SECONDARY))) |
303 (v-t (format-time-string (car org-time-stamp-formats) (org-current-time))) | 330 (v-t (format-time-string (car org-time-stamp-formats) ct)) |
304 (v-T (format-time-string (cdr org-time-stamp-formats) (org-current-time))) | 331 (v-T (format-time-string (cdr org-time-stamp-formats) ct)) |
305 (v-u (concat "[" (substring v-t 1 -1) "]")) | 332 (v-u (concat "[" (substring v-t 1 -1) "]")) |
306 (v-U (concat "[" (substring v-T 1 -1) "]")) | 333 (v-U (concat "[" (substring v-T 1 -1) "]")) |
307 ;; `initial' and `annotation' are bound in `remember' | 334 ;; `initial' and `annotation' are bound in `remember' |
308 (v-i (if (boundp 'initial) initial)) | 335 (v-i (if (boundp 'initial) initial)) |
309 (v-a (if (and (boundp 'annotation) annotation) | 336 (v-a (if (and (boundp 'annotation) annotation) |
392 ;; Turn on org-mode in the remember buffer, set local variables | 419 ;; Turn on org-mode in the remember buffer, set local variables |
393 (org-mode) | 420 (org-mode) |
394 (org-set-local 'org-finish-function 'org-remember-finalize) | 421 (org-set-local 'org-finish-function 'org-remember-finalize) |
395 (if (and file (string-match "\\S-" file) (not (file-directory-p file))) | 422 (if (and file (string-match "\\S-" file) (not (file-directory-p file))) |
396 (org-set-local 'org-default-notes-file file)) | 423 (org-set-local 'org-default-notes-file file)) |
397 (if (and headline (stringp headline) (string-match "\\S-" headline)) | 424 (if headline |
398 (org-set-local 'org-remember-default-headline headline)) | 425 (org-set-local 'org-remember-default-headline headline)) |
399 ;; Interactive template entries | 426 ;; Interactive template entries |
400 (goto-char (point-min)) | 427 (goto-char (point-min)) |
401 (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGuUtTCL]\\)?" nil t) | 428 (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([gGtTuUCL]\\)?" nil t) |
402 (setq char (if (match-end 3) (match-string 3)) | 429 (setq char (if (match-end 3) (match-string 3)) |
403 prompt (if (match-end 2) (match-string 2))) | 430 prompt (if (match-end 2) (match-string 2))) |
404 (goto-char (match-beginning 0)) | 431 (goto-char (match-beginning 0)) |
405 (replace-match "") | 432 (replace-match "") |
406 (setq completions nil default nil) | 433 (setq completions nil default nil) |
442 (org-insert-link 0 (read-string "Clipboard/kill value: " | 469 (org-insert-link 0 (read-string "Clipboard/kill value: " |
443 (car clipboards) | 470 (car clipboards) |
444 '(clipboards . 1) | 471 '(clipboards . 1) |
445 (car clipboards)))))) | 472 (car clipboards)))))) |
446 (char | 473 (char |
474 ;; These are the date/time related ones | |
447 (setq org-time-was-given (equal (upcase char) char)) | 475 (setq org-time-was-given (equal (upcase char) char)) |
448 (setq time (org-read-date (equal (upcase char) "U") t nil | 476 (setq time (org-read-date (equal (upcase char) "U") t nil |
449 prompt)) | 477 prompt)) |
450 (org-insert-time-stamp time org-time-was-given | 478 (org-insert-time-stamp time org-time-was-given |
451 (member char '("u" "U")) | 479 (member char '("u" "U")) |
462 (and (re-search-forward "^[^#\n]" nil t) (backward-char 1)))) | 490 (and (re-search-forward "^[^#\n]" nil t) (backward-char 1)))) |
463 (org-mode) | 491 (org-mode) |
464 (org-set-local 'org-finish-function 'org-remember-finalize)) | 492 (org-set-local 'org-finish-function 'org-remember-finalize)) |
465 (when (save-excursion | 493 (when (save-excursion |
466 (goto-char (point-min)) | 494 (goto-char (point-min)) |
495 (re-search-forward "%&" nil t)) | |
496 (replace-match "") | |
497 (org-set-local 'org-jump-to-target-location t)) | |
498 (when (save-excursion | |
499 (goto-char (point-min)) | |
467 (re-search-forward "%!" nil t)) | 500 (re-search-forward "%!" nil t)) |
468 (replace-match "") | 501 (replace-match "") |
469 (add-hook 'post-command-hook 'org-remember-finish-immediately 'append))) | 502 (add-hook 'post-command-hook 'org-remember-finish-immediately 'append))) |
470 | 503 |
471 (defun org-remember-finish-immediately () | 504 (defun org-remember-finish-immediately () |
474 from that hook." | 507 from that hook." |
475 (remove-hook 'post-command-hook 'org-remember-finish-immediately) | 508 (remove-hook 'post-command-hook 'org-remember-finish-immediately) |
476 (when org-finish-function | 509 (when org-finish-function |
477 (funcall org-finish-function))) | 510 (funcall org-finish-function))) |
478 | 511 |
479 (defvar org-clock-marker) ; Defined below | 512 (defun org-remember-visit-immediately () |
513 "File remember note immediately. | |
514 This should be run in `post-command-hook' and will remove itself | |
515 from that hook." | |
516 (org-remember '(16)) | |
517 (goto-char (or (text-property-any | |
518 (point) (save-excursion (org-end-of-subtree t t)) | |
519 'org-position-cursor t) | |
520 (point))) | |
521 (message "%s" | |
522 (format | |
523 (substitute-command-keys | |
524 "Restore window configuration with \\[jump-to-register] %c") | |
525 remember-register))) | |
526 | |
527 (defvar org-clock-marker) ; Defined in org.el | |
480 (defun org-remember-finalize () | 528 (defun org-remember-finalize () |
481 "Finalize the remember process." | 529 "Finalize the remember process." |
482 (unless (fboundp 'remember-finalize) | 530 (unless (fboundp 'remember-finalize) |
483 (defalias 'remember-finalize 'remember-buffer)) | 531 (defalias 'remember-finalize 'remember-buffer)) |
484 (when (and org-clock-marker | 532 (when (and org-clock-marker |
485 (equal (marker-buffer org-clock-marker) (current-buffer))) | 533 (equal (marker-buffer org-clock-marker) (current-buffer))) |
486 ;; FIXME: test this, this is w/o notetaking! | 534 ;; the clock is running in this buffer. |
487 (let (org-log-note-clock-out) (org-clock-out))) | 535 (when (and (equal (marker-buffer org-clock-marker) (current-buffer)) |
536 (or (eq org-remember-clock-out-on-exit t) | |
537 (and org-remember-clock-out-on-exit | |
538 (y-or-n-p "The clock is running in this buffer. Clock out now? ")))) | |
539 (let (org-log-note-clock-out) (org-clock-out)))) | |
488 (when buffer-file-name | 540 (when buffer-file-name |
489 (save-buffer) | 541 (save-buffer) |
490 (setq buffer-file-name nil)) | 542 (setq buffer-file-name nil)) |
491 (remember-finalize)) | 543 (remember-finalize)) |
492 | 544 |
523 (message "Press C-c C-c to remember data")) | 575 (message "Press C-c C-c to remember data")) |
524 (if (org-region-active-p) | 576 (if (org-region-active-p) |
525 (org-do-remember (buffer-substring (point) (mark))) | 577 (org-do-remember (buffer-substring (point) (mark))) |
526 (org-do-remember)))))) | 578 (org-do-remember)))))) |
527 | 579 |
580 (defvar org-remember-last-stored-marker (make-marker) | |
581 "Marker pointing to the entry most recently stored with `org-remember'.") | |
582 | |
528 (defun org-remember-goto-last-stored () | 583 (defun org-remember-goto-last-stored () |
529 "Go to the location where the last remember note was stored." | 584 "Go to the location where the last remember note was stored." |
530 (interactive) | 585 (interactive) |
531 (bookmark-jump "org-remember-last-stored") | 586 (org-goto-marker-or-bmk org-remember-last-stored-marker |
587 "org-remember-last-stored") | |
532 (message "This is the last note stored by remember")) | 588 (message "This is the last note stored by remember")) |
533 | 589 |
534 (defun org-go-to-remember-target (&optional template-key) | 590 (defun org-go-to-remember-target (&optional template-key) |
535 "Go to the target location of a remember template. | 591 "Go to the target location of a remember template. |
536 The user is queried for the template." | 592 The user is queried for the template." |
592 If the variable `org-adapt-indentation' is non-nil, the entire text is | 648 If the variable `org-adapt-indentation' is non-nil, the entire text is |
593 also indented so that it starts in the same column as the headline | 649 also indented so that it starts in the same column as the headline |
594 \(i.e. after the stars). | 650 \(i.e. after the stars). |
595 | 651 |
596 See also the variable `org-reverse-note-order'." | 652 See also the variable `org-reverse-note-order'." |
653 (when (org-bound-and-true-p org-jump-to-target-location) | |
654 (let* ((end (min (point-max) (1+ (point)))) | |
655 (beg (point))) | |
656 (if (= end beg) (setq beg (1- beg))) | |
657 (put-text-property beg end 'org-position-cursor t))) | |
597 (goto-char (point-min)) | 658 (goto-char (point-min)) |
598 (while (looking-at "^[ \t]*\n\\|^##.*\n") | 659 (while (looking-at "^[ \t]*\n\\|^##.*\n") |
599 (replace-match "")) | 660 (replace-match "")) |
600 (goto-char (point-max)) | 661 (goto-char (point-max)) |
601 (beginning-of-line 1) | 662 (beginning-of-line 1) |
602 (while (looking-at "[ \t]*$\\|##.*") | 663 (while (looking-at "[ \t]*$\\|##.*") |
603 (delete-region (1- (point)) (point-max)) | 664 (delete-region (1- (point)) (point-max)) |
604 (beginning-of-line 1)) | 665 (beginning-of-line 1)) |
605 (catch 'quit | 666 (catch 'quit |
606 (if org-note-abort (throw 'quit nil)) | 667 (if org-note-abort (throw 'quit nil)) |
607 (let* ((txt (buffer-substring (point-min) (point-max))) | 668 (let* ((visitp (org-bound-and-true-p org-jump-to-target-location)) |
608 (fastp (org-xor (equal current-prefix-arg '(4)) | 669 (fastp (org-xor (equal current-prefix-arg '(4)) |
609 org-remember-store-without-prompt)) | 670 org-remember-store-without-prompt)) |
610 (file (cond | 671 (file (cond |
611 (fastp org-default-notes-file) | 672 (fastp org-default-notes-file) |
612 ((and (eq org-remember-interactive-interface 'refile) | 673 ((and (eq org-remember-interactive-interface 'refile) |
618 (heading org-remember-default-headline) | 679 (heading org-remember-default-headline) |
619 (visiting (and file (org-find-base-buffer-visiting file))) | 680 (visiting (and file (org-find-base-buffer-visiting file))) |
620 (org-startup-folded nil) | 681 (org-startup-folded nil) |
621 (org-startup-align-all-tables nil) | 682 (org-startup-align-all-tables nil) |
622 (org-goto-start-pos 1) | 683 (org-goto-start-pos 1) |
623 spos exitcmd level indent reversed) | 684 spos exitcmd level reversed txt) |
624 (if (and (equal current-prefix-arg '(16)) org-remember-previous-location) | 685 (if (and (equal current-prefix-arg '(16)) org-remember-previous-location) |
625 (setq file (car org-remember-previous-location) | 686 (setq file (car org-remember-previous-location) |
626 heading (cdr org-remember-previous-location) | 687 heading (cdr org-remember-previous-location) |
627 fastp t)) | 688 fastp t)) |
628 (setq current-prefix-arg nil) | 689 (setq current-prefix-arg nil) |
629 (if (string-match "[ \t\n]+\\'" txt) | |
630 (setq txt (replace-match "" t t txt))) | |
631 ;; Modify text so that it becomes a nice subtree which can be inserted | 690 ;; Modify text so that it becomes a nice subtree which can be inserted |
632 ;; into an org tree. | 691 ;; into an org tree. |
633 (let* ((lines (split-string txt "\n")) | |
634 first) | |
635 (setq first (car lines) lines (cdr lines)) | |
636 (if (string-match "^\\*+ " first) | |
637 ;; Is already a headline | |
638 (setq indent nil) | |
639 ;; We need to add a headline: Use time and first buffer line | |
640 (setq lines (cons first lines) | |
641 first (concat "* " (current-time-string) | |
642 " (" (remember-buffer-desc) ")") | |
643 indent " ")) | |
644 (if (and org-adapt-indentation indent) | |
645 (setq lines (mapcar | |
646 (lambda (x) | |
647 (if (string-match "\\S-" x) | |
648 (concat indent x) x)) | |
649 lines))) | |
650 (setq txt (concat first "\n" | |
651 (mapconcat 'identity lines "\n")))) | |
652 (if (string-match "\n[ \t]*\n[ \t\n]*\\'" txt) | |
653 (setq txt (replace-match "\n\n" t t txt)) | |
654 (if (string-match "[ \t\n]*\\'" txt) | |
655 (setq txt (replace-match "\n" t t txt)))) | |
656 ;; Put the modified text back into the remember buffer, for refile. | |
657 (erase-buffer) | |
658 (insert txt) | |
659 (goto-char (point-min)) | 692 (goto-char (point-min)) |
693 (if (re-search-forward "[ \t\n]+\\'" nil t) | |
694 ;; remove empty lines at end | |
695 (replace-match "")) | |
696 (goto-char (point-min)) | |
697 (unless (looking-at org-outline-regexp) | |
698 ;; add a headline | |
699 (insert (concat "* " (current-time-string) | |
700 " (" (remember-buffer-desc) ")\n")) | |
701 (backward-char 1) | |
702 (when org-adapt-indentation | |
703 (while (re-search-forward "^" nil t) | |
704 (insert " ")))) | |
705 (goto-char (point-min)) | |
706 (if (re-search-forward "\n[ \t]*\n[ \t\n]*\\'" nil t) | |
707 (replace-match "\n\n") | |
708 (if (re-search-forward "[ \t\n]*\\'") | |
709 (replace-match "\n"))) | |
710 (goto-char (point-min)) | |
711 (setq txt (buffer-string)) | |
712 (org-save-markers-in-region (point-min) (point-max)) | |
660 (when (and (eq org-remember-interactive-interface 'refile) | 713 (when (and (eq org-remember-interactive-interface 'refile) |
661 (not fastp)) | 714 (not fastp)) |
662 (org-refile nil (or visiting (find-file-noselect file))) | 715 (org-refile nil (or visiting (find-file-noselect file))) |
716 (and visitp (run-with-idle-timer 0.01 nil 'org-remember-visit-immediately)) | |
663 (throw 'quit t)) | 717 (throw 'quit t)) |
664 ;; Find the file | 718 ;; Find the file |
665 (if (not visiting) (find-file-noselect file)) | 719 (if (not visiting) (find-file-noselect file)) |
666 (with-current-buffer (or visiting (get-file-buffer file)) | 720 (with-current-buffer (or visiting (get-file-buffer file)) |
667 (unless (org-mode-p) | 721 (unless (org-mode-p) |
669 (save-excursion | 723 (save-excursion |
670 (save-restriction | 724 (save-restriction |
671 (widen) | 725 (widen) |
672 (and (goto-char (point-min)) | 726 (and (goto-char (point-min)) |
673 (not (re-search-forward "^\\* " nil t)) | 727 (not (re-search-forward "^\\* " nil t)) |
674 (insert "\n* " (or heading "Notes") "\n")) | 728 (insert "\n* " (or (and (stringp heading) heading) |
729 "Notes") "\n")) | |
675 (setq reversed (org-notes-order-reversed-p)) | 730 (setq reversed (org-notes-order-reversed-p)) |
676 | 731 |
677 ;; Find the default location | 732 ;; Find the default location |
678 (when (and heading (stringp heading) (string-match "\\S-" heading)) | 733 (when heading |
679 (goto-char (point-min)) | 734 (cond |
680 (if (re-search-forward | 735 ((eq heading 'top) |
681 (concat "^\\*+[ \t]+" (regexp-quote heading) | 736 (goto-char (point-min)) |
682 (org-re "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$")) | 737 (or (looking-at org-outline-regexp) |
683 nil t) | 738 (re-search-forward org-outline-regexp nil t)) |
684 (setq org-goto-start-pos (match-beginning 0)) | 739 (setq org-goto-start-pos (or (match-beginning 0) (point-min)))) |
685 (when fastp | 740 ((eq heading 'bottom) |
686 (goto-char (point-max)) | 741 (goto-char (point-max)) |
687 (unless (bolp) (newline)) | 742 (re-search-backward "^\\* " nil t) |
688 (insert "* " heading "\n") | 743 (or (bolp) (newline)) |
689 (setq org-goto-start-pos (point-at-bol 0))))) | 744 (setq org-goto-start-pos (point))) |
745 ((and (stringp heading) (string-match "\\S-" heading)) | |
746 (goto-char (point-min)) | |
747 (if (re-search-forward | |
748 (concat "^\\*+[ \t]+" (regexp-quote heading) | |
749 (org-re "\\([ \t]+:[[:alnum:]@_:]*\\)?[ \t]*$")) | |
750 nil t) | |
751 (setq org-goto-start-pos (match-beginning 0)) | |
752 (when fastp | |
753 (goto-char (point-max)) | |
754 (unless (bolp) (newline)) | |
755 (insert "* " heading "\n") | |
756 (setq org-goto-start-pos (point-at-bol 0))))) | |
757 (t (goto-char (point-min)) (setq org-goto-start-pos (point) | |
758 heading 'top)))) | |
690 | 759 |
691 ;; Ask the User for a location, using the appropriate interface | 760 ;; Ask the User for a location, using the appropriate interface |
692 (cond | 761 (cond |
762 ((and fastp (memq heading '(top bottom))) | |
763 (setq spos org-goto-start-pos | |
764 exitcmd (if (eq heading 'top) 'left 'right))) | |
693 (fastp (setq spos org-goto-start-pos | 765 (fastp (setq spos org-goto-start-pos |
694 exitcmd 'return)) | 766 exitcmd 'return)) |
695 ((eq org-remember-interactive-interface 'outline) | 767 ((eq org-remember-interactive-interface 'outline) |
696 (setq spos (org-get-location (current-buffer) | 768 (setq spos (org-get-location (current-buffer) |
697 org-remember-help) | 769 org-remember-help) |
704 exitcmd 'return | 776 exitcmd 'return |
705 spos (nth 3 spos)))) | 777 spos (nth 3 spos)))) |
706 (t (error "This should not happen"))) | 778 (t (error "This should not happen"))) |
707 (if (not spos) (throw 'quit nil)) ; return nil to show we did | 779 (if (not spos) (throw 'quit nil)) ; return nil to show we did |
708 ; not handle this note | 780 ; not handle this note |
781 (and visitp (run-with-idle-timer 0.01 nil 'org-remember-visit-immediately)) | |
709 (goto-char spos) | 782 (goto-char spos) |
710 (cond ((org-on-heading-p t) | 783 (cond ((org-on-heading-p t) |
711 (org-back-to-heading t) | 784 (org-back-to-heading t) |
712 (setq level (funcall outline-level)) | 785 (setq level (funcall outline-level)) |
713 (cond | 786 (cond |
722 (if (not (bolp)) | 795 (if (not (bolp)) |
723 (if (looking-at "[ \t]*\n") | 796 (if (looking-at "[ \t]*\n") |
724 (beginning-of-line 2) | 797 (beginning-of-line 2) |
725 (end-of-line 1) | 798 (end-of-line 1) |
726 (insert "\n")))) | 799 (insert "\n")))) |
800 (org-paste-subtree (org-get-valid-level level 1) txt) | |
801 (and org-auto-align-tags (org-set-tags nil t)) | |
727 (bookmark-set "org-remember-last-stored") | 802 (bookmark-set "org-remember-last-stored") |
728 (org-paste-subtree (org-get-valid-level level 1) txt)) | 803 (move-marker org-remember-last-stored-marker (point))) |
729 ((eq exitcmd 'left) | 804 ((eq exitcmd 'left) |
730 ;; before current | 805 ;; before current |
806 (org-paste-subtree level txt) | |
807 (and org-auto-align-tags (org-set-tags nil t)) | |
731 (bookmark-set "org-remember-last-stored") | 808 (bookmark-set "org-remember-last-stored") |
732 (org-paste-subtree level txt)) | 809 (move-marker org-remember-last-stored-marker (point))) |
733 ((eq exitcmd 'right) | 810 ((eq exitcmd 'right) |
734 ;; after current | 811 ;; after current |
735 (org-end-of-subtree t) | 812 (org-end-of-subtree t) |
813 (org-paste-subtree level txt) | |
814 (and org-auto-align-tags (org-set-tags nil t)) | |
736 (bookmark-set "org-remember-last-stored") | 815 (bookmark-set "org-remember-last-stored") |
737 (org-paste-subtree level txt)) | 816 (move-marker org-remember-last-stored-marker (point))) |
738 (t (error "This should not happen")))) | 817 (t (error "This should not happen")))) |
739 | 818 |
740 ((and (bobp) (not reversed)) | 819 ((and (bobp) (not reversed)) |
741 ;; Put it at the end, one level below level 1 | 820 ;; Put it at the end, one level below level 1 |
742 (save-restriction | 821 (save-restriction |
743 (widen) | 822 (widen) |
744 (goto-char (point-max)) | 823 (goto-char (point-max)) |
745 (if (not (bolp)) (newline)) | 824 (if (not (bolp)) (newline)) |
825 (org-paste-subtree (org-get-valid-level 1 1) txt) | |
826 (and org-auto-align-tags (org-set-tags nil t)) | |
746 (bookmark-set "org-remember-last-stored") | 827 (bookmark-set "org-remember-last-stored") |
747 (org-paste-subtree (org-get-valid-level 1 1) txt))) | 828 (move-marker org-remember-last-stored-marker (point)))) |
748 | 829 |
749 ((and (bobp) reversed) | 830 ((and (bobp) reversed) |
750 ;; Put it at the start, as level 1 | 831 ;; Put it at the start, as level 1 |
751 (save-restriction | 832 (save-restriction |
752 (widen) | 833 (widen) |
753 (goto-char (point-min)) | 834 (goto-char (point-min)) |
754 (re-search-forward "^\\*+ " nil t) | 835 (re-search-forward "^\\*+ " nil t) |
755 (beginning-of-line 1) | 836 (beginning-of-line 1) |
837 (org-paste-subtree 1 txt) | |
838 (and org-auto-align-tags (org-set-tags nil t)) | |
756 (bookmark-set "org-remember-last-stored") | 839 (bookmark-set "org-remember-last-stored") |
757 (org-paste-subtree 1 txt))) | 840 (move-marker org-remember-last-stored-marker (point)))) |
758 (t | 841 (t |
759 ;; Put it right there, with automatic level determined by | 842 ;; Put it right there, with automatic level determined by |
760 ;; org-paste-subtree or from prefix arg | 843 ;; org-paste-subtree or from prefix arg |
761 (bookmark-set "org-remember-last-stored") | |
762 (org-paste-subtree | 844 (org-paste-subtree |
763 (if (numberp current-prefix-arg) current-prefix-arg) | 845 (if (numberp current-prefix-arg) current-prefix-arg) |
764 txt))) | 846 txt) |
847 (and org-auto-align-tags (org-set-tags nil t)) | |
848 (bookmark-set "org-remember-last-stored") | |
849 (move-marker org-remember-last-stored-marker (point)))) | |
850 | |
765 (when remember-save-after-remembering | 851 (when remember-save-after-remembering |
766 (save-buffer) | 852 (save-buffer) |
767 (if (not visiting) (kill-buffer (current-buffer))))))))) | 853 (if (and (not visiting) |
854 (not (equal (marker-buffer org-clock-marker) | |
855 (current-buffer)))) | |
856 (kill-buffer (current-buffer))))))))) | |
768 | 857 |
769 t) ;; return t to indicate that we took care of this note. | 858 t) ;; return t to indicate that we took care of this note. |
770 | 859 |
771 | 860 |
772 (defun org-do-remember (&optional initial) | 861 (defun org-do-remember (&optional initial) |
773 "Call remember." | 862 "Call remember." |
774 (remember initial)) | 863 (remember initial)) |
775 | 864 |
776 (provide 'org-remember) | 865 (provide 'org-remember) |
777 | 866 |
867 ;; arch-tag: 497f30d0-4bc3-4097-8622-2d27ac5f2698 | |
868 | |
778 ;;; org-remember.el ends here | 869 ;;; org-remember.el ends here |
779 | |
780 ;; arch-tag: 497f30d0-4bc3-4097-8622-2d27ac5f2698 |