branch: externals/objed
commit ba3d63c9bb2cd83bf29be9712d2f48da53194a5d
Author: Clemens Radermacher <clem...@posteo.net>
Commit: Clemens Radermacher <clem...@posteo.net>

    Improve quit window or reformat
---
 objed.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/objed.el b/objed.el
index 655a04f..c04cf07 100644
--- a/objed.el
+++ b/objed.el
@@ -601,7 +601,8 @@ selected one."
   (interactive)
   (let* ((overriding-terminal-local-map nil)
          (nc (key-binding "q" nil t)))
-    (if (string-match "insert" (symbol-name nc))
+    (if (and (string-match "insert" (symbol-name nc))
+             (not buffer-read-only))
         (cond ((and (not (eq last-command this-command))
                     (or (eq major-mode 'fundamental-mode)
                         (derived-mode-p 'text-mode)
@@ -611,7 +612,7 @@ selected one."
                (objed--switch-to 'textblock))
               ((objed--switch-to 'defun)
                (indent-region (objed--beg) (objed--end))
-               (objed--switch-to 'defun)))
+               (objed--update-current-object)))
       (call-interactively nc))))
 
 (defvar objed-map

Reply via email to