Commit Graph

263 Commits

Author SHA1 Message Date
Kyle Meyer c6d37c6ebd org-attach: Autoload org-attach-dired-to-subtree
* lisp/org-attach.el (org-attach-dired-to-subtree): Autoload.

A code snippet in the manual suggests binding this command in
dired-mode-map.  Autoload it so that the snippet works without an
implicit (require 'org-attach).
2019-02-03 12:04:57 -05:00
Paul Eggert d64c9a996b Backport commit 662bee7d7 from Emacs
* lisp/ob-eval.el (org-babel--shell-command-on-region):
* lisp/org-attach.el (org-attach-commit):
* lisp/org-macro.el (org-macro-initialize-templates):
* lisp/org.el (org-babel-load-file)
(org-file-newer-than-p):
* lisp/ox-html.el (org-html-format-spec):
* lisp/ox-publish.el (org-publish-find-date)
(org-publish-cache-ctime-of-src):
Prefer (file-attribute-size A) to (nth 7 A), and similarly
for other file attributes accessors.
* lisp/ox-publish.el (org-publish-cache-ctime-of-src):
Prefer float-time to doing time arithmetic by hand.

file-attributes cleanup
662bee7d70ccd3903e123b08c7ec9108a1a2ce0b
Paul Eggert
Sun Sep 23 18:32:59 2018 -0700
2019-01-13 12:43:04 -05:00
Bastien f584d37a67 Update copyright year 2019-01-01 11:50:56 +01:00
Nicolas Goaziou 6382a6bbb3 org-attach: Fix command string
* lisp/org-attach.el (org-attach): Add missing command letters.
2018-11-01 23:31:57 +01:00
Kyle Meyer ab1f7712de org-attach: Don't query unnecessarily about archiving
* lisp/org-attach.el (org-attach-archive-delete-maybe): Don't query
about deleting attachments if the entry doesn't have any attachments.
2018-08-10 21:24:54 -04:00
Bastien 8fd176ee76 Merge branch 'maint' into wip 2018-04-27 01:09:51 +02:00
Matt Lundin 407014e068 Fix default directory for git-annex checks
* lisp/org-attach.el: (org-attach-annex-get-maybe) Ensure shell
  command that checks whether a git-annex file exists is called from
  within the git-annex repository. Otherwise, it will result in an
  error.
2018-04-26 21:17:55 +02:00
Kyle Meyer d94f7024bc Merge branch 'maint' 2018-01-07 00:28:35 -05:00
Kyle Meyer 3e1641ef0a Update copyright years 2018-01-07 00:27:54 -05:00
Nicolas Goaziou ada2f64b16 org-attach: Make `org-attach-directory' a safe variable
* lisp/org-attach.el (org-attach-directory): Add :safe keyword.
2017-12-04 14:55:20 +01:00
Marco Wahl 5c382f2ee2 org-attach,test-org-attach: Refactoring.
* lisp/org-attach.el (org-attach-dired-to-subtree): Renamed from
  `org-attach-dired-attach-to-next-best-subtree'.  Convenience
  functions have been dropped.

* testing/lisp/test-org-attach.el: Tests use
  `org-test-with-temp-text-in-file' now and are cleaner now.
2017-11-15 14:39:26 +01:00
Marco Wahl a49ac98f3f org-attach: Refactor. Replace self made with available function.
* lisp/org-attach.el (org-attach-dired-marked-files-or-file-at-cursor-in-dired)
  (org-attach-dired-marked-files-in-dired): Removed.  Use
  `dired-get-marked-files' instead.
2017-11-15 12:21:18 +01:00
Marco Wahl 615b147031 org-attach: Attach files specified in a dired buffer.
* lisp/org-attach.el (org-attach-attach-files): New.
(org-attach-dired-marked-files-in-dired): New
(org-attach-dired-marked-files-or-file-at-cursor-in-dired): New.
(org-attach-dired-attach-to-next-best-subtree): New command.
(org-attach-dired-attach-to-next-best-subtree-cp): New command.
(org-attach-dired-attach-to-next-best-subtree-mv): New command.
(org-attach-dired-attach-to-next-best-subtree-ln): New command.
(org-attach-dired-attach-to-next-best-subtree-lns): New command.
* testing/lisp/test-org-attach.el: Tests.
2017-11-15 11:25:51 +01:00
Marco Wahl 12e41c445b org-attach: Fix handling of ATTACH tag at sychronize
* lisp/org-attach.el (org-attach-sync): Remove ATTACH tag at
  synchronize when no files left.
2017-11-10 19:35:35 +01: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
Kyle Meyer 6496d0ca95 Correct defcustom version information
* lisp/ob-lilypond.el (org-babel-lilypond-commands):
* lisp/ob-lua.el (org-babel-lua-command):
(org-babel-lua-mode):
(org-babel-lua-hline-to):
(org-babel-lua-None-to):
* lisp/org-agenda.el (org-agenda-search-view-max-outline-level):
* lisp/org.el (org-mouse-1-follows-link):
(org-src-fontify-natively):
(orgstruct-heading-prefix-regexp):
* lisp/ox-ascii.el (org-ascii-format-inlinetask-function):
* lisp/ox-latex.el (org-latex-format-drawer-function):
(org-latex-listings-langs):
* lisp/ox-odt.el (org-odt-format-drawer-function):
* lisp/ox.el (org-export-with-properties): Correct ":version" value.

* lisp/org-attach.el (org-attach-annex-auto-get): Correct
":package-version" value.
2017-09-07 16:56:11 -04:00
Florian Lindner da99ee0fa6 org-attach: Make org-attach move directories, when attachment dir changes
* lisp/org-attach.el (org-attach-set-directory): Make org-attach move
  directories, when attachment dir changes.
(org-attach): Update docstring.
2017-07-09 17:16:24 +02:00
Nicolas Goaziou 27c2ae47fc Merge branch 'maint' 2017-06-17 16:18:01 +02:00
Allen Li b9b921716b org-attach: Respect org-attach-commit everywhere
* lisp/org-attach.el (org-attach-delete-one): Respect org-attach-commit
(org-attach-delete-all): Respect org-attach-commit
(org-attach-sync): Respect org-attach-commit

TINYCHANGE
2017-06-17 16:16:27 +02:00
Nicolas Goaziou 9a297d6531 org-attach: Silence byte-compiler
* lisp/org-attach.el (org-attach-attach): Tiny refactoring.
2017-05-09 17:56:24 +02:00
Oleh Krehel e23b806bd8 lisp/org-attach.el (org-attach-attach): Add dired-dwim-target-directory
Use case: have two windows open side-by-side. One has an Org-mode
file, the other - a Dired buffer with a file we want to attach.

With this change, and user's `dired-dwim-target' setting, the prompt
for file to attach will start in the Dired buffer's directory.
2017-05-09 17:30:18 +02:00
Wojciech Gac 2d1f73ebf8 org-attach.el: Add functionality to attach from URL
* lisp/org-attach.el (org-attach): Create a binding under 'u' to
  attach a file from URL
  (org-attach-url): Prompt user for URL
  (org-attach-attach): Update method list

* doc/org.texi (Attachments): Document attaching from URL

TINYCHANGE
2017-03-11 13:41:18 +01:00
Kyle Meyer 7c710f6f57 Change :version in defcustoms from "25.2" to "26.1"
* lisp/ob-J.el (org-babel-J-command):
* lisp/ob-core.el (org-babel-hash-show-time):
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/ob-lisp.el (org-babel-lisp-eval-fn):
* lisp/org-agenda.el (org-agenda-view-columns-initially):
* lisp/org-attach.el (org-attach-commit):
(org-attach-archive-delete):
(org-attach-annex-auto-get):
* lisp/org-bibtex.el (org-bibtex-inherit-tags):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-colview.el (org-columns-summary-types):
* lisp/org-faces.el (org-block):
* lisp/org-src.el (org-src-block-faces):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
(org-table-convert-region-max-lines):
* lisp/org-timer.el (org-timer-default-timer):
* lisp/org.el (org-export-backends):
(org-show-context-detail):
(org-cycle-hook):
(org-occur-case-fold-search):
(org-preview-latex-default-process):
(org-preview-latex-process-alist):
(org-preview-latex-image-directory):
(org-latex-default-packages-alist):
(org-sparse-tree-default-date-type):
(org-structure-template-alist):
(org-effort-durations):
(org-agenda-ignore-properties): Change :version from "25.2" to "26.1".
(customize-package-emacs-version-alist): Fix associations between Org
and Emacs releases.
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-beamer.el (org-beamer-subtitle-format):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
(org-html-viewport):
* lisp/ox-latex.el (org-latex-caption-above):
(org-latex-prefer-user-labels):
(org-latex-subtitle-format):
(org-latex-hyperref-template):
(org-latex-footnote-defined-format):
(org-latex-images-centered):
(org-latex-default-figure-position):
(org-latex-text-markup-alist):
(org-latex-format-inlinetask-function):
(org-latex-custom-lang-environments):
(org-latex-compiler-file-string):
(org-latex-compiler):
(org-latex-bib-compiler):
(org-latex-logfiles-extensions):
(org-latex-known-warnings):
* lisp/ox-md.el (org-md-footnotes-section):
(org-md-footnote-format):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
(org-odt-inline-image-rules):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function):
* lisp/ox.el (org-export-with-creator):
(org-export-with-title):
(org-export-with-broken-links):
(org-export-copy-to-kill-ring): Change :version from "25.2" to "26.1".

