all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Uwe Brauer <oub@mat.ucm.es>, Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: shrink table in columnmode view (poor man's issue system)
Date: Mon, 27 Sep 2021 20:53:25 +0200	[thread overview]
Message-ID: <87y27hvoii.fsf@gmail.com> (raw)
In-Reply-To: <874ka63rcf.fsf@gnu.org> (Bastien's message of "Mon, 27 Sep 2021 18:39:44 +0200")

Hi all!

Bastien <bzg@gnu.org> 
> Uwe Brauer <oub@mat.ucm.es> 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 soooooooooooooooooooooooo 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 soooooooooooooooooooooooo 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!



      reply	other threads:[~2021-09-27 18:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 12:25 shrink table in columnmode view (poor man's issue system) Uwe Brauer
2021-09-26 10:09 ` Marco Wahl
2021-09-26 15:13   ` Uwe Brauer
     [not found]     ` <87sfxqe3hu.fsf@gmail.com>
2021-09-27 16:03       ` Uwe Brauer
2021-09-27 16:39         ` Bastien
2021-09-27 18:53           ` Marco Wahl [this message]

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=87y27hvoii.fsf@gmail.com \
    --to=marcowahlsoft@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=oub@mat.ucm.es \
    /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.