summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-12-18 12:07:43 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-12-18 12:07:43 +0100
commit2d9b08b8975847c4a910ef62a9ead4cb8ccc3fd6 (patch)
treeb153237e7a9f133e8eaae79f4ff7cb09a074250d
parent4f0d8a008f866d8da131a5e2a1db3e73134cfe56 (diff)
downloadorg-mode-2d9b08b8975847c4a910ef62a9ead4cb8ccc3fd6.tar.gz
org-colview: Remove asterisks from ITEM in Agenda mode
* lisp/org-colview.el (org-columns--displayed-value): Add new optional argument. (org-columns--collect-values): Use new argument when called from Agenda mode. Reported-by: Allen Li <darkfeline@felesatra.moe> <http://lists.gnu.org/r/emacs-orgmode/2018-12/msg00040.html>
-rw-r--r--lisp/org-colview.el24
1 files changed, 17 insertions, 7 deletions
diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 41abd5f..deab4c8 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -233,21 +233,27 @@ See `org-columns-summary-types' for details.")
"--"
["Quit" org-columns-quit t]))
-(defun org-columns--displayed-value (spec value)
+(defun org-columns--displayed-value (spec value &optional no-star)
"Return displayed value for specification SPEC in current entry.
+
SPEC is a column format specification as stored in
`org-columns-current-fmt-compiled'. VALUE is the real value to
-display, as a string."
+display, as a string.
+
+When NO-STAR is non-nil, do not add asterisks before displayed
+value for ITEM property."
(or (and (functionp org-columns-modify-value-for-display-function)
(funcall org-columns-modify-value-for-display-function
(nth 1 spec) ;column name
value))
(pcase spec
(`("ITEM" . ,_)
- (concat (make-string (1- (org-current-level))
- (if org-hide-leading-stars ?\s ?*))
- "* "
- (org-columns-compact-links value)))
+ (let ((stars
+ (and (not no-star)
+ (concat (make-string (1- (org-current-level))
+ (if org-hide-leading-stars ?\s ?*))
+ "* "))))
+ (concat stars (org-columns-compact-links value))))
(`(,_ ,_ ,_ ,_ nil) value)
;; If PRINTF is set, assume we are displaying a number and
;; obey to the format string.
@@ -280,7 +286,11 @@ possible to override it with optional argument COMPILED-FMT."
(get-text-property (point) 'duration))
'face 'org-warning))
"")))
- (list spec v (org-columns--displayed-value spec v))))))
+ ;; A non-nil COMPILED-FMT means we're calling from Org
+ ;; Agenda mode, where we do not want leading stars for
+ ;; ITEM. Hence the optional argument for
+ ;; `org-columns--displayed-value'.
+ (list spec v (org-columns--displayed-value spec v compiled-fmt))))))
(or compiled-fmt org-columns-current-fmt-compiled))))
(defun org-columns--set-widths (cache)