File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,7 @@ put it into `kill-ring'."
609
609
(define-key map " ^" 'gist-unstar )
610
610
(define-key map " f" 'gist-fork )
611
611
(define-key map " /p" 'gist-list-push-visibility-limit )
612
+ (define-key map " /t" 'gist-list-push-tag-limit )
612
613
(define-key map " /w" 'gist-list-pop-limit )
613
614
map))
614
615
@@ -642,6 +643,39 @@ put it into `kill-ring'."
642
643
gist-list-limits)
643
644
(gist-list-user 'current-user ))
644
645
646
+ (defun gist-parse-tags (tags )
647
+ (let ((words (split-string tags))
648
+ with without)
649
+ (dolist (w words)
650
+ (cond ((string-prefix-p " +" w)
651
+ (push (substring w 1 ) with))
652
+ ((string-prefix-p " -" w)
653
+ (push (substring w 1 ) without))
654
+ (t
655
+ (push w with))))
656
+ (list with without)))
657
+
658
+ (defun gist-list-push-tag-limit (tags )
659
+ (interactive " sTags: " )
660
+ (let* ((lsts (gist-parse-tags tags))
661
+ (with (car lsts))
662
+ (without (cadr lsts)))
663
+ (push (apply-partially (lambda (with without g )
664
+ (and
665
+ (every (lambda (tag )
666
+ (string-match-p
667
+ (format " #%s \\ > " tag)
668
+ (oref g :description )))
669
+ with)
670
+ (not (some (lambda (tag )
671
+ (string-match-p
672
+ (format " #%s \\ > " tag)
673
+ (oref g :description )))
674
+ without))))
675
+ with without)
676
+ gist-list-limits))
677
+ (gist-list-user 'current-user ))
678
+
645
679
(defun gist-list-apply-limits (gists )
646
680
(condition-case nil
647
681
(delete nil
You can’t perform that action at this time.
0 commit comments