From: Kaushal Modi <kaushal.modi@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Proposal: new mode-line `%'-construct %o meaning "Degree of travel of window through buffer".
Date: Mon, 22 May 2017 18:55:34 +0000 [thread overview]
Message-ID: <CAFyQvY2Giv=vmtvr=69BfVTa9j8rUuUgRRcTRS6jizyOwZ5=OQ@mail.gmail.com> (raw)
In-Reply-To: <20170522182007.GA2899@acm.fritz.box>
[-- Attachment #1: Type: text/plain, Size: 3700 bytes --]
On Mon, May 22, 2017 at 2:21 PM Alan Mackenzie <acm@muc.de> wrote:
> Thanks for taking on the task of finishing up the documentation of this
> new facility.
>
Sure. I was just attempting to clarify things that were not clear to me as
the mode-line-format is not very familiar to me.
> I'm not completely happy with these changes, because I think they're a
> bit misleading. Primarily, mode-line-percent-position _DOESN'T_ require
> a 2-element list - just that that's what's most likely to be used. It
> could also be nil, or (I think) a bare "%o", etc., or any other valid
> mode line format fragment.
>
When I saw the defcustom options for mode-line-percent-position, it wasn't
evident to me why %q had 6 as the first element and why the rest had -3.
> How about: "Also add detail about what these elements typically are."
>
Sure. I was just reverse-engineering your patch, and documenting for my
future-self :)
> Or: "The option's value is typically a list of the form (WIDTH TYPE)
> where WIDTH specifies the field width ... to display in
> `mode-line-position' (see ....). It could be nil, or any other valid mode
> line format construct."
>
Same as above.
> > +WIDTH is specified as an integer. If the integer is negative (-N),
> > +the width is truncated to N characters, and if it is positive (N),
> > +padding is added, if needed, to make the field N characters wide.
> > +
>
> Here, I'm a bit bothered that we'd be documenting something which
> doesn't really belong here. This meaning of an integer applies
> throughout the whole of the mode line format, not just in
> mode-line-percent-position.
>
I wasn't aware of that. Being not acquainted to mode-line-format. I thought
that the the reason for -3 and 6 as first elements needed to be explained.
mode-line-format docstring has this:
> A list whose car is an integer is processed by processing the cadr of
> the list, and padding (if the number is positive) or truncating (if
> negative) to the width specified by that number.
But I wanted the integer element description to be made even clearer. May
be the mode-line-format docstring should be improved?
> > +TYPE can be one of \"%o\", \"%p\", \"%P\" or \"%q\". See
> > +`mode-line-format' for more information on these % constructs."
> > :type `(radio
> > (const :tag "nil: No offset is displayed" nil)
> > (const :tag "\"%o\": Proportion of \"travel\" of the window
> through the buffer"
>
> or ... "TYPE is typically one of \"%o\", ...."
>
OK.
> This description of %o seems a bit clumsy and unintuitive, even though it
> is accurate. What was wrong with my phrase "the proportion of
> \"travel\" of the window through the buffer".
>
At first, I could not understand what that meant. But the analogy of
a/(a+b) earlier in the thread made complete sense to me. So I just spelled
that out in English, while also stealing the verbiage used in the Info
manual text.
The last clause should be "or Top, BotTOM, or All". %o, %p, and %P
> actually output "Bottom"; it is only the field width (-3) which
> truncates it to "Bot". (I just learned that over the weekend. ;-)
>
I learned that just now :)
So in summary I was just attempting to explain the defcustom values of
mode-line-percent-position better, by reverse-engineering. I had to refer
to the initial discussion in this thread, docstring of mode-line-format and
parts from the Info manual changes made by your commit to completely
understand these options. So then I distilled all of that into the
mode-line-percent-position docstring.
Can you please rephrase the mode-line-format and mode-line-percent-position
docstrings taking that into account?
--
Kaushal Modi
[-- Attachment #2: Type: text/html, Size: 5586 bytes --]
next prev parent reply other threads:[~2017-05-22 18:55 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 20:44 Proposal: new mode-line `%'-construct %o meaning "Degree of travel of window through buffer" Alan Mackenzie
2017-05-15 23:27 ` Paul Eggert
2017-05-15 23:29 ` Drew Adams
2017-05-15 23:54 ` Kaushal Modi
2017-05-16 0:38 ` Noam Postavsky
2017-05-16 1:15 ` Clément Pit-Claudel
2017-05-16 2:47 ` Eli Zaretskii
2017-05-18 1:15 ` Perry E. Metzger
2017-05-18 4:28 ` Eli Zaretskii
2017-05-18 16:01 ` Perry E. Metzger
2017-05-18 16:18 ` Eli Zaretskii
2017-05-18 16:45 ` Perry E. Metzger
2017-05-18 19:43 ` Eli Zaretskii
2017-05-18 20:13 ` Perry E. Metzger
2017-05-18 20:25 ` Eli Zaretskii
2017-05-18 20:51 ` Perry E. Metzger
2017-05-19 6:17 ` Eli Zaretskii
2017-05-22 2:22 ` Kaushal Modi
2017-05-22 4:13 ` Eli Zaretskii
2017-05-22 13:38 ` Kaushal Modi
2017-05-22 18:20 ` Alan Mackenzie
2017-05-22 18:55 ` Kaushal Modi [this message]
2017-05-16 3:00 ` Eli Zaretskii
2017-05-16 3:35 ` Noam Postavsky
2017-05-16 20:37 ` Alan Mackenzie
2017-05-17 2:30 ` Eli Zaretskii
2017-05-17 21:32 ` Alan Mackenzie
2017-05-18 19:16 ` Dani Moncayo
2017-05-18 21:22 ` Alan Mackenzie
2017-05-19 5:32 ` Yuri Khan
2017-05-16 7:22 ` Andreas Schwab
2017-05-16 10:05 ` Dani Moncayo
2017-05-16 13:31 ` Drew Adams
2017-05-16 18:59 ` Toon Claes
2017-05-16 20:56 ` John Yates
2017-05-20 10:34 ` Proposal: new mode-line `%'-construct %o meaning "Degree of travel of window through buffer". [Patch] Alan Mackenzie
2017-05-21 15:55 ` Difficulty applying multi-file patches from within emacs (Was: Proposal: new mode-line `%'-construct %o ..) Kaushal Modi
2017-05-21 16:04 ` Noam Postavsky
2017-05-22 1:19 ` Kaushal Modi
2017-05-22 2:35 ` Noam Postavsky
2017-05-21 16:08 ` Difficulty applying multi-file patches from within emacs Alan Mackenzie
2017-05-21 17:20 ` Philipp Stephani
2017-05-21 17:39 ` Alan Mackenzie
2017-05-22 1:21 ` Kaushal Modi
2017-05-22 1:23 ` Kaushal Modi
2017-05-23 11:21 ` Difficulty applying multi-file patches from within emacs (Was: Proposal: new mode-line `%'-construct %o ..) Tino Calancha
2017-05-23 8:00 ` Proposal: new mode-line `%'-construct %o meaning "Degree of travel of window through buffer". [Patch] Dani Moncayo
2017-05-23 20:24 ` Alan Mackenzie
2017-05-24 10:45 ` Dani Moncayo
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='CAFyQvY2Giv=vmtvr=69BfVTa9j8rUuUgRRcTRS6jizyOwZ5=OQ@mail.gmail.com' \
--to=kaushal.modi@gmail.com \
--cc=acm@muc.de \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/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.