From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: emacs-30 ab7c40ea52a: Fix Imenu in 'emacs-news-view-mode' Date: Mon, 22 Jul 2024 13:19:55 +0200 Message-ID: <87cyn5brms.fsf@gmail.com> References: <172146804439.2058.3466869777211222963@vcs2.savannah.gnu.org> <20240720093404.DAF02C41F01@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6067"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 22 13:20:53 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sVr64-0001UB-Ts for ged-emacs-devel@m.gmane-mx.org; Mon, 22 Jul 2024 13:20:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVr5P-0000DZ-14; Mon, 22 Jul 2024 07:20:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVr5J-0008K7-2y for emacs-devel@gnu.org; Mon, 22 Jul 2024 07:20:05 -0400 Original-Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sVr5H-0005Fx-6r; Mon, 22 Jul 2024 07:20:04 -0400 Original-Received: by mail-lj1-x22a.google.com with SMTP id 38308e7fff4ca-2eea8ea8c06so54494511fa.2; Mon, 22 Jul 2024 04:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721647199; x=1722251999; darn=gnu.org; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=oWJY+LDESLv+Rh+G4Z50ZVssuLT1HAccebNR0RE5BVo=; b=ZPPMgqLdXmPD4Ly6ZRtFJyuj5b5+IDVvQm5IW/bZClpNaUGmgKROZNwNiENzcy7LIN PJpKPX1ZVwtqnH4d6htqeRh7/dlDb9ZKwu8CxWDrH/peAYIH4h3f9evtRM5S7UUiJHYY +zmFCzra9d+EmwvbUKpFw1eq3LC3ueri7wLZ2xdKFqbLXHTTuzJJ/x6aYQy/BIQuZJUR PSfUgeWP2UfJDLNM2UPNCWG2kwZdkbtm3c0L1NtfQLG9lEnXolLMDeUEoUfbVkZLf1Ot A/KQ8NRQHj51q+syTm+erkMzhdWSWtjpldcq5YjVjgt3nvW66VMKvFCJhccLVGAFZYKT YaHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721647199; x=1722251999; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oWJY+LDESLv+Rh+G4Z50ZVssuLT1HAccebNR0RE5BVo=; b=le3IhgzfsyI1LkccnEg6HQlSJaXgWJy0p7YUGhPMIA9Qb9JrynHQRaNA4gVHIan6ZU /zikzzG3RCbOr5btmBCehymAgZpP4POy8ukoNjvBkre2UE0/bCuP3YbVYCWX7Vm3/9/L jIk0zBqHb0VDF4eRXrtNrl7VtBGN4FWzN+cajVOQyYp35jITEvMiAoptljuboLGjq1pv m5RCRwNjUrFhLmXhg6FkOFq0UIBgjub8jOH86495iTNAszopu0Oeexr2Om4rsTTRVzek r8GbR+bsLp7ap+QUjm7OnuoSZv01OLZxtTLaEom3kOuBrzZonqa7q45fNHpq3Jow5BT5 C7Zg== X-Gm-Message-State: AOJu0YwP2fJpKmOIO6/vwJG948l5T6Jt8r/Uj5hFKfbeiMTwTe8q9l9t ihd8l7BS87p70SqS+dSiVTFgUEQKLpQk0admXY5snGueKjE6s3Ll7TucKA== X-Google-Smtp-Source: AGHT+IEEVRxUDEvOSQ6costycDd1SVnXEaM05kJjtc4DRbvmuKF7HT1WwPaqzPyDQsUwvDxd+fpOXg== X-Received: by 2002:a2e:8097:0:b0:2ee:8453:5164 with SMTP id 38308e7fff4ca-2ef1662084dmr45099121fa.0.1721647197299; Mon, 22 Jul 2024 04:19:57 -0700 (PDT) Original-Received: from rltb ([82.66.8.55]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-427d2a5c564sm149960145e9.14.2024.07.22.04.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jul 2024 04:19:56 -0700 (PDT) In-Reply-To: <20240720093404.DAF02C41F01@vcs2.savannah.gnu.org> (Eli Zaretskii's message of "Sat, 20 Jul 2024 05:34:04 -0400 (EDT)") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::22a; envelope-from=rpluim@gmail.com; helo=mail-lj1-x22a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:321931 Archived-At: >>>>> On Sat, 20 Jul 2024 05:34:04 -0400 (EDT), Eli Zaretskii said: Eli> branch: emacs-30 Eli> commit ab7c40ea52a1db0cfc8b6605363f4e1378c9b471 Eli> Author: Eli Zaretskii Eli> Commit: Eli Zaretskii Eli> Fix Imenu in 'emacs-news-view-mode' Eli> * lisp/textmodes/emacs-news-mode.el (emacs-news-view-mode): Make Eli> it derived from emacs-news-mode. Add useful key bindings. Eli> (Bug#72080) If you want all the bindings of `special-mode', you could just inherit from it: diff --git a/lisp/textmodes/emacs-news-mode.el b/lisp/textmodes/emacs-news-mode.el index ca897ec4567..2c6a5f174ed 100644 --- a/lisp/textmodes/emacs-news-mode.el +++ b/lisp/textmodes/emacs-news-mode.el @@ -75,12 +75,10 @@ emacs-news-mode-menu "--" ["Enter View Mode" emacs-news-view-mode :help "Enter view-only mode"])) -(defvar emacs-news-view-mode-map - ;; This is defined this way instead of inheriting because we're - ;; deriving the mode from `special-mode' and want the keys from there. - (let ((map (copy-keymap emacs-news-common-map))) - (keymap-set map "C-x C-q" #'emacs-news-mode) - map)) +(defvar-keymap emacs-news-view-mode-map + :parent (make-composed-keymap emacs-news-mode-map special-mode-map) + "C-x C-q" #'emacs-news-mode +) (defvar emacs-news-mode-font-lock-keywords `(("^---$" 0 'emacs-news-does-not-need-documentation) @@ -111,17 +109,7 @@ emacs-news-view-mode "Major mode for viewing the Emacs NEWS file." (setq buffer-read-only t) (emacs-news--buttonize) - (button-mode) - ;; Bind useful browsing keys. - (keymap-local-set "q" 'quit-window) - (keymap-local-set "SPC" 'scroll-up-command) - (keymap-local-set "S-SPC" 'scroll-down-command) - (keymap-local-set "DEL" 'scroll-down-command) - (keymap-local-set "?" 'describe-mode) - (keymap-local-set "h" 'describe-mode) - (keymap-local-set ">" 'end-of-buffer) - (keymap-local-set "<" 'beginning-of-buffer) - (keymap-local-set "g" 'revert-buffer)) + (button-mode)) (defun emacs-news--fill-paragraph (&optional justify) (cond Robert --