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

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

Re: Java mixed case deletion


From: Mahesh Padmanabhan
Subject: Re: Java mixed case deletion
Date: Tue, 26 Oct 2004 13:52:44 -0600
User-agent: Mozilla Thunderbird 0.8 (Windows/20040913)

Benjamin Rutt wrote:
Mahesh Padmanabhan <mahesh@privacy.net> writes:


The functions c-forward-into-nomenclature and
c-backward-into-nomenclature take care of negotiating mixed case words
but i could not find anything that allows me to delete while keeping
mixed case in mind.

For example - if there is a word like this: SomeClass then a backward
delete word deletes the whole word. What I want is to delete just
Class in SomeClass.


(defun my-c-kill-forward-into-nomenclature (&optional arg)
  "Kill forward to the end of a nomenclature section or word.  With
arg, do it arg times."
  (interactive "p")
  (save-excursion
    (set-mark (point))
    (c-forward-into-nomenclature arg)
    (kill-region (mark) (point))))

(defun my-c-kill-backward-into-nomenclature (&optional arg)
  "Kill backward to the beginning of a nomenclature section or word.
th arg, do it arg times."
  (interactive "p")
  (save-excursion
    (set-mark (point))
    (c-backward-into-nomenclature arg)
    (kill-region (mark) (point))))

Add those to your keys of choice in the hook and you're all set.  I
use
  (local-set-key [(control backspace)] 'my-c-kill-backward-into-nomenclature)
  (local-set-key [(meta d)] 'my-c-kill-forward-into-nomenclature)

inside my c-mode-common-hook, personally.

Thanks!


reply via email to

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