help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: forward/backward word with case sensitivity


From: Thierry Volpiatto
Subject: Re: forward/backward word with case sensitivity
Date: Tue, 28 Jul 2009 11:00:52 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux)

Anselm Helbig <anselm.helbig+news2009@googlemail.com> writes:

> Hi!
>
>> I'm wondering how to use the case sensitive buffer editing in buffer.
>> For example, in the kill-word function (M-d), how I can set it to kill
>> up to the final lower case, not space, comma, etc. as follows:
>> testFunction()
>> ^ (Here, M-d)
>> Function()
>
> I'm using c-subword-mode with ruby, to this end I've got this line in
> my .emacs:
>
>   (add-hook 'ruby-mode-hook (lambda () (c-subword-mode 1)))
>
> You can try it out yourself with M-x subword-mode. This doesn't only
> affect `kill-word' but changes emacs notion about what a word is in
> the current buffer, so `forward-word' and `backward-word' are affected
> as well.
>
> HTH, 

You can also write your own functions:

Something like that... (should be better, i wrote that on the fly)

,----
| (defun tv-delete-forward-to-first-upper-case ()
|   (interactive)
|   (let ((case-fold-search nil)
|         (beg (point))
|         end)
|     (while (not (looking-at "[A-Z]")) (forward-char 1))
|     (setq end (point))
|     (delete-region beg end)))
`----


> Anselm

-- 
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France





reply via email to

[Prev in Thread] Current Thread [Next in Thread]