From ea6825cf1f3c2f4e43c81424ac115ef76e5698d1 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 26 Apr 2018 13:52:19 +0200 Subject: [PATCH 1/2] Improve docstring * lisp/org.el (org-set-tags-command): Improve docstring. --- lisp/org.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 1cf2d2700..a56c59585 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14226,9 +14226,10 @@ Assume point is on a headline." (defun org-set-tags-command (&optional arg) "Set the tags for the current visible entry. -When called with `\\[universal-argument]' prefix argument ARG, -realign all tags in headings in the current buffer. If a region -is active, set tags for all headlines in the region. +When called with `\\[universal-argument]' prefix argument ARG, \ +realign all tags +in the current buffer. If a region is active, set tags for +all headlines in the region. This function is for interactive use only; in Lisp code use `org-set-tags' instead." From e2e5495239833034c27de6f21c496fa1b05f5d85 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 26 Apr 2018 14:16:17 +0200 Subject: [PATCH 2/2] Fix "(wrong-number-of-arguments max 0)" with fast tag selection * lisp/org.el (org-fast-tag-selection): Fix "(wrong-number-of-arguments max 0)" error when setting tag and no tag is defined. --- lisp/org.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 600693ba3..7ed65a680 100644 --- a/lisp/org.el +++ b/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)