Closed usaoc closed 11 months ago
Because I feel like this little feature is a necessary evil and detour (as opposed to me wanting to go down the entire long road of an ideal auto-pair package), I didn't think about this too long.
But my (small) thinking was:
Point and mark can be set in various ways.
expand-region
package: Point is always before the start of the thing, mark always after.Given this variety, it seemed like point wasn't necessarily a precious value to preserve. Instead, better just to move it consistently somewhere. For which, I arbitrarily chose the end. :shrug:
I'm open to other ideas.
Yes, most, if not all, of the times I use wrapping with C-M-SPC
(in #lang racket
, that is), so preserving the point is important to me. The workflow is like this: suppose I’m looking at an expression,
|(some s-exp)
I may think that this expression deserves some further processing, so I’ll C-M-SPC
, (
, and insert more things. Moving the point to the end doesn’t seem useful if you use wrapping like this—you’ll have to C-M-b C-M-d
anyway. Preserving the point is arguably the most natural option.
That's reasonable. Will do....
I’m not sure if this is intentional, but it seems unnatural to me that wrapping a region with pairs can cause the point to move. In
racket-hash-lang-mode
, if you mark a region and insert an opening delimiter, the region will be wrapped, as in Smartparens. Unlike in Smartparens, though, the point seems to always move to the end of region. I think the Smartparens behavior makes more sense (keep the point at where it was). Again, I’m not sure if this is intentional, so I’m opening this as a question.