Commit Graph

462 Commits

Author SHA1 Message Date
Gustav Wikström ae9cd4370b org-attach*, org, org-manual, org-news, ox-html, testing/*
* lisp/org-attach.el

Changed the way attachments deal with property-inheritance.  It now
adheres to the =org-use-property-inheritance= setting by default but
it can be customized if needed (I recommend to enable it!).
The property ATTACH_DIR is deprecated in favour of the shorter and simpler
property DIR.

Added an explicit option to =org-attach= for unsetting
attachment-directories (i.e. remove DIR property and deal with the
attachments by interaction).

Added attachment link type with the prefix "attachment:".

Added customizations:
- org-attach-dir-relative
- org-attach-preferred-new-method
- org-attach-use-inheritance
- org-attach-id-to-path-function

Hooks added:
- org-attach-after-change-hook
- org-attach-open-hook

A new linktype "attachment" is added in order to reduce
link-duplication when wanting to link to files in attached folders of
nodes.  This works for both ID and DIR properties.  The goal is to
make the functionality for attachment links mirror the functionality
for file links.

* lisp/org-attach-git.el

New file, existing functionality.  Code here has been factored out
from org-attach.el and if GIT-functionality is to be used this module
needs to be required sepatately.  It extends org-attach by use of its
hooks.

Activating git functionality in org-attach is done by loading
org-attach-git from now on, instead of customizing a variable.

Naming of both functions and tests has been modified to match the move
of functionality into its own module.

* lisp/org.el

Inline images are shown also using attachment-links, exactly the same
as it works for file-links today.

Make org-open-at-point respect ARG when opening attachment-dir.

* lisp/org-compat.el

org-attach-directory has been deprecated in favour for
org-attach-id-dir.  The new name matches its purpose better.

* lisp/ox-html.el

Export attachment links to images as inline images, in the same way as
file links work today.

* etc/ORG-NEWS

Mention the changes in this patch.

* doc/org-manual.org

The chapter "Refile, Copy, Archive" has been split into two separate
chapters.
- "Refile, Copy and Archiving" for information related to moving
  existing data around.

- "Capture, Attachments, RSS Feeds and Protocols" for information
  related to working with external data.

The attachment-part has been rewritten and extended to match the
changes in this patch.

The new attachment link type is mentioned both inside the attachments
chapter and in the chapter dealing with links.

Documentation related to external links has been improved.

* testing/lisp/test-org-attach-annex.el

Require org-attach-git instead of org-attach, since this file tests
the GIT-functionality.

* testing/lisp/test-org-attach.el

Add tests for org-attach.

* testing/org-test.el

Define a symbol for a file to test attachments with.

* testing/examples/*

A bunch of new example files and folders are created and are used in
testing of org-attach to verify its functionality.
2019-07-07 19:55:49 +02:00
Nicolas Goaziou 0201d1c0cc Fix inserting capture templates at point
* lisp/org-capture.el (org-capture):
(org-capture-set-target-location):
(org-capture-place-entry):
(org-capture-place-item):
(org-capture-place-table-line): Fix inserting capture templates at
point.  Insert a new internal property for capture
template: :insert-here.
(org-capture-insert-template-here): Remove function.

* testing/lisp/test-org-capture.el (test-org-caputre/entry):
(test-org-capture/item):
(test-org-capture/table-line): Add tests.

Reported-by: Dominic Surano <sk8ingdom@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-07/msg00002.html>
2019-07-06 16:02:37 +02:00
Nicolas Goaziou 9ddfe45314 org-table: Improve `org-table-copy-down'
* lisp/org-table.el (org-table--increment-field): New function.
(org-table-copy-down): Use new function.
* testing/lisp/test-org-table.el (test-org-table/copy-down): New test.
* doc/org-manual.org (Calculations): Update documentation.
2019-06-28 00:07:25 +02:00
Nicolas Goaziou 0ff65e9f4c org-list: Change `org-list-to-subtree' signature
* lisp/org-list.el (org-list-to-subtree): Add optional argument to
  specify level of the subtree.
(org-list-make-subtree):
* lisp/org.el (org-toggle-heading): Adapt to signature change.

Reported-by: Felix Wiemuth <felixwiemuth@hotmail.de>
<http://lists.gnu.org/r/emacs-orgmode/2019-06/msg00010.html>
2019-06-10 00:19:32 +02:00
Sacha Chua a41e9950ae Add :target option for the TOC keyword
* doc/org-manual.org, etc/ORG_NEWS: Document :target option
  for the TOC keyword.

* lisp/ox.el (org-export-resolve-link): New function.

* lisp/ox-ascii.el (org-ascii-keyword): Added :target to the TOC
  keyword.
  (org-ascii--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-html.el (org-html-keyword): Added :target to the TOC keyword.

* lisp/ox-md.el (org-md-keyword): Added :target to the TOC keyword.
  (org-md--build-toc): Changed LOCAL argument to SCOPE.

* lisp/ox-odt.el (org-odt-keyword): Added :target to the TOC keyword.

* testing/lisp/test-ox.el (test-org-export/collect-headlines): Added
  tests for specifying scope by CUSTOM_ID or by fuzzy matching.
  (test-org-export/resolve-link): New test.
2019-05-30 15:25:46 +02:00
Eric Danan fb866077db ORG-NEWS: Mention new variable org-attach-commands 2019-05-03 00:00:59 +02:00
Emmanuel Charpentier ffccea7d73 Document the LATEX_ATTR :scale parameter in ORG-NEWS
* etc/ORG-NEWS: document the new builtin LaTeX exporters' LATEX_ATTR
  :scale parameter
2019-04-23 10:23:42 +02:00
Stefano Rodighiero f3e7dcd174 ORG-NEWS: Mention parameter :dbconnection for org-babel-execute:sql 2019-04-17 14:24:18 +02:00
Nicolas Goaziou e5d05e881a ORG-NEWS: Use less conservative link update function 2019-04-02 23:15:22 +02:00
Nicolas Goaziou a39ee98873 Turn `org-dynamic-block-alist' into a defvar
* lisp/org.el (org-dynamic-block-alist): Make it a defvar.  Update docstring.
2019-03-22 18:32:40 +01:00
Feng Shu 967f6c0dd0 org-agenda: Add org-agenda-breadcrumbs-separator
* lisp/org-agenda.el (org-agenda-breadcrumbs-separator): New variable.
(org-agenda-format-item): Use org-agenda-breadcrumbs-separator
* etc/ORG-NEWS (New variable: ~org-agenda-breadcrumbs-separator~): New variable.
2019-03-21 21:46:10 +01:00
Nicolas Goaziou 07d0c9edbc Complete ORG-NEWS entry about new link syntax 2019-03-21 14:45:32 +01:00
Marco Wahl 2e92b9abb9 org-habit: C-u K in agenda toggles display all/today habits
* lisp/org-habit.el (org-habit-toggle-display-in-agenda): New command.
2019-03-18 17:06:28 +01:00
Sebastian Miele a2deb8ce76 ob-emacs-lisp: Set `lexical-binding' in edit buffers
* lisp/ob-emacs-lisp.el (org-babel-execute:emacs-lisp,
  org-babel-emacs-lisp-lexical): Factor out the conversion of the
  :lexical source block argument to a form that is appropriate for
  `lexical-binding' and the LEXICAL argument to `eval'.

* lisp/ob-emacs-lisp.el (org-babel-edit-prep:emacs-lisp): Set
  `lexical-binding'.

* lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp):
  Update docstring.
2019-03-14 15:41:11 +01:00
Nicolas Goaziou 67de9a6865 ox-texinfo: Support lettered lists
* lisp/ox-texinfo.el (org-texinfo-plain-list): Add :enum attribute.
* doc/org-manual.org (Plain lists in Texinfo export): Document :enum
  attribute.
2019-03-13 15:38:43 +01:00
Nicolas Goaziou 1c936fd2ac org-manual: Document new link syntax
* doc/org-manual.org (Link Format): Document rules for escaping
  sensitive characters in a link.
2019-03-10 18:00:36 +01:00
stardiviner 8b5941330b ob-core: Make :mkdirp work for :dir too
* lisp/ob-core.el (org-babel-execute-src-block): Make directory if
  ":dir path" does not exist when ":mkdirp yes" exist.

* doc/org-manual.org (Header arguments): Document it.

* testing/lisp/test-ob.el: Add a specific testing file for ob-core.el,
  and add a testing for ":mkdir yes" work with :dir header argument
  usage.
2019-03-04 22:25:48 +01:00
Nicolas Goaziou 6d9022df22 Make LaTeX preview toggle more useful and predictable
* lisp/org.el (org-remove-highlights-with-change):
(org-mode): Update.
(org--format-latex-make-overlay):
(org--list-latex-overlays): Remove functions.
(org--make-preview-overlay):
(org-clear-latex-preview):
(org--latex-preview-region):
(org-latex-preview): New functions.
(org-format-latex): Use new function
* lisp/org-compat.el (org-toggle-latex-fragment):
(org-remove-latex-fragment-image-overlays): Deprecate.
* doc/org-manual.org (Previewing LaTeX fragments): Update
  documentation about `org-latex-preview'.

See <http://lists.gnu.org/archive/html/emacs-orgmode/2019-02/msg00138.html>.
2019-02-14 00:14:25 +01:00
Kyle Meyer 87836e14e6 Merge branch 'maint' 2019-02-03 19:17:37 -05:00
Kyle Meyer 69c9f632f4 ORG-NEWS: Fix copyright year 2019-02-03 19:16:36 -05:00
Nicolas Goaziou 683df456a4 org-list: Remove fancy description list indentation
* lisp/org-list.el (org-list-description-max-indent): Remove variable.
(org-list-item-body-column): No longer indent specially description
items.
* lisp/org.el (org-indent-line): Prune reference to removed variable
  in docstring.

Special indentation on description items breaks indentation in
sub-items.
2019-01-31 00:26:00 +01:00
Nicolas Goaziou e1dab51d4d Mention `org-todo-repeat-hook' in ORG-NEWS 2019-01-30 22:37:31 +01:00
Jamie Forth 5c07b4522c ox-beamer: Export overlay specification for notes
* ox-beamer.el (org-beamer-headline): Pass overlay specification to
beamer `\note{}' command.

This is useful for animating multiple slides within a single frame and
displaying only relevant note for each step.

TINYCHANGE
2019-01-26 18:23:42 +01:00
stardiviner bcdb2b5568 ob-clojure: Don't tangle with auto prepend ns statement
* lisp/ob-clojure.el: (org-babel-expand-body:clojure,
  org-babel-header-args:clojure): whether auto prepend Clojure (ns ..)
  statement depend on whether have :ns header argument specified.

* testing/test-ob-clojure.el: Add a test.
2019-01-21 21:17:47 +01:00
Yasushi SHOJI 4a076ed545 Allow cloning subtrees while shifting them backward in time
* lisp/org.el (org-clone-subtree-with-time-shift): Accept a negative
value to shift the timestamp backward in time.
* testing/lisp/test-org.el (test-org/clone-with-time-shift): Add test.

Reported-by: Scott Randby <srandby@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-01/msg00151.html>

Signed-off-by: Yasushi SHOJI <yasushi.shoji@gmail.com>
2019-01-21 18:47:49 +01:00
Marco Wahl 2862bea69b org: Option for user to force non fast tag selection interface
* lisp/org.el (org-set-tags-command): Disable the fast tag selection
  interface when the command is prefixed by C-u C-u.
2019-01-05 13:16:31 +01:00
memeplex 7db8ebc1df Add option to natively fontify LaTeX snippets and environments
* lisp/org.el: add a 'native value to org-highlight-latex-and-related
  that allows to use tex native font locking by means of
  org-src-font-lock-fontify-block.
* etc/ORG-NEWS: add note about new feature.
2019-01-04 14:22:11 +01:00
memeplex 0e26444fe0 Use xcolor for all latex preview converters
* lisp/org.el: remove :use-xcolor option and make dvipng use xcolor
  since usage of CLI fg and bg color args is incompatible with docs
  that themselves use xcolor (e.g. through tikz).
* etc/ORG-NEWS: add incompatible change note.
2019-01-04 14:20:23 +01:00
stardiviner 34b71a0ca9 Add a dispatcher command for inserting dynamic blocks
* lisp/org.el (org-dynamic-block-insert-dblock,
  org-dynamic-block-alist, org-dynamic-block-functions,
  org-dynamic-block-types, org-dynamic-block-define,
  org-dynamic-block-function): New variables, New functions.

* lisp/org-keys.el (org-dynamic-block-insert-dblock): Add binding for
  the function.
(org-clock-report, org-columns-insert-dblock): Remove function
keybindings. Mark them as obsolete.

* doc/org-manual.org (Dynamic Blocks): : Add manual for dispatch
command `org-dynamic-block-insert-dblock'.

* testing/lisp/test-org-clock.el: New test.
2019-01-02 15:55:51 +01:00
Nicolas Goaziou 69c300bbf6 Add Org Num minor mode
* doc/org-manual.org (Headlines): Refer to new section.
(Dynamic Headline Numbering): New section.
* lisp/org-num.el:
* testing/lisp/test-org-num.el: New files.
2019-01-01 22:08:24 +01:00
Bastien 7a22b8f93b Merge branch 'maint' 2019-01-01 11:54:01 +01:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Toon Claes e37412b5d2 ox-html: Make it possible to self link headlines
* lisp/ox-html.el (org-html-self-link-headlines): New variable.
(org-html-headline): Create a hyperlink on headlines
when :html-self-link-headlines is set.
2018-12-29 14:58:43 +01:00
Jens Lechtenboerger 94d2dbf95f ox-html: New property HTML_HEADLINE_CLASS for class of headline
* lisp/ox-html.el (org-html-headline): Add new property
HTML_HEADLINE_CLASS to assign class attribute to headline.

* doc/org-manual.org (CSS support): Document new property
HTML_HEADLINE_CLASS.
2018-12-08 12:45:22 +01:00
Nicolas Goaziou b3c40c32b6 ox-latex: Extend LaTeX attributes and captions to "table.el" tables
* lisp/ox-latex.el (org-latex--decorate-table): New function.
(org-latex--org-table): Use new function.
(org-latex--table.el-table): Use new function.
2018-11-30 18:43:30 +01:00
Matt Price 819e98afd0 org-src: Do not restore window config when exiting an edit buffer
org-src.el (org-src--saved-temp-window-config): Remove variable.
* lisp/org-src.el (org-src--edit-element): Apply removal.
2018-11-27 21:32:07 +01:00
Nicolas Goaziou ae03104402 org-attach: Attach buffers to tasks
* lisp/org-attach.el (org-attach-buffer): New function.
(org-attach): Call new function.
* doc/org-manual.org (Attachments): Document new function.
2018-11-02 02:04:38 +01:00
Nicolas Goaziou 363df82b19 Change default value for `org-email-link-description-format'
* lisp/org.el (org-email-link-description-format): Change default
  value.  No longer truncate subject by default.  Add `:safe' keyword.
* doc/org-manual.org (Handling Links): Document change.

Reported-by: "Garreau, Alexandre" <galex-713@galex-713.eu>
<http://lists.gnu.org/r/emacs-orgmode/2018-10/msg00344.html>
2018-11-01 23:00:45 +01:00
stardiviner 2c5df17ed1 ob-clojure: Support new CIDER using sesman to manage sessions
* ob-clojure.el (org-babel-clojure-initiate-session): Improve ob-clojure
  initialize session way to support CIDER new API.
* etc/ORG-NEWS: Add declare for new :session support feature.
2018-10-25 10:33:16 +02:00
Mark A. Hershberger eb806aa503 ox-odt: Add support for text:start-value
* lisp/ox-odt.el (org-odt-item): Support starting lists at a set
number via "text:start-value".  Without this, ODF files just restart
numbering when they should continue with the specified number.
2018-10-19 21:49:54 +02:00
Gong Qijian 2b96fc9171 ob-core: Fix `org-babel--string-to-number'
* lisp/ob-core.el (org-babel--string-to-number): Fix the regular expression.
* testing/lisp/test-ob.el (test-ob/string-to-number): Test cases.

If people write the data in the form "0001"", it means that he wants to
treat it as a string.

TINYCHANGE

> #+name: TBL
> |   id | name   | age |
> |------|--------|-----|
> | 0001 | Apollo |  16 |
> | 0002 | Bmw    |  16 |
>
> #+BEGIN_SRC emacs-lisp :results value pp :var tbl=TBL
> (mapc 'print tbl)
> #+END_SRC
>
> #+RESULTS:
> : (("0001" "Apollo" 16)
> :  ("0002" "Bmw" 16))

TINYCHANGE
2018-10-13 23:22:05 +02:00
Nicolas Goaziou 100edaccd1 Implement `month' and `year' steps in clock tables
* doc/org-manual.org (The clock table): Update manual.
* lisp/org-clock.el (org-clocktable-steps): Rewrite function.  Add
  `month' and `year' steps.
* testing/lisp/test-org-clock.el (test-org-clock/clocktable/step): Add
  tests.
2018-10-13 16:22:43 +02:00
Nicolas Goaziou 26ed66b233 ob: :file and :file-ext no longer imply :results file
* lisp/ob-core.el (org-babel-execute-src-block): ":results file" must
  be specified in order to return a file.
(org-babel-merge-params): :file and :file-ext no longer imply :results
file.
* testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
(test-ob/result-file-link-type-header-argument):
(test-ob/result-graphics-link-type-header-argument): Update tests.

Deducing the results from some other arguments is not obvious.
Moreover, it prevents users from setting, e.g., :file-ext, in a node
property, as every block would then create a file.

Reported-by: Alex Fenton <alex@pressure.to>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00469.html>
2018-10-06 08:56:05 +02:00
Nicolas Goaziou bfd481be42 ob-core: Remove `org-babel-set-current-result-hash'
* lisp/ob-core.el (org-babel-set-current-result-hash): Remove
  function, unused through the code base.
2018-10-03 18:44:34 +02:00
Nicolas Goaziou 72cadea3c0 ORG-NEWS: Document "CLASS" property
* etc/ORG-NEWS (iCalendar export respects a =CLASS= property): New
  section.
2018-10-03 18:44:34 +02:00
Nicolas Goaziou 19d545a0a8 ORG-NEWS: Document last change
* etc/ORG-NEWS (Plain numbers are hours in Column View mode): New
  section.
2018-10-03 18:44:34 +02:00
Nicolas Goaziou db56e096e8 ORG-NEWS: Document :coding parameter for INCLUDE keywords 2018-10-03 18:44:34 +02:00
Nicolas Goaziou 37f3fbf3c6 ORG-NEWS: Document cell movement in tables 2018-10-03 18:44:34 +02:00
Nicolas Goaziou 537748b7b7 ORG-NEWS: Update 2018-10-03 18:44:34 +02:00
Marco Wahl b19e7737dd org,org-agenda: New: open info depending on context
* lisp/org.el (org-info-find-node): Function to jump to info depending
  on context.  For an org file the context is the element type at point.
2018-10-01 22:47:33 +02:00