For the most part you can use the same <strong>.emacs</strong> file on both a PC and the Nokia N900 GNU mobile phone. However, you might want to have a different setup in some parts, for instance since the display is smaller on the N900, you might want to arrange the modeline differently etc.</p>

To still have the <strong>.emacs</strong> files synchronized so you can use the same elisp tools etc. on both, and so that changes are automatically updated on both devices, I'm using the following solution. This applies to any device you might want to use GNU Emacs on, not just the Nokia N900.</p>

Use descriptive shortcuts for code in <strong>.emacs</strong> that differs and simple two scripts which automatically quote/unquote the device specific parts of the code.</p>

To do this:</p> <ul> <li>Create the scripts: <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b># echo &quot;#!/bin/sh&quot; &gt; /usr/local/bin/dotemacs-pc.sh<br /> # echo &quot;sed '/^;;;pc-begin;;;$/,/^;;;pc-end;;;$/ { /;;;pc-begin;;;/! { /;;;pc-end;;;/! s/^;//; } }' -i ~/.emacs&quot; &gt;&gt; /usr/local/bin/dotemacs-pc.sh<br /> # echo &quot;sed '/^;;;n900-begin;;;$/,/^;;;n900-end;;;$/ { /;;;n900-begin;;;/! { /;;;n900-end;;;/! s/^/;/; } }' -i ~/.emacs&quot; &gt;&gt; /usr/local/bin/dotemacs-pc.sh<br /> # echo &quot;#!/bin/sh&quot; &gt; /usr/local/bin/dotemacs-n900.sh<br /> # echo &quot;sed '/^;;;n900-begin;;;$/,/^;;;n900-end;;;$/ { /;;;n900-begin;;;/! { /;;;n900-end;;;/! s/^;//; } }' -i ~/.emacs&quot; &gt;&gt; /usr/local/bin/dotemacs-n900.sh<br /> # echo &quot;sed '/^;;;pc-begin;;;$/,/^;;;pc-end;;;$/ { /;;;pc-begin;;;/! { /;;;pc-end;;;/! s/^/;/; } }' -i ~/.emacs&quot; &gt;&gt; /usr/local/bin/dotemacs-n900.sh<br /> # chmod 755 dotemacs-pc.sh<br /> # chmod 755 dotemacs-n900.sh</b></td></tr></table></li> <li>For script customization, then enclose each block of PC-specific text with the lines: <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>;;;pc-begin;;;</b></td></tr></table>and<table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>;;;mb5-end;;;</b></td></tr></table> and enclose each block of N900-specific text with the lines: <table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>;;;n900-begin;;;</b></td></tr></table>and<table bgcolor="#000000" border="1"><tr><td border="0"><font color="#FFFF00"><b>;;;n900-end;;;</b></td></tr></table> Make sure to not have any quoted-lines within these enclosed blocks of code.</li> <li>Then run the appropriate customize-dotemacs script, i.e. on the PC, to use the joint <strong>.emacs</strong> run `dotemacs-pc.sh' and on the N900 run `dotemacs-n900.sh'.</li> </ul>

The scripts will strip the leading semicolon in the lines between the device specific tags and quote out the lines between the other architecture's specific tags. <!— Page published by Emacs Muse ends here —> </div> <i>To send me feedback about this page, use the below email.</i><br /> <b>&copy; sumoudou.org 2010</b><br /> <img style="border:0" alt="sumoudou.org" src="email.gif" width="129" height="10" /><br /> <a href="http://www.gnu.org/" style="text-decoration: none;"><img style="border:0" alt="GNU" src="powered-by-gnu.png" />]] <a href="http://www.gnu.org/software/emacs/emacs.html" style="text-decoration: none;"><img style="border:0" alt="GNU Emacs" src="made-with-emacs.png" />]] <a href="http://hcoop.net/" style="text-decoration: none;"><img style="border:0" alt="HCoop" src="hcoop-proud-member.png" />]] <a href="http://hcoop.net/" style="text-decoration: none;"><img style="border:0" alt="HCoop" src="hosted-by-hcoop.png" />]] <a href="http://mwolson.org/projects/EmacsMuse.html" style="text-decoration: none;"><img style="border:0" alt="Emacs Muse" src="made-with-muse.png" />]] <a href="http://mwolson.org/projects/EmacsMuse.html" style="text-decoration: none;"><img style="border:0" alt="Emacs Muse" src="powered-by-muse.png" />]] <br /> <a href="http://www.fsf.org/resources/formats/playogg" style="text-decoration: none;"><img style="border:0" alt="Ogg" src="play-ogg.png" />]] <a href="http://www.catb.org/hacker-emblem/" style="text-decoration: none;"><img style="border:0" alt="Glider" src="glider.png" />]] <a href="http://ubuntu.com/" style="text-decoration: none;"><img style="border:0" alt="Ubuntu" src="ubuntu.png" />]] <a href="http://validator.w3.org/check?uri=referer" style="text-decoration: none;"><img style="border:0" alt="Valid XHTML 1.0 Strict!" src="valid-xhtml10-blue.png" />]] <a href="http://jigsaw.w3.org/css-validator/check/referer" style="text-decoration: none;"><img style="border:0" alt="Valid CSS!" src="valid-css-blue.png" />]] <br />Last updated 2010-03-16-153111

</div> <br />. </body> </html>

.