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

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

[elpa] externals/gnorb dfa0043 300/449: Safer usage of cl-subseq


From: Stefan Monnier
Subject: [elpa] externals/gnorb dfa0043 300/449: Safer usage of cl-subseq
Date: Fri, 27 Nov 2020 23:15:59 -0500 (EST)

branch: externals/gnorb
commit dfa0043f231ea07bbde86668903f2d3b270a7e7e
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Safer usage of cl-subseq
    
    * gnorb-org.el (gnorb-org-extract-links): Looks like cl-subseq will
      start throwing errors for END arguments larger than the length of SEQ.
      This is a tidier way of handling it, anyway.
---
 gnorb-org.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnorb-org.el b/gnorb-org.el
index 39fc7c1..b4de033 100644
--- a/gnorb-org.el
+++ b/gnorb-org.el
@@ -177,9 +177,10 @@ we came from."
            (cond ((eq gnorb-org-mail-scan-scope 'all)
                   strings)
                  ((numberp gnorb-org-mail-scan-scope)
-                  (delq nil
-                        (cl-subseq
-                         strings 0 (1+ gnorb-org-mail-scan-scope))))
+                  (cl-subseq
+                   strings 0 (min
+                              (length strings)
+                              (1+ gnorb-org-mail-scan-scope))))
                  ;; We could provide more options here. 'tree vs
                  ;; 'subtree, for instance.
                  (t



reply via email to

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