emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/repology 41b9dd46c7 4/5: repology: Allow strings in sor


From: Nicolas Goaziou
Subject: [elpa] externals/repology 41b9dd46c7 4/5: repology: Allow strings in sort keys
Date: Tue, 22 Feb 2022 05:20:00 -0500 (EST)

branch: externals/repology
commit 41b9dd46c7cb82067f9089a46580733d20bba81d
Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Commit: Nicolas Goaziou <mail@nicolasgoaziou.fr>

    repology: Allow strings in sort keys
    
    * repology.el (repology--display-sort-key): Allow string sort key.
    (repology-display-problems-sort-key):
    (repology-display-packages-sort-key):
    (repology-display-projects-sort-key): Update docstring.
---
 repology.el | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/repology.el b/repology.el
index 36f8b89c6b..bbdaee07c7 100644
--- a/repology.el
+++ b/repology.el
@@ -78,7 +78,7 @@
 ;; (setq repology-outdated-project-definition
 ;;       '(("emacs:circe" "<=2.11" nil)
 ;;         ("emacs:erlang" nil nil))
-;;       repology-display-projects-sort-key '("Project" . nil))
+;;       repology-display-projects-sort-key "Project")
 ;;
 ;;    (let ((repo "gnuguix"))
 ;;      (repology-display-projects
@@ -245,6 +245,9 @@ a string matching one of the column names in
 `repology-display-problems-columns'.  FLIP, if non-nil, means to
 invert the resulting sort.
 
+Alternatively, it can be a string matching a valid column name.
+In that case, FLIP is considered as nil.
+
 If the key name doesn't match any column name, no sorting is
 initially done."
   :type
@@ -304,6 +307,9 @@ a string matching one of the column names in
 `repology-display-packages-columns'.  FLIP, if non-nil, means to
 invert the resulting sort.
 
+Alternatively, it can be a string matching a valid column name.
+In that case, FLIP is considered as nil.
+
 If the key name doesn't match any column name, no sorting is
 initially done."
   :type
@@ -355,6 +361,9 @@ a string matching one of the column names in
 `repology-display-projects-columns'.  FLIP, if non-nil, means to
 invert the resulting sort.
 
+Alternatively, it can be a string matching a valid column name.
+In that case, FLIP is considered as nil.
+
 If the key name doesn't match any column name, no sorting is
 initially done."
   :type
@@ -732,10 +741,11 @@ exist.
 
 This function assumes `tabulated-list-format' is set already."
   (pcase key-pair
-    (`(,name . ,_)
-     (let ((columns (mapcar #'car tabulated-list-format)))
+    ((or (and (pred stringp) name) `(,name . ,flip))
+     (let ((columns (mapcar #'car tabulated-list-format))
+           (flip (bound-and-true-p flip))) ;not defined when string
        (and (member name columns)
-            key-pair)))
+            (cons name flip))))
     (_ nil)))
 
 (define-derived-mode repology--display-package-mode tabulated-list-mode



reply via email to

[Prev in Thread] Current Thread [Next in Thread]