From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#72080: imenu returns different lists in emacs-news-mode and emacs-news-view-mode Date: Sun, 14 Jul 2024 16:16:09 +0300 Message-ID: <861q3wjequ.fsf@gnu.org> References: <864j8tlkuy.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6308"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72080@debbugs.gnu.org, chansey97@gmail.com To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 14 15:19:16 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1sSz8G-0001Qh-5O for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 14 Jul 2024 15:19:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSz83-00005o-8l; Sun, 14 Jul 2024 09:19:03 -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 1sSz81-00005f-Qc for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2024 09:19:01 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sSz81-0000H1-IG for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2024 09:19:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSz81-0006CU-SU for bug-gnu-emacs@gnu.org; Sun, 14 Jul 2024 09:19:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jul 2024 13:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72080 X-GNU-PR-Package: emacs Original-Received: via spool by 72080-submit@debbugs.gnu.org id=B72080.172096311323799 (code B ref 72080); Sun, 14 Jul 2024 13:19:01 +0000 Original-Received: (at 72080) by debbugs.gnu.org; 14 Jul 2024 13:18:33 +0000 Original-Received: from localhost ([127.0.0.1]:57338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSz7Z-0006Bn-17 for submit@debbugs.gnu.org; Sun, 14 Jul 2024 09:18:33 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSz7W-0006Ba-Q3 for 72080@debbugs.gnu.org; Sun, 14 Jul 2024 09:18:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sSz5I-0008Ot-Rf; Sun, 14 Jul 2024 09:16:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=cdBP6y8VngwhBgW8r2grIWeTrtkFYCWVvcJyC6LmiVI=; b=gr8YznNqP66OiaB9pwKb lpHS6+9xNcWKE9LbDRmGO//1RHNeYVElNOFA4sBbw0cUFGCW77q62J7yjUxsBDSpwQlVJhMMQIcao 13cX0/jZyLQT7I0BpixQdO52PleyQ2wm5auWiBGk/YYpeUPcHlSHhXpdZhunTUcDODOXB7neFsaAO MIIam7jeWrY/Wjc8h4973E3HTU+aKY9V1kGkzNnNgmZ7//G68KhRlQAWvXtY6m3VeQSHAsLyWxHDl WYP0DsNo8Gv3r0mC4LbEGT4iZWbft3Q+JAZLJXNxS+V+QKnj1irOZ7Pkk8ziUd7IZ+Bt/O1Cjdjsy TBl7QAC/9JN3Bw==; In-Reply-To: (message from Stefan Monnier on Sun, 14 Jul 2024 08:57:37 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288842 Archived-At: > From: Stefan Monnier > Cc: Siyuan Chen , 72080@debbugs.gnu.org > Date: Sun, 14 Jul 2024 08:57:37 -0400 > > > For some reason I cannot get emacs-news-view-mode inherit the > > keymap of special-mode, nor even use its own keymap I defined in a > > defvar emacs-news-view-mode-map. Stefan, any reason why a simple > > definition of emacs-news-view-mode-map doesn't work, as the ELisp > > manual promises it should (where it described define-derived-mode)? > > Can't think of a reason, no. But it doesn't work. I'm puzzled why. Any suggestions where to look? > > Do we have a way of making one mode use the syntax table of another > > mode without having a variable which holds the latter? > > `C-h o` says: > > define-derived-mode is an autoloaded Lisp macro in ‘derived.el’. > [...] > KEYWORD-ARGS: > [...] > :syntax-table TABLE > Use TABLE instead of the default > (CHILD-syntax-table). A nil value means to > simply use the same syntax-table as the parent. > > so `:syntax-table` should be able to do that. Sure, but TABLE should be a variable here. What I wanted was to tell define-derived-mode to use the syntax table of a given other mode which has no such variable. Would something like this: :syntax-table (with-temp-buffer (emacs-news-mode) (syntax-table)) have worked?