From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: binding C-uC-SPC to a new key Date: 22 Dec 2006 05:47:42 -0800 Organization: http://groups.google.com Message-ID: <1166795262.463657.84070@i12g2000cwa.googlegroups.com> References: <1166218278.688516.190300@79g2000cws.googlegroups.com> <1166717789.737921.289600@i12g2000cwa.googlegroups.com> NNTP-Posting-Host: dough.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: sea.gmane.org 1166798440 19726 80.91.229.10 (22 Dec 2006 14:40:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 22 Dec 2006 14:40:40 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 22 15:40:40 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by dough.gmane.org with esmtp (Exim 4.50) id 1GxlZb-00051R-KM for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Dec 2006 15:40:36 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GxlZb-0004uc-5x for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Dec 2006 09:40:35 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!i12g2000cwa.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 168.208.215.220 Original-X-Trace: posting.google.com 1166795268 14976 127.0.0.1 (22 Dec 2006 13:47:48 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 22 Dec 2006 13:47:48 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: i12g2000cwa.googlegroups.com; posting-host=168.208.215.220; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:144237 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:39840 Archived-At: > >> > 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.