unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-pretest-bug@gnu.org>
Subject: bug#2030: 23.0.60; doc string of dired-guess-shell-alist-user
Date: Sat, 24 Jan 2009 11:09:08 -0800	[thread overview]
Message-ID: <000c01c97e57$3c19ad20$0200a8c0@us.oracle.com> (raw)

The doc string should suggest that users use Customize. It should not
use a complex `setq' example as its only illustration:
 
(setq dired-guess-shell-alist-user
      (list (list "\\.foo\\'" "FOO-COMMAND");; fixed rule
             ;; possibly more rules ...
             (list "\\.bar\'";; rule with condition test
                   '(if condition
                         "BAR-COMMAND-1"
                       "BAR-COMMAND-2"))))
 
This example is in any case incorrect - "\\.bar\'" should be "\\.bar\\'".
 
If it's felt that an example of a _value_ for this option is needed,
then it's OK to show that directly:
 
(("\\.foo\\'" "foo-command") ; unconditional rule
 ("\\.bar\\'"                ; conditional rule
  (if (some-sexp) "bar-command-1" "bar-command-2")))
 
But there is absolutely no reason to show setting the value using
`setq', especially since the expression evaluated by `setq' is 100%
constant. Nothing is gained by showing anything other than the result
of that evaluation, that is, a possible value for the option.
 
It might also be better to write `(some-sexp)' or similar, instead of
`condition', to emphasise that even that part is code to be evaluated.
 
The use of uppercase for the command names is also problematic - those
are constants (strings). This is an example, not a template.
 
In sum: (1) the doc string is confusing in several respects; (2) it is
incorrect; (3) it is unnecessarily complex; and (4) it favors Lisp
instead of Customize for a user-option example.
 

 







             reply	other threads:[~2009-01-24 19:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-24 19:09 Drew Adams [this message]
2011-07-11 13:48 ` bug#2030: 23.0.60; doc string of dired-guess-shell-alist-user Lars Magne Ingebrigtsen
2011-07-11 15:19   ` Drew Adams
2011-07-11 15:21     ` Lars Magne Ingebrigtsen
2011-07-11 16:03       ` Drew Adams
2011-07-16 18:35         ` Lars Magne Ingebrigtsen
2011-07-16 23:21           ` Drew Adams

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='000c01c97e57$3c19ad20$0200a8c0@us.oracle.com' \
    --to=drew.adams@oracle.com \
    --cc=2030@emacsbugs.donarmstrong.com \
    --cc=emacs-pretest-bug@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).