From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#24982: 24.5; way to let Elisp reader ignore unreadable #(...) constructs Date: Sat, 22 Aug 2020 21:53:50 +0200 Message-ID: <87pn7ih2y9.fsf@gnus.org> References: <87tuwuh4mj.fsf@gnus.org> <947a8471-8f34-40a9-852c-dc3a0997f9dc@default> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29194"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 24982@debbugs.gnu.org, Stefan Kangas To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 22 21:55:10 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 1k9ZbZ-0007UK-O7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Aug 2020 21:55:09 +0200 Original-Received: from localhost ([::1]:42804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k9ZbY-00080q-95 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 22 Aug 2020 15:55:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9ZbR-00080O-VB for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 15:55:01 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k9ZbR-0001gX-MH for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 15:55:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k9ZbR-0006qg-L7 for bug-gnu-emacs@gnu.org; Sat, 22 Aug 2020 15:55:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 22 Aug 2020 19:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24982 X-GNU-PR-Package: emacs Original-Received: via spool by 24982-submit@debbugs.gnu.org id=B24982.159812604426253 (code B ref 24982); Sat, 22 Aug 2020 19:55:01 +0000 Original-Received: (at 24982) by debbugs.gnu.org; 22 Aug 2020 19:54:04 +0000 Original-Received: from localhost ([127.0.0.1]:51548 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9ZaV-0006pN-Vf for submit@debbugs.gnu.org; Sat, 22 Aug 2020 15:54:04 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:39110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k9ZaU-0006or-9L for 24982@debbugs.gnu.org; Sat, 22 Aug 2020 15:54:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JsifzkmSRRobp9Qwa4guCNLHQsVrUVo1DWoMz2xO9iA=; b=gcIVsFThv3l69d44s0Q7DnJEky toc3t/3h6+Febijy2D40L5UISAq5Q1fh0VzifAzdHUaPHK+sbFJ8gdvSNiQ2VnUZjNOcbtqLBCLUZ 9VX7t56pOlH6pPB6Q+VTgSzkjBVfL7M3/rW6nuFtd5mCPhu4cCn2Ty6bYiyA0E+F8g2Q=; Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=xo) by quimby with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k9ZaJ-0005bL-JN; Sat, 22 Aug 2020 21:53:55 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEUQCwstHBqnoaeJ a3BVSFBPKiAXFyz///+6/j+UAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+QIFhMPJzjxBDsAAAGrSURB VDjLdZLBcusgDEVFk7K2UpN1BrcfUCD71uC9acyeN9Ph/z/hgXBcu3VY2AxH90pIAGwXW3ang3uH vXXqddf1H3/Bl1RKqks2wWYDblrrrr+wYIcwrsHBABwBcFJD8Nsc1vT2A4UyYWP29STzujDsTdhI TlIqoy6sVcaHsJK0gw3BNaJVcisRbRh8GEfWyy6DlSSlCEyMwNphB9AVvJhBXADgmC/0dnuvBacf ALY5dEZeZxB/wItuQHUDYj3KH16/YvJBycEj+gLSHZjJGkdADM8jLy4E/OtNdzf56pEJ077xIiGK z3pwU+exYaj1FRYA0MDRdD6nQOs+yWYG4KzW0yeWVesivzxY57QJvh6XkhbQWm3u8XT5GeAZGzrH +rKwFFB79v1dMjQNO0d6eHfQGlczsHRvVf7nncjNx9LD2XsBOVR4rM0jSflxCnkxfo7MEjaDHHK0 1zIMHlOVLID9q0PiqWoqSMsTiGkfcPgF4kJWAM6PQFqB9AgQ4TuALp4eAL5rBVQlDYptQaQ0JdkW 8FpxifilIOc9QAL+AEROo9uxWsDqvE79P+wzsHv9vnZwAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIw LTA4LTIyVDE5OjE1OjM5KzAwOjAwcItz+QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMC0wOC0yMlQx OToxNTozOSswMDowMAHWy0UAAAAASUVORK5CYII= X-Now-Playing: Miles Davis's _In A Silent Way_: "In A Silent Way-It's About That Time-In A Silent Way" In-Reply-To: <947a8471-8f34-40a9-852c-dc3a0997f9dc@default> (Drew Adams's message of "Sat, 22 Aug 2020 12:28:32 -0700 (PDT)") 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" Xref: news.gmane.io gmane.emacs.bugs:185998 Archived-At: Drew Adams writes: >> In Common Lisp, this is the #| ... |# operator, and it's handy >> occasionally. It's really like a nesting comment thing... > > Good point. I was thinking of #(...), but yes, > the situation is more general. It's about # > syntax that's found to be invalid, but for cases > where # nevertheless can tell where the sexp > parsing should end (and so can advance point there). Yup. I couldn't quite remember whether the Common Lisp #| |# was balanced, but it is, which is nice. That is, you can write #| foo #| bar |# zot |# and the first |# doesn't end the first #|. Digression: While Googling, I was reminded that Common Lisp also has #+condition (foo:bar) which (possibly) ignores the next sexp... which is handy in Common Lisp, but Emacs doesn't need it. Common Lisp needs it because reference to an unloaded package is a read error, instead of an undefined error. Which is a really bad design choice. That is, you can't say (if (fboundp 'foo:bar) ...) if foo is a package that isn't loaded -- it's a read error. Digression over! I'm not an expert on the Emacs Lisp reader, but poking at it at bit, it seems like adding support for #| |# should be trivial: It's just a new comment syntax, really, so we just have to count #|'s and discard the input. A bigger issue would be in emacs-lisp-mode -- having forward-sexp etc do the right thing. However, surely that's handled already in the Common Lisp modes, so we could just crib code from those, I'd have thought... So I think it's doable, which only leaves us with the question: What's the use case? Well, I think it's handy when developing. If I'm in the middle of a function ... (foo) (bar) (and-here-i'm-adding-some-new-stuff-that's-not-finished ... ) (zot) ... and I'm testing stuff, and I decide to take out the stuff I'm writing... Emacs doesn't really handle that well. I usually end up deleting the sexp, and hoping that the kill ring is big enough to hold it until I need it again, or slapping a (when nil ...) around it, which is unsatisfactory, because that changes the indentation. Just being able to do: ... (foo) (bar) #| (and-here-i'm-adding-some-new-stuff-that's-not-finished ... ) |# (zot) ... would be nice. And then the stuff I'm working on doesn't even have to be syntactically correct. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no