<?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>Notes on software development &#187; emacs</title>
	<atom:link href="http://kuniganotas.wordpress.com/category/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://kuniganotas.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 15:44:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='kuniganotas.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Notes on software development &#187; emacs</title>
		<link>http://kuniganotas.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://kuniganotas.wordpress.com/osd.xml" title="Notes on software development" />
	<atom:link rel='hub' href='http://kuniganotas.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Working with mixed HTML and PHP code in emacs</title>
		<link>http://kuniganotas.wordpress.com/2011/11/27/working-with-mixed-html-and-php-code-in-emacs/</link>
		<comments>http://kuniganotas.wordpress.com/2011/11/27/working-with-mixed-html-and-php-code-in-emacs/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 14:28:22 +0000</pubDate>
		<dc:creator>kunigami</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://kuniganotas.wordpress.com/?p=655</guid>
		<description><![CDATA[I found that the html-helper-mode is a better alternative than either php or html mode. To set this mode automatically for .php and .html files, just add the following entry in your .emacs configuration: (setq auto-mode-alist (cons '("\\.php$" . html-helper-mode) &#8230; <a href="http://kuniganotas.wordpress.com/2011/11/27/working-with-mixed-html-and-php-code-in-emacs/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=655&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I found that the <code>html-helper-mode</code> is a better alternative than either php or html mode.</p>
<p>To set this mode automatically for <code>.php</code> and <code>.html</code> files, just add the following entry in your <code>.emacs</code> configuration:</p>
<p><code>(setq auto-mode-alist (cons '("\\.php$" . html-helper-mode) auto-mode-alist))<br />
(setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))<br />
</code></p>
<p>To check in which mode you&#8217;re currently on,</p>
<p><code>C-h m<br />
Display documentation of the current major mode (describe-mode).<br />
</code></p>
<h3>References:</h3>
<p>[1] <a href="http://xahlee.org/emacs/emacs_html.html">http://xahlee.org/emacs/emacs_html.html</a><br />
[2] <a href="http://jeremy.zawodny.com/emacs/emacs-4.html">http://jeremy.zawodny.com/emacs/emacs-4.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuniganotas.wordpress.com/655/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuniganotas.wordpress.com/655/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=655&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuniganotas.wordpress.com/2011/11/27/working-with-mixed-html-and-php-code-in-emacs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c96a203d99d04b22c2c70e136ec0588b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kunigami</media:title>
		</media:content>
	</item>
		<item>
		<title>Gtags on emacs</title>
		<link>http://kuniganotas.wordpress.com/2011/07/31/gtags-on-emacs/</link>
		<comments>http://kuniganotas.wordpress.com/2011/07/31/gtags-on-emacs/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 13:51:45 +0000</pubDate>
		<dc:creator>kunigami</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[mac os]]></category>

		<guid isPermaLink="false">http://kuniganotas.wordpress.com/?p=523</guid>
		<description><![CDATA[In a previous post about emacs etags, I received a tip from Alex Ott suggesting gtags for C/C++. Installing On MacOS, you can get gtags through mac ports, installing the &#8220;global&#8221; package. Usage To build the symbols table, it&#8217;s simple &#8230; <a href="http://kuniganotas.wordpress.com/2011/07/31/gtags-on-emacs/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=523&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In a <a href="2011/07/21/emacs-etags/">previous post</a> about emacs etags, I received a tip from Alex Ott suggesting gtags for C/C++.</p>
<h3>Installing</h3>
<p>On MacOS, you can get gtags through <a href="http://www.macports.org/">mac ports</a>, installing the &#8220;<code>global</code>&#8221; package.</p>
<h3>Usage</h3>
<p>To build the symbols table, it&#8217;s simple as doing:</p>
<pre class="brush: plain; title: ; notranslate">
gtags
</pre>
<p>at the root of the project.</p>
<h3>Usage on emacs</h3>
<p>First, you need to add a gtags-mode on emacs and tell it where to find the gtags script if gtags.el file is not installed in the default location (mac ports install it on <code>/opt/local/share/gtags</code> by default). On the preferences files, I added these lines:</p>
<pre class="brush: plain; title: ; notranslate">
(setq load-path (cons &quot;/opt/local/share/gtags/&quot; load-path))                                                                                                             
(autoload 'gtags-mode &quot;gtags&quot; &quot;&quot; t)  
</pre>
<p>Some useful commands:</p>
<ul>
<li><code>gtags-find-tag [tag name]</code> &#8212; this command finds the definition of tag name.
</li>
<li><code>gtags-find-rtag [tag name]</code> &#8212; this command finds the usage of the tag name</li>
<li><code>gtags-find-tag-from-here</code> &#8212; this command is a smart version of the above. It will look up the name that is pointed by your cursor. If your cursor is on a definition, it will look for usage. On the other hand, if your cursor is on a usage, it will look for the definition.</li>
</ul>
<p>One may wish to bind this last command to some key.</p>
<h3>Reference</h3>
<p><a href="http://www.gnu.org/s/global/globaldoc.html">http://www.gnu.org/s/global/globaldoc.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuniganotas.wordpress.com/523/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuniganotas.wordpress.com/523/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=523&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuniganotas.wordpress.com/2011/07/31/gtags-on-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c96a203d99d04b22c2c70e136ec0588b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kunigami</media:title>
		</media:content>
	</item>
		<item>
		<title>Emacs etags</title>
		<link>http://kuniganotas.wordpress.com/2011/07/21/emacs-etags/</link>
		<comments>http://kuniganotas.wordpress.com/2011/07/21/emacs-etags/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 15:15:25 +0000</pubDate>
		<dc:creator>kunigami</dc:creator>
				<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://kuniganotas.wordpress.com/?p=499</guid>
		<description><![CDATA[etags is a simple way to find the definition of a function. This is very useful if you&#8217;re reading code from a large application. You can run the following command at the root of the sources: (Sorry, I don&#8217;t know &#8230; <a href="http://kuniganotas.wordpress.com/2011/07/21/emacs-etags/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=499&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>etags is a simple way to find the definition of a function. This is very useful if you&#8217;re reading code from a large application.</p>
<p>You can run the following command at the root of the sources:</p>
<pre class="brush: plain; title: ; notranslate">
find . | grep -P &quot;(c|cpp|h|hpp)$&quot; | etags - 
</pre>
<p>(Sorry, I don&#8217;t know how to do it directly with <code>find</code>)</p>
<p>Then, when using emacs, just place the cursor above the function name and type </p>
<p><code>M-.</code></p>
<p>This will take you to the function definition.</p>
<p>References:</p>
<p><a href="http://www.gnu.org/software/libtool/manual/emacs/Tags.html" rel="nofollow">http://www.gnu.org/software/libtool/manual/emacs/Tags.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuniganotas.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuniganotas.wordpress.com/499/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=499&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuniganotas.wordpress.com/2011/07/21/emacs-etags/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c96a203d99d04b22c2c70e136ec0588b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kunigami</media:title>
		</media:content>
	</item>
		<item>
		<title>Cmake syntax highlighting for aquamacs</title>
		<link>http://kuniganotas.wordpress.com/2011/06/06/cmake-syntax-highlighting-for-aquamacs/</link>
		<comments>http://kuniganotas.wordpress.com/2011/06/06/cmake-syntax-highlighting-for-aquamacs/#comments</comments>
		<pubDate>Mon, 06 Jun 2011 20:04:51 +0000</pubDate>
		<dc:creator>kunigami</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[mac os]]></category>

		<guid isPermaLink="false">http://kuniganotas.wordpress.com/?p=479</guid>
		<description><![CDATA[Aquamacs does not offer syntax highlighting for cmake files for default. To change that, download the parser from cmake website: http://www.cmake.org/CMakeDocs/cmake-mode.el Then, add the following lines in the configuration file for aquamacs, usually in: ~/Library/Preferences/Aquamacs Emacs/Preferences.el Source: http://www.itk.org/Wiki/CMake_Editors_Support<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=479&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Aquamacs does not offer syntax highlighting for cmake files for default. To change that, download the parser from cmake website: <a href="http://www.cmake.org/CMakeDocs/cmake-mode.el" rel="nofollow">http://www.cmake.org/CMakeDocs/cmake-mode.el</a></p>
<p>Then, add the following lines in the configuration file for aquamacs, usually in: ~/Library/Preferences/Aquamacs Emacs/Preferences.el </p>
<pre class="brush: plain; title: ; notranslate">
; Add cmake listfile names to the mode list.
(setq auto-mode-alist
	  (append
	   '((&quot;CMakeLists\\.txt\\'&quot; . cmake-mode))
	   '((&quot;\\.cmake\\'&quot; . cmake-mode))
	   auto-mode-alist))

(autoload 'cmake-mode &quot;~/CMake/Docs/cmake-mode.el&quot; t)
</pre>
<p>Source:</p>
<p><a href="http://www.itk.org/Wiki/CMake_Editors_Support">http://www.itk.org/Wiki/CMake_Editors_Support</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuniganotas.wordpress.com/479/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuniganotas.wordpress.com/479/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=479&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuniganotas.wordpress.com/2011/06/06/cmake-syntax-highlighting-for-aquamacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c96a203d99d04b22c2c70e136ec0588b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kunigami</media:title>
		</media:content>
	</item>
		<item>
		<title>Regexp replace all on emacs</title>
		<link>http://kuniganotas.wordpress.com/2011/05/10/regexp-replace-all-on-emacs/</link>
		<comments>http://kuniganotas.wordpress.com/2011/05/10/regexp-replace-all-on-emacs/#comments</comments>
		<pubDate>Tue, 10 May 2011 12:53:50 +0000</pubDate>
		<dc:creator>kunigami</dc:creator>
				<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://kuniganotas.wordpress.com/?p=429</guid>
		<description><![CDATA[useful command: Replace every match for regexp with newstring [1] http://www.gnu.org/software/libtool/manual/emacs/Regexp-Replace.html<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=429&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>useful command:</p>
<pre class="brush: cpp; title: ; notranslate">M-x replace-regexp &lt;RET&gt; regexp &lt;RET&gt; newstring &lt;RET&gt;</pre>
<p>Replace every match for <code>regexp</code> with <code>newstring</code></p>
<p>[1] <a href="http://www.gnu.org/software/libtool/manual/emacs/Regexp-Replace.html">http://www.gnu.org/software/libtool/manual/emacs/Regexp-Replace.html</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuniganotas.wordpress.com/429/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuniganotas.wordpress.com/429/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=429&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuniganotas.wordpress.com/2011/05/10/regexp-replace-all-on-emacs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c96a203d99d04b22c2c70e136ec0588b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kunigami</media:title>
		</media:content>
	</item>
		<item>
		<title>Indent macros as regular C code in emacs</title>
		<link>http://kuniganotas.wordpress.com/2011/03/10/indent-c-macros-as-regular-code-in-emacs/</link>
		<comments>http://kuniganotas.wordpress.com/2011/03/10/indent-c-macros-as-regular-code-in-emacs/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 19:49:17 +0000</pubDate>
		<dc:creator>kunigami</dc:creator>
				<category><![CDATA[emacs]]></category>

		<guid isPermaLink="false">http://kuniganotas.wordpress.com/?p=361</guid>
		<description><![CDATA[Indenting macros as it were regular code, may cause confusion, since macros are not to be considered part of the code. Although, when programming with openmp and its directives (#pragma omp), it&#8217;s annoying to have they indented to the beginning &#8230; <a href="http://kuniganotas.wordpress.com/2011/03/10/indent-c-macros-as-regular-code-in-emacs/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=361&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Indenting macros as it were regular code, may cause confusion, since macros are not to be considered part of the code. Although, when programming with openmp and its directives (#pragma omp), it&#8217;s annoying to have they indented to the beginning of the line, specially because openmp directives may be nested.</p>
<p>So, to change indentation, add the following line to you .emacs configuration file:</p>
<pre class="brush: plain; title: ; notranslate">
(c-set-offset (quote cpp-macro) 0 nil)
</pre>
<p>Source: <a href="http://stackoverflow.com/questions/4669219/indent-preprocessor-directives-as-c-code-in-emacs">http://stackoverflow.com/questions/4669219/indent-preprocessor-directives-as-c-code-in-emacs</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/kuniganotas.wordpress.com/361/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/kuniganotas.wordpress.com/361/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=kuniganotas.wordpress.com&#038;blog=13050037&#038;post=361&#038;subd=kuniganotas&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://kuniganotas.wordpress.com/2011/03/10/indent-c-macros-as-regular-code-in-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c96a203d99d04b22c2c70e136ec0588b?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">kunigami</media:title>
		</media:content>
	</item>
	</channel>
</rss>