It looks like the goal is to sync Org 9.0.* (maint) with the Emacs
master branch (what will be version 26.1):
https://lists.gnu.org/archive/html/emacs-orgmode/2017-01/msg00558.html
2017-01-26 00:02:03 -05:00
Kyle Meyer 713f785017 Update copyright years 2017-01-05 20:19:37 -05: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 d907041911 Change :version in defcustoms from "25.1" to "25.2"
* lisp/ob-exp.el (org-babel-exp-inline-code-template):
* lisp/ob-lisp.el (org-babel-lisp-eval-fn):
* lisp/org-agenda.el (org-agenda-view-columns-initially):
* lisp/org-attach.el (org-attach-commit):
(org-attach-archive-delete):
(org-attach-annex-auto-get):
* lisp/org-bibtex.el (org-bibtex-inherit-tags):
* lisp/org-clock.el (org-clock-into-drawer):
* lisp/org-colview.el (org-columns-summary-types):
* lisp/org-table.el (org-table-copy-increment):
(org-table-formula-create-columns):
(org-table-convert-region-max-lines):
* lisp/org-timer.el (org-timer-default-timer):
* lisp/org.el (org-export-backends):
(org-cycle-hook):
(org-occur-case-fold-search):
(org-preview-latex-image-directory):
(org-latex-default-packages-alist):
(org-sparse-tree-default-date-type):
(org-structure-template-alist):
(org-effort-durations):
(org-agenda-ignore-properties): Change :version from "25.1" to "25.2".
(customize-package-emacs-version-alist): Fix associations between Org
and Emacs releases.
* lisp/ox-ascii.el (org-ascii-list-margin):
* lisp/ox-beamer.el (org-beamer-subtitle-format):
* lisp/ox-html.el (org-html-format-headline-function):
(org-html-format-inlinetask-function):
(org-html-viewport):
* lisp/ox-latex.el (org-latex-caption-above):
(org-latex-prefer-user-labels):
(org-latex-subtitle-format):
(org-latex-hyperref-template):
(org-latex-images-centered):
(org-latex-text-markup-alist):
(org-latex-format-inlinetask-function):
(org-latex-custom-lang-environments):
(org-latex-compiler-file-string):
(org-latex-compiler):
(org-latex-bib-compiler):
(org-latex-logfiles-extensions):
(org-latex-known-warnings):
* lisp/ox-md.el (org-md-footnotes-section):
(org-md-footnote-format):
* lisp/ox-odt.el (org-odt-format-headline-function):
(org-odt-format-inlinetask-function):
(org-odt-inline-image-rules):
* lisp/ox-texinfo.el (org-texinfo-format-headline-function):
* lisp/ox.el (org-export-with-creator):
(org-export-with-title):
(org-export-with-broken-links):
(org-export-copy-to-kill-ring): Change :version from "25.1" to "25.2".

