From f29d88e84576d8e7c082f1a35c7a68ade16c2542 Mon Sep 17 00:00:00 2001 From: Florian Obser Date: Mon, 25 Mar 2024 16:32:01 +0100 Subject: [PATCH] Flip read-only-mode and text-mode to make it work with view-mode. --- emacs-ietf.org | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/emacs-ietf.org b/emacs-ietf.org index 7aaf131..fa32025 100644 --- a/emacs-ietf.org +++ b/emacs-ietf.org @@ -50,8 +50,8 @@ comes down to opening the correct file. So we can copy the code of (if (listp value) (mapcar 'pop-to-buffer-same-window (nreverse value)) (pop-to-buffer-same-window value)) - (read-only-mode) - (text-mode))) + (text-mode) + (read-only-mode))) ;; RFCs are stored in 'in-notes/' (defun ietf-rfc (filename &optional wildcards) @@ -66,10 +66,15 @@ comes down to opening the correct file. So we can copy the code of (if (listp value) (mapcar 'pop-to-buffer-same-window (nreverse value)) (pop-to-buffer-same-window value)) - (read-only-mode) - (text-mode))) + (text-mode) + (read-only-mode))) #+end_src +*Update 2024-03-25*: Flipping the order of ~(text-mode)~ and +~(read-only-mode)~ so that ~(read-only-mode)~ gets activated last +makes it work correctly with ~view-mode~ if that mode is automatically +activated by ~(setq view-read-only t)~ on read-only buffers. + Setting a global key binding lets us open RFCs and drafts from anywhere within Emacs: #+begin_src emacs-lisp