Commit Graph

360 Commits

Author SHA1 Message Date
Feng Shu b4422add37 org-capture: Do not save buffer when running `org-capture-finalize'
* lisp/org-capture.el (org-capture-finalize): Do not run
  `save-buffer'.
2018-04-16 12:11:00 +02:00
Nicolas Goaziou 52ba1a27ad Merge branch 'maint' 2018-04-11 23:03:01 +02:00
Nicolas Goaziou d20fc4d7c5 org-capture: Properly handle `org-extend-today-until' in templates
* lisp/org-capture.el (org-capture-set-target-location): Handle
  non-default `org-extend-today-until'.

Reported-by: Robert Irelan <rirelan@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-04/msg00023.html>
2018-04-11 23:01:16 +02:00
Rasmus 06ab656f42 org-macs: Move org-mks from org-capture to org-macs
* lisp/org-capture.el (org-mks): Moved to org-macs.el.
* lisp/org-macs.el (org-mks): Added from org-capture.el.

The move is being done to accommodate the usage of org-mks in other
Org libraries.
2018-04-07 13:03:18 +02:00
Bastien 8548dfa33f Merge branch 'maint' 2018-03-20 12:38:31 +01:00
Bastien b2d3dbabf7 org-capture.el: Fix docstring
* lisp/org-capture.el (org-capture-templates-contexts): Fix docstring.
2018-03-20 12:38:24 +01:00
Nicolas Goaziou 0de818964d Merge branch 'maint' 2018-03-11 19:22:25 +01:00
Nicolas Goaziou 2f587d496f org-capture: Prevent spurious blank line during capture
* lisp/org-capture.el (org-capture-place-entry): Prevent spurious
  blank line during capture.

