From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Motz Subject: [PATCH 2/2] org-colview.el: Add property :exclude-tags to column view Date: Sat, 07 Jul 2018 00:17:22 +0200 Message-ID: <87zhz46mbx.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbZ2d-0005IT-4p for emacs-orgmode@gnu.org; Fri, 06 Jul 2018 18:17:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbZ2c-0001q7-4F for emacs-orgmode@gnu.org; Fri, 06 Jul 2018 18:17:27 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35352) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fbZ2b-0001pc-Rk for emacs-orgmode@gnu.org; Fri, 06 Jul 2018 18:17:26 -0400 Received: by mail-wr1-x432.google.com with SMTP id h40-v6so5448892wrh.2 for ; Fri, 06 Jul 2018 15:17:25 -0700 (PDT) Received: from bzuio410 ([2a02:908:df51:3ae0:a09f:4305:27e9:d4e9]) by smtp.gmail.com with ESMTPSA id b1-v6sm12776881wma.23.2018.07.06.15.17.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Jul 2018 15:17:23 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, This addition allows to specify a list of tags to exclude from column view tables. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-org-colview.el-Add-property-exclude-tags-to-column-v.patch Content-Description: patch >From 4ac32c4b24f33b841ad73c4b10158ec7a18087a9 Mon Sep 17 00:00:00 2001 From: Benjamin Motz Date: Wed, 4 Jul 2018 14:27:24 +0200 Subject: [PATCH 2/2] org-colview.el: Add property :exclude-tags to column view table This addition allows to specify a list of tags to exclude from column view tables. TINYCHANGE --- lisp/org-colview.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 70710aa..b769c5f 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -1327,7 +1327,7 @@ and variances (respectively) of the individual estimates." ;;; Dynamic block for Column view -(defun org-columns--capture-view (maxlevel match skip-empty format local) +(defun org-columns--capture-view (maxlevel match skip-empty exclude-tags format local) "Get the column view of the current buffer. MAXLEVEL sets the level limit. SKIP-EMPTY tells whether to skip @@ -1357,9 +1357,13 @@ other rows. Each row is a list of fields, as strings, or 'org-columns-value 'org-columns-value-modified))) row))) - (unless (and skip-empty - (let ((r (delete-dups (remove "" row)))) - (or (null r) (and has-item (= (length r) 1))))) + (unless (or + (and skip-empty + (let ((r (delete-dups (remove "" row)))) + (or (null r) (and has-item (= (length r) 1))))) + (and exclude-tags + (cl-some (lambda (tag) (member tag exclude-tags)) + (org-get-tags)))) (push (cons (org-reduced-level (org-current-level)) (nreverse row)) table))))) (or (and maxlevel (format "LEVEL<=%d" maxlevel)) @@ -1404,6 +1408,8 @@ PARAMS is a property list of parameters: :match When set to a string, use this as a tags/property match filter. :skip-empty-rows When t, skip rows where all specifiers other than ITEM are empty. +:exclude-tags + List of tags to exclude from column view table. :format When non-nil, specify the column view format to use." (let ((table (let ((id (plist-get params :id)) @@ -1429,6 +1435,7 @@ PARAMS is a property list of parameters: (org-columns--capture-view (plist-get params :maxlevel) (plist-get params :match) (plist-get params :skip-empty-rows) + (plist-get params :exclude-tags) (plist-get params :format) view-pos)))))) (when table -- 2.7.4 --=-=-= Content-Type: text/plain Best regards, Benjamin Motz --=-=-=--