Re: shrink table in columnmode view (poor man's issue system)

2021-09-27 Thread Marco Wahl
Hi all!

Bastien  
> Uwe Brauer  writes:
>> Thank you for the code! As I said, your code should be included. If you
>> have write access please push it.

Thanks Uwe.

> It's up to the maintainers to decide for pushing changes, and to
> regular contributors, for areas they feel confident they can push,
> like Marco does regularily (thanks).

Thanks Bastien.

> I don't see any patch in this thread - am I missing something?

There is no patch yet.  But I think the idea of Uwe is worthy to be
discussed.

Let me present the idea of Uwe with his columnview dynamic block example
(a little bit simplified.)

With the current state in Org one could get the following columnview
block in a respective Org file.

#+BEGIN: columnview :format "%10ITEM(Problem) %5Is(Issue)"
| Problem   | Issue |
| Issues|   |
| Why is this item s wide ? | 9 |
#+END:

The idea is to add a line with width indicators taken from the column
format.  Here (it is the first table line):

#+BEGIN: columnview :format "%10ITEM(Problem) %5Is(Issue)"
| <10>  | <5>   |
| Problem   | Issue |
| Issues|   |
| Why is this item s wide ? | 9 |
#+END:

This would allow to use the C-c TAB feature to control the widths of the
columns.

We realized this using a newly defined personal dynamic block as
described in (info "(org) Dynamic Blocks").  Concretely:

(defun org-dblock-write:columnview2 (params)
  "Write the column view table.

Like org-dblock-write:columnview but write a line with shrink widths 
taken from the
column view format.

PARAMS is the same as in `org-dblock-write:columnview'."
  (insert (format "|%s|\n"
  (mapconcat
   (lambda (x) (concat "<" (number-to-string x) ">"))
   (mapcar (lambda (x) (nth 2 x)) 
(org-columns-compile-format
  (plist-get params 
:format)))
   "|")))
  (org-dblock-write:columnview params))

I think the idea is good.  But possibly the extra line is too much for
some people.  Further I'm sure that the code can be improved and I don't
feel 100% confident in this dynamic block area.


Best regards!




Re: shrink table in columnmode view (poor man's issue system)

2021-09-27 Thread Bastien
Hi Uwe,

Uwe Brauer  writes:

>> Thanks for the feedback!
>
> Thank you for the code! As I said, your code should be included. If you
> have write access please push it.

It's up to the maintainers to decide for pushing changes, and to
regular contributors, for areas they feel confident they can push,
like Marco does regularily (thanks).

I don't see any patch in this thread - am I missing something?

-- 
 Bastien



Re: shrink table in columnmode view (poor man's issue system)

2021-09-27 Thread Uwe Brauer

> Uwe Brauer  writes:

> Hi Uwe,

> Thanks for the feedback!

Thank you for the code! As I said, your code should be included. If you
have write access please push it.

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: shrink table in columnmode view (poor man's issue system)

2021-09-26 Thread Uwe Brauer
>>> "MW" == Marco Wahl  writes:

> Hi!
> Uwe Brauer  writes:
>> I use the following org file to organise my issues.
>> It works quite well, however I would like to have a shrink option
>> automatically in my columnview.

> Your suggestion looks quite useful to me.

>> Any idea how to achieve that?

> One possibility is to write your own dynamic block writer function.
> Find documentation at (info "(org) Dynamic Blocks") .

Aha, meanwhile I discovered that a dummy entry 

* Issues
   :PROPERTIES:
   :COLUMNS:  %50ITEM(Problem) %10Is(Issue Nr) %7TODO(Status) %26TAGS(Which) 
%17Date(Date) %7STATUS(Status){X/} 
   :ID:   Issues
   :END:

** <45>
   :PROPERTIES:
   :ID:  Issues 
   :Date:
   :STATUS:   
   :Is:  0 
   :END:


Also works well sort of.

However, your solution is soo much *better* and works like charms, thanks a lot!

@maintainers, why not include this functionality into org-mode (most
likely  ‘org-insert-dblock.el’.


Regards

Uwe 


smime.p7s
Description: S/MIME cryptographic signature


Re: shrink table in columnmode view (poor man's issue system)

2021-09-26 Thread Marco Wahl
Hi!

Uwe Brauer  writes:
> I use the following org file to organise my issues.
> It works quite well, however I would like to have a shrink option
> automatically in my columnview.

Your suggestion looks quite useful to me.

> Any idea how to achieve that?

One possibility is to write your own dynamic block writer function.
Find documentation at (info "(org) Dynamic Blocks") .

> File starts here:
>
> #+begin_src 
> #+STARTUP: shrink
>
> * Issues
>:PROPERTIES:
>:COLUMNS:  %50ITEM(Problem) %10Is(Issue Nr) %7TODO(Status) %26TAGS(Which) 
> %17Date(Date) %7STATUS(Status){X/} 
>:ID:   Issues
>:END:
>
> ** TODO Why is  \eqref{eq:section4-sh15}: not used in the proof of 
> proposition 5 (section 4)
>:PROPERTIES:
>:ID:   Issues
>:Date: <2021-09-25 sáb>
>:STATUS:   [ ]
>:Is:   9
>:END:
>
> The table is generated like this
> #+BEGIN: columnview  :hlines 2 :skip-empty-rows t :indent nil  :format 
> "%5ITEM(Problem) %5Is(Issue) %12TODO  %12Date %7Status(Status){X/}"
> | Problem 
>  | Issue | TODO | Date | Status |
> |--+---+--+--+|
> | Issues  
>  |   |  |  | [0/1]  |
> |--+---+--+--+|
> | Why is  \eqref{eq:section4-sh15}: not used in the proof of proposition 5 
> (section 4) | 9 | TODO | <2021-09-25 sáb> | [ ]|
> #+END:
>
>
> But I would like to have this
>
> #+BEGIN: columnview  :hlines 2 :skip-empty-rows t :indent nil  :format 
> "%5ITEM(Problem) %5Is(Issue) %12TODO  %12Date %7Status(Status){X/}"
> |<45>
> | Problem 
>  | Issue | TODO | Date | Status |
> |--+---+--+--+|
> | Issues  
>  |   |  |  | [0/1]  |
> |--+---+--+--+|
> | Why is  \eqref{eq:section4-sh15}: not used in the proof of proposition 5 
> (section 4) | 9 | TODO | <2021-09-25 sáb> | [ ]|
> #+END:
>
> #+end_src 

Concretely check out this proposition (tested with your example).  Have

(defun org-dblock-write:columnview2 (params)
  "Write the column view table.

Like org-dblock-write:columnview but write a line with shrink widths 
taken from the
column view format.

PARAMS is the same as in `org-dblock-write:columnview'."
  (insert (format "|%s|\n"
  (mapconcat
   (lambda (x) (concat "<" (number-to-string x) ">"))
   (mapcar (lambda (x) (nth 2 x)) 
(org-columns-compile-format
  (plist-get params 
:format)))
   "|")))
  (org-dblock-write:columnview params))

defined.  E.g. type C-x C-e after the last paren.

Then use "columnview2" instead of "columnview" and get

#+BEGIN: columnview2  :hlines 2 :skip-empty-rows t :indent nil  :format 
"%5ITEM(Problem) %5Is(Issue) %12TODO  %12Date %7Status(Status){X/}"
| <5>   
   | <5>   | <12> | <12> | <7>|
| Problem   
   | Issue | TODO | Date | Status |
|--+---+--+--+|
| Issues
   |   |  |  | [0/1]  |
|--+---+--+--+|
| Why is  \eqref{eq:section4-sh15}: not used in the proof of proposition 5 
(section 4) | 9 | TODO | <2021-09-25 sáb> | [ ]|
#+END:


HTH





shrink table in columnmode view (poor man's issue system)

2021-09-25 Thread Uwe Brauer
Hi 

I use the following org file to organise my issues.
It works quite well, however I would like to have a shrink option
automatically in my columnview.

Any idea how to achieve that?

Thanks and regards

Uwe Brauer 

File starts here:
#+begin_src 
#+STARTUP: shrink

* Issues
   :PROPERTIES:
   :COLUMNS:  %50ITEM(Problem) %10Is(Issue Nr) %7TODO(Status) %26TAGS(Which) 
%17Date(Date) %7STATUS(Status){X/} 
   :ID:   Issues
   :END:

** TODO Why is  \eqref{eq:section4-sh15}: not used in the proof of proposition 
5 (section 4)
   :PROPERTIES:
   :ID:   Issues
   :Date: <2021-09-25 sáb>
   :STATUS:   [ ]
   :Is:   9
   :END:

The table is generated like this
#+BEGIN: columnview  :hlines 2 :skip-empty-rows t :indent nil  :format 
"%5ITEM(Problem) %5Is(Issue) %12TODO  %12Date %7Status(Status){X/}"
| Problem   
   | Issue | TODO | Date | Status |
|--+---+--+--+|
| Issues
   |   |  |  | [0/1]  |
|--+---+--+--+|
| Why is  \eqref{eq:section4-sh15}: not used in the proof of proposition 5 
(section 4) | 9 | TODO | <2021-09-25 sáb> | [ ]|
#+END:


But I would like to have this

#+BEGIN: columnview  :hlines 2 :skip-empty-rows t :indent nil  :format 
"%5ITEM(Problem) %5Is(Issue) %12TODO  %12Date %7Status(Status){X/}"
|<45>
| Problem   
   | Issue | TODO | Date | Status |
|--+---+--+--+|
| Issues
   |   |  |  | [0/1]  |
|--+---+--+--+|
| Why is  \eqref{eq:section4-sh15}: not used in the proof of proposition 5 
(section 4) | 9 | TODO | <2021-09-25 sáb> | [ ]|
#+END:

#+end_src