unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: "Bradley M. Kuhn" <bkuhn@softwarefreedom.org>
Cc: bug-gnu-emacs@gnu.org
Subject: Re: [patch] alist option for add-log-mailing-address
Date: Wed, 28 Mar 2007 23:03:19 +0200	[thread overview]
Message-ID: <87y7lhozc8.fsf@ambire.localdomain> (raw)
In-Reply-To: <87mz1xz2do.fsf@shipitfish.net> (Bradley M. Kuhn's message of "Wed\, 28 Mar 2007 13\:47\:31 -0400")

() "Bradley M. Kuhn" <bkuhn@softwarefreedom.org>
() Wed, 28 Mar 2007 13:47:31 -0400

   Finally, let me know if you like the patch or would like me to rewrite it
   a bit differently!

   +	* add-log.el (add-log-mailing-address): Added alist option.  Made
   +	tags more specific.
   +	(add-change-log-entry): Added code to handle alist setting on
   +	add-log-mailing-address.

s/Added/Add;s/Made/Make;

context diff preferred.

   +This defaults to the value of `user-mail-address'.  This value
   +can be a simple string; setting it as such will always use that
   +string in ChangeLog headers.  If the value is instead a list of
   +strings, when creating a new ChangeLog entry, one element will be
   +chosen at random.  If the value is an alist, the keys will be
   +considered regular expressions compared against the
   +`buffer-file-name' of the ChangeLog file, and the values will be
   +email address used when the expression matches.  If you set the
   +value to an alist, but no regular expressions match the
   +`buffer-file-name' of the ChangeLog, `user-mail-address' is used
   +instead."

i would move this documentation into the `add-change-log-entry'
docstring, including suitable cross references.  also, i would
restructure "foo will do bar" to be "foo bars" and factor "list of
elements where each element can be" idiom towards the front.  also, i
would not use "you", prefering to take `add-change-log-entry' pov.

                       (if (consp mailing-address)
   -                       mailing-address
   +                         (if (consp (car mailing-address)) ; it's an alist
   +                           (let ( (changelog-buffer (buffer-file-name))
   +                                  (preferred-addr user-mail-address) )
   +                             (mapc (lambda (regex-email-pair)
   +                                   (if (string-match
   +                                        (car regex-email-pair) changelog-buffer)
   +                                    (setq preferred-addr (cdr regex-email-pair))))
   +                                   add-log-mailing-address)
   +                             (list preferred-addr))
   +                           mailing-address)

IMHO, a `cond' expression is clearer than a nested-`if' here.  also,
extra space between parens is disturbing...

thi

      reply	other threads:[~2007-03-28 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-28 17:47 [patch] alist option for add-log-mailing-address Bradley M. Kuhn
2007-03-28 21:03 ` Thien-Thi Nguyen [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://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87y7lhozc8.fsf@ambire.localdomain \
    --to=ttn@gnuvola.org \
    --cc=bkuhn@softwarefreedom.org \
    --cc=bug-gnu-emacs@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).