<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Rforge &#187; Emacs</title>
	<atom:link href="http://rforge.org/category/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://rforge.org</link>
	<description>open source tools and statistical computing ++</description>
	<lastBuildDate>Wed, 22 May 2013 07:17:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='rforge.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Rforge &#187; Emacs</title>
		<link>http://rforge.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://rforge.org/osd.xml" title="Rforge" />
	<atom:link rel='hub' href='http://rforge.org/?pushpress=hub'/>
		<item>
		<title>Sane PATH variable in Emacs on Mac OS X</title>
		<link>http://rforge.org/2011/08/16/sane-path-variable-in-emacs-on-mac-os-x/</link>
		<comments>http://rforge.org/2011/08/16/sane-path-variable-in-emacs-on-mac-os-x/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 09:12:51 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[/usr/local/mysql/bin]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[path variable]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=680</guid>
		<description><![CDATA[On Mac OS X the system PATH variable is not recognized by emacs. This means that one can not simply type in the emacs shell to get into the database. The emacs shell complains about &#8220;binary not found&#8221;. Indeed reveals that emacs just looks into /bin, /usr/bin, /sbin and /usr/sbin. To set the $PATH variable [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=680&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>On Mac OS X the system PATH variable is not recognized by emacs. This means that one can not simply type
<pre class="brush: plain; title: ; notranslate">mysql</pre>
<p> in the emacs shell to get into the database. The emacs shell complains about &#8220;binary not found&#8221;.</p>
<p>Indeed </p>
<pre class="brush: plain; title: ; notranslate">echo $PATH</pre>
<p>reveals that emacs just looks into /bin, /usr/bin, /sbin and /usr/sbin.</p>
<p>To set the $PATH variable inside emacs one can append the following lines to the .emacs file (found on <a href="https://github.com/al3x/emacs/blob/master/customizations/my-shell.el" target="_blank">github</a>, hattip Alex Payne):</p>
<pre class="brush: plain; title: ; notranslate">; sane path
(setq path &quot;/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/mysql/bin&quot;)
(setenv &quot;PATH&quot; path)</pre>
<p>Next time Emacs starts one can go to the shell and</p>
<pre class="brush: plain; title: ; notranslate">mysql</pre>
<p>presents the database prompt.</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=680&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/08/16/sane-path-variable-in-emacs-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Match and replace TAB</title>
		<link>http://rforge.org/2011/01/20/match-and-replace-tab/</link>
		<comments>http://rforge.org/2011/01/20/match-and-replace-tab/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 11:18:05 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[BASH]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[match]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[regular expression]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[TAB]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=626</guid>
		<description><![CDATA[I am using the terminal inside emacs to modify and clean textfiles (colon separated) for import into MySQL &#8211; mostly with SED, GREP, AWK. Replacing TAB in a textfile with SED was not as straightforward as I thought. So Google came up with an excellent post on macworld.com and here especially one post suggesting perl [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=626&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I am using the terminal inside emacs to modify and clean textfiles (colon separated) for import into MySQL &#8211; mostly with SED, GREP, AWK.<br />
Replacing TAB in a textfile with SED was not as straightforward as I thought. So Google came up with an excellent post on <a href="http://hintsforums.macworld.com/showthread.php?t=3779">macworld.com</a> and here especially one post suggesting <a href="http://hintsforums.macworld.com/showpost.php?p=18232&amp;postcount=4">perl as a solution</a>. It turned out perl behaves inside the pipe the same way as SED/AWK.</p>
<p>Replacing TAB &#8216;<strong>\t</strong>&#8216; with colon &#8216;<strong>,</strong>&#8216; in a textfile <strong>&#8216;SomeFile.txt</strong>&#8216; can be done with:</p>
<p><code>perl -pi -e 's/\t/,/g' SomeFile.txt</code></p>
<p>or using the pipe, which can be combined with grep, sed, awk, tr, head, tail, etc&#8230;</p>
<p><code>cat SomeFile.txt | perl -pi -e 's/\t/,/g'</code></p>
<blockquote><p>*Very* similar to the sed invocation, except for the flags. &#8220;-pi&#8221; for &#8220;*print* every line out after making the changes, while editing *inplace*. That is, no backup file is kept. In reality, a temp file is written, and if all is well (ie the operation succeeds), the temp file is shifted &#8220;onto&#8221; the original file, giving the appearance of an in-place edit.</p></blockquote>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=626&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/01/20/match-and-replace-tab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Emacs as MySQL frontend</title>
		<link>http://rforge.org/2011/01/18/emacs-as-mysql-frontend/</link>
		<comments>http://rforge.org/2011/01/18/emacs-as-mysql-frontend/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 10:08:11 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[elisp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql-mysql]]></category>

		<guid isPermaLink="false">http://rforge.org/?p=618</guid>
		<description><![CDATA[After working quite a time with some minor MySQL databases in the (Emacs-) Terminal I just looked up the preinstalled SQL related emacs functions. Just entered M-x sql TAB and indeed the autocompletion showed a function sql-mysql, as expected&#8230; I gave it a try with M-x sql-mysql and after prompting for database, servername, username and [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=618&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After working quite a time with some minor MySQL databases in the (Emacs-) Terminal I just looked up the preinstalled SQL related emacs functions. Just entered <code>M-x sql TAB </code> and indeed the autocompletion showed a function <em>sql-mysql</em>, as expected&#8230;</p>
<p>I gave it a try with<br />
<code>M-x sql-mysql</code><br />
and after prompting for database, servername, username and password Emacs connected to the database and presented the MySQL shell. So I bound sql-mysql to some keyboard shortcut, BUT entering the whole connection parameters each and every time was not acceptable.</p>
<p>Atomized.org has a really nice post on <a href="http://atomized.org/2008/10/enhancing-emacs%E2%80%99-sql-mode/">Enhancing Emacs&#8217; SQL Mode</a> (you can have a look, but you cannot read the post before pasting the content to a text editor). There I found some excellent functions which would provide a solution:</p>
<blockquote><p>
<code>(setq sql-connection-alist<br />
      '((pool-a<br />
         (sql-product 'mysql)<br />
         (sql-server "1.2.3.4")<br />
         (sql-user "me")<br />
         (sql-password "mypassword")<br />
         (sql-database "thedb")<br />
         (sql-port 3306))<br />
        (pool-b<br />
         (sql-product 'mysql)<br />
         (sql-server "1.2.3.4")<br />
         (sql-user "me")<br />
         (sql-password "mypassword")<br />
         (sql-database "thedb")<br />
         (sql-port 3307))))</code></p>
<p><code>(defun sql-connect-preset (name)<br />
  "Connect to a predefined SQL connection listed in `sql-connection-alist'"<br />
  (eval `(let ,(cdr (assoc name sql-connection-alist))<br />
    (flet ((sql-get-login (&amp;rest what)))<br />
      (sql-product-interactive sql-product)))))</code></p>
<p><code>(defun sql-pool-a ()<br />
  (interactive)<br />
  (sql-connect-preset 'pool-a))</code></p>
<p>Now, you can just run sql-pool-a and get connected right away. Because the buffers have good names, you can easily fire up many connections.</p></blockquote>
<p>I included it in my .emacs file and appended<br />
<code>(DefGlobKey "s-a" 'sql-pool-a)</code><br />
and with a keystroke the database promt appears.</p>
<p>Thx, atomized.org, <del datetime="2011-01-19T08:59:12+00:00">but what&#8217;s that webpage giving you an epileptic fit looking at it?!</del>. Excellent page <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=618&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2011/01/18/emacs-as-mysql-frontend/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending Email from Emacs</title>
		<link>http://rforge.org/2009/09/30/sending-email-from-emacs/</link>
		<comments>http://rforge.org/2009/09/30/sending-email-from-emacs/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 11:30:01 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://rforge.wordpress.com/2009/09/30/sending-email-from-emacs/</guid>
		<description><![CDATA[Since Emacs is my main workhorse it comes handy to send plain text email straight from an Emacs buffer. Like for example this blog post directly from Emacs to the Rforge blog. Emacs needs some configuration to do this, which I found on GNU.org&#8217;s Emacs Speaks SMTP: First you need a helper application which enables [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=450&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Since Emacs is my main workhorse it comes handy to send plain text email straight from an Emacs buffer. Like for example this blog post directly from Emacs to the Rforge blog.</p>
<p>Emacs needs some configuration to do this, which I found on <a href="http://www.gnu.org/software/emacs/manual/html_node/smtpmail/Emacs-Speaks-SMTP.html#Emacs-Speaks-SMTP">GNU.org&#8217;s Emacs Speaks SMTP</a>:</p>
<p>First you need a helper application which enables Emacs to use a crypted connection to an IMAP server like e.g. starttls:</p>
<p><code>sudo aptitude install starttls</code></p>
<p>Then include the following into your ~/.emacs file to setup the outgoing mail server (SMTP):</p>
<p><code>;; Emacs Speaks SMTP (gnu.org) using the default mail agent ;; If you use the default mail user agent.<br />
(setq send-mail-function 'smtpmail-send-it)<br />
;; Send mail using SMTP via gmail.<br />
(setq smtpmail-smtp-server "smtp.gmail.com")<br />
;; Send mail using SMTP on the mail submission port 587.<br />
(setq smtpmail-smtp-service 587)<br />
;; Authenticate using this username and password against smtp.gmail.com. (setq smtpmail-auth-credentials<br />
'(("smtp.gmail.com" 587 "captain.cheese" nil)))<br />
;; Use STARTTLS against the server.<br />
(setq smtpmail-starttls-credentials<br />
'(("smtp.gmail.com" 587 "captain.cheese" nil)))</code></p>
<p>when you are not using gmail, you have to find out which SMTP server and port your provider uses and captain.cheese has to be changed to your user account. Note that <em>nil</em> can be changed to your passphrase, which I do not recommend since the .emacs file is plain text so it is possible to read your passphrase&#8230;</p>
<p>The standard Emacs keys to open an empty email formular is Control-x m, which I found to awkward, so I changed it to Hyper-c (this requires having CapsLock redefined as &#8220;Hyper&#8221;-key, which is another story and highly recommendable): <code>(DefGlobKey "H-c" 'compose-mail)<br />
(DefGlobKey "H-M-c" 'mail-send-and-exit)</code></p>
<p>Now H-c opens an email and after writing it H-M-c sends it.</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=450&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2009/09/30/sending-email-from-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Fullscreen toggle with Emacs Shortcuts</title>
		<link>http://rforge.org/2009/08/16/fullscreen-toggle-with-emacs-shortcuts/</link>
		<comments>http://rforge.org/2009/08/16/fullscreen-toggle-with-emacs-shortcuts/#comments</comments>
		<pubDate>Sun, 16 Aug 2009 16:50:09 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[wmctrl]]></category>

		<guid isPermaLink="false">http://rforge.wordpress.com/?p=373</guid>
		<description><![CDATA[After having the unnecessary scroll-, tool- and foo-bars removed it is nice to toggle emacs fullscreen with a keyboard shortcut. The following code pasted into the .emacs file will do the job under Ubuntu, using wmctrl. It works with a lot of desktop managers (Xfce, fluxbox, Gnome at I tried at least). If it is [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=373&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>After having the unnecessary scroll-, tool- and foo-bars removed it is nice to toggle emacs fullscreen with a keyboard shortcut.</p>
<p>The following code pasted into the <strong>.emacs</strong> file will do the job under Ubuntu, using <strong>wmctrl</strong>. It works with a lot of desktop managers (Xfce, fluxbox, Gnome at I tried at least). If it is not installed<br />
<code>sudo aptitude install wmctrl</code></p>
<p>The full screen mode is based on a code snippet I found online. The comments in the .emacs file gave credit to the <a href="http://www.emacswiki.org/cgi-bin/wiki/WriteRoom">emacswiki</a> and <a href="http://stevenpoole.net/blog/goodbye-cruel-word/">Steven Poole</a> for the code.</p>
<p>First define a lisp function calling wmctrl:<br />
<code>(defun djcb-full-screen-toggle ()<br />
    (interactive)<br />
    (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))</code></p>
<p>and then a keybinding to the function</p>
<p><code>(DefGlobKey "H-f" 'djcb-full-screen-toggle)</code></p>
<p>In this example <em>toggle fullscreen</em> is bound to <em>H-f</em> which means pressing the <em>Hyper</em> key and <em>f</em>. You have to customize it to your needs.</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=373&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2009/08/16/fullscreen-toggle-with-emacs-shortcuts/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Using the Directory Editor in Emacs</title>
		<link>http://rforge.org/2009/08/05/using-the-directory-editor-in-emacs/</link>
		<comments>http://rforge.org/2009/08/05/using-the-directory-editor-in-emacs/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 08:10:30 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[dired]]></category>

		<guid isPermaLink="false">http://rforge.wordpress.com/?p=281</guid>
		<description><![CDATA[Emacs autocompletes path names when opening a file. Just hit TAB. When I forget the correct name of the file I am looking for I just stop at some place in the path and hit ENTER. A list of files and folders in the directory show up and Emacs says (Dired by name). I just [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=281&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Emacs autocompletes path names when opening a file. Just hit TAB. When I forget the correct name of the file I am looking for I just stop at some place in the path and hit ENTER.</p>
<p>A list of files and folders in the directory show up and Emacs says (Dired by name). I just recently found out that Emacs offers full control over the listed files and directories in this so called <em>Dired</em> (directory editor) mode.</p>
<p>A look at the <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html">manual</a> showed some straighforward commands, which work while Emacs is <em>Dired</em>. Move to the line listing the file/folder and hit</p>
<ul>
<li><strong>D</strong> to delete this file or folder</li>
<li><strong>d</strong> to flagg this file/folder for deletion</li>
<li><strong>u</strong> to unflagg this file/folder to prevent deletion</li>
<li><strong>x</strong> to delete the files flagged for deletion</li>
<li><strong>R</strong> Rename the specified file</li>
<li><strong>C</strong> Copy the specified file(s). Emacs asks for the directory (and filename) where to copy to.</li>
</ul>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=281&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2009/08/05/using-the-directory-editor-in-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>Emacs &#8211; Display REAL Full Screen</title>
		<link>http://rforge.org/2009/07/27/emacs-display-real-full-screen/</link>
		<comments>http://rforge.org/2009/07/27/emacs-display-real-full-screen/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 12:20:23 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://rforge.wordpress.com/?p=255</guid>
		<description><![CDATA[Remove scroll bar, tool bar and menu bar in emacs<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=255&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The main advantage of the Emacs editor is the possiblity to control <em>everything</em> (literally) with lightning fast keyboard shortcuts. This holds true <em>after</em> the default shortcuts got replaced by the sane keybindings of Andrew Polonsky &#8211; otherwise you end up lightning fast crippled.</p>
<p>Anyway. Having proper keybindings and being used to them, everything which is not text content is no longer usefull and just minimized the invaluable screenspace (espacially on a 12&#8221; X61 without an external display).</p>
<p>So away with them:<br />
<code>(menu-bar-mode -1)<br />
(toggle-scroll-bar -1)<br />
(tool-bar-mode -1)</code></p>
<p>include those lines into the configuration file in your homefolder (in Linux: /home/YourLoginName/.emacs) and<br />
menu-bar, tool-bar and scroll-bar disappear.</p>
<p>Update: The only thing to do then is to <a href="http://http://rforge.wordpress.com/2009/08/16/fullscreen-toggle-with-emacs-shortcuts/">toggle emacs to fullscreen</a> and the whole screen is emacs (Hat tip: Nisheet).</p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=255&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2009/07/27/emacs-display-real-full-screen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
		<item>
		<title>.emacs</title>
		<link>http://rforge.org/2009/06/04/emacs/</link>
		<comments>http://rforge.org/2009/06/04/emacs/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 20:14:56 +0000</pubDate>
		<dc:creator>rforge</dc:creator>
				<category><![CDATA[Emacs]]></category>

		<guid isPermaLink="false">http://rforge.wordpress.com/?p=9</guid>
		<description><![CDATA[The emacs configuration file with capslock as "Hyper", keybindings, fullscreen toggle via wmctrl, etc...<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=9&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Here goes my mighty dot-emacs file. The mighty key-bindings are courtesy of Andre Polonsky &#8211; thanks for that mate!!</p>
<p><code><br />
(menu-bar-mode -1)<br />
(toggle-scroll-bar -1)<br />
(tool-bar-mode -1)<br />
(blink-cursor-mode 0)           ; don't blink cursor</p>
<p>(transient-mark-mode t)         ; make the current 'selection' visible<br />
(delete-selection-mode t)       ; delete the selection area with a keypress<br />
(setq search-highlight t        ; highlight when searching...<br />
  query-replace-highlight t)    ; ...and replacing<br />
(fset 'yes-or-no-p 'y-or-n-p)   ; enable one letter y/n answers to yes/no</p>
<p>;; don't show startup messages<br />
(setq inhibit-startup-message t<br />
  inhibit-startup-echo-area-message t)</p>
<p>;; set frame title / icon title using filename or buffername and current date<br />
;; little trick to replace  /home/foo with ~ (www.emacswiki.org/cgi-bin/wiki/ShadyTrees)<br />
(defun djcb-title-format ()<br />
  (if buffer-file-name<br />
    (replace-regexp-in-string "\\\\" "/"<br />
      (replace-regexp-in-string (regexp-quote (getenv "HOME")) "~"<br />
        (convert-standard-filename buffer-file-name)))<br />
    (buffer-name)))</p>
<p>(setq<br />
  frame-title-format '(:eval (concat (url-get-normalized-date) "     " (djcb-title-format)))<br />
  icon-title-format  '(:eval (concat "emacs:" (djcb-title-format))))</p>
<p>;; Backups<br />
(setq make-backup-files t ; do make backups<br />
  backup-by-copying t ; and copy them ...<br />
  backup-directory-alist '(("." . "~/.emacs.d/backup/")) ; ... here<br />
  version-control t<br />
  kept-new-versions 2<br />
  kept-old-versions 5<br />
  delete-old-versions t)</p>
<p>;; full-screen mode<br />
;; based on <a href="http://www.emacswiki.org/cgi-bin/wiki/WriteRoom" rel="nofollow">http://www.emacswiki.org/cgi-bin/wiki/WriteRoom</a><br />
;; toggle full screen with custom keybinding; require 'wmctrl'<br />
;; <a href="http://stevenpoole.net/blog/goodbye-cruel-word/" rel="nofollow">http://stevenpoole.net/blog/goodbye-cruel-word/</a><br />
(defun djcb-full-screen-toggle ()<br />
    (interactive)<br />
    (shell-command "wmctrl -r :ACTIVE: -b toggle,fullscreen"))</p>
<p>(defun djcb-maximize-screen-toggle ()<br />
    (interactive)<br />
    (shell-command "wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz"))</p>
<p>;; change caps- to hyper-key<br />
(shell-command "xmodmap -e 'remove lock = Caps_Lock' &amp;&amp; xmodmap -e 'keycode 66 = Hyper_L' &amp;&amp; xmodmap -e 'add mod3 = Hyper_L'")</p>
<p>;; org-mode / remember-mode<br />
;; we use org-mode as the backend for remember<br />
(add-to-list 'auto-mode-alist '("\\.org$" . org-mode))</p>
<p>;(org-remember-insinuate)<br />
(setq org-directory "~/.emacs.d/org/")<br />
(setq org-default-notes-file (concat org-directory "/notes.org")<br />
  org-agenda-files (list (expand-file-name org-directory)<br />
  (concat (expand-file-name org-directory) "/todo.org"))<br />
  org-agenda-include-diary t)</p>
<p>;; org-latex.el<br />
(autoload 'org-export-as-latex-batch "org-export-latex")<br />
(autoload 'org-export-as-latex-to-buffer "org-export-latex"<br />
  "Call `org-exort-as-latex` with output to a temporary buffer" t)<br />
(autoload 'org-replace-region-by-latex "org-export-latex"<br />
  "Replace the region from BEG to END with its LaTeX export." t)<br />
(autoload 'org-export-region-as-latex "org-export-latex"<br />
  "Convert region from BEG to END in `org-mode' buffer to LaTeX." t)<br />
(autoload 'org-export-as-latex "org-export-latex"<br />
  "Export current buffer to a LaTeX file." t)</p>
<p>;; start with my todo-list<br />
(find-file "~/.emacs.d/org/todo.org")</p>
<p>;; Custom Colors from Dirk Binnema<br />
;  (set-background-color "black")<br />
;  (set-foreground-color "lightblue")<br />
;<br />
;  (set-face-foreground 'font-lock-string-face  "#123467") ;<br />
;  (set-face-foreground 'font-lock-comment-face  "#aaaaaa") ;<br />
;  (make-face-italic 'font-lock-comment-face)<br />
;<br />
;  (set-face-foreground 'font-lock-keyword-face  "lemonchiffon") ;<br />
;  (make-face-bold 'font-lock-keyword-face)<br />
;<br />
;  (set-face-foreground 'font-lock-string-face   "#ffffff") ;<br />
;  (set-face-foreground 'font-lock-preprocessor-face "red") ;<br />
;  (set-face-foreground 'font-lock-constant-face   "green") ;<br />
;<br />
;  (set-face-foreground 'font-lock-type-face    "lightblue")<br />
;  (make-face-bold 'font-lock-type-face)<br />
;<br />
;  (set-face-foreground 'font-lock-function-name-face "darkcyan")<br />
;  (set-face-foreground 'font-lock-variable-name-face "darkgreen")<br />
;<br />
;  (set-face-foreground 'font-lock-warning-face "yellow")<br />
;  (set-face-underline  'font-lock-warning-face "red")<br />
;<br />
  (set-face-background 'region "#777777")</p>
<p>  (set-face-foreground 'mode-line "#777777")<br />
  (set-face-background 'mode-line "#333333")</p>
<p>;;   The Sane Emacs Keybindings</p>
<p>; I included the bindings directly into my .emacs, so the load-file is no longer necessary<br />
;(load-file "~/.emacs.d/bindings.el")</p>
<p>;; auxiliary functions</p>
<p>(defun DefGlobKey (k b)<br />
(define-key global-map (read-kbd-macro k) b) )<br />
(defun DefSrchKey (k b)<br />
(define-key isearch-mode-map (read-kbd-macro k) b) )</p>
<p>(defun other-other-window ()<br />
  (interactive)<br />
  (other-window -1))<br />
(defun yank-push ()<br />
  (interactive)<br />
  (yank-pop -1))<br />
(defun move-n-lines (n)<br />
  (scroll-up n))</p>
<p>(setq scroll-preserve-screen-position t)</p>
<p>(defun scroll-one-left ()<br />
  (interactive)<br />
  (backward-char)<br />
  (scroll-left -1))<br />
(defun scroll-one-right ()<br />
  (interactive)<br />
  (forward-char)<br />
  (scroll-right -1))<br />
(defun scroll-one-up ()<br />
  (interactive)<br />
  (move-n-lines -1))<br />
(defun scroll-one-down ()<br />
  (interactive)<br />
  (move-n-lines 1))<br />
(defun page-up ()<br />
  (interactive)<br />
  (move-n-lines (- 1 (window-height))))<br />
(defun page-down ()<br />
  (interactive)<br />
  (move-n-lines (- (window-height) 1)))</p>
<p>;; basic movement</p>
<p>(DefGlobKey "H-j" 'backward-char)<br />
(DefGlobKey "H-l" 'forward-char)<br />
(DefGlobKey "H-i" 'previous-line)<br />
(DefGlobKey "H-k" 'next-line)<br />
(DefGlobKey "H-u" 'beginning-of-line)<br />
(DefGlobKey "H-o" 'end-of-line)</p>
<p>(DefGlobKey "H-M-j" 'backward-word)<br />
(DefGlobKey "H-M-l" 'forward-word)<br />
(DefGlobKey "H-M-i" 'backward-paragraph)<br />
(DefGlobKey "H-M-k" 'forward-paragraph)<br />
(DefGlobKey "H-M-u" 'page-up)<br />
(DefGlobKey "H-M-o" 'page-down)</p>
<p>(DefGlobKey "H-J" 'scroll-one-left)<br />
(DefGlobKey "H-L" 'scroll-one-right)<br />
(DefGlobKey "H-I" 'scroll-one-up)<br />
(DefGlobKey "H-K" 'scroll-one-down)<br />
(DefGlobKey "H-U" 'beginning-of-buffer)<br />
(DefGlobKey "H-O" 'end-of-buffer)</p>
<p>(DefGlobKey "H-." 'isearch-forward)<br />
(DefGlobKey "H-m" 'isearch-backward)<br />
(DefGlobKey "H-M-." 'isearch-forward-regexp)<br />
(DefGlobKey "H-M-m" 'isearch-backward-regexp)</p>
<p>(DefGlobKey "H-M-," 'recenter)</p>
<p>;; basic editing</p>
<p>(DefGlobKey "H-æ" 'advertised-undo)<br />
(DefGlobKey "H-M-æ" 'redo)<br />
(DefGlobKey "H-ø" 'backward-delete-char-untabify)<br />
(DefGlobKey "H-M-ø" 'delete-char)<br />
(DefGlobKey "H-p" 'kill-whole-line)<br />
(DefGlobKey "H-M-p" 'kill-line)</p>
<p>(DefGlobKey "H-" 'set-mark-command)<br />
(DefGlobKey "H-M-" 'exchange-point-and-mark)<br />
(DefGlobKey "H-M-å" 'mark-paragraph)<br />
(DefGlobKey "H-å" 'mark-whole-buffer)</p>
<p>(DefGlobKey "H-M-h" 'kill-region)<br />
(DefGlobKey "H-h" 'kill-ring-save)<br />
(DefGlobKey "H-y" 'yank)<br />
(DefGlobKey "H-M-y" 'yank-pop)<br />
(DefGlobKey "H-Y" 'yank-push)<br />
(DefGlobKey "H-n" 'replace-string)<br />
(DefGlobKey "H-M-n" 'replace-regexp)</p>
<p>(DefGlobKey "H-_" 'fill-region)</p>
<p>;; basic control</p>
<p>(DefGlobKey "H-q" 'save-buffer)<br />
(DefGlobKey "H-M-q" 'write-file)<br />
(DefGlobKey "H-w" 'find-file)<br />
(DefGlobKey "H-r" 'switch-to-buffer)<br />
(DefGlobKey "H-M-r" 'next-buffer)<br />
(DefGlobKey "H-e" 'kill-this-buffer)<br />
(DefGlobKey "H-M-e" 'save-buffers-kill-emacs)</p>
<p>(DefGlobKey "M-E" 'kill-this-buffer)<br />
(DefGlobKey "M-J" 'previous-buffer)<br />
(DefGlobKey "M-L" 'next-buffer)</p>
<p>(DefGlobKey "H-M-s" 'ess-eval-buffer-and-go)<br />
(DefGlobKey "H-s" 'ess-eval-region-and-go)<br />
(DefGlobKey "H-t" 'tex-compile)<br />
(DefGlobKey "H-a" 'term)<br />
(DefGlobKey "H-A" 'shell)</p>
<p>(DefGlobKey "H-F" 'djcb-maximize-screen-toggle)<br />
(DefGlobKey "H-f" 'djcb-full-screen-toggle)<br />
(DefGlobKey "H-M-z" 'split-window-horizontally)<br />
(DefGlobKey "H-z" 'split-window-vertically)<br />
(DefGlobKey "H-x" 'delete-window)<br />
(DefGlobKey "H-M-x" 'delete-other-windows)<br />
(define-key global-map [H-tab] 'other-window)<br />
(define-key global-map [H-M-tab] 'other-other-window)</p>
<p>;; search mode</p>
<p>(DefSrchKey "H-m" 'isearch-repeat-backward)<br />
(DefSrchKey "H-." 'isearch-repeat-forward)<br />
(DefSrchKey "H-M-m" 'isearch-repeat-backward)<br />
(DefSrchKey "H-M-." 'isearch-repeat-forward)<br />
(DefSrchKey "H-," 'isearch-query-replace)<br />
(DefSrchKey "H-M-," 'isearch-query-replace-regexp)</p>
<p>(DefSrchKey "H-/" 'isearch-complete)<br />
(DefSrchKey "H-M-/" 'isearch-toggle-case-fold)<br />
(DefSrchKey "H-?" 'isearch-toggle-regexp)</p>
<p>(DefSrchKey "H-n" 'isearch-cancel)<br />
(DefSrchKey "H-M-n" 'isearch-exit)</p>
<p>;; other features</p>
<p>;;help<br />
;(DefGlobKey "H-f" 'describe-key)<br />
;(DefGlobKey "H-M-f" 'describe-function)</p>
<p>;; I do not use Lisp yet, but constantly get into the evaluation queue, so I comment away these<br />
;lisp<br />
;(DefGlobKey "H-" 'eval-defun)<br />
;(DefGlobKey "H-M-" 'eval-region)<br />
</code></p>
<br />  <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=rforge.org&#038;blog=7577563&#038;post=9&#038;subd=rforge&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://rforge.org/2009/06/04/emacs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/2a4cc3be2c3e1c3b1442535ef7a46f42?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">rforge</media:title>
		</media:content>
	</item>
	</channel>
</rss>
