all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* two more emacs questions
@ 2006-11-17 19:05 Vadim Bendebury
  2006-11-17 20:31 ` Perry Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Vadim Bendebury @ 2006-11-17 19:05 UTC (permalink / raw)


Say I want to search for other occurences of a word which the cursor is ot. 
I hit C-s C-w C-s and off it goes. The problem is when the word includes 
underscores - each C-w moves the mark to the next underscore, nit to the end 
ofthe word. Is there a way to configure emacs such that underscore is 
considered part of the word?

Another emacs annoyance (at least for us, unfortunate users of other, less 
priviledged editors ;-)) is its handling of undo. It does not consider 
highligting of the part of the file (like setting marks around a block of 
code) a separate operation. Say I highlighted a 10 line block, cut it, moved 
the cursor to another place in the file and pasted the block there. Then I 
wanted to actually decrease the amount of moved code. I hit undo a few 
times, it does put the code back where it came from, but it skips the 
highlighting step, so at this time, if I wanted to move a 9 line block 
instead of 10 - I need to highlight the entire block again instead of just 
shrinking the highlighted area by a line. Is there a way to make it consider 
highligting a part of the command sequence and folow it in the undo path?

TIA,
/vb

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-17 19:05 two more emacs questions Vadim Bendebury
@ 2006-11-17 20:31 ` Perry Smith
  2006-11-17 22:02   ` vb
  2006-11-18  8:20 ` Dieter Wilhelm
  2006-11-18 10:02 ` Eli Zaretskii
  2 siblings, 1 reply; 14+ messages in thread
From: Perry Smith @ 2006-11-17 20:31 UTC (permalink / raw)
  Cc: help-gnu-emacs


[-- Attachment #1.1: Type: text/plain, Size: 1297 bytes --]

On Nov 17, 2006, at 1:05 PM, Vadim Bendebury wrote:

> Say I want to search for other occurences of a word which the  
> cursor is ot. I hit C-s C-w C-s and off it goes. The problem is  
> when the word includes underscores - each C-w moves the mark to the  
> next underscore, nit to the end ofthe word. Is there a way to  
> configure emacs such that underscore is considered part of the word?

I do this for C mode: (modify-syntax-entry 95 "w" c-mode-syntax-table)

Two problems:
   1) There are comments somewhere that explicitly say "don't do  
this!!!" but I never figured out why.  I'd like to here from others  
why this is not recommended.
   2) There are lots of syntax tables.  Most major-modes have their  
own.  Some minor-modes I think diddle with them too.  Plus there is a  
global syntax table.  So, you will need to explore and figure out  
which syntax tables you want to change.  Then add the modification to  
the appropriate hook(s).

I have this in my .emacs file:

(custom-set-variables
    ...
'(c-initialization-hook (function (lambda nil (modify-syntax-entry 95  
"w" c-mode-syntax-table))))
    ... )


Perry Smith ( pedz@easesoftware.com )
Ease Software, Inc. ( http://www.easesoftware.com )

Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems



[-- Attachment #1.2: Type: text/html, Size: 5368 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-17 20:31 ` Perry Smith
@ 2006-11-17 22:02   ` vb
  0 siblings, 0 replies; 14+ messages in thread
From: vb @ 2006-11-17 22:02 UTC (permalink / raw)
  Cc: help-gnu-emacs

> 
> I have this in my .emacs file:
> 
> (custom-set-variables
>    ...
> '(c-initialization-hook (function (lambda nil (modify-syntax-entry 95  
> "w" c-mode-syntax-table))))
>    ... )
> 

Perry, this works like a charm, thanks a lot!

\vb

> 
> Perry Smith ( pedz@easesoftware.com )
> Ease Software, Inc. ( http://www.easesoftware.com )
> 
> Low cost SATA Disk Systems for IBMs p5, pSeries, and RS/6000 AIX systems
> 
> 
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-17 19:05 two more emacs questions Vadim Bendebury
  2006-11-17 20:31 ` Perry Smith