Neither Org 8.3 nor Org 9.0 were released with Emacs 25.1.
2016-10-05 11:18:39 +02: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 a8a9c286e9 org-attach: Use cl-lib
* lisp/org-attach.el (org-attach-commit): Use "cl-" prefix.
2016-07-25 15:54:06 +02:00
Erik Hetzner f97317abcb org-attach: Use relative path for git annex
* lisp/org-attach.el (org-attach-annex-get-maybe): Use relative path as
  argument for git annex.  Fixes error in test with version 3 of git
  annex.
2016-04-10 10:13:57 +02:00
John Foerch ff98903015 org-attach: Make use of git optional
* lisp/org-attach.el (org-attach-commit): New variable.
(org-attach-attach): Use new variable.

TINYCHANGE
2016-02-14 17:56:18 +01:00
Erik Hetzner 5040718945 org-attach.el: Get attachments from git annex
* org-attach.el (org-attach-use-annex): New function to check if git
  annex should be used.
  (org-attach-annex-get-maybe): New function to get a file from git
  annex if necessary.
  (org-attach-annex-auto-get): New defcustom to determine behavior
  of org-attach-annex-get-maybe.
  (org-attach-open): Automatically get attached files from git annex when
  opening if necessary.
* testing/lisp/test-org-annex.el: New file for testing org-attach. Only
  contains code for testing org-attach with git annex at the moment.
