emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FR] multiple column view definition


From: Slawomir Grochowski
Subject: Re: [FR] multiple column view definition
Date: Tue, 05 Mar 2024 17:40:30 +0100

Ihor Radchenko <yantar92@posteo.net> writes:

> It looks like you are asking for a way to choose between multiple column
> specs when building column view. And that you have a very specific idea
> how to implement it. However, the details of the idea are elusive to me.
> May you elaborate?

Sure.

We have two COLUMNS definition:

* 2024
:PROPERTIES:
:COLUMNS:  %ITEM(B) %TEST(B column)
:COLUMNS:  %ITEM(A) %TEST(A column)
:END:

#+BEGIN: columnview :hlines 1
|    A | A column |
|------+----------|
| 2024 |          |
#+END:

When and run `org-columns' on that heading it will display column view
using :COLUMNS: definition from bottom. ':COLUMNS:  %ITEM(A) %TEST(A column)'. 
The definition on top ':COLUMNS:  %ITEM(B) %TEST(B column)' is ignored. 

The function to get the :COLUMN: definition to display is (org-entry-get nil 
"COLUMNS" t).

Based on that behavior I made a simple function:

(defun org-columns-switch-columns ()
  (interactive)
  (save-excursion
    (org-columns-goto-top-level)
    (re-search-forward ":COLUMNS:")
    (org-metadown)
    (org-columns)))

So it's just to move :COLUMNS: definition from top to bottom. And run
`org-columns'. It works fine. 

The problem is when I want to modify the :COLUMNS: definition.
In e.g.  

* 2024
:PROPERTIES:
:COLUMNS:  %ITEM(B) %TEST(B column)
:COLUMNS:  %ITEM(A) %TEST(A column)
:END:

It will display ':COLUMNS:  %ITEM(A) %TEST(A column)'

#+BEGIN: columnview :hlines 1
|    A | A column |
|------+----------|
| 2024 |  (put cursor here and run org-columns-delete) |
#+END:

It will modify the ':COLUMNS:  %ITEM(B) %TEST(B column)'. 
So :COLUMNS: definition from top not from bottom. 

The function to modify :COLUMNS: definition is (org-entry-put nil "COLUMNS" 
fmt).
So this is the problem.

So in my opinion (org-entry-put nil "COLUMNS" fmt) should modify the
:COLUMNS: definition from bottom (the last one) not from top (the first one).  

Or maybe someone has a better idea how to implement the functionality
'multiple column view definition'? 

-- 
Slawomir Grochowski



reply via email to

[Prev in Thread] Current Thread [Next in Thread]