<?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>Thu, 15 Mar 2012 05:47:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</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. Sometimes, I like that CScope updates the buffer where I initiated the search to reflect <a href="http://bloggoergosum.com/2008/09/15/dedicated-window-buffer-mapping-with-emacs/"> read more <span class="meta-nav">&#187;</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>
<pre lang="lisp">
;; keybindings
(global-set-key [pause] 'toggle-window-dedicated)

;; buffer dedication (mostly for cscope
(defun toggle-window-dedicated ()
  "Toggle whether the current active window is dedicated"
  (interactive)
  (message
   (if (let (window (get-buffer-window (current-buffer)))
	 (set-window-dedicated-p window
				 (not (window-dedicated-p window))))
     "Window '%s' is dedicated"
     "Window '%s' is normal")
   (current-buffer)))
</pre>
<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>

