emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Brave new mark-defun (and a testing tool)


From: Marcin Borkowski
Subject: Re: Brave new mark-defun (and a testing tool)
Date: Sun, 12 Feb 2017 11:10:27 +0100
User-agent: mu4e 0.9.19; emacs 26.0.50.3

On 2017-02-12, at 08:09, John Wiegley <address@hidden> wrote:

>>>>>> "MB" == Marcin Borkowski <address@hidden> writes:
>
> MB> after several months of on-and-off work on bug#21072, I have implemented
> MB> two (hopefully) nice features.  One is an (almost) completely new
> MB> version of mark-defun, which I hope works much better than the previous
> MB> one:
>
> Can you clarify in what ways it is better? Reading through the text you
> attached did not make it obvious to me...

Well, sorry for that - all details are in the quite extensive thread
about bug 21072.  Here's a short summary of what "my" mark-defun tries
to accomplish (I hope my memory serves me well here...) in case you have
better things to do than reading through tens of old messages;-).

0. In order to test mark-defun more easily, I introduced the
elisp-tests-with-temp-buffer macro.  It accepts a string (or
a string-valued variable) and runs the rest of its body in an Elisp
buffer with that very string, with the exception that you can put
special "markers" in that string (by default, of the form "=!name="),
these markers are deleted from the temp buffer, and variables called
"name" etc. are then bound to markers pointing at these positions.
I would very much like some experienced Elisp hackers to look at it -
I'm not sure it is entirely correct/elegant.

1. mark-defun is now extensively tested - it comes with a suite of about
two dozen ert tests.

2. Bug#21072 is fixed - mark-defun between defuns marks the following
defun, as its docstring and the manual say.

3. Both positive and negative arguments work correctly when the region
is inactive (i.e., the right number of defuns are marked, either after
or before the point).  Both Drew and me (in the mentioned discussion)
agreed that this is better than the allow-extend argument used now
(which is probably quite useless anyway).

4. When the region is active, mark-defun selects one more defun
(assuming that the region contains one or more defuns already - this is
not checked), or abs(N) more defuns with an argument.  With negative
argument, the direction of selecting defuns is reversed (for the sake of
following mark-defun commands).

> Thanks,

You're welcome,

--
Marcin Borkowski



reply via email to

[Prev in Thread] Current Thread [Next in Thread]