From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#54704: [PATCH] 29.0.50; Broken code assistance for Scheme libraries Date: Tue, 27 Dec 2022 01:48:34 +0100 Message-ID: References: <83a63d5765.fsf@gnu.org> <83a63a2uua.fsf@gnu.org> Reply-To: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25251"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 54704@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 27 01:49:28 2022 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 1p9y9m-0006Fx-Bg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Dec 2022 01:49:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9y9T-0005Bz-PR; Mon, 26 Dec 2022 19:49:07 -0500 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 1p9y9O-0005Bh-Hw for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2022 19:49:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9y9O-000497-9p for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2022 19:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9y9N-0007rF-Uj for bug-gnu-emacs@gnu.org; Mon, 26 Dec 2022 19:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Dec 2022 00:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54704 X-GNU-PR-Package: emacs Original-Received: via spool by 54704-submit@debbugs.gnu.org id=B54704.167210212830181 (code B ref 54704); Tue, 27 Dec 2022 00:49:01 +0000 Original-Received: (at 54704) by debbugs.gnu.org; 27 Dec 2022 00:48:48 +0000 Original-Received: from localhost ([127.0.0.1]:54377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9y9A-0007qi-1I for submit@debbugs.gnu.org; Mon, 26 Dec 2022 19:48:48 -0500 Original-Received: from pv50p00im-ztdg10012101.me.com ([17.58.6.49]:41238) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9y97-0007qT-Qo for 54704@debbugs.gnu.org; Mon, 26 Dec 2022 19:48:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1672102119; bh=/5Jf7crQ8lypc3wN2Xj2A98yDBsjQY0IU26R2YTt0gE=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=w+NbZhiB4d4Zz8+xUIL8TAocdB05zzjMMoQvlUPuC0uulfu4o+88X3+Xoe+SCf8uZ jYCeYtDb03ClEMeVlAyiSNGK6g3KvN+MW/NmvE8dKUj+51GB0snZgZuZ1kTBMzI5Fq 0+an8CuXUJYZiwgyhuO0a+5yaA0bXjGE/3KqBHRVZjJO5FEhxx38N2UbNhNCksmgh5 /IQDeAXD/EfU765nXI5q2Ftq2INWSRrGtDvSYbZoZBtWEWmPXorayHeJAWWr9JK8iB joiRl1kunqhQ/BOIi3XevtmyoFh71KPb6Sfyd4LH/ARymbnZtsoOvQfCX87zy8HWnN VOBlmapiALY6A== Original-Received: from Rudolfs-MacBook-Air.local (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10012101.me.com (Postfix) with ESMTPSA id C032774097E; Tue, 27 Dec 2022 00:48:37 +0000 (UTC) In-Reply-To: <83a63a2uua.fsf@gnu.org> X-Proofpoint-GUID: B3EckAq70rNJx5Hd7ND0ArOQXjIVDzuy X-Proofpoint-ORIG-GUID: B3EckAq70rNJx5Hd7ND0ArOQXjIVDzuy X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.517, 18.0.883, 17.11.64.514.0000000 definitions=2022-06-21_08:2022-06-21_01, 2022-06-21_08, 2022-02-23_01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 mlxlogscore=999 suspectscore=0 malwarescore=0 clxscore=1015 adultscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2212270004 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:251926 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks. Thank you! > I'd like to install this on the emacs-29 branch, so could you please > rebase the patch on top of emacs-29 and resubmit? Please see the attached file. Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Improve-support-for-Scheme-R6RS-and-R7RS-libraries-b.patch >From 8d3a6f2c384af04a4ae03e9d08bb183da14bf364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Sat, 24 Dec 2022 01:00:32 +0100 Subject: [PATCH] Improve support for Scheme R6RS and R7RS libraries (bug#54704) * etc/NEWS (Scheme mode): Document improved file-type auto-detection and Imenu support for R6RS and R7RS Scheme libraries. * lisp/files.el (auto-mode-alist): Associate the '.sls' (R6RS Scheme Library Source) and '.sld' (R7RS Scheme Library Definition) file name extensions with the Scheme mode. * lisp/progmodes/scheme.el (scheme-imenu-generic-expression): Make Imenu recognize the members nested (and so indented) inside of 'library' (R6RS) or 'define-library' (R7RS) forms. --- etc/NEWS | 13 +++++++++++++ lisp/files.el | 2 +- lisp/progmodes/scheme.el | 20 +++++++++++++------- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index 5b804b82b7..c64db9973d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3055,6 +3055,19 @@ name. This key is now bound to 'Buffer-menu-view-other-window', which will view this line's buffer in View mode in another window. +** Scheme mode + +--- +*** Auto-detection of Scheme library files. +Emacs now automatically enables the Scheme mode when opening R6RS +Scheme Library Source ('.sls') files and R7RS Scheme Library +Definition ('.sld') files. + +--- +*** Imenu members for R6RS and R7RS library members. +Imenu now lists the members directly nested in R6RS Scheme libraries +('library') and R7RS libraries ('define-library'). + * New Modes and Packages in Emacs 29.1 diff --git a/lisp/files.el b/lisp/files.el index f352d3a9a7..522e4fbf93 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2850,7 +2850,7 @@ auto-mode-alist ("\\.emacs-places\\'" . lisp-data-mode) ("\\.el\\'" . emacs-lisp-mode) ("Project\\.ede\\'" . emacs-lisp-mode) - ("\\.\\(scm\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) + ("\\.\\(scm\\|sls\\|sld\\|stk\\|ss\\|sch\\)\\'" . scheme-mode) ("\\.l\\'" . lisp-mode) ("\\.li?sp\\'" . lisp-mode) ("\\.[fF]\\'" . fortran-mode) diff --git a/lisp/progmodes/scheme.el b/lisp/progmodes/scheme.el index 8454f24356..f45d799252 100644 --- a/lisp/progmodes/scheme.el +++ b/lisp/progmodes/scheme.el @@ -115,7 +115,8 @@ 'scheme-mode-abbrev-table (defvar scheme-imenu-generic-expression `((nil - ,(rx bol "(define" + ,(rx bol (zero-or-more space) + "(define" (zero-or-one "*") (zero-or-one "-public") (one-or-more space) @@ -123,36 +124,41 @@ scheme-imenu-generic-expression (group (one-or-more (or word (syntax symbol))))) 1) ("Methods" - ,(rx bol "(define-" + ,(rx bol (zero-or-more space) + "(define-" (or "generic" "method" "accessor") (one-or-more space) (zero-or-one "(") (group (one-or-more (or word (syntax symbol))))) 1) ("Classes" - ,(rx bol "(define-class" + ,(rx bol (zero-or-more space) + "(define-class" (one-or-more space) (zero-or-one "(") (group (one-or-more (or word (syntax symbol))))) 1) ("Records" - ,(rx bol "(define-record-type" + ,(rx bol (zero-or-more space) + "(define-record-type" (zero-or-one "*") (one-or-more space) (group (one-or-more (or word (syntax symbol))))) 1) ("Conditions" - ,(rx bol "(define-condition-type" + ,(rx bol (zero-or-more space) + "(define-condition-type" (one-or-more space) (group (one-or-more (or word (syntax symbol))))) 1) ("Modules" - ,(rx bol "(define-module" + ,(rx bol (zero-or-more space) + "(define-module" (one-or-more space) (group "(" (one-or-more any) ")")) 1) ("Macros" - ,(rx bol "(" + ,(rx bol (zero-or-more space) "(" (or (and "defmacro" (zero-or-one "*") (zero-or-one "-public")) -- 2.39.0 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable --=20 "'Contrariwise,' continued Tweedledee, 'if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic.'" -- Lewis Carroll, Through the Looking Glass, 1871/1872 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--