emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: numbchild@gmail.com
Cc: Samim Pezeshki <p.samim@gmail.com>,
	 emacs-orgmode@gnu.org,  Nicolas Goaziou <mail@nicolasgoaziou.fr>
Subject: [PATCH] Re: [ISSUE] Re: [PATCH] lisp/org-agenda.el: Add header to agenda clock report table
Date: Mon, 09 May 2022 20:38:56 +0800	[thread overview]
Message-ID: <877d6u3mov.fsf@localhost> (raw)
In-Reply-To: <PAXPR08MB6640274350AC08560F866661A3229@PAXPR08MB6640.eurprd08.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

"Christopher M. Miles" <numbchild@gmail.com> writes:

> I tested this commit, it should auto append a newline character after
> ~org-agenda-clock-report-header~. Otherwise the header line will in same line with table first line.

Reasonable concern.
The attached patch should fix it.

Best,
Ihor


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-Make-sure-that-clock-report-header-has-tr.patch --]
[-- Type: text/x-patch, Size: 1396 bytes --]

From c918d5097af4ca82e381cc7a45efccebadf22e91 Mon Sep 17 00:00:00 2001
Message-Id: <c918d5097af4ca82e381cc7a45efccebadf22e91.1652099867.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Mon, 9 May 2022 20:35:18 +0800
Subject: [PATCH] org-agenda: Make sure that clock report header has trailing
 newline

* lisp/org-agenda.el (org-agenda-list): Add trailing newline to
`org-agenda-clock-report-header' if there is none.
---
 lisp/org-agenda.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9d38b889d..3a795ef74 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4486,8 +4486,10 @@ (defun org-agenda-list (&optional arg start-day span with-hour)
 	  (setq p (plist-put p :tend clocktable-end))
 	  (setq p (plist-put p :scope 'agenda))
 	  (setq tbl (apply #'org-clock-get-clocktable p))
-    (when org-agenda-clock-report-header
-      (insert (propertize org-agenda-clock-report-header 'face 'org-agenda-structure)))
+          (when org-agenda-clock-report-header
+            (insert (propertize org-agenda-clock-report-header 'face 'org-agenda-structure))
+            (unless (string-suffix-p "\n" org-agenda-clock-report-header)
+              (insert "\n")))
 	  (insert tbl)))
       (goto-char (point-min))
       (or org-agenda-multi (org-agenda-fit-window-to-buffer))
-- 
2.35.1


  reply	other threads:[~2022-05-09 12:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  9:26 [PATCH] lisp/org-agenda.el: Add header to agenda clock report table Samim Pezeshki
2022-01-10 10:27 ` Christopher M. Miles
2022-01-21  9:13   ` Samim Pezeshki
2022-01-21 10:28 ` Nicolas Goaziou
2022-01-22 16:24   ` Samim Pezeshki
2022-01-26 20:08     ` Nicolas Goaziou
2022-01-28  9:01     ` [ISSUE] " Christopher M. Miles
2022-05-09 12:38       ` Ihor Radchenko [this message]
2022-07-11  5:03         ` [PATCH] " Ihor Radchenko

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877d6u3mov.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    --cc=numbchild@gmail.com \
    --cc=p.samim@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).