瀏覽代碼

Merge branch 'maint' of code.orgmode.org:bzg/org-mode into maint

Bastien 7 年之前
父節點
當前提交
6cd224e833
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      lisp/org.el

+ 6 - 4
lisp/org.el

@@ -15090,10 +15090,12 @@ TODO keywords, should these have keys assigned to them.
 If the keys are nil, a-z are automatically assigned.
 Returns the new tags string, or nil to not change the current settings."
   (let* ((fulltable (append table todo-table))
-	 (maxlen (apply 'max (mapcar
-			      (lambda (x)
-				(if (stringp (car x)) (string-width (car x)) 0))
-			      fulltable)))
+	 (maxlen (if (null fulltable) 0
+		   (apply #'max
+			  (mapcar (lambda (x)
+				    (if (stringp (car x)) (string-width (car x))
+				      0))
+				  fulltable))))
 	 (buf (current-buffer))
 	 (expert (eq org-fast-tag-selection-single-key 'expert))
 	 (buffer-tags nil)