#63 Compile warning in 22.2.1

Packaging (2)

When I byte-compile php-mode.el with Emacs 22.2.1, I get the following warning:

In php-mode: php-mode.el:392:8:Warning: assignment to free variable

When I subsequently load a .php file, it loads in Fundamental mode.


  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-14

    Thanks for reporting this. I hadn't been able to duplicate it. After running Emacs with the -q option, I'm now able to duplicate it.

    Attached is a patch that will fix it.

    Thanks again.

    File Added: add-log-warning.diff

  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-14

    Patch to fix byte compile warning in version 1.5.0 of php-mode.el

  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-14
    • status: open --> open-accepted
  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-14
    • milestone: --> php-mode-1.5.0
    • assigned_to: nobody --> ashawley
  • Chris

    Chris - 2008-11-14

    Emacs-newbie question... How do I apply the patch? Google stutters when I ask.

    I'm also curious how I helped you find the -q bug, but maybe I would have to know Lisp to understand.

  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-14

    As emacs --help says about -q:

    --no-init-file, -q load neither ~/.emacs nor default.el

    So there was something in my Emacs that was already loading add-log, so I never saw the compiler warning. Running Emacs with -q avoided autoloading add-log, and then I could confirm the byte compiler warning.

    Concerning Fundamental Mode, what happens when you run M-x php-mode RET inside an open PHP file. Does it work then?

    Is PHP mode installed correctly?


    Concerning patches, I agree there really isn't a great document introducing patches. I've tried to document the situation on the EmacsWiki.


  • Chris

    Chris - 2008-11-15

    I apparently need to take a break from everything to RTFM. (I empathize with the editor of EmacsWiki who claimed that it must have "been communicated by a martian...")

    I get [No match] when trying to switch to the mode directly.

    I have a suggestion for the Installation page in your manual... Provide an HTML bookmark where the .el file is obtained and link to it from the top for those who downloaded it directly. I went on a short but frustrating adventure trying to use GnuPG to decrypt an unencrypted file. I'm glad I actually looked at the contents before finishing the journey which prompted http://lists.canonical.org/pipermail/kragen-tol/2001-March/000648.html

    Come to find out, I hadn't mentioned php-mode in my .emacs. Once that's fixed, it works fine. Thanks!

  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-15

    I'm glad you figured it out.

    I'm sorry the installation instructions were confusing as well. A link to php-mode.el file is made available from the top of the PHP mode home page.

    After reading your initial bug report, I assumed you were an experienced Emacs user, not an Emacs newbie. Byte-compiler warning reports are usually the stuff of Emacs officianados. Out of curiosity, where had you read that you need to byte-compile php-mode.el to install PHP mode?

  • Chris

    Chris - 2008-11-15

    Actually, I read it about js2-mode (http://code.google.com/p/js2-mode/wiki/InstallationInstructions) and assumed a pattern. Now that I've installed a few modes, I see that Emacs allows a lot of flexibility to the installation process, but I'm used to extensions having a few standard steps (a la Firefox).

    But now I'm back in the market (obsolete metaphor) for a PHP mode because php-mode can't do HTML and JS (should have thought of that before). I wonder if you have any recommendations for that threesome? I took your suggestions from the warning but don't want to install something that can do PHP+HTML but not JS.

  • Aaron S. Hawley

    Aaron S. Hawley - 2008-11-15

    Ok. I see.

    I don't do a lot of PHP/HTML/Javascript programming, but I'd suggest something like NxhtmlMode. Its popular with the kids.




Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks