From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Taylor R Campbell Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3824: 23.1.50; too much effort is put into handling Scheme S-expression comments, causing problems Date: Sat, 11 Jul 2009 12:35:45 -0400 Message-ID: <20090711163545.1FF939828B@pluto.mumble.net> Reply-To: Taylor R Campbell , 3824@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1247422558 5344 80.91.229.12 (12 Jul 2009 18:15:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2009 18:15:58 +0000 (UTC) To: emacs-pretest-bug@gnu.org, bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 12 20:15:51 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MQ3aZ-0000pL-9z for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Jul 2009 20:15:51 +0200 Original-Received: from localhost ([127.0.0.1]:52790 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQ3aY-0005ot-Ct for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Jul 2009 14:15:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MPftH-0001LN-CB for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:57:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MPftD-0001J0-0F for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:57:34 -0400 Original-Received: from [199.232.76.173] (port=34493 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MPftC-0001Il-H8 for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:57:30 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:35448) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MPftB-0008Mj-Oa for bug-gnu-emacs@gnu.org; Sat, 11 Jul 2009 12:57:30 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BGvR7O027162; Sat, 11 Jul 2009 09:57:27 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6BGe6tx024343; Sat, 11 Jul 2009 09:40:07 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Taylor R Campbell Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 11 Jul 2009 16:40:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3824 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124733015923829 (code B ref -1); Sat, 11 Jul 2009 16:40:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 11 Jul 2009 16:35:59 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6BGZrJ5023823 for ; Sat, 11 Jul 2009 09:35:54 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:38628) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MPfYG-0006sQ-TY for emacs-pretest-bug@gnu.org; Sat, 11 Jul 2009 12:35:53 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MPfYD-0004L9-HA for emacs-pretest-bug@gnu.org; Sat, 11 Jul 2009 12:35:52 -0400 Original-Received: from pluto.mumble.net ([206.123.75.20]:39860) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MPfYC-0004Kl-Je; Sat, 11 Jul 2009 12:35:48 -0400 Original-Received: from Oberon.local (localhost [127.0.0.1]) by pluto.mumble.net (Postfix) with ESMTP id 1FF939828B; Sat, 11 Jul 2009 16:35:45 +0000 (UTC) User-Agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/7.7.90.+ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Sat, 11 Jul 2009 12:57:34 -0400 X-Mailman-Approved-At: Sun, 12 Jul 2009 14:15:30 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29360 gmane.emacs.pretest.bugs:24780 Archived-At: (Apologies for duplicates: apparently sending mail from this machine using Emacs is non-trivial. Grmble.) Consider the following line of Scheme code: (foo bar #;(baz (quux #;() zot) mumble) frotz) If the point is at the beginning, hitting C-M-f causes Emacs to barf on imbalanced parentheses. This is because Emacs goes to excessive effort to handle S-expression comments in Scheme Mode, which causes more problems than it solves. Emacs should treat `#;' as whitespace, nothing more. The text following `#;' must be a valid S-expression anyway, so treating it as if it were a comment, which can contain any unstructured text except for a comment ender, leads to trouble. For example, because Emacs's `parse-partial-sexp' says that the point is in a comment if it is in an S-expression comment, paredit fails to preserve structure there. This is an extreme example; Emacs's S-expression motion commands in general should work inside S-expression comments, but they don't. For example, if `|' denotes the point in (foo bar #;(baz |(quux #;() zot) mumble) frotz), then C-M-f should cause the point to turn up at (foo bar #;(baz (quux #;() zot)| mumble) frotz), but instead it barfs on imbalanced parentheses. As far as I can imagine, the only legitimate context for treating `#;' as more than whitespace is Font Lock, but since Font Lock works with regular expressions, it, too, will do the wrong thing. (In the above example, Emacs fontifies everything after the initial `#;' as a comment, including the text `frotz)', which is outside the comment.) If it is too hard to make Emacs treat `#;' as whitespace and nothing more, then Emacs shouldn't treat the octothorpe specially, and simply read the rest of the line as a line comment. Scheme programmers can then just break the line after the semicolon. Emacs's current attempt to be clever causes trouble even for this simple workaround. For example, if `|' denotes the point in (foo bar #; |(baz (quux #; () zot) mumble) frotz), then C-M-f causes the point to move to the very end of the whole text, rather than to (foo bar #; (baz (quux #; () zot) mumble)| frotz), where it should go. In GNU Emacs 23.1.50.1 (i386-apple-darwin9.7.0, GTK+ Version 2.12.9) of 2009-07-11 on Oberon.local Windowing system distributor `The X.Org Foundation', version 11.0.10402000 Important settings: value of $LC_ALL: en_US.UTF-8 value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default-enable-multibyte-characters: t Major mode: Scheme Minor modes in effect: show-paren-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: S-SPC f o o # | f o o SPC f o o SPC | # C-b C-b C-b C-b M-: M-p C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b b C-b C-b SPC ( f r o b b l e ) S-SPC C-M-u C-M-f C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b [ ] C-a C-M-f C-M-b C-M-f C-M-b C-M-f C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-f SPC # ; C-f C-f SPC C-a C-M-f C-M-b C-M-f C-M-f C-M-f C-M-f C-M-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-f C-d C-d ( ) C-a C-M-f C-M-f C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-M-f C-M-b C-a C-n C-p C-n C-p C-f C-e C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-k C-n C-a C-p M-f M-f M-f z M-f q u u x M-f z o t M-f m u m b l e M-f f r o t z C-n C-x o C-x 4 0 M-x r e p r o t SPC e m a o r t SPC e m a c s SPC b u g Recent messages: (1 1 18 nil nil nil 0 nil nil (1)) (1 1 6 nil nil nil 0 nil nil (1)) (1 1 6 nil t nil 0 nil 10 (1)) (1 1 6 nil nil nil 0 nil nil (1)) let: End of file during parsing (1 1 6 nil t nil 0 nil 10 (1)) Undo! (0 nil 1 nil t nil 0 nil 26 nil) (0 nil 1 nil 1 nil 0 t 26 nil) forward-sexp: Scan error: "Unbalanced parentheses", 1, 53 [18 times]