1388Re: [jasspa] mark, point, and active regions
- May 25, 2005Hey that's not a bad idea. Write a macro that first verifies that the
region is currently highlighted, and does the kill only if it is.
(Please be clear that the *region* always exists one the mark was set,
it's the *highlighting* that comes and goes. If you want to eliminate
the region per se, I think you'll have to unset the mark.)
Suggest you enable the backup functionality, in the meantime :-)
Check out the manpage for $show-region.
I think the while region highlighting thing was done to make life easier
for people who use a mouse. I'm very glad to have it. The original
design of Emacs (and hence Jasspa) is sometimes at odds to what we
expect from modern software (i.e., gui-based stuff) so things like this
sometimes still have kinks to work out. Many of these get worked out on
Gnu Emacs first, since that has probably 100x the number of users (and
10x the developers?) as does Jasspa, so it's sometimes helpful to look
and see how they've solved something over there.
Schofield, Bryan (GE Trans) wrote:
> To the best that I can tell, once the first mark is set in a buffer,
> a mark will always remain. Many macros operate on a region, that
> magical area in the buffer between the mark and the point. But since
> once the first mark is set, the buffer always has mark, then it
> always has a region. This where things get a little wierd for me.
> Let's say I have a buffer with some lines of text. I place the cursor
> at the beginning of line 1 and call "set-mark" (C-space). I then move
> the cursor down a few lines and I see the region highlighted from the
> beginning of the first line to the cursors current position. I decide
> I didn't mean to hit C-space, so I issue "abort-command" (C-g). The
> highlighted region disappears. Now I issue "kill-region" (C-w) and
> magically, the lines that had been previously highlight, but are not
> currently, disappear.
> MicroEmacs is doing something as a user I don't expect. To me, there
> is no region. I "cancelled" it and editor *appeared* to comply by
> removing the highlight from the "selected" lines of text. But
> "kill-region" is operating under a different understanding. This
> problem can get a lot worse. Let's assume I'm working a big file, I
> select something at the top of the file, then C-g because I didn't
> really want to select the text. I page down a few times and try to
> put the cursor at the beginning of the line. I fat-finger C-e and hit
> C-w too. My previously selected text poofs aways, my cursor goes to
> the beginning of the line and I'm none-the-wiser. I save my file my
> exit, happy with my masterpiece, only find out next week it's missing
> a chunk at the beginning.
> Is there a way I can find out if a region *really* exists, that is
> one is visibly highlighted, from inside a macro?
- << Previous post in topic Next post in topic >>