From 5182b352cd2d4e03d18b5a37505db64e1fdf1f62 Mon Sep 17 00:00:00 2001 From: Howard Abrams Date: Tue, 29 Oct 2024 19:42:34 -0700 Subject: [PATCH] Demo code can load file or switch to buffer --- ha-demos.org | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ha-demos.org b/ha-demos.org index 93cda64..03a71ff 100644 --- a/ha-demos.org +++ b/ha-demos.org @@ -2,7 +2,7 @@ #+author: Howard X. Abrams #+date: 2024-10-18 #+filetags: emacs hamacs -#+lastmod: [2024-10-24 Thu] +#+lastmod: [2024-10-26 Sat] A literate programming file for creating and running demonstrations @@ -275,8 +275,11 @@ All options? Should I use Common Lisp’s =cl-defun= for the keyword parameters? ('below (progn (split-window-vertically) (other-window 1)))) ;; We could do :left and :top by not doing the other window bit... - ;; Step 2: Load the file - (find-file filename) + ;; Step 2: Load the file or switch to the buffer: + (if (file-exists-p filename) + (find-file filename) + (switch-to-buffer filename)) + (goto-char (point-min)) ;; Step 3: Increase the font size