From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#40915: [PATCH] Make leaving Info-summary more intuitive Date: Tue, 28 Apr 2020 11:43:54 -0700 (PDT) Message-ID: References: <83sggo2ik3.fsf@gnu.org> <25e557d9-4b68-470a-96d5-c51552d5fa38@default> <878sif7bng.fsf@stefankangas.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="34589"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 40915@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 28 20:45:21 2020 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 1jTVEK-0008nN-Uq for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 20:45:16 +0200 Original-Received: from localhost ([::1]:44726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTVEJ-00060q-JP for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 28 Apr 2020 14:45:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52512) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTVE7-0005wp-Cq for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 14:45:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTVE6-0005Hu-Nm for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 14:45:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58146) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jTVE6-0005HI-8e for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 14:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jTVE6-0004y6-4n for bug-gnu-emacs@gnu.org; Tue, 28 Apr 2020 14:45:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 28 Apr 2020 18:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40915 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40915-submit@debbugs.gnu.org id=B40915.158809944619016 (code B ref 40915); Tue, 28 Apr 2020 18:45:02 +0000 Original-Received: (at 40915) by debbugs.gnu.org; 28 Apr 2020 18:44:06 +0000 Original-Received: from localhost ([127.0.0.1]:41459 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTVDB-0004we-Na for submit@debbugs.gnu.org; Tue, 28 Apr 2020 14:44:05 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:36958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jTVD9-0004w2-T8 for 40915@debbugs.gnu.org; Tue, 28 Apr 2020 14:44:04 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03SIhY5s092299; Tue, 28 Apr 2020 18:43:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=aOjjj9n3g5ShHY50PgYTdit6sItC80ELW3aXMMzV4rw=; b=zvolo8dd+DlClefB5Aen6C4SvmldXLQIL7Sk4B73kJISSHeMt8DzZxsNNEOTiBoUQ/r2 dNLjHmX/sL7/n9LUTNmZk+sDGFnytFu9XB7qAo3AfWrCOn3Upc4SMyR9hDKB16CJ2HTo bLcb4TE5luebKJKJGWEYDDP1RHkAW534H8fJj0Qnb5vU5JLk+7eaWVwzeaXI4gGGjQxH G7LEuunbx7jMnVaTABQsDy76jbayuoA8h+xxPMRgSojos908HatixQIUQ5w24XptkfkV 6Xb6oKz6XYbZU+kquB8Ham2uFcKVbXSj+kbKTw/fLsXYnVxaVrTeEqxoVWnVZofqzCgn Tw== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 30p01nr9kx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 18:43:57 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03SIftwU064425; Tue, 28 Apr 2020 18:43:57 GMT Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3020.oracle.com with ESMTP id 30mxx0fky8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 28 Apr 2020 18:43:57 +0000 Original-Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 03SIht07020490; Tue, 28 Apr 2020 18:43:56 GMT In-Reply-To: <878sif7bng.fsf@stefankangas.se> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4993.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9605 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280147 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9605 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 clxscore=1015 phishscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004280147 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 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" Xref: news.gmane.io gmane.emacs.bugs:179239 Archived-At: > > For (a), what do you mean by a "general" help > > command? The point of Info-summary is to provide > > succinct help about Info. >=20 > I meant that you can have a command which works in any major mode very > easily: >=20 > (defun Info-summary () > "Display a brief summary of all Info commands." > (interactive) > (save-window-excursion > (switch-to-buffer "*Help*") > (setq buffer-read-only nil) > (erase-buffer) > - (insert (documentation 'Info-mode)) > + (insert (documentation major-mode)) > (help-mode) > (goto-char (point-min)) > (let (ch flag) > (while (progn (setq flag (not (pos-visible-in-window-p (point- > max)))) > =09=09 (message (if flag "Type Space to see more" > =09=09=09 "Type Space to return to Info")) > =09=09 (if (not (eq ?\s (setq ch (read-event)))) > =09=09=09(progn (push ch unread-command-events) nil) > =09=09 flag)) > =09(scroll-up))) > (bury-buffer "*Help*"))) I see. +1. But maybe consider something like this instead. IOW, let it be useful for any major mode, from anywhere, not just for the current major mode. (defun summarize-major-mode (mode) (interactive (list (completing-read (format "Mode (default %s): " major-mode) obarray (lambda (ss) (and (commandp ss) (boundp ss) (string-match-p "-mode\\'" (symbol-name ss)))) t nil nil major-mode))) ...) ; The rest as you showed