Improve pcmpl-rpm-query-options custom type
authorGlenn Morris <rgm@gnu.org>
Fri, 22 Jun 2012 16:00:34 +0000 (09:00 -0700)
committerGlenn Morris <rgm@gnu.org>
Fri, 22 Jun 2012 16:00:34 +0000 (09:00 -0700)
lisp/pcmpl-rpm.el

index 12fce36..4afda82 100644 (file)
         (if (search-forward "--nosignature " nil t)
             (push "--nosignature" opts))))
     opts)
-  "List of extra options to add to an rpm query command."
+  "String, or list of strings, with extra options for an rpm query command."
   :version "24.2"
-  :type '(repeat string)
+  :type '(choice (const :tag "No options" nil)
+                 (string :tag "Single option")
+                 (repeat :tag "List of options" string))
   :group 'pcmpl-rpm)
 
 (defcustom pcmpl-rpm-cache t
@@ -78,7 +80,9 @@
           pcmpl-rpm-packages
           (split-string (apply 'pcomplete-process-result "rpm"
                                (append '("-q" "-a")
-                                       pcmpl-rpm-query-options))))))
+                                       (if (stringp pcmpl-rpm-query-options)
+                                           (list pcmpl-rpm-query-options)
+                                         pcmpl-rpm-query-options)))))))
 
 ;; Should this use pcmpl-rpm-query-options?
 ;; I don't think it would speed it up at all (?).