Emacs notes
Note: I am using Emacs 23.1 on Ubuntu Jaunty Linux
js2-mode (for javascript)
I tried to byte-compile js2-mode in Emacs 23.0.60.1, using
M-x byte-compile-file RET js2.el RET from within
Emacs, but I got a Error: Variable binding depth exceeds max-specpdl-size
message. Luckily the comments on the
Installation
Instructions page on the wiki had help for this.
$ cd ~/.emacs.d/site-lisp $ wget http://js2-mode.googlecode.com/files/js2-20080616a.el $ emacs --batch --eval '(byte-compile-file "js2-20080616a.el")'
I added the following to my ~/.emacs:
(autoload 'js2-mode "js2-20080616a" nil t)
(add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))
Update 2010-03-11: I've
switched to
espresso-mode.
php-mode
http://php-mode.sourceforge.net/cd ~/incoming wget http://downloads.sourceforge.net/project/php-mode/php-mode/1.5.0/php-mode-1.5.0.tar.gz tar zxvf php-mode-1.5.0.tar.gz cp -p php-mode-1.5.0/php-mode.el ~/.emacs.d/site-lisp/php-mode-1.5.0.el
Add the following to your .emacs:
(autoload 'php-mode "php-mode-1.5.0")
(add-to-list 'auto-mode-alist
'("\\.php[34]?\\'\\|\\.phtml\\'" . php-mode))
How to manually set the major mode
See 28.1 How Major Modes are Chosen in the Emacs manual. For example to change to js2-mode:
M-x js2-mode
How to use sudo in Tramp
note the two colons
C-c C-f /sudo::/etc/apache2/httpd.conf
alternatively:
C-c C-f /sudo:root@localhost:/etc/apache2/httpd.conf
How to align columns
M-x align may work but M-x align-regexp is more powerful.
How to replace <br> with a newline when using replace-string
Via this article,
hit C-u C-j to insert a newline character.
M-x replace-string <br> RET C-q C-j
Post a comment
About
I'm Eliot and this is my notepad for programming topics such as Python, Django, Ubuntu, Emacs, etc... more »
Search Blog
Tags
-
algorithms
(4)
-
aws
(8)
-
blogproject
(20)
-
c_cplusplus
(12)
-
cardstore
(8)
-
colinux
(2)
-
concurrency
(9)
-
conkeror
(2)
-
cygwin
(18)
-
datastructures
(15)
-
datetime
(3)
-
dell
(3)
-
django
(39)
-
emacs
(20)
-
files_directories
(10)
-
install_setup
(7)
-
javascript
(3)
-
keyboard
(6)
-
matplotlib
(5)
-
mercurial
(4)
-
nginx
(2)
-
preferences
(8)
-
processes
(3)
-
pyqt
(18)
-
python
(122)
-
ratpoison
(3)
-
regexes
(5)
-
rsync
(3)
-
softwaretools
(17)
-
sql
(13)
-
ssh
(7)
-
subversion
(6)
-
twisted
(6)
-
ubuntu
(60)
-
urxvt
(5)
-
vxworks
(25)
-
webservices
(4)
-
wmii
(7)
Blogroll
- Adam Gomaa
- Alex Clemesha
- Amir Salihefendic
- Armin Ronacher
- David Beazley
- David Ziegler
- Duncan McGreggor
- Gareth Rushgrave
- Glyph Lefkowitz
- Guido van Rossum
- Ian Bicking
- Jacob Kaplan-Moss
- James Bennett
- James Tauber
- Jesper Noehr
- Matt Harrison
- Nikolay Kolev
- Parand Darugar
- Peter Baumgartner
- Peter Bengtsson
- Rob Hudson
- Simon Willison
- Will McGugan