Commit Graph

463 Commits

Author SHA1 Message Date
Kyle Meyer 30bcff1129 org-capture: Document org-directory
* lisp/org-capture.el (org-capture-templates):
* doc/org.texi (Template elements): Document org-directory.
2016-02-07 11:56:04 -05:00
Nicolas Goaziou a971366910 org-capture: Fix interactive template placeholders
* lisp/org-capture.el (org-capture-fill-template): Allow spaces in
  interactive placeholders.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/104113>
2016-01-11 23:51:54 +01:00
Nicolas Goaziou fdbf441560 Obsolete `org-icompleting-read' and `org-completing-read-no-i'
* lisp/org.el (org-icompleting-read, org-completing-read-no-i): Obsolete
  aliases for `completing-read'
(org-iswitchb-completing-read): Remove function.
(org-sort-entries):
(org-refile-get-location):
(org-todo):
(org-deadline):
(org-occur-parameters):
(org-change-tag-in-region):
(org-fast-tag-selection):
(org-delete-property-globally):
(org-compute-property-at-point):
(org-buffer-list): Use genuine function.

* contrib/lisp/org-colview-xemacs.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* contrib/lisp/org-index.el (org-index):
* contrib/lisp/ox-bibtex.el (org-bibtex-goto-citation):
* lisp/ob-core.el (org-babel-insert-header-arg):
(org-babel-goto-named-src-block):
(org-babel-goto-named-result):
(org-babel-demarcate-block):
* lisp/org-agenda.el (org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-bulk-action):
* lisp/org-attach.el (org-attach-delete-one):
(org-attach-open):
* lisp/org-bibtex.el (org-bibtex-fleshout):
(org-bibtex-create):
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-colview.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* lisp/org-footnote.el (org-footnote-new):
* lisp/org-list.el (org-sort-list):
* lisp/ox-publish.el (org-publish):
* lisp/ox.el (org-export-dispatch): Use genuine function.
2016-01-10 21:16:29 +01:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou e0d3944985 Fix escaping in capture, part 2
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-feed.el (org-feed-format-entry): Fix wrong argument in
  `replace-regexp-in-string'.
2016-01-09 17:04:26 +01:00
Nicolas Goaziou e2fbaeedc1 Fix handling escaped placeholders in templates
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-feed.el (org-feed-format-entry): Fix handling escaped
  placeholders in templates.  In particular, do not rely on match data
  when `org-capture-escaped-%' is used.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104081>
2016-01-08 23:36:22 +01:00
Nicolas Goaziou aa52550e4b org-capture: Fix sexp handling
* lisp/org-capture.el (org-capture-expand-embedded-elisp): Do not mark
  invalid sexp.  Renamed from `org-capture--expand-embedded-elisp'.
(org-capture-fill-template): Escape " characters for placeholders
located within sexp.  Small refactoring.
(org-capture-inside-embedded-elisp-p): Rewrite function.
2016-01-07 17:30:54 +01:00
Nicolas Goaziou 8e273a3d32 org-capture: Fix code typo
* lisp/org-capture.el (org-capture-fill-template): Fix `pcase'.
2016-01-05 23:59:05 +01:00
Nicolas Goaziou b5515ace2f org-capture: Fix %^T capture place-holders with end-time
Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/103981>
2016-01-05 23:30:01 +01:00
Rüdiger Sonderfeld 3e252a4dea org-capture.el: Add support for week trees
* lisp/org-capture.el (org-capture-templates): Add
  file+weektree(+prompt) options.
  (org-capture-set-target-location): Add support for week trees.
* doc/org.texi (Template elements): Document file+weektree(+prompt)
  options.
2015-12-29 21:57:58 +01:00
Nicolas Goaziou d6a169a82c org-capture: Fix cache in capture buffers
* lisp/org-capture.el (org-capture-steal-local-variables): Remove function.
(org-capture-fill-template): Apply removal.  Use
`org-clone-local-variables' instead.  Focus on Org specific variables.

* lisp/org.el (org-get-local-variables):
(org-clone-local-variables): Ignore internal local variables, whose
value is probably tied to their respective buffer.  In particular, this
prevents cache related variables from being copied.

* lisp/org-indent.el (org-indent--initial-marker): Renamed from
  `org-indent-initial-marker'.  Marking it as internal prevents it from
  being copied by `org-clone-local-variables' and alike.
(org-indent-mode):
(org-indent-initialize-buffer): Apply renaming.
2015-12-05 11:55:02 +01:00
Nicolas Goaziou a682b20a46 org-capture: Use lexical binding
* lisp/org-capture.el (org-capture-is-refiling): New variable.
(org-capture-place-template): Silence byte-compiler.

* lisp/org.el (org-refile): Use new variable.
2015-12-05 09:30:17 +01:00
Nicolas Goaziou 9e1d625971 org-capture: Add missing %s placeholder
* lisp/org-capture.el (org-capture-fill-template): Add missing placeholder.
2015-12-05 09:25:06 +01:00
Nicolas Goaziou 5c13a6b765 org-capture: Expand interactive placeholders last
* lisp/org-capture.el (org-capture-templates): Update docstring.
(org-capture-fill-template): Expand interactive placeholders when the
template is otherwise completely filled.

This restores the previous behaviour for template's expansion.
2015-12-03 23:27:07 +01:00
Nicolas Goaziou b49f2e0b75 org-capture: Fix bd3a2cb (part 2)
* lisp/org-capture.el (org-capture-fill-template): Allow more than one
  word when filling %{prompt} place holders.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/103251>
2015-12-02 22:22:24 +01:00
Nicolas Goaziou fb32b28057 org-capture: Fix bd3a2cb
* lisp/org-capture.el (org-capture-fill-template): Fix regexp and type
  for KEY.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/103214>
2015-12-01 23:20:44 +01:00
Nicolas Goaziou 813d04f8d4 org-capture: Silence byte-compiler
* lisp/org-capture.el (org-capture-fill-template): Silence
  byte-compiler.
2015-11-29 22:01:30 +01:00
Nicolas Goaziou bd3a2cbf2f org-capture: Prevent recursive evaluation of %(...) placeholders
* lisp/org-capture.el (org-capture-templates): Improve docstring.
(org-capture-fill-template): Prevent recursive evaluation of %(...)
placeholders.  Fix escaping of % character in templates.
* testing/lisp/test-org-capture.el: New file.

Reported-by: Thomas Preindl <thomas.preindl@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103018>
2015-11-29 16:58:14 +01:00
Nicolas Goaziou e1cb24288e org-capture: Silence byte-compiler
* lisp/org-capture.el (org-capture-place-template): Remove unused
  `org-capture-target-marker'.
2015-11-07 23:09:47 +01:00
Aaron Ecay 07e16c2fc5 Use setq-local and defvar-local.
* lisp/org-macs.el (org-set-local): Remove.  All callers changed.
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-macro.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/org.el: Use defvar-local.
* lisp/org-agenda.el:
* lisp/org-capture.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-plot.el:
* lisp/org.el:
* lisp/ox-odt.el:
* lisp/ox.el: Use setq-local instead of set + make-local-variable.

Changes in contrib:

* contrib/lisp/org-colview-xemacs.el (org-colview-xemacs-set-local): New
macro. Adjust old callers of `org-set-local'.
2015-11-05 16:47:38 +00:00
Jan Seeger d183c59e46 org-capture: Reverse capture finalize and refile, hack buffer killing
* org-capture.el (org-capture-refile): Call finalize first, then
  refile. If the capture buffer needs to be killed afterwards, kill
  after refiling.

Refiling before finalizing led to an incorrect cursor position during
refile.  Since adjusting the buffer position and bounds for the refiled
entry is difficult, I reverted the `org-capture-refile' function to its
original order of finalizing and then refiling.  However, this leads to
a bug with killing the buffer on capture, described in
<http://permalink.gmane.org/gmane.emacs.orgmode/78027/>.  To work around
this, now the :kill-buffer flag is cleared before calling finalize, and
the capture buffer is killed after `org-refile' is called.

TINYCHANGE
2015-10-13 21:42:47 +02:00
Kyle Meyer ef3ea9d02d Use prefix for outline functions
* lisp/ob-lilypond.el (org-babel-lilypond-mark-error-line):
* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-show-and-scroll-up):
(org-agenda-show-1):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-to-archive-sibling):
(org-toggle-archive-tag):
* lisp/org-capture.el:
(org-capture-place-template):
* lisp/org-colview.el:
(org-columns-eval):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org-feed.el (org-feed-update):
* lisp/org-mouse.el (org-mouse-popup-global-menu):
* lisp/org.el (org-cycle):
(org-cycle-internal-global):
(org-cycle-internal-local):
(org-global-cycle):
(org-set-startup-visibility):
(org-set-visibility-according-to-property):
(org-overview):
(org-content):
(org-clean-visibility-after-subtree-move):
(org-set-outline-overlay-data):
(org-tree-to-indirect-buffer):
(org-move-subtree-down):
(org-paste-subtree):
(org-sort-entries):
(orgstruct-setup):
(org-show-set-visibility):
(org-mode-map):
(org-check-before-invisible-edit):
(org-kill-note-or-show-branches):
(org-org-menu):
(org-yank-generic):
* lisp/ox-org.el (org-org-publish-to-org): Use prefix for outline
  functions.
* lisp/org-compat.el: Add compatibility functions for outline functions
  that are under the "outline-" prefix as of Emacs 25.
2015-10-04 02:31:16 -04:00
Kyle Meyer 077810e521 Modify quote-related backport
These changes are in line with the changes proposed on the mailing list,
but many of those changes weren't necessary because they had already
been reverted in the Emacs repo.

<http://permalink.gmane.org/gmane.emacs.orgmode/100896/>
2015-09-21 18:38:39 -04:00
Kyle Meyer d77a52a502 Backport quote-related commits from Emacs
These changes are the combination of the commits below (in order
applied).  Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits.  Changes to message and help quote
display for Emacs 25 seem to be here to stay.  The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.

  Quoting fixes in lisp/org
  6cd2629bd1b3ce77d29ac28e29237c94a4197116
  Paul Eggert
  Mon Aug 31 00:29:40 2015 -0700

  More-conservative ‘format’ quote restyling
  fbb5531fa11d13854b274d28ccd329c9b6652cfc
  Paul Eggert
  Sun Aug 23 22:39:06 2015 -0700

  Prefer directed to neutral quotes
  875a5d0ead827d3da32ecbd30e739a29f07bbc87
  Paul Eggert
  Mon Aug 24 23:57:25 2015 -0700

  Escape ` and ' in doc
  19532d147b431a4fe34f088d6de07891c48e2c5c
  Paul Eggert
  Tue Sep 1 18:23:21 2015 -0700

  Fix some more docstring etc. quoting problems
  26bd978d87dfbf9baa115cd961a67d42b416c4bf
  Paul Eggert
  Thu Sep 3 15:32:54 2015 -0700

  Go back to grave quoting in source-code docstrings etc.
  6afef3f6ca2f3009c722b84e249903b7f807b044
  Paul Eggert
  Mon Sep 7 16:09:27 2015 -0700
2015-09-21 18:38:18 -04:00
Nicolas Goaziou 3a6c9f5f06 org-capture: Fix bindings in header line
* lisp/org-capture.el (org-capture-mode): Display currently used
  bindings in header line.
2015-08-22 00:54:14 +02:00
Nicolas Goaziou 2316925ecb Revert "org-capture: Fix datetree capture"
This reverts commit a834a5939f.
2015-08-21 23:48:36 +02:00
Nicolas Goaziou a834a5939f org-capture: Fix datetree capture
* lisp/org-capture.el (org-capture-set-target-location): Fix
  file+datetree capture with non-nil `org-datetree-add-timestamp.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/100300>
2015-08-21 23:31:23 +02:00
Bastien 0d0d0ad56e Merge branch 'backport-master'
Conflicts:
	lisp/org-table.el
2015-08-05 01:01:46 +02:00
Nicolas Goaziou 14d07c0e7d org-table: Improve tables' speed in large buffers
* lisp/org-table.el (org-table-auto-recalculate-regexp):
(org-table-recalculate-regexp):
(org-table-calculate-mark-regexp):
(org-table-column-names):
(org-table-column-name-regexp):
(org-table-local-parameters):
(org-table-named-field-locations):
(org-table-current-line-types):
(org-table-current-begin-pos):
(org-table-current-ncol):
(org-table-dlines):
(org-table-hlines): Improve docstrings.

(org-table-current-begin-line): Remove variable.

(org-table-save-field): New macro.

(org-table-get-specials): Remove function.
(org-table-analyze): New function, renamed from
`org-table-get-specials'.

(org-table-find-row-type): Remove function.
(org-table--row-type): New function, renamed from
`org-table-find-row-type'.

(org-table-align): Use new macro.

(org-table-field-info):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-sort-lines):
(org-table-paste-rectangle):
(org-table-wrap-region):
(org-table-current-field-formula):
(org-table-get-formula):
(org-table-maybe-recalculate-line):
(org-table-eval-formula):
(org-table-get-range):
(org-table--descriptor-line):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-edit-formulas):
(org-table-show-reference):
(org-table-get-remote-range): Apply changes above.  Refactor code.

(org-table-check-inside-data-field):
(org-table-current-column):
(org-table-current-dline):
(org-table-line-to-dline):
(org-table-copy-region):
(org-table-rotate-recalc-marks):
(org-table-fedit-post-command):
(org-table-fedit-convert-buffer):
(org-table-highlight-rectangle): Refactor code.

(org-table-goto-field): New function.

* lisp/org-capture.el (org-capture-place-table-line): Apply change made
  to table internals.

The point of this commit is to remove dependency on `org-current-line'
and `org-goto-line', which are both expensive in large buffers.  Now,
lines are relative to the beginning of the current table instead of
global (i.e., relative to the beginning of the buffer).
2015-08-02 18:01:12 +02:00
Kyle Meyer 6f9184a294 Merge branch 'maint' into backport-master 2015-07-26 23:56:50 -04:00
Paul Eggert 6b04312e85 Backport commit 96794d2 from Emacs master branch
Don't quote nil and t in doc strings
96794d2f97cd064e4c2bf4f71459b42558cc8c79
Paul Eggert
Thu May 21 10:06:44 2015 -0700
2015-07-26 23:29:31 -04:00
Eric S Fraga 0b0bbf6194 org-capture: Place capture buffer in other window
* org-capture.el (org-capture-fill-template): The capture template
  buffer will be displayed in another window, keeping original window
  visible if appropriate.
2015-06-25 14:21:56 +02:00
Nicolas Goaziou b27e630bab org-capture: Fix "org-find-olp: Wrong type argument: stringp, nil"
* lisp/org-capture.el (org-capture-expand-file): Empyt string defaults
  to `org-default-notes-file'.
* lisp/org.el (org-default-notes-file): Do not fallback on
`remember-data-file' since "org-capture.el" is not based off
"remember.el" anymore.

Reported-by: Florian Lindner <mailinglists@xgm.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/97448>
2015-05-08 11:32:35 +02:00
Nicolas Goaziou 98a1bc868a Replace `org-end-of-meta-data-and-drawers'
* lisp/org.el (org-end-of-meta-data): New function.
(org-end-of-meta-data-and-drawers): Remove function.

* lisp/org-capture.el (org-capture-place-plain-text): Use new
  function.

* testing/lisp/test-org.el (test-org/end-of-meta-data): New test.

* etc/ORG-NEWS: Document removal.
2015-01-30 19:31:27 +01:00
Nicolas Goaziou fbcdc5d6d5 Merge branch 'maint' 2014-11-02 10:42:09 +01:00
Roberto Huelga Díaz cdb0a962bc org-capture.el: Fix expand template order
* lisp/org-capture.el (org-capture-fill-template): Expand %(sexp) after
  %:keywords, per documentation about capture templates expansion.

When a template is expanded first the simple %-escapes, %:keywords and
after that the %(sexp).

TINYCHANGE
2014-11-02 10:40:31 +01:00
Andrew Burgess 587280ea68 org-capture: Better indentation when creating a new list
lisp/org-capture.el (org-capture-place-item): When starting a new list
use org-indent-line to establish the correct indentation rather than
just using 0.

Creating an entry in org-capture-templates of type item adds entries
into a list, however, currently, if the list is empty then the first
list item will always be indented to depth 0 (so hard on the left),
which looks like this:

  * Top Level
  ** Second Level
  - item #1
  - item #2
  - item #3

This is fine if org-adapt-indentation is nil, however, with the
default value of t lists should be indented more like this:

  * Top Level
  ** Second Level
     - item #1
     - item #2
     - item #3

The patch below changes org-capture-place-item so that, when starting
a new list, the items are indented as above.

Care is taken to preserve two features of the existing behaviour,
first, when adding to an existing list, new items are indented to
match the items already in the list.  And secondly, when there is some
introductory text before the list new items are inserted after the
text, like this:

  * Top Level
  ** Second Level
     This is some introductory text:
     - item #1
     - item #2
     - item #3

TINYCHANGE
2014-10-14 22:24:30 +02:00
Bastien Guerry 7f21cfc658 Merge branch 'maint' 2014-07-28 18:08:44 +02:00
Bastien Guerry 1387694888 org-capture.el (org-capture-fill-template): Small fix
* org-capture.el (org-capture-fill-template): Take
`org-extend-today-until' into account when setting the format
time string.
2014-07-28 18:08:34 +02:00
Bastien Guerry 99580828e6 Merge branch 'maint' 2014-05-23 21:51:23 +02:00
Alex Kosorukoff 942a95cd59 org-capture.el (org-capture-fill-template): Set `mark-active' to nil
* org-capture.el (org-capture-fill-template): Set
`mark-active' to nil.

TINYCHANGE
2014-05-23 21:50:24 +02:00
Bastien Guerry 567241e986 Revert "org-capture.el (org-capture-steal-local-variables): Don't steal `mark-active'"
This reverts commit ee5a88cd01.
2014-05-23 21:49:19 +02:00
Bastien Guerry d6775b8751 Merge branch 'maint' 2014-05-23 14:01:45 +02:00
Bastien Guerry ee5a88cd01 org-capture.el (org-capture-steal-local-variables): Don't steal `mark-active'
* org-capture.el (org-capture-steal-local-variables): Don't
steal `mark-active', which should be nil in the target buffer.

Thanks to Alex Kosorukoff for raising this issue.
2014-05-23 14:01:39 +02:00
Bastien Guerry 20b70a1716 Merge branch 'maint' 2014-04-29 13:08:23 +02:00
Bastien Guerry 3104f7de7b org-capture.el (org-capture-fill-template): Fix bug
* org-capture.el (org-capture-fill-template): Deactivate
region while trying to align tags on the current headline.

Thanks to Alex Kosorukoff for reporting this.
2014-04-29 13:05:04 +02:00
Thomas Holst 176125c32f org-capture.el: Allow `:table-line-pos' to be a function name, a string or a variable
* lisp/org-capture.el (org-capture-place-table-line): If the value of
`:table-line-pos' is a function name, used its return value to set the
position inside the table.  The return value must be a string like
"II-3".  Else `:table-line-pos' is 'eval'ed.

TINYCHANGE
2014-03-19 09:34:58 +01:00
Bastien Guerry 423133efe9 org-capture.el: Use `org-buffer-narrowed-p'
* org-capture.el (org-capture-put-target-region-and-position):
Use `org-buffer-narrowed-p'.
2014-03-13 10:49:48 +01:00
Bastien Guerry 94f104ad5c org-capture.el: Fix wrong narrowing with :prepend set to `t'
* org-capture.el (org-capture-finalize): Ensure to widen the
buffer when the target buffer is not initially narrowed.

Thanks to Adam Spiers and Thomas Proschinger for reporting this bug.
2014-03-13 10:45:08 +01:00
Bastien Guerry a6bac51c5b org-capture.el: Fix wrong narrowing with :prepend set to `t'
* org-capture.el (org-capture-finalize): Ensure to widen the
buffer when the target buffer is not initially narrowed.

Thanks to Adam Spiers and Thomas Proschinger for reporting this bug.
2014-03-13 10:44:41 +01:00
Oleh Krehel 367780d133 Enforce `org-bookmark-names-plist'
* lisp/org-capture.el (org-capture-goto-last-stored): Use
  `org-bookmark-names-plist'.
* lisp/org.el (org-refile-goto-last-stored): Use
  `org-bookmark-names-plist'.
2014-03-07 14:09:16 +01:00
Bastien Guerry f8e1745440 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-07 14:19:03 +01:00
Bastien Guerry 7d9a883b50 Update copyright years again.
Hint: copyright years are all updated in Emacs.
2014-01-07 14:18:17 +01:00
Bastien Guerry c41f5075ac Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-05 06:36:11 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
York Zhao f1583aab46 Fix problem with :exact-positions in capture
* lisp/org-capture.el (org-capture-place-entry): Set :exact-position
before doing other stuff, to allow function with other target settings

TINYCHANGE

Assuming file "test.org" has a single headline "* Level 1" (ended with
newline character), when trying to use function type capture target in
an org-capture template, as shown in the example:

(setq org-capture-templates
      `(("t"
         "Test function type target"
         entry
         (function
          (lambda ()
            (set-buffer (org-capture-target-buffer "test.org"))
            (goto-char (point-max))))
         "* Level 2")))

When this template gets filled, file "test.org" becomes:

* Level 1
* Level 2

Instead of:

* Level 1
** Level 2

This is because when using function type target, `:exact-position' is
used to store buffer position returned by user's function (the lambda
function here), and function `org-capture-place-entry' will never
insert template as a child of current entry when `:exact-position' is
used.

The problem is addressed by not special casing for `:exact-position'
in function `org-capture-place-entry'.

York
2013-11-26 06:28:07 +01:00
Bastien Guerry 47b0eec8dc org-capture.el (org-capture-refile): Don't finalize prematurely
* org-capture.el (org-capture-refile): Don't finalize
prematurely.

Thanks to Rodrigo Amestica for reporting this.
2013-11-06 16:26:38 +01:00
Bastien Guerry 747f46aa1f org-capture: Fix bug when capturing with templates using `function'
* org-capture.el (org-capture): Store :return-to-wconf
earlier.
(org-capture-place-template): Don't store :return-to-wconf
when called from a capture template using `function', rely on
the early :return-to-wconf value store from `org-capture'.

Thanks to Brett Viren for raising this issue.
2013-11-06 15:51:57 +01:00
Bastien Guerry 6c48056b2b Some clean-up related to org-remember being removed
* org.el (org-directory, org-default-notes-file)
(org-reverse-note-order): Don't use the `org-remember'
customization group.
(org-require-autoloaded-modules): Don't require
`org-remember'.

* org-capture.el: Update commentary section to reflect the
fact that org-remember.el is not used anymore.
2013-11-05 12:13:46 +01:00
oleh 1871bf6933 Allow nil as return of sexp in capture templates
* lisp/org-capture.el (org-capture-expand-embedded-elisp): Throw error if
result is not a string and not nil.  If the result is nil, treat it as
if it was the empty string.
2013-09-01 19:47:37 +02:00
Carsten Dominik 131e7a679e Allow to specify the names of automatic bookmarks
* lisp/org.el (org-bookmark-names-plist): New user option.
(org-set-regexps-and-options-for-tags): Use `org-bookmark-names-plist'.
(org-refile): Use `org-bookmark-names-plist'.
* lisp/org-capture.el (org-capture-bookmark-last-stored-position): Use
`org-bookmark-names-plist'.

Patch modified from a proposal by Oleh.
2013-08-08 12:43:03 +02:00
Bastien Guerry eff77aa85e org-capture.el (org-capture-set-target-location): Don't throw an error when `org-time-was-given' is not bound
* org-capture.el (org-capture-set-target-location): Don't
throw an error when `org-time-was-given' is not bound.

Thanks to Eric S Fraga for reporting this.
2013-06-27 15:35:22 +02:00
Bastien Guerry df4ed8e794 org-capture.el (org-capture-use-agenda-date): Fix docstring
* org-capture.el (org-capture-use-agenda-date): Fix docstring.
2013-04-17 07:00:59 +02:00
Bastien Guerry 35b9983107 org-capture.el (org-mks): Fix bug.
* org-capture.el (org-mks): Fix bug: let-bind
`case-fold-search' to nil while matching the first letter of a
multi-letters template.

Thanks to Robert Goldman for reporting this bug and providing the fix.
2013-04-16 18:27:11 +02:00
Bastien Guerry 8546254ce5 org-capture.el (org-mks): Make cursor invisible
* org-capture.el (org-mks): Make cursor invisible.
2013-04-16 09:23:45 +02:00
Bastien Guerry 2c41456b1d org-capture.el (org-capture-import-remember-templates): Take care of adding :jump-to-captured option if needed
* org-capture.el (org-capture-import-remember-templates): Take
care of adding :jump-to-captured option if needed.
2013-03-30 19:03:09 +01:00
Bastien Guerry 15c3792f2b org-capture.el: New capture template option :jump-to-captured
* org-capture.el (org-capture-templates): Document new option
:jump-to-captured in the docstring.  Offer the complete list
of options when customizing.
(org-capture-finalize): Handle :jump-to-captured.

This emulates the behavior triggered by %& in remember templates.

Thanks to Adam Spiers for reporting this.
2013-03-30 15:43:30 +01:00
Bastien Guerry 4184699910 Revert "org-capture.el (org-capture): Don't store multiple links over lines in the active region"
This reverts commit 2c994218ea.
2013-03-26 14:16:56 +01:00
Bastien Guerry 2c994218ea org-capture.el (org-capture): Don't store multiple links over lines in the active region
* org-capture.el (org-capture): Don't store multiple links
over lines in the active region.

Thanks to Matt Lundin for reporting this.
2013-03-25 23:49:39 +01:00
Bastien Guerry 7e6c632f80 org-capture.el: Fix or add docstrings
* org-capture.el (org-capture-templates, org-capture-string)
(org-capture-steal-local-variables)
(org-capture-empty-lines-before)
(org-capture-empty-lines-after)
(org-capture-insert-template-here)
(org-capture-import-remember-templates): Fix or add docstring.
2013-03-05 16:38:33 +01:00
Bastien Guerry b653e12ec2 Move `org-mks' to org-capture.el and delete org-mks.el.
* org-capture.el (org-mks): Move from org-mks.el.
* org-mks.el: Delete.
2013-03-04 18:21:47 +01:00
Bastien Guerry ffefa9ed86 org-capture.el (org-capture): Cosmetic fix
* org-capture.el (org-capture): Cosmetic fix.
2013-02-28 00:29:24 +01:00
Nicolas Goaziou 73ddb3c49c Remove references to `org-protected' `org-example' and `original-indentation'
* lisp/org-macs.el (org-if-unprotected, org-if-unprotected-1,
  org-if-unprotected-at): Removed macros.
(org-re-search-forward-unprotected): Removed function.
* lisp/org.el (org-format-latex): Remove reference to `org-protected'.
* lisp/org-list.el (org-list-struct): Remove reference to
  `org-example' and `org-protected'.
* lisp/org-footnote.el (org-footnote-at-reference-p): Remove reference
  to `org-protected'.
* lisp/org-capture.el (org-capture-fill-template): Remove reference to
  `org-protected'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
  Remove reference to `org-protected' value.

These text properties were used by the old export framework. They are
not needed anymore.
2013-02-06 23:06:31 +01:00
Bastien Guerry bbea8d348b Allow to contextualize capture and agenda commands by checking the name of the buffer
* org.el (org-contextualize-validate-key): Check against two
new context predicates [not-]in-buffer.

* org-capture.el (org-capture-templates-contexts):
* org-agenda.el (org-agenda-custom-commands-contexts):
Document the new [not-]in-buffer context predicates.

Thanks to Paul Sexton for triggering this and for proposing a patch.
2013-01-31 11:06:04 +01:00
Bastien Guerry 09f108ec57 Merge branch 'maint' 2013-01-12 09:20:22 +01:00
Bastien Guerry a0ad34b8d4 Docstring fixes.
* org-capture.el (org-capture-templates-contexts):
* org-agenda.el (org-agenda-custom-commands-contexts):
Docstring fix.
2013-01-12 09:20:17 +01:00
Bastien Guerry 5fc740a230 Merge branch 'maint' 2013-01-08 15:04:40 +01:00
Bastien Guerry 72bc144c15 Update Copyright lines to match Emacs format. 2013-01-08 15:04:32 +01:00
Bastien Guerry 60b23bdeac Merge branch 'maint'
Conflicts:
	contrib/lisp/htmlize.el
	etc/schema/od-manifest-schema-v1.2-os.rnc
	etc/schema/od-schema-v1.2-os.rnc
	lisp/org-exp-blocks.el
2013-01-01 16:06:17 +01:00
Bastien Guerry 98cd4687a2 Update copyright years.
Happy new year!
2013-01-01 16:04:24 +01:00
Bastien Guerry 5de94e46e4 Merge branch 'maint' 2012-12-20 13:16:47 +01:00
Dmitry Antipov bfb9f9d10f Use (point-marker) instead of (move-marker (make-marker) (point))
* org-agenda.el (org-agenda-get-restriction-and-command): Use `point-marker'.
* org-capture.el (org-capture-place-template): Likewise.
* org-colview-xemacs.el (org-dblock-write:columnview): Likewise.
* org-colview.el (org-dblock-write:columnview): Likewise.
* org-mobile.el (org-mobile-locate-entry): Likewise.
* org-table.el (org-table-convert-region): Likewise.
* org.el (org-update-statistics-cookies): Likewise.
* contrib/lisp/org-invoice.el (org-dblock-write:invoice): Likewise.
2012-12-20 13:16:41 +01:00
Bastien Guerry 1bfea39fd4 Support `C-1' prefix for `org-agenda-capture' and `org-capture'.
* org.el (org-get-cursor-date): New optional argument
WITH-TIME to add the time of the day.

* org-capture.el (org-capture): When capturing from the agenda
and with a non-nil value for `org-capture-use-agenda-date', a
`C-1' prefix will set the capture time to the HH:MM of the
current line or the current HH:MM.

* org-agenda.el (org-agenda-capture): New optional argument
WITH-TIME: when set to 1, the capture time will be set to the
HH:MM time of the current line, or the current HH:MM time.

From an agenda buffer, C-1 k (i.e. org-agenda-capture) and
C-1 M-x org-capture RET will use the time of the day of the
current line, or the current time of the day.  The date is
not changed by using this prefix.

Thanks to Rene for triggering this change.
2012-12-12 15:21:10 +01:00
Nicolas Goaziou d94a0bcd61 org-capture: Fix docstring
* lisp/org-capture.el (org-capture--expand-keyword-in-embedded-elisp):
  Fix docstring.
2012-11-05 13:38:18 +01:00
Ryo TAKAISHI fb143b6787 org-capture: Expand keywords within %(sexp) placeholder in template
* lisp/org-capture.el: (org-capture--expand-keyword-in-embedded-elisp): New function.
(org-capture-expand-embedded-elisp): Use new function.
2012-11-05 01:29:25 +01:00
Bastien Guerry 116c09053f Run `bookmark-set' within `with-demoted-errors'.
* org.el (org-refile): Run within `with-demoted-errors' so
that a corrupted bookmark file does not stop the refile
process.

* org-capture.el (org-capture-bookmark-last-stored-position):
Ditto for the capture process.

Note: we do not prevent such errors in org-remember.el as this
libary will be obsoleted for the next major release of Org.
2012-10-26 14:55:08 +02:00
Bastien Guerry 5c762bbdc6 Remove some autoloads and clean up code.
* org.el (turn-on-orgtbl): Moved here from org-table.el.
(org-clock-persistence-insinuate): Moved here from org-clock.el.
(org-update-all-dblocks, org-map-entries)
(org-require-autoloaded-modules, org-forward-element)
(org-backward-element, org-up-element)
(org-element-greater-elements, org-drag-element-backward)
(org-drag-element-forward, org-mark-element)
(org-narrow-to-element, org-transpose-element)
(org-unindent-buffer): Don't autoload.

* org-clock.el (org-clock-get-clocktable): Rename from
`org-get-clocktable'.
(org-clock-persistence-insinuate): Move to org.el.

* org-capture.el: Do no set `generated-autoload-file' locally.
Minor code clean up.

* org-agenda.el (org-agenda-list): Use
`org-clock-get-clocktable'.  Do no set
`generated-autoload-file' locally.

* org-table.el (org-table-iterate-buffer-tables): Minor
reformatting.
(turn-on-orgtbl): Move to org.el.

* org-html.el (org-export-htmlize-generate-css): Don't autoload.

* org-timer.el (org-timer-pause-or-continue, org-timer-stop):
Ditto.

* ob-tangle.el (org-babel-tangle-lang-exts): Ditto.

* ob-lob.el (org-babel-lob-ingest): Ditto.

* org-id.el (org-id-copy)
(org-id-get-with-outline-path-completion)
(org-id-get-with-outline-drilling): Ditto.

* org-lparse.el (org-lparse-and-open, org-lparse-batch)
(org-lparse-to-buffer, org-replace-region-by)
(org-lparse-region): Ditto.

* org-mobile.el (org-mobile-create-sumo-agenda): Ditto.
2012-10-02 10:03:15 +02:00
Bastien Guerry e4c31cf98b Use generated-autoload-file: "org-loaddefs.el" as a local variable. 2012-10-02 08:50:46 +02:00
Bastien Guerry c7ffcf9246 Uncomment :version "24.3" cookies.
* org.el (org-url-hexify-p, org-doi-server-url)
(org-latex-preview-ltxpng-directory, org-custom-properties)
(org-sparse-tree-default-date-type): Add :version "24.3".

* org-agenda.el (org-agenda-sticky)
(org-agenda-custom-commands-contexts): Ditto.

* org-capture.el (org-capture-bookmark)
(org-capture-templates-contexts)
(org-capture-use-agenda-date): Ditto.

* org-latex.el (org-export-latex-hyperref-options-format)
(org-export-latex-link-with-unknown-path-format): Ditto.

* org-id.el (org-id-link-to-org-use-id): Ditto.

* org-datetree.el (org-datetree-add-timestamp): Ditto.
2012-09-29 23:46:02 +02:00
Bastien Guerry 453be213ce org-capture.el (org-capture-templates): Fix typo in docstring
* org-capture.el (org-capture-templates): Fix typo in docstring.
2012-09-27 00:54:20 +02:00
Bastien Guerry c1b6920568 Fix a compiler warning. 2012-09-26 15:18:49 +02:00
Bastien Guerry 0b65064961 org-capture.el: Add declarations and check is `org-crypt' is loaded (Fix commit ac6409fe)
* org-capture.el (org-at-encrypted-entry-p)
(org-encrypt-entry, org-decrypt-entry): Declare.
(org-capture-set-target-location): Check whether `org-crypt'
has been loaded.

Thanks to Mike McLean for reporting this.
2012-09-26 08:25:05 +02:00
Bastien Guerry ac6409feae Allow using an encrypted headline as a capture target.
* org-capture.el (org-capture-finalize): Maybe re-encrypt
the target headline if it was decrypted.
(org-capture-set-target-location): Maybe decrypt the target
headline.

* org-crypt.el (org-at-encrypted-entry-p): New function.

Thanks to Guilherme Gondim for suggesting this.
2012-09-25 17:29:44 +02:00
Bastien Guerry b61ff117bc org-capture.el: Set a correct time value with file+datetree+prompt
* org-capture.el (org-capture-set-target-location): Set a
correct time value when storing a note in a datetree and
prompting the user for a date.

Thanks to Gregor Zattler for reporting this.
2012-09-24 08:28:45 +02:00
Bastien Guerry ec9f52d185 org-capture.el (org-capture-mode): Fix bug: don't run the mode's hook twice
* org-capture.el (org-capture-mode): Fix bug: don't run the
mode's hook twice.

Thanks to Kalev Takkis for reporting this.
2012-09-24 07:07:43 +02:00
Bastien Guerry 1fc19ce5bc org-capture.el (org-capture-fill-template): Fix checking of protected template entries
* org-capture.el (org-capture-fill-template): Fix checking of
protected template entries.

Thanks to Myles English for spotting this.
2012-09-22 11:08:20 +02:00
Bastien Guerry d66cbad3d9 org-capture.el: Fix bug in `org-capture-string'
* org-capture.el (org-capture-entry): New variable.
(org-capture-string, org-capture): Use it to possibly skip the
interactive prompt for a capture template.
2012-09-17 18:42:11 +02:00
Bastien Guerry f011496ceb `k' now calls org-agenda-capture from agenda. Also add `org-capture-use-agenda-date' option.
* org-capture.el (org-capture-use-agenda-date): New option.
(org-capture): Use it.

* org-agenda.el (org-agenda-capture): New command.
(org-agenda-mode-map): Bind it to `k'.
(org-agenda-menu): Add it to the menu.

* org.texi (Agenda commands): Document the new command and the
new option.

Thanks to Eric Abrahamsen who suggested this change, along with
other merging about bulk actions.
2012-09-02 12:52:38 +02:00
Bastien Guerry b121753490 org-capture.el (org-capture): Update docstring
* org-capture.el (org-capture): Update docstring.
2012-09-02 12:30:56 +02:00
Bastien Guerry a3f82f430b org-capture.el: When capturing from an agenda buffer use the cursor date at the default date
* org-capture.el (org-capture): When called from an agenda
buffer, use the cursor date at the default date.
2012-09-02 12:29:59 +02:00
Bastien Guerry dd31878ee7 org-capture.el: Protect the text used for replacement from being further replaced
* org-capture.el (org-capture-fill-template): Protect the text
used for replacement from being further replaced.

Thanks to Moritz Ulrich for reporting this bug.
2012-08-24 15:45:03 +02:00
Bastien Guerry 10dbdf5fc2 Update the handling of agenda/capture keys contextualization.
* org.el (org-contextualize-keys): Rename from
`org-contextualize-agenda-or-capture'.  Fix normalization to
handle empty key replacement string.
(org-contextualize-validate-key): Rename from
`org-contexts-validate'.  Allow checking against a custom
function.

* org-agenda.el (org-agenda-custom-commands-contexts): Update.
(org-agenda): Use `org-contextualize-keys'.

* org-capture.el (org-capture-templates-contexts): Ditto.

* org.texi (Templates in contexts, Setting Options): Update to
reflect changes in how contexts options are processed.
2012-08-24 12:18:05 +02:00
Bastien Guerry 6c94ea0518 Implement key replacement depending on the contexts.
* org.el (org-contextualize-agenda-or-capture): Handle key
replacement depending on the contexts.

* org-capture.el (org-capture-templates-contexts): Allow to
use the context as a way to replace one capture template by
another one.

* org-agenda.el (org-agenda-custom-commands-contexts): Allow
to use the context as a way to replace one agenda custom
command by another one.

* org.texi (Templates in contexts): Document the new structure
of the variables `org-agenda-custom-commands-contexts' and
`org-capture-templates-contexts'.

In the setup below, X is not a real capture template, it is just
an alias to templates A and B in .txt and .el files.  A and B are
deactivated by default in all files.

(setq org-capture-templates
      '(("X" "Nothing but an alias")
	("A" "AAAA" entry (file+headline [...]))
	("B" "BBBB" entry (file+headline [...]))))

(setq org-capture-templates-contexts
      '(("A" "A" ((not-in-file . ".*")))
	("B" "B" ((not-in-file . ".*")))
	("X" "A" ((in-file . "\\.txt")))
	("X" "B" ((in-file . "\\.el")))))

Thanks to Carsten for suggesting this "key-replacement" idea!
2012-08-24 12:17:58 +02:00
Bastien Guerry d378c7b41b Implement context filtering for agenda commands and capture templates.
* org.el (org-contextualize-agenda-or-capture)
(org-rule-validate): New functions, implement context
filtering for agenda commands and capture templates.

* org-agenda.el (org-agenda-custom-commands-contexts): New
option.
(org-agenda): Use it.

* org-capture.el (org-capture-templates-contexts): New option.
(org-capture-select-template): Use it.

* org.texi (Templates in contexts): Document the new option
`org-capture-templates-contexts'.
(Storing searches): Document the new option
`org-agenda-custom-commands-contexts'.

This idea comes from Sylvain Rousseau, who implemented a similar
feature with org-context.el: https://github.com/thisirs/org-context

This implementation is a bit simpler and more general.  Simpler
because it relies on existing templates, no need to define other
contextual ones.  More general because contexts can be defined
wrt files and modes.

Thanks *very much* to Sylvain for paving the way -- certainly a
great addition to Org.
2012-08-23 11:08:47 +02:00
Bastien Guerry b4df37076d Don't use :version "24.3" until Emacs 24.3 is released and/or Org sync'ed in Emacs 2012-08-20 07:49:16 +02:00
Bastien Guerry 92271aecea org-capture.el (org-capture-place-table-line): Fix bug
* org-capture.el (org-capture-place-table-line): Fix bug.

Thanks to Ian Barton for reporting this.
2012-08-19 17:41:01 +02:00
Bastien Guerry 76b0d582b8 Replace Emacs version to "24.2" by "24.3"
This is needed because the current HEAD of the git repository
will not be synced with Emacs 24.2 but more likely with Emacs 24.3.
2012-08-16 09:24:58 +02:00
Bastien Guerry 722e0e0c83 Remove `org-substring-no-properties' and some redundant code
* org-macs.el (org-no-properties): Allow a new parameter
`restricted' to restrict the properties removal to those in
`org-rm-props'.  The default is now to remove all properties.

* org-compat.el (org-substring-no-properties): Remove unused
defun.

* org-remember.el (org-remember-apply-template): Remove
redundant removal of text properties.
(org-remember-apply-template): Use `org-no-properties'.

* org-capture.el (org-capture-fill-template): Remove redundant
removal of text properties.
(org-capture-fill-template): Use `org-no-properties'.

* org-gnus.el (org-gnus-open, org-gnus-follow-link): Use
`org-no-properties'.
2012-08-15 09:35:21 +02:00
Michael Brand e1d5a31786 Improve parsing of org-capture-inside-embedded-elisp-p
* org-capture.el (org-capture-inside-embedded-elisp-p): Improve parsing.
2012-08-12 12:12:04 +02:00
Bastien Guerry e5c93760c8 org-capture.el (org-capture): Fix bug introduced by commit 1737d3
* org-capture.el (org-capture): Fix bug introduced by commit
1737d3.

