Zap useless (require 'pp) in "lst:grok-org-element-tree"

This commit is contained in:
Gerard Vermeulen 2024-06-13 09:02:05 +02:00
parent 08d2f6bf6d
commit b16448bc83

View File

@ -3814,51 +3814,50 @@ non-interactive =org-element= functions to an =Emacs-lisp= buffer.
#+name: lst:grok-org-element-tree
#+begin_src emacs-lisp -n :results silent
(with-eval-after-load 'org-element
(when (require 'pp nil 'noerror)
(defconst grok-org-output
"*Grok Org Element Output*"
"Grok Org output buffer name.")
(defconst grok-org-output
"*Grok Org Element Output*"
"Grok Org output buffer name.")
(defun grok-org-element-at-point ()
"Call `org-element-at-point' interactively and pretty-print."
(interactive)
(defun grok-org-element-at-point ()
"Call `org-element-at-point' interactively and pretty-print."
(interactive)
(pp-display-expression
(org-element-at-point) grok-org-output))
(defun grok-org-element-context ()
"Call `org-element-context' interactively and pretty-print."
(interactive)
(pp-display-expression
(org-element-context) grok-org-output))
(defun grok-org-element-parse-buffer ()
"Call `org-element-parse-buffer' interactively and pretty-print."
(interactive)
(let ((what (completing-read
"granularity: "
'(headline element greater-element object)
nil 'require-match)))
(pp-display-expression
(org-element-at-point) grok-org-output))
(org-element-parse-buffer what) grok-org-output)))
(defun grok-org-element-context ()
"Call `org-element-context' interactively and pretty-print."
(interactive)
(pp-display-expression
(org-element-context) grok-org-output))
(defun grok-org-element-parse-whole-buffer ()
"Like `grok-org-element-parse-buffer' from point 1 and sans granularity."
(interactive)
(org-with-point-at 1
(pp-display-expression (org-element-parse-buffer) grok-org-output)))
(defun grok-org-element-parse-buffer ()
"Call `org-element-parse-buffer' interactively and pretty-print."
(interactive)
(let ((what (completing-read
"granularity: "
'(headline element greater-element object)
nil 'require-match)))
(pp-display-expression
(org-element-parse-buffer what) grok-org-output)))
(defun grok-org-heading-components ()
"Call `org-heading-components' interactively and pretty-print."
(interactive)
(pp-display-expression
(org-heading-components) grok-org-output))
(defun grok-org-element-parse-whole-buffer ()
"Like `grok-org-element-parse-buffer' from point 1 and sans granularity."
(interactive)
(org-with-point-at 1
(pp-display-expression (org-element-parse-buffer) grok-org-output)))
(defun grok-org-heading-components ()
"Call `org-heading-components' interactively and pretty-print."
(interactive)
(pp-display-expression
(org-heading-components) grok-org-output))
(defun grok-org-element-lineage ()
"Call `org-element-lineage' interactively and pretty-print."
(interactive)
(org-load-modules-maybe)
(pp-display-expression
(org-element-lineage (org-element-context) nil t) grok-org-output))))
(defun grok-org-element-lineage ()
"Call `org-element-lineage' interactively and pretty-print."
(interactive)
(org-load-modules-maybe)
(pp-display-expression
(org-element-lineage (org-element-context) nil t) grok-org-output)))
#+end_src
** Grammar, spelling, and style tools