From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mahesh Padmanabhan Newsgroups: gmane.emacs.help Subject: Re: Java mixed case deletion Date: Tue, 26 Oct 2004 13:52:44 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <2u7o8dF27ffs0U1@uni-berlin.de> References: <2u7fcnF26ss6cU1@uni-berlin.de> <87acu91dy5.fsf@penguin.brutt.org> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1098820652 12334 80.91.229.6 (26 Oct 2004 19:57:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Oct 2004 19:57:32 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 26 21:57:26 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CMXRd-0007Aq-00 for ; Tue, 26 Oct 2004 21:57:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CMXZL-0005Ro-QE for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Oct 2004 16:05:23 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 41 Original-X-Trace: news.uni-berlin.de r7qJIw/kxYjrGR5KnKUa3AGqXEpY/pt7nW1v9zbtTuqwazx8ZH User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en In-Reply-To: <87acu91dy5.fsf@penguin.brutt.org> Original-Xref: shelby.stanford.edu gnu.emacs.help:126090 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:21469 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:21469 Benjamin Rutt wrote: > Mahesh Padmanabhan 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!