
python-mode )) ( add-to-list 'interpreter-mode-alist ' ( "python". ( require 'python ) ( require 'auto-complete ) ( require 'yasnippet ) ( autoload 'python-mode "python-mode" "Python Mode." t ) ( add-to-list 'auto-mode-alist ' ( "\\.py\\'".
#PYMACS ROPE AQUAMACS INSTALL#
You'll need to install the very latest development version (as of December '08) of Rope, Ropemacs and Ropemode:

AutoComplete can handle both of them nicely. The two most important completions I want to integrate into it are Rope and yasnippet. Instead, it allows the user to plug into it, feeding it whatever sorts of intelligent completion you want, including Rope. However, AutoComplete is only a completion framework, it doesn't know anything about Python.
#PYMACS ROPE AQUAMACS CODE#
AutoComplete.el is intriguing to me because, unlike ropemacs mode which I've blogged about before, the completions AutoComplete.el provides are inline with your code in a dropdown box instead of in a seperate window (windows in Emacs are what most people call frames). Today, he introduced to me the very cool AutoComplete.el package. $HOME/bin directory (which is on my PATH by default):ĪutoComplete.el : Python Code Completion in Emacs Januat 10:01 PM | categories:Ī friend of mine and I like to show off to each other little Emacs tips and tricks we learn.


This depends on a small BASH helper script which I have stored in my ( require 'php-mode ) ( require 'flymake ) Pear coding standards : ( defun pear/php-mode-init () "Set some buffer-local variables." ( setq case-fold-search t ) ( setq indent-tabs-mode nil ) ( setq fill-column 78 ) ( setq c-basic-offset 4 ) ( c-set-offset 'arglist-cont 0 ) ( c-set-offset 'arglist-intro '+ ) ( c-set-offset 'case-label 2 ) ( c-set-offset 'arglist-close 0 )) ( add-hook 'php-mode-hook 'pear/php-mode-init ) ( defun my-php-hook-function () ( set ( make-local-variable 'compile-command ) ( format "php_lint %s" ( buffer-file-name )))) ( add-hook 'php-mode-hook 'my-php-hook-function ) ( defun flymake-php-init () "Use php and phpcs to check the syntax and code compliance of the current file." ( let* (( temp ( flymake-init-create-temp-buffer-copy 'flymake-create-temp-inplace )) ( local ( file-relative-name temp ( file-name-directory buffer-file-name )))) ( list "php_lint" ( list local )))) This is the error format for : php -f somefile.php -l ( add-to-list 'flymake-err-line-patterns ' ( "\\(Parse\\|Fatal\\) error: +\\(.*?\\) in \\(.*?\\) on line \\(+\\)$" 3 4 nil 2 )) ( add-to-list 'flymake-allowed-file-name-masks ' ( "\\.php$" flymake-php-init )) ( add-hook 'php-mode-hook ( lambda () ( flymake-mode 1 ))) So here's my elisp for configuring Emacs to automatically highlightīoth syntax errors and coding standard deviations for PHP: Though, for that I still wanted to use flymake like Sacha has. Compile mode still doesn't give me automatic feedback Which performs a static analysis of a PHP file and notes anyĭeviations for a given standard. Sacha's configuration only checks for general syntax errors, itĭoesn't check for code compliance. Subversion pre-commit hook checks for compliance and prevents me fromĬhecking in non-conforming code just when I thought I was ready to go Standard is if your editor doesn't pick up on your mistakes rightĪway, you get no automatic feedback and you're left with the task ofĬleaning up your code later at an inconvenient time. The only real pain in conforming to a coding

Pedantic in places, but it's generally a good reference to make cleanĪnd readable code. My code is required to conform to the PEAR coding Of course, I knew Sacha Chua would have a great PHP setup, other than vanilla php-mode, so I went in search of Python, but PHP has grown up considerably since the last time I used My job has me working on a project in PHP right now - it sure isn't PHP Code Compliance In Emacs Jat 09:00 AM | categories:
