From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.bugs Subject: bug#24882: 25.1; edebug-defun fails when lparen in string at BOL Date: Wed, 30 Nov 2016 00:48:07 -0800 Message-ID: References: <87k2cidpbb.fsf@zancas.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1480495887 6910 195.159.176.226 (30 Nov 2016 08:51:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2016 08:51:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) Cc: David Bremner , 24882@debbugs.gnu.org To: John Mastro Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 30 09:51:21 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC0bm-0000O7-WE for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Nov 2016 09:51:19 +0100 Original-Received: from localhost ([::1]:41998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC0bn-000372-JH for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Nov 2016 03:51:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cC0bb-00034h-5b for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2016 03:51:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cC0bW-0005on-8Y for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2016 03:51:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59721) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cC0bW-0005oA-27 for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2016 03:51:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cC0bV-00039R-Md for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2016 03:51:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Matt Armstrong Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Nov 2016 08:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24882 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24882-submit@debbugs.gnu.org id=B24882.148049585812102 (code B ref 24882); Wed, 30 Nov 2016 08:51:01 +0000 Original-Received: (at 24882) by debbugs.gnu.org; 30 Nov 2016 08:50:58 +0000 Original-Received: from localhost ([127.0.0.1]:46887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC0bR-000398-QN for submit@debbugs.gnu.org; Wed, 30 Nov 2016 03:50:58 -0500 Original-Received: from mail-pg0-f49.google.com ([74.125.83.49]:35763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cC0bQ-00038s-13 for 24882@debbugs.gnu.org; Wed, 30 Nov 2016 03:50:56 -0500 Original-Received: by mail-pg0-f49.google.com with SMTP id p66so79967671pga.2 for <24882@debbugs.gnu.org>; Wed, 30 Nov 2016 00:50:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=O3sNN1idSwb18LYymv+emNkczP5QOi8itYsryHnu9mk=; b=L1i+lNoci1IN7HbAGKZi47maVidDkVRbsicMhtb9z1dMGvoVezFqbIvsbNnZJ5GUIV hCGP60mnh5PcRfg6qOOYA9P6f1+4/kiYooCoFaFtrlR7PHiIpRgRjZ3lFTNZgjh3dXa1 2ylm04nkc3DzkhptzYil4ga5BsH71xFypUw/zdXmwfy6wNy6grc3ogDJghZDsD3nGj3q G2gysmexWNYhb9t5py/dYjU+0TQNpbRAj/mr0e6sjnJQiZS6PxGLtoNONBRockCmIKWz ZhS0fK3IHAGFqokdHDXhBn/b6wuZVdk3mF41OD5nOmDpVXl9JtHn5raa32nLwk0jFDpz U2hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=O3sNN1idSwb18LYymv+emNkczP5QOi8itYsryHnu9mk=; b=gzp8js1XXRgSiAhYKA+E20w4RquAJaELqRJHsvBBjKNi3khY55LkLkh3ubKxzQ7TD9 Ixb6AV99u9NGlDgwMj6lOZMJHe/qs6X3vnTxhTQp6uzIw8Ab1e1FbZQPJz9hDUQqoZum XUDECwfjlwT5K82ohKRY6GnkxkoFFRuFSeHzmmY8/ktxXO2XXmKxHX9R+rgRCiAdD0sX yiEQr4zJIa/osp02jmukuHo15FfPq/TPIOUfGDDiXULSxt5TfM2UgoM2CpQ5F8wiujOJ FshXd0j2fdgMgC3pg3Mo5SNAuZdsfeixEBPYReiSxcj1E5tuO+HLaoTAcvY6/yX4Prku DllQ== X-Gm-Message-State: AKaTC02XSed+tA5G/cgiMv/7c4TcMlEHo8ZLB1q6+nNbG/YU//1MPZ/SV/WKhdag9Jq9Ir18 X-Received: by 10.99.207.17 with SMTP id j17mr56060461pgg.57.1480495850169; Wed, 30 Nov 2016 00:50:50 -0800 (PST) Original-Received: from marmstrong-macbookpro.roam.corp.google.com (50-46-113-121.evrt.wa.frontiernet.net. [50.46.113.121]) by smtp.gmail.com with ESMTPSA id o1sm82943377pgf.35.2016.11.30.00.50.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Nov 2016 00:50:49 -0800 (PST) X-Google-Original-From: Matt Armstrong In-Reply-To: (John Mastro's message of "Sat, 5 Nov 2016 17:05:17 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:126292 Archived-At: John Mastro writes: > David Bremner wrote: >> 1) save the following definitions into a file edebug-fail.el >> >> (defun edebug-fail () >> "blah" >> (glub "foo >> (bar)")) >> >> (defun edebug-success () >> "blah" >> (glub "foo (bar)")) >> >> 2) emacs -Q edebug-defun.el >> >> 3) place the point after the defun for edebug fail >> >> 4) run M-x edebug-defun ; observe the next defun, for edebug-success is >> evaled. >> >> 5) Add a space before (bar), repeat step 4. Observe the correct function >> definition is evaluated > > This is caused by the heuristic that an open paren in column zero > indicates the beginning of a defun, via end-of-defun. If you set > open-paren-in-column-0-is-defun-start to nil the recipe will work as > expected (i.e. edebug-defun will evaluate edebug-fail). > > Not sure if there's anything that can be reasonably done to improve this > (other than changing the default for o-p-i-c-0-i-d-s). > > John Indeed this heuristic appears to be intentional, justified by an apeal to efficiency. The Emacs manual uses an example very similar to `edebug-fail' above as a "what not to do" case: https://www.gnu.org/software/emacs/manual/html_node/emacs/Left-Margin-Paren.html David, if you agree with this rationale, mind closing the bug?