From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: vincent.marguerit@gmail.com Newsgroups: gmane.emacs.help Subject: Re: PHP/HTML indentation Date: Mon, 30 Jul 2007 08:55:20 -0700 Organization: http://groups.google.com Message-ID: <1185810920.619948.119110@r34g2000hsd.googlegroups.com> References: <1185793679.975121.95720@k79g2000hse.googlegroups.com> <1185799103.065883.34670@19g2000hsx.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1185813653 8934 80.91.229.12 (30 Jul 2007 16:40:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 Jul 2007 16:40:53 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 30 18:40:45 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IFYIS-0000OV-UD for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Jul 2007 18:40:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IFYIS-0002mL-6w for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Jul 2007 12:40:40 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!r34g2000hsd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 130 Original-NNTP-Posting-Host: 83.245.56.210 Original-X-Trace: posting.google.com 1185810921 19828 127.0.0.1 (30 Jul 2007 15:55:21 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 30 Jul 2007 15:55:21 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.5) Gecko/20070713 Firefox/2.0.0.5,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r34g2000hsd.googlegroups.com; posting-host=83.245.56.210; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Original-Xref: shelby.stanford.edu gnu.emacs.help:150621 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: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:46199 Archived-At: On 30 juil, 14:42, "Lennart Borgman (gmail)" wrote: > vincent.margue...@gmail.com wrote: > > My version of Emacs is 22.1, I use php-mode version 1.2.0 with this is > > in .emacs file: > > Unfortunately there are several php-modes out there. You have to tell us > the author too. > > > (global-font-lock-mode 1) > > (require 'php-mode) > > (add-hook 'php-mode-user-hook 'turn-on-font-lock) > > Font lock is on by default in Emacs 22. > > > The file for which the indentation does not work anymore is > > global_display.inc.php, I have put it here: > >http://boxfly.free.fr/test/php/global_display.inc.phps > > > If I go to line 5 and press TAB key, it will auto indent. But if I go > > to line 522 in the function dis_end_main(), the indentation does not > > work anymore. > > Thanks, but what code to you have on that line? It looks to me that this > is the empty line here: > > function dis_end_main() { > > echo " > > Anyway, indentation works for me here with the version of php-mode I > have. I have the version that comes with nXhtml. > > ** Important: In your case you have just php code and then indentation > works ok. In the case where the code mixes XHTML and PHP it is > different, see nXhtml. > > > I work under Mac OS X. > > > Thanks for your help, > > Vincent. > > > _______________________________________________ > > help-gnu-emacs mailing list > > help-gnu-em...@gnu.org > >http://lists.gnu.org/mailman/listinfo/help-gnu-emacs I have also a error message which is: http://boxfly.free.fr/test/php/emacs-php-fails.jpg And if I choose "y" I have a mumamo error which is a bit long: Do you want to do that now? (y or n) mumamo-turn-on-actions: Symbol's value as variable is void: mlinks- mode backtrace() (let ((standard-output standard-output)) (backtrace)) (let ((standard-output ...)) (let (...) (backtrace)) (with-current- buffer standard-output (prog1 ... ...))) (with-output-to-string (backtrace)) (let ((msg2 ...) (bt ...) (start ...)) (apply (quote message) msg2 lwarn-type args) (message "%s" bt) (with-current-buffer "*Messages*" (goto-char ...) (backward-char) (put-text-property start ... ... ...)) (apply (quote message) msg2 lwarn-type args) (run- with-idle-timer 1 nil (quote mumamo-show-report-message)) (when mumamo- display-error-stop (apply ... msg2 lwarn-type args))) mumamo-display-error(mumamo-turn-on-actions "%s" "Symbol's value as variable is void: mlinks-mode") (condition-case err (progn (mumamo-msgfntfy "mumamo-turn-on- actions") (unless mumamo-current-chunk-family ...) (if ... ... ... ... ... ... ...) (mumamo-get-chunk-at ...) (mumamo-set- major-from-overlay) (add-hook ... ... nil t) (setq mumamo-mode-major- mode major-mode)) (quit (setq mumamo-mode nil)) (error (setq mumamo- mode nil) (mumamo-display-error ... "%s" ...))) mumamo-turn-on-actions() (progn (setq mumamo-main-major-mode major-mode) (mumamo-turn-on- actions) (run-hooks (quote mumamo-mode-on-hook))) (if mumamo-mode (progn (setq mumamo-main-major-mode major-mode) (mumamo-turn-on-actions) (run-hooks ...)) (mumamo-turn-off-actions) (run-hooks (quote mumamo-mode-off-hook))) (let (mumamo-mode--called) (unless (or ... ...) (setq mumamo- explicitly-turned-on-off t)) (if mumamo-mode (progn ... ... ...) (mumamo-turn-off-actions) (run-hooks ...))) (if (or (boundp ...) mumamo-set-major-running (boundp ...)) nil (let (mumamo-mode--called) (unless ... ...) (if mumamo-mode ... ... ...))) (unless (or (boundp ...) mumamo-set-major-running (boundp ...)) (let (mumamo-mode--called) (unless ... ...) (if mumamo-mode ... ... ...))) mumamo-mode(1) (if (not (y-or-n-p ...)) (message "Did not do indentation, but You can try again if you want") (message "") (mumamo-mode 1) (run-with- idle-timer 0 nil (quote message) "Multiple Major Modes is now on, please try to indent again.")) (if (featurep (quote mumamo)) (if (not ...) (message "Did not do indentation, but You can try again if you want") (message "") (mumamo- mode 1) (run-with-idle-timer 0 nil ... "Multiple Major Modes is now on, please try to indent again.")) (lwarn (quote php-indent) :warning (concat " Indentation fails badly with mixed HTML/PHP." " You can get it working by using mumamo-mode," " but I can not find it in your Emacs load path!"))) (if (not (or ... ...)) t (goto-char here) (setq php-warned-bad- indent t) (require (quote mumamo) nil t) (if (featurep ...) (if ... ... ... ... ...) (lwarn ... :warning ...)) nil) (let ((html-tag-re "") (here ...)) (if (not ...) t (goto- char here) (setq php-warned-bad-indent t) (require ... nil t) (if ... ... ...) nil)) php-check-html-for-indenation() (or php-warned-bad-indent (and (featurep ...) mumamo-mode) (php- check-html-for-indenation)) (if (or php-warned-bad-indent (and ... mumamo-mode) (php-check-html- for-indenation)) (funcall (quote c-indent-line))) php-cautious-indent-line() #[nil " \302>\203) So I tried different php-mode.el files but with all the time the same result. I even tried this small one: http://www.ontosys.com/src/php-mode.el But still the same result. I have found a way which is not at all funny, I put functions I work on at the beginning of the file and then the indentation works normally. For exemple, for the function dis_end_main() which is at the end of the file the indentation does not work anymore, but if I cut/paste it at the beginning of the file the indentation works ! I don't what I should do :( Thanks for your help, Vincent.