From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#23565: (24.5; tcl-end-of-defun and tcl-eval-defun doesn't work reliable) Date: Thu, 16 Jun 2016 23:55:00 -0400 Message-ID: References: <87mvnoe3pi.fsf@linux-qg7d.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1466135783 12420 80.91.229.3 (17 Jun 2016 03:56:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 03:56:23 +0000 (UTC) Cc: Rolf Ade To: 23565@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 17 05:56:16 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bDktD-0006Ht-2Q for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 05:56:15 +0200 Original-Received: from localhost ([::1]:53624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDktC-0000IT-4p for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Jun 2016 23:56:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDkt3-0000EW-L5 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 23:56:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDkt0-000893-2K for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 23:56:04 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59594) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDksz-00088z-UD for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 23:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bDksz-0000GI-P1 for bug-gnu-emacs@gnu.org; Thu, 16 Jun 2016 23:56:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87mvnoe3pi.fsf@linux-qg7d.fritz.box> Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2016 03:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23565 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23565-submit@debbugs.gnu.org id=B23565.1466135711947 (code B ref 23565); Fri, 17 Jun 2016 03:56:01 +0000 Original-Received: (at 23565) by debbugs.gnu.org; 17 Jun 2016 03:55:11 +0000 Original-Received: from localhost ([127.0.0.1]:43698 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDksB-0000FC-3J for submit@debbugs.gnu.org; Thu, 16 Jun 2016 23:55:11 -0400 Original-Received: from mail-oi0-f66.google.com ([209.85.218.66]:34868) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDks9-0000Eo-N2 for 23565@debbugs.gnu.org; Thu, 16 Jun 2016 23:55:09 -0400 Original-Received: by mail-oi0-f66.google.com with SMTP id u201so11552100oie.2 for <23565@debbugs.gnu.org>; Thu, 16 Jun 2016 20:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=ifiX5MmaXAxN05iiXQaILlwTz3OGtER3azCimsxVutE=; b=x8c54NIeoV32cDKIPXXlTnCcvkAQxhfN4J1cVWRHEp5ykYNlSlAhhAkXZf4z7BA4tm 8gtw10JcmhQq+/P1BUCHbknVeCXWsEOfkovfqJg+rdvmjtCdwNa5PAJBF1G7VPjh7ent dwgrFu4pjh+k3T2HKmAbliwGqGcr2wmKbB8SiI4UmVVttC8pyjC6oLebOv5M965oUJPZ aSymT20O0M56kqityuW3vOz3Vju+OH3iHH/n7ZNW3c6MA5iCYaIZAaqXRAUb3jzSkST7 DuzlylRKCYNkRrf06GpphcVmsGNetZ0WPqutw6HA7AxYodk3kHZ9wQSJ8RPYsK4aGkbp jU2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=ifiX5MmaXAxN05iiXQaILlwTz3OGtER3azCimsxVutE=; b=dzQr2jdfC8pdZSo/fGAsX0zB6j54iJPIaS6tJ/wEcI+vNLdB/FY9ejCyXRJ8apliLV ym30kk8XalSSXIexXfxJEtFWx5F3PsrwCg5PwebfeLfxLF3Aa8b9OYUTST9WaId6fLPD tbh81ljc3hPBcPK+W/PPByPAVXWrsClwo52fucfdXaBubHDkgu+3S/0O6OBAstHMV6yD c1S1OxVu7eCd8FkE3O4L+7BWfIS0I5siOL5aVlnlPBtQKjeX2ji6qUsIOLjpE2H23Zrf dcJJp7mUeqr5xw6kewtMZY3ueq5xA+j8RRw2S3P76q9E2wl0DSgTEuvL7H2VEkEmk0xU Z5lA== X-Gm-Message-State: ALyK8tK1lDP1PAkB/FtWAayN1FgY3K+6UOWxfjR5LVGDsqx0BDDkTps49I3Xjtebk75beloMks52jU4gEqMGKA== X-Received: by 10.202.197.137 with SMTP id v131mr3970204oif.178.1466135701296; Thu, 16 Jun 2016 20:55:01 -0700 (PDT) Original-Received: by 10.157.44.103 with HTTP; Thu, 16 Jun 2016 20:55:00 -0700 (PDT) X-Google-Sender-Auth: UBP62jt6muqhFWWj_NGDWgTO3bc 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:119650 Archived-At: tag 23565 + confirmed quit It has to do with the tcl-omit-ws-regexp which is used to set the buffer local value of defun-prompt-regexp (why isn't it called tcl-defun-prompt-regexp?). The current setting, along with commentary is: ;; Here's another stab. I think this one actually works. ;; We have to be careful that the open-brace following this regexp ;; is indeed the one corresponding to the function's body so ;; that end-of-defun works correctly. Tricky cases are: ;; proc foo { {arg1 def} arg2 } { ;; as well as ;; proc foo { \n {arg1 def} \n arg2 } { ;; The current setting handles the first case properly but not the second. ;; It also fails if `proc' is not in column-0 (e.g. it's in a namespace). (defconst tcl-omit-ws-regexp "^[^]\" \t\n#}][^\n\"#]+[ \t]+") If I remove the " from the second character set, then the examples given in this bug report work, but probably some others might break (I don't know tcl well enough to come up with any). ;; this works for given examples (defconst tcl-omit-ws-regexp "^[^]\" \t\n#}][^\n#]+[ \t]+") A regexp based approach is probably always doomed to have some bad cases, so perhaps the real fix is to define a beginning-of-defun-function for tcl-mode.