emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@posteo.net>
To: "Sławomir Grochowski" <slawomir.grochowski@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [RFC] [feat] org-colview/org-columns: 'column view' moving rows up/down
Date: Fri, 07 Apr 2023 11:04:06 +0000	[thread overview]
Message-ID: <87355ckl7d.fsf@localhost> (raw)
In-Reply-To: <87lej51frx.fsf@gmail.com>

Sławomir Grochowski <slawomir.grochowski@gmail.com> writes:

> Recently I often use 'column view' feature. 
> To my suprise in 'column view' user can't move rows up & down.
> So I wrote a little code snippet to be able to do it, and I'm sharing it with you.
>
> Questions:
> 1. Why user can't move rows up & down in 'column view'?
> 2. Is this was intentional design decision?

I do not see any particular reason.
The current design dates back to 15 years ago - the initial commit in
our current git repo.

> I think 'column view' is missing one the core feel & functionality of org-mode - moving rows (headings) up & down.
> In my experiance with 'column view' & tables I shuffle a lot of columns & rows order.

Sounds reasonable.

> From 1f0f2052b8dddf4982ab35267ed1564f2250784b Mon Sep 17 00:00:00 2001
> From: Sławomir Grochowski <slawomir.grochowski@gmail.com>
> Date: Mon, 3 Apr 2023 19:23:09 +0200
> Subject: [PATCH] org-columns: add feat to move row up/down

The patch looks good in general, but you need to add proper commit
message. See https://orgmode.org/worg/org-contribute.html#commit-messages

Also, you need to add etc/ORG-NEWS entry about the new functionality and
also modify the manual.

Finally, I see no records about you copyright assignment status.
Please take a look at https://orgmode.org/worg/org-contribute.html#copyright

> +(defun org-columns--move-row (&optional up)
> +    "Move table row. Calls `org-move-subtree-down' or `org-move-subtree-up'."

*Move column view table row.

We generally prefer single sentence as the first line of the docstring.
Also, please describe UP argument in the docstring.

> +;; Each column is an overlay on top of a character.  So there has
> +;; to be at least as many characters available on the line as
> +;; columns to display.
> +;; 'org-columns--display-here'
> +(ert-deftest test-org-colview/bug-add-whitespace ()
> +  "Insert space characters if number of characters on the line
> +  is lower then number of columns."
> +  :expected-result :failed

Does this test have anything to do with the new feature?

> +(ert-deftest test-org-colview/columns-move-row-down ()
> +  "Test `org-columns-move-row-down' specifications."
> +  (should
> +   (equal "* H
> +** B
> +** A
> +"
> +          (org-test-with-temp-text "* H
> +** A
> +** B
> +"
> +            (let ((org-columns-default-format "%ITEM")) (org-columns)
> +                 (next-line 1)
> +                 (org-columns-move-row-down)
> +                 (buffer-substring-no-properties (point-min) (point-max)))))))

One special case we may want to consider is when columns are from
different heading levels, like

* H
** A
*** A1
** B

-- 
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:[~2023-04-07 11:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-06 10:11 [RFC] [feat] org-colview/org-columns: 'column view' moving rows up/down Sławomir Grochowski
2023-04-07 11:04 ` Ihor Radchenko [this message]
2023-04-08 21:48   ` Sławomir Grochowski
2023-04-09  9:16     ` Ihor Radchenko
2023-04-11  8:49       ` Sławomir Grochowski
2023-04-12  9:09         ` Ihor Radchenko
2023-08-20 10:43           ` Ihor Radchenko
2023-08-20 17:44             ` Sławomir Grochowski
2023-08-20 19:39               ` 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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87355ckl7d.fsf@localhost \
    --to=yantar92@posteo.net \
    --cc=emacs-orgmode@gnu.org \
    --cc=slawomir.grochowski@gmail.com \
    /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 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).