<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PComplete: Context-Sensitive Completion in Emacs</title>
	<atom:link href="http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/</link>
	<description>a blog about mastering the world&#039;s best text editor</description>
	<lastBuildDate>Fri, 17 May 2013 21:26:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jisang Yoo</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-13892</link>
		<dc:creator>Jisang Yoo</dc:creator>
		<pubDate>Sun, 26 Aug 2012 15:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-13892</guid>
		<description><![CDATA[In the body of pcmpl-git-get-refs, you are using add-to-list with a local list variable for accumulation. This practice has two problems. One problem is that when the parameter name that add-to-list internally uses to hold the list variable symbol and the local list variable name that the user of add-to-list uses for accumulation is same, surprise happens:

(let ((list-var (list 1 2 3))) (add-to-list (quote list-var) 0) list-var) ; =&gt; (1 2 3)

Another problem is that when someone copy and paste your definition of pcmpl-git-get-refs into an el file which happens to be lexically scoped, he/she will find that every call of pcmpl-git-get-refs causes error: &quot;Symbol&#039;s value as variable is void: ref-list&quot;

Quoting a local variable name is what&#039;s causing these gotchas. I am going to write an article about this, but let me just shortly mention here two ways to avoid quoting the accumulating list variable.

One way is to define and use a macro version, add-to-list-q, of add-to-list:

(add-to-list-q ref-list (match-string 1))

The second way is to define and use a function, added-to-list, that returns the resulting list:

(setq ref-list (added-to-list ref-list (match-string 1)))]]></description>
		<content:encoded><![CDATA[<p>In the body of pcmpl-git-get-refs, you are using add-to-list with a local list variable for accumulation. This practice has two problems. One problem is that when the parameter name that add-to-list internally uses to hold the list variable symbol and the local list variable name that the user of add-to-list uses for accumulation is same, surprise happens:</p>
<p>(let ((list-var (list 1 2 3))) (add-to-list (quote list-var) 0) list-var) ; =&gt; (1 2 3)</p>
<p>Another problem is that when someone copy and paste your definition of pcmpl-git-get-refs into an el file which happens to be lexically scoped, he/she will find that every call of pcmpl-git-get-refs causes error: &#8220;Symbol&#8217;s value as variable is void: ref-list&#8221;</p>
<p>Quoting a local variable name is what&#8217;s causing these gotchas. I am going to write an article about this, but let me just shortly mention here two ways to avoid quoting the accumulating list variable.</p>
<p>One way is to define and use a macro version, add-to-list-q, of add-to-list:</p>
<p>(add-to-list-q ref-list (match-string 1))</p>
<p>The second way is to define and use a function, added-to-list, that returns the resulting list:</p>
<p>(setq ref-list (added-to-list ref-list (match-string 1)))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mickey</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-10390</link>
		<dc:creator>mickey</dc:creator>
		<pubDate>Tue, 12 Jun 2012 20:47:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-10390</guid>
		<description><![CDATA[Thanks for writing the module, John!]]></description>
		<content:encoded><![CDATA[<p>Thanks for writing the module, John!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Wiegley</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-10363</link>
		<dc:creator>John Wiegley</dc:creator>
		<pubDate>Mon, 11 Jun 2012 23:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-10363</guid>
		<description><![CDATA[Great article!  Thanks for providing users with such a nice introduction to pcomplete&#039;s functionality.]]></description>
		<content:encoded><![CDATA[<p>Great article!  Thanks for providing users with such a nice introduction to pcomplete&#8217;s functionality.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo Alekseyev</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-6953</link>
		<dc:creator>Leo Alekseyev</dc:creator>
		<pubDate>Sun, 26 Feb 2012 19:25:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-6953</guid>
		<description><![CDATA[Umm, hitting TAB repeatedly (note to self: don&#039;t use HTML-like delimiters in comments :)  )]]></description>
		<content:encoded><![CDATA[<p>Umm, hitting TAB repeatedly (note to self: don&#8217;t use HTML-like delimiters in comments <img src='http://www.masteringemacs.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo Alekseyev</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-6952</link>
		<dc:creator>Leo Alekseyev</dc:creator>
		<pubDate>Sun, 26 Feb 2012 19:23:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-6952</guid>
		<description><![CDATA[Your post seems to suggest that eshell-style completion works with M-x shell out-of-the-box now, but I don&#039;t see it in Emacs 24.0.93.  For instance, if I have a few directories starting with &quot;a&quot;, in eshell I type cd a and hitting  repeatedly cycles me through the options.  In M-x shell, it pops up the completion buffer, as before.

This is the main reason that I still turn to an external terminal for my bash needs -- bash completion is pretty great, and I&#039;d love to see a semblance of it in Emacs.]]></description>
		<content:encoded><![CDATA[<p>Your post seems to suggest that eshell-style completion works with M-x shell out-of-the-box now, but I don&#8217;t see it in Emacs 24.0.93.  For instance, if I have a few directories starting with &#8220;a&#8221;, in eshell I type cd a and hitting  repeatedly cycles me through the options.  In M-x shell, it pops up the completion buffer, as before.</p>
<p>This is the main reason that I still turn to an external terminal for my bash needs &#8212; bash completion is pretty great, and I&#8217;d love to see a semblance of it in Emacs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Completion for GHCi commands in Emacs &#171; Oleksandr Manzyuk&#039;s Blog</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-6410</link>
		<dc:creator>Completion for GHCi commands in Emacs &#171; Oleksandr Manzyuk&#039;s Blog</dc:creator>
		<pubDate>Sat, 04 Feb 2012 21:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-6410</guid>
		<description><![CDATA[[...] Furthermore, it allows one to relatively easily add completion for new commands. For example, this post shows how to add rudimentary completion for git commands in shell and eshell. Drawing inspiration [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Furthermore, it allows one to relatively easily add completion for new commands. For example, this post shows how to add rudimentary completion for git commands in shell and eshell. Drawing inspiration [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorge</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-6040</link>
		<dc:creator>Jorge</dc:creator>
		<pubDate>Wed, 25 Jan 2012 20:58:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-6040</guid>
		<description><![CDATA[Thank you for this post. Is there something that can be done so that if you start with sudo, the default completion starts. Right now sudo completes for names of files in the folder.]]></description>
		<content:encoded><![CDATA[<p>Thank you for this post. Is there something that can be done so that if you start with sudo, the default completion starts. Right now sudo completes for names of files in the folder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrei</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-5936</link>
		<dc:creator>Andrei</dc:creator>
		<pubDate>Sun, 22 Jan 2012 18:30:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-5936</guid>
		<description><![CDATA[Yes, sorry, I meant to ask if it would be feasible to do. &lt;a href=&quot;http://www.emacswiki.org/emacs/AutoComplete&quot; rel=&quot;nofollow&quot;&gt;auto-complete&lt;/a&gt; can help implement completion in a simpler way than full-blown Semantic/CEDET support, which is quite more complicated to implement.]]></description>
		<content:encoded><![CDATA[<p>Yes, sorry, I meant to ask if it would be feasible to do. <a href="http://www.emacswiki.org/emacs/AutoComplete" rel="nofollow">auto-complete</a> can help implement completion in a simpler way than full-blown Semantic/CEDET support, which is quite more complicated to implement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave F</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-5812</link>
		<dc:creator>Dave F</dc:creator>
		<pubDate>Wed, 18 Jan 2012 06:57:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-5812</guid>
		<description><![CDATA[Great general purpose tip, thanks.

As for bash completion that git has, perhaps we can glue it in, but pcomplete seems like it&#039;s a more general solution that I could expand to add all my custom SQL commands accumulated over the years. Some of these commands depend on current schemas that can be obtained from the backend by pcomplete.]]></description>
		<content:encoded><![CDATA[<p>Great general purpose tip, thanks.</p>
<p>As for bash completion that git has, perhaps we can glue it in, but pcomplete seems like it&#8217;s a more general solution that I could expand to add all my custom SQL commands accumulated over the years. Some of these commands depend on current schemas that can be obtained from the backend by pcomplete.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brendan Miller</title>
		<link>http://www.masteringemacs.org/articles/2012/01/16/pcomplete-context-sensitive-completion-emacs/#comment-5806</link>
		<dc:creator>Brendan Miller</dc:creator>
		<pubDate>Wed, 18 Jan 2012 00:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.masteringemacs.org/?p=536#comment-5806</guid>
		<description><![CDATA[Actually, bash can complete remote filenames with scp. My understanding is that&#039;s it&#039;s completion mechanism is pretty general purpose and extensible.

That said, I&#039;ve always found bash scp completion to be kind of slow and flakey.]]></description>
		<content:encoded><![CDATA[<p>Actually, bash can complete remote filenames with scp. My understanding is that&#8217;s it&#8217;s completion mechanism is pretty general purpose and extensible.</p>
<p>That said, I&#8217;ve always found bash scp completion to be kind of slow and flakey.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
