Flip read-only-mode and text-mode to make it work with view-mode.

This commit is contained in:
Florian Obser 2024-03-25 16:32:01 +01:00
parent b510145d24
commit f29d88e845

View File

@ -50,8 +50,8 @@ comes down to opening the correct file. So we can copy the code of
(if (listp value) (if (listp value)
(mapcar 'pop-to-buffer-same-window (nreverse value)) (mapcar 'pop-to-buffer-same-window (nreverse value))
(pop-to-buffer-same-window value)) (pop-to-buffer-same-window value))
(read-only-mode) (text-mode)
(text-mode))) (read-only-mode)))
;; RFCs are stored in 'in-notes/' ;; RFCs are stored in 'in-notes/'
(defun ietf-rfc (filename &optional wildcards) (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) (if (listp value)
(mapcar 'pop-to-buffer-same-window (nreverse value)) (mapcar 'pop-to-buffer-same-window (nreverse value))
(pop-to-buffer-same-window value)) (pop-to-buffer-same-window value))
(read-only-mode) (text-mode)
(text-mode))) (read-only-mode)))
#+end_src #+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 Setting a global key binding lets us open RFCs and drafts from
anywhere within Emacs: anywhere within Emacs:
#+begin_src emacs-lisp #+begin_src emacs-lisp