Commit Graph

322 Commits

Author SHA1 Message Date
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
Nicolas Goaziou 92ee4d06a2 org-capture: Fix escaping characters in template embedded S-exps
* lisp/org-capture.el (org-capture-fill-template): Escape backslash
  characters in %i contents when those are inserted within a S-exp.
  Also prevent adding any prefix to %i contents spanning over multiple
  lines when they are inserted within a S-exp.

* testing/lisp/test-org-capture.el (test-org-capture/fill-template):
  Add tests.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112232>
2017-03-14 09:03:59 +01:00
Nicolas Goaziou 83f5c8962f Merge branch 'maint' 2017-02-23 12:59:45 +01:00
Nicolas Goaziou da80e6c6ab org-capture: Tiny refactoring
* lisp/org-capture.el (org-capture-refile): Tiny refactoring.
2017-02-23 12:59:24 +01:00
Bastien cfadbc3761 Merge branch 'maint' 2017-02-21 15:42:12 +01:00
Bastien df506794db org-capture: Fix commit 7d7c38 2017-02-21 15:41:15 +01:00
Nicolas Goaziou d1577d1e1b Merge branch 'maint' 2017-02-19 15:37:41 +01:00
Nicolas Goaziou 7d7c38c6b1 org-capture: Fix `org-capture-refile'
* lisp/org-capture.el (org-capture-refile): Preserve location of point
  when refiling.

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

Reported-by: Liu Hui <liuhui1610@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/112202>
2017-02-19 15:37:12 +01:00
Nicolas Goaziou 5edc17ef73 Merge branch 'maint' 2017-01-31 22:52:43 +01:00
Nicolas Goaziou 426bce6a83 org-capture: Small fix
* lisp/org-capture.el (org-mks): Find entries with full prefix, not
last pressed key.

This fixes a bug introduced in 8194e7b09.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/111779>
2017-01-31 22:50:09 +01:00
Nicolas Goaziou 9cb36f1982 Merge branch 'maint' 2017-01-30 23:43:14 +01:00
Nicolas Goaziou 8194e7b09d org-capture: Fix freeze when capture templates are ill-defined
* lisp/org-capture.el (org-mks): Do not freeze when there is a missing
  step in the key hierarchy.  Fix docstring.  Refactor code for clarity.

Reported-by: Roland Everaert <reveatwork@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/111716>
2017-01-30 23:36:52 +01:00
Nicolas Goaziou 235d3c5e45 Merge branch 'maint' 2017-01-11 11:58:51 +01:00
Nicolas Goaziou 71890398cd org-capture: Fix :jump-+to-captured when `org-capture-bookmark' is nil
* lisp/org-capture.el (org-capture-bookmark-last-stored-position):
  Rename to ...
(org-capture-store-last-position): ... this.  Also store last position
unconditionally.
* lisp/org-capture.el (org-capture-finalize): Apply renaming.
2017-01-11 09:52:57 +01:00
Nicolas Goaziou 6a49de8862 org-capture: Improve error message for date/weektree capture
* lisp/org-capture.el (org-capture-set-target-location): Raise an
  error when target location is not an Org buffer.

