unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9643: 24.0.90; pcomplete/tar and complete-within
@ 2011-10-01  0:05 Per Starbäck
  2011-10-01  2:39 ` Glenn Morris
  0 siblings, 1 reply; 3+ messages in thread
From: Per Starbäck @ 2011-10-01  0:05 UTC (permalink / raw)
  To: 9643

    $ touch foo bar
    $ tar cf test.tar foo bar
    $ emacs -Q -f shell
    tar xf test. TAB

yields

    Error in post-command-hook (completion-in-region--postch):
    (wrong-type-argument listp [tar-header #<marker at 513 in  *tar-data
    test.tar*> foo 436 324 324 0 (20102 20143) 5077 nil  ustar  starback
    starback 0 0 nil])

I expected getting a completion of ".tar " to my command.

Reason: pcomplete/tar in pcmpl-gnu.el has an erroneous notion of how
tar-parse-info entries look like.

With this fix the example above will work, and it can complete "foo" and
"bar" inside the tar file as arguments after "test.tar":

----------------------------------------------------------------------
$ diff -u pcmpl-gnu.el~ pcmpl-gnu.el
--- pcmpl-gnu.el~	2011-01-26 17:16:33.000000000 +0100
+++ pcmpl-gnu.el	2011-10-01 01:24:45.000000000 +0200
@@ -298,7 +298,7 @@
 		  (mapcar
 		   (function
 		    (lambda (entry)
-		      (tar-header-name (cdr entry))))
+		      (tar-header-name entry)))
 		   tar-parse-info))
 	      (pcomplete-entries))
 	    nil 'identity))))
----------------------------------------------------------------------

I don't totally like this anyway. I get an extra buffer for "test.tar"
even though I never explicitly opened the file.

Next problem, also in "*shell*", when I have a large tar file,
in this case emacs-24.0.90.tar.gz:

    tar xf emacs-24.0.90.t TAB

yields (with the patch above) completion and a question

    File emacs-24.0.90.tar.gz is large (48MB), really open? (y or n)

This was what I first encountered, and not knowing about pcomplete
beforehand I was really surprised, as I had no intention of opening that
file in Emacs. Even if I had known about it I wouldn't have liked
this. I was only trying to complete the tar filename!

* In both my examples I'm trying to complete the tar filename, and it
  looked inside it to prepare for doing completion of arguments after
  this. If it only opened the tar file if I actually tried to complete
  more arguments *after* the tar filename it would be a lot better.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-10-02  1:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-01  0:05 bug#9643: 24.0.90; pcomplete/tar and complete-within Per Starbäck
2011-10-01  2:39 ` Glenn Morris
2011-10-02  1:01   ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).