Reported-by: Luke <mideniko1234-org@yahoo.co.uk>
<http://lists.gnu.org/r/emacs-orgmode/2018-03/msg00075.html>
2018-03-11 19:21:29 +01:00
Nicolas Goaziou 6e10c268de Merge branch 'maint' 2018-02-24 22:01:32 +01:00
Nicolas Goaziou 65d6d3b043 org-capture: Silence byte-compiler 2018-02-24 22:01:04 +01:00
Nicolas Goaziou 79b36b6a8d Merge branch 'maint' 2018-02-21 15:04:37 +01:00
Nicolas Goaziou 6655429b8d org-capture: Refresh clock mode line when finalizing capture
* lisp/org-capture.el (org-capture-finalize): Refresh clock mode line.
* lisp/org-clock.el (org-clock--mode-line-heading): New function.
(org-clock-get-clock-string): Small refactoring.
(org-clock-update-mode-line): Add optional argument. Use new function.
(org-clock-in): Use new function.
2018-02-21 15:02:33 +01:00
Nicolas Goaziou 0155441358 Merge branch 'maint' 2018-01-19 18:22:00 +01:00
Tim Landscheidt b289a65be7 Use https for links to orgmode.org
TINYCHANGE
2018-01-19 18:14:58 +01:00
Nicolas Goaziou 4dbb4a76a7 Implement `org-show-all'
* lisp/org.el (org-show-all): New function.
(org-cycle):
(org-cycle-internal-global):
(org-global-cycle):
(org-set-startup-visibility):
(org-set-outline-overlay-data):
(org-hide-block-all):
(org-mode-hook):
(org-tree-to-indirect-buffer):
(org-sort-entries):
(org-mode-map):
(org-org-menu):
* lisp/ob-lilypond.el (org-babel-lilypond-mark-error-line):
* lisp/org-archive.el (org-archive-subtree):
* lisp/org-capture.el (org-capture-place-template):
* lisp/org-mouse.el (org-mouse-popup-global-menu):
* lisp/ox-org.el (org-org-publish-to-org):
* testing/org-test.el (org-test-at-id):
(org-test-in-example-file): Use new function.

* lisp/org-compat.el (org-show-block-all): Mark as obsolete.
2018-01-10 15:58:21 +01:00
Nicolas Goaziou ec6813157e org-capture: Demote error when capturing `file+headline' in non-Org buffers
* lisp/org-capture.el (org-capture-set-target-location): Warn when
  capturing a `file+headline' target and buffer is not in Org mode.

Fixes: 22352
2018-01-02 12:40:54 +01:00
Nicolas Goaziou 45c4502713 org-capture: Re-introduce history list per prompt
* lisp/org-capture.el (org-capture--prompt-history-table):
(org-capture--prompt-history): New variables.

(org-capture-fill-template): Handle history list per prompt.

Reported-by: Karl Eichwalder <ke@gnu.franken.de>
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00251.html>
2017-11-29 15:09:44 +01:00
Xavier Martinez-Hidalgo f38a7d433b org-capture: Fix aborting after inserting text at end of buffer
* lisp/org-capture.el (org-capture-mark-kill-region): Set end marker
  insertion type so that it advances when inserting text at the end of
  the capture buffer.

* testing/lisp/test-org-capture.el (test-org-capture/insert-at-end-abort):
  Add test case.

Inserting text at the end of the capture buffer does not advance the
end kill marker.  This causes the narrowing region and the kill
markers to get out of sync, which prevents 'org-capture-finalize' from
correctly cleaning the target buffer when aborting the capture.

Setting the kill end marker insertion type fixes this.

TINYCHANGE
2017-11-03 22:20:11 +01:00
Matt Lundin ce536f6375 Fix interactive timestamp entry in capture templates
* lisp/org-capture.el: (org-capture-fill-template) Fix interactive
  timestamp entry to match the behavior of org-time-stamp. This fixes
  a bug related to the %^t and %^u template escapes which resulted in
  incorrect timestamps (<2017-10-06 Fri-12:00>). The difference
  between %^t and %^T now corresponds to the difference between
  org-time-stamp called without and with a prefix argument.
2017-10-06 19:13:57 +02:00
Paul Eggert ff0dcf52a5 Backport commit bc511a64f from Emacs
Prefer HTTPS to FTP and HTTP in documentation
bc511a64f6da9ab51acc7c8865e80c4a4cb655c2
Paul Eggert
Wed Sep 13 15:54:37 2017 -0700
2017-09-17 00:28:38 -04:00
Matt Lundin 2dfbafa4a9 Ensure that top-level capture targets are pasted at level 1
* lisp/org-capture.el: (org-capture-place-entry) Ensure that level is
  set to 1 (i.e., the top level) if there is no headline target
  defined. Otherwise, captured items are improperly nested by context.
2017-09-10 09:39:24 +02:00
Nicolas Goaziou 8a0c89244d Merge branch 'maint' 2017-08-31 23:15:56 +02:00
Nicolas Goaziou 1654a5a98a Fix `:jump-to-captured' when refiling a capture target
* lisp/org-capture.el (org-capture-refile): Call
  `org-capture-goto-last-stored' at the appropriate time.

* testing/lisp/test-org-capture.el (test-org-capture/refile): Add
  test.

Reported-by: "Raymond Zeitler" <zeitra@yahoo.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00704.html>
2017-08-31 23:14:04 +02:00
Nicolas Goaziou 489346c1d5 Merge branch 'maint' 2017-08-25 21:51:56 +02:00
Nicolas Goaziou 51b431d013 org-capture: Fix "org-capture: Fix %^T and %^U placeholders"
* lisp/org-capture.el (org-capture-fill-template): Fix
  2ff3101c0e.
2017-08-25 21:51:04 +02:00
Nicolas Goaziou b47de25062 Merge branch 'maint' 2017-08-23 10:30:33 +02:00
Nicolas Goaziou 2ff3101c0e org-capture: Fix %^T and %^U placeholders
* lisp/org-capture.el (org-capture-fill-template): Fix %^T and %^U
  placeholders.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-08/msg00528.html>
2017-08-23 10:28:39 +02:00
Nicolas Goaziou 71aabd9db7 Merge branch 'maint' 2017-08-06 01:55:26 +02:00
Michaël Cadilhac 1f6f46aa69 org-capture.el: Document what the time stamp is in capture templates
* lisp/org-capture.el (org-capture-templates): Make explicit that the time
stamp aware %-escapes are influenced by `org-capture-use-agenda-date'.

TINYCHANGE
2017-08-06 01:44:23 +02:00
Nicolas Goaziou e59718e9c3 Merge branch 'maint' 2017-07-14 10:40:47 +02:00
Nicolas Goaziou 8d9854ca8a org-capture: Fix last commit
* lisp/org-capture.el (org-capture-fill-template): %K link
  specifically targets a headline.  Also provide a description.
2017-07-14 10:40:03 +02:00
Nicolas Goaziou 0c9feb660a Merge branch 'maint' 2017-07-13 14:26:12 +02:00
Nicolas Goaziou 3315bd1118 org-capture: Fix %k and %K in capture template
* lisp/org-capture.el (org-capture-fill-template): Fix link returned
  by %K.  Also, both %k and %K should be expanded as strings even when
  there is no clocking data.

Reported-by: Michal Politowski <mpol@meep.pl>
2017-07-13 14:08:20 +02:00
Nicolas Goaziou dd757f14f0 Merge branch 'maint' 2017-07-02 09:20:35 +02:00
Nicolas Goaziou 796a78222a Move an obsolete declaration in "org-compat.el"
* lisp/org-compat.el (org-capture-import-remember-templates): Moved
  from "org-capture.el".
