Start working on the help section with the shortdoc library

This commit is contained in:
Gerard Vermeulen 2022-04-17 17:45:42 +02:00
parent a9e1ed2ec1
commit ec0210d63f

View File

@ -548,9 +548,62 @@ the contents of packages and allows to update packages to the latest version.
(package-install-selected-packages)) (package-install-selected-packages))
#+end_src #+end_src
* [[info:dir#Top][Info documentation]] * [[info:emacs#Help][Help (info)]]
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: sec:info-documentation :CUSTOM_ID: sec:help
:END:
Table [[tab:help-key-bindings]] lists a number of key bindings to start playing with
the help facilities of Emacs.
#+attr_latex: :booktabs yes :float table
#+caption[Help key bindings]:
#+caption: Help key bindings.
#+name: tab:help-key-bindings
|--------------------------------+------------------+------------|
| command | keys | key map |
|--------------------------------+------------------+------------|
| =Info-goto-emacs-command-node= | {{{kbd(C-h F)}}} | =help-map= |
| =describe-function= | {{{kbd(C-h f)}}} | =help-map= |
| =describe-key= | {{{kbd(C-h k)}}} | =help-map= |
| =describe-symbol= | {{{kbd(C-h o)}}} | =help-map= |
| =describe-variable= | {{{kbd(C-h v)}}} | =help-map= |
| =info= | {{{kbd(C-h i)}}} | =help-map= |
|--------------------------------+------------------+------------|
** [[info:emacs#Name Help][Shortdoc-display-group (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:shortdoc-display-group
:END:
Listing [[lst:configure-shortdoc]] binds {{{kbd(C-h y)}}} to
=short-doc-display-group= and defines a short documentation group for functions
defined in this Org file.
#+caption[Configure =shortdoc=]:
#+caption: Configure =shortdoc=.
#+name: lst:configure-shortdoc
#+begin_src emacs-lisp
(when (fboundp 'shortdoc-display-group)
(define-key help-map (kbd "y") #'shortdoc-display-group)
(with-eval-after-load 'shortdoc
;; Ensure defining the functions before documenting them.
(define-short-documentation-group init
"Face"
(invert-default-face
:no-manual t)
(set-default-face-height
:no-manual t)
"Org"
(org-electric-dollar
:no-manual t)
(org-syntax-convert-keyword-case-to-lower
:no-manual t))))
#+end_src
** [[info:info#Top][Info (info)]]
:PROPERTIES:
:CUSTOM_ID: sec:help
:END: :END:
Listing [[lst:configure-info]] adds a path in my home directory to the places where Listing [[lst:configure-info]] adds a path in my home directory to the places where
@ -572,9 +625,9 @@ Listing [[lst:configure-info]] adds a path in my home directory to the places wh
:END: :END:
#+attr_latex: :booktabs yes :float table #+attr_latex: :booktabs yes :float table
#+caption[Basic Emacs key bindings]: #+caption[Basic key bindings]:
#+caption: Basic Emacs key-bindings. #+caption: Basic key bindings.
#+name: tab:basic-emacs-key-bindings #+name: tab:basic-key-bindings
|----------------------+------------------------+--------------| |----------------------+------------------------+--------------|
| command | keys | key map | | command | keys | key map |
|----------------------+------------------------+--------------| |----------------------+------------------------+--------------|
@ -1392,7 +1445,7 @@ backward compatibility. See table [[tab:org-latex-class-tag-placeholder]] and ty
#+caption: Configure =org-mode-map=. #+caption: Configure =org-mode-map=.
#+name: lst:configure-org-mode-map #+name: lst:configure-org-mode-map
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'org (with-eval-after-load 'emacs
;; From: "Nicolas Richard" <theonewiththeevillook@yahoo.fr> ;; From: "Nicolas Richard" <theonewiththeevillook@yahoo.fr>
;; Date: Fri, 08 Mar 2013 16:23:02 +0100 [thread overview] ;; Date: Fri, 08 Mar 2013 16:23:02 +0100 [thread overview]
;; Message-ID: <87vc913oh5.fsf@yahoo.fr> (raw) ;; Message-ID: <87vc913oh5.fsf@yahoo.fr> (raw)
@ -1407,8 +1460,9 @@ backward compatibility. See table [[tab:org-latex-class-tag-placeholder]] and ty
(insert "\\(\\)") (insert "\\(\\)")
(backward-char 2))) (backward-char 2)))
(define-key org-mode-map (kbd "$") #'org-electric-dollar) (with-eval-after-load 'org
(define-key org-mode-map (kbd "M-q") #'org-fill-paragraph)) (define-key org-mode-map (kbd "$") #'org-electric-dollar)
(define-key org-mode-map (kbd "M-q") #'org-fill-paragraph)))
#+end_src #+end_src
#+caption[Customize =org-export=]: #+caption[Customize =org-export=]:
@ -1734,19 +1788,21 @@ variables in order to export the =info-org-link= types in this document to
#+caption: Convert upper to lower case keywords. #+caption: Convert upper to lower case keywords.
#+name: lst:convert-upper-to-lower-case-keywords #+name: lst:convert-upper-to-lower-case-keywords
#+begin_src emacs-lisp #+begin_src emacs-lisp
(with-eval-after-load 'org (with-eval-after-load 'emacs
;; https://tecosaur.github.io/emacs-config/#translate-capital-keywords
(defun org-syntax-convert-keyword-case-to-lower () (defun org-syntax-convert-keyword-case-to-lower ()
"Convert all #+KEYWORDS to #+keywords." "Convert all #+KEYWORDS to #+keywords."
(interactive) (interactive)
(save-excursion (when (derived-mode-p 'org-mode)
(goto-char (point-min)) (save-excursion
(let ((count 0) (goto-char (point-min))
(case-fold-search nil)) (let ((count 0)
(while (re-search-forward "^[ \t]*#\\+[A-Z_]+" nil t) (case-fold-search nil))
(unless (s-matches-p "RESULTS" (match-string 0)) (while (re-search-forward "^[ \t]*#\\+[A-Z_]+" nil t)
(replace-match (downcase (match-string 0)) t) (unless (s-matches-p "RESULTS" (match-string 0))
(setq count (1+ count)))) (replace-match (downcase (match-string 0)) t)
(message "Replaced %d keywords" count))))) (setq count (1+ count))))
(message "Replaced %d keywords" count))))))
#+end_src #+end_src
*** [[https://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00394.html][Evaluate specific source blocks at load-time]] *** [[https://lists.gnu.org/archive/html/emacs-orgmode/2016-07/msg00394.html][Evaluate specific source blocks at load-time]]