[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/systemd ac11adf 025/131: add tunable for using either `man
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/systemd ac11adf 025/131: add tunable for using either `man` or `woman` |
Date: |
Sun, 29 Aug 2021 11:35:08 -0400 (EDT) |
branch: elpa/systemd
commit ac11adf59980fc2372ce0d07b88d4cda33fed26e
Author: Mark Oteiza <mvoteiza@udel.edu>
Commit: Mark Oteiza <mvoteiza@udel.edu>
add tunable for using either `man` or `woman`
---
systemd.el | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/systemd.el b/systemd.el
index a5ecd7c..332e4b3 100644
--- a/systemd.el
+++ b/systemd.el
@@ -57,6 +57,13 @@
(string :tag "Semicolon" ";"))
:group 'systemd)
+(defcustom systemd-man-function 'man
+ "Pager to use for system manual pages."
+ :type '(radio (function-item man)
+ (function-item woman)
+ (function :tag "Other function"))
+ :group 'systemd)
+
(defcustom systemd-use-company-p t
"Whether to use `company-mode' for completion, if available."
:type 'boolean
@@ -106,6 +113,13 @@ as a list of strings, otherwise nil."
(when string
(split-string string))))
+(defun systemd-doc-man (page)
+ "Open a manual page with `systemd-man-function'."
+ (pcase (symbol-name systemd-man-function)
+ ("woman" (woman (replace-regexp-in-string "([[:alnum:]]+)" "" page)))
+ ("man" (man page))
+ (_ (apply 'systemd-man-function page))))
+
(defun systemd-doc-open (url)
"Open URL. Interactively completes the documentation in the
current unit file, defaulting to the link under point, if any."
@@ -120,7 +134,7 @@ current unit file, defaulting to the link under point, if
any."
(let ((link (url-generic-parse-url url)))
(pcase (url-type link)
("file" (find-file (url-filename link)))
- ("man" (url-man link))
+ ("man" (systemd-doc-man (url-filename link)))
("info" (url-info link))
((or "http" "https") (funcall systemd-browse-url-function url))
(_ (user-error "Invalid link")))))
@@ -128,7 +142,7 @@ current unit file, defaulting to the link under point, if
any."
(defun systemd-doc-directives ()
"Open systemd.directives(7)"
(interactive)
- (man "systemd.directives(7)"))
+ (systemd-doc-man "systemd.directives(7)"))
(defvar systemd-mode-syntax-table
(let ((table (make-syntax-table)))
- [nongnu] elpa/systemd 3cb77a5 013/131: add a link, (continued)
- [nongnu] elpa/systemd 3cb77a5 013/131: add a link, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a46e81b 017/131: autoload for slice units, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd b03e616 079/131: bump, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a1633c2 083/131: systemd 231 directives, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 7769000 086/131: bump to 0.4.1, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 4c0ec1e 105/131: split font-lock-keywords into levels, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 9265ef8 126/131: update section lists, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 6b0878e 016/131: add autoload for drop-ins with `systemctl edit`, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 7ef42d5 020/131: adopt browse url function from lua-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd c8d3472 012/131: add commentary, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd ac11adf 025/131: add tunable for using either `man` or `woman`,
ELPA Syncer <=
- [nongnu] elpa/systemd d7a9c1d 045/131: fontify "-" and "@" prefixes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd d03b70c 043/131: derive from conf-mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 6f2e31e 048/131: add a mode menu, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 1a7af12 051/131: no strings with single quotes either, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 26de1dd 056/131: don't turn on company by default, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd cd22a2c 065/131: use a-zA-Z0-9, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd bd1b86e 072/131: woops!, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd f74f3c8 075/131: add to buffer-local hooks, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd 921f8d0 074/131: nix systemd-use-company-p, ELPA Syncer, 2021/08/29
- [nongnu] elpa/systemd a73c16a 085/131: nix LOCAL argument for adding to company-backends, ELPA Syncer, 2021/08/29