#63 Compile warning in 22.2.1

php-mode-1.5.0
open-accepted
Packaging (2)
5
2008-11-14
2008-11-10
Chris
No

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
`add-log-current-defun-header-regexp'

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

Discussion

1 2 > >> (Page 1 of 2)
  • 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

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

     
    Attachments
    • status: open --> open-accepted
     
    • 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.

     
  • 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?

    http://php-mode.sourceforge.net/html-manual/Installation.html

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

    http://emacswiki.org/ApplyingPatches

     
  • 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!

     
  • 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.

     
  • 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.

    See

    http://www.emacswiki.org/emacs/NxhtmlMode

     
1 2 > >> (Page 1 of 2)