From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thomas Christensen Newsgroups: gmane.emacs.cc-mode.general,gmane.emacs.devel Subject: Re: [christensenthomas@gmail.com: C indentation (problem)] Date: Wed, 21 Mar 2007 00:45:39 +0100 Message-ID: <20070320234539.GA7109@toshiba.unispeed.dk> References: <20070319212605.GA2077@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Dxnq1zWXvFF0Q93v" X-Trace: sea.gmane.org 1174434360 26322 80.91.229.12 (20 Mar 2007 23:46:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 20 Mar 2007 23:46:00 +0000 (UTC) Cc: bug-cc-mode@gnu.org, emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: cc-mode-help-bounces@lists.sourceforge.net Wed Mar 21 00:45:50 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 1HTo1V-00058S-RT for sf-cc-mode-help@m.gmane.org; Wed, 21 Mar 2007 00:45:50 +0100 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 31AC2129B4; Tue, 20 Mar 2007 15:45:49 -0800 (PST) Original-Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1HTo1T-0003NE-C8 for cc-mode-help@lists.sourceforge.net; Tue, 20 Mar 2007 16:45:47 -0700 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by mail.sourceforge.net with esmtps (TLSv1:AES256-SHA:256) (Exim 4.44) id 1HTo1R-0005ML-Dw for cc-mode-help@lists.sourceforge.net; Tue, 20 Mar 2007 16:45:47 -0700 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HTnzT-00021N-U4 for bug-cc-mode@gnu.org; Tue, 20 Mar 2007 19:43:43 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1HTo1O-00053O-6c for bug-cc-mode@gnu.org; Tue, 20 Mar 2007 19:45:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on monty-python X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=SPF_NEUTRAL autolearn=no version=3.1.0 Original-Received: from [81.7.189.9] (helo=thomasc.openhost.dk) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HTo1N-00052Y-7u; Tue, 20 Mar 2007 19:45:42 -0400 Original-Received: from toshiba.unispeed.dk (unknown [80.72.152.144]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by thomasc.openhost.dk (Postfix) with ESMTP id C4DB96A70F8D; Wed, 21 Mar 2007 00:45:44 +0100 (CET) Original-Received: by toshiba.unispeed.dk (Postfix, from userid 1000) id 0BA428789; Wed, 21 Mar 2007 00:45:39 +0100 (CET) Content-Disposition: inline In-Reply-To: <20070319212605.GA2077@muc.de> X-Draft-From: ("nndoc+/home/thomasc/mbox:mbox" 9) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux) X-detected-kernel: Linux 2.6 (newer, 3) 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:4440 gmane.emacs.devel:68182 Archived-At: --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Alan Mackenzie writes: > On Mon, Mar 19, 2007 at 01:14:54AM -0400, Richard Stallman wrote: >> Would someone please DTRT and ack? > > You wrote: >> In the emacs pretest I have indentation problems running php-mode. > >> The indentation breaks if I put in a php opening tag, otherwise it >> works fine. I have tracked the source of the problem to the new c-mode >> which php-mode inherits. > > Could you do a few things to help me diagnose this, please: > > (i) Tell me about this PHP Mode. Where do I find the PHP Mode that you > are using? Who maintains it? (Yourself, perhaps?) It doesn't seem to > be part of Emacs 22 itself. The information you've posted says "Major > mode: C/l", which isn't "PHP Mode". How does php-mode work, here? > [Note: I don't know PHP, so be gentle on me, please!] The php-mode is from http://sourceforge.net/projects/php-mode/. My brief studies of php-mode.el told me that it is cc-mode + some syntax highlighting, so I tried to see if the issue was with the CC Mode. > (ii) You say: >> The indentation breaks if I put in a php opening tag, otherwise it >> works fine. I have tracked the source of the problem to the new c-mode >> which php-mode inherits. > > Could you be more specific about what you've found here, please. What > exactly have you found C Mode doing? What version of CC Mode were you > using before which seemed to work all right? Currently I use the CC Mode shipped with this pretest, and I find it working with Emacs 21.4 and it's shipped CC Mode. What I found was that in: the closing bracket of the function definition aligns with the text in the tag, and not with the start of the function declaration, whereas in: it works right. > (iii) Could you post a dump of CC Mode's configuration. You get this > with C-c C-b (or M-x c-submit-bug-report). I will try to attach this. --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=utf-8 Content-Description: C-c C-b Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable Emacs : GNU Emacs 22.0.96.2 (i686-pc-linux-gnu, GTK+ Version 2.10.9) of 2007-03-20 on toshiba Package: CC Mode 5.31.4 (C/l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-st= ring-delim gen-comment-delim syntax-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . = 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . c-lineup-inexpr-block) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont . c-lineup-ObjC-method-call) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist ) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment ) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-intro . +) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont ) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties nil auto-fill-function nil comment-multi-line t comment-start-skip "\\(//+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-!|#%;>*=C2=B7= =E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*\\)*\\)" ) --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline > You say: >> This is the indentation in c-mode (it is the same in php-mode): >> >> > void foo() { >> bar(); >> } >> ?> > > In that little code snippet, could you please do C-u C-c C-s on each > line, to dump CC Mode's idea of each line's syntax, then post the > results. Here it is: /* ((topmost-intro 125)) */ And the flawless one: /* ((topmost-intro 152)) */ >> I am not sure if it's a bug or the ancient php-mode just needs to >> accommodate for the new emacs. > > "<" and ">" are nasty tokens in C-like languages. They can appear as > "i < 10", "#include " and in C++ templates. It could be that > the PHP " Looking forward to hearing from you again, Glad if I can help. Thomas --Dxnq1zWXvFF0Q93v Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --Dxnq1zWXvFF0Q93v--