2017-07-02 09:19:09 +02:00
Nicolas Goaziou 602a1a21fc Merge branch 'maint' 2017-06-30 14:36:30 +02:00
Nicolas Goaziou 4f90f44af3 org-capture: Fix blank lines in `item' target type
* lisp/org-capture.el (org-capture-place-item): Fix blank lines in
  `item' target type.
2017-06-30 13:50:39 +02:00
Nicolas Goaziou 04403b446a org-capture: Fix regression in item templates
* lisp/org-capture.el (org-capture-place-item):

Fix regression introduced in d6f096546.

Reported-by: Alan Schmitt <alan.schmitt@polytechnique.org>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00591.html>

Reported-by: Florian Lindner <mailinglists@xgm.de>
<http://lists.gnu.org/archive/html/emacs-orgmode/2017-06/msg00606.html>
2017-06-30 13:27:38 +02:00
Nicolas Goaziou ed291a4a91 Merge branch 'maint' 2017-06-02 09:23:03 +02:00
Nicolas Goaziou 57d0a7453d org-capture: Fix visibility of planning line in capture buffer
* lisp/org-capture.el (org-capture-place-entry): Make sure planning
  line is visible when added in a narrowed capture buffer.  Refactor
  code.

Reported-by: Detlef Steuer <steuer@unibw-hamburg.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/113756>
2017-06-02 09:21:44 +02:00
Nicolas Goaziou a023b31e48 Merge branch 'maint' 2017-05-23 18:15:42 +02:00
Nicolas Goaziou d6f096546e org-capture: Fix number of blank lines with :unnarrowed option
* lisp/org-capture.el (org-capture-finalize): Remove blank lines
  number fix, which only applies to narrowed capture buffers.
(org-capture-insert-template-here):
(org-capture-place-plain-text):
(org-capture-place-item):
(org-capture-place-entry): Do not hard-code number of blank lines
after entry.

Reported-by: Igor Perepelytsya <igorquail@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113093>

Reported-by: Jay Dresser <jay@jaydresser.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/113449>
2017-05-23 18:10:06 +02:00
Yuri D. Lensky 9e4a1704ab org-capture.el: Fix handling of variable capture location
* lisp/org-capture.el (org-capture-expand-file): Fix handling of
  variable capture location.
2017-05-19 16:07:27 +02:00
Nicolas Goaziou 1dfdb81932 Merge branch 'maint' 2017-04-17 20:04:42 +02:00
Nicolas Goaziou 68f60dbdd5 org-capture: Fix typo
* lisp/org-capture.el (org-capture-fill-template): Fix typo introduced
  in last commit.

Reported-by: Kaushal Modi <kaushal.modi@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/113126>
2017-04-17 20:04:09 +02:00
Nicolas Goaziou ea3754f168 Merge branch 'maint' 2017-04-17 14:19:12 +02:00
Nicolas Goaziou 03873f070c org-capture: Fix clipboard history with %^C or %^L place holders
* lisp/org-capture.el (org-capture--clipboards): New variable.
(org-capture-fill-template): Use new variable.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://permalink.gmane.org/gmane.emacs.orgmode/113020>
2017-04-17 14:18:06 +02:00
Nicolas Goaziou 2ff038da31 org-capture: Tiny refactoring
* lisp/org-capture.el (org-capture-set-target-location): Use
  `point-marker'.  Also remove trailing space.
2017-03-17 08:26:29 +01:00
Carsten Dominik 0f1b5ec496 Consolidate capture targets and allow outline path in datetree targets
* doc/org.texi: Document the new capture templates target.
* lisp/org-capture.el (org-capture-upgrade-templates): New function.
(org-capture-templates): Implement the new file+olp+datetree target.
(org-capture): Document the C-1 prefix.
(org-capture-sanitize-olp): New function.
(org-capture-select-template): Make sure upgraded version of templates
variable is used.
* lisp/org-datetree.el (org-datetree-find-date-create): Accept
`subtree-at-point' as a value for the KEEP-RESTRICTION argument.
(org-datetree-find-iso-week-create): Accept `subtree-at-point'
as a value for the KEEP-RESTRICTION argument.
* lisp/org.el (org-find-olp): Throw an error when called in a
buffer that is not in Org mode.
* lisp/org-capture.el (org-capture-fill-template): Use overriding time
also in `?<>' escapes.
2017-03-16 08:18:55 +01:00
Nicolas Goaziou c41c2be339 Merge branch 'maint' 2017-03-14 09:07:55 +01:00