Commit Graph

271 Commits

Author SHA1 Message Date
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