Browse Source

org-reload: bugfix when first element of features is nil

* lisp/org.el (org-reload): Let-bind features and make sure to use the
  result of delq and not just the side-effects.  Otherwise a
  spurious (nil ...) remains at the beginning of the list and leads to
  a spurious warning about a possible reload error.

Thanks to Rainer M. Krug for reporting this.
Achim Gratz 5 years ago
1 changed files with 10 additions and 8 deletions
  1. 10 8

+ 10 - 8

@@ -20006,16 +20006,18 @@ With prefix arg UNCOMPILED, load the uncompiled versions."
 		      (if (featurep 'xemacs) "org-colview" "org-colview-xemacs")
 		      "^org$" "^org-infojs$" "^org-loaddefs$" "^org-version$")
+	 (feats features)
 	 (lfeat (append
-		  (delq nil (mapcar
-			     (lambda (f)
-			       (let ((feature (symbol-name f)))
-				 (if (and (string-match feature-re feature)
-					  (not (string-match remove-re feature)))
-				     feature nil)))
-			     features))
-		  'string-lessp)
+		  (setq feats
+			(delq nil (mapcar
+				   (lambda (f)
+				     (let ((feat (symbol-name f)))
+				       (if (and (string-match feature-re feat)
+						(not (string-match remove-re feat)))
+					   feat nil)))
+				   feats)))
+			'string-lessp)
 		 (list "org-version" "org")))
 	 (load-suffixes (if uncompiled (reverse load-suffixes) load-suffixes))
 	 (load-misses ()))