unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Frederik Fouvry <fouvry@CoLi.Uni-SB.DE>
Subject: documentation bug
Date: Wed, 27 Oct 2004 16:19:06 +0200 (CEST)	[thread overview]
Message-ID: <20041027141906.97A4A10C80@cc.at.coli.uni-sb.de> (raw)

This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2004-02-19 on cc.at.coli.uni-sb.de
configured using `configure  --prefix=/export/black --with-xpm --with-jpeg --with-tiff --with-gif --with-png --with-x --with-gcc --with-pop --with-sound'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: POSIX
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: de_DE@euro
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

In the Elisp manual, there is the following section (in
"Conventions for Writing Minor Modes"):

     The command should accept one optional argument.  If the argument
     is `nil', it should toggle the mode (turn it on if it is off, and
     off if it is on).  Otherwise, it should turn the mode on if the
     argument is a positive integer, a symbol other than `nil' or `-',
     or a list whose CAR is such an integer or symbol; it should turn
     the mode off otherwise.

     Here is an example taken from the definition of
     `transient-mark-mode'.  It shows the use of `transient-mark-mode'
     as a variable that enables or disables the mode's behavior, and
     also shows the proper way to toggle, enable or disable the minor
     mode based on the raw prefix argument value.

          (setq transient-mark-mode
                (if (null arg) (not transient-mark-mode)
                  (> (prefix-numeric-value arg) 0)))


The given example does not behave as documented for the arguments
'(-) and '(nil):

(prefix-numeric-value '(-)) -> 1
(prefix-numeric-value '(nil)) -> 1

According to the quoted text, these arguments should switch off
the mode.

Either prefix-numeric-value() is not behaving correctly, or the
example is not complete.  In the latter case, one could write

          (setq transient-mark-mode
	        (let ((larg (if (consp arg) (car arg) arg)))
                  (if (null larg) (not transient-mark-mode)
		    (> (prefix-numeric-value larg) 0))))

             reply	other threads:[~2004-10-27 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27 14:19 Frederik Fouvry [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-05-08 16:49 documentation bug harven
2008-05-08 18:02 ` Eli Zaretskii
2008-05-09 11:13   ` Richard M Stallman

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=20041027141906.97A4A10C80@cc.at.coli.uni-sb.de \
    --to=fouvry@coli.uni-sb.de \
    --cc=Frederik.Fouvry@CoLi.Uni-SB.DE \
    /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).