@ 2006-11-18  8:20 ` Dieter Wilhelm
  2006-11-18 18:39   ` vb
  2006-11-18 10:02 ` Eli Zaretskii
  2 siblings, 1 reply; 14+ messages in thread
From: Dieter Wilhelm @ 2006-11-18  8:20 UTC (permalink / raw)
  Cc: help-gnu-emacs

"Vadim Bendebury" <vb@vsbe.com> writes:

> Say I want to search for other occurences of a word which the cursor
> is ot. I hit C-s C-w C-s and off it goes. The problem is when the word
> includes underscores - each C-w moves the mark to the next underscore,
> nit to the end ofthe word. Is there a way to configure emacs such that
> underscore is considered part of the word?
>
> Another emacs annoyance (at least for us, unfortunate users of other,
> less priviledged editors ;-)) is its handling of undo. It does not

May I ask which editor?

> consider highligting of the part of the file (like setting marks
> around a block of code) a separate operation. Say I highlighted a 10
> line block, cut it, moved the cursor to another place in the file and
> pasted the block there. Then I wanted to actually decrease the amount
> of moved code. I hit undo a few times, it does put the code back where
> it came from, but it skips the highlighting step, so at this time, if
> I wanted to move a 9 line block instead of 10 - I need to highlight
> the entire block again instead of just shrinking the highlighted area

I can only offer a workaround (or a change of working habits):

0.) Paste the 10 lines: C-y or with middle mouse button.
1.) Kill the superfluous 10th line.
2.) Go back where you you killed the 10 lines C-u C-SPC C-u C-SPC
3.) Type C-y again

> by a line. Is there a way to make it consider highligting a part of
> the command sequence and folow it in the undo path?
> by a line. Is there a way to make it consider highligting a part of

A good question, I hope others can answer it.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-17 19:05 two more emacs questions Vadim Bendebury
  2006-11-17 20:31 ` Perry Smith
  2006-11-18  8:20 ` Dieter Wilhelm
@ 2006-11-18 10:02 ` Eli Zaretskii
  2006-11-18 18:41   ` vb
  2 siblings, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2006-11-18 10:02 UTC (permalink / raw)


> From: "Vadim Bendebury" <vb@vsbe.com>
> Date: Fri, 17 Nov 2006 11:05:50 -0800
> 
> Another emacs annoyance (at least for us, unfortunate users of other, less 
> priviledged editors ;-)) is its handling of undo. It does not consider 
> highligting of the part of the file (like setting marks around a block of 
> code) a separate operation. Say I highlighted a 10 line block, cut it, moved 
> the cursor to another place in the file and pasted the block there. Then I 
> wanted to actually decrease the amount of moved code. I hit undo a few 
> times, it does put the code back where it came from, but it skips the 
> highlighting step, so at this time, if I wanted to move a 9 line block 
> instead of 10 - I need to highlight the entire block again instead of just 
> shrinking the highlighted area by a line. Is there a way to make it consider 
> highligting a part of the command sequence and folow it in the undo path?

Doesn't "C-x C-x" re-highlight the block again?

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-18  8:20 ` Dieter Wilhelm
@ 2006-11-18 18:39   ` vb
  2006-11-19  3:00     ` Dieter Wilhelm
  0 siblings, 1 reply; 14+ messages in thread
From: vb @ 2006-11-18 18:39 UTC (permalink / raw)
  Cc: help-gnu-emacs

>>
>> Another emacs annoyance (at least for us, unfortunate users of other,
>> less priviledged editors ;-)) is its handling of undo. It does not
>
> May I ask which editor?
>

crisp (as in www.crisp.com) has been doing this for at least twelve years 
now...

cheers,
/vb

