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: Kiwon Um
Subject: Re: forward/backward word with case sensitivity
Date: Tue, 28 Jul 2009 02:27:35 -0700 (PDT)
User-agent: G2/1.0

On 7월28일, 오후6시00분, Thierry Volpiatto <thierry.volpia...@gmail.com>
wrote:
> Anselm Helbig <anselm.helbig+news2...@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

You made a good function! Really thanks for your effort. :)


reply via email to

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