* mk/targets.mk: Fix cleantest target so it can delete git annex repos.
2016-02-06 13:17:33 +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 6345de2d05 Merge branch 'maint' 2016-01-09 17:43:27 -05:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou 403249a6ab org-attach: Use lexical binding
* lisp/org-attach.el (org-attach-dir): Silence byte-compiler.
2015-11-13 23:51:28 +01:00
Paul Eggert ecf3a4af2c Backport remaining changes from commit 7e09ef0
Add changes from Emacs repo that should have been backported with
bb77dd2.

Update copyright year to 2015
7e09ef09a479731d01b1ca46e94ddadd73ac98e3
Paul Eggert
Thu Jan 1 14:26:41 2015 -0800
2015-08-10 02:17:19 -04:00
Erik Hetzner 6d88ee5ff0 org-attach.el: Fix check for git annex
* lisp/org-attach.el (org-attach-commit): Check for .git/annex dir in
addition to annex dir in root git dir to ensure that git annex is used

TINYCHANGE
2015-05-17 10:20:58 +02:00
Eric Abrahamsen 1feafbfa99 org-attach: Maybe delete heading attachments when archiving
* lisp/org-attach.el (org-attach-archive-delete): New option
  controlling what to do with attachments when
  archiving.
(org-attach-archive-delete-maybe): New function that runs as a hook on
  org-archive-hook.  Checks the value of `org-attach-archive-delete',
  and behaves accordingly.
2014-10-16 18:57:39 +02:00
Bastien Guerry df53dce911 Merge branch 'maint' 2014-05-21 19:47:29 +02:00
Bastien Guerry 241286865c org-attach.el (org-attach-dir): Fix bug
* org-attach.el (org-attach-dir): When the property is
"inherited" from a variable outside of the file, do not use
`org-entry-property-inherited-from' to find the attachment
position, assume we need to go back to the current headline.
2014-05-21 19:47:13 +02:00
Bastien Guerry 74162d9eb6 org-attach.el: Allow to attach files starting with a dot
* org-attach.el (org-attach-sync, org-attach-file-list): Allow
to attach files starting with a dot.

