From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.bugs Subject: bug#21072: Brave new mark-defun (and a testing tool) Date: Mon, 24 Apr 2017 14:17:47 +0200 Message-ID: <87shky9ez8.fsf@jane> References: <87o9ydrzkr.fsf@mbork.pl> <52e67f43-edcf-09e3-5fd6-6079763fd234@yandex.ru> <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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1493036956 8676 195.159.176.226 (24 Apr 2017 12:29:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2017 12:29:16 +0000 (UTC) User-Agent: mu4e 0.9.19; emacs 26.0.50 Cc: 21072@debbugs.gnu.org, Stefan Monnier To: npostavs@users.sourceforge.net Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 24 14:29:12 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 1d2d78-0002Ac-OS for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Apr 2017 14:29:10 +0200 Original-Received: from localhost ([::1]:43954 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2d7E-00089x-KQ for geb-bug-gnu-emacs@m.gmane.org; Mon, 24 Apr 2017 08:29:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2cwT-0007Cv-MP for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:18:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2cwM-0007h6-2Z for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:18:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:39025) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2cwL-0007h0-Uw for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:18:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d2cwL-0005I3-Kg for bug-gnu-emacs@gnu.org; Mon, 24 Apr 2017 08:18:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Marcin Borkowski Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Apr 2017 12:18:01 +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.149303622620270 (code B ref 21072); Mon, 24 Apr 2017 12:18:01 +0000 Original-Received: (at 21072) by debbugs.gnu.org; 24 Apr 2017 12:17:06 +0000 Original-Received: from localhost ([127.0.0.1]:37224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2cvS-0005Gs-1P for submit@debbugs.gnu.org; Mon, 24 Apr 2017 08:17:06 -0400 Original-Received: from mail.mojserwer.eu ([195.110.48.8]:54439) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2cvR-0005Gk-07 for 21072@debbugs.gnu.org; Mon, 24 Apr 2017 08:17:05 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id B62B5E632F; Mon, 24 Apr 2017 14:17:03 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ttDTzrdw302i; Mon, 24 Apr 2017 14:17:00 +0200 (CEST) Original-Received: from localhost (static-dwadziewiec-jedenpiec7.echostar.pl [109.232.29.157]) by mail.mojserwer.eu (Postfix) with ESMTPSA id D0865E6042; Mon, 24 Apr 2017 14:16:59 +0200 (CEST) In-reply-to: <87shl0pbcg.fsf@users.sourceforge.net> 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:131933 Archived-At: 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: > > (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 (point)) > (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))))) Still the same here, also in emacs -Q. >> I'm tempted to leave it is it is in my branch. For one, I'm a bit tired >> by all this and I'd like to move on; also, as you said above, there is >> little hope to do it "100% correctly", and I guess my solution may be >> good enough. (I'm pretty sure it's better than the status quo, at >> least.) > > Yeah, since there's no perfect answer, I think it's fine if you just go > with whichever version you like best. If people disagree, we'll find > out in bug reports :) ;-) >> as I mentioned a few minutes ago, I pushed the fix/bug-21072 branch with >> a few fixes discussed in this thread. If it is in good enoug shape to >> merge into master, please tell me and I'll do it; if not, I'll fix what >> should be fixed (commit messages?) > > Looks good to me (apart from the commit messages). 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)? Best, -- Marcin Borkowski