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.