Reported-by: Simao <smm@imap.cc>
<http://permalink.gmane.org/gmane.emacs.orgmode/111320>
2017-01-11 09:17:18 +01:00
Nicolas Goaziou 0ca32a2838 org-table: Remove command status for some functions
* lisp/org-table.el (org-table-current-column):
(org-table-current-dline): Do not allow to call these functions
interactively.  `org-table-field-info' should be used instead.
* lisp/org-capture.el (org-encrypt-entry): Silence byte-compiler.
2017-01-09 00:30:41 +01:00
Kyle Meyer 0d3683f2cd Merge branch 'maint' 2017-01-05 20:23:58 -05:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05:00
Nicolas Goaziou 8dc2d77678 Merge branch 'maint' 2016-11-07 01:16:29 +01:00
Nicolas Goaziou 13dbea95af Fix documentation
* doc/org.texi (Installation):
(Feedback):
(Handling links):
(Setting tags):
(Matching tags and properties):
(Storing searches):
(The very busy C-c C-c key):
(org-crypt):
(Adding hyperlink types):
* lisp/org-agenda.el (org-agenda-todo-ignore-deadlines):
(org-agenda-show-inherited-tags):
(org-agenda-week-view):
(org-agenda-fortnight-view):
(org-agenda-month-view):
(org-agenda-year-view):
* lisp/org-archive.el (org-archive-to-archive-sibling):
* lisp/org-capture.el (org-capture-templates):
* lisp/org-table.el:
* lisp/org.el (org-startup-folded):
(org-tag-alist):
(org-match-sparse-tree): Provide more accurate documentation.

Reported-by: Jorge Morais Neto <jorge13515@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/110080>
2016-11-07 01:14:04 +01:00
Nicolas Goaziou 88a3c2483e org-capture: Improve error handling for file locations
* lisp/org-capture.el (org-capture-expand-file): Return an error on
  invalid locations.
(org-capture-target-buffer): Remove useless checks.
2016-11-06 11:20:25 +01:00
Nicolas Goaziou dc3c69918f org-capture: Remove error checking in capture template
* lisp/org-capture.el (org-capture-expand-file): Remove error checking
  in capture template introduced in
  b89dfaa904 for now.
2016-11-06 11:10:23 +01:00
Nicolas Goaziou 958eacdf22 org-capture: Small refactoring
* lisp/org-capture.el (org-capture-set-target-location): Refactor using
  pattern-matching for clarity.
2016-11-06 09:29:09 +01:00
Nicolas Goaziou bd061b91f3 Merge branch 'maint' 2016-11-06 08:59:47 +01:00
Nicolas Goaziou b89dfaa904 org-capture: Fix file+olp target with a relative file name
* lisp/org-capture.el (org-capture-expand-file): Expand relative file
  names from `org-directory'
(org-capture-target-buffer): Apply change above.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://permalink.gmane.org/gmane.emacs.orgmode/110075>
2016-11-06 08:56:22 +01:00
Nicolas Goaziou f5645675a3 Disallow S-exp in capture templates
* lisp/org-capture.el (org-capture-expand-file): Disallow S-exp.
(org-capture-templates):
* doc/org.texi (Template elements): Update documentation.

