all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Karl Fogel <kfogel@red-bean.com>
To: Org-mode <emacs-orgmode@gnu.org>
Cc: Marco Wahl <marcowahlsoft@gmail.com>
Subject: Re: [PATCH] Use prefix arg to control scope of org-narrow-to-subtree.
Date: Mon, 02 Dec 2019 13:17:59 -0600	[thread overview]
Message-ID: <87v9qysfiw.fsf@red-bean.com> (raw)
In-Reply-To: <84k17elfnu.fsf@gmail.com> (Marco Wahl's message of "Mon, 02 Dec 2019 19:56:53 +0100")

On 02 Dec 2019, Marco Wahl wrote:
>Karl Fogel <kfogel@red-bean.com> writes:
>> Since `widen' itself is already available via C-x n w, it might be
>> better to save a special flag value like that for some special
>> behavior that we (or someone else) might think of in the future.  I'm
>> pretty sure that anyone using `org-narrow-to-subtree' must also know
>> about the `widen' command, too.
>
>Okay, this sounds sound.
>
>Let me be a bit more explicit about my wish: I vote for the prefix arg 0
>to widen because this fits to the logic to view the whole file as level
>0 subtree.  With this perspective on the feature the effect of a numeric
>prefix argument is clear as day:
>
>...
>C-u 2 M-x org-narrow... => Narrow to the level-2 subtree containing point.
>C-u 1 M-x org-narrow... => Narrow to the level-1 subtree containing point.
>C-u 0 M-x org-narrow... => Narrow to the level-0 subtree containing point.
>
>The last line stands in opposition to the current behavior.
>
>C-u 0 M-x org-narrow... => Narrow to the level-1 subtree containing point.
>    ^                                          ^

Oh, yes, I get the logic, from a consistency standpoint.

My only concern is that a) it's unnecessary, because `widen' is available, and b) some day we might think of a better special meaning for C-u 0 (and in the meantime it could error instead of narrowing to the current level-1 subtree).

But I don't feel strongly about it either way.  Perhaps consistency is desirable here, although I tend to think that consistency is overrated in UI/UX in general -- the famous example of "`transpose-chars' at the end of a line" comes to mind.

Hmm, but on the other hand, your proposed consistency *would* be good if anyone's ever calling `org-narrow-to-subtree' from Lisp with an algorithmically calculated STEPS argument.  I can't imagine what kind of circumstance that would be, but if it's a general principle of Org Mode to consider "level 0" to be the entire buffer, then we should probably go with your proposed behavior.  So I guess I'm tentatively +1...

Does anyone else have any thoughts on this?

Best regards,
-Karl

      reply	other threads:[~2019-12-02 19:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 19:05 [PROPOSAL] Use prefix arg to control scope of org-narrow-to-subtree Karl Fogel
2019-04-24 21:56 ` Alan L Tyree
2019-04-24 22:02 ` Alan L Tyree
2019-04-25  8:42 ` Nicolas Goaziou
2019-05-31  7:33   ` Karl Fogel
2019-12-01  8:45   ` [PATCH] " Karl Fogel
2019-12-01 13:13     ` Marco Wahl
2019-12-01 15:25       ` Karl Fogel
2019-12-01 15:44         ` Marco Wahl
2019-12-01 15:46           ` Karl Fogel
2019-12-02  8:51     ` Eric Abrahamsen
2019-12-02 15:15     ` Marco Wahl
2019-12-02 18:06       ` Karl Fogel
2019-12-02 18:56         ` Marco Wahl
2019-12-02 19:17           ` Karl Fogel [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=87v9qysfiw.fsf@red-bean.com \
    --to=kfogel@red-bean.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=marcowahlsoft@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 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.