371

professional dilettante

Emacs php-mode and php-electric-mode

Following up on my “To Do for Emacs PHP” post, I added a hook to start php-electric-mode automatically when Emacs goes into PHP mode. Without a hook, I had to type (from within php-mode),  M-x php-electric-mode lots of times in lots of buffers. I also went into the Semantic customization group and turned off semantic-show-unmatched-syntax-mode [...]

Following up on my “To Do for Emacs PHP” post, I added a hook to start php-electric-mode automatically when Emacs goes into PHP mode. Without a hook, I had to type (from within php-mode),

 M-x php-electric-mode

lots of times in lots of buffers. I also went into the Semantic customization group and turned off

semantic-show-unmatched-syntax-mode

. It sounds like that would be a useful mode, but with Emacs’ PHP mode it shows red underlines everywhere and it is not easy to ignore. Here’s what I added to my .emacs (with Aquamacs, it’s Preferences.el):

(add-to-list 'load-path "~/Library/Preferences/Aquamacs Emacs/emacs_includes/plugins/php-mode")
(autoload 'php-mode "php-mode" "Major mode for editing php scripts." t)
(setq auto-mode-alist  (cons '(".php$" . php-mode) auto-mode-alist))
(add-to-list 'load-path "~/Library/Preferences/Aquamacs Emacs/emacs_includes/plugins/php-mode/php-electric.el")
(add-hook 'php-mode-hook '(lambda()
(require 'php-electric)
(php-electric-mode t)
))

And to turn off the underlines do

 M-x customize-group [return]
semantic [return]

Then you can customize the options for that group, specifically the

semantic-show-unmatched-syntax-mode

.

Leave a Reply

Required fields are marked with an asterisk (*), you may use these tags in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam protection by WP Captcha-Free

Most Recent Post

It’s been a long time, I shouldn’t have left you, part 1 …

But now I’m back.All official like.I do social stuff again.I see my friends.I’m moving into my own place again.And all that adult shit.

Categories

Content © professional dilettante
Proudly powered by WordPress
Theme designed by Artisan Themes

Entries (RSS)
Comments (RSS)

22 queries.
0.483 seconds.