help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PHP/HTML indentation


From: vincent . marguerit
Subject: Re: PHP/HTML indentation
Date: Mon, 30 Jul 2007 08:55:20 -0700
User-agent: G2/1.0

On 30 juil, 14:42, "Lennart Borgman (gmail)"
<lennart.borg...@gmail.com> 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 "</[a-z]+>") (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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]