Skip to content

Commit

Permalink
reference.org: Use temp-buffer and write-region
Browse files Browse the repository at this point in the history
  • Loading branch information
greghendershott committed Nov 4, 2024
1 parent e7e121a commit 39c5df9
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions doc/generate.el
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
(require 'seq)

(defun racket-generate-reference.org ()
(find-file "reference.org")
(delete-region (point-min) (point-max))
(insert-org-contents)
(save-buffer 0)) ;don't create reference.org~ backup
(with-temp-buffer
(insert-org-contents)
(write-region nil nil "reference.org")))

(defun insert-org-contents ()
(insert-commands)
(insert-variables)
(insert-configuration-functions)
(insert-functions)
(insert-faces))

;;; Interactive command functions
Expand Down Expand Up @@ -177,7 +176,7 @@
racket-vterm)
"Configuration functions to include in the Reference.")

(defun insert-configuration-functions ()
(defun insert-functions ()
(insert "* Configuration functions\n\n")
(dolist (s the-functions)
(pcase s
Expand Down Expand Up @@ -391,8 +390,8 @@ Filter \"noise\" like bindings for `negative-argument' and
Insert sorted by command name.
When multiple key-bindings for a command, group into one row of
table, sorted shortest first."
When multiple key-bindings for a command, group into one row,
sorted shortest key sequences first."
;; Accumulate nested keymaps into a flat association list. Each key
;; is a command symbol. Each value is a list of lists of keys
;; (potentially more than one key sequence bound for each command).
Expand Down

0 comments on commit 39c5df9

Please sign in to comment.