unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH 0/2] re-enable line wrapping and add some header bling
Date: Fri, 27 Jan 2012 06:52:46 +0000	[thread overview]
Message-ID: <cuny5stk56p.fsf@hotblack-desiato.hh.sledj.net> (raw)
In-Reply-To: <87ty3iqvyq.fsf@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4048 bytes --]

On Thu, 26 Jan 2012 20:17:49 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
> I did not review the code, but here is a general comment for both
> patches (but especially for the first one).  It would be nice to have a
> more detailed documentation for hooks.  Docstring like "Enable Visual
> Line mode." for a function named `notmuch-show-turn-on-visual-line-mode'
> is near useless.  It is quite obvious that the function enables
> visual-line-mode from it's name.  And it does not give any information
> on why would someone actually want to use it.  I do not remember what
> visual-line-mode is exactly, so to understand whether this hook is
> actually useful for me, I have to read visual-line-mode docs, think
> about how it helps in notmuch-show, read some code, perhaps, etc.  I
> would argue that since the hook itself is trivial, the main point in
> having it is to provide a clearly documented solution for a common
> problem for those who do not know how to solve this problem right away.
> Currently, those who know what visual-line-mode is do not need this
> hook, because they can easily write their own, and those who do not know
> what visual-line-mode is can not use this hook, because it says nothing
> about why it is actually useful.
> 
> Also, in addition to better docs, I would rename
> `notmuch-show-turn-on-visual-line-mode' to something that reflects what
> it does from user POV (like the other two hooks).
> 
> Though, the fact that the hook is enabled by default makes the above
> arguments less important, I guess.

I have a bunch of somewhat conflicting thoughts about this:
  - Being able to configure the behaviour without having to change the
    core code is good, so implementing behaviour using hook functions is
    useful.
  - Things should behave well in the default configuration, so most of
    the hook functions are enabled by default.
  - Everything can't be hook functions, so there's a balance to be made
    between implementing things as in-line code and via hook functions.
  - Most users shouldn't need to modify any of the hooks.
  - Documentation that explains what a hook function is about is
    obviously good.
  - Documenting something that is external to notmuch can be both
    wasteful and risky.

    Wasteful because such documentation typically already exists and
    risky because the precise behaviour of external components is not
    under our control.

    For example, the documentation for `visual-line-mode' is both
    concise and good, so there's little point in repeating it and, of
    course, the exact details of what `visual-line-mode' does can be
    changed by the Emacs developers. One would expect that they would
    update the documentation for `visual-line-mode' in such situations,
    which would leave any cloned documentation in an incorrect state.

Hence, I would probably take issue with your statement:

> I would argue that since the hook itself is trivial, the main point in
> having it is to provide a clearly documented solution for a common
> problem for those who do not know how to solve this problem right
> away.

That's not the intention of the hook functions under discussion
here. They are hook functions so that a curious and interested user can
make a change based on some aesthetic preference. The are not about
solving problems with the default configuration.

I think that `turn-on-visual-line-mode' (or the package local derivative
of it that was chosen) is precisely the right name for a function that
enables `visual-line-mode'. It describes perfectly and succinctly what
the function does and provides a pointer to follow to find out more (the
documentation for `visual-line-mode') without a user even having to
examine the documentation of the function itself.

All of that said, I'd agree that the documentation of
`notmuch-show-indent-continuations' could have been better. How about:
  "Indent any continuation lines in the current headers."
?

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2012-01-27  6:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-26  8:17 [PATCH 0/2] re-enable line wrapping and add some header bling David Edmondson
2012-01-26  8:17 ` [PATCH 1/2] emacs: Re-enable line wrapping in `notmuch-show-mode' David Edmondson
2012-01-26 20:26   ` Tomi Ollila
2012-01-27 11:57   ` David Bremner
2012-01-26  8:17 ` [PATCH 2/2] emacs: Add more processing of displayed headers David Edmondson
2012-01-26 16:17 ` [PATCH 0/2] re-enable line wrapping and add some header bling Dmitry Kurochkin
2012-01-27  6:52   ` David Edmondson [this message]
2012-01-27  8:22     ` Jani Nikula
2012-01-26 17:36 ` Jani Nikula
2012-02-06 13:16 ` [PATCH v2] Wrap and indent headers in show mode David Edmondson
2012-02-06 13:16   ` [PATCH v2] emacs: Add more processing of displayed headers David Edmondson

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://notmuchmail.org/

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

  git send-email \
    --in-reply-to=cuny5stk56p.fsf@hotblack-desiato.hh.sledj.net \
    --to=dme@dme.org \
    --cc=dmitry.kurochkin@gmail.com \
    --cc=notmuch@notmuchmail.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 public inbox

	https://yhetil.org/notmuch.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).