unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, Austin Clements <amdragon@MIT.EDU>
Cc: notmuch@notmuchmail.org
Subject: Re: [PATCH] emacs: remove hardcoded defaults values from docstrings
Date: Wed, 05 Jun 2013 09:05:43 +0300	[thread overview]
Message-ID: <m2vc5thz2g.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <87haheq7kq.fsf@zancas.localnet>

On Tue, Jun 04 2013, David Bremner <david@tethera.net> wrote:

> Austin Clements <amdragon@MIT.EDU> writes:
>>
>> Right.  I think we should both reference the variable and say what the
>> default behavior is (there's no reason not to do both).  But isn't
>> that what these docstrings used to do?
>
> Looking at the old docstrings in notmuch-show.el, I agree they basically
> implement Tomi's suggestion.  While I think copying default values of
> variables into docstrings creates some minor maintainability traps
> (since we then need to remember to look at all the places a variable is
> referenced if we change the default value), I'm willing to revert the
> patch if people think the tradeoff of better usability is worth it.

Well, revert would be the worst option -- maintainability traps there
and no reference to the variable used ;/

So either what we currently have in repository (and merge Mark's similar
patches) or have both. In addition to my quick suggestion, what is been
seen in notmuch-show.el docstrings this is what `split-string' has:

...
If SEPARATORS is non-nil, it should be a regular expression matching text
which separates, but is not part of, the substrings.  If nil it defaults to
`split-string-default-separators', normally "[ \f\t\n\r\v]+", and
OMIT-NULLS is forced to t.
...

By looking the code, doc hardcoded, defconst split-string-default-separators
-- from maintainability point of view those are close to each other...

IMO what we currently have is OK, unless SomeOne(tm) provides a neat patch
and agrees that maintainability is not really a problem here :D

> It is unfortunate emacs doesn't provide a way to expand the current
> value of a variable in the help string, but there we are. It probably
> wouldn't be as easy to understand as hand crafted text in any case.

We could have placeholders in *.el files and tune byte compiler
to fill in the docstrings >;) Imagine the added bonus we get by
the confusion that causes !


> d

Tomi

      reply	other threads:[~2013-06-05  6:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-02 14:04 [PATCH] emacs: remove hardcoded defaults values from docstrings david
2013-06-02 14:29 ` [PATCH] emacs: add `notmuch-archive-tags' cross references in docstrings david
2013-06-02 14:32 ` [PATCH] emacs: remove hardcoded defaults values from docstrings Tomi Ollila
2013-06-02 17:47 ` Mark Walters
2013-06-03  0:03   ` David Bremner
2013-06-04  4:01 ` Austin Clements
2013-06-04  6:30   ` Tomi Ollila
2013-06-04 11:37     ` David Bremner
2013-06-04 13:37       ` Austin Clements
2013-06-04 14:22         ` David Bremner
2013-06-05  6:05           ` Tomi Ollila [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

  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=m2vc5thz2g.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=amdragon@MIT.EDU \
    --cc=david@tethera.net \
    --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).