emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make-help-screen


From: martin rudalics
Subject: make-help-screen
Date: Wed, 17 Sep 2008 17:41:07 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

With emacs -Q

C-h C-h n q

gets me

Buffer is read-only: #<buffer NEWS>

The reason is `make-help-screen' locally binds `minor-mode-map-alist',
calls `help-mode' which calls `view-mode' which adds its bindings to
`minor-mode-map-alist'.  Exiting the local binding restores the original
binding of `minor-mode-map-alist' which now doesn't contain the
view-mode bindings.  The attached patch solves this problem for me.  Any
objections?

martin
*** help-macro.el.~1.43.~       2008-05-06 09:57:37.000000000 +0200
--- help-macro.el       2008-09-17 17:22:19.593750000 +0200
***************
*** 103,109 ****
                    ;; sections, *excluding* where we switch buffers
                    ;; and where we execute the chosen help command.
                    (local-map (make-sparse-keymap))
!                   (minor-mode-map-alist nil)
                    (prev-frame (selected-frame))
                    config new-frame key char)
               (if (string-match "%THIS-KEY%" help-screen)
--- 103,109 ----
                    ;; sections, *excluding* where we switch buffers
                    ;; and where we execute the chosen help command.
                    (local-map (make-sparse-keymap))
!                   (new-minor-mode-map-alist minor-mode-map-alist)
                    (prev-frame (selected-frame))
                    config new-frame key char)
               (if (string-match "%THIS-KEY%" help-screen)
***************
*** 111,117 ****
                         (replace-match (key-description (substring 
(this-command-keys) 0 -1))
                                        t t help-screen)))
               (unwind-protect
!                  (progn
                     (setcdr local-map ,helped-map)
                     (define-key local-map [t] 'undefined)
                     ;; Make the scroll bar keep working normally.
--- 111,117 ----
                         (replace-match (key-description (substring 
(this-command-keys) 0 -1))
                                        t t help-screen)))
               (unwind-protect
!                  (let ((minor-mode-map-alist nil))
                     (setcdr local-map ,helped-map)
                     (define-key local-map [t] 'undefined)
                     ;; Make the scroll bar keep working normally.
***************
*** 140,146 ****
                           (let ((inhibit-read-only t))
                             (erase-buffer)
                             (insert help-screen))
!                          (help-mode)
                           (goto-char (point-min))
                           (while (or (memq char (append help-event-list
                                                         (cons help-char '(?? 
?\C-v ?\s ?\177 delete backspace vertical-scroll-bar ?\M-v))))
--- 140,148 ----
                           (let ((inhibit-read-only t))
                             (erase-buffer)
                             (insert help-screen))
!                          (let ((minor-mode-map-alist 
new-minor-mode-map-alist))
!                            (help-mode)
!                            (setq new-minor-mode-map-alist 
minor-mode-map-alist))
                           (goto-char (point-min))
                           (while (or (memq char (append help-event-list
                                                         (cons help-char '(?? 
?\C-v ?\s ?\177 delete backspace vertical-scroll-bar ?\M-v))))
***************
*** 191,198 ****
                           (ding)))))
                 (if new-frame (iconify-frame new-frame))
                 (if config
!                    (set-window-configuration config))))))
!      )))
  
  (provide 'help-macro)
  
--- 193,200 ----
                           (ding)))))
                 (if new-frame (iconify-frame new-frame))
                 (if config
!                    (set-window-configuration config))
!                (setq minor-mode-map-alist new-minor-mode-map-alist))))))))
  
  (provide 'help-macro)
  

reply via email to

[Prev in Thread] Current Thread [Next in Thread]