Thanks to Oleh for requesting this and providing a patch.
2014-03-18 17:17:41 +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 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Bastien Guerry 6a86f32c70 org-attach.el: Check whether git is installed
* org-attach.el (vc-git): Require.
(org-attach-commit): Check whether git is installed.

Thanks to Jonathan Leech-Pepin for reporting this.
2013-12-06 15:22:50 +01:00
Bastien Guerry 138f18d3ce Fix compiler warnings.
* org-attach.el (vc-git-root):
* ob-shen.el (org-babel-ruby-var-to-ruby): Declare.
2013-09-02 13:33:52 +02:00
Carsten Dominik 2c38c3acc0 Use vc-git to find the git repository for org-attach
* lisp/org-attach.el (org-attach-commit): Use vc-git to find the git
repository.

Org attach use to fail to commit the attached file in git or git annex
when the .git repository is not in the data sub-directory.

This new code will use vc-git to find the .git file, and from this do
what is needed for committing file into git or git annex.

Patch by Remi Vanicat
2013-08-31 15:58:12 +02:00
Bastien Guerry 8a2e3e2a79 Add :version and :package-version
* ox.el (org-export-snippet-translation-alist)
(org-export-coding-system, org-export-in-background)
(org-export-async-init-file, org-export-invisible-backends)
(org-export-dispatch-use-expert-ui):
* ox-texinfo.el (org-texinfo-filename, org-texinfo-classes)
(org-texinfo-format-headline-function)
(org-texinfo-node-description-column)
(org-texinfo-active-timestamp-format)
(org-texinfo-link-with-unknown-path-format)
(org-texinfo-tables-verbatim)
(org-texinfo-table-scientific-notation)
(org-texinfo-text-markup-alist)
(org-texinfo-format-drawer-function)
(org-texinfo-format-inlinetask-function)
(org-texinfo-info-process):
* ox-man.el (org-man-tables-centered)
(org-man-table-scientific-notation)
(org-man-source-highlight, org-man-source-highlight-langs)
(org-man-pdf-process, org-man-logfiles-extensions):
* ox-html.el (org-html-allow-name-attribute-in-anchors)
(org-html-coding-system, org-html-divs):
* ox-ascii.el (org-ascii-text-width)
(org-ascii-headline-spacing, org-ascii-indented-line-width)
(org-ascii-paragraph-spacing, org-ascii-charset)
(org-ascii-underline, org-ascii-bullets)
(org-ascii-links-to-notes)
(org-ascii-table-keep-all-vertical-lines)
(org-ascii-table-widen-columns)
(org-ascii-table-use-ascii-art)
(org-ascii-format-drawer-function)
(org-ascii-format-inlinetask-function):
* org.el (org-modules, org-export-backends)
(org-highlight-latex-and-related, orgstruct-setup-hook):
* org-attach.el (org-attach-git-annex-cutoff):
* org-archive.el (org-archive-file-header-format):
* org-agenda.el (org-agenda-todo-ignore-time-comparison-use-seconds):
* ob-python.el (org-babel-python-hline-to)
(org-babel-python-None-to):
* ob-ditaa.el (org-ditaa-eps-jar-path):
* ob-core.el (org-babel-results-keyword): Add :version and
:package-version.

* ox-ascii.el: Use utf-8-emacs as the file coding system.
2013-03-05 16:38:33 +01:00
Nicolas Richard da0276cba5 * org-attach.el (org-attach-reveal, org-attach-reveal-in-emacs): Fix the docstrings. 2013-01-09 18:01:54 +01:00
Bastien Guerry 5fc740a230 Merge branch 'maint' 2013-01-08 15:04:40 +01:00