emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FR] multiple column view definition
@ 2024-03-04 15:50 Slawomir Grochowski
  2024-03-05 12:41 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Slawomir Grochowski @ 2024-03-04 15:50 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: t_leitner

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

Dear All,

Recently I started using multiple column view definition in org-columns. 

In e.g. I have calendar 'date tree' and I can switch between 3 views:
 
 1. dosage of medications
 2. exercise in e.g how many push ups daily
 3. some other statistics like weight or number of pomodoros daily  

#+begin_src org
   `* 2024        
   :PROPERTIES:
   :COLUMNS:  %40ITEM(item) %OMEGA-3-1000(omega 3){+} %MULTIVITAMIN(multivitamin){+}
   :COLUMNS:  %40ITEM(item) %PUSHUP(pushup){+} %CRUNCH(crunch){+} %BIRDIE(birdie){+} %LYING-LEG-RAISE(lying leg raise){+} %PLANK(plank){+}
   :COLUMNS:  %40ITEM(item) %FOOD-MORNING(s-food-t){:mean} %FOOD-NIGHT(e-food-t){:mean} %DOWN(down){:mean} %POMODORO(pomodoro){+} %WEIGHT(weight){mean;%.1f}
   :END: 
   `** week 10
   `*** [2024-03-10 Sun]
   `*** [2024-03-09 Sat]
   `*** [2024-03-08 Fri]
   `*** [2024-03-07 Thu]
   `*** [2024-03-06 Wed]
   `*** [2024-03-05 Tue]
   `*** [2024-03-04 Mon]
#+end_src

For better understanding and visualization I'm attaching a video in gif.

[-- Attachment #2: output.gif --]
[-- Type: image/gif, Size: 1136951 bytes --]

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

Is it OK to attach 1 MB file? 

To make it work I did a simple hack:

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

It works If I'm only changing the 'view', but it doesn't work properly
when I want to change column definition in e.g. remove or add a column.

Because the code for the view is 'reading' the last :COLUMNS: definition with
function (org-entry-get nil "COLUMNS" t).

But is 'changing' the first :COLUMNS: definition with function 
(org-entry-put nil "COLUMNS" fmt).

However, this is a bit of an inconsistency. This 'hack' could work
without any problems.  If the read and write behavior of property :COLUMNS: were
predictable, same.

Do you have any idea how to solve this problem?

Over 10 years ago Thomas Leitner asked about this feature
https://lists.gnu.org/archive/html/emacs-orgmode/2009-12/msg00797.html

@Thomas 
How did you deal with this feature?
Are you still using it?

Regards, 
-- 
Slawomir Grochowski

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-03-06 10:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-04 15:50 [FR] multiple column view definition Slawomir Grochowski
2024-03-05 12:41 ` Ihor Radchenko
2024-03-05 16:40   ` Slawomir Grochowski
2024-03-06 10:53     ` Ihor Radchenko

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).