diff options
author | Sebastien Delafond <seb@debian.org> | 2013-08-11 16:27:56 +0200 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:27 +0200 |
commit | 53b246b7d66bfa03ab9bcf47d4647913b401e3d6 (patch) | |
tree | b5ea4e732c2219456d13048feb05b37b22a76391 /contrib/lisp/org-man.el | |
parent | 8606e2621fc00fd8b334a06924aeef3aab7a2e4d (diff) | |
parent | e32a45ed36d6000db4b39171149072d11b77af72 (diff) |
Imported Debian patch 8.0.7-1
Diffstat (limited to 'contrib/lisp/org-man.el')
-rw-r--r-- | contrib/lisp/org-man.el | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/contrib/lisp/org-man.el b/contrib/lisp/org-man.el index 27e8cca..a9db83d 100644 --- a/contrib/lisp/org-man.el +++ b/contrib/lisp/org-man.el @@ -7,27 +7,25 @@ ;; ;; This file is not yet part of GNU Emacs. ;; -;; GNU Emacs is free software; you can redistribute it and/or modify +;; 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 ;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. -;; GNU Emacs is distributed in the hope that it will be useful, +;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: (require 'org) -(org-add-link-type "man" 'org-man-open) +(org-add-link-type "man" 'org-man-open 'org-man-export) (add-hook 'org-store-link-functions 'org-man-store-link) (defcustom org-man-command 'man @@ -59,6 +57,17 @@ PATH should be a topic that can be thrown at the man command." (match-string 1 (buffer-name)) (error "Cannot create link to this man page"))) +(defun org-man-export (link description format) + "Export a man page link from Org files." + (let ((path (format "http://man.he.net/?topic=%s§ion=all" link)) + (desc (or description link))) + (cond + ((eq format 'html) (format "<a target=\"_blank\" href=\"%s\">%s</a>" path desc)) + ((eq format 'latex) (format "\\href{%s}{%s}" path desc)) + ((eq format 'texinfo) (format "@uref{%s,%s}" path desc)) + ((eq format 'ascii) (format "%s (%s)" desc path)) + (t path)))) + (provide 'org-man) ;;; org-man.el ends here |