From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Masatake YAMATO Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: Incompatibility of CC mode Date: Mon, 09 Apr 2007 22:20:18 +0900 (JST) Message-ID: <20070409.222018.267346327.jet@gyve.org> References: <20070404.231748.97433582.jet@gyve.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1176125148 14735 80.91.229.12 (9 Apr 2007 13:25:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Apr 2007 13:25:48 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Mon Apr 09 15:24:57 2007 Return-path: Envelope-to: sf-cc-mode-help@m.gmane.org Original-Received: from lists-outbound.sourceforge.net ([66.35.250.225]) by lo.gmane.org with esmtp (Exim 4.50) id 1HatoC-0006lO-Nx for sf-cc-mode-help@m.gmane.org; Mon, 09 Apr 2007 15:21:25 +0200 Original-Received: from sc8-sf-list1-new.sourceforge.net (sc8-sf-list1-new-b.sourceforge.net [10.3.1.93]) by sc8-sf-spam2.sourceforge.net (Postfix) with ESMTP id 47527124D4; Mon, 9 Apr 2007 06:21:23 -0700 (PDT) Original-Received: from sc8-sf-mx1-b.sourceforge.net ([10.3.1.91] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1Hato9-0002tX-CD for cc-mode-help@lists.sourceforge.net; Mon, 09 Apr 2007 06:21:21 -0700 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtp (Exim 4.44) id 1Hato8-0002eX-Qf for cc-mode-help@lists.sourceforge.net; Mon, 09 Apr 2007 06:21:21 -0700 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hatln-0001cT-1l for bug-cc-mode@gnu.org; Mon, 09 Apr 2007 09:18:55 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Hato5-0007E8-7y for bug-cc-mode@gnu.org; Mon, 09 Apr 2007 09:21:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=MISSING_HEADERS autolearn=no version=3.1.0 Original-Received: from mx1.redhat.com ([66.187.233.31]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hato4-0007Dy-UG; Mon, 09 Apr 2007 09:21:17 -0400 Original-Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l39DLD5x014161; Mon, 9 Apr 2007 09:21:16 -0400 Original-Received: from pobox.tokyo.redhat.com (pobox.tokyo.redhat.com [172.16.33.225]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l39DLCUo018843; Mon, 9 Apr 2007 09:21:13 -0400 Original-Received: from localhost (gps06.tokyo.redhat.com [172.16.32.89]) by pobox.tokyo.redhat.com (8.12.8/8.12.8) with ESMTP id l39DL80Q010314; Mon, 9 Apr 2007 22:21:11 +0900 lTo: Paul Curry X-Mailer: Mew version 4.2.53 on Emacs 22.0.51 / Mule 5.0 (SAKAKI) In-Reply-To: <20070404.231748.97433582.jet@gyve.org> X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by sourceforge.net. See http://spamassassin.org/tag/ for more details. Report problems to http://sf.net/tracker/?func=add&group_id=1&atid=200001 X-BeenThere: cc-mode-help@lists.sourceforge.net X-Mailman-Version: 2.1.8 Precedence: list List-Id: "Bug reports, feature requests, and general talk about CC Mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: cc-mode-help-bounces@lists.sourceforge.net Errors-To: cc-mode-help-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.emacs.cc-mode.general:4472 gmane.emacs.devel:69222 Archived-At: Hi, I'm the author of cc-subword. > The functions c-capitalize-subword, c-downcase-subword, c-upcase-subword > claim to behave like their normal emacs counterparts, but all three > functions move the point when given a negative argument. Furthermore, > c-capitalize-subword doesn't even work with a negative argument on my > machine. I changed the functions to better mimic the behavior of > capitalize/downcase/upcase/-word: they no longer move point with a > negative > argument. Thank you. About downcase and upcase, what you say and your code are correct. So I installed your code to emacs's CVS repository. Soon cc-mode maintainer will also install it to cc-mode's CVS repository. 2007-04-09 Paul Curry (tiny change) * progmodes/cc-subword.el (c-downcase-subword, c-upcase-subword): Don't move point if ARG is netagive. About capitalize, I've written my own code based on your code; and installed it. First of all, in subword, I cannot find expected behavior of capitalize, which all of people can agree with. As you wrote my old is wrong because point moves with netagive argument. This is obvious. However, I wonder which character should be upcase when a netagive argument is given. I'd like to explain why I modify your code here: Consider doing "-3 M-c" at xxx. ^ point is here. [With your original code] efg bceFghi xxx => Efg BceFghi Xxx [With my modified code] efg bceFghi xxx => efg BceFghi Xxx [With real capitalize-word] efg bce Fghi xxx => efg Bce Fghi Xxx I think my modified code is rather similar to the real `capitalize-word' than your original code. If you have strong objection, please, tell me. 2007-04-09 Masatake YAMATO * progmodes/cc-subword.el (c-capitalize-subword): Implement better mimic the behavior of `capitalize-word'. They no longer move point with a negative argument. Based on code by Paul Curry. (defun c-capitalize-subword (arg) "Do the same as `capitalize-word' but on subwords. See the command `c-subword-mode' for a description of subwords. Optional argument ARG is the same as for `capitalize-word'." (interactive "p") (let ((count (abs arg)) (start (point)) (advance (if (< arg 0) nil t))) (dotimes (i count) (if advance (progn (re-search-forward (concat "[" c-alpha "]") nil t) (goto-char (match-beginning 0))) (c-backward-subword)) (let* ((p (point)) (pp (1+ p)) (np (c-forward-subword))) (upcase-region p pp) (downcase-region pp np) (goto-char (if advance np p)))) (unless advance (goto-char start)))) Regards, Masatake YAMATO ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV