From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#21072: Brave new mark-defun (and a testing tool) Date: Mon, 24 Apr 2017 08:52:10 -0400 Message-ID: <8737cyotmt.fsf@users.sourceforge.net> References: <87o9ydrzkr.fsf@mbork.pl> <87tw7wh9sf.fsf@mbork.pl> <87k28sdka6.fsf@jane> <87efyze00g.fsf@jane> <87bmu2eoji.fsf@jane> <87wpcpw61w.fsf@jane> <83o9xdghmc.fsf@gnu.org> <87o9wkoald.fsf@jane> <87a881ofsu.fsf@jane> <87k272wh8x.fsf@users.sourceforge.net> <871st4aal7.fsf@jane> <87tw5l7v26.fsf@jane> <877f2hs1nw.fsf@users.sourceforge.net> <87zifa9ce5.fsf@jane> <87shl0pbcg.fsf@users.sourceforge.net> <87shky9ez8.fsf@jane> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493038281 22254 195.159.176.226 (24 Apr 2017 12:51:21 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2017 12:51:21 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 21072@debbugs.gnu.org, Stefan Monnier To: Marcin Borkowski Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 24 14:51:15 2017 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 1d2dSR-0005YP-57 for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Apr 2017 14:51:11 +0200 Original-Received: from localhost ([::1]:44051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2dSW-00081R-OD for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Apr 2017 08:51:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2dSN-0007zs-9h for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:51:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2dSJ-0001ZW-3k for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:51:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2dSI-0001ZR-NW for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d2dSI-00063E-CB for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2017 12:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21072 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21072-submit@debbugs.gnu.org id=B21072.149303825023238 (code B ref 21072); Mon, 24 Apr 2017 12:51:02 +0000 Original-Received: (at 21072) by debbugs.gnu.org; 24 Apr 2017 12:50:50 +0000 Original-Received: from localhost ([127.0.0.1]:37235 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2dS5-00062k-PB for submit@debbugs.gnu.org; Mon, 24 Apr 2017 08:50:49 -0400 Original-Received: from mail-io0-f194.google.com ([209.85.223.194]:35902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2dS3-00062U-1G for 21072@debbugs.gnu.org; Mon, 24 Apr 2017 08:50:47 -0400 Original-Received: by mail-io0-f194.google.com with SMTP id x86so49101600ioe.3 for <21072@debbugs.gnu.org>; Mon, 24 Apr 2017 05:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=h7EdSJB1sXnV9KlT4vxhA9emt43rKpQKjO3ND0ltDuU=; b=GTJYv0VOnOTai3MBBRDGtvhm2uBT6+EdXkLpFX+xvCbUnn97kLNXSKq0Ewetub7jAH zv6+eT3BaNi0qevVcp8OJv152pcVl6Mvbdy+aazwprIM86gsDSBCUiM3QChIZ3+6+ULN OJOv6YLCpNEvxGq/EZPvd47fthH3mQ2fNc9GARsS6GAP+hOLTOLHHMPh1xctCIbsy/91 aGa3Pl2cC48liiaaboYqXD1/z8U0W7etROEoLhp5BnPr05+q3Za91DN2Db5CUSaPkTzI MEvcWM56ug64wI98FLU491dOYEqgV5H0S5cgFpmHooH9kBpZcqUMRKDs3cjWqVGid3k8 fvTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=h7EdSJB1sXnV9KlT4vxhA9emt43rKpQKjO3ND0ltDuU=; b=U7K/N5d5van3zE7cAmmU8IK87mrExgiwGnjXdvUwmYBKYRe+v1CV/MrGo+jml71OYo 0wy6UXrdwyTCv+cluUNo7pTb7Pqt6aE90WAOSNDrQWJiGxWWWJcH2DCmFoos9L6UqD1l RFrfsTiqK+2i7YavdLAjjbD0ia8TkVefYpEGkD99pzX9UVhm41qd2xNBK9HV54+OXhxr F9qhYidSkYWGx/hBNL9C1JA9WzMR5OyitGG9a1uGBQVVchph0bOwr6o0LjfEk3e6CXqZ jNRFaAUFfPn8ebsoimPCzEot1uFrWw9pPdm50GLAD1Kqv0UkCbSVjImAfj6K6+EXG7BR LMrg== X-Gm-Message-State: AN3rC/4HsRmQHbBTZYjoz/ymdKi1hvgfvAjj5oAWdU0gamnRQlohwzV3 neWytREG3Oq9ZA== X-Received: by 10.107.141.2 with SMTP id p2mr8106840iod.161.1493038241175; Mon, 24 Apr 2017 05:50:41 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id r70sm7783636iod.37.2017.04.24.05.50.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 24 Apr 2017 05:50:39 -0700 (PDT) In-Reply-To: <87shky9ez8.fsf@jane> (Marcin Borkowski's message of "Mon, 24 Apr 2017 14:17:47 +0200") 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:131934 Archived-At: Marcin Borkowski writes: > On 2017-04-22, at 20:05, npostavs@users.sourceforge.net wrote: > >>> Still not there - I tried first on Elisp, like this: >>> >>> ;; A comment >>> (defun ...) >>> >>> and it left the point at the end of the "A comment" line instead of at >>> the beginning... >> >> Hmm, I don't get that, although I did miss an inf loop when the comment >> is at beginning of buffer. Here is a fixed version: > > Still the same here, also in emacs -Q. Hmm, I was testing before now just by evaluating the changed functions after startup, I must have messed something up. I think this one might be okay. (defun beginning-of-defun-comments (&optional arg) "Move to the beginning of ARGth defun, including comments." (interactive "^p") (unless arg (setq arg 1)) (beginning-of-defun arg) (while (let ((pt (line-beginning-position)) (ppss (and (zerop (forward-line -1)) (syntax-ppss)))) (cond ((nth 4 ppss) (goto-char (nth 8 ppss))) ((and ppss (parse-partial-sexp (point) (line-end-position) nil t ppss) (not (bolp)) (eolp))) (t (goto-char pt) nil))))) >> >> Looks good to me (apart from the commit messages). Actually, now that I've applied this thing properly, I notice 2 test failures in batch mode: 2 unexpected results: FAILED mark-defun-arg-region-active FAILED mark-defun-no-arg-region-active They pass when run in interactive mode (I haven't looked into why). > > What should they look like, then? Should I make all of them into the > ChangeLog format, or just rebase/squash all of them so that there are > two of them only (one for the testing tool and one for the > beginning-of-defun)? Yeah, I would go ahead and squash them, since you need to rebase to fix commit messages anyway.