>> consider highligting of the part of the file (like setting marks
>> around a block of code) a separate operation. Say I highlighted a 10
>> line block, cut it, moved the cursor to another place in the file and
>> pasted the block there. Then I wanted to actually decrease the amount
>> of moved code. I hit undo a few times, it does put the code back where
>> it came from, but it skips the highlighting step, so at this time, if
>> I wanted to move a 9 line block instead of 10 - I need to highlight
>> the entire block again instead of just shrinking the highlighted area
>
> I can only offer a workaround (or a change of working habits):
>
> 0.) Paste the 10 lines: C-y or with middle mouse button.
> 1.) Kill the superfluous 10th line.
> 2.) Go back where you you killed the 10 lines C-u C-SPC C-u C-SPC
> 3.) Type C-y again
>
>> by a line. Is there a way to make it consider highligting a part of
>> the command sequence and folow it in the undo path?
>> by a line. Is there a way to make it consider highligting a part of
>
> A good question, I hope others can answer it.
>
> -- 
>    Best wishes
>
>    H. Dieter Wilhelm
>    Darmstadt, Germany
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-18 10:02 ` Eli Zaretskii
@ 2006-11-18 18:41   ` vb
  2006-11-18 19:45     ` Eli Zaretskii
  0 siblings, 1 reply; 14+ messages in thread
From: vb @ 2006-11-18 18:41 UTC (permalink / raw)



>> shrinking the highlighted area by a line. Is there a way to make it 
>> consider
>> highligting a part of the command sequence and folow it in the undo path?
>
> Doesn't "C-x C-x" re-highlight the block again?
>

it very well might do that, but the question is why highlighting a region is 
not a part of the undo sequence - it should be, shouldn't it?

cheers,
/vb

>
> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-18 18:41   ` vb
@ 2006-11-18 19:45     ` Eli Zaretskii
  2006-11-19  4:06       ` vb
       [not found]       ` <mailman.828.1163922268.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Eli Zaretskii @ 2006-11-18 19:45 UTC (permalink / raw)


> From: "vb" <vb@vsbe.com>
> Cc: "Eli Zaretskii" <eliz@gnu.org>
> Date: Sat, 18 Nov 2006 10:41:52 -0800
> >
> > Doesn't "C-x C-x" re-highlight the block again?
> >
> 
> it very well might do that, but the question is why highlighting a region is 
> not a part of the undo sequence - it should be, shouldn't it?

The highlight doesn't change the buffer, therefore it is not undone.
So this is by design, albeit contrary to your expectations.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-18 18:39   ` vb
@ 2006-11-19  3:00     ` Dieter Wilhelm
  2006-11-19  4:00       ` vb
  0 siblings, 1 reply; 14+ messages in thread
From: Dieter Wilhelm @ 2006-11-19  3:00 UTC (permalink / raw)
  Cc: help-gnu-emacs

"vb" <vb@vsbe.com> writes:

>>>
>>> Another emacs annoyance (at least for us, unfortunate users of other,
>>> less priviledged editors ;-)) is its handling of undo. It does not
>>
>> May I ask which editor?
>>
>
> crisp (as in www.crisp.com) has been doing this for at least twelve
> years now...
>

Looks nice and capable, so why do you want to play with some other
editor?  Emacs can't do any miracles either (except some small,
uplifting ones, you might have seen my organisation header 8-).

In earnest, I think this is partly a matter of taste and style, some
prefer an interface with strong visual hints and some prefer a more
abstract approach.

Nothing to argue about.

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-19  3:00     ` Dieter Wilhelm
@ 2006-11-19  4:00       ` vb
  2006-11-19 10:17         ` Dieter Wilhelm
  0 siblings, 1 reply; 14+ messages in thread
From: vb @ 2006-11-19  4:00 UTC (permalink / raw)
  Cc: help-gnu-emacs


>>>> Another emacs annoyance (at least for us, unfortunate users of other,
>>>> less priviledged editors ;-)) is its handling of undo. It does not
>>>
>>> May I ask which editor?
>>>
>>
>> crisp (as in www.crisp.com) has been doing this for at least twelve
>> years now...
>>
>
> Looks nice and capable, so why do you want to play with some other
> editor?  Emacs can't do any miracles either (except some small,
> uplifting ones, you might have seen my organisation header 8-).
>
> In earnest, I think this is partly a matter of taste and style, some
> prefer an interface with strong visual hints and some prefer a more
> abstract approach.
>
> Nothing to argue about.
>

well, a big difference is that emacs is free and crisp costs money, I moved 
departments in the company and just was not ready fork out my own $300 or 
whatever it is these days for the office use. Crisp's colorization, macro 
language and customization flexibility in my opinion exceeds that of emacs. 
After a few weeks of macking around with Lisp and asking questions (and 
getting prompt and to the point answers!) on this forum I got myself more or 
less comfortable with emacs, but I still think Crisp is a superior product.

OTOH emacs is available pretty much anywhere, and for free, being able to 
use it efficiently is a good skill after all :-)

cheers,
/vb

> -- 
>    Best wishes
>
>    H. Dieter Wilhelm
>    Darmstadt, Germany
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-18 19:45     ` Eli Zaretskii
@ 2006-11-19  4:06       ` vb
  2006-11-19  4:12         ` Eli Zaretskii
       [not found]       ` <mailman.828.1163922268.2155.help-gnu-emacs@gnu.org>
  1 sibling, 1 reply; 14+ messages in thread
From: vb @ 2006-11-19  4:06 UTC (permalink / raw)


>> From: "vb" <vb@vsbe.com>
>> Cc: "Eli Zaretskii" <eliz@gnu.org>
>> Date: Sat, 18 Nov 2006 10:41:52 -0800
>> >
>> > Doesn't "C-x C-x" re-highlight the block again?
>> >
>>
>> it very well might do that, but the question is why highlighting a region 
>> is
>> not a part of the undo sequence - it should be, shouldn't it?
>
> The highlight doesn't change the buffer, therefore it is not undone.
> So this is by design, albeit contrary to your expectations.
>
>

well, that's the thing - I am a user, not a computer, I don't care if typing 
keys changes the buffer or not. As a user I expect the undo sequence to 
exactly follow my actions in the reverse order. I just checked - even MS 
Word does this (brings back the highlight in the undo stream).

Too bad emacs' designers did not think about it this way - it wouldn't hurt 
to have this feature even optional if someone finds it objectional.

cheers,
/vb

> _______________________________________________
> help-gnu-emacs mailing list
> help-gnu-emacs@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-19  4:06       ` vb
@ 2006-11-19  4:12         ` Eli Zaretskii
  0 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2006-11-19  4:12 UTC (permalink / raw)


> From: "vb" <vb@vsbe.com>
> Cc: "Eli Zaretskii" <eliz@gnu.org>
> Date: Sat, 18 Nov 2006 20:06:25 -0800
> 
> well, that's the thing - I am a user, not a computer, I don't care if typing 
> keys changes the buffer or not. As a user I expect the undo sequence to 
> exactly follow my actions in the reverse order. I just checked - even MS 
> Word does this (brings back the highlight in the undo stream).

Feel free to suggest a new feature on emacs-devel@gnu.org.

> Too bad emacs' designers did not think about it this way

They did.  They just didn't implement it yet.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
  2006-11-19  4:00       ` vb
