2021-04-19 12:21:01 +02:00
|
|
|
|
;;; ox-man.el --- Man Back-End for Org Export Engine -*- lexical-binding: t; -*-
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
2022-01-01 02:45:51 -05:00
|
|
|
|
;; Copyright (C) 2011-2022 Free Software Foundation, Inc.
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
;; Author: Nicolas Goaziou <n.goaziou at gmail dot com>
|
|
|
|
|
;; Luis R Anaya <papoanaya aroba hot mail punto com>
|
|
|
|
|
;; Keywords: outlines, hypermedia, calendar, wp
|
|
|
|
|
|
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs 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 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
;; GNU Emacs 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
|
2017-09-13 15:52:52 -07:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
;;
|
|
|
|
|
;; This library implements a Man back-end for Org generic exporter.
|
|
|
|
|
;;
|
|
|
|
|
;; To test it, run
|
|
|
|
|
;;
|
|
|
|
|
;; M-: (org-export-to-buffer 'man "*Test Man*") RET
|
|
|
|
|
;;
|
2017-06-21 13:20:20 +02:00
|
|
|
|
;; in an Org buffer then switch to the buffer to see the Man export.
|
|
|
|
|
;; See ox.el for more details on how this exporter works.
|
2013-11-12 14:06:26 +01:00
|
|
|
|
;;
|
|
|
|
|
;; It introduces one new buffer keywords:
|
|
|
|
|
;; "MAN_CLASS_OPTIONS".
|
|
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(require 'cl-lib)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(require 'ox)
|
|
|
|
|
|
2020-12-13 13:44:15 +01:00
|
|
|
|
;;; Function Declarations
|
|
|
|
|
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(defvar org-export-man-default-packages-alist)
|
|
|
|
|
(defvar org-export-man-packages-alist)
|
|
|
|
|
(defvar orgtbl-exp-regexp)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Define Back-End
|
|
|
|
|
|
|
|
|
|
(org-export-define-backend 'man
|
|
|
|
|
'((babel-call . org-man-babel-call)
|
|
|
|
|
(bold . org-man-bold)
|
|
|
|
|
(center-block . org-man-center-block)
|
|
|
|
|
(code . org-man-code)
|
|
|
|
|
(drawer . org-man-drawer)
|
|
|
|
|
(dynamic-block . org-man-dynamic-block)
|
|
|
|
|
(entity . org-man-entity)
|
|
|
|
|
(example-block . org-man-example-block)
|
|
|
|
|
(export-block . org-man-export-block)
|
|
|
|
|
(export-snippet . org-man-export-snippet)
|
|
|
|
|
(fixed-width . org-man-fixed-width)
|
|
|
|
|
(footnote-definition . org-man-footnote-definition)
|
|
|
|
|
(footnote-reference . org-man-footnote-reference)
|
|
|
|
|
(headline . org-man-headline)
|
|
|
|
|
(horizontal-rule . org-man-horizontal-rule)
|
|
|
|
|
(inline-babel-call . org-man-inline-babel-call)
|
|
|
|
|
(inline-src-block . org-man-inline-src-block)
|
|
|
|
|
(inlinetask . org-man-inlinetask)
|
|
|
|
|
(italic . org-man-italic)
|
|
|
|
|
(item . org-man-item)
|
|
|
|
|
(keyword . org-man-keyword)
|
|
|
|
|
(line-break . org-man-line-break)
|
|
|
|
|
(link . org-man-link)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(node-property . org-man-node-property)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(paragraph . org-man-paragraph)
|
|
|
|
|
(plain-list . org-man-plain-list)
|
|
|
|
|
(plain-text . org-man-plain-text)
|
|
|
|
|
(planning . org-man-planning)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(property-drawer . org-man-property-drawer)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(quote-block . org-man-quote-block)
|
|
|
|
|
(radio-target . org-man-radio-target)
|
|
|
|
|
(section . org-man-section)
|
|
|
|
|
(special-block . org-man-special-block)
|
|
|
|
|
(src-block . org-man-src-block)
|
|
|
|
|
(statistics-cookie . org-man-statistics-cookie)
|
|
|
|
|
(strike-through . org-man-strike-through)
|
|
|
|
|
(subscript . org-man-subscript)
|
|
|
|
|
(superscript . org-man-superscript)
|
|
|
|
|
(table . org-man-table)
|
|
|
|
|
(table-cell . org-man-table-cell)
|
|
|
|
|
(table-row . org-man-table-row)
|
|
|
|
|
(target . org-man-target)
|
|
|
|
|
(template . org-man-template)
|
|
|
|
|
(timestamp . org-man-timestamp)
|
|
|
|
|
(underline . org-man-underline)
|
|
|
|
|
(verbatim . org-man-verbatim)
|
|
|
|
|
(verse-block . org-man-verse-block))
|
|
|
|
|
:menu-entry
|
2017-06-21 13:20:20 +02:00
|
|
|
|
'(?M "Export to MAN"
|
2013-11-12 14:06:26 +01:00
|
|
|
|
((?m "As MAN file" org-man-export-to-man)
|
|
|
|
|
(?p "As PDF file" org-man-export-to-pdf)
|
|
|
|
|
(?o "As PDF file and open"
|
|
|
|
|
(lambda (a s v b)
|
|
|
|
|
(if a (org-man-export-to-pdf t s v b)
|
|
|
|
|
(org-open-file (org-man-export-to-pdf nil s v b)))))))
|
|
|
|
|
:options-alist
|
|
|
|
|
'((:man-class "MAN_CLASS" nil nil t)
|
|
|
|
|
(:man-class-options "MAN_CLASS_OPTIONS" nil nil t)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(:man-header-extra "MAN_HEADER" nil nil newline)
|
|
|
|
|
;; Other variables.
|
|
|
|
|
(:man-tables-centered nil nil org-man-tables-centered)
|
|
|
|
|
(:man-tables-verbatim nil nil org-man-tables-verbatim)
|
|
|
|
|
(:man-table-scientific-notation nil nil org-man-table-scientific-notation)
|
|
|
|
|
(:man-source-highlight nil nil org-man-source-highlight)
|
|
|
|
|
(:man-source-highlight-langs nil nil org-man-source-highlight-langs)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; User Configurable Variables
|
|
|
|
|
|
|
|
|
|
(defgroup org-export-man nil
|
|
|
|
|
"Options for exporting Org mode files to Man."
|
|
|
|
|
:tag "Org Export Man"
|
|
|
|
|
:group 'org-export)
|
|
|
|
|
|
|
|
|
|
;;; Tables
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-tables-centered t
|
|
|
|
|
"When non-nil, tables are exported in a center environment."
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-tables-verbatim nil
|
|
|
|
|
"When non-nil, tables are exported verbatim."
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-table-scientific-notation "%sE%s"
|
|
|
|
|
"Format string to display numbers in scientific notation.
|
|
|
|
|
The format should have \"%s\" twice, for mantissa and exponent
|
|
|
|
|
\(i.e. \"%s\\\\times10^{%s}\").
|
|
|
|
|
|
|
|
|
|
When nil, no transformation is made."
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(choice
|
|
|
|
|
(string :tag "Format string")
|
|
|
|
|
(const :tag "No formatting")))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Inlinetasks
|
|
|
|
|
;; Src blocks
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-source-highlight nil
|
lisp/*.el: Fix typos and other trivial doc fixes
* lisp/allout-widgets.el (allout-widgets-auto-activation)
(allout-current-decorated-p):
* lisp/auth-source.el (auth-source-protocols):
* lisp/autorevert.el (auto-revert-set-timer):
* lisp/battery.el (battery-mode-line-limit):
* lisp/calc/calcalg3.el (math-map-binop):
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
* lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute):
* lisp/calendar/calendar.el (calendar-date-echo-text)
(calendar-generate-month, calendar-string-spread)
(calendar-cursor-to-date, calendar-read, calendar-read-date)
(calendar-mark-visible-date, calendar-dayname-on-or-before):
* lisp/calendar/diary-lib.el (diary-ordinal-suffix):
* lisp/cedet/ede/autoconf-edit.el (autoconf-new-program)
(autoconf-find-last-macro, autoconf-parameter-strip):
* lisp/cedet/ede/config.el (ede-target-with-config-build):
* lisp/cedet/ede/linux.el (ede-linux--detect-architecture)
(ede-linux--get-architecture):
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache)
(semantic-displayer-abstract, semantic-displayer-point-position):
* lisp/cedet/semantic/format.el (semantic-format-face-alist)
(semantic-format-tag-short-doc):
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time)
(semantic-idle-breadcrumbs-display-function)
(semantic-idle-breadcrumbs-format-tag-list-function):
* lisp/cedet/semantic/lex.el (semantic-lex-map-types)
(define-lex, define-lex-block-type-analyzer):
* lisp/cedet/semantic/senator.el (senator-search-default-tag-filter):
* lisp/cedet/semantic/symref.el (semantic-symref-result)
(semantic-symref-hit-to-tag-via-db):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass):
* lisp/cedet/semantic/tag.el (semantic-tag-new-variable)
(semantic-tag-new-include, semantic-tag-new-package)
(semantic-tag-set-faux, semantic-create-tag-proxy)
(semantic-tag-function-parent)
(semantic-tag-components-with-overlays):
* lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces)
(srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict):
* lisp/cedet/srecode/dictionary.el (srecode-create-dictionary)
(srecode-dictionary-add-entries, srecode-dictionary-lookup-name)
(srecode-create-dictionaries-from-tags):
* lisp/cmuscheme.el (scheme-compile-region):
* lisp/color.el (color-lab-to-lch):
* lisp/doc-view.el (doc-view-image-width)
(doc-view-set-up-single-converter):
* lisp/dynamic-setting.el (font-setting-change-default-font)
(dynamic-setting-handle-config-changed-event):
* lisp/elec-pair.el (electric-pair-text-pairs)
(electric-pair-skip-whitespace-function)
(electric-pair-string-bound-function):
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance)
(avl-tree-member, avl-tree-mapcar, avl-tree-iter):
* lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree):
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag)
(checkdoc-spellcheck-documentation-flag, checkdoc-ispell)
(checkdoc-ispell-current-buffer, checkdoc-ispell-interactive)
(checkdoc-ispell-message-interactive)
(checkdoc-ispell-message-text, checkdoc-ispell-start)
(checkdoc-ispell-continue, checkdoc-ispell-comments)
(checkdoc-ispell-defun):
* lisp/emacs-lisp/cl-generic.el (cl--generic-search-method):
* lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group):
* lisp/emacs-lisp/lisp.el (forward-sexp, up-list):
* lisp/emacs-lisp/package-x.el (package--archive-contents-from-file):
* lisp/emacs-lisp/package.el (package-desc)
(package--make-autoloads-and-stuff, package-hidden-regexps):
* lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup):
* lisp/emacs-lisp/testcover.el (testcover-nohits)
(testcover-1value):
* lisp/epg.el (epg-receive-keys, epg-start-edit-key):
* lisp/erc/erc-backend.el (erc-server-processing-p)
(erc-split-line-length, erc-server-coding-system)
(erc-server-send, erc-message):
* lisp/erc/erc-button.el (erc-button-face, erc-button-alist)
(erc-browse-emacswiki):
* lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login):
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation):
* lisp/erc/erc-log.el (erc-current-logfile):
* lisp/erc/erc-match.el (erc-log-match-format)
(erc-text-matched-hook):
* lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug):
* lisp/erc/erc-networks.el (erc-server-alist)
(erc-networks-alist, erc-current-network):
* lisp/erc/erc-ring.el (erc-input-ring-index):
* lisp/erc/erc-speedbar.el (erc-speedbar)
(erc-speedbar-update-channel):
* lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag):
* lisp/erc/erc-track.el (erc-track-position-in-mode-line)
(erc-track-remove-from-mode-line, erc-modified-channels-update)
(erc-track-last-non-erc-buffer, erc-track-sort-by-importance)
(erc-track-get-active-buffer):
* lisp/erc/erc.el (erc-get-channel-user-list)
(erc-echo-notice-hook, erc-echo-notice-always-hook)
(erc-wash-quit-reason, erc-format-@nick):
* lisp/ffap.el (ffap-latex-mode):
* lisp/files.el (abort-if-file-too-large)
(dir-locals--get-sort-score, buffer-stale--default-function):
* lisp/filesets.el (filesets-tree-max-level, filesets-data)
(filesets-update-pre010505):
* lisp/gnus/gnus-agent.el (gnus-agent-flush-cache):
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-prefer-mid-or-mail):
* lisp/gnus/gnus-cus.el (gnus-group-parameters):
* lisp/gnus/gnus-demon.el (gnus-demon-handlers)
(gnus-demon-run-callback):
* lisp/gnus/gnus-dired.el (gnus-dired-print):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer):
* lisp/gnus/gnus-range.el (gnus-range-normalize):
* lisp/gnus/gnus-spec.el (gnus-pad-form):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-closed, gnus-server-denied)
(gnus-server-offline):
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir)
(gnus-refer-thread-limit-to-thread)
(gnus-summary-limit-include-thread, gnus-summary-refer-thread)
(gnus-summary-find-matching):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server):
* lisp/gnus/mail-source.el (mail-source-incoming-file-prefix):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style-outlook, message-cite-style-thunderbird)
(message-cite-style-gmail, message--send-mail-maybe-partially):
* lisp/gnus/mm-extern.el (mm-inline-external-body):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mml-sec.el (mml-secure-message-sign)
(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
* lisp/gnus/mml2015.el (mml2015-epg-key-image)
(mml2015-epg-key-image-to-string):
* lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail):
* lisp/gnus/nnheader.el (nnheader-directory-files-is-safe):
* lisp/gnus/nnir.el (nnir-search-history)
(nnir-imap-search-other, nnir-artlist-length)
(nnir-artlist-article, nnir-artitem-group, nnir-artitem-number)
(nnir-artitem-rsv, nnir-article-group, nnir-article-number)
(nnir-article-rsv, nnir-article-ids, nnir-categorize)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-hyrex-additional-switches)
(gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms)
(nnir-read-parm, nnir-read-server-parm, nnir-search-thread):
* lisp/gnus/nnmairix.el (nnmairix-default-group)
(nnmairix-propagate-marks):
* lisp/gnus/smime.el (smime-keys, smime-crl-check)
(smime-verify-buffer, smime-noverify-buffer):
* lisp/gnus/spam-report.el (spam-report-url-ping-mm-url):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header)
(spam-spamassassin-spam-status-header, spam-sa-learn-rebuild)
(spam-classifications, spam-check-stat, spam-spamassassin-score):
* lisp/help.el (describe-minor-mode-from-symbol):
* lisp/hippie-exp.el (hippie-expand-ignore-buffers):
* lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face)
(hfy-begin-span):
* lisp/ibuf-ext.el (ibuffer-update-saved-filters-format)
(ibuffer-saved-filters, ibuffer-old-saved-filters-warning)
(ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters)
(eval, ibuffer-unary-operand, file-extension, directory):
* lisp/image-dired.el (image-dired-cmd-pngcrush-options):
* lisp/image-mode.el (image-toggle-display):
* lisp/international/ccl.el (ccl-compile-read-multibyte-character)
(ccl-compile-write-multibyte-character):
* lisp/international/kkc.el (kkc-save-init-file):
* lisp/international/latin1-disp.el (latin1-display):
* lisp/international/ogonek.el (ogonek-name-encoding-alist)
(ogonek-information, ogonek-lookup-encoding)
(ogonek-deprefixify-region):
* lisp/isearch.el (isearch-filter-predicate)
(isearch--momentary-message):
* lisp/jsonrpc.el (jsonrpc-connection-send)
(jsonrpc-process-connection, jsonrpc-shutdown)
(jsonrpc--async-request-1):
* lisp/language/tibet-util.el (tibetan-char-p):
* lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date)
(feedmail-last-chance-hook, feedmail-before-fcc-hook)
(feedmail-send-it-immediately-wrapper, feedmail-find-eoh):
* lisp/mail/hashcash.el (hashcash-generate-payment)
(hashcash-generate-payment-async, hashcash-insert-payment)
(hashcash-verify-payment):
* lisp/mail/rmail.el (rmail-movemail-variant-in-use)
(rmail-get-attr-value):
* lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime):
* lisp/mail/rmailsum.el (rmail-summary-show-message):
* lisp/mail/supercite.el (sc-raw-mode-toggle):
* lisp/man.el (Man-start-calling):
* lisp/mh-e/mh-acros.el (mh-do-at-event-location)
(mh-iterate-on-messages-in-region, mh-iterate-on-range):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases)
(mh-alias-reload, mh-alias-ali)
(mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file)
(mh-alias-add-alias):
* lisp/mouse.el (mouse-save-then-kill):
* lisp/net/browse-url.el (browse-url-default-macosx-browser):
* lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value)
(eudc-variable-server-value, eudc-update-variable)
(eudc-expand-inline):
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result):
* lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list):
* lisp/net/pop3.el (pop3-list):
* lisp/net/soap-client.el (soap-namespace-put)
(soap-xs-parse-sequence, soap-parse-envelope):
* lisp/net/soap-inspect.el (soap-inspect-xs-complex-type):
* lisp/nxml/rng-xsd.el (rng-xsd-date-to-days):
* lisp/org/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/org/ob-J.el (org-babel-execute:J):
* lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/org/ob-awk.el (org-babel-execute:awk):
* lisp/org/ob-core.el (org-babel-process-file-name):
* lisp/org/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/org/ob-forth.el (org-babel-execute:forth):
* lisp/org/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/org/ob-groovy.el (org-babel-execute:groovy):
* lisp/org/ob-io.el (org-babel-execute:io):
* lisp/org/ob-js.el (org-babel-execute:js):
* lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/org/ob-lua.el (org-babel-prep-session:lua):
* lisp/org/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/org/ob-processing.el (org-babel-prep-session:processing):
* lisp/org/ob-python.el (org-babel-prep-session:python):
* lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/org/ob-shen.el (org-babel-execute:shen):
* lisp/org/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org/org-colview.el (org-columns--overlay-text):
* lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org/org-indent.el (org-indent-set-line-properties):
* lisp/org/org-macs.el (org-get-limited-outline-regexp):
* lisp/org/org-mobile.el (org-mobile-files):
* lisp/org/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties, org-open-at-point-global)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/org/ox-html.el (org-html-checkbox-type):
* lisp/org/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/org/ox-publish.el (org-publish-sitemap-default):
* lisp/outline.el (outline-head-from-level):
* lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-calc-command-indent, dcl-indent-to):
* lisp/progmodes/flymake.el (flymake-make-diagnostic)
(flymake--overlays, flymake-diagnostic-functions)
(flymake-diagnostic-types-alist, flymake--backend-state)
(flymake-is-running, flymake--collect, flymake-mode):
* lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop)
(gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer):
* lisp/progmodes/grep.el (grep-error-screen-columns):
* lisp/progmodes/gud.el (gud-prev-expr):
* lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column)
(ps-run-goto-error):
* lisp/progmodes/python.el (python-eldoc-get-doc)
(python-eldoc-function-timeout-permanent, python-eldoc-function):
* lisp/shadowfile.el (shadow-make-group):
* lisp/speedbar.el (speedbar-obj-do-check):
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook):
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib):
* lisp/textmodes/reftex-index.el (reftex-index-goto-entry)
(reftex-index-kill, reftex-index-undo):
* lisp/textmodes/reftex-parse.el (reftex-context-substring):
* lisp/textmodes/reftex.el (reftex-TeX-master-file):
* lisp/textmodes/rst.el (rst-next-hdr, rst-toc)
(rst-uncomment-region, rst-font-lock-extend-region-internal):
* lisp/thumbs.el (thumbs-mode):
* lisp/vc/ediff-util.el (ediff-restore-diff):
* lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p):
* lisp/wid-edit.el (widget-field-value-set, string):
* lisp/x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
|
|
|
|
"Use GNU source highlight to embellish source blocks."
|
2013-11-12 14:06:26 +01:00
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-source-highlight-langs
|
|
|
|
|
'((emacs-lisp "lisp") (lisp "lisp") (clojure "lisp")
|
|
|
|
|
(scheme "scheme")
|
|
|
|
|
(c "c") (cc "cpp") (csharp "csharp") (d "d")
|
|
|
|
|
(fortran "fortran") (cobol "cobol") (pascal "pascal")
|
|
|
|
|
(ada "ada") (asm "asm")
|
|
|
|
|
(perl "perl") (cperl "perl")
|
|
|
|
|
(python "python") (ruby "ruby") (tcl "tcl") (lua "lua")
|
|
|
|
|
(java "java") (javascript "javascript")
|
|
|
|
|
(tex "latex")
|
|
|
|
|
(shell-script "sh") (awk "awk") (diff "diff") (m4 "m4")
|
|
|
|
|
(ocaml "caml") (caml "caml")
|
|
|
|
|
(sql "sql") (sqlite "sql")
|
|
|
|
|
(html "html") (css "css") (xml "xml")
|
|
|
|
|
(bat "bat") (bison "bison") (clipper "clipper")
|
|
|
|
|
(ldap "ldap") (opa "opa")
|
|
|
|
|
(php "php") (postscript "postscript") (prolog "prolog")
|
|
|
|
|
(properties "properties") (makefile "makefile")
|
2021-09-29 18:48:59 -04:00
|
|
|
|
(tml "tml") (vbscript "vbscript") (xorg "xorg"))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Alist mapping languages to their listing language counterpart.
|
|
|
|
|
The key is a symbol, the major mode symbol without the \"-mode\".
|
|
|
|
|
The value is the string that should be inserted as the language
|
|
|
|
|
parameter for the listings package. If the mode name and the
|
|
|
|
|
listings name are the same, the language does not need an entry
|
|
|
|
|
in this list - but it does not hurt if it is present."
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(repeat
|
|
|
|
|
(list
|
|
|
|
|
(symbol :tag "Major mode ")
|
|
|
|
|
(string :tag "Listings language"))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Compilation
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-pdf-process
|
|
|
|
|
'("tbl %f | eqn | groff -man | ps2pdf - > %b.pdf"
|
|
|
|
|
"tbl %f | eqn | groff -man | ps2pdf - > %b.pdf"
|
|
|
|
|
"tbl %f | eqn | groff -man | ps2pdf - > %b.pdf")
|
|
|
|
|
|
|
|
|
|
"Commands to process a Man file to a PDF file.
|
2017-06-21 13:20:20 +02:00
|
|
|
|
|
2013-11-12 14:06:26 +01:00
|
|
|
|
This is a list of strings, each of them will be given to the
|
|
|
|
|
shell as a command. %f in the command will be replaced by the
|
2017-06-21 13:20:20 +02:00
|
|
|
|
relative file name, %F by the absolute file name, %b by the file
|
|
|
|
|
base name (i.e. without directory and extension parts), %o by the
|
|
|
|
|
base directory of the file and %O by the absolute file name of
|
|
|
|
|
the output file.
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
By default, Org uses 3 runs of to do the processing.
|
|
|
|
|
|
|
|
|
|
Alternatively, this may be a Lisp function that does the
|
|
|
|
|
processing. This function should accept the file name as
|
|
|
|
|
its single argument."
|
|
|
|
|
:group 'org-export-pdf
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(choice
|
|
|
|
|
(repeat :tag "Shell command sequence"
|
|
|
|
|
(string :tag "Shell command"))
|
|
|
|
|
(const :tag "2 runs of pdfgroff"
|
|
|
|
|
("tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"
|
|
|
|
|
"tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf" ))
|
|
|
|
|
(const :tag "3 runs of pdfgroff"
|
|
|
|
|
("tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"
|
|
|
|
|
"tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"
|
|
|
|
|
"tbl %f | eqn | groff -mm | ps2pdf - > %b.pdf"))
|
|
|
|
|
(function)))
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-logfiles-extensions
|
|
|
|
|
'("log" "out" "toc")
|
|
|
|
|
"The list of file extensions to consider as Man logfiles."
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type '(repeat (string :tag "Extension")))
|
|
|
|
|
|
|
|
|
|
(defcustom org-man-remove-logfiles t
|
|
|
|
|
"Non-nil means remove the logfiles produced by PDF production.
|
|
|
|
|
These are the .aux, .log, .out, and .toc files."
|
|
|
|
|
:group 'org-export-man
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:package-version '(Org . "8.0")
|
|
|
|
|
:type 'boolean)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Internal Functions
|
|
|
|
|
|
|
|
|
|
(defun org-man--caption/label-string (element info)
|
|
|
|
|
"Return caption and label Man string for ELEMENT.
|
|
|
|
|
|
|
|
|
|
INFO is a plist holding contextual information. If there's no
|
|
|
|
|
caption nor label, return the empty string.
|
|
|
|
|
|
|
|
|
|
For non-floats, see `org-man--wrap-label'."
|
|
|
|
|
(let ((label (org-element-property :label element))
|
|
|
|
|
(main (org-export-get-caption element))
|
|
|
|
|
(short (org-export-get-caption element t)))
|
|
|
|
|
(cond ((and (not main) (not label)) "")
|
|
|
|
|
((not main) (format "\\fI%s\\fP" label))
|
|
|
|
|
;; Option caption format with short name.
|
|
|
|
|
(short (format "\\fR%s\\fP - \\fI\\P - %s\n"
|
|
|
|
|
(org-export-data short info)
|
|
|
|
|
(org-export-data main info)))
|
|
|
|
|
;; Standard caption format.
|
|
|
|
|
(t (format "\\fR%s\\fP" (org-export-data main info))))))
|
|
|
|
|
|
|
|
|
|
(defun org-man--wrap-label (element output)
|
|
|
|
|
"Wrap label associated to ELEMENT around OUTPUT, if appropriate.
|
|
|
|
|
This function shouldn't be used for floats. See
|
|
|
|
|
`org-man--caption/label-string'."
|
|
|
|
|
(let ((label (org-element-property :name element)))
|
|
|
|
|
(if (or (not output) (not label) (string= output "") (string= label ""))
|
|
|
|
|
output
|
|
|
|
|
(concat (format "%s\n.br\n" label) output))))
|
|
|
|
|
|
2017-12-06 15:02:15 +01:00
|
|
|
|
(defun org-man--protect-text (text)
|
|
|
|
|
"Protect minus and backslash characters in string TEXT."
|
|
|
|
|
(replace-regexp-in-string "-" "\\-" text nil t))
|
|
|
|
|
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Template
|
|
|
|
|
|
|
|
|
|
(defun org-man-template (contents info)
|
|
|
|
|
"Return complete document string after Man conversion.
|
|
|
|
|
CONTENTS is the transcoded contents string. INFO is a plist
|
|
|
|
|
holding export options."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(let* ((title (when (plist-get info :with-title)
|
|
|
|
|
(org-export-data (plist-get info :title) info)))
|
2021-09-29 18:48:59 -04:00
|
|
|
|
(attr (read (format "(%s)"
|
|
|
|
|
(mapconcat
|
|
|
|
|
#'identity
|
|
|
|
|
(list (plist-get info :man-class-options))
|
|
|
|
|
" "))))
|
|
|
|
|
(section-item (plist-get attr :section-id)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(concat
|
|
|
|
|
|
|
|
|
|
(cond
|
|
|
|
|
((and title (stringp section-item))
|
|
|
|
|
(format ".TH \"%s\" \"%s\" \n" title section-item))
|
|
|
|
|
((and (string= "" title) (stringp section-item))
|
|
|
|
|
(format ".TH \"%s\" \"%s\" \n" " " section-item))
|
|
|
|
|
(title
|
|
|
|
|
(format ".TH \"%s\" \"1\" \n" title))
|
|
|
|
|
(t
|
|
|
|
|
".TH \" \" \"1\" "))
|
|
|
|
|
contents)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Transcode Functions
|
|
|
|
|
|
|
|
|
|
;;; Babel Call
|
|
|
|
|
;;
|
|
|
|
|
;; Babel Calls are ignored.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Bold
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-bold (_bold contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode BOLD from Org to Man.
|
|
|
|
|
CONTENTS is the text with bold markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "\\fB%s\\fP" contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Center Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-center-block (center-block contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a CENTER-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the center block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(org-man--wrap-label
|
|
|
|
|
center-block
|
|
|
|
|
(format ".ce %d\n.nf\n%s\n.fi"
|
|
|
|
|
(- (length (split-string contents "\n")) 1 )
|
|
|
|
|
contents)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Code
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-code (code _contents _info)
|
2017-12-06 15:02:15 +01:00
|
|
|
|
"Transcode a CODE object from Org to Man."
|
|
|
|
|
(format "\\fC%s\\fP"
|
|
|
|
|
(org-man--protect-text (org-element-property :value code))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Drawer
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-drawer (_drawer contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a DRAWER element from Org to Man.
|
2021-09-29 18:48:59 -04:00
|
|
|
|
DRAWER holds the drawer information
|
|
|
|
|
CONTENTS holds the contents of the block.
|
|
|
|
|
INFO is a plist holding contextual information."
|
2013-11-12 14:06:26 +01:00
|
|
|
|
contents)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Dynamic Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-dynamic-block (dynamic-block contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a DYNAMIC-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information. See `org-export-data'."
|
|
|
|
|
(org-man--wrap-label dynamic-block contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Entity
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-entity (entity _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode an ENTITY object from Org to Man.
|
|
|
|
|
CONTENTS are the definition itself. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(org-element-property :utf-8 entity))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Example Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-example-block (example-block _contents info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode an EXAMPLE-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(org-man--wrap-label
|
|
|
|
|
example-block
|
|
|
|
|
(format ".RS\n.nf\n%s\n.fi\n.RE"
|
|
|
|
|
(org-export-format-code-default example-block info))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Export Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-export-block (export-block _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a EXPORT-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(when (string= (org-element-property :type export-block) "MAN")
|
|
|
|
|
(org-remove-indentation (org-element-property :value export-block))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Export Snippet
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-export-snippet (export-snippet _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a EXPORT-SNIPPET object from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(when (eq (org-export-snippet-backend export-snippet) 'man)
|
|
|
|
|
(org-element-property :value export-snippet)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Fixed Width
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-fixed-width (fixed-width _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a FIXED-WIDTH element from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(org-man--wrap-label
|
|
|
|
|
fixed-width
|
2019-12-03 23:27:04 +01:00
|
|
|
|
(format "\\fC\n%s\n\\fP"
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(org-remove-indentation
|
|
|
|
|
(org-element-property :value fixed-width)))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Footnote Definition
|
|
|
|
|
;;
|
|
|
|
|
;; Footnote Definitions are ignored.
|
|
|
|
|
|
|
|
|
|
;;; Footnote References
|
|
|
|
|
;;
|
|
|
|
|
;; Footnote References are Ignored
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Headline
|
|
|
|
|
|
|
|
|
|
(defun org-man-headline (headline contents info)
|
|
|
|
|
"Transcode a HEADLINE element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the headline. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(let* ((level (org-export-get-relative-level headline info))
|
2017-06-21 13:20:20 +02:00
|
|
|
|
;; Section formatting will set two placeholders: one for the
|
|
|
|
|
;; title and the other for the contents.
|
|
|
|
|
(section-fmt
|
|
|
|
|
(pcase level
|
|
|
|
|
(1 ".SH \"%s\"\n%s")
|
|
|
|
|
(2 ".SS \"%s\"\n%s")
|
|
|
|
|
(3 ".SS \"%s\"\n%s")
|
|
|
|
|
(_ nil)))
|
|
|
|
|
(text (org-export-data (org-element-property :title headline) info)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: This is a footnote section: ignore it.
|
|
|
|
|
((org-element-property :footnote-section-p headline) nil)
|
|
|
|
|
|
|
|
|
|
;; Case 2. This is a deep sub-tree: export it as a list item.
|
|
|
|
|
;; Also export as items headlines for which no section
|
|
|
|
|
;; format has been found.
|
|
|
|
|
((or (not section-fmt) (org-export-low-level-p headline info))
|
|
|
|
|
;; Build the real contents of the sub-tree.
|
|
|
|
|
(let ((low-level-body
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(concat
|
|
|
|
|
;; If the headline is the first sibling, start a list.
|
|
|
|
|
(when (org-export-first-sibling-p headline info)
|
|
|
|
|
(format "%s\n" ".RS"))
|
|
|
|
|
;; Itemize headline
|
|
|
|
|
".TP\n.ft I\n" text "\n.ft\n"
|
|
|
|
|
contents ".RE")))
|
|
|
|
|
;; If headline is not the last sibling simply return
|
|
|
|
|
;; LOW-LEVEL-BODY. Otherwise, also close the list, before any
|
|
|
|
|
;; blank line.
|
|
|
|
|
(if (not (org-export-last-sibling-p headline info)) low-level-body
|
|
|
|
|
(replace-regexp-in-string
|
|
|
|
|
"[ \t\n]*\\'" ""
|
|
|
|
|
low-level-body))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
;; Case 3. Standard headline. Export it as a section.
|
|
|
|
|
(t (format section-fmt text contents )))))
|
|
|
|
|
|
|
|
|
|
;;; Horizontal Rule
|
|
|
|
|
;; Not supported
|
|
|
|
|
|
|
|
|
|
;;; Inline Babel Call
|
|
|
|
|
;;
|
|
|
|
|
;; Inline Babel Calls are ignored.
|
|
|
|
|
|
|
|
|
|
;;; Inline Src Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-inline-src-block (inline-src-block _contents info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode an INLINE-SRC-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(let* ((code (org-element-property :value inline-src-block)))
|
|
|
|
|
(cond
|
2017-06-21 13:20:20 +02:00
|
|
|
|
((plist-get info :man-source-highlight)
|
|
|
|
|
(let* ((tmpdir temporary-file-directory)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(in-file (make-temp-name
|
|
|
|
|
(expand-file-name "srchilite" tmpdir)))
|
|
|
|
|
(out-file (make-temp-name
|
|
|
|
|
(expand-file-name "reshilite" tmpdir)))
|
|
|
|
|
(org-lang (org-element-property :language inline-src-block))
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(lst-lang
|
|
|
|
|
(cadr (assq (intern org-lang)
|
|
|
|
|
(plist-get info :man-source-highlight-langs))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(cmd (concat (expand-file-name "source-highlight")
|
|
|
|
|
" -s " lst-lang
|
|
|
|
|
" -f groff_man"
|
|
|
|
|
" -i " in-file
|
|
|
|
|
" -o " out-file )))
|
|
|
|
|
|
|
|
|
|
(if lst-lang
|
|
|
|
|
(let ((code-block "" ))
|
|
|
|
|
(with-temp-file in-file (insert code))
|
|
|
|
|
(shell-command cmd)
|
|
|
|
|
(setq code-block (org-file-contents out-file))
|
|
|
|
|
(delete-file in-file)
|
|
|
|
|
(delete-file out-file)
|
|
|
|
|
code-block)
|
|
|
|
|
(format ".RS\n.nf\n\\fC\\m[black]%s\\m[]\\fP\n.fi\n.RE\n"
|
|
|
|
|
code))))
|
|
|
|
|
|
|
|
|
|
;; Do not use a special package: transcode it verbatim.
|
|
|
|
|
(t
|
|
|
|
|
(concat ".RS\n.nf\n" "\\fC" "\n" code "\n"
|
|
|
|
|
"\\fP\n.fi\n.RE\n")))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Inlinetask
|
|
|
|
|
;;; Italic
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-italic (_italic contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode ITALIC from Org to Man.
|
|
|
|
|
CONTENTS is the text with italic markup. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "\\fI%s\\fP" contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Item
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(defun org-man-item (item contents info)
|
|
|
|
|
"Transcode an ITEM element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(let* ((bullet (org-element-property :bullet item))
|
|
|
|
|
(type (org-element-property :type (org-element-property :parent item)))
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(checkbox (pcase (org-element-property :checkbox item)
|
|
|
|
|
(`on "\\o'\\(sq\\(mu'")
|
|
|
|
|
(`off "\\(sq ")
|
|
|
|
|
(`trans "\\o'\\(sq\\(mi'")))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(tag (let ((tag (org-element-property :tag item)))
|
|
|
|
|
;; Check-boxes must belong to the tag.
|
|
|
|
|
(and tag (format "\\fB%s\\fP"
|
|
|
|
|
(concat checkbox
|
|
|
|
|
(org-export-data tag info)))))))
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(if (and (null tag) (null checkbox))
|
|
|
|
|
(let* ((bullet (org-trim bullet))
|
|
|
|
|
(marker (cond ((string= "-" bullet) "\\(em")
|
|
|
|
|
((string= "*" bullet) "\\(bu")
|
|
|
|
|
((eq type 'ordered)
|
|
|
|
|
(format "%s " (org-trim bullet)))
|
|
|
|
|
(t "\\(dg"))))
|
|
|
|
|
(concat ".IP " marker " 4\n"
|
|
|
|
|
(org-trim (or contents " " ))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(concat ".TP\n" (or tag (concat " " checkbox)) "\n"
|
|
|
|
|
(org-trim (or contents " " ))))))
|
|
|
|
|
|
|
|
|
|
;;; Keyword
|
|
|
|
|
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-keyword (keyword _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a KEYWORD element from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(let ((key (org-element-property :key keyword))
|
|
|
|
|
(value (org-element-property :value keyword)))
|
|
|
|
|
(cond
|
|
|
|
|
((string= key "MAN") value)
|
|
|
|
|
((string= key "INDEX") nil)
|
|
|
|
|
((string= key "TOC" ) nil))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Line Break
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-line-break (_line-break _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a LINE-BREAK object from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
"\n.br\n")
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Link
|
|
|
|
|
|
|
|
|
|
|
2020-12-13 13:44:15 +01:00
|
|
|
|
(defun org-man-link (link desc info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a LINK object from Org to Man.
|
|
|
|
|
|
|
|
|
|
DESC is the description part of the link, or the empty string.
|
|
|
|
|
INFO is a plist holding contextual information. See
|
|
|
|
|
`org-export-data'."
|
|
|
|
|
(let* ((type (org-element-property :type link))
|
2020-12-13 13:44:15 +01:00
|
|
|
|
(raw-path (org-element-property :path link))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
;; Ensure DESC really exists, or set it to nil.
|
|
|
|
|
(desc (and (not (string= desc "")) desc))
|
2020-12-13 13:44:15 +01:00
|
|
|
|
(path (pcase type
|
|
|
|
|
((or "http" "https" "ftp" "mailto")
|
|
|
|
|
(concat type ":" raw-path))
|
|
|
|
|
("file" (org-export-file-uri raw-path))
|
|
|
|
|
(_ raw-path))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(cond
|
2017-06-21 13:20:20 +02:00
|
|
|
|
;; Link type is handled by a special function.
|
2020-12-13 13:44:15 +01:00
|
|
|
|
((org-export-custom-protocol-maybe link desc 'man info))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
;; External link with a description part.
|
|
|
|
|
((and path desc) (format "%s \\fBat\\fP \\fI%s\\fP" path desc))
|
|
|
|
|
;; External link without a description part.
|
|
|
|
|
(path (format "\\fI%s\\fP" path))
|
|
|
|
|
;; No path, only description. Try to do something useful.
|
|
|
|
|
(t (format "\\fI%s\\fP" desc)))))
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
;;;; Node Property
|
|
|
|
|
|
|
|
|
|
(defun org-man-node-property (node-property _contents _info)
|
|
|
|
|
"Transcode a NODE-PROPERTY element from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
|
|
|
|
(format "%s:%s"
|
|
|
|
|
(org-element-property :key node-property)
|
|
|
|
|
(let ((value (org-element-property :value node-property)))
|
|
|
|
|
(if value (concat " " value) ""))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
;;; Paragraph
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-paragraph (paragraph contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a PARAGRAPH element from Org to Man.
|
|
|
|
|
CONTENTS is the contents of the paragraph, as a string. INFO is
|
|
|
|
|
the plist used as a communication channel."
|
|
|
|
|
(let ((parent (plist-get (nth 1 paragraph) :parent)))
|
|
|
|
|
(when parent
|
|
|
|
|
(let ((parent-type (car parent))
|
|
|
|
|
(fixed-paragraph ""))
|
|
|
|
|
(cond ((and (eq parent-type 'item)
|
|
|
|
|
(plist-get (nth 1 parent) :bullet ))
|
|
|
|
|
(setq fixed-paragraph (concat "" contents)))
|
|
|
|
|
((eq parent-type 'section)
|
|
|
|
|
(setq fixed-paragraph (concat ".PP\n" contents)))
|
|
|
|
|
((eq parent-type 'footnote-definition)
|
|
|
|
|
(setq fixed-paragraph contents))
|
|
|
|
|
(t (setq fixed-paragraph (concat "" contents))))
|
|
|
|
|
fixed-paragraph ))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Plain List
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-plain-list (_plain-list contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a PLAIN-LIST element from Org to Man.
|
|
|
|
|
CONTENTS is the contents of the list. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
contents)
|
|
|
|
|
|
|
|
|
|
;;; Plain Text
|
|
|
|
|
|
|
|
|
|
(defun org-man-plain-text (text info)
|
|
|
|
|
"Transcode a TEXT string from Org to Man.
|
|
|
|
|
TEXT is the string to transcode. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(let ((output text))
|
|
|
|
|
;; Protect various chars.
|
|
|
|
|
(setq output (replace-regexp-in-string
|
|
|
|
|
"\\(?:[^\\]\\|^\\)\\(\\\\\\)\\(?:[^%$#&{}~^_\\]\\|$\\)"
|
|
|
|
|
"$\\" output nil t 1))
|
|
|
|
|
;; Activate smart quotes. Be sure to provide original TEXT string
|
|
|
|
|
;; since OUTPUT may have been modified.
|
|
|
|
|
(when (plist-get info :with-smart-quotes)
|
|
|
|
|
(setq output (org-export-activate-smart-quotes output :utf-8 info text)))
|
|
|
|
|
;; Handle break preservation if required.
|
|
|
|
|
(when (plist-get info :preserve-breaks)
|
|
|
|
|
(setq output (replace-regexp-in-string "\\(\\\\\\\\\\)?[ \t]*\n" ".br\n"
|
|
|
|
|
output)))
|
|
|
|
|
;; Return value.
|
|
|
|
|
output))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Planning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Property Drawer
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-property-drawer (_property-drawer contents _info)
|
|
|
|
|
"Transcode a PROPERTY-DRAWER element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the drawer. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(and (org-string-nw-p contents)
|
|
|
|
|
(format ".RS\n.nf\n%s\n.fi\n.RE" contents)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
;;; Quote Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-quote-block (quote-block contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a QUOTE-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(org-man--wrap-label
|
|
|
|
|
quote-block
|
|
|
|
|
(format ".RS\n%s\n.RE" contents)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Radio Target
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-radio-target (_radio-target text _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a RADIO-TARGET object from Org to Man.
|
|
|
|
|
TEXT is the text of the target. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
text)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Section
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-section (_section contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a SECTION element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the section. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
contents)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Special Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-special-block (special-block contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a SPECIAL-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the block. INFO is a plist
|
|
|
|
|
holding contextual information."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(org-man--wrap-label special-block (format "%s\n" contents)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Src Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-src-block (src-block _contents info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a SRC-BLOCK element from Org to Man.
|
|
|
|
|
CONTENTS holds the contents of the item. INFO is a plist holding
|
|
|
|
|
contextual information."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(if (not (plist-get info :man-source-highlight))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(format ".RS\n.nf\n\\fC%s\\fP\n.fi\n.RE\n\n"
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(org-export-format-code-default src-block info))
|
|
|
|
|
(let* ((tmpdir temporary-file-directory)
|
|
|
|
|
(in-file (make-temp-name (expand-file-name "srchilite" tmpdir)))
|
|
|
|
|
(out-file (make-temp-name (expand-file-name "reshilite" tmpdir)))
|
|
|
|
|
(code (org-element-property :value src-block))
|
|
|
|
|
(org-lang (org-element-property :language src-block))
|
|
|
|
|
(lst-lang
|
|
|
|
|
(cadr (assq (intern org-lang)
|
|
|
|
|
(plist-get info :man-source-highlight-langs))))
|
|
|
|
|
(cmd (concat "source-highlight"
|
|
|
|
|
" -s " lst-lang
|
|
|
|
|
" -f groff_man "
|
|
|
|
|
" -i " in-file
|
|
|
|
|
" -o " out-file)))
|
|
|
|
|
(if lst-lang
|
|
|
|
|
(let ((code-block ""))
|
|
|
|
|
(with-temp-file in-file (insert code))
|
|
|
|
|
(shell-command cmd)
|
|
|
|
|
(setq code-block (org-file-contents out-file))
|
|
|
|
|
(delete-file in-file)
|
|
|
|
|
(delete-file out-file)
|
|
|
|
|
code-block)
|
|
|
|
|
(format ".RS\n.nf\n\\fC\\m[black]%s\\m[]\\fP\n.fi\n.RE" code)))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Statistics Cookie
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-statistics-cookie (statistics-cookie _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a STATISTICS-COOKIE object from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
|
|
|
|
(org-element-property :value statistics-cookie))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Strike-Through
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-strike-through (_strike-through contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode STRIKE-THROUGH from Org to Man.
|
|
|
|
|
CONTENTS is the text with strike-through markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(format "\\fI%s\\fP" contents))
|
|
|
|
|
|
|
|
|
|
;;; Subscript
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-subscript (_subscript contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a SUBSCRIPT object from Org to Man.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "\\d\\s-2%s\\s+2\\u" contents))
|
|
|
|
|
|
|
|
|
|
;;; Superscript "^_%s$
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-superscript (_superscript contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a SUPERSCRIPT object from Org to Man.
|
|
|
|
|
CONTENTS is the contents of the object. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(format "\\u\\s-2%s\\s+2\\d" contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Table
|
|
|
|
|
;;
|
|
|
|
|
;; `org-man-table' is the entry point for table transcoding. It
|
|
|
|
|
;; takes care of tables with a "verbatim" attribute. Otherwise, it
|
|
|
|
|
;; delegates the job to either `org-man-table--table.el-table' or
|
|
|
|
|
;; `org-man-table--org-table' functions, depending of the type of
|
|
|
|
|
;; the table.
|
|
|
|
|
;;
|
|
|
|
|
;; `org-man-table--align-string' is a subroutine used to build
|
|
|
|
|
;; alignment string for Org tables.
|
|
|
|
|
|
|
|
|
|
(defun org-man-table (table contents info)
|
|
|
|
|
"Transcode a TABLE element from Org to Man.
|
|
|
|
|
CONTENTS is the contents of the table. INFO is a plist holding
|
|
|
|
|
contextual information."
|
|
|
|
|
(cond
|
|
|
|
|
;; Case 1: verbatim table.
|
2017-06-21 13:20:20 +02:00
|
|
|
|
((or (plist-get info :man-tables-verbatim)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(let ((attr (read (format "(%s)"
|
2021-09-29 18:48:59 -04:00
|
|
|
|
(mapconcat
|
|
|
|
|
#'identity
|
|
|
|
|
(org-element-property :attr_man table)
|
|
|
|
|
" ")))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(and attr (plist-get attr :verbatim))))
|
|
|
|
|
|
|
|
|
|
(format ".nf\n\\fC%s\\fP\n.fi"
|
|
|
|
|
;; Re-create table, without affiliated keywords.
|
|
|
|
|
(org-trim
|
|
|
|
|
(org-element-interpret-data
|
|
|
|
|
`(table nil ,@(org-element-contents table))))))
|
|
|
|
|
;; Case 2: Standard table.
|
|
|
|
|
(t (org-man-table--org-table table contents info))))
|
|
|
|
|
|
|
|
|
|
(defun org-man-table--align-string (divider table info)
|
|
|
|
|
"Return an appropriate Man alignment string.
|
|
|
|
|
TABLE is the considered table. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
|
|
|
|
(let (alignment)
|
|
|
|
|
;; Extract column groups and alignment from first (non-rule) row.
|
|
|
|
|
(org-element-map
|
|
|
|
|
(org-element-map table 'table-row
|
|
|
|
|
(lambda (row)
|
|
|
|
|
(and (eq (org-element-property :type row) 'standard) row))
|
|
|
|
|
info 'first-match)
|
|
|
|
|
'table-cell
|
|
|
|
|
(lambda (cell)
|
|
|
|
|
(let* ((borders (org-export-table-cell-borders cell info))
|
|
|
|
|
(raw-width (org-export-table-cell-width cell info))
|
|
|
|
|
(width-cm (when raw-width (/ raw-width 5)))
|
|
|
|
|
(width (if raw-width (format "w(%dc)"
|
|
|
|
|
(if (< width-cm 1) 1 width-cm)) "")))
|
|
|
|
|
;; Check left border for the first cell only.
|
|
|
|
|
(when (and (memq 'left borders) (not alignment))
|
|
|
|
|
(push "|" alignment))
|
|
|
|
|
(push
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(concat (pcase (org-export-table-cell-alignment cell info)
|
|
|
|
|
(`left "l") (`right "r") (`center "c"))
|
|
|
|
|
width
|
|
|
|
|
divider)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
alignment)
|
|
|
|
|
(when (memq 'right borders) (push "|" alignment))))
|
|
|
|
|
info)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(apply #'concat (reverse alignment))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(defun org-man-table--org-table (table contents info)
|
|
|
|
|
"Return appropriate Man code for an Org table.
|
|
|
|
|
|
|
|
|
|
TABLE is the table type element to transcode. CONTENTS is its
|
|
|
|
|
contents, as a string. INFO is a plist used as a communication
|
|
|
|
|
channel.
|
|
|
|
|
|
|
|
|
|
This function assumes TABLE has `org' as its `:type' attribute."
|
|
|
|
|
(let* ((attr (org-export-read-attribute :attr_man table))
|
|
|
|
|
(caption (and (not (plist-get attr :disable-caption))
|
|
|
|
|
(org-man--caption/label-string table info)))
|
|
|
|
|
(divider (if (plist-get attr :divider) "|" " "))
|
|
|
|
|
|
|
|
|
|
;; Determine alignment string.
|
|
|
|
|
(alignment (org-man-table--align-string divider table info))
|
|
|
|
|
;; Extract others display options.
|
|
|
|
|
|
|
|
|
|
(lines (org-split-string contents "\n"))
|
|
|
|
|
|
|
|
|
|
(attr-list
|
|
|
|
|
(delq nil
|
|
|
|
|
(list
|
|
|
|
|
(and (plist-get attr :expand) "expand")
|
|
|
|
|
(let ((placement (plist-get attr :placement)))
|
|
|
|
|
(cond ((string= placement 'center) "center")
|
|
|
|
|
((string= placement 'left) nil)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
((plist-get info :man-tables-centered) "center")
|
|
|
|
|
(t "")))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(or (plist-get attr :boxtype) "box"))))
|
|
|
|
|
|
|
|
|
|
(title-line (plist-get attr :title-line))
|
|
|
|
|
(long-cells (plist-get attr :long-cells))
|
|
|
|
|
|
|
|
|
|
(table-format (concat
|
|
|
|
|
(format "%s" (or (car attr-list) "" ))
|
|
|
|
|
(or
|
|
|
|
|
(let ((output-list '()))
|
|
|
|
|
(when (cdr attr-list)
|
|
|
|
|
(dolist (attr-item (cdr attr-list))
|
|
|
|
|
(setq output-list (concat output-list (format ",%s" attr-item)))))
|
|
|
|
|
output-list)
|
|
|
|
|
"")))
|
|
|
|
|
|
|
|
|
|
(first-line (when lines (org-split-string (car lines) "\t"))))
|
|
|
|
|
;; Prepare the final format string for the table.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(cond
|
|
|
|
|
;; Others.
|
|
|
|
|
(lines (concat ".TS\n " table-format ";\n"
|
|
|
|
|
|
|
|
|
|
(format "%s.\n"
|
|
|
|
|
(let ((final-line ""))
|
|
|
|
|
(when title-line
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(dotimes (_ (length first-line))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(setq final-line (concat final-line "cb" divider))))
|
|
|
|
|
|
|
|
|
|
(setq final-line (concat final-line "\n"))
|
|
|
|
|
|
|
|
|
|
(if alignment
|
|
|
|
|
(setq final-line (concat final-line alignment))
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(dotimes (_ (length first-line))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(setq final-line (concat final-line "c" divider))))
|
|
|
|
|
final-line ))
|
|
|
|
|
|
|
|
|
|
(format "%s.TE\n"
|
|
|
|
|
(let ((final-line "")
|
|
|
|
|
(long-line "")
|
|
|
|
|
(lines (org-split-string contents "\n")))
|
|
|
|
|
|
|
|
|
|
(dolist (line-item lines)
|
|
|
|
|
(setq long-line "")
|
|
|
|
|
|
|
|
|
|
(if long-cells
|
|
|
|
|
(progn
|
|
|
|
|
(if (string= line-item "_")
|
|
|
|
|
(setq long-line (format "%s\n" line-item))
|
|
|
|
|
;; else string =
|
|
|
|
|
(let ((cell-item-list (org-split-string line-item "\t")))
|
|
|
|
|
(dolist (cell-item cell-item-list)
|
|
|
|
|
|
|
|
|
|
(cond ((eq cell-item (car (last cell-item-list)))
|
|
|
|
|
(setq long-line (concat long-line
|
|
|
|
|
(format "T{\n%s\nT}\t\n" cell-item ))))
|
|
|
|
|
(t
|
|
|
|
|
(setq long-line (concat long-line
|
|
|
|
|
(format "T{\n%s\nT}\t" cell-item ))))))
|
|
|
|
|
long-line))
|
|
|
|
|
;; else long cells
|
|
|
|
|
(setq final-line (concat final-line long-line )))
|
|
|
|
|
|
|
|
|
|
(setq final-line (concat final-line line-item "\n"))))
|
|
|
|
|
final-line))
|
|
|
|
|
|
|
|
|
|
(and caption (format ".TB \"%s\"" caption)))))))
|
|
|
|
|
|
|
|
|
|
;;; Table Cell
|
|
|
|
|
|
|
|
|
|
(defun org-man-table-cell (table-cell contents info)
|
|
|
|
|
"Transcode a TABLE-CELL element from Org to Man
|
|
|
|
|
CONTENTS is the cell contents. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(concat
|
|
|
|
|
(let ((scientific-format (plist-get info :man-table-scientific-notation)))
|
|
|
|
|
(if (and contents
|
|
|
|
|
scientific-format
|
|
|
|
|
(string-match orgtbl-exp-regexp contents))
|
|
|
|
|
;; Use appropriate format string for scientific notation.
|
|
|
|
|
(format scientific-format
|
|
|
|
|
(match-string 1 contents)
|
|
|
|
|
(match-string 2 contents))
|
|
|
|
|
contents))
|
|
|
|
|
(when (org-export-get-next-element table-cell info) "\t")))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Table Row
|
|
|
|
|
|
|
|
|
|
(defun org-man-table-row (table-row contents info)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
"Transcode a TABLE-ROW element from Org to Man.
|
2013-11-12 14:06:26 +01:00
|
|
|
|
CONTENTS is the contents of the row. INFO is a plist used as
|
|
|
|
|
a communication channel."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
;; Rules are ignored since table separators are deduced from borders
|
|
|
|
|
;; of the current row.
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(when (eq (org-element-property :type table-row) 'standard)
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(let ((borders
|
|
|
|
|
;; TABLE-ROW's borders are extracted from its first cell.
|
|
|
|
|
(org-export-table-cell-borders
|
|
|
|
|
(car (org-element-contents table-row)) info)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
(concat
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(cond ((and (memq 'top borders) (memq 'above borders)) "_\n"))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
contents
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(cond ((and (memq 'bottom borders) (memq 'below borders)) "\n_")
|
|
|
|
|
((memq 'below borders) "\n_"))))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Target
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-target (target _contents info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a TARGET object from Org to Man.
|
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual
|
|
|
|
|
information."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(format "\\fI%s\\fP" (org-export-get-reference target info)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Timestamp
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-timestamp (_timestamp _contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a TIMESTAMP object from Org to Man.
|
2017-07-06 00:23:30 -07:00
|
|
|
|
CONTENTS is nil. INFO is a plist holding contextual information."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
"")
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Underline
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-underline (_underline contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode UNDERLINE from Org to Man.
|
|
|
|
|
CONTENTS is the text with underline markup. INFO is a plist
|
|
|
|
|
holding contextual information."
|
|
|
|
|
(format "\\fI%s\\fP" contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Verbatim
|
|
|
|
|
|
2017-12-06 15:02:15 +01:00
|
|
|
|
(defun org-man-verbatim (verbatim _contents _info)
|
|
|
|
|
"Transcode a VERBATIM object from Org to Man."
|
|
|
|
|
(format "\\fI%s\\fP"
|
|
|
|
|
(org-man--protect-text (org-element-property :value verbatim))))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Verse Block
|
|
|
|
|
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(defun org-man-verse-block (_verse-block contents _info)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Transcode a VERSE-BLOCK element from Org to Man.
|
lisp/*.el: Fix typos and other trivial doc fixes
* lisp/allout-widgets.el (allout-widgets-auto-activation)
(allout-current-decorated-p):
* lisp/auth-source.el (auth-source-protocols):
* lisp/autorevert.el (auto-revert-set-timer):
* lisp/battery.el (battery-mode-line-limit):
* lisp/calc/calcalg3.el (math-map-binop):
* lisp/calendar/cal-dst.el (calendar-dst-find-startend):
* lisp/calendar/cal-mayan.el (calendar-mayan-long-count-to-absolute):
* lisp/calendar/calendar.el (calendar-date-echo-text)
(calendar-generate-month, calendar-string-spread)
(calendar-cursor-to-date, calendar-read, calendar-read-date)
(calendar-mark-visible-date, calendar-dayname-on-or-before):
* lisp/calendar/diary-lib.el (diary-ordinal-suffix):
* lisp/cedet/ede/autoconf-edit.el (autoconf-new-program)
(autoconf-find-last-macro, autoconf-parameter-strip):
* lisp/cedet/ede/config.el (ede-target-with-config-build):
* lisp/cedet/ede/linux.el (ede-linux--detect-architecture)
(ede-linux--get-architecture):
* lisp/cedet/semantic/complete.el (semantic-collector-calculate-cache)
(semantic-displayer-abstract, semantic-displayer-point-position):
* lisp/cedet/semantic/format.el (semantic-format-face-alist)
(semantic-format-tag-short-doc):
* lisp/cedet/semantic/fw.el (semantic-find-file-noselect):
* lisp/cedet/semantic/idle.el (semantic-idle-scheduler-work-idle-time)
(semantic-idle-breadcrumbs-display-function)
(semantic-idle-breadcrumbs-format-tag-list-function):
* lisp/cedet/semantic/lex.el (semantic-lex-map-types)
(define-lex, define-lex-block-type-analyzer):
* lisp/cedet/semantic/senator.el (senator-search-default-tag-filter):
* lisp/cedet/semantic/symref.el (semantic-symref-result)
(semantic-symref-hit-to-tag-via-db):
* lisp/cedet/semantic/symref.el (semantic-symref-tool-baseclass):
* lisp/cedet/semantic/tag.el (semantic-tag-new-variable)
(semantic-tag-new-include, semantic-tag-new-package)
(semantic-tag-set-faux, semantic-create-tag-proxy)
(semantic-tag-function-parent)
(semantic-tag-components-with-overlays):
* lisp/cedet/srecode/cpp.el (srecode-cpp-namespaces)
(srecode-semantic-handle-:c, srecode-semantic-apply-tag-to-dict):
* lisp/cedet/srecode/dictionary.el (srecode-create-dictionary)
(srecode-dictionary-add-entries, srecode-dictionary-lookup-name)
(srecode-create-dictionaries-from-tags):
* lisp/cmuscheme.el (scheme-compile-region):
* lisp/color.el (color-lab-to-lch):
* lisp/doc-view.el (doc-view-image-width)
(doc-view-set-up-single-converter):
* lisp/dynamic-setting.el (font-setting-change-default-font)
(dynamic-setting-handle-config-changed-event):
* lisp/elec-pair.el (electric-pair-text-pairs)
(electric-pair-skip-whitespace-function)
(electric-pair-string-bound-function):
* lisp/emacs-lisp/avl-tree.el (avl-tree--del-balance)
(avl-tree-member, avl-tree-mapcar, avl-tree-iter):
* lisp/emacs-lisp/bytecomp.el (byte-compile-generate-call-tree):
* lisp/emacs-lisp/checkdoc.el (checkdoc-autofix-flag)
(checkdoc-spellcheck-documentation-flag, checkdoc-ispell)
(checkdoc-ispell-current-buffer, checkdoc-ispell-interactive)
(checkdoc-ispell-message-interactive)
(checkdoc-ispell-message-text, checkdoc-ispell-start)
(checkdoc-ispell-continue, checkdoc-ispell-comments)
(checkdoc-ispell-defun):
* lisp/emacs-lisp/cl-generic.el (cl--generic-search-method):
* lisp/emacs-lisp/eieio-custom.el (eieio-read-customization-group):
* lisp/emacs-lisp/lisp.el (forward-sexp, up-list):
* lisp/emacs-lisp/package-x.el (package--archive-contents-from-file):
* lisp/emacs-lisp/package.el (package-desc)
(package--make-autoloads-and-stuff, package-hidden-regexps):
* lisp/emacs-lisp/tcover-ses.el (ses-exercise-startup):
* lisp/emacs-lisp/testcover.el (testcover-nohits)
(testcover-1value):
* lisp/epg.el (epg-receive-keys, epg-start-edit-key):
* lisp/erc/erc-backend.el (erc-server-processing-p)
(erc-split-line-length, erc-server-coding-system)
(erc-server-send, erc-message):
* lisp/erc/erc-button.el (erc-button-face, erc-button-alist)
(erc-browse-emacswiki):
* lisp/erc/erc-ezbounce.el (erc-ezbounce, erc-ezb-get-login):
* lisp/erc/erc-fill.el (erc-fill-variable-maximum-indentation):
* lisp/erc/erc-log.el (erc-current-logfile):
* lisp/erc/erc-match.el (erc-log-match-format)
(erc-text-matched-hook):
* lisp/erc/erc-netsplit.el (erc-netsplit, erc-netsplit-debug):
* lisp/erc/erc-networks.el (erc-server-alist)
(erc-networks-alist, erc-current-network):
* lisp/erc/erc-ring.el (erc-input-ring-index):
* lisp/erc/erc-speedbar.el (erc-speedbar)
(erc-speedbar-update-channel):
* lisp/erc/erc-stamp.el (erc-timestamp-only-if-changed-flag):
* lisp/erc/erc-track.el (erc-track-position-in-mode-line)
(erc-track-remove-from-mode-line, erc-modified-channels-update)
(erc-track-last-non-erc-buffer, erc-track-sort-by-importance)
(erc-track-get-active-buffer):
* lisp/erc/erc.el (erc-get-channel-user-list)
(erc-echo-notice-hook, erc-echo-notice-always-hook)
(erc-wash-quit-reason, erc-format-@nick):
* lisp/ffap.el (ffap-latex-mode):
* lisp/files.el (abort-if-file-too-large)
(dir-locals--get-sort-score, buffer-stale--default-function):
* lisp/filesets.el (filesets-tree-max-level, filesets-data)
(filesets-update-pre010505):
* lisp/gnus/gnus-agent.el (gnus-agent-flush-cache):
* lisp/gnus/gnus-art.el (gnus-article-encrypt-protocol)
(gnus-button-prefer-mid-or-mail):
* lisp/gnus/gnus-cus.el (gnus-group-parameters):
* lisp/gnus/gnus-demon.el (gnus-demon-handlers)
(gnus-demon-run-callback):
* lisp/gnus/gnus-dired.el (gnus-dired-print):
* lisp/gnus/gnus-icalendar.el (gnus-icalendar-event-from-buffer):
* lisp/gnus/gnus-range.el (gnus-range-normalize):
* lisp/gnus/gnus-spec.el (gnus-pad-form):
* lisp/gnus/gnus-srvr.el (gnus-server-agent, gnus-server-cloud)
(gnus-server-opened, gnus-server-closed, gnus-server-denied)
(gnus-server-offline):
* lisp/gnus/gnus-sum.el (gnus-refer-thread-use-nnir)
(gnus-refer-thread-limit-to-thread)
(gnus-summary-limit-include-thread, gnus-summary-refer-thread)
(gnus-summary-find-matching):
* lisp/gnus/gnus-util.el (gnus-rescale-image):
* lisp/gnus/gnus.el (gnus-summary-line-format, gnus-no-server):
* lisp/gnus/mail-source.el (mail-source-incoming-file-prefix):
* lisp/gnus/message.el (message-cite-reply-position)
(message-cite-style-outlook, message-cite-style-thunderbird)
(message-cite-style-gmail, message--send-mail-maybe-partially):
* lisp/gnus/mm-extern.el (mm-inline-external-body):
* lisp/gnus/mm-partial.el (mm-inline-partial):
* lisp/gnus/mml-sec.el (mml-secure-message-sign)
(mml-secure-message-sign-encrypt, mml-secure-message-encrypt):
* lisp/gnus/mml2015.el (mml2015-epg-key-image)
(mml2015-epg-key-image-to-string):
* lisp/gnus/nndiary.el (nndiary-reminders, nndiary-get-new-mail):
* lisp/gnus/nnheader.el (nnheader-directory-files-is-safe):
* lisp/gnus/nnir.el (nnir-search-history)
(nnir-imap-search-other, nnir-artlist-length)
(nnir-artlist-article, nnir-artitem-group, nnir-artitem-number)
(nnir-artitem-rsv, nnir-article-group, nnir-article-number)
(nnir-article-rsv, nnir-article-ids, nnir-categorize)
(nnir-retrieve-headers-override-function)
(nnir-imap-default-search-key, nnir-hyrex-additional-switches)
(gnus-group-make-nnir-group, nnir-run-namazu, nnir-read-parms)
(nnir-read-parm, nnir-read-server-parm, nnir-search-thread):
* lisp/gnus/nnmairix.el (nnmairix-default-group)
(nnmairix-propagate-marks):
* lisp/gnus/smime.el (smime-keys, smime-crl-check)
(smime-verify-buffer, smime-noverify-buffer):
* lisp/gnus/spam-report.el (spam-report-url-ping-mm-url):
* lisp/gnus/spam.el (spam-spamassassin-positive-spam-flag-header)
(spam-spamassassin-spam-status-header, spam-sa-learn-rebuild)
(spam-classifications, spam-check-stat, spam-spamassassin-score):
* lisp/help.el (describe-minor-mode-from-symbol):
* lisp/hippie-exp.el (hippie-expand-ignore-buffers):
* lisp/htmlfontify.el (hfy-optimizations, hfy-face-resolve-face)
(hfy-begin-span):
* lisp/ibuf-ext.el (ibuffer-update-saved-filters-format)
(ibuffer-saved-filters, ibuffer-old-saved-filters-warning)
(ibuffer-filtering-qualifiers, ibuffer-repair-saved-filters)
(eval, ibuffer-unary-operand, file-extension, directory):
* lisp/image-dired.el (image-dired-cmd-pngcrush-options):
* lisp/image-mode.el (image-toggle-display):
* lisp/international/ccl.el (ccl-compile-read-multibyte-character)
(ccl-compile-write-multibyte-character):
* lisp/international/kkc.el (kkc-save-init-file):
* lisp/international/latin1-disp.el (latin1-display):
* lisp/international/ogonek.el (ogonek-name-encoding-alist)
(ogonek-information, ogonek-lookup-encoding)
(ogonek-deprefixify-region):
* lisp/isearch.el (isearch-filter-predicate)
(isearch--momentary-message):
* lisp/jsonrpc.el (jsonrpc-connection-send)
(jsonrpc-process-connection, jsonrpc-shutdown)
(jsonrpc--async-request-1):
* lisp/language/tibet-util.el (tibetan-char-p):
* lisp/mail/feedmail.el (feedmail-queue-use-send-time-for-date)
(feedmail-last-chance-hook, feedmail-before-fcc-hook)
(feedmail-send-it-immediately-wrapper, feedmail-find-eoh):
* lisp/mail/hashcash.el (hashcash-generate-payment)
(hashcash-generate-payment-async, hashcash-insert-payment)
(hashcash-verify-payment):
* lisp/mail/rmail.el (rmail-movemail-variant-in-use)
(rmail-get-attr-value):
* lisp/mail/rmailmm.el (rmail-mime-prefer-html, rmail-mime):
* lisp/mail/rmailsum.el (rmail-summary-show-message):
* lisp/mail/supercite.el (sc-raw-mode-toggle):
* lisp/man.el (Man-start-calling):
* lisp/mh-e/mh-acros.el (mh-do-at-event-location)
(mh-iterate-on-messages-in-region, mh-iterate-on-range):
* lisp/mh-e/mh-alias.el (mh-alias-system-aliases)
(mh-alias-reload, mh-alias-ali)
(mh-alias-canonicalize-suggestion, mh-alias-add-alias-to-file)
(mh-alias-add-alias):
* lisp/mouse.el (mouse-save-then-kill):
* lisp/net/browse-url.el (browse-url-default-macosx-browser):
* lisp/net/eudc.el (eudc-set, eudc-variable-protocol-value)
(eudc-variable-server-value, eudc-update-variable)
(eudc-expand-inline):
* lisp/net/eudcb-bbdb.el (eudc-bbdb-format-record-as-result):
* lisp/net/eudcb-ldap.el (eudc-ldap-get-field-list):
* lisp/net/pop3.el (pop3-list):
* lisp/net/soap-client.el (soap-namespace-put)
(soap-xs-parse-sequence, soap-parse-envelope):
* lisp/net/soap-inspect.el (soap-inspect-xs-complex-type):
* lisp/nxml/rng-xsd.el (rng-xsd-date-to-days):
* lisp/org/ob-C.el (org-babel-prep-session:C)
(org-babel-load-session:C):
* lisp/org/ob-J.el (org-babel-execute:J):
* lisp/org/ob-asymptote.el (org-babel-prep-session:asymptote):
* lisp/org/ob-awk.el (org-babel-execute:awk):
* lisp/org/ob-core.el (org-babel-process-file-name):
* lisp/org/ob-ebnf.el (org-babel-execute:ebnf):
* lisp/org/ob-forth.el (org-babel-execute:forth):
* lisp/org/ob-fortran.el (org-babel-execute:fortran)
(org-babel-prep-session:fortran, org-babel-load-session:fortran):
* lisp/org/ob-groovy.el (org-babel-execute:groovy):
* lisp/org/ob-io.el (org-babel-execute:io):
* lisp/org/ob-js.el (org-babel-execute:js):
* lisp/org/ob-lilypond.el (org-babel-default-header-args:lilypond)
(org-babel-lilypond-compile-post-tangle)
(org-babel-lilypond-display-pdf-post-tangle)
(org-babel-lilypond-tangle)
(org-babel-lilypond-execute-tangled-ly)
(org-babel-lilypond-compile-lilyfile)
(org-babel-lilypond-check-for-compile-error)
(org-babel-lilypond-process-compile-error)
(org-babel-lilypond-mark-error-line)
(org-babel-lilypond-parse-error-line)
(org-babel-lilypond-attempt-to-open-pdf)
(org-babel-lilypond-attempt-to-play-midi)
(org-babel-lilypond-switch-extension)
(org-babel-lilypond-set-header-args):
* lisp/org/ob-lua.el (org-babel-prep-session:lua):
* lisp/org/ob-picolisp.el (org-babel-execute:picolisp):
* lisp/org/ob-processing.el (org-babel-prep-session:processing):
* lisp/org/ob-python.el (org-babel-prep-session:python):
* lisp/org/ob-scheme.el (org-babel-scheme-capture-current-message)
(org-babel-scheme-execute-with-geiser, org-babel-execute:scheme):
* lisp/org/ob-shen.el (org-babel-execute:shen):
* lisp/org/org-agenda.el (org-agenda-entry-types)
(org-agenda-move-date-from-past-immediately-to-today)
(org-agenda-time-grid, org-agenda-sorting-strategy)
(org-agenda-filter-by-category, org-agenda-forward-block):
* lisp/org/org-colview.el (org-columns--overlay-text):
* lisp/org/org-faces.el (org-verbatim, org-cycle-level-faces):
* lisp/org/org-indent.el (org-indent-set-line-properties):
* lisp/org/org-macs.el (org-get-limited-outline-regexp):
* lisp/org/org-mobile.el (org-mobile-files):
* lisp/org/org.el (org-use-fast-todo-selection)
(org-extend-today-until, org-use-property-inheritance)
(org-refresh-effort-properties, org-open-at-point-global)
(org-track-ordered-property-with-tag, org-shiftright):
* lisp/org/ox-html.el (org-html-checkbox-type):
* lisp/org/ox-man.el (org-man-source-highlight)
(org-man-verse-block):
* lisp/org/ox-publish.el (org-publish-sitemap-default):
* lisp/outline.el (outline-head-from-level):
* lisp/progmodes/dcl-mode.el (dcl-back-to-indentation-1)
(dcl-calc-command-indent, dcl-indent-to):
* lisp/progmodes/flymake.el (flymake-make-diagnostic)
(flymake--overlays, flymake-diagnostic-functions)
(flymake-diagnostic-types-alist, flymake--backend-state)
(flymake-is-running, flymake--collect, flymake-mode):
* lisp/progmodes/gdb-mi.el (gdb-threads-list, gdb, gdb-non-stop)
(gdb-buffers, gdb-gud-context-call, gdb-jsonify-buffer):
* lisp/progmodes/grep.el (grep-error-screen-columns):
* lisp/progmodes/gud.el (gud-prev-expr):
* lisp/progmodes/ps-mode.el (ps-mode, ps-mode-target-column)
(ps-run-goto-error):
* lisp/progmodes/python.el (python-eldoc-get-doc)
(python-eldoc-function-timeout-permanent, python-eldoc-function):
* lisp/shadowfile.el (shadow-make-group):
* lisp/speedbar.el (speedbar-obj-do-check):
* lisp/textmodes/flyspell.el (flyspell-auto-correct-previous-hook):
* lisp/textmodes/reftex-cite.el (reftex-bib-or-thebib):
* lisp/textmodes/reftex-index.el (reftex-index-goto-entry)
(reftex-index-kill, reftex-index-undo):
* lisp/textmodes/reftex-parse.el (reftex-context-substring):
* lisp/textmodes/reftex.el (reftex-TeX-master-file):
* lisp/textmodes/rst.el (rst-next-hdr, rst-toc)
(rst-uncomment-region, rst-font-lock-extend-region-internal):
* lisp/thumbs.el (thumbs-mode):
* lisp/vc/ediff-util.el (ediff-restore-diff):
* lisp/vc/pcvs-defs.el (cvs-cvsroot, cvs-force-dir-tag):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p):
* lisp/wid-edit.el (widget-field-value-set, string):
* lisp/x-dnd.el (x-dnd-version-from-flags)
(x-dnd-more-than-3-from-flags): Assorted docfixes.
2019-09-21 00:27:53 +02:00
|
|
|
|
CONTENTS is verse block contents. INFO is a plist holding
|
2013-11-12 14:06:26 +01:00
|
|
|
|
contextual information."
|
|
|
|
|
(format ".RS\n.ft I\n%s\n.ft\n.RE" contents))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;; Interactive functions
|
|
|
|
|
|
|
|
|
|
(defun org-man-export-to-man
|
2021-09-29 18:48:59 -04:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Export current buffer to a Man file.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only the body
|
|
|
|
|
without any markers.
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return output file's name."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((outfile (org-export-output-file-name ".man" subtreep)))
|
|
|
|
|
(org-export-to-file 'man outfile
|
|
|
|
|
async subtreep visible-only body-only ext-plist)))
|
|
|
|
|
|
|
|
|
|
(defun org-man-export-to-pdf
|
2021-09-29 18:48:59 -04:00
|
|
|
|
(&optional async subtreep visible-only body-only ext-plist)
|
2013-11-12 14:06:26 +01:00
|
|
|
|
"Export current buffer to Groff then process through to PDF.
|
|
|
|
|
|
|
|
|
|
If narrowing is active in the current buffer, only export its
|
|
|
|
|
narrowed part.
|
|
|
|
|
|
|
|
|
|
If a region is active, export that region.
|
|
|
|
|
|
|
|
|
|
A non-nil optional argument ASYNC means the process should happen
|
|
|
|
|
asynchronously. The resulting file should be accessible through
|
|
|
|
|
the `org-export-stack' interface.
|
|
|
|
|
|
|
|
|
|
When optional argument SUBTREEP is non-nil, export the sub-tree
|
|
|
|
|
at point, extracting information from the headline properties
|
|
|
|
|
first.
|
|
|
|
|
|
|
|
|
|
When optional argument VISIBLE-ONLY is non-nil, don't export
|
|
|
|
|
contents of hidden elements.
|
|
|
|
|
|
|
|
|
|
When optional argument BODY-ONLY is non-nil, only write between
|
|
|
|
|
markers.
|
|
|
|
|
|
|
|
|
|
EXT-PLIST, when provided, is a property list with external
|
|
|
|
|
parameters overriding Org default settings, but still inferior to
|
|
|
|
|
file-local settings.
|
|
|
|
|
|
|
|
|
|
Return PDF file's name."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((outfile (org-export-output-file-name ".man" subtreep)))
|
|
|
|
|
(org-export-to-file 'man outfile
|
|
|
|
|
async subtreep visible-only body-only ext-plist
|
2021-12-11 12:31:13 -05:00
|
|
|
|
#'org-latex-compile)))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(defun org-man-compile (file)
|
|
|
|
|
"Compile a Groff file.
|
|
|
|
|
|
|
|
|
|
FILE is the name of the file being compiled. Processing is done
|
|
|
|
|
through the command specified in `org-man-pdf-process'.
|
|
|
|
|
|
|
|
|
|
Return PDF file name or an error if it couldn't be produced."
|
2017-06-21 13:20:20 +02:00
|
|
|
|
(message "Processing Groff file %s..." file)
|
|
|
|
|
(let ((output (org-compile-file file org-man-pdf-process "pdf")))
|
|
|
|
|
(when org-man-remove-logfiles
|
|
|
|
|
(let ((base (file-name-sans-extension output)))
|
|
|
|
|
(dolist (ext org-man-logfiles-extensions)
|
|
|
|
|
(let ((file (concat base "." ext)))
|
|
|
|
|
(when (file-exists-p file) (delete-file file))))))
|
|
|
|
|
(message "Process completed.")
|
|
|
|
|
output))
|
2013-11-12 14:06:26 +01:00
|
|
|
|
|
|
|
|
|
(provide 'ox-man)
|
|
|
|
|
|
|
|
|
|
;;; ox-man.el ends here
|