Thread (14 messages) flat view 14 messages, 4 authors, 2016-06-15

Re: [PATCH v2] completion: add new git_complete helper

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:53:36

(cc-ing the bash-completion-devel list)
Felipe Contreras wrote:
On Mon, Apr 16, 2012 at 11:46 PM, Jonathan Nieder [off-list ref] wrote:
quoted
Felipe Contreras wrote:
quoted
quoted
Now, even if you use the bash completion library, it still does export
functions without a prefix
Are you sure?  "complete" is a bash builtin and has nothing to do with
the bash completion library except that the latter uses it.
I already provided examples:
have(), quote(), dequote(), quote_readline()
Ah, that's what you mean.  Thanks for the pointers, and sorry to have
misunderstood.

There's a little oddity here.  "have" is clearly an unwanted backward
compatibility feature:

	# @deprecated should no longer be used; generally not needed with dynamically
	#             loaded completions, and _have is suitable for runtime use.
	have()
	[...]
	unset -f have
	unset have

But "quote", "dequote", and "quote_readline" do not get the same
treatment.  Perhaps they are for backward compatibility, too, but are
so widely used that there is no hope of ever getting rid of them.

Hopefully this information helps clarify to what extent the leading
underscores in functions exposed by completion scripts are meant or
are not meant as a convention.

Jonathan

_______________________________________________
Bash-completion-devel mailing list
Bash-completion-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-devel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help