From: "Michaël Cadilhac" <michael@cadilhac.name>
To: Adam Porter <adam@alphapapa.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [Patch] Hide the file column in a clock report.
Date: Sat, 2 Sep 2017 10:14:50 +0100 [thread overview]
Message-ID: <CADt3fpPJkHj3mir4np6_+YFAE6B9s+n8oVWCC2L8th-OGoOGDw@mail.gmail.com> (raw)
In-Reply-To: <87shg5hmdf.fsf@alphapapa.net>
[-- Attachment #1: Type: text/plain, Size: 673 bytes --]
On 2 September 2017 at 03:20, Adam Porter <adam@alphapapa.net> wrote:
> One suggestion:
>
> +:hidefiles @r{Should the file column be hidden when multiple files are parsed?}
>
> It would be clearer if it said something like, "Hide file column when
> multiple files are parsed." The other options mentioned there are
> written like that, not as questions. :)
While I definitely agree that question form is weird, I copied it from
the ":level" option (arguably without thinking twice) which reads:
:level @r{Should a level number column be included?}
In any case, let's not repeat that oddity :-) I've changed the patch
according to your suggestion.
Cheers;
M.
[-- Attachment #2: 0001-Add-the-option-of-hiding-the-file-column-in-a-clock-.patch --]
[-- Type: text/x-patch, Size: 3754 bytes --]
From f251bf0fa764e245eabe88e3959e801af5c8fd37 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C3=ABl=20Cadilhac?= <michael@cadilhac.name>
Date: Thu, 31 Aug 2017 19:37:55 +0100
Subject: [PATCH] Add the option of hiding the file column in a clock report
* contrib/orgmanual.org: Document the change.
* doc/org.texi (The clock table): Ditto.
* lisp/org-clock.el (org-clocktable-defaults): Add default value for
:hidefiles.
(org-dblock-write:clocktable): Do not make "multiline" true if
hidefiles is.
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/clocktable):
Add :hidefiles to completions.
TINYCHANGE
---
contrib/orgmanual.org | 4 ++++
doc/org.texi | 1 +
lisp/org-clock.el | 5 ++++-
lisp/org-pcomplete.el | 5 +++--
4 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/contrib/orgmanual.org b/contrib/orgmanual.org
index 6cc88a86e..e184fb51d 100644
--- a/contrib/orgmanual.org
+++ b/contrib/orgmanual.org
@@ -6253,6 +6253,10 @@ but you can specify your own function using the ~:formatter~ parameter.
Indent each headline field according to its level.
+- :hidefiles ::
+
+ Hide the file column when multiple files are used to produced the table.
+
- :tcolumns ::
Number of columns to be used for times. If this is smaller than
diff --git a/doc/org.texi b/doc/org.texi
index a74f967f5..2c2f8d0cc 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -6689,6 +6689,7 @@ but you can specify your own function using the @code{:formatter} parameter.
@r{the org table. If you write it like @samp{50!}, then the}
@r{headline will also be shortened in export.}
:indent @r{Indent each headline field according to its level.}
+:hidefiles @r{Hide file column when multiple files are parsed.}
:tcolumns @r{Number of columns to be used for times. If this is smaller}
@r{than @code{:maxlevel}, lower levels will be lumped into one column.}
:level @r{Should a level number column be included?}
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 6b967c673..05c46e18c 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -298,6 +298,7 @@ string as argument."
:link nil
:narrow '40!
:indent t
+ :hidefiles nil
:formula nil
:timestamp nil
:level nil
@@ -2391,6 +2392,7 @@ the currently selected interval size."
(ws (plist-get params :wstart))
(ms (plist-get params :mstart))
(step (plist-get params :step))
+ (hide-files (plist-get params :hidefiles))
(formatter (or (plist-get params :formatter)
org-clock-clocktable-formatter
'org-clocktable-write-default))
@@ -2445,7 +2447,8 @@ the currently selected interval size."
;; Even though `file-with-archives' can consist of
;; multiple files, we consider this is one extended file
;; instead.
- (and (consp files) (not (eq scope 'file-with-archives)))))
+ (and (not hide-files)
+ (consp files) (not (eq scope 'file-with-archives)))))
(funcall formatter
origin
diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el
index 61ec5fad4..a92b44cb2 100644
--- a/lisp/org-pcomplete.el
+++ b/lisp/org-pcomplete.el
@@ -374,8 +374,9 @@ Complete a language in the first field, the header arguments and switches."
":tstart" ":tend" ":block" ":step"
":stepskip0" ":fileskip0"
":emphasize" ":link" ":narrow" ":indent"
- ":tcolumns" ":level" ":compact" ":timestamp"
- ":formula" ":formatter" ":wstart" ":mstart"))))
+ ":hidefiles" ":tcolumns" ":level" ":compact"
+ ":timestamp" ":formula" ":formatter"
+ ":wstart" ":mstart"))))
(defun org-pcomplete-case-double (list)
"Return list with both upcase and downcase version of all strings in LIST."
--
2.14.1
next prev parent reply other threads:[~2017-09-02 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-31 18:44 [Patch] Hide the file column in a clock report Michaël Cadilhac
2017-09-02 2:20 ` Adam Porter
2017-09-02 9:14 ` Michaël Cadilhac [this message]
2017-09-03 1:11 ` Adam Porter
2017-09-03 8:15 ` Nicolas Goaziou
2019-08-28 23:25 ` Michaël Cadilhac
2019-09-05 16:58 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADt3fpPJkHj3mir4np6_+YFAE6B9s+n8oVWCC2L8th-OGoOGDw@mail.gmail.com \
--to=michael@cadilhac.name \
--cc=adam@alphapapa.net \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.