From 39c5df99dc5ff050afbc7e413abcecacdf0de7f4 Mon Sep 17 00:00:00 2001 From: Greg Hendershott Date: Mon, 4 Nov 2024 13:00:25 -0500 Subject: [PATCH] reference.org: Use temp-buffer and write-region --- doc/generate.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/generate.el b/doc/generate.el index 88ce5719..3ebc5ec7 100644 --- a/doc/generate.el +++ b/doc/generate.el @@ -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 @@ -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 @@ -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).