Subject: bug#30085: 25.2: Documentation for cua-rectangle-mark-mode

From: Boruch Baum <[email-masked]>
Date: Wed, 28 Oct 2020 02:40:35 -0400

Wow. This is what? Two years old? My vague memory was that this mode
seemed very feature-rich and desirable but slightly overlapping the more
common rectangle editing functions. When the thread went dead due to
lack of response, I stopped investigating and using it.

The desirable and unique feature that most stands out in my memory was
the mode's ability toggle POINT amongst the four corners of a selected
rectangle in order to resize it in any possible direction.

I remember the mode had other cool features, but don't remember what
they were. One of the deficiencies that I had wanted to address was the
mode's lack of documentation, but with the discouraging (lack of)
feedback, I just moved on.

Following is some feedback:

On 2020-10-26 18:50, Stefan Kangas wrote:
> Boruch Baum <[email-masked]> writes:
>
> > 3. I noticed that `M-m' was bound to `cua-copy-rectangle-as-text'
> >    instead of `back-to-indentation', so I took the liberty of writing a
> >    function `cua-resize-rectangle-back-to-indentation' and binding it to
> >    `M-m', which is what most users would expect. If this approved, to
> >    what should be bound `cua-copy-rectangle-as-text'
> >
> > 4. Function `cua-resize-rectangle-bot' had a bug in that it always
> >    placed point at the actual (point-max) even though the rectangle
> >    corner would not be there. This would occur when (point-max) was at a
> >    column number smaller than the left edge of the rectangle. The patch
> >    file includes the fix.
> >
> > 5. Two commonly used navigation functions, normally bound to `C-a' and
> >    `C-e' were not remapped. (DONE)
>
> Could you please provide instructions for how to test the above parts?
> I don't use this mode and it's not clear to me what to do.

I don't remember how to use the mode and its features (as I mentioned
above, it's been two years of non-response), but I see that the
notes.txt file that I included along with the patch that there are some
tips.

I *DO* remember that the remapped functions were to apply operations on
the selected rectangle instead of upon the buffer. What I mean is that
C-a would go the beginning of the line with the selected rectangle
instead of the buffer's beginning of line. And likewise for C-e, M-m.

You would need anyway to learn the basics of using the mode before
patching it. Once you've figured that out, try C-a, C-e, M-m before and
after the patch.

Again, some tips are in the notes.txt file accompanying the patch.

>  Also, could you perhaps split the patch up and make it clear which
> parts of your code belong to which of the above points?

Nope. At least not anytime reasonably soon. I have a full plate of other
FOSS stuff in my inbox just now and other life 'stuff'.

> Ideally, if possible, you would also add ChangeLog entries as per
> etc/CONTRIBUTE.
>
> > 6. The help message is remapped from `C-?' to `M-?' for the sanity of
> >    people like me who use emacs-nox and can only perform a `C-?' by
> >    typing `C-x @ c ?'.
>
> I don't understand which part of your patch this refers to, or how to
> test it.  Could you please clarify?

That's easy. It's a single line in the patch...

--8<--cut here-(start)------------------------------------------- >8
+  (define-key cua--rectangle-keymap (kbd "M-?") 'cua-help-for-rectangle)
--8<--cut here-(end)--------------------------------------------- >8

> > 7. The current keybindings are made using an old method of keystroke
> >    definition that I find a bit scary. Is it OK / desirable to change
> >    the method uniformly to use `kbd'?
>
> I have no strong opinion on this, but it seems relatively minor.  Perhaps
> it's not worth the code churn.

> > First slow steps.
>
> I've attached a diff with the parts of your patch that I didn't yet push
> to master.
>
> Thanks.

Thank you.

Word of caution: In the bigger picture, there ought to be a consensus on
whether to have two parallel packages that perform basically the same
functions in two different ways with two different code-bases. IMO, only
one should exist in emacs-core, and if that package can't incorporate
the unique features of the other by merging code, the other package
should be spun-off to ELPA/MELPA with a note that it has become
abandon-ware but retains value. In that spirit, I remember that
cua-rectangle mode was clearly *better*, but the development team might
shrink from foisting something different on users. In any case, without
clear documentation on how to even use the mode, I don't see a chance
for the development team to adopt it that way.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0