From: Christoph Scholtes <cschol2112@googlemail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: completion-list-mode-map
Date: Mon, 11 Jul 2011 22:20:39 -0600 [thread overview]
Message-ID: <86oc10w2nc.fsf@googlemail.com> (raw)
In-Reply-To: <jwvbox0rydr.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Mon, 11 Jul 2011 23:20:51 -0400")
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> OK, I see some instances where this is still present although the mode is
>> derived from special-mode. I assume those can be removed then?
>
> Yes.
OK. I will clean those up.
>> There is multiple instances where the mode derives from special-mode, but
>> the keymap parent is explicitly set to special-mode also. Should those
>> be removed?
>
> They don't hurt.
OK.
> copy-keymap is usually a bad idea. I guess you used it in order to
> still be able to inherit from special-mode-map, but that's not needed
> any more: I installed a week ago changes that add multiple-keymap
> inheritance
Excellent. That was exactly what I was trying to achieve.
> Why keep the view-no-disable-on-exit setting?
Oversight. Removed.
Here is the updated patch with Changelog entry.
Christoph
=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog 2011-07-06 22:43:46 +0000
+++ lisp/ChangeLog 2011-07-12 04:12:27 +0000
@@ -1,3 +1,12 @@
+2011-07-12 Christoph Scholtes <cschol2112@googlemail.com>
+
+ * help-mode.el (help-mode-map): Add special-mode-map to parent map.
+ (help-mode): Derive help-mode from special-mode. Don't invoke
+ view-mode from help-mode.
+ (help-xref-override-view-map): Remove.
+ (help-make-xrefs): Remove minor-mode-overriding-map-alist since
+ view-mode is not used anymore.
+
2011-07-06 Richard Stallman <rms@gnu.org>
* mail/rmailmm.el (rmail-mime-process): Use markers for buf positions.
=== modified file 'lisp/help-mode.el'
--- lisp/help-mode.el 2011-06-13 13:14:42 +0000
+++ lisp/help-mode.el 2011-07-12 03:41:40 +0000
@@ -35,13 +35,12 @@
(defvar help-mode-map
(let ((map (make-sparse-keymap)))
- (set-keymap-parent map button-buffer-map)
-
+ (set-keymap-parent map (make-composed-keymap button-buffer-map
+ special-mode-map))
(define-key map [mouse-2] 'help-follow-mouse)
(define-key map "\C-c\C-b" 'help-go-back)
(define-key map "\C-c\C-f" 'help-go-forward)
(define-key map "\C-c\C-c" 'help-follow-symbol)
- ;; Documentation only, since we use minor-mode-overriding-map-alist.
(define-key map "\r" 'help-follow)
map)
"Keymap for help mode.")
@@ -266,37 +265,13 @@
'help-function 'customize-create-theme
'help-echo (purecopy "mouse-2, RET: edit this theme file"))
\f
-;;;###autoload
-(defun help-mode ()
+(define-derived-mode help-mode special-mode "Help"
"Major mode for viewing help text and navigating references in it.
Entry to this mode runs the normal hook `help-mode-hook'.
Commands:
\\{help-mode-map}"
- (interactive)
- (kill-all-local-variables)
- (use-local-map help-mode-map)
- (setq mode-name "Help")
- (setq major-mode 'help-mode)
-
- (view-mode)
- (set (make-local-variable 'view-no-disable-on-exit) t)
- ;; With Emacs 22 `view-exit-action' could delete the selected window
- ;; disregarding whether the help buffer was shown in that window at
- ;; all. Since `view-exit-action' is called with the help buffer as
- ;; argument it seems more appropriate to have it work on the buffer
- ;; only and leave it to `view-mode-exit' to delete any associated
- ;; window(s).
- (setq view-exit-action
- (lambda (buffer)
- ;; Use `with-current-buffer' to make sure that `bury-buffer'
- ;; also removes BUFFER from the selected window.
- (with-current-buffer buffer
- (bury-buffer))))
-
(set (make-local-variable 'revert-buffer-function)
- 'help-mode-revert-buffer)
-
- (run-mode-hooks 'help-mode-hook))
+ 'help-mode-revert-buffer))
;;;###autoload
(defun help-mode-setup ()
@@ -403,13 +378,6 @@
(error "Current buffer is not in Help mode"))
(current-buffer))))
-(defvar help-xref-override-view-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map view-mode-map)
- (define-key map "\r" nil)
- map)
- "Replacement keymap for `view-mode' in help buffers.")
-
;;;###autoload
(defun help-make-xrefs (&optional buffer)
"Parse and hyperlink documentation cross-references in the given BUFFER.
@@ -594,9 +562,6 @@
(current-buffer)))
(when (or help-xref-stack help-xref-forward-stack)
(insert "\n")))
- ;; View mode steals RET from us.
- (set (make-local-variable 'minor-mode-overriding-map-alist)
- (list (cons 'view-mode help-xref-override-view-map)))
(set-buffer-modified-p old-modified)))))
;;;###autoload
next prev parent reply other threads:[~2011-07-12 4:20 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-04 14:20 completion-list-mode-map Christoph Scholtes
2011-06-06 15:31 ` completion-list-mode-map Stefan Monnier
2011-06-26 23:00 ` completion-list-mode-map Christoph Scholtes
2011-06-29 3:04 ` completion-list-mode-map Stefan Monnier
2011-07-02 16:00 ` completion-list-mode-map Christoph Scholtes
2011-07-02 22:30 ` completion-list-mode-map Stefan Monnier
2011-07-03 0:18 ` completion-list-mode-map Christoph Scholtes
2011-07-03 5:38 ` completion-list-mode-map Stefan Monnier
2011-07-06 1:37 ` completion-list-mode-map Christoph Scholtes
2011-07-06 12:49 ` completion-list-mode-map Stefan Monnier
2011-07-10 2:41 ` completion-list-mode-map Christoph Scholtes
2011-07-12 3:20 ` completion-list-mode-map Stefan Monnier
2011-07-12 4:20 ` Christoph Scholtes [this message]
2011-07-14 2:19 ` completion-list-mode-map Christoph Scholtes
2011-07-12 11:29 ` completion-list-mode-map Juanma Barranquero
2011-07-13 3:57 ` completion-list-mode-map Stefan Monnier
2011-08-02 1:59 ` completion-list-mode-map Christoph Scholtes
2011-08-14 17:34 ` completion-list-mode-map Chong Yidong
2011-08-15 2:11 ` completion-list-mode-map Stefan Monnier
2011-08-15 4:48 ` completion-list-mode-map Thierry Volpiatto
2011-08-15 15:12 ` completion-list-mode-map Chong Yidong
2011-08-16 16:54 ` completion-list-mode-map Stefan Monnier
2011-08-16 18:53 ` completion-list-mode-map martin rudalics
2011-08-16 20:29 ` completion-list-mode-map Stefan Monnier
2011-08-16 20:54 ` completion-list-mode-map martin rudalics
2011-08-16 22:06 ` completion-list-mode-map Chong Yidong
2011-08-17 9:06 ` completion-list-mode-map martin rudalics
2011-08-17 20:39 ` completion-list-mode-map Chong Yidong
2011-08-18 6:57 ` completion-list-mode-map martin rudalics
2011-08-18 22:46 ` completion-list-mode-map Chong Yidong
2011-08-19 7:13 ` completion-list-mode-map martin rudalics
2011-08-20 19:20 ` completion-list-mode-map Chong Yidong
2011-08-21 8:45 ` completion-list-mode-map martin rudalics
2011-08-21 20:26 ` completion-list-mode-map Chong Yidong
2011-08-22 9:00 ` completion-list-mode-map Juri Linkov
2011-08-22 10:05 ` completion-list-mode-map Štěpán Němec
2011-08-22 19:52 ` completion-list-mode-map Stefan Monnier
2011-08-22 15:00 ` completion-list-mode-map Chong Yidong
2011-08-23 9:44 ` completion-list-mode-map martin rudalics
2011-09-03 17:19 ` completion-list-mode-map Christoph Scholtes
2011-09-03 18:33 ` completion-list-mode-map Chong Yidong
2011-09-03 20:01 ` completion-list-mode-map Christoph Scholtes
2011-09-05 14:40 ` completion-list-mode-map Chong Yidong
2011-09-05 18:02 ` completion-list-mode-map Andreas Schwab
2011-08-17 1:19 ` completion-list-mode-map Stefan Monnier
2011-08-17 9:06 ` completion-list-mode-map martin rudalics
-- strict thread matches above, loose matches on Subject: below --
2011-03-16 22:46 completion-list-mode-map Christoph Scholtes
2011-03-17 2:22 ` completion-list-mode-map Stefan Monnier
2011-03-17 5:00 ` completion-list-mode-map Christoph Scholtes
2011-03-17 12:53 ` completion-list-mode-map Wojciech Meyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86oc10w2nc.fsf@googlemail.com \
--to=cschol2112@googlemail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).