unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
To: emacs-devel@gnu.org
Subject: Re: keep|flush-lines, how-many to be used backward.
Date: Fri, 28 Sep 2007 22:25:35 +0000 (UTC)	[thread overview]
Message-ID: <m1IbOH9-002KHlC@rattlesnake.com> (raw)
In-Reply-To: <87lkardtk8.fsf@cadilhac.name> (michael@cadilhac.name)

    What I fail to agree with, is that a prefix argument can be a
    three-state boolean=A0: present, negative or positive.  

It is straight forward to provide three options or two depending on
whether the code distinguishes between a list and an integer.

(You can also distinguish between the integer -1 and the symbol `-',
but I never have.)

See: 

    (info "(elisp)Prefix Command Arguments")

which says,

   Here are the possible values of a raw prefix argument:

   * `nil', meaning there is no prefix argument.  Its numeric value is
     1, but numerous commands make a distinction between `nil' and the
     integer 1.

   * An integer, which stands for itself.

   * A list of one element, which is an integer.  This form of prefix
     argument results from one or a succession of `C-u''s with no
     digits.  The numeric value is the integer in the list, but some
     commands make a distinction between such a list and an integer
     alone.

   * The symbol `-'.  This indicates that `M--' or `C-u -' was typed,
     without following digits.  The equivalent numeric value is -1, but
     some commands make a distinction between the integer -1 and the
     symbol `-'.

That Info shows the results of interactively invoking a defun called
`display-prefix' in nine different ways.  (The whole defun is shown,
so you can copy it.)

With a slightly different definition for display-prefix than provided
by the manual, 

    (defun display-prefix (arg)
      "Display the value of the raw prefix arg."
      (interactive "P")
      (if (listp arg)
          (message "%s: is a list" arg)
        (message "%s: is not a list" arg)))

we find:

  list present

             M-x display-prefix  -| nil: is a list

     C-u     M-x display-prefix  -| (4): is a list

     C-u C-u M-x display-prefix  -| (16): is a list

  no list; number positive.  

     C-u 4   M-x display-prefix  -| 4: is not a list

     M-4     M-x display-prefix  -| 4: is not a list   ; (Same as `C-u 4'.)

  no list; number negative or non-existant

     C-u -   M-x display-prefix  -| -: is not a list

     M--     M-x display-prefix  -| -: is not a list   ; (Same as `C-u -'.)

     C-u - 7 M-x display-prefix  -| -7: is not a list

     M-- 7   M-x display-prefix  -| -7: is not a list  ; (Same as `C-u -7'.)

-- 
    Robert J. Chassell                          GnuPG Key ID: 004B4AC8
    bob@rattlesnake.com                         bob@gnu.org
    http://www.rattlesnake.com                  http://www.teak.cc

  parent reply	other threads:[~2007-09-28 22:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-24 16:08 keep|flush-lines, how-many to be used backward Michaël Cadilhac
2007-09-24 17:27 ` Drew Adams
2007-09-24 17:42   ` Michaël Cadilhac
2007-09-25 14:10     ` Stefan Monnier
2007-09-25 14:36       ` Michaël Cadilhac
2007-09-26  5:01         ` Stefan Monnier
2007-09-25 10:44 ` Richard Stallman
2007-09-25 20:39 ` Michaël Cadilhac
2007-09-25 20:56   ` Juri Linkov
2007-09-25 21:01     ` Michaël Cadilhac
2007-09-25 21:49       ` Juri Linkov
2007-09-28  9:32         ` Michaël Cadilhac
2007-09-28 10:52           ` Robert J. Chassell
2007-09-28 10:59             ` Michaël Cadilhac
2007-09-29 16:10             ` Richard Stallman
2007-09-28 15:50           ` Drew Adams
2007-09-28 22:25           ` Robert J. Chassell [this message]
2007-09-29 22:48           ` Juri Linkov
2007-09-30  2:18             ` 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=m1IbOH9-002KHlC@rattlesnake.com \
    --to=bob@rattlesnake.com \
    --cc=emacs-devel@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).