<?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/"
	>

<channel>
	<title>bloggo ergo sum &#187; Emacs</title>
	<atom:link href="http://bloggoergosum.com/tag/emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://bloggoergosum.com</link>
	<description></description>
	<lastBuildDate>Sun, 14 Mar 2010 21:13:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dedicated window-buffer mapping with Emacs</title>
		<link>http://bloggoergosum.com/2008/09/15/dedicated-window-buffer-mapping-with-emacs/</link>
		<comments>http://bloggoergosum.com/2008/09/15/dedicated-window-buffer-mapping-with-emacs/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 02:32:45 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://bloggoergosum.com/?p=337</guid>
		<description><![CDATA[I use CScope to navigate source code from within Emacs. It&#8217;s very, very useful and integrates will into Emacs. However, I&#8217;ve been wanting a way to control how cscope updates the buffer/window mappings as it locates search results for you. &#8230; <a href="http://bloggoergosum.com/2008/09/15/dedicated-window-buffer-mapping-with-emacs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I use CScope to navigate source code from within Emacs.  It&#8217;s very, very useful and integrates will into Emacs.  However, I&#8217;ve been wanting a way to control how cscope updates the buffer/window mappings as it locates search results for you.  Sometimes, I like that CScope updates the buffer where I initiated the search to reflect the results, and it&#8217;s easy to get back to the point of origin using the C-c s u command.  </p>
<p>However, sometimes I want CScope to leave my origin buffer alone and show the result location in another window so I can see both at the same time.  It&#8217;s bothersome to have to arrange the buffers manually after performing a search, so I asked on <a href="http://stackoverflow.com/questions/43765/pin-emacs-buffers-to-windows-for-cscope#65992">stackoverflow.com</a>, and voila!  I got a good answer &#8211; create a simple keybinding to a function for dedicating a window/buffer mapping:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">;; keybindings</span>
<span style="color: #66cc66;">&#40;</span>global-set-key <span style="color: #66cc66;">&#91;</span>pause<span style="color: #66cc66;">&#93;</span> 'toggle-window-dedicated<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">;; buffer dedication (mostly for cscope</span>
<span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">defun</span> toggle-window-dedicated <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #ff0000;">&quot;Toggle whether the current active window is dedicated&quot;</span>
  <span style="color: #66cc66;">&#40;</span>interactive<span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#40;</span>message
   <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">let</span> <span style="color: #66cc66;">&#40;</span>window <span style="color: #66cc66;">&#40;</span>get-buffer-window <span style="color: #66cc66;">&#40;</span>current-buffer<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	 <span style="color: #66cc66;">&#40;</span>set-window-dedicated-p window
				 <span style="color: #66cc66;">&#40;</span><span style="color: #b1b100;">not</span> <span style="color: #66cc66;">&#40;</span>window-dedicated-p window<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
     <span style="color: #ff0000;">&quot;Window '%s' is dedicated&quot;</span>
     <span style="color: #ff0000;">&quot;Window '%s' is normal&quot;</span><span style="color: #66cc66;">&#41;</span>
   <span style="color: #66cc66;">&#40;</span>current-buffer<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Now, using this, I can just hit the pause button on my keyboard when I want to pin down my main source buffer.</p>
]]></content:encoded>
			<wfw:commentRss>http://bloggoergosum.com/2008/09/15/dedicated-window-buffer-mapping-with-emacs/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