A function is equivalent to using S-exp, without tainting code with an
yet another call to `eval'.
2016-11-04 17:41:27 +01:00
Nicolas Goaziou c81f9fff3b Revert "org-capture: Remove forbidden value type from "file" templates"
This reverts commit 5485170263.
2016-11-04 17:30:12 +01:00
Nicolas Goaziou e4c38ab1d3 Improve documentation for capture templates
* doc/org.texi (Template expansion):
* lisp/org-capture.el (org-capture-templates): Clarify documentation.

Suggested-by: Stig Brautaset <stig@brautaset.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/109844>
2016-10-19 19:23:31 +02:00
Nicolas Goaziou 0cf58cc208 Improve docstrings
* lisp/ob-core.el (org-confirm-babel-evaluate):
(org-babel-no-eval-on-ctrl-c-ctrl-c):
(org-babel-hash-at-point):
* lisp/org-agenda.el (org-agenda-custom-commands):
(org-stuck-projects):
(org-agenda):
(org-timeline):
(org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-log-mode):
(org-agenda-refile):
(org-agenda-show-and-scroll-up):
(org-agenda-tree-to-indirect-buffer):
(org-agenda-show-the-flagging-note):
(org-agenda-to-appt):
* lisp/org-capture.el (org-capture-mode):
(org-capture-use-agenda-date):
(org-capture):
* lisp/org-clock.el (org-clock-in):
(org-clock-display):
* lisp/org-colview.el (org-columns--display-here):
(org-columns):
* lisp/org-footnote.el (org-footnote-section):
* lisp/org-gnus.el (org-gnus-prefer-web-links):
* lisp/org-lint.el (org-lint):
* lisp/org-list.el (org-plain-list-ordered-item-terminator):
(org-list-allow-alphabetical):
(org-list-automatic-rules):
(org-list-use-circular-motion):
* lisp/org-protocol.el (org-protocol-store-link):
(org-protocol-create-for-org):
* lisp/org-src.el (org-src-preserve-indentation):
(org-edit-src-content-indentation):
(org-src-mode-hook):
(org-src-mode):
(org-edit-table.el):
(org-edit-export-block):
(org-edit-src-code):
(org-edit-fixed-width-region):
* lisp/org-table.el (org-table-automatic-realign):
(org-table-copy-increment):
(org-table-formula-evaluate-inline):
(org-table-allow-automatic-line-recalculation):
(org-table-edit-field):
(orgtbl-ascii-plot):
* lisp/org-timer.el (org-timer):
* lisp/org.el (org-deadline-string):
(org-comment-string):
(org-ellipsis):
(org-show-context-detail):
(org-indirect-buffer-display):
(org-cycle-global-at-bob):
(org-insert-heading-respect-content):
(org-enable-table-editor):
(org-context-in-file-links):
(org-display-internal-link-with-indirect-buffer):
(org-file-apps):
(org-refile-targets):
(org-todo-keywords):
(org-use-fast-todo-selection):
(org-treat-insert-todo-heading-as-state-change):
(org-time-clocksum-use-fractional):
(org-time-clocksum-use-effort-durations):
(org-agenda-files):
(org-cycle-hide-archived-subtrees):
(org-cycle):
(org-global-cycle):
(org-tree-to-indirect-buffer):
(org-insert-heading):
(org-store-link):
(org-insert-link):
(org-mark-ring-push):
(org-refile):
(org-todo):
(org-show-todo-tree):
(org-reveal):
(org-check-deadlines):
(org-switchb):
(org-cdlatex-mode):
(org-toggle-latex-fragment):
(org-ctrl-c-ctrl-c):
(org-toggle-heading):
(org-indent-line):
(org-yank):
(org-speedbar-set-agenda-restriction):
* lisp/ox-html.el (org-html-htmlize-output-type):
* lisp/ox-icalendar.el (org-icalendar-combined-agenda-file):
* lisp/ox-publish.el (org-publish-project-alist):
* lisp/ox.el (org-export-in-background):
(org-export-stack-mode):
(org-export--stack-source-at-point):
(org-export-dispatch): Improve quotes and formatting in docstrings.
2016-10-15 17:43:54 +02:00
Nicolas Goaziou 0c0bc84190 Change "Org-mode" into "Org mode"
* lisp/org-agenda.el:
* lisp/org-attach.el:
* lisp/org-bbdb.el:
* lisp/org-capture.el:
* lisp/org-clock.el:
* lisp/org-entities.el:
* lisp/org-gnus.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-info.el:
* lisp/org-inlinetask.el:
* lisp/org-irc.el:
* lisp/org-list.el:
* lisp/org-mhe.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/ox-html.el:
* lisp/ox-odt.el: Use "Org mode", or "Org", instead of "Org-mode".
2016-10-11 18:00:08 +02:00
Nicolas Goaziou 2e4b66f5f5 Fix some `cl-case' uses
* lisp/org-capture.el (org-capture-finalize):
* lisp/org-timer.el (org-timer-set-mode-line): Symbols need not be
  quoted in `cl-case'.
2016-09-25 21:08:36 +02:00
Aaron Ecay 140aacbf2f Use ‘eq’ instead of ‘equal’ for symbols
* lisp/ob-C.el (org-babel-C-val-to-C-type):
* lisp/ob-core.el (org-babel-get-colnames):
(org-babel-disassemble-tables):
* lisp/ob-lua.el (org-babel-lua-var-to-lua):
(org-babel-lua-table-or-string):
* lisp/ob-python.el (org-babel-python-var-to-python):
(org-babel-python-table-or-string):
* lisp/ob-ruby.el (org-babel-ruby-var-to-ruby):
(org-babel-ruby-table-or-string):
* lisp/ob-shell.el (org-babel-sh-var-to-string):
* lisp/ob-sqlite.el (org-babel-sqlite-table-or-scalar):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-compile-prefix-format):
* lisp/org-bibtex.el (org-bibtex-headline):
* lisp/org-capture.el (org-capture):
* lisp/org-colview.el (org-columns-next-allowed-value):
* lisp/org-mhe.el (org-mhe-store-link):
(org-mhe-get-message-real-folder):
(org-mhe-get-message-folder):
(org-mhe-get-message-num):
(org-mhe-get-header):
(org-mhe-follow-link):
* lisp/org-table.el (org-define-lookup-function):
* lisp/org.el (format-spec):
* lisp/ox-odt.el (org-odt--translate-description-lists):
* lisp/ox-publish.el (org-publish-compare-directory-files):
Use `eq' instead of `equal' when comparing to symbols.
* lisp/org-timer.el (org-timer-set-mode-line):
* lisp/org-capture.el (org-capture-finalize):
Use `cl-case' instead of `(cond ((eq x 'foo) ...) ...)'.
2016-09-25 16:29:06 +01:00
Aaron Ecay 48e7f17bc6 Use assq instead of assoc with quoted symbols
* lisp/ob-core.el (org-babel-merge-params):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-agenda-to-appt):
* lisp/org-capture.el (org-capture-finalize):
* lisp/org.el (org-find-invisible-foreground):
(org-open-file):
(org-todo-trigger-tag-changes):
(org-back-over-empty-lines):
* lisp/ox-odt.el (org-odt-get-table-cell-styles):
Use assq instead of assoc with quoted symbols.
2016-09-23 11:20:55 +01:00
Aaron Ecay f7c01f217b Add obsolescence warning
* lisp/org-capture.el (org-capture-import-remember-templates):
Add obsolescence warning.
2016-09-03 02:11:18 +01:00
Aaron Ecay 1c18efb615 String handling improvements.
* lisp/org-agenda.el (org-agenda-export-csv-mapper): Use `replace-regexp-in-string'.
* lisp/org-capture.el (org-capture): Use `string-prefix-p'.
* lisp/org-compat.el (string-blank-p, string-remove-prefix):
* lisp/org-compat.el (string-remove-suffix): Add compatibility defuns
for emacs 24.3.
* lisp/org-datetree.el (org-datetree-cleanup): Use `string-suffix-p'.
* lisp/org-footnote.el (org-footnote-normalize-label): Use
`string-remove-prefix'.
* lisp/org-gnus.el (org-gnus-group-link): Use `string-prefix-p'.
* lisp/org-list.el (org-list-struct):
(org-list-get-list-type, org-list-send-item):
(org-list-use-alpha-bul-p): Use `string-match-p'.
* lisp/org.el (org-paste-subtree): Use `string-suffix-p'.
(org-open-file, org-refile-get-targets): Use `replace-regexp-in-string'.
(org-make-tags-matcher): Use `string-prefix-p'.
(org-set-tags): Use `string-(prefix,suffix)-p'.
* lisp/ox-beamer.el (org-beamer--element-has-overlay-p):
(org-beamer--format-block):
Use `string-(prefix,suffix)-p'.
* lisp/ox-html.el (org-html-fix-class-name): Use `replace-regexp-in-string'.
* lisp/ox-md.el (org-md-verbatim): Use `string-(prefix,suffix)-p'.
(org-md-paragraph): Use `string-prefix-p'.
2016-09-03 02:05:10 +01:00
Aaron Ecay ab04bab4d6 Use org-with-wide-buffer where appropriate
* lisp/org-agenda.el (org-agenda-get-some-entry-text):
(org-agenda-refile, org-agenda-open-link):
(org-agenda-change-all-lines, org-agenda-clock-out):
* lisp/org-capture.el (org-capture-refile):
(org-capture-bookmark-last-stored-position):
* lisp/org-clock.el (org-with-clock-position):
(org-clock-in):
* lisp/org-table.el (org-table-recalculate-buffer-tables):
(org-table-iterate-buffer-tables):
* lisp/org.el (org-table-map-tables):
(org-outline-overlay-data, org-refresh-properties):
(org-refresh-stats-properties, org-offer-links-in-entry):
(org-refile, org-refile-check-position):
(org-refile-new-child, org-map-entries):
(org-find-exact-headline-in-buffer):
(org-reftex-citation, org-imenu-get-tree):
Use `org-with-wide-buffer'.
2016-09-03 01:44:58 +01:00
Nicolas Goaziou de24694f05 Turn org-mode into Org or Org mode
Use Org or Org mode instead of org-mode or Org-mode according to
"Documentation standards".
2016-08-23 22:13:56 +02:00
Nicolas Goaziou 71a3331aaf Move org-eww to core
* lisp/org-eww.el: Move file from contrib/lisp/ to lisp/.
* lisp/org.el (org-modules): Apply change.
* lisp/org-capture.el (org-capture-templates):
* doc/org.texi: Document changes.
2016-08-20 02:59:56 +02:00
Nicolas Goaziou d2de890d3e org-capture: Remove history for template completion
* lisp/org-capture.el (org-capture-fill-template): Remove history
  variable, which is not strictly necessary and relies, in its current
  implementation, on dynamic binding.
2016-07-29 16:00:07 +02:00