@ 2006-11-19 10:17         ` Dieter Wilhelm
  0 siblings, 0 replies; 14+ messages in thread
From: Dieter Wilhelm @ 2006-11-19 10:17 UTC (permalink / raw)
  Cc: help-gnu-emacs

"vb" <vb@vsbe.com> writes:

> with Lisp and asking questions (and getting prompt and to the point

8-)

> answers!) on this forum I got myself more or less comfortable with
> emacs, but I still think Crisp is a superior product.
>

It might be, I do not know.  And I do not care because I surely know
one field where Emacs is *far* better: You can influence the
development of Emacs, when you really think there is something which
could be done in a better way make your opinion heard, as Eli
suggested.  (Or in the worst case change the sources. ;-)

--
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: two more emacs questions
       [not found]       ` <mailman.828.1163922268.2155.help-gnu-emacs@gnu.org>
@ 2006-11-22  9:37         ` Mathias Dahl
  0 siblings, 0 replies; 14+ messages in thread
From: Mathias Dahl @ 2006-11-22  9:37 UTC (permalink / raw)


"vb" <vb@vsbe.com> writes:

> well, that's the thing - I am a user, not a computer, I don't care
> if typing keys changes the buffer or not. As a user I expect the
> undo sequence to exactly follow my actions in the reverse order. I
> just checked - even MS Word does this (brings back the highlight in
> the undo stream).

One could argue the same about cursor movements, that they should be
undoable, but they are not, neither in Emacs nor MS Word. In Emacs
though, it is quite possible to implement. To some extent C-u C-SPC is
a good workaround for this "limitation".

Personally I have never seen the need for undoing highlighted
text. And the highlight you mention Word handles undo of is not the
"mark hilight" on marked text.

Anyway, nice that you have try out Emacs, you might find, after some
time, that it is superior to all other text editors... :)

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-11-22  9:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-17 19:05 two more emacs questions Vadim Bendebury
2006-11-17 20:31 ` Perry Smith
2006-11-17 22:02   ` vb
2006-11-18  8:20 ` Dieter Wilhelm
2006-11-18 18:39   ` vb
2006-11-19  3:00     ` Dieter Wilhelm
2006-11-19  4:00       ` vb
2006-11-19 10:17         ` Dieter Wilhelm
2006-11-18 10:02 ` Eli Zaretskii
2006-11-18 18:41   ` vb
2006-11-18 19:45     ` Eli Zaretskii
2006-11-19  4:06       ` vb
2006-11-19  4:12         ` Eli Zaretskii
     [not found]       ` <mailman.828.1163922268.2155.help-gnu-emacs@gnu.org>
2006-11-22  9:37         ` Mathias Dahl

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.