meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.15k stars 133 forks source link

meow-*-thing commands not working as expected with plain lists #616

Open kaibagley opened 1 month ago

kaibagley commented 1 month ago

Hey guys,

First, thanks for the awesome software. You're making my emacs life even better than it already was.

Sorry if I've missed an issue/discussion somewhere, but I've noticed that the thing commands don't work as expected with Org "plain lists". Here is an example (notes from some literature):

* Notes
** Abstract
The paper is a proposal of steps for fitting nonlinear models, described by a
flow diagram, as well as discussion on each of the steps.

** First paragraphs
_Goals:_
1. Provide an overview of nonlinear models, and developing a guideline to
   understand the families of functions used for agricultural applications.
2. Indicate techniques to modify nonlinear models, and coping with multiple.
3. Discuss key methodological issues on parameter estimation, model performance
   and comparison; and,
4. Demonstrate a step-by-step analysis of experimental data using nonlinear
   regression models.

Hitting . p (meow-bounds-of-thing paragraph) in the Abstract paragraph selects all lines ("The paper is a ..."), but doing the same on the very final line ("regression models") only selects that line.

Same behaviour with . ., only the line is selected, not the full sentence. Similarly with meow-beginning-of-thing and meow-end-of-thing.

Expected behaviour would be, for . p, that either the whole "4." list item is selected, or the entire section including "Goals:", whichever seems most logical.

Thanks!!

Linerre commented 1 month ago

Hitting . p (meow-bounds-of-thing paragraph) in the Abstract paragraph selects all lines ("The paper is a ..."), but doing the same on the very final line ("regression models") only selects that line.

In org-mode, what is considered a "paragraph" is rather complicated (see for yourself by C-h v paragraph-separate or C-h v paragraph-start). I don't think meow has ever tried to wrap around that in org mode.

Expected behaviour would be, for . p, that either the whole "4." list item is selected, or the entire section including "Goals:", whichever seems most logical.

If you don't mind, M-h would do most of what you expect, except that M-h seems to select the whole list if your point is on the first item of the list. Not intruding into the default keybindings shipped with Emacs is part of meow's philosophy. I would prefer M-h in this case (plus, it is easier to press than . p)

To let . p do what you expected, you may need to learn meow-thing-register and paragraph-related stuff in org mode and customize it yourself. I may be wrong, though.

kaibagley commented 1 month ago

Thanks for the reply, and thanks for teaching me about M-h! What a useful command. It does exactly what I'd expect in this scenario so I will be using it extensively.

Yeah it seems like you're right, the definition of a paragraph is pretty wild. In my head I do still think that:

Expected behaviour would be, for . p, that either the whole "4." list item is selected, or the entire section including "Goals:", whichever seems most logical.

Is what one should expect, but in conjunction with M-h I can get around it