From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#11107: 24.0.94; indentation in objc-mode Date: Thu, 29 Mar 2012 13:35:28 +0000 Message-ID: <20120329133528.GB2961__13211.6229077385$1333028280$gmane$org@acm.acm> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1333028280 32626 80.91.229.3 (29 Mar 2012 13:38:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 29 Mar 2012 13:38:00 +0000 (UTC) Cc: 11107@debbugs.gnu.org To: Leo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 29 15:37:59 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SDFY6-000345-Hb for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 15:37:58 +0200 Original-Received: from localhost ([::1]:38061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDFY5-0002I8-Ux for geb-bug-gnu-emacs@m.gmane.org; Thu, 29 Mar 2012 09:37:57 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:38224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDFXy-0002GY-Fg for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 09:37:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SDFXs-0003wg-5O for bug-gnu-emacs@gnu.org; Thu, 29 Mar 2012 09:37:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38094) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SDFXk-0003rA-Hg; Thu, 29 Mar 2012 09:37:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SDG29-0003ml-Sa; Thu, 29 Mar 2012 10:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Thu, 29 Mar 2012 14:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11107 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: X-Debbugs-Original-Cc: bug-cc-mode@gnu.org, 11107@debbugs.gnu.org Original-Received: via spool by 11107-submit@debbugs.gnu.org id=B11107.133303013014528 (code B ref 11107); Thu, 29 Mar 2012 14:09:01 +0000 Original-Received: (at 11107) by debbugs.gnu.org; 29 Mar 2012 14:08:50 +0000 Original-Received: from localhost ([127.0.0.1]:44926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDG1x-0003mG-CE for submit@debbugs.gnu.org; Thu, 29 Mar 2012 10:08:50 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:24325 helo=mail.muc.de) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SDG1O-0003lW-PD for 11107@debbugs.gnu.org; Thu, 29 Mar 2012 10:08:48 -0400 Original-Received: (qmail 5622 invoked by uid 3782); 29 Mar 2012 13:36:46 -0000 Original-Received: from acm.muc.de (pD951B3B6.dip.t-dialin.net [217.81.179.182]) by colin.muc.de (tmda-ofmipd) with ESMTP; Thu, 29 Mar 2012 15:36:44 +0200 Original-Received: (qmail 6799 invoked by uid 1000); 29 Mar 2012 13:35:28 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:58285 Archived-At: Hello, Leo. On Wed, Mar 28, 2012 at 09:23:32AM +0800, Leo wrote: > -(IBAction)loginClicked:(id)sender > { > if (![username.text isEqualToString:@""]&&![password.text isEqualToString:@""]&&![companyCode.text isEqualToString:@""]) { > if ([username.text isMatchedByRegex:@"[a-zA-Z0-9]+"]&&[password.text isMatchedByRegex:@"[a-zA-Z0-9]+"]&&[companyCode.text isMatchedByRegex:@"[a-zA-Z0-9]+"]) { > ; > } else { > UIAlertView *alert = [[[UIAlertView alloc] > initWithTitle:@"" > message:@"" > delegate:self > cancelButtonTitle:@"" > otherButtonTitles:nil] autorelease]; > [alert show]; > } > } else { > UIAlertView *alert = [[[UIAlertView alloc] > initWithTitle:@"" > message:@"" > delegate:self > cancelButtonTitle:@"" > otherButtonTitles:nil] autorelease]; > [alert show]; > } > } > 1. Emacs -q > 2. Open the attach file > 3. Eval in the file buffer: > - (c-set-style "bsd") > - (setq c-basic-offset 4) > Try indenting the file, you will see : in the message name not aligned > properly as shown in this picture. What is happening here is this: cancelButtonTitle would, if its : were lined up, not be sufficiently indented from the enclosing [. Here "sufficiently indented" is determined by the variable c-objc-method-arg-min-delta-to-bracket, whose default value is 2. On failing that test, the line gets indented c-basic-offset columns after that [. The simplest WAY TO FIX THIS is to give a lower value to c-objc-method-arg-min-delta-to-bracket (honestly, I didn't invent that name ;-), probably a negative number. You can set this variable via M-x customize-variable, or your favourite other method. There is actually a lineup-function c-lineup-ObjC-method-args which should do exactly what you want, but sadly it doesn't work at all. I'll need to fix it sometime. ######################################################################## OPTIONAL SECTION If you're interested in what's going on here, do C-c C-o on the cancelButtonTitle line, then hit . You get (default (c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call +)). The "default" means "execute the functions in the following list until one returns non-nil". The first one returns nil on the cancelButtonTitle. The second one returns 4, the relative indentation used. All this is detailed in the CC Mode manual in the chapter "Customizing indentation" and its subsections, in particular "Line-Up Functions" together with its subsections. ######################################################################### -- Alan Mackenzie (Nuremberg, Germany).