diff --git a/lisp/lib/docs.el b/lisp/lib/docs.el index 037efe80f..c3b0056cd 100644 --- a/lisp/lib/docs.el +++ b/lisp/lib/docs.el @@ -467,208 +467,4 @@ Keeps track of its own IDs in `doom-docs-dir' and toggles `doom-docs-mode' when (add-hook 'doom-docs-org-mode-hook #'doom-docs-read-only-h) - -;; -;;; Custom links - -;;;###autoload -(defun doom-docs-read-link-desc-at-point (&optional default context) - "TODO" - (if (and (stringp default) (not (string-empty-p default))) - (string-trim default) - (if-let* ((context (or context (org-element-context))) - (context (org-element-lineage context '(link) t)) - (beg (org-element-property :contents-begin context)) - (end (org-element-property :contents-end context))) - (unless (= beg end) - (replace-regexp-in-string - "[ \n]+" " " (string-trim (buffer-substring-no-properties beg end))))))) - -;;;###autoload -(defun doom-docs-doom-module-link-follow-fn (link) - (cl-destructuring-bind (&key category module flag) - (doom-docs--read-module-link link) - (when category - (let ((doom-modules-dirs (list doom-modules-dir))) - (if-let* ((path (doom-module-locate-path category module)) - (path (or (car (doom-glob path "README.org")) - path))) - (find-file path) - (user-error "Can't find Doom module '%s'" link)))) - (when flag - (goto-char (point-min)) - (when (and (re-search-forward "^\\*+ \\(?:TODO \\)?Module flags") - (re-search-forward (format "^\\s-*- \\+%s ::[ \n]" - (substring (symbol-name flag) 1)) - (save-excursion (org-get-next-sibling) - (point)))) - (org-show-entry) - (recenter))))) - -;;;###autoload -(defun doom-docs-doom-module-link-face-fn (link) - (cl-destructuring-bind (&key category module flag) - (doom-docs--read-module-link link) - (if (doom-module-locate-path category module) - `(:inherit org-priority - :weight bold) - 'error))) - -;;;###autoload -(defun doom-docs-doom-package-link-follow-fn (link) - "TODO" - (doom/describe-package - (intern-soft - (doom-docs-read-link-desc-at-point link)))) - -;;;###autoload -(defun doom-docs-make-symbol-link (fn) - "TODO" - (lambda (link) - (let ((desc (doom-docs-read-link-desc-at-point link))) - (funcall - fn (or (intern-soft desc) - (user-error "Can't find documentation for %S" desc)))))) - -(defun doom-docs--describe-kbd (keystr) - (dolist (key `(("" . ,doom-leader-key) - ("" . ,doom-localleader-key) - ("" . ,(if (bound-and-true-p evil-mode) - (concat doom-leader-key " u") - "C-u")) - ("" . ,(if (bound-and-true-p evil-mode) - (concat doom-leader-key " h") - "C-h")) - ("\\" . ,doom-leader-key) + ("" . ,doom-localleader-key) + ("" . ,(if (bound-and-true-p evil-mode) + (concat doom-leader-key " u") + "C-u")) + ("" . ,(if (bound-and-true-p evil-mode) + (concat doom-leader-key " h") + "C-h")) + ("\\