unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "rgb" <rbielaws@i1.net>
Subject: Re: binding C-uC-SPC to a new key
Date: 22 Dec 2006 05:47:42 -0800	[thread overview]
Message-ID: <1166795262.463657.84070@i12g2000cwa.googlegroups.com> (raw)
In-Reply-To: mailman.2208.1166752483.2155.help-gnu-emacs@gnu.org

> >> > i would appreciate pointers to invoke the the set-mark-command
> >> > with a prefix (so that it traverses back to where previous mark was).
> >>
> >> Is not C-x C-x what you want?  Or do you just want that the cursor to
> >> skip temporarily to the previous mark?
> >
> > no. what i wanted is to cycle thru all of the marks in my mark-ring.
>
> (setq set-mark-command-repeat-pop t)
>
> means that effectively you only have to type "C-u C-SPC" *once* and
> then for the other locations only "C-SPC".

But if you still want to create a key that invokes a function with a
prefix arg, look at the function's calling syntax.  A prefix arg, like
other interactive arguments is handled by the (interactive ...) clause
which tells emacs how to get the arguments needed to call the
function.

Since you don't want to call it interactively you're call just supplies

the arguments that the interactive clause would otherwise supply.  In
this case, C-u translates to (4).  So call the function like this:

(set-mark-command '(4))

Mapping it to a key could look like this:

(global-set-key [?\C-\M- ](lambda () (interactive)(set-mark-command
'(4))))

The C-u prefix is probably the most obsecure of all interactive
translations so don't be put off by the fact that you're saying to
yourself 'how could I have known'.  All the others are really obvious.
C-h f interactive
and the Elisp reference node- 21.11 Prefix Command Arguments
describe it all.

      parent reply	other threads:[~2006-12-22 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-15 21:31 binding C-uC-SPC to a new key Badari Kakumani
2006-12-18 22:11 ` Dieter Wilhelm
     [not found] ` <mailman.2086.1166480959.2155.help-gnu-emacs@gnu.org>
2006-12-21 16:16   ` Badari Kakumani
2006-12-21 16:46     ` Drew Adams
     [not found]     ` <mailman.2193.1166719607.2155.help-gnu-emacs@gnu.org>
2006-12-21 23:41       ` Badari Kakumani
2006-12-22  1:53     ` Dieter Wilhelm
     [not found]     ` <mailman.2208.1166752483.2155.help-gnu-emacs@gnu.org>
2006-12-22 13:47       ` rgb [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=1166795262.463657.84070@i12g2000cwa.googlegroups.com \
    --to=rbielaws@i1.net \
    /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.
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).