From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christoph Scholtes Newsgroups: gmane.emacs.devel Subject: Re: completion-list-mode-map Date: Mon, 11 Jul 2011 22:20:39 -0600 Message-ID: <86oc10w2nc.fsf@googlemail.com> References: <4DEA3F21.2020302@gmail.com> <4E07B9F0.3080102@gmail.com> <4E0F40A1.3020503@gmail.com> <4E0FB543.9040608@gmail.com> <4E13BC5A.2070007@gmail.com> <4E191159.1080501@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1310444474 9783 80.91.229.12 (12 Jul 2011 04:21:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 12 Jul 2011 04:21:14 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 12 06:21:10 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QgUT7-0003Ms-BB for ged-emacs-devel@m.gmane.org; Tue, 12 Jul 2011 06:21:09 +0200 Original-Received: from localhost ([::1]:58269 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgUT6-0008I9-KO for ged-emacs-devel@m.gmane.org; Tue, 12 Jul 2011 00:21:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:33796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgUSs-0008I2-AX for emacs-devel@gnu.org; Tue, 12 Jul 2011 00:20:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QgUSr-0004oK-0u for emacs-devel@gnu.org; Tue, 12 Jul 2011 00:20:54 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:52199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QgUSq-0004oA-TA for emacs-devel@gnu.org; Tue, 12 Jul 2011 00:20:52 -0400 Original-Received: by yxj17 with SMTP id 17so229482yxj.0 for ; Mon, 11 Jul 2011 21:20:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:cc:date :message-id:mime-version:content-type; bh=1WgRnp/9wElGLSSdEBm7AZ6KYp/rxmb2uP3h0TKeSJU=; b=COJJsPlfi+L/wv6bLxjMB9d1MyyahLH4GaV0imjoLqP3apsVA1xgDrh1omHw72ZJQ4 voZ9KtHhbjOj7Pm3uPZBfNzBtWje9/IJ1qsexQVzThbVlASrbB+kJYlsNYz0KO82cq52 gN8iecYlALIdToz0KrsejQETwHFk/7IrvYxio= Original-Received: by 10.236.154.1 with SMTP id g1mr6470418yhk.112.1310444452116; Mon, 11 Jul 2011 21:20:52 -0700 (PDT) Original-Received: from MARVIN (71-208-199-22.hlrn.qwest.net [71.208.199.22]) by mx.google.com with ESMTPS id i61sm285848yhe.61.2011.07.11.21.20.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 21:20:51 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 11 Jul 2011 23:20:51 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (windows-nt) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.213.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:141968 Archived-At: Stefan Monnier 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 + + * 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 * 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")) -;;;###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