diff options
author | Nicholas D Steeves <nsteeves@gmail.com> | 2017-07-03 20:44:19 -0400 |
---|---|---|
committer | Nicholas D Steeves <nsteeves@gmail.com> | 2017-07-03 20:57:31 -0400 |
commit | 3458b4fdfffc1b4f542405325ffa8b6eed0eb1df (patch) | |
tree | 0c9ed6fcddc796bdb92d3fc5fd266fac3b583eda /contrib/lisp | |
parent | 969f455bc143bb93c745b82db358392b123661e0 (diff) |
New upstream version 9.0.9+dfsg
Diffstat (limited to 'contrib/lisp')
42 files changed, 209 insertions, 113 deletions
diff --git a/contrib/lisp/ob-csharp.el b/contrib/lisp/ob-csharp.el index 5ecac23..c4aa046 100644 --- a/contrib/lisp/ob-csharp.el +++ b/contrib/lisp/ob-csharp.el @@ -1,6 +1,6 @@ ;;; ob-csharp.el --- org-babel functions for csharp evaluation -;; Copyright (C) 2011-2015 Free Software Foundation, Inc. +;; Copyright (C) 2011-2017 Free Software Foundation, Inc. ;; Author: thomas "at" friendlyvillagers.com based on ob-java.el by Eric Schulte ;; Keywords: literate programming, reproducible research diff --git a/contrib/lisp/ob-eukleides.el b/contrib/lisp/ob-eukleides.el index e4fc298..d3ad993 100644 --- a/contrib/lisp/ob-eukleides.el +++ b/contrib/lisp/ob-eukleides.el @@ -1,6 +1,6 @@ ;;; ob-eukleides.el --- Org-babel functions for eukleides evaluation -;; Copyright (C) 2010-2016 Free Software Foundation, Inc. +;; Copyright (C) 2010-2017 Free Software Foundation, Inc. ;; Author: Luis Anaya ;; Keywords: literate programming, reproducible research diff --git a/contrib/lisp/ob-mathomatic.el b/contrib/lisp/ob-mathomatic.el index fc08d9f..c62e181 100644 --- a/contrib/lisp/ob-mathomatic.el +++ b/contrib/lisp/ob-mathomatic.el @@ -1,6 +1,6 @@ ;;; ob-mathomatic.el --- Org-babel functions for mathomatic evaluation -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; Author: Eric S Fraga ;; Eric Schulte diff --git a/contrib/lisp/ob-tcl.el b/contrib/lisp/ob-tcl.el index 5373069..c76b138 100644 --- a/contrib/lisp/ob-tcl.el +++ b/contrib/lisp/ob-tcl.el @@ -1,6 +1,6 @@ ;;; ob-tcl.el --- Org-babel functions for tcl evaluation -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; Authors: Dan Davison ;; Eric Schulte diff --git a/contrib/lisp/ob-vbnet.el b/contrib/lisp/ob-vbnet.el index 8b27494..b0f2688 100644 --- a/contrib/lisp/ob-vbnet.el +++ b/contrib/lisp/ob-vbnet.el @@ -1,6 +1,6 @@ ;;; ob-vbnet.el --- org-babel functions for VB.Net evaluation -;; Copyright (C) 2011-2015 Free Software Foundation, Inc. +;; Copyright (C) 2011-2017 Free Software Foundation, Inc. ;; Author: thomas "at" friendlyvillagers.com based on ob-java.el by Eric Schulte ;; Keywords: literate programming, reproducible research diff --git a/contrib/lisp/org-bibtex-extras.el b/contrib/lisp/org-bibtex-extras.el index 587aa67..c5b521a 100644 --- a/contrib/lisp/org-bibtex-extras.el +++ b/contrib/lisp/org-bibtex-extras.el @@ -1,6 +1,6 @@ ;;; org-bibtex-extras --- extras for working with org-bibtex entries -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; Author: Eric Schulte <eric dot schulte at gmx dot com> ;; Keywords: outlines, hypermedia, bibtex, d3 diff --git a/contrib/lisp/org-bookmark.el b/contrib/lisp/org-bookmark.el index f042467..04a473b 100644 --- a/contrib/lisp/org-bookmark.el +++ b/contrib/lisp/org-bookmark.el @@ -1,5 +1,5 @@ ;;; org-bookmark.el - Support for links to bookmark -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; ;; Author: Tokuya Kameshima <kames AT fa2.so-net.ne.jp> ;; Version: 1.0 diff --git a/contrib/lisp/org-collector.el b/contrib/lisp/org-collector.el index 3e2b3c4..10ec0cb 100644 --- a/contrib/lisp/org-collector.el +++ b/contrib/lisp/org-collector.el @@ -1,6 +1,6 @@ ;;; org-collector --- collect properties into tables -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; Author: Eric Schulte <schulte dot eric at gmail dot com> ;; Keywords: outlines, hypermedia, calendar, wp, experimentation, diff --git a/contrib/lisp/org-contribdir.el b/contrib/lisp/org-contribdir.el index d0bd951..4ad3116 100644 --- a/contrib/lisp/org-contribdir.el +++ b/contrib/lisp/org-contribdir.el @@ -1,5 +1,5 @@ ;;; org-contribdir.el --- Mark the location of the contrib directory -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el index 5e49b6c..b6f3d27 100644 --- a/contrib/lisp/org-depend.el +++ b/contrib/lisp/org-depend.el @@ -1,5 +1,5 @@ ;;; org-depend.el --- TODO dependencies for Org-mode -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-drill.el b/contrib/lisp/org-drill.el index a78b806..fb578ab 100644 --- a/contrib/lisp/org-drill.el +++ b/contrib/lisp/org-drill.el @@ -1455,7 +1455,7 @@ How well did you do? %s" ;; (save-excursion ;; (org-map-entries ;; (lambda () -;; (when (and (not (outline-invisible-p)) +;; (when (and (not (org-invisible-p)) ;; (> (org-current-level) drill-entry-level)) ;; (setq drill-heading (org-get-heading t)) ;; (unless (and (= (org-current-level) (1+ drill-entry-level)) @@ -1480,7 +1480,7 @@ the current topic." (save-excursion (org-map-entries (lambda () - (when (and (not (outline-invisible-p)) + (when (and (not (org-invisible-p)) (> (org-current-level) drill-entry-level)) (when (or (/= (org-current-level) (1+ drill-entry-level)) (funcall test)) diff --git a/contrib/lisp/org-effectiveness.el b/contrib/lisp/org-effectiveness.el index 8d179fc..a07084c 100644 --- a/contrib/lisp/org-effectiveness.el +++ b/contrib/lisp/org-effectiveness.el @@ -1,6 +1,6 @@ ;;; org-effectiveness.el --- Measuring the personal effectiveness -;; Copyright (C) 2013-2016 Free Software Foundation, Inc. +;; Copyright (C) 2013-2017 Free Software Foundation, Inc. ;; Author: David Arroyo Menéndez <davidam@es.gnu.org> ;; Keywords: effectiveness, plot diff --git a/contrib/lisp/org-eldoc.el b/contrib/lisp/org-eldoc.el index 046918d..74dc69b 100644 --- a/contrib/lisp/org-eldoc.el +++ b/contrib/lisp/org-eldoc.el @@ -1,6 +1,6 @@ ;;; org-eldoc.el --- display org header and src block info using eldoc -;; Copyright (c) 2014-2016 Free Software Foundation, Inc. +;; Copyright (c) 2014-2017 Free Software Foundation, Inc. ;; Author: Łukasz Gruner <lukasz@gruner.lu> ;; Maintainer: Łukasz Gruner <lukasz@gruner.lu> diff --git a/contrib/lisp/org-elisp-symbol.el b/contrib/lisp/org-elisp-symbol.el index 7c98962..a089914 100644 --- a/contrib/lisp/org-elisp-symbol.el +++ b/contrib/lisp/org-elisp-symbol.el @@ -1,6 +1,6 @@ ;;; org-elisp-symbol.el --- Org links to emacs-lisp symbols ;; -;; Copyright 2007-2016 Free Software Foundation, Inc. +;; Copyright 2007-2017 Free Software Foundation, Inc. ;; ;; Author: Bastien Guerry ;; Version: 0.2 diff --git a/contrib/lisp/org-eval-light.el b/contrib/lisp/org-eval-light.el index 1449b24..57ac290 100644 --- a/contrib/lisp/org-eval-light.el +++ b/contrib/lisp/org-eval-light.el @@ -1,6 +1,6 @@ ;;; org-eval-light.el --- Display result of evaluating code in various languages (light) -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; Author: Carsten Dominik <carsten at orgmode dot org>, ;; Eric Schulte <schulte dot eric at gmail dot com> diff --git a/contrib/lisp/org-eval.el b/contrib/lisp/org-eval.el index 92a4a19..ecea46a 100644 --- a/contrib/lisp/org-eval.el +++ b/contrib/lisp/org-eval.el @@ -1,5 +1,5 @@ ;;; org-eval.el --- Display result of evaluating code in various languages -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-expiry.el b/contrib/lisp/org-expiry.el index 45f59a2..2b8c050 100644 --- a/contrib/lisp/org-expiry.el +++ b/contrib/lisp/org-expiry.el @@ -1,6 +1,6 @@ ;;; org-expiry.el --- expiry mechanism for Org entries ;; -;; Copyright 2007-2016 Free Software Foundation, Inc. +;; Copyright 2007-2017 Free Software Foundation, Inc. ;; ;; Author: Bastien Guerry ;; Version: 0.2 diff --git a/contrib/lisp/org-git-link.el b/contrib/lisp/org-git-link.el index 9d3ff32..0028daf 100644 --- a/contrib/lisp/org-git-link.el +++ b/contrib/lisp/org-git-link.el @@ -73,8 +73,8 @@ (defun org-gitbare-open (str) (let* ((strlist (org-git-split-string str)) - (gitdir (first strlist)) - (object (second strlist))) + (gitdir (nth 0 strlist)) + (object (nth 1 strlist))) (org-git-open-file-internal gitdir object))) @@ -96,14 +96,18 @@ (defun org-git-open (str) (let* ((strlist (org-git-split-string str)) - (filepath (first strlist)) - (commit (second strlist)) - (line (third strlist)) + (filepath (nth 0 strlist)) + (commit (nth 1 strlist)) + (line (nth 2 strlist)) (dirlist (org-git-find-gitdir (file-truename filepath))) - (gitdir (first dirlist)) - (relpath (second dirlist))) + (gitdir (nth 0 dirlist)) + (relpath (nth 1 dirlist))) (org-git-open-file-internal gitdir (concat commit ":" relpath)) - (when line (goto-line (string-to-int line))))) + (when line + (save-restriction + (widen) + (goto-char (point-min)) + (forward-line (1- (string-to-number line))))))) ;; Utility functions (file names etc) @@ -122,15 +126,15 @@ the path. Example: (org-git-find-gitdir \"~/gitrepos/foo/bar.txt\") returns '(\"/home/user/gitrepos/.git\" \"foo/bar.txt\"). When not in a git repository, return nil." - (let ((dir (file-name-directory path)) + (let ((dir (expand-file-name (file-name-directory path))) (relpath (file-name-nondirectory path))) (catch 'toplevel (while (not (file-exists-p (expand-file-name ".git" dir))) (let ((dirlist (org-git-split-dirpath dir))) - (when (string= (second dirlist) "") ; at top level + (when (string= (nth 1 dirlist) "") ; at top level (throw 'toplevel nil)) - (setq dir (first dirlist) - relpath (concat (file-name-as-directory (second dirlist)) relpath)))) + (setq dir (nth 0 dirlist) + relpath (concat (file-name-as-directory (nth 1 dirlist)) relpath)))) (list (expand-file-name ".git" dir) relpath)))) @@ -174,7 +178,7 @@ than two double colons, str2 and/or str3 may be set the empty string." (defun org-git-create-git-link (file &optional line) "Create git link part to file at specific time" (interactive "FFile: ") - (let* ((gitdir (first (org-git-find-gitdir (file-truename file)))) + (let* ((gitdir (nth 0 (org-git-find-gitdir (file-truename file)))) (branchname (org-git-get-current-branch gitdir)) (timestring (format-time-string "%Y-%m-%d" (current-time)))) (concat "git:" file "::" (org-git-create-searchstring branchname timestring) diff --git a/contrib/lisp/org-index.el b/contrib/lisp/org-index.el index 31b675e..9efa510 100644 --- a/contrib/lisp/org-index.el +++ b/contrib/lisp/org-index.el @@ -1,6 +1,6 @@ ;;; org-index.el --- A personal adaptive index for org -;; Copyright (C) 2011-2016 Free Software Foundation, Inc. +;; Copyright (C) 2011-2017 Free Software Foundation, Inc. ;; Author: Marc Ihm <org-index@2484.de> ;; Version: 5.1.3 diff --git a/contrib/lisp/org-interactive-query.el b/contrib/lisp/org-interactive-query.el index 928c801..147ddae 100644 --- a/contrib/lisp/org-interactive-query.el +++ b/contrib/lisp/org-interactive-query.el @@ -1,6 +1,6 @@ ;;; org-interactive-query.el --- Interactive modification of agenda query ;; -;; Copyright 2007-2016 Free Software Foundation, Inc. +;; Copyright 2007-2017 Free Software Foundation, Inc. ;; ;; Author: Christopher League <league at contrapunctus dot net> ;; Version: 1.0 diff --git a/contrib/lisp/org-learn.el b/contrib/lisp/org-learn.el index e47c8f8..db9580f 100644 --- a/contrib/lisp/org-learn.el +++ b/contrib/lisp/org-learn.el @@ -1,6 +1,6 @@ ;;; org-learn.el --- Implements SuperMemo's incremental learning algorithm -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; Author: John Wiegley <johnw at gnu dot org> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-license.el b/contrib/lisp/org-license.el index dc1d797..2fad68f 100644 --- a/contrib/lisp/org-license.el +++ b/contrib/lisp/org-license.el @@ -1,6 +1,6 @@ ;;; org-license.el --- Add a license to your org files -;; Copyright (C) 2013-2016 Free Software Foundation, Inc. +;; Copyright (C) 2013-2017 Free Software Foundation, Inc. ;; Author: David Arroyo Menéndez <davidam@es.gnu.org> ;; Keywords: licenses, creative commons diff --git a/contrib/lisp/org-link-edit.el b/contrib/lisp/org-link-edit.el index 431c934..000dd1c 100644 --- a/contrib/lisp/org-link-edit.el +++ b/contrib/lisp/org-link-edit.el @@ -1,12 +1,12 @@ ;;; org-link-edit.el --- Slurp and barf with Org links -*- lexical-binding: t; -*- -;; Copyright (C) 2015 Kyle Meyer <kyle@kyleam.com> +;; Copyright (C) 2015-2017 Kyle Meyer <kyle@kyleam.com> ;; Author: Kyle Meyer <kyle@kyleam.com> -;; URL: https://github.com/kyleam/org-link-edit +;; URL: https://gitlab.com/kyleam/org-link-edit ;; Keywords: convenience -;; Version: 1.0.1 -;; Package-Requires: ((cl-lib "0.5") (org "8.2")) +;; Version: 1.1.1 +;; Package-Requires: ((cl-lib "0.5") (org "8.2.10")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -26,8 +26,8 @@ ;; Org Link Edit provides Paredit-inspired slurping and barfing ;; commands for Org link descriptions. ;; -;; There are four commands, all which operate when point is on an Org -;; link. +;; There are four slurp and barf commands, all which operate when +;; point is on an Org link. ;; ;; - org-link-edit-forward-slurp ;; - org-link-edit-backward-slurp @@ -53,6 +53,11 @@ ;; ("i" org-link-edit-backward-barf "backward barf") ;; ("q" nil "cancel"))) ;; +;; In addition to the slurp and barf commands, the command +;; `org-link-edit-transport-next-link' searches for the next (or +;; previous) link and moves it to point, using the word at point or +;; the selected region as the link's description. +;; ;; [1] https://github.com/abo-abo/hydra ;;; Code: @@ -61,7 +66,15 @@ (require 'org-element) (require 'cl-lib) -(defun org-link-edit--get-link-data () +(defun org-link-edit--on-link-p (&optional element) + (let ((el (or element (org-element-context)))) + ;; Don't use `org-element-lineage' because it isn't available + ;; until Org version 8.3. + (while (and el (not (memq (car el) '(link)))) + (setq el (org-element-property :parent el))) + (eq (car el) 'link))) + +(defun org-link-edit--link-data () "Return list with information about the link at point. The list includes - the position at the start of the link @@ -69,11 +82,7 @@ The list includes - the link text - the link description (nil when on a plain link)" (let ((el (org-element-context))) - ;; Don't use `org-element-lineage' because it isn't available - ;; until Org version 8.3. - (while (and el (not (memq (car el) '(link)))) - (setq el (org-element-property :parent el))) - (unless (eq (car el) 'link) + (unless (org-link-edit--on-link-p el) (user-error "Point is not on a link")) (save-excursion (goto-char (org-element-property :begin el)) @@ -84,7 +93,8 @@ The list includes ((looking-at org-bracket-link-regexp) (list (match-beginning 0) (match-end 0) - (org-link-unescape (match-string-no-properties 1)) + (save-match-data + (org-link-unescape (match-string-no-properties 1))) (or (and (match-end 3) (match-string-no-properties 3)) ""))) @@ -148,7 +158,7 @@ If N is negative, slurp leading blobs instead of trailing blobs." ((< n 0) (org-link-edit-backward-slurp (- n))) (t - (cl-multiple-value-bind (beg end link desc) (org-link-edit--get-link-data) + (cl-multiple-value-bind (beg end link desc) (org-link-edit--link-data) (goto-char (save-excursion (goto-char end) (or (org-link-edit--forward-blob n 'no-punctuation) @@ -190,7 +200,7 @@ If N is negative, slurp trailing blobs instead of leading blobs." ((< n 0) (org-link-edit-forward-slurp (- n))) (t - (cl-multiple-value-bind (beg end link desc) (org-link-edit--get-link-data) + (cl-multiple-value-bind (beg end link desc) (org-link-edit--link-data) (goto-char (save-excursion (goto-char beg) (or (org-link-edit--forward-blob (- n)) @@ -266,20 +276,17 @@ If N is negative, barf leading blobs instead of trailing blobs." ((< n 0) (org-link-edit-backward-barf (- n))) (t - (cl-multiple-value-bind (beg end link desc) (org-link-edit--get-link-data) + (cl-multiple-value-bind (beg end link desc) (org-link-edit--link-data) (when (= (length desc) 0) (user-error "Link has no description")) (pcase-let ((`(,new-desc . ,barfed) (org-link-edit--split-last-blobs desc n))) (unless new-desc (user-error "Not enough blobs in description")) + (goto-char beg) (delete-region beg end) (insert (org-make-link-string link new-desc)) - (if (string= new-desc "") - ;; Two brackets are dropped when an empty description is - ;; passed to `org-make-link-string'. - (progn (goto-char (- end (+ 2 (length desc)))) - (setq barfed (concat " " barfed))) - (goto-char (- end (- (length desc) (length new-desc))))) + (when (string= new-desc "") + (setq barfed (concat " " barfed))) (insert barfed) (goto-char beg) barfed))))) @@ -308,20 +315,76 @@ If N is negative, barf trailing blobs instead of leading blobs." ((< n 0) (org-link-edit-forward-barf (- n))) (t - (cl-multiple-value-bind (beg end link desc) (org-link-edit--get-link-data) + (cl-multiple-value-bind (beg end link desc) (org-link-edit--link-data) (when (= (length desc) 0) (user-error "Link has no description")) (pcase-let ((`(,barfed . ,new-desc) (org-link-edit--split-first-blobs desc n))) (unless new-desc (user-error "Not enough blobs in description")) + (goto-char beg) (delete-region beg end) (insert (org-make-link-string link new-desc)) (when (string= new-desc "") (setq barfed (concat barfed " "))) (goto-char beg) (insert barfed) - (goto-char (+ beg (length barfed))) barfed))))) +(defun org-link-edit--next-link-data (&optional previous) + (save-excursion + (if (funcall (if previous #'re-search-backward #'re-search-forward) + org-any-link-re nil t) + (org-link-edit--link-data) + (user-error "No %s link found" (if previous "previous" "next"))))) + +;;;###autoload +(defun org-link-edit-transport-next-link (&optional previous beg end) + "Move the next link to point. + +If the region is active, use the selected text as the link's +description. Otherwise, use the word at point. + +With prefix argument PREVIOUS, move the previous link instead of +the next link. + +Non-interactively, use the text between BEG and END as the +description, moving the next (or previous) link relative BEG and +END." + (interactive (cons current-prefix-arg + (and (use-region-p) + (list (region-beginning) (region-end))))) + (let ((pt (point)) + (desc-bounds (cond + ((and beg end) + (cons (progn (goto-char beg) + (point-marker)) + (progn (goto-char end) + (point-marker)))) + ((not (looking-at-p "\\s-")) + (progn (skip-syntax-backward "w") + (let ((beg (point-marker))) + (skip-syntax-forward "w") + (cons beg (point-marker)))))))) + (when (or (and desc-bounds + (or (progn (goto-char (car desc-bounds)) + (org-link-edit--on-link-p)) + (progn (goto-char (cdr desc-bounds)) + (org-link-edit--on-link-p)))) + (progn (goto-char pt) + (org-link-edit--on-link-p))) + (user-error "Cannot transport next link with point on a link")) + (goto-char (or (car desc-bounds) pt)) + (cl-multiple-value-bind (link-beg link-end link orig-desc) + (org-link-edit--next-link-data previous) + (unless (or (not desc-bounds) (= (length orig-desc) 0)) + (user-error "Link already has a description")) + (delete-region link-beg link-end) + (insert (org-make-link-string + link + (if desc-bounds + (delete-and-extract-region (car desc-bounds) + (cdr desc-bounds)) + orig-desc)))))) + (provide 'org-link-edit) ;;; org-link-edit.el ends here diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el index ae2def3..7f4af30 100644 --- a/contrib/lisp/org-mac-link.el +++ b/contrib/lisp/org-mac-link.el @@ -1,6 +1,6 @@ ;;; org-mac-link.el --- Insert org-mode links to items selected in various Mac apps ;; -;; Copyright (c) 2010-2016 Free Software Foundation, Inc. +;; Copyright (c) 2010-2017 Free Software Foundation, Inc. ;; ;; Author: Anthony Lander <anthony.lander@gmail.com> ;; John Wiegley <johnw@gnu.org> diff --git a/contrib/lisp/org-mew.el b/contrib/lisp/org-mew.el index 2c2bdcc..6dbc67c 100644 --- a/contrib/lisp/org-mew.el +++ b/contrib/lisp/org-mew.el @@ -1,6 +1,6 @@ ;;; org-mew.el --- Support for links to Mew messages from within Org-mode -;; Copyright (C) 2008-2016 Free Software Foundation, Inc. +;; Copyright (C) 2008-2017 Free Software Foundation, Inc. ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-notify.el b/contrib/lisp/org-notify.el index d0acdec..1a1d557 100644 --- a/contrib/lisp/org-notify.el +++ b/contrib/lisp/org-notify.el @@ -1,6 +1,6 @@ ;;; org-notify.el --- Notifications for Org-mode -;; Copyright (C) 2012-2016 Free Software Foundation, Inc. +;; Copyright (C) 2012-2017 Free Software Foundation, Inc. ;; Author: Peter Münster <pmrb@free.fr> ;; Keywords: notification, todo-list, alarm, reminder, pop-up diff --git a/contrib/lisp/org-screenshot.el b/contrib/lisp/org-screenshot.el index 3716020..1cf6911 100644 --- a/contrib/lisp/org-screenshot.el +++ b/contrib/lisp/org-screenshot.el @@ -1,6 +1,6 @@ ;;; org-screenshot.el --- Take and manage screenshots in Org-mode files ;; -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; ;; Author: Max Mikhanosha <max@openchat.com> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-sudoku.el b/contrib/lisp/org-sudoku.el index c6a64e1..baa9fcd 100644 --- a/contrib/lisp/org-sudoku.el +++ b/contrib/lisp/org-sudoku.el @@ -1,6 +1,6 @@ ;;; org-sudoku.el --- Greate and solve SUDOKU games in Org tables -;; Copyright (C) 2012-2016 Free Software Foundation, Inc. +;; Copyright (C) 2012-2017 Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp, games diff --git a/contrib/lisp/org-toc.el b/contrib/lisp/org-toc.el index a692d85..1c14a4f 100644 --- a/contrib/lisp/org-toc.el +++ b/contrib/lisp/org-toc.el @@ -1,6 +1,6 @@ ;;; org-toc.el --- Table of contents for Org-mode buffer -;; Copyright 2007-2016 Free Software Foundation, Inc. +;; Copyright 2007-2017 Free Software Foundation, Inc. ;; ;; Author: Bastien Guerry <bzg@gnu.org> ;; Keywords: Org table of contents @@ -354,7 +354,7 @@ If DELETE is non-nil, delete other windows when in the Org buffer." (defun org-toc-quit () "Quit the current Org TOC buffer." (interactive) - (kill-this-buffer) + (kill-buffer) (other-window 1) (delete-other-windows)) diff --git a/contrib/lisp/org-track.el b/contrib/lisp/org-track.el index 50f10cd..36724de 100644 --- a/contrib/lisp/org-track.el +++ b/contrib/lisp/org-track.el @@ -1,6 +1,6 @@ ;;; org-track.el --- Track the most recent Org-mode version available. ;; -;; Copyright (C) 2009-2016 Free Software Foundation, Inc. +;; Copyright (C) 2009-2017 Free Software Foundation, Inc. ;; ;; Author: Bastien Guerry <bzg@gnu.org> ;; Eric S Fraga <e.fraga at ucl.ac dot uk> diff --git a/contrib/lisp/org-vm.el b/contrib/lisp/org-vm.el index 070d2f8..4deca8f 100644 --- a/contrib/lisp/org-vm.el +++ b/contrib/lisp/org-vm.el @@ -1,6 +1,6 @@ ;;; org-vm.el --- Support for links to VM messages from within Org-mode -;; Copyright (C) 2004-2016 Free Software Foundation, Inc. +;; Copyright (C) 2004-2017 Free Software Foundation, Inc. ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/org-wikinodes.el b/contrib/lisp/org-wikinodes.el index 02c170d..35242db 100644 --- a/contrib/lisp/org-wikinodes.el +++ b/contrib/lisp/org-wikinodes.el @@ -1,6 +1,6 @@ ;;; org-wikinodes.el --- Wiki-like CamelCase links to outline nodes -;; Copyright (C) 2010-2016 Free Software Foundation, Inc. +;; Copyright (C) 2010-2017 Free Software Foundation, Inc. ;; Author: Carsten Dominik <carsten at orgmode dot org> ;; Keywords: outlines, hypermedia, calendar, wp @@ -252,7 +252,7 @@ If there is no such wiki target, return nil." (defvar target-alist) (defvar last-section-target) (defvar org-export-target-aliases) -(defun org-wikinodes-set-wiki-targets-during-export () +(defun org-wikinodes-set-wiki-targets-during-export (_) (let ((line (buffer-substring (point-at-bol) (point-at-eol))) (case-fold-search nil) wtarget a) @@ -268,9 +268,8 @@ If there is no such wiki target, return nil." (car org-export-target-aliases)))) (push (caar target-alist) (cdr a))))) -(defun org-wikinodes-process-links-for-export () +(defun org-wikinodes-process-links-for-export (_) "Process Wiki links in the export preprocess buffer. - Try to find target matches in the wiki scope and replace CamelCase words with working links." (let ((re org-wikinodes-camel-regexp) @@ -289,7 +288,7 @@ with working links." (cond ((org-find-exact-headline-in-buffer link (current-buffer)) ;; Found in current buffer - (insert (format "[[#%s][%s]]" link link))) + (insert (format "[[*%s][%s]]" link link))) ((eq org-wikinodes-scope 'file) ;; No match in file, and other files are not allowed (insert (format "%s" link))) @@ -305,19 +304,18 @@ with working links." (add-hook 'org-ctrl-c-ctrl-c-hook 'org-wikinodes-clear-cache-when-on-target) ;; Make Wiki haeding create additional link names for headlines -(add-hook 'org-export-define-heading-targets-headline-hook +(add-hook 'org-export-before-parsing-hook 'org-wikinodes-set-wiki-targets-during-export) ;; Turn Wiki links into links the exporter will treat correctly -(add-hook 'org-export-preprocess-after-radio-targets-hook +(add-hook 'org-export-before-parsing-hook 'org-wikinodes-process-links-for-export) ;; Activate CamelCase words as part of Org mode font lock (defun org-wikinodes-add-to-font-lock-keywords () "Add wikinode CamelCase highlighting to `org-font-lock-extra-keywords'." - (let ((m (member '(org-activate-plain-links (0 'org-link t)) - org-font-lock-extra-keywords))) + (let ((m (member '(org-activate-links) org-font-lock-extra-keywords))) (if m (push '(org-wikinodes-activate-links) (cdr m)) (message "Failed to add wikinodes to `org-font-lock-extra-keywords'.")))) diff --git a/contrib/lisp/org-wl.el b/contrib/lisp/org-wl.el index 01eee13..4f74d47 100644 --- a/contrib/lisp/org-wl.el +++ b/contrib/lisp/org-wl.el @@ -1,6 +1,6 @@ ;;; org-wl.el --- Support for links to Wanderlust messages from within Org-mode -;; Copyright (C) 2004-2016 Free Software Foundation, Inc. +;; Copyright (C) 2004-2017 Free Software Foundation, Inc. ;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp> ;; David Maus <dmaus at ictsoc dot de> diff --git a/contrib/lisp/orgtbl-sqlinsert.el b/contrib/lisp/orgtbl-sqlinsert.el index c8a39af..8fba18f 100644 --- a/contrib/lisp/orgtbl-sqlinsert.el +++ b/contrib/lisp/orgtbl-sqlinsert.el @@ -1,6 +1,6 @@ ;;; orgtbl-sqlinsert.el --- orgtbl to SQL insert statements. -;; Copyright (C) 2008-2016 Free Software Foundation +;; Copyright (C) 2008-2017 Free Software Foundation ;; Author: Jason Riedy <jason@acm.org> ;; Keywords: org, tables, sql diff --git a/contrib/lisp/ox-bibtex.el b/contrib/lisp/ox-bibtex.el index 56dec38..fb34a5e 100644 --- a/contrib/lisp/ox-bibtex.el +++ b/contrib/lisp/ox-bibtex.el @@ -235,7 +235,7 @@ Return new parse tree." ;; Update `org-bibtex-html-entries-alist'. (goto-char (point-min)) (while (re-search-forward - "a name=\"\\([-_a-zA-Z0-9:]+\\)\">\\(\\w+\\)" nil t) + "a name=\"\\([-_a-zA-Z0-9:]+\\)\">\\([^<]+\\)" nil t) (push (cons (match-string 1) (match-string 2)) org-bibtex-html-entries-alist))) ;; Open produced HTML file, wrap references within a block and diff --git a/contrib/lisp/ox-confluence.el b/contrib/lisp/ox-confluence.el index 48bc5ea..9de6ce7 100644 --- a/contrib/lisp/ox-confluence.el +++ b/contrib/lisp/ox-confluence.el @@ -56,6 +56,7 @@ (table-cell . org-confluence-table-cell) (table-row . org-confluence-table-row) (template . org-confluence-template) + (timestamp . org-confluence-timestamp) (underline . org-confluence-underline))) (defcustom org-confluence-lang-alist @@ -87,14 +88,19 @@ (format "\{\{%s\}\}" contents)) (defun org-confluence-headline (headline contents info) - (let ((low-level-rank (org-export-low-level-p headline info)) - (text (org-export-data (org-element-property :title headline) - info)) - (level (org-export-get-relative-level headline info))) + (let* ((low-level-rank (org-export-low-level-p headline info)) + (text (org-export-data (org-element-property :title headline) + info)) + (todo (org-export-data (org-element-property :todo-keyword headline) + info)) + (level (org-export-get-relative-level headline info)) + (todo-text (if (or (not (plist-get info :with-todo-keywords)) + (string= todo "")) + "" + (format "*{{%s}}* " todo)))) ;; Else: Standard headline. - (format "h%s. %s\n%s" level text - (if (org-string-nw-p contents) contents - "")))) + (format "h%s. %s%s\n%s" level todo-text text + (if (org-string-nw-p contents) contents "")))) (defun org-confluence-link (link desc info) (let ((raw-link (org-element-property :raw-link link))) @@ -142,15 +148,22 @@ a communication channel." (defun org-confluence-table-cell (table-cell contents info) (let ((table-row (org-export-get-parent table-cell))) - (concat - (when (org-export-table-row-starts-header-p table-row info) - "|") - contents "|"))) + (concat (and (org-export-table-row-starts-header-p table-row info) "|") + (if (= (length contents) 0) " " contents) + "|"))) (defun org-confluence-template (contents info) (let ((depth (plist-get info :with-toc))) (concat (when depth "\{toc\}\n\n") contents))) +(defun org-confluence-timestamp (timestamp _contents _info) + "Transcode a TIMESTAMP object from Org to Confluence. +CONTENTS and INFO are ignored." + (let ((translated (org-timestamp-translate timestamp))) + (if (string-prefix-p "[" translated) + (concat "(" (substring translated 1 -1) ")") + translated))) + (defun org-confluence-underline (underline contents info) (format "+%s+" contents)) diff --git a/contrib/lisp/ox-extra.el b/contrib/lisp/ox-extra.el index 85dae47..9cd6980 100644 --- a/contrib/lisp/ox-extra.el +++ b/contrib/lisp/ox-extra.el @@ -56,7 +56,7 @@ ;;; Code: (require 'ox) -(eval-when-compile (require 'cl)) +(require 'cl-lib) (defun org-latex-header-blocks-filter (backend) (when (org-export-derived-backend-p backend 'latex) @@ -72,8 +72,10 @@ (org-element-property :post-affiliated block))))))) (mapc (lambda (pos) (goto-char (nth 2 pos)) - (destructuring-bind + (cl-destructuring-bind (beg end &rest ignore) + ;; FIXME: `org-edit-src-find-region-and-lang' was + ;; removed in 9c06f8cce (2014-11-11). (org-edit-src-find-region-and-lang) (let ((contents-lines (split-string (buffer-substring-no-properties beg end) @@ -150,8 +152,27 @@ parent." (org-element-contents object))) (org-element-extract-element object))) info nil) + (org-extra--merge-sections data backend info) data) +(defun org-extra--merge-sections (data _backend info) + (org-element-map data 'headline + (lambda (hl) + (let ((sections + (cl-loop + for el in (org-element-map (org-element-contents hl) + '(headline section) #'identity info) + until (eq (org-element-type el) 'headline) + collect el))) + (when (and sections + (> (length sections) 1)) + (apply #'org-element-adopt-elements + (car sections) + (cl-mapcan (lambda (s) (org-element-contents s)) + (cdr sections))) + (mapc #'org-element-extract-element (cdr sections))))) + info)) + (defconst ox-extras '((latex-header-blocks org-latex-header-blocks-filter org-export-before-parsing-hook) (ignore-headlines org-export-ignore-headlines org-export-filter-parse-tree-functions)) diff --git a/contrib/lisp/ox-freemind.el b/contrib/lisp/ox-freemind.el index 85323a2..a2bf129 100644 --- a/contrib/lisp/ox-freemind.el +++ b/contrib/lisp/ox-freemind.el @@ -1,6 +1,6 @@ ;;; ox-freemind.el --- Freemind Mindmap Back-End for Org Export Engine -;; Copyright (C) 2013-2016 Free Software Foundation, Inc. +;; Copyright (C) 2013-2017 Free Software Foundation, Inc. ;; Author: Jambunathan K <kjambunathan at gmail dot com> ;; Keywords: outlines, hypermedia, calendar, wp diff --git a/contrib/lisp/ox-groff.el b/contrib/lisp/ox-groff.el index c83d44d..555a89d 100644 --- a/contrib/lisp/ox-groff.el +++ b/contrib/lisp/ox-groff.el @@ -1,6 +1,6 @@ ;;; ox-groff.el --- Groff Back-End for Org Export Engine -;; Copyright (C) 2011-2016 Free Software Foundation, Inc. +;; Copyright (C) 2011-2017 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou <n.goaziou at gmail dot com> ;; Author: Luis R Anaya <papoanaya aroba hot mail punto com> @@ -823,9 +823,7 @@ information." (concat (format "\\fB%s\\fP " org-clock-string) (format org-groff-inactive-timestamp-format - (concat (org-translate-time - (org-element-property :raw-value - (org-element-property :value clock))) + (concat (org-timestamp-translate (org-element-property :value clock)) (let ((time (org-element-property :duration clock))) (and time (format " (%s)" time))))))) @@ -1409,22 +1407,19 @@ information." (concat (format "\\fR %s \\fP" org-closed-string) (format org-groff-inactive-timestamp-format - (org-translate-time - (org-element-property :raw-value closed)))))) + (org-timestamp-translate closed))))) (let ((deadline (org-element-property :deadline planning))) (when deadline (concat (format "\\fB %s \\fP" org-deadline-string) (format org-groff-active-timestamp-format - (org-translate-time - (org-element-property :raw-value deadline)))))) + (org-timestamp-translate deadline))))) (let ((scheduled (org-element-property :scheduled planning))) (when scheduled (concat (format "\\fR %s \\fP" org-scheduled-string) (format org-groff-active-timestamp-format - (org-translate-time - (org-element-property :raw-value scheduled)))))))) + (org-timestamp-translate scheduled))))))) "") "")) diff --git a/contrib/lisp/ox-koma-letter.el b/contrib/lisp/ox-koma-letter.el index 801ab7d..37da54c 100644 --- a/contrib/lisp/ox-koma-letter.el +++ b/contrib/lisp/ox-koma-letter.el @@ -1,6 +1,6 @@ ;;; ox-koma-letter.el --- KOMA Scrlttr2 Back-End for Org Export Engine -;; Copyright (C) 2007-2016 Free Software Foundation, Inc. +;; Copyright (C) 2007-2017 Free Software Foundation, Inc. ;; Author: Nicolas Goaziou <n.goaziou AT gmail DOT com> ;; Alan Schmitt <alan.schmitt AT polytechnique DOT org> @@ -631,7 +631,7 @@ holding export options." ;; LaTeX compiler (org-latex--insert-compiler info) ;; Document class and packages. - (org-latex--make-preamble info) + (org-latex-make-preamble info) ;; Settings. They can come from three locations, in increasing ;; order of precedence: global variables, LCO files and in-buffer ;; settings. Thus, we first insert settings coming from global diff --git a/contrib/lisp/ox-s5.el b/contrib/lisp/ox-s5.el index 503bfd0..8f95010 100644 --- a/contrib/lisp/ox-s5.el +++ b/contrib/lisp/ox-s5.el @@ -304,13 +304,15 @@ holding export options." "Return complete document string after HTML conversion. CONTENTS is the transcoded contents string. INFO is a plist holding export options." - (let ((org-html-divs - (if (equal (plist-get info :html-container) "li") - (append '((content "ol" "content")) org-s5--divs) - org-s5--divs)) - (info (plist-put + (let ((info (plist-put + (plist-put (plist-put info :html-preamble (plist-get info :s5-preamble)) - :html-postamble (plist-get info :s5-postamble)))) + :html-postamble + (plist-get info :s5-postamble)) + :html-divs + (if (equal "li" (plist-get info :html-container)) + (cons '(content "ol" "content") org-s5--divs) + org-s5--divs)))) (mapconcat 'identity (list diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el index 133d8a3..d856878 100644 --- a/contrib/lisp/ox-taskjuggler.el +++ b/contrib/lisp/ox-taskjuggler.el @@ -1,6 +1,6 @@ ;;; ox-taskjuggler.el --- TaskJuggler Back-End for Org Export Engine ;; -;; Copyright (C) 2007-2016 Free Software Foundation, Inc. +;; Copyright (C) 2007-2017 Free Software Foundation, Inc. ;; ;; Emacs Lisp Archive Entry ;; Filename: ox-taskjuggler.el |