Subject: bug#1027 closed by Chong Yidong <[email-masked]> (Re: 23.0.60; pcomplete/rpm does not complete "rpm -qip filepath")

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#1027: 23.0.60; pcomplete/rpm does not complete "rpm -qip filepath"

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
1027: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1027
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Thu Oct 23 15:09:54 2008
From: Chong Yidong <[email-masked]>
To: Jens Petersen <[email-masked]>
Cc: [email-masked]
Subject: Re: 23.0.60; pcomplete/rpm does not complete "rpm -qip filepath"
Date: Thu, 23 Oct 2008 18:09:54 -0400

> In eshell, pcomplete/rpm does not handle the -p (file) option well
> currently:
>
> eg "rpm -q -p filepath..." completes but not "rpm -qp filepath...".
>
> Here is an improvement which at least checks the first argument for a
> -p option, so that "rpm -qp", "rpm --qp --changelog", etc all file
> complete rather than querying the rpm database.  I think this is good
> enough for now, though strictly all args should be checked for a -p
> option.

Thanks.  I've checked in the patch.

>From [email-masked] Thu Sep 25 17:57:43 2008
Date: Fri, 26 Sep 2008 10:57:30 +1000
From: Jens Petersen <[email-masked]>
To: [email-masked]
Subject: 23.0.60; pcomplete/rpm does not complete "rpm -qip filepath"

Hi,

In eshell, pcomplete/rpm does not handle the -p (file) option well currently:

eg "rpm -q -p filepath..." completes but not "rpm -qp filepath...".

Here is an improvement which at least checks the first argument for a -p option, so that "rpm -qp", "rpm --qp --changelog", etc all file complete rather than querying the rpm database.  I think this is good enough for now, though strictly all args should be checked for a -p option.

Jens

2008-09-26  Jens Petersen  <[email-masked]>

	* pcmpl-rpm.el (pcomplete/rpm): Make "rpm -qp" use file completion.

Index: lisp/pcmpl-rpm.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/pcmpl-rpm.el,v
retrieving revision 1.13
diff -u -r1.13 pcmpl-rpm.el
--- lisp/pcmpl-rpm.el	6 May 2008 07:57:45 -0000	1.13
+++ lisp/pcmpl-rpm.el	26 Sep 2008 00:22:31 -0000
@@ -135,7 +135,9 @@
 		 (pcmpl-rpm-all-query "--requires")))))
 	  (if (pcomplete-match "^-" 0)
 	      (pcomplete-opt "af.p(pcmpl-rpm-files)ilsdcvR")
-	    (pcomplete-here (pcmpl-rpm-packages)))))
+	    (if (pcomplete-test "-[^-]*p" 'first 1)
+		(pcomplete-here (pcmpl-rpm-files))	
+	      (pcomplete-here (pcmpl-rpm-packages))))))
        ((pcomplete-test "--pipe")
 	(pcomplete-here* (funcall pcomplete-command-completion-function)))
        ((pcomplete-test "--rmsource")