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: Sat, 24 Dec 2022 23:32:21 +0100 Message-ID: References: <83a63d5765.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="28690"; 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 Sat Dec 24 23:33:13 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 1p9D4q-0007FL-Eb for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Dec 2022 23:33:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9D4h-0003RW-VI; Sat, 24 Dec 2022 17:33:03 -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 1p9D4g-0003Qv-D5 for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 17:33:02 -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 1p9D4g-00070P-3o for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 17:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9D4f-0007h0-TT for bug-gnu-emacs@gnu.org; Sat, 24 Dec 2022 17:33: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: Sat, 24 Dec 2022 22:33: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.167192115429500 (code B ref 54704); Sat, 24 Dec 2022 22:33:01 +0000 Original-Received: (at 54704) by debbugs.gnu.org; 24 Dec 2022 22:32:34 +0000 Original-Received: from localhost ([127.0.0.1]:47266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9D4D-0007fk-Ru for submit@debbugs.gnu.org; Sat, 24 Dec 2022 17:32:34 -0500 Original-Received: from mr85p00im-hyfv06021301.me.com ([17.58.23.188]:43932) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9D4B-0007f7-Bi for 54704@debbugs.gnu.org; Sat, 24 Dec 2022 17:32:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1671921144; bh=9mfw9i4xiT4tsOUZhzoc2k5revwmHQpOLKIyhskwtRY=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=T7OMiMu33bFZ/4A/0+GwZyJf5wLgfk7CwYZ8Tf5vZIPhJa4a9PlRpotkMMXSj5Iy0 oYiZwosrt3AudMRFWpJ2rg1YEtNeQ2rGkvmZtvWaauoqAcSAjIHYagJayFrqBZ2HxX ePZ7F4Irzo8pB2Ysh2D57aTLa4ZY9DyjPMu9EIWe98BFCMJzMkIZRbonrdOT3zl/fH BeFkenDdQOWMqAmzjlxNOQn/SNfeFK/JgVSJix+llUhcfLcX7UX7NczOldZw7rtpOp S/e7kd35WpV1Qdn+/2rYjuzrASNw5yt1tsJfuh27Egg6Ue2AlAmMkqc9po5bmCWXgS LFij0+Xx74fSw== Original-Received: from Rudolfs-MacBook-Air.local (mr38p00im-dlb-asmtp-mailmevip.me.com [17.57.152.18]) by mr85p00im-hyfv06021301.me.com (Postfix) with ESMTPSA id 0C5AD2151944; Sat, 24 Dec 2022 22:32:23 +0000 (UTC) In-Reply-To: <83a63d5765.fsf@gnu.org> X-Proofpoint-GUID: 0vL35Qf4OfH1ht7qzQbwdyCANwCuFyK1 X-Proofpoint-ORIG-GUID: 0vL35Qf4OfH1ht7qzQbwdyCANwCuFyK1 X-Proofpoint-Virus-Version: vendor=fsecure engine=1.1.170-22c6f66c430a71ce266a39bfe25bc2903e8d5c8f:6.0.138, 18.0.572, 17.11.62.513.0000000 definitions=2020-02-14_11:2020-02-14_02, 2020-02-14_11, 2021-12-02_01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=964 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 adultscore=0 clxscore=1015 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2212240198 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:251816 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Please see the attached patch that makes Emacs recognize R6RS/R7RS >> library files, as well as, makes Emacs recognize their members. > > Thanks. Thank you for your review! > The "+++" mark means that the manuals have been updated with this > information. I don't think this is the case, and we don't have any > manuals for the Scheme mode, right? So this should be "---" instead. Fixed. >> +*** Auto-detection of Scheme library files > > Heading lines in NEWS should end with a period. Fixed. >> +Emacs now automatically enables the Scheme mode for R6RS library >> +sources ('.sls') and R7RS library definitions ('.sld'). > > "source files" and "library definition files", right? Nope. Historically, Scheme has two *standard* library definitions, incompatible with each other, due to a bit "screwed up" transition from R5RS to R6RS and then R7RS. While not mandated by the standards R6RS and R7RS standards, in the wild, these come as: - Scheme Library Source ('.sls') for R6RS - Scheme Library Definition ('.sld) for R7RS However! I see how this can confuse the user, so I reworded both items in the NEWS file. Importantly, I capitalized the names and put them right next to their extensions, to tie it all together. Better? >> ++++ >> +*** Imenu members for R6RS and R7RS library members > > Same comments here. Fixed. Rudy --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Improve-support-for-Scheme-R6RS-and-R7RS-libraries-b.patch >From 0cd5b236981fa1dda92fd63da0017ff288fd50b0 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 | 14 ++++++++++++++ lisp/files.el | 2 +- lisp/progmodes/scheme.el | 20 +++++++++++++------- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index af7f1050b7..c121a0dd24 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -93,6 +93,20 @@ This command either fills a single paragraph in a defun, such as a doc-string, or a comment, or (re)indents the surrounding defun if point is not in a comment or a string. It is by default bound to 'M-q' in 'prog-mode' and all its descendants. + +** 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 30.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 "Logic is a science of the necessary laws of thought, without which no employment of the understanding and the reason takes place." -- Immanuel Kant, 1785 Rudolf Adamkovi=C4=8D [he/him] Studenohorsk=C3=A1 25 84103 Bratislava Slovakia --=-=-=--