Subject: Re: bug#21072: Brave new mark-defun (and a testing tool)

From: Marcin Borkowski <[email-masked]>
Date: Mon, 24 Apr 2017 14:17:47 +0200

On 2017-04-22, at 20:05, [email-masked] 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