Thanks to Simon Thum for reporting this.
2012-08-11 19:50:20 +02:00
Bastien Guerry b422af282d org-capture.el: Minor code cleanup 2012-08-11 19:35:34 +02:00
Bastien Guerry 70dd1196d2 Massive code clean-up.
Delete trailing whitespaces.
Indent all sexps correctly.
Sentences end with double spaces.
2012-08-11 19:10:44 +02:00
Michael Brand 042db379fc Add the capture feature sexp to org feed
* org-feed.el (org-feed-format-entry): Require `org-capture'.
Expand Elisp %(...) templates.
(org-feed-default-template): Update docstring.

* org-capture.el (org-capture-expand-embedded-elisp): New
function.
(org-capture-fill-template): Use it.
(org-capture-inside-embedded-elisp-p): New function to tell if
we are within an Elisp %(...) template.
2012-08-11 18:55:12 +02:00
Bastien Guerry 1737d3c4ee New command `org-capture-string'
* org-capture.el (org-capture-string): New command to prompt
for the interactive text interactively.  This can also be used
in Elisp programs to use ̀org-capture' with some initial text.
(org-capture-initial): New variable to store the initial text.
(org-capture): Use `org-capture-initial'.
2012-08-11 11:17:35 +02:00
Bastien Guerry d9ebb7c8be org-capture.el: Fix bug in placing point according to %?
* org-capture.el (org-capture-templates): Docstring clean up.
(org-capture-place-entry, org-capture-place-item)
(org-capture-place-plain-text, org-capture-place-table-line):
Ensure to always position the point according to %?.

Thanks to Gsqual for reporting this and to Nick Dokos for digging into this
issue.
2012-08-10 11:48:54 +02:00
Bastien Guerry 7fdd49dd33 org-capture.el: Fix docstring by adding Gnus to the list of mail clients.
* org-capture.el (org-capture-templates): Fix docstring by
adding Gnus to the list of mail clients.

Thanks to Tassilo Horn for spotting this.
2012-08-03 14:01:19 +02:00
Bastien Guerry 21ec0159b8 org-capture.el: New template %l to insert the literal link.
* org-capture.el (org-capture-templates): New template %l to
insert the literal link pointing at the current buffer.

* org.texi (Template expansion): Document the new %l template.

Thanks to Eric Abrahamsen for this idea.
2012-08-02 17:06:22 +02:00
Bastien Guerry 8eb584331a Add punctuation at the end of the first line of docstrings. Code cleanup. 2012-07-30 10:08:15 +02:00
Bastien Guerry f71d45a913 New option `org-capture-bookmark' (mentioned in the manual.)
* org.texi (Using capture): Mention the
`org-capture-last-stored' bookmark as a way to jump to the
last stored capture.

* org-capture.el (org-capture-bookmark): New option.
(org-capture-finalize): Use it.
2012-05-25 23:45:31 +02:00
Bastien Guerry 1666b910fe org-capture.el: Use %\n instead of %n.
* org-capture.el (org-capture-fill-template): Use %\n instead of %n as a
template element to be replaced with the nth prompted string.
(org-capture-templates): Update docstring.

* org.texi (Template expansion): Update doc to reflect change.

Using %n triggers errors when the template contains escaped strings,
which happens a lot with links.
2012-04-24 11:54:16 +02:00
Toby S. Cubitt b7982a0024 org-capture.el: Fixed bug in org-capture-templates %<n> expandos
* lisp/org-capture.el (org-capture-fill-template): Fixed regexp for
  %<n> expandos to match any positive integer.
  (org-capture-templates): Updated docstring accordingly.

* doc/org.texi: Updated documentation accordingly.
2012-04-23 17:34:15 +02:00
Toby Cubitt e13d182ce8 Allow %<num> escapes to capture templates, expanded to text entered in <num>'th prompt
* org-capture.el (org-capture-fill-template): Expand %<num>
escape sequences into text entered for <num>'th %^{PROMPT} escape.
2012-04-23 12:48:40 +02:00
Bastien Guerry 1c203d8d19 Match #+name/#+tblname/#+tblfm along with uppercase twins.
* org.el: Use (case-fold-search t).
(org-edit-special, org-ctrl-c-ctrl-c): Ditto.

* org-table.el:
(org-table-store-formulas, org-table-get-stored-formulas)
(org-table-fix-formulas, org-table-edit-formulas)
(org-old-auto-fill-inhibit-regexp, orgtbl-ctrl-c-ctrl-c)
(orgtbl-toggle-comment, org-table-get-remote-range): Ditto.

* org-footnote.el:
(org-footnote-goto-local-insertion-point): Ditto.

* org-exp.el: Ditto.

* org-colview.el:
(org-dblock-write:columnview, org-dblock-write:columnview):
Ditto.

* org-colview-xemacs.el:
(org-dblock-write:columnview): Ditto.

* org-clock.el (org-clocktable-write-default): Ditto.

* org-capture.el (org-capture-place-table-line): Ditto.

* ob.el (org-babel-data-names, org-babel-goto-named-src-block)
(org-babel-src-block-names)
(org-babel-where-is-src-block-result, org-babel-result-end)
(org-babel-where-is-src-block-head)
(org-babel-find-named-result, org-babel-result-names): Ditto.
2012-04-23 12:48:33 +02:00
Toby S. Cubitt 501b76ad36 Capture: Allow more control over inserted whitespace in capture templates
* lisp/org-capture.el (org-capture-place-entry): Place captured entry
immediately after last subheading of target, instead of just before
next heading at same level as target.
* lisp/org-capture.el (org-capture-templates): Document new capture
template properties.
* lisp/org-capture.el (org-capture-place-entry,
org-capture-empty-lines-before): Make new :empty-lines-before property
override :empty-lines when inserting empty lines before captured
captured entry.
* lisp/org-capture.el (org-capture-finalize,
org-capture-empty-lines-after): Make new :empty-lines-after property
override :empty-lines when inserting empty lines after captured
captured entry.
2012-04-21 01:57:54 +02:00
Bastien Guerry d5c0af72cf Use (derived-mode-p 'org-mode) instead of (eq major-mode 'org-mode).
* org.el (org-show-hierarchy-above, org-cycle)
(org-global-cycle, org-files-list, org-store-link)
(org-link-search, org-open-file, org-display-outline-path)
(org-refile-get-location, org-update-all-dblocks)
(org-change-tag-in-region, org-entry-properties)
(org-save-all-org-buffers, org-revert-all-org-buffers)
(org-buffer-list, org-cdlatex-mode)
(org-install-agenda-files-menu, org-end-of-subtree)
(org-speedbar-set-agenda-restriction): Use (derived-mode-p
'org-mode) instead of (eq major-mode 'org-mode).

* org-timer.el (org-timer-set-timer): Ditto.

* org-table.el (orgtbl-mode, org-table-align, orgtbl-mode): Ditto.

* org-src.el (org-edit-src-exit, org-edit-src-code)
(org-edit-fixed-width-region, org-edit-src-exit): Ditto.

* org-remember.el (org-remember-handler): Ditto.

* org-mouse.el (dnd-open-file, org-mouse-insert-item): Ditto.

* org-macs.el (org-get-limited-outline-regexp): Ditto.

* org-lparse.el (org-replace-region-by): Ditto.

* org-latex.el (org-latex-to-pdf-process)
(org-replace-region-by-latex): Ditto.

* org-indent.el (org-indent-indent-buffer): Ditto.

* org-id.el (org-id-store-link, org-id-update-id-locations)
(org-id-store-link): Ditto.

* org-html.el (org-export-html-preprocess)
(org-replace-region-by-html): Ditto.

* org-footnote.el (org-footnote-normalize)
(org-footnote-goto-definition)
(org-footnote-create-definition, org-footnote-normalize): Ditto.

* org-docbook.el (org-replace-region-by-docbook): Ditto.

* org-ctags.el (find-tag): Ditto.

* org-colview.el (org-columns-redo)
(org-columns-display-here, org-columns-edit-value)
(org-columns-redo): Ditto.

* org-colview-xemacs.el (org-columns-redo)
(org-columns-display-here, org-columns-edit-value)
(org-columns-redo): Ditto.

* org-capture.el (org-capture-insert-template-here)
(org-capture, org-capture-finalize)
(org-capture-set-target-location)
(org-capture-insert-template-here): Ditto.

* org-ascii.el (org-replace-region-by-ascii):  Ditto.

* org-archive.el (org-archive-subtree): Ditto.

* org-agenda.el (org-agenda)
(org-agenda-get-restriction-and-command)
(org-agenda-get-some-entry-text, org-search-view)
(org-tags-view, org-agenda-get-day-entries)
(org-agenda-format-item, org-agenda-goto, org-agenda-kill)
(org-agenda-archive-with, org-agenda-switch-to): Ditto.
2012-04-21 00:43:16 +02:00
Bastien Guerry e3913a2ab5 Merge branch 'hotfix-7.8.06' 2012-04-02 00:53:37 +02:00
Bastien Guerry 5c38bf0ef7 Fix copyright and authors lines. 2012-04-02 00:53:28 +02:00
Bastien Guerry 8ab92f8b55 Delete trailing whitespaces in core files. 2012-03-28 02:05:36 +02:00
Bastien Guerry ecd0562c5f Fix the master branch.
I started from the 78ec8e commit then cherry-picked and squashed
commits that have been done in master since then, except the bad
commits that overwrote the tree (in master) with the tree in maint.

This commit also bumps the version number to 7.8.06.

The only "fix" that was made between 78ec8e and the previous commit
is e0072f which has been reported to break stuff.
2012-03-19 22:01:29 +01:00
Bastien Guerry de42649f7b Manually revert maint to e85080.
e85080 is the last correct commit in the maint branch
before releasing 7.8.04.  The 7.8.05 release should be
done from this commit.
2012-03-17 16:28:46 +01:00
Bastien Guerry 73bb18ba37 Manually revert to the Release 7.8.04 tag. 2012-03-17 15:52:24 +01:00
Bastien Guerry 6e534f9c61 Manually revert back to commit e85080.
This fixes a wrong merge that should not have happened:
commit 7e903a merges the master branch into the maint branch,
while we really want to keep the maint branch a bugfix-only
branch.

This commit reverts back the maint branch to its state before
merging the master branch.  From there, we will fix remaining
problems with the maint branch (e.g. copyright issues) then
release this maint branch as Org-mode 7.8.05.
2012-03-17 14:34:01 +01:00
David Maus f737fbdc6e New hook: Run before the finalization process starts
* org-capture.el (org-capture-prepare-finalize-hook): New hook. Run
before the finalization process starts.
(org-capture-finalize): Run new hook.
2012-02-18 16:41:30 +01:00
Bastien Guerry 04971de4b9 Add version tag "24.1" for options introduced since Emacs 23.4 (and <= 24.1)
* org-exp.el (org-export-kill-product-buffer-when-displayed)
(org-export-initial-scope, org-export-date-timestamp-format)
(org-export-with-tasks, org-export-email-info)
(org-export-table-remove-empty-lines): Add version tag.

* org-mobile.el (org-mobile-files-exclude-regexp)
(org-mobile-use-encryption, org-mobile-encryption-tempfile)
(org-mobile-encryption-password, org-mobile-agendas): Add
version tag.

* ob-plantuml.el (org-plantuml-jar-path): Add version tag.

* org.el (org-babel-load-languages, org-clone-delete-id)
(org-log-buffer-setup-hook)
(org-loop-over-headlines-in-active-region)
(org-use-sub-superscripts, org-startup-with-beamer-mode)
(org-startup-with-inline-images, org-ctrl-k-protect-subtree)
(org-catch-invisible-edits)
(org-link-search-must-match-exact-headline)
(org-confirm-shell-link-not-regexp)
(org-confirm-elisp-link-not-regexp, org-log-refile)
(org-refile-use-cache)
(org-refile-active-region-within-subtree)
(org-todo-repeat-to-state, org-get-priority-function)
(org-agenda-jump-prefer-future)
(org-read-date-force-compatible-dates)
(org-use-effective-time)
(org-complete-tags-always-offer-all-agenda-tags)
(org-properties-postprocess-alist)
(org-format-latex-signal-error)
(org-latex-to-mathml-jar-file)
(org-latex-to-mathml-convert-command)
(org-export-latex-default-packages-alist)
(org-hidden-keywords, org-pretty-entities)
(org-pretty-entities-include-sub-superscripts)
(org-src-fontify-natively, org-effort-durations)
(org-speed-command-hook): Add version tag.

* org-html.el (org-export-html-footnote-separator)
(org-export-html-mathjax-options)
(org-export-html-mathjax-template)
(org-export-html-headline-anchor-format)
(org-export-html-preamble-format)
(org-export-html-postamble-format)
(org-export-html-table-align-individual-fields)
(org-export-html-protect-char-alist, org-export-html-divs):
Add version tag.

* org-ctags.el (org-ctags-path-to-ctags)
(org-ctags-open-link-functions)
(org-ctags-new-topic-template): Add version tag.

* ob-exp.el (org-export-babel-evaluate): Add version tag.

* org-beamer.el (org-beamer-use-parts)
(org-beamer-frame-level, org-beamer-frame-default-options)
(org-beamer-column-view-format, org-beamer-themes)
(org-beamer-environments-extra, org-beamer-fragile-re)
(org-beamer-outline-frame-title)
(org-beamer-outline-frame-options): Add version tag.

* org-wl.el (org-wl-link-remove-filter)
(org-wl-shimbun-prefer-web-links)
(org-wl-nntp-prefer-web-links, org-wl-disable-folder-check)
(org-wl-namazu-default-index): Add version tag.

* org-clock.el (org-task-overrun-text)
(org-clocktable-defaults, org-clock-clocktable-formatter)
(org-clock-clocktable-language-setup)
(org-clock-report-include-clocking-task)
(org-clock-resolve-expert): Add version tag.

* ob-lob.el (org-babel-lob-files): Add version tag.

* org-freemind.el (org-freemind-node-css-style): Add version
tag.

* org-archive.el (org-archive-reversed-order)
(org-archive-subtree-add-inherited-tags): Add version tag.

* org-bibtex.el (org-bibtex-autogen-keys, org-bibtex-prefix)
(org-bibtex-treat-headline-as-title)
(org-bibtex-export-arbitrary-fields)
(org-bibtex-key-property, org-bibtex-tags)
(org-bibtex-tags-are-keywords, org-bibtex-no-export-tags)
(org-bibtex-type-property-name): Add version tag.

* org-timer.el (org-timer-default-timer): Add version tag.

* org-taskjuggler.el (org-export-taskjuggler-extension)
(org-export-taskjuggler-project-tag)
(org-export-taskjuggler-resource-tag)
(org-export-taskjuggler-target-version)
(org-export-taskjuggler-default-project-version)
(org-export-taskjuggler-default-project-duration)
(org-export-taskjuggler-default-reports)
(org-export-taskjuggler-default-global-properties): Add
version tag.

* org-habit.el (org-habit-today-glyph)
(org-habit-completed-glyph): Add version tag.

* org-list.el (org-alphabetical-lists)
(org-list-ending-method, org-list-end-regexp)
(org-list-automatic-rules, org-list-use-circular-motion)
(org-list-indent-offset): Add version tag.

* ob-picolisp.el (org-babel-picolisp-cmd): Add version tag.

* org-icalendar.el (org-icalendar-alarm-time)
(org-icalendar-combined-description)
(org-icalendar-honor-noexport-tag)
(org-icalendar-date-time-format): Add version tag.

* org-src.el (org-src-tab-acts-natively): Add version tag.

* org-exp-blocks.el (org-export-blocks-postblock-hook): Add
version tag.

* org-table.el (org-table-exit-follow-field-mode-when-leaving-table)
(org-table-fix-formulas-confirm)
(org-table-duration-custom-format)
(org-table-formula-field-format): Add version tag.

* org-publish.el (org-publish-sitemap-sort-files)
(org-publish-sitemap-sort-folders)
(org-publish-sitemap-sort-ignore-case)
(org-publish-sitemap-date-format)
(org-publish-sitemap-file-entry-format): Add version tag.

* ob-js.el (org-babel-js-cmd): Add version tag.

* org-docbook.el (org-export-docbook-footnote-separator)
(org-export-docbook-xslt-stylesheet): Add version tag.

* org-entities.el (org-entities-ascii-explanatory)
(org-entities-user): Add version tag.

* ob.el (org-confirm-babel-evaluate)
(org-babel-no-eval-on-ctrl-c-ctrl-c): Add version tag.

* ob-tangle.el (org-babel-tangle-lang-exts)
(org-babel-post-tangle-hook, org-babel-pre-tangle-hook)
(org-babel-tangle-body-hook)
(org-babel-tangle-comment-format-beg)
(org-babel-tangle-comment-format-end)
(org-babel-process-comment-text): Add version tag.

* org-gnus.el (org-gnus-nnimap-query-article-no-from-file):
Add version tag.

* org-crypt.el (org-crypt-disable-auto-save): Add version tag.

* org-inlinetask.el (org-inlinetask-default-state): Add
version tag.

* ob-scheme.el (org-babel-scheme-cmd): Add version tag.

* ob-lisp.el (org-babel-lisp-dir-fmt): Add version tag.

* org-attach.el (org-attach-store-link-p): Add version tag.

* org-capture.el (org-capture-templates)
(org-capture-before-finalize-hook)
(org-capture-after-finalize-hook): Add version tag.

* org-agenda.el (org-agenda-skip-deadline-prewarning-if-scheduled)
(org-agenda-time-leading-zero, org-agenda-follow-indirect)
(org-agenda-menu-two-column, org-agenda-menu-show-matcher)
(org-agenda-timegrid-use-ampm)
(org-agenda-remove-timeranges-from-blocks)
(org-agenda-inactive-leader, org-agenda-current-time-string)
(org-agenda-show-current-time-in-grid)
(org-agenda-search-view-force-full-words)
(org-agenda-search-view-always-boolean)
(org-agenda-clock-consistency-checks)
(org-agenda-include-deadlines)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-day-face-function)
(org-agenda-category-icon-alist)
(org-agenda-bulk-custom-functions)
(org-agenda-insert-diary-extract-time): Add version tag.

* org-latex.el (org-export-latex-inputenc-alist)
(org-export-latex-tag-markup)
(org-export-latex-timestamp-inactive-markup)
(org-export-latex-href-format)
(org-export-latex-hyperref-format)
(org-export-latex-footnote-separator)
(org-export-latex-quotes)
(org-export-latex-table-caption-above)
(org-export-latex-listings-w-names)
(org-export-latex-minted-langs)
(org-export-latex-listings-options)
(org-export-latex-minted-options)
(org-latex-default-figure-position, org-export-pdf-logfiles):
Add version tag.

* org-faces.el (org-faces-easy-properties)
(org-fontify-quote-and-verse-blocks, org-cycle-level-faces):
Add version tag.

* ob-ditaa.el (org-ditaa-jar-option): Add version tag.

Thanks to Glenn Morris for reporting this.
2012-02-13 15:49:28 +01:00
David Maus cda38d182a Don't search for position in existing list if :exact-position
* org-capture.el (org-capture-place-item): Don't search for
position in existing list if :exact-position was supplied.

This fixes a bug reported by François Pinard in
<http://thread.gmane.org/gmane.emacs.orgmode/49995>.
2012-01-24 06:41:49 +01:00
Bastien Guerry fadca5e8eb Fix typos and spelling mistakes.
Thanks to Paul Eggert for this fixes in Emacs trunk.
2012-01-10 11:56:15 +01:00
Bastien Guerry f6d7b32bf2 Fix trailing whitespaces. 2012-01-04 16:20:04 +01:00
Bastien Guerry 575ecebcac More copyright year fixes. 2012-01-04 15:11:23 +01:00
Bastien Guerry b73075a8d2 Code cleanup up: rename org-on-*-p to org-at-*-p.
Rename `org-on-heading-p' and `org-on-target-p' to
`org-at-heading-p' and `org-at-target-p' to be more
consistent with the org-at-*-p family.

Also define two aliases.
2012-01-02 19:52:35 +01:00
Carsten Dominik acfd6ff3bc Fix bug in org-capture file+datetree+promt target type
* lisp/org-capture.el (org-capture-set-target-location): Set the capture
default time also to the prompt time.

In the file+datetree+promt target type, the user is being asked for a
date, where to file an entry.  In the template, there can the escape
placeholders for active and inactive time stamps.  So far, these were
filled with todays date.  This patch changes this behavior, so that
also at %t and %u escaped, the date entered at the prompt will be
used.

Reported by Erik Hetzner.
2011-12-06 09:00:27 +01:00
Bastien Guerry ad09e1e036 org-capture.el: improve docstring for `org-capture-before-finalize-hook'.
* org-capture.el (org-capture-before-finalize-hook): Docstring
improvement: mention that the buffer is widened when this hook
is run.

Thanks to Paul for a suggestion about this.
2011-10-29 14:07:18 +02:00
Michael Sperber 2d296c12ea org-capture and XEmacs, indenting too far
Robert Pluim <rpluim@gmail.com> writes:

> Hi, I'm using XEmacs 21.5  (beta29) "garbanzo" d27c1ee1943b+ [Lucid]
> (i686-pc-cygwin, Mule) of Mon Oct 18 2010 on RPluim, with the following
> org-capture-templates
>
> (("t" "Todo" entry (file+headline "~/org/notes.org" "Tasks") "* TODO %?"))
>
> The problem is that for some reason the resulting TODO heading is has 2
> extra spaces, and is placed at too deep a level, giving:
>
> * Tasks
> ***   TODO a task
>
> I've tested this on a fairly recent emacs24 build, and everything works
> fine there, so this is probably something XEmacs specific.  Can anyone
> suggest any way to track this down (I'd bisect, but I've yet to find a
> 'good' version)?

I finally got around to looking into this: The reason is that, in
org-capture mode, `outline-level' is bound to outline.el's function,
which is off by one compared to org-mode's.  I used this patch to fix
it:

Could somebody review and maybe apply this?
2011-10-26 19:49:51 +02:00
Michael Sperber d493a0eced * org-capture.el (org-capture-get-indirect-buffer): Fix XEmacs
compatibility issue when creating an indirect buffer.

TINYCHANGE
2011-10-26 19:43:07 +02:00
Tassilo Horn 4bbdfd229d Replace org-mode-p with usual (eq major-mode 'org-mode) check
Additionally, replace one

  (or (org-mode-p) (derived-mode-p 'org-mode))

with

  (derived-mode-p 'org-mode)

cause that is reflexive anyway (returns true, if the current mode is
org-mode).

Delete one check testing for org-mode or org derived mode
2011-10-22 11:29:24 +02:00
Bastien Guerry 58f1dbccf8 Remove the "Version" header in Org libraries (leave it in org.el).
Also remove blank lines before the ";;; org*el ends here" declarations.

Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.

Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
2011-08-17 14:42:34 +02:00
Bastien Guerry 7a18799e25 Remove arch-tag at the bottom of files. 2011-08-15 20:04:38 +02:00
Bastien Guerry 904ed18bc2 Fix copyright years for elisp files in core and contrib.
Also add "This file is not part of GNU Emacs." when this is the case.
2011-08-15 15:23:11 +02:00
emacs 7340cee33a Update website to show 7.7 as current release 2011-07-28 10:33:35 +00:00
Bastien Guerry c222e8f134 org-capture: Fix order of template sequences.
* org-capture.el (org-capture-templates): docstring fix.
* org.texi (Template expansion): order template sequences in
the proper order.

Thanks to Philipp Möller for this fix.
2011-07-25 23:08:45 +02:00
Bastien Guerry 5e33df46a4 Revert "org-capture: require dired since org-capture might use `dired-buffers'"
This reverts commit f3e563476b.
2011-07-19 18:41:21 +02:00
Bastien Guerry 4670e95458 Merge branch 'master' of orgmode.org:org-mode 2011-07-19 18:34:02 +02:00
Bastien Guerry f3e563476b org-capture: require dired since org-capture might use `dired-buffers' 2011-07-19 18:27:11 +02:00
Nicolas Goaziou d883d0b01d org-capture: fix error with %F and dired not loaded
* lisp/org-capture.el (org-capture): if dired isn't loaded,
  `dired-buffers' isn't defined, and %F will fail.

Thanks to Puneeth Chaganti for reporting this.
2011-07-19 17:49:37 +02:00
Nicolas Goaziou 819fbec641 org-capture: %F is directory when capture starts in a dired buffer
* lisp/org-capture.el (org-capture): if no file is associated to
  current buffer, check dired buffer and try to retreive a possibly
  directory associated.
2011-07-19 08:56:10 +02:00
Bastien Guerry 5c53026d32 Fix (a lot of) compiler warnings.
Also introduce `org-pop-to-buffer-same-window' as a compatibility
function for Emacs =>24.1.
2011-07-18 19:25:10 +02:00
Bastien Guerry 9fc6daa3d2 org-capture.el: Delete trailing whitespace. 2011-07-12 08:29:55 +02:00
Bastien Guerry 17603418ab org-capture.el: Fix bug about insert blank line when aborting.
* org-capture.el (org-capture-finalize): bugfix about
inserted blank line when killing the capture buffer and
`org-blank-before-new-entry' tells to not insert anything
before a heading.

Thanks to Leo for reporting this.
2011-07-12 08:29:02 +02:00
David Maus 6b12ff2e2f Fix docstrings, consistently refer to capture, not remember
* org-capture.el (org-capture-before-finalize-hook)
(org-capture-after-finalize-hook, org-capture-mode-map)
(org-capture-mode, org-capture-goto-last-stored): Fix docstring,
consistently refer to capture, not remember.
2011-07-10 19:30:40 +02:00
Bastien Guerry 9c05a7c781 Bump to version 7.6 2011-07-06 21:06:03 +02:00
Carsten Dominik bc161ded36 Capture: Store time from prompt in file+datetree+prompt target
* lisp/org-capture.el (org-capture-current-plist): Improve docstring.
(org-capture-put): Add docstring.
(org-capture-get): Add docstring.
(org-capture-member): Add LOCAL argument. Add docstring.
(org-capture-set-target-location): Store the time received from a date
prompt into the :prompt-time property.

When using the file+datetree+prompt target for capture, the time set
by the prompt is now stored in the :prompt-time property.
2011-05-27 20:50:09 +02:00
Carsten Dominik af7aefe945 * lisp/org-capture.el (org-capture): Ignore errors when creating a link.
Patch by Tassilo Horn.
2011-05-24 13:39:56 +02:00
Carsten Dominik 1b262c9fc0 Fix bug in capture customization setup.
* lisp/org-capture.el (org-capture-templates): Fix bug in customization setup.

Patch by Giovanni Ridolfi

TINYCHANGE
2011-05-13 14:49:27 +02:00
Carsten Dominik e98237927f Document the capture property :table-line-pos 2011-05-05 09:58:31 +02:00
Bastien Guerry 8cf35f0ab1 org-capture.el: Fix bugs about handling the :clock-keep parameter.
* org-capture.el (org-capture-clock-keep): New local variable.
(org-capture, org-capture-finalize): Use it and fix a bug when
:clock-keep is set to `t'.
2011-04-08 18:04:47 +02:00
Carsten Dominik 27fe8e0dd7 Fix bug introduced with previous commit 2011-04-07 18:42:11 +02:00
Carsten Dominik f1ffed8a6c Allow to capture plain templates into Org nodes
* lisp/org.el (org-end-of-meta-data-and-drawers): New function.
* lisp/org-capture.el (org-capture-place-plain-text): Implement adding
plain text templates to Org nodes.

This is something which came out of a discussion with Philip Rooke, in
the thread

Philip tried to use a capture template with template type plain, but
using a date tree as a target.  Plain templates where placed at the
end of the file, not at the end of the entry.  I complained first that
mixing headlined entries and plain snippets into the same capture
target is not possible, but I realized that there is a way to make
this work OK.  The headlined entries become children, and the plain
text snippets become part of the text before the first child.
2011-04-07 08:47:13 +02:00
Carsten Dominik 8a831e8f6c Introduce a new org-capture escape for arbitrarily defined time strings
* lisp/org-capture.el (org-capture-fill-template): Resolve new %<...>
template escape.
(org-capture-templates): Document new %<...> template escape.
* doc/org.texi (Template expansion): Document new %<...> template escape.
2011-04-06 08:49:12 +02:00
Carsten Dominik 6daac769f5 Minor fix
* lisp/org-capture.el (org-datetree-find-date-create): Lower-case for
variable names in define-function form.
2011-03-19 14:55:41 +01:00
Bastien Guerry 9784af675c Fix bug with the handling of the new :clock-keep option.
Thanks to Bernt for the detailed report.
2011-03-07 17:25:00 +01:00
emacs 11a10bdfe7 Update website to show 7.5 as current release 2011-03-07 14:27:39 +00:00
Bastien Guerry 54c638523d org-capture.el: Rename :no-clock-out to :clock-keep.
(org-capture-templates): Rename :no-clock-out to :clock-keep.
(org-capture): Use :clock-keep instead of :no-clock-out.

Thanks to Bernt Hansen for the suggestion.
2011-03-07 15:21:13 +01:00
Bastien Guerry b969081ebd org-capture.el: new :no-clock-out template option.
* org-capture.el (org-capture-templates): New option
:no-clock-out.
(org-capture): Use the new option.

* org.texi (Template elements): document the new template
option :no-clock-out.
2011-03-07 11:43:58 +01:00
Bastien Guerry 25dfaf717c * org-capture.el: Don't allow currentfile anymore.
* org-capture.el (org-capture-templates): Don't allow
currentfile anymore.
2011-03-06 18:10:48 +01:00
Bastien Guerry 030960559e org-capture.el: remove (currentfile) as a file specification in templates.
You can already use a function like (buffer-file-name) to get the currently
visited file.  So (currentfile) is not necessary.
2011-03-06 17:31:56 +01:00
Bastien Guerry 35effd6b6d org-capture.el: Fix bug about capturing to narrowed buffers.
* org-capture.el (org-capture-put-target-region-and-position):
New function to store information about the target buffer.
(org-capture-set-target-location): Use it.
(org-capture-finalize): restore the target buffer in its
possibly narrowed state.  Also restore the cursor position.
2011-03-06 14:10:28 +01:00
Bastien Guerry c255f03676 org-capture.el: make :immediate-finish cooperate with :clock-in.
* org-capture.el (org-capture-finalize): New argument
clock-out, to tell whether finalizing the capture process
should clock out the running clock.
(org-capture): Use the new argument.
2011-03-06 01:09:51 +01:00
Carsten Dominik aaf0e2d6bb Get rid of some compiler warnings
* Makefile (lisp/org-special-blocks.elc): Add dependency on org-compat.el
* lisp/ob-ref.el (org-at-item-p): Declare function.
* lisp/org-agenda.el (diary-time-regexp): defvar.
* lisp/org-archive.el (org-archive-subtree): Bind local variable `infile-p'.
* lisp/org-capture.el (org-capture-insert-template-here): Get template
text from property list, to avoid byte compiler message.
* lisp/org-latex.el (org-export-latex-tables): Bind local variable `width'.
* lisp/org-special-blocks.el (org-compat): Add require statement.
* lisp/org-table.el (orgtbl-ctrl-c-ctrl-c): Bind local variable `const-str'.
* lisp/org.el (org-eval): Moved function here from org-agenda.el.
2011-03-01 07:24:14 +01:00
Puneeth Chaganti aa946f224d Bugfix with interactive prompt in templates expansion.
* org-capture.el (org-capture-fill-template): fix bug with
the display of interactive prompt in templates expansion.
2011-02-26 16:53:51 +01:00
Bastien Guerry d45739f62f * org-capture.el (org-capture-refile): Fix typo in docstring. 2011-02-23 16:47:37 +01:00
Carsten Dominik 4ab9990b54 Simplify the function `org-capture-expand-file' 2011-02-22 14:00:24 +01:00
Carsten Dominik a821f4e922 Fix typo in code 2011-02-22 13:38:28 +01:00
Carsten Dominik c654620d73 Allow file names in capture templates to be functions, forms, or variables
* lisp/org-capture.el (org-capture-expand-file): New function.
(org-capture-target-buffer):
(org-capture-set-target-location): Use `org-capture-expand-file'.

* doc/org.texi (Template elements): Document that files can be given
as function, form, or variable.
2011-02-22 10:10:22 +01:00
Nicolas Goaziou 781228183a org-list: implement alphabetical lists
* lisp/org-list.el (org-alphabetical-lists): new variable
(org-item-re, org-list-full-item, org-cycle-list-bullet,
org-list-struct-fix-bul, org-list-inc-bullet-maybe): reflect
introduction of the new variable.
(org-item-beginning-re): changed into a function, so any modification
of `org-alphabetical-lists' will not require reloading Org.
(org-at-item-p, org-toggle-checkbox, org-update-checkbox-count,
org-list-parse-list, org-list-send-list): reflect changes to
`org-item-beginning-re'.
(org-list-use-alpha-bul-p): new function.
* lisp/org.el (org-check-for-hidden): reflect changes to
`org-item-beginning-re'.
* lisp/org-capture.el (org-capture-place-item): reflect changes to
`org-item-beginning-re'.
* lisp/org-docbook.el (org-export-docbook-list-line): handle new type
of items.
* lisp/org-exp.el (org-export-mark-list-end,
org-export-mark-list-properties): reflect changes to
`org-item-beginning-re'.
* lisp/org-html.el (org-html-export-list-line): handle new type of
items.
* lisp/org-latex.el (org-export-latex-lists): handle new type of items
and reflect changes to `org-item-beginning-re'.
* lisp/org-ascii.el (org-export-ascii-preprocess): handle new counters.

Modified from a patch by Nathaniel Flath.
2011-02-18 12:45:10 +01:00
Nicolas Goaziou da6a10b02d Modified behavior in searches specific to lists
* lisp/org-list.el (org-list-search-generic): renamed form
  org-search-unenclosed-generic to reflect now behavior. Now, match
  can only be in a valid context for lists, as determined by
  `org-list-context'.
(org-list-search-backward): renamed from
org-search-backward-unenclosed.
(org-list-search-forward): renamed from org-search-forward-unenclosed.
(org-toggle-checkbox,org-update-checkbox-count): use new functions.
(org-sort-list): using default regexp search functions as context is
not required in this case.

* lisp/org-ascii.el (org-export-ascii-preprocess): use new function

* lisp/org-capture.el (org-capture-place-item): use new function
2011-02-18 12:45:09 +01:00
Bastien 08650cbb5c Allow (currentfile) for capture templates.
* org-capture.el (org-capture-templates): document currentfile
for capture template.
(org-capture-templates): Allow to use currentfile for capture
templates.
(org-capture-set-target-location): Handle currentfile as a way
to setting the capture buffer.

* org.texi (Template elements): document currentfile for
capture templates.
2011-02-12 19:07:52 +01:00
Osamu Okano a017fca37f Various docstrings typo fixes by Osamu OKANO. 2011-02-01 13:05:13 +01:00
Carsten Dominik bd11460542 Make file and path accessible in capture templates
* lisp/org-capture.el (org-capture-templates): Add %f and %F escapes
(org-capture): Add more information to capture property list
(org-capture-fill-template): Handle %f and %F escapes
2011-01-07 15:28:57 +01:00
Carsten Dominik f9e174b74e Merge branch 't/patch490' 2010-12-20 15:50:04 +01:00
Carsten Dominik af33cb709a Fix bug with capture to datetree
* lisp/org-capture.el (org-capture-set-target-location): Use `current-time'.
2010-12-20 15:14:00 +01:00
Julien Danjou f73b121549 org-capture: use org-eval
* org-capture.el (org-capture-fill-template): Use org-eval.
2010-12-20 13:12:48 +01:00
Julien Danjou ce837d0e8f org: rework `org-set-property'
* org-capture.el (org-capture-fill-template): Use `org-set-property'
directly.

* org.el (org-set-property): Split property and values reading.
(org-read-property-name, org-read-property-value)
(org-set-property-function): New functions.
(org-property-set-functions-alist): New variable.

The goal of this patch is to introduce a special variable
`org-property-set-functions-alist'. This variable allows to read
properties values in a more intelligent way from `org-set-property' or
from `org-capture'.

For that, it simplifies the `org-set-property' code and remove
duplication between `org-capture' and `org-set-property'.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-12-17 18:37:30 +01:00
Carsten Dominik 8aacc708dd Capture: Better error message for invalid entry-type templates
* lisp/org-capture.el (org-capture-place-entry):
(org-capture-insert-template-here): Check tree for validity before
pasting it.
2010-12-16 16:51:04 +01:00
Carsten Dominik 7666ba421f Version number back to 7.4 2010-12-10 18:49:40 +01:00
Carsten Dominik 76a25715c9 Bump version number to 7.5 2010-12-10 18:43:10 +01:00
Carsten Dominik 970b2f7b88 Allow to jump to capture template after finalizing
* lisp/org-capture.el (org-capture-finalize): New prefix argument
STAY-WITH-CAPTURE.
(org-capture-refile): Improve docstring.
* doc/org.texi (Using capture): Document using prefix arguments for
finalizing capture.
2010-12-06 09:32:24 +01:00
Julien Danjou 13f066d66d org-capture: use org-today
* org-capture.el: Use org-today.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-12-01 00:50:08 +01:00
Allen S. Rout f8e6119131 New hook to run after finalizing capture, suitable for deleting a frame
* lisp/org-capture.el (org-capture-after-finalize-hook): New hook.
(org-capture-finalize): Run the new hook.

TINYCHANGE
2010-11-27 07:55:21 +01:00
Carsten Dominik 341e9ce1d7 Date tree capture with prompt for date
* doc/org.texi (Template elements): Document the new entry type.

* lisp/org-capture.el (org-capture-templates): Add new option to customize
type and docstring.
(org-capture-set-target-location): Interpret the file+datetree+prompt
entry.
2010-11-25 17:00:57 +01:00
Carsten Dominik dbc8a8ede1 Remove the autoload for org-capture-templates
This seems to have been causing than solving problems.
2010-11-12 16:26:48 -06:00
Bastien Guerry 6630edbd0f Set version number to 7.3 2010-11-07 14:52:14 +01:00
Carsten Dominik 82af72eef7 Push version number to 7.02trans 2010-10-29 09:11:46 +02:00
Carsten Dominik 7635429d44 New capture property :kill-buffer
* lisp/org-capture.el (org-capture-templates): New capture
property `:kill-buffer'. (org-capture-finalize): Kill target buffer
if that is desired.
(org-capture-target-buffer): Remember if we have to make the buffer.

Proposal by Samuel Wales.
2010-10-26 17:46:48 +02:00
Carsten Dominik 2a58795e19 Fix empty line bug in capture
* lisp/org-capture.el (org-capture-empty-lines-before):
(org-capture-empty-lines-after): Make sure the n=0 does not insert any
newlines.

Marcel van der Boom writes:

> I'm in the process of migrating from org-remember to org-capture.
> Pretty easy going so far, but it seems org-capture adds newlines, which
> I think it should not do.
>
> My (test) capture-template is:
>
> (("t" "Todo" entry
>  (file "~/.outlet/GTD.org")
>  "* TODO %?" :prepend t :empty-lines 0)
>
> with the intention of inserting the captured task on the
> first line of the file ~/.outlet/GTD.org. What happens when I capture
> an task is this:
>
> <beginning of file>
>
> * TODO Captured task
>
> <original first line of file here>
> ....
>
> Both before and after the task is a newline. Also, when capturing and
> cancelling the capture with C-c C-k the newlines remain whereas the
> task is removed.
2010-10-26 06:34:16 +02:00
Carsten Dominik a2c342308d Fix placing capture items at beginning of buffer.
* lisp/org-capture.el (org-capture-place-entry): If the first
line is already a headline, just stay there.

Patch by THomas Fuchs.
TINYCHANGE

> I'm trying to capture and file an entry as an top-level entry as first entry

> in an org file without config at the beginning (no "#+").
> This leads to filing the entry as _second_ headline in the org file.

> The template is:
> ("z" "test" entry (file "~/Data/z.org") "* %^{Note} %t  :NOTE:\n %?"
> :prepend t)
>
> I think this is due to jumping over lines starting with "#+" at the
> beginning of the org file
> (line 715 in org-capture.el (org-capture-place-entry)).
> My file has no config header and starts with the first headline. Calling
> outline-next-heading
> in this situation leads to jumping to the second headline in the file.
2010-10-16 07:17:00 +02:00
Carsten Dominik ed39b332fb Capture: Fix positioning error when :unnarrowed property is set
* lisp/org-capture.el (org-capture-place-entry): Move to `beg' before
searching for `%?'.
2010-10-11 08:26:26 +02:00
Carsten Dominik 2b3fa6ef3e Fix bug with capture template prompt history
* lisp/org-capture.el (org-capture-fill-template): Initialize history variable.
2010-09-30 13:12:12 +02:00
David Maus 215749b3d8 Widen to remove possible restrictions in target buffer
* org-capture.el (org-capture-place-template): Widen to remove
possible restrictions in target buffer.

Jules Bean wrote:
>If I run org-capture with the template:

>("t" "Todo" entry (file+headline
>"/Users/jules/work/TODO.org" "Tasks") "* TODO %?
>  (Captured at %u)
>  %i
>  %a
>")

>whilst I have narrowed (using, e.g., org-narrow-to-subtree) the buffer
>that contains TODO.org, a new "* Tasks" headline is inserted at the
>end of my narrowing and the new entry is added there, which messes up
>the hierarchy of the file.
2010-09-24 14:09:56 +02:00
David Maus 567201e56c Update doc string with new message date related escapes
* org-capture.el (org-capture-templates): Update doc string with new
message date related escapes.
2010-09-23 18:46:35 +02:00
Bastien Guerry d821c54aab Allow %:org-date for Gnus links.
* org-capture.el (org-capture-templates): update docstring
to advertize %:org-date.

* org-remember.el (org-remember-templates): update docstring
to advertize %:org-date.

* org-gnus.el (org-gnus-store-link): define %:org-date.

This was suggested by Sébastien Vauban.
2010-09-22 11:35:32 +02:00
David Maus 59fa0d12c8 Small fix in doc string
* org-capture.el (org-capture-templates): Small fix in doc string.
2010-09-12 18:45:04 +02:00
Carsten Dominik 8302e2b0d8 Fix read-only property removal bug
* lisp/org-capture.el (org-capture): Compute the length of the
correct string when removing properties.
2010-09-03 07:09:18 +02:00
Carsten Dominik d8498a40e8 Fix read-only issue with capture
* lisp/org-capture.el (org-capture): Remove read-only text properties
from capture text.
(org-capture-set-target-location): Throw an error if file+headline
target does not point into a file which is in Org mode.

Richard Riley writes:

> If I select a region in, in this case, an erc (emacs irc client)
> buffer in the read only section and then use my global keys to create
> a new item using the following "j" template while the text is still
> selected
>
> ("j" "Journal" entry
>  (file+datetree "journal.org")
>  "* %T %?\n  %i\n  %a")
>
> then I get the following backtrace :-
>
> Debugger entered--Lisp error: (error "Capture abort: (text-read-only)")
>  signal(error ("Capture abort: (text-read-only)"))
>  error("Capture abort: %s" (text-read-only))
>  byte-code("\301\302!\203\n
2010-09-02 11:35:21 +02:00
Nicolas Goaziou dae1ec63a9 org-fix-bullet-type is now org-list-repair. Created aliases for compatibility. 2010-09-01 19:05:53 +02:00
Nicolas Goaziou ff6c147ac6 Defined `org-item-beginning-re'. Org capture should recognize new lists.
* org-capture.el (org-capture-place-item): use `org-search-forward-unenclosed'
  and `org-search-backward-unenclosed' and new variable `org-item-beginning-re'.
* org-list.el (org-item-beginning-re): regexp matching beginning of an item.
2010-09-01 19:05:49 +02:00
Manish Sharma 2cf6136523 Allow "#" and "%" in tags
Patch largely from Manish, missing points added by Carsten
2010-08-31 08:25:20 +02:00
Carsten Dominik b212d2ed60 Align tags after capture template tags insertion
* lisp/org-capture.el (org-capture-fill-template): Align tags
after insertion.
2010-08-30 13:51:04 +02:00
Magnus Henoch bf0d8c5a0e org-capture + autoload
Jambunathan K <kjambunathan@gmail.com> writes:

> It would be convenient if I could do a
>
> M-x customize-group org-capture and/or
> M-x customize-variable org-capture-templates
>
> without having triggered a prior org-capture.
>
> For now, I trigger a capture, abort it and then proceed ahead with
> customizing these.

Here is a patch that adds an "autoload cookie" for
org-capture-templates.  After recompiling, org-install.el should contain
an autoload declaration for org-capture-templates.

Let's see if the patch tracker likes me :)

Magnus
2010-08-20 10:01:50 +02:00
Carsten Dominik 6da5c4525a Fix checkitem and item placement bugs in org-capture
* lisp/org-capture.el (org-capture-place-template): Handle the checkitem
case.
(org-capture-place-item): Provide boundaries for the search to make
sure we do not get a match in a different tree.
2010-08-16 10:24:13 +02:00
Bastien Guerry f0be9ff91b Bugfix: tiny typo in org-capture.el. 2010-08-11 15:08:45 +02:00
Carsten Dominik 0633c6aa09 Capture: Fix indentation of %i 2010-08-11 11:10:02 +02:00
Noorul Islam 0ac2a69836 org-capture: Make messages consistent.
A very small patch that makes the message displayed consistent.

* lisp/org-capture.el (org-capture-finalize):
  Make messages consistent.
2010-07-31 18:41:52 +02:00
John Wiegley 3ee6b99f06 Added a missing call to (goto-char (point-min)) 2010-07-28 21:05:50 -04:00
Bernt Hansen 95212c2202 Fix clocking on capture completion
* lisp/org-capture.el (org-capture-finalize): Fix clock in of interrupted
task during capture finalize

Calling org-capture-get inside the org-with-point-at macro does not
work when the current clocking task and the capture target buffer are
the same.  In this case the captured task would continue clocking
instead of switching back to the previously clocking task.
2010-07-28 02:35:38 -04:00
Carsten Dominik e3b93cda2e Capture: Default template when no capture templates are defined
* lisp/org-capture.el (org-capture-target-buffer): Throw an error
if we have no target file.
(org-capture-select-template): Use a default template if the user has
not specified any.
2010-07-21 08:28:20 +02:00
Carsten Dominik cee04fa632 Make org-capture use `org-default-notes-file' if the file is not specified
* lisp/org-macs.el (org-string-nw-p): New function.
* lisp/org-capture.el (org-capture-import-remember-templates): Interpret
an empty string as request to use `org-default-notes-file'.
(org-capture-target-buffer): If the FILE is not a (non-empty) string,
use `org-default-notes-file'.
2010-07-20 09:05:31 +02:00
Carsten Dominik 347c8ebe34 Fix customize type for capture template function
* lisp/org-capture.el (org-capture-templates): Fix customize type
2010-07-19 14:42:06 +02:00
Carsten Dominik 6268cceec3 Mention release 7.01 on the website, push release number to 7.01trans 2010-07-19 08:33:24 +02:00
Carsten Dominik aaea4a8dbf Capture: Change order of escape processing
* lisp/org-capture.el (org-capture-fill-template): Do inserting file
contents and expanding sexp escapes first, so that further escape
processing can happen in the inserted text.

This was a request by Sebastian Rose.
2010-07-18 07:37:52 +02:00
Philip Rooke 254740cb9c Correct some docstrings
This patch makes some straightforward corrections to a number of
docstrings.  Each change is normally to:

- correct a typo, or
- fix up hyperlinks to function or variable names, or
- ensure slightly better conformance with the documentation guidelines
  and tips given in the Elisp manual

No attempt is made to provide missing docstrings or document arguments.

Cheers,

Phil
2010-07-15 19:04:38 +02:00
Carsten Dominik 0791edd54a Capture, fix template files again
Note to self: Next time, just trust David ... :-)
2010-07-14 21:59:53 +02:00
Carsten Dominik bca27d9215 Capture: Fix the case of using a template file
* lisp/org-capture.el (org-capture-set-plist): Make sure txt is a string
before calling `string-match'.
(org-capture-templates): Fix customization type.

Modified from a patch proposal by Johan Friis.

TINYCHANGE
2010-07-14 11:03:27 +02:00
Carsten Dominik cb1ab577a2 Fix bookmarking the capture position
* lisp/org-capture.el (org-capture-refile): Do not try to manipulate
bookmark list.
* lisp/org.el (org-refile): Use the correct bookmark here.
2010-07-13 14:12:45 +02:00
David Maus 4c1b83e899 Check if `org-capture-link-is-already-stored' is bound before evaluating.
* org-capture.el (org-capture): Check if
`org-capture-link-is-already-stored' is bound before evaluating.

If `org-protocol-capture' is the first function that calls
`org-capture', this variable is locally bound while it is globally
unbound. I.e. org-capture.el was not loaded before, the defvar not
evaluated.  If `org-protocol-capture' exits, Emacs restores the global
value, which is void.
2010-07-09 10:06:50 +02:00
Philip Rooke 7add6fd51d The docstring of org-capture-templates
A few minor corrections and suggestions for the org-capture-templates
docstring
2010-07-08 06:41:53 +02:00
Carsten Dominik b6305c713c Make sure going to last capture also works after refile 2010-07-06 12:49:41 +02:00
Carsten Dominik 2235ecb422 Fix bug in getting template from file or function 2010-07-06 12:49:35 +02:00
Carsten Dominik c80d5b9c27 Capture: Expand template file name 2010-07-06 09:44:31 +02:00
Carsten Dominik 75192f263e Allow capture template to come from a file or from a function call
* lisp/org-capture.el (org-capture-templates): Allow the template
to come from a file or function call.
(org-capture-place-entry): Get the template from file or function.
2010-07-06 09:41:01 +02:00
Stephen Eglen 27a4e48b0a Small doc fixes to org-feed.el and org-capture.el 2010-07-05 15:07:53 +02:00
Carsten Dominik 9e9bc16476 Capture: fix the function target 2010-07-05 08:53:48 +02:00
Carsten Dominik 8b7c742750 Capture: Put final touched to file+regexp & file+function targets
* lisp/org-capture.el (org-capture-set-target-location): Store
exact positions for file+regexp and file+function targets.
(org-capture-place-entry, org-capture-place-item)
(org-capture-place-table-line, org-capture-place-plain-text): Respect
exact positions.
(org-capture-finalize): Make sure we are at the beginning of a line
when fixing the empty lines after the entry.
2010-07-05 08:25:51 +02:00
Carsten Dominik d0fa608267 Capture: Respect time-of-day preference in interactive template prompt.
* lisp/org-capture.el (org-capture-fill-template): Respect
time-of-day preference in template prompt.

In an interactive time prompt in a capture template, the users
preference of getting a stamp with time was not respected.

Reported by Markus Heller
2010-07-02 09:08:29 +02:00
Carsten Dominik 0ed29448aa Keep byte compiler happy 2010-07-01 15:54:29 +02:00
Carsten Dominik 14f05b4461 Capture: Fix bug in file+function target specification
* lisp/org-capture.el (org-capture-set-target-location): Fix
file+function interpretation.
2010-07-01 15:43:43 +02:00
Carsten Dominik d537c10964 Capture: Better error handling and better return-to-last-stored
* lisp/org-capture.el (org-capture-position-for-last-stored):
org-capture-bookmark-last-stored-position): New functions.
(org-capture-place-table-line): Better error catching.
(org-capture-place-item):
(org-capture-place-entry):
(org-capture-place-plain-text): Call
`org-capture-position-for-last-stored'.
(org-capture-finalize): Just call
`org-capture-bookmark-last-stored-position'.
2010-06-29 09:16:04 +02:00
Carsten Dominik f63d977c8b Better capturing of error when aborting capture 2010-06-27 12:26:08 +02:00
Carsten Dominik a77dce0eac Do not set the file name of the temporary buffer during capture 2010-06-27 08:33:16 +02:00
Carsten Dominik 2b26cb4e4e Fix bug with regexp target definition
Patch by Juan Pechiar
2010-06-25 20:53:15 +02:00