unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: vincent.marguerit@gmail.com
To: help-gnu-emacs@gnu.org
Subject: Re: PHP/HTML indentation
Date: Mon, 30 Jul 2007 08:55:20 -0700	[thread overview]
Message-ID: <1185810920.619948.119110@r34g2000hsd.googlegroups.com> (raw)
In-Reply-To: <mailman.4125.1185802953.32220.help-gnu-emacs@gnu.org>

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.

      parent reply	other threads:[~2007-07-30 15:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 11:07 PHP/HTML indentation vincent.marguerit
2007-07-30 11:46 ` Lennart Borgman (gmail)
     [not found] ` <mailman.4121.1185795982.32220.help-gnu-emacs@gnu.org>
2007-07-30 12:38   ` vincent.marguerit
2007-07-30 13:42     ` Lennart Borgman (gmail)
     [not found]     ` <mailman.4125.1185802953.32220.help-gnu-emacs@gnu.org>
2007-07-30 15:55       ` vincent.marguerit [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1185810920.619948.119110@r34g2000hsd.googlegroups.com \
    --to=vincent.marguerit@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).