all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: Alexander Adolf <alexander.adolf@condition-alpha.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: columnview dynamic block - different time summing behaviour for EFFORT and CLOCKSUM
Date: Tue, 23 Apr 2024 11:28:52 +0000	[thread overview]
Message-ID: <87zftkpbbf.fsf@localhost> (raw)
In-Reply-To: <117e93f189241f4800af207ce30aa606@condition-alpha.com>

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

Alexander Adolf <alexander.adolf@condition-alpha.com> writes:

> Ihor Radchenko <yantar92@posteo.net> writes:
>
>> [...]
>> Calling `org-columns--clean-item' is a must to create a valid table.
>
> True.
>
> Additionally, it would seem advisable to call `org-quote-vert' on the
> data, too, as `org-columns--clean-item' does not take care of vertical
> bars? This is done in a previous step in `org-columns--capture-view',
> however, so that the vertical bars get converted to "\vert" before the
> formatting function gets called.
>
> `org-link-heading-search-string', and `org-link-make-string' (both
> called from the formatting function _after_ `org-columns--clean-item')
> OTOH take care of the link's path and description parts being
> appropriate for a link.

It would make sense then to include `org-quote-vert' call into
`org-columns--clean-item' then.

> Kindly find updated patches below. I hope to have succeeded in
> addressing all your comments; that was my intention at least.

Thanks!

>  (defun org-columns--capture-view (maxlevel match skip-empty exclude-tags format local)
>    "Get the column view of the current buffer.
>...
> +When LOCAL is non-nil, only capture headings in current subtree.  When
> +LINK is non-nil, item headlines will be linked to their origins.

Looks like you removed the LINK parameter, but forgot to remove its
description from the docstring.
  
> +			       (let ((search (org-link-heading-search-string raw)))
> +				 (org-link-make-string
> +				  (if (not (buffer-file-name)) search
> +				    (format "file:%s::%s" (buffer-file-name) search))
> +				  cleaned))

This will unconditionally generate file: links, even when the dynamic
block only refers to headings in the same buffer. The clock tables do
use internal links when appropriate (see `org-clock-get-table-data').

I am attaching a patch containing test case making sure that internal
links are generated when appropriate. The test case is failing with
the latest version of your patch.

If you can, please add some more tests like mine checking
`org-columns--clean-item'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-colview-Add-test-for-the-new-link-parameter.patch --]
[-- Type: text/x-patch, Size: 1352 bytes --]

From 3961072d80883aef5da21d8d6ba10213778ff32f Mon Sep 17 00:00:00 2001
Message-ID: <3961072d80883aef5da21d8d6ba10213778ff32f.1713871396.git.yantar92@posteo.net>
From: Ihor Radchenko <yantar92@posteo.net>
Date: Tue, 23 Apr 2024 14:22:44 +0300
Subject: [PATCH] org-colview: Add test for the new :link parameter

* testing/lisp/test-org-colview.el (test-org-colview/dblock): New
test case.
---
 testing/lisp/test-org-colview.el | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index 7f0aa763e..872a61753 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -1422,6 +1422,18 @@ (ert-deftest test-org-colview/dblock ()
         "* H\n:PROPERTIES:\n:A: 1\n:END:\n<point>#+BEGIN: columnview\n#+END:"
       (let ((org-columns-default-format "%ITEM %A")) (org-update-dblock))
       (buffer-substring-no-properties (point) (point-max)))))
+  ;; Test `:link' parameter.
+  (should
+   (equal
+    "#+BEGIN: columnview
+| ITEM |
+|------|
+| [[*H][H]]    |
+#+END:"
+    (org-test-with-temp-text
+        "* H\n<point>#+BEGIN: columnview\n#+END:"
+      (let ((org-columns-default-format "%ITEM")) (org-update-dblock))
+      (buffer-substring-no-properties (point) (point-max)))))
   ;; Test column widths.
   (should
    (equal
-- 
2.44.0


[-- Attachment #3: Type: text/plain, Size: 224 bytes --]


-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

  reply	other threads:[~2024-04-23 11:29 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08 21:08 columnview dynamic block - different time summing behaviour for EFFORT and CLOCKSUM Alexander Adolf
2024-04-11 13:44 ` Ihor Radchenko
2024-04-12 12:13   ` Alexander Adolf
2024-04-13 14:19     ` Ihor Radchenko
2024-04-13 16:37       ` Alexander Adolf
2024-04-13 16:55         ` Ihor Radchenko
2024-04-15 16:46           ` Alexander Adolf
2024-04-19 10:49             ` Ihor Radchenko
2024-04-19 15:35               ` Alexander Adolf
2024-04-19 17:09                 ` Ihor Radchenko
2024-04-20 14:30                   ` Alexander Adolf
2024-04-21 13:42                     ` Ihor Radchenko
2024-04-22 20:41                       ` Alexander Adolf
2024-04-23 11:28                         ` Ihor Radchenko [this message]
2024-04-23 16:27                           ` Alexander Adolf
2024-04-23 16:35                             ` Ihor Radchenko
2024-04-24 17:29                               ` Alexander Adolf
2024-04-26 12:21                                 ` Ihor Radchenko
2024-04-26 12:38                                   ` Bastien Guerry
2024-04-26 12:47                                     ` Ihor Radchenko
2024-04-26 16:07                                       ` Alexander Adolf
2024-04-28 13:13                                         ` Ihor Radchenko
2024-04-19 17:26               ` Alexander Adolf
2024-04-24 10:51             ` FAILED test-ob-shell/bash-uses-assoc-arrays Max Nikulin
2024-04-24 12:54               ` Ihor Radchenko
2024-04-24 16:04                 ` Max Nikulin
2024-04-26 11:08                   ` Ihor Radchenko
2024-04-26 16:41                     ` Max Nikulin
2024-04-28 13:11                       ` Ihor Radchenko
2024-05-02 10:20                         ` [PATCH] test-ob-shell.el: Skip based on feature detection Max Nikulin
2024-05-02 12:57                           ` Ihor Radchenko
2024-05-02 12:09             ` columnview dynamic block - different time summing behaviour for EFFORT and CLOCKSUM Ihor Radchenko
2024-05-02 12:36               ` Alexander Adolf
2024-05-02 12:59                 ` 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

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

  git send-email \
    --in-reply-to=87zftkpbbf.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=alexander.adolf@condition-alpha.com \
    --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.