Results 1 to 6 of 6

Thread: Developing HTML/PHP files with Emacs ...

  1. #1
    Join Date
    Aug 2005
    Beans
    465

    Developing HTML/PHP files with Emacs ...

    Looking for emacs add-on that'll help with developing PHP/HTML files on a single page for WordPress platform.

    html-mode doesn't seem to work for PHP pages.

    Need as much functionality as possible, including formatting, fuzzy selection etc...
    I wish my computer would do what I want it to do - not what I tell it to do.

  2. #2
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Developing HTML/PHP files with Emacs ...

    I have never used emacs .. I use Atom and other tools such as Sublime Text 3.
    But out of curiosity I explored how Atom and emacs might be configured in a cooperative toolchain.
    These are the emacs related packages available in Atom.
    So in my thinking you could continue using emacs but pass certain tasks over to Atom (and vice versa).
    Atom has PHP server package, markdown, snippets, autocomplete and other development tools.
    You could argue that Atom is your emacs "add-on".

  3. #3
    Join Date
    Dec 2014
    Beans
    2,586

    Re: Developing HTML/PHP files with Emacs ...

    On my system Emacs has a php-mode which emacs runs in if I visit a file with the extension .php or .phtml. I can also start it manually with 'M-x php-mode'. I can't recall having done anything to install it but doing an 'apt search emacs' and searching for php in the result shows that there's a package named 'php-elisp' installed.
    It even has a function php-mode-enable-wordpress-coding-style to support coding for wordpress.

    Holger
    Last edited by Holger_Gehrke; January 12th, 2021 at 02:03 PM.

  4. #4
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Developing HTML/PHP files with Emacs ...

    I've used the Emacs clone jed for many years now. It also has syntax highlighting and other goodies for PHP code. jed is in the Ubuntu repositories.

    Having an editor that keeps track of open braces, parentheses, etc., is worth its weight in gold.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Aug 2005
    Beans
    465

    Re: Developing HTML/PHP files with Emacs ...

    thanks Holger,

    I've installed php-mode and it seems to be working fine. that's going to save me some serious hassle in the future.

    can't find any php-mode-enable-wordpress-coding-style though. Is that in the php-elisp library?
    I wish my computer would do what I want it to do - not what I tell it to do.

  6. #6
    Join Date
    Dec 2014
    Beans
    2,586

    Re: Developing HTML/PHP files with Emacs ...

    "php-enable-wordpress-coding-style" is an emacs lisp function in "/usr/share/emacs/site-lisp/php-elisp/php-mode.el". You can either hit M-x and enter the function name or - if you haven't changed the key bindings - hit "C-c ." and enter "wordpress" or you can select 'set style' from the 'Style' menu in the 'C' menu end enter "wordpress".

    Holger

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •