all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* binding C-uC-SPC to a new key
@ 2006-12-15 21:31 Badari Kakumani
  2006-12-18 22:11 ` Dieter Wilhelm
       [not found] ` <mailman.2086.1166480959.2155.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 7+ messages in thread
From: Badari Kakumani @ 2006-12-15 21:31 UTC (permalink / raw)


folks,

i would appreciate pointers to invoke the the set-mark-command
with a prefix (so that it traverses back to where previous mark was).

i tried:

    (define-key alt-m-map "p" '(lambda ()
((universal-argument)(set-mark-command))))

but the above didn't work. yes, i am newbie to elisp ;)

thanks,
-badari

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: binding C-uC-SPC to a new key
  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>
  1 sibling, 0 replies; 7+ messages in thread
From: Dieter Wilhelm @ 2006-12-18 22:11 UTC (permalink / raw)
  Cc: help-gnu-emacs

"Badari Kakumani" <badarisj@gmail.com> writes:

> folks,
>
> 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?

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: binding C-uC-SPC to a new key
       [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
                       ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Badari Kakumani @ 2006-12-21 16:16 UTC (permalink / raw)



Dieter Wilhelm wrote:
> "Badari Kakumani" <badarisj@gmail.com> writes:
>
> > folks,
> >
> > 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.

thanks,
-badari

>
> --
>     Best wishes
> 
>     H. Dieter Wilhelm
>     Darmstadt, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: binding C-uC-SPC to a new key
  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>
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Drew Adams @ 2006-12-21 16:46 UTC (permalink / raw)


> > > 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.

C-u C-SPC does what you are asking, IIUC.

See also my post on Dec 16 to the thread "Re: vim's jumplist equivalent in
emacs?" for other ways to do this. Here is some doc on that:
http://www.emacswiki.org/cgi-bin/wiki/MarkCommands#IciclesGoToMarker.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: binding C-uC-SPC to a new key
       [not found]     ` <mailman.2193.1166719607.2155.help-gnu-emacs@gnu.org>
@ 2006-12-21 23:41       ` Badari Kakumani
  0 siblings, 0 replies; 7+ messages in thread
From: Badari Kakumani @ 2006-12-21 23:41 UTC (permalink / raw)



Drew Adams wrote:
> > > > 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.
>
> C-u C-SPC does what you are asking, IIUC.

i know it does what i want -- BUT i wanted to bind it to some different
key (since typing C-u C-SPC is inconvenient)... i could probably solve
it using macros. but i am exploring how to solve it thru some elisp
code.
all i need is a lisp function that invokes set-mark-command with a
prefix argument.
once i have this elisp function, i can bind it to a key i want.

i see the exact lisp function i wanted -- goto-previous-mark -- written
by you
in the URL you pointed below.  thanks very much.
i shall keep checking the emacswiki for such goodies i guess...

thanks,
-badari

>
> See also my post on Dec 16 to the thread "Re: vim's jumplist equivalent in
> emacs?" for other ways to do this. Here is some doc on that:
> http://www.emacswiki.org/cgi-bin/wiki/MarkCommands#IciclesGoToMarker.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: binding C-uC-SPC to a new key
  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-22  1:53     ` Dieter Wilhelm
       [not found]     ` <mailman.2208.1166752483.2155.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 7+ messages in thread
From: Dieter Wilhelm @ 2006-12-22  1:53 UTC (permalink / raw)
  Cc: help-gnu-emacs

"Badari Kakumani" <badarisj@gmail.com> writes:

> Dieter Wilhelm wrote:
>> "Badari Kakumani" <badarisj@gmail.com> writes:
>>
>> > folks,
>> >
>> > 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.

Ohhhh, now I understand you, sorry for my confusion.  But nevertheless
I really think it is not necessary to create a new binding for "C-u
C-SPC".

Because (in Emacs 22)

(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".

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: binding C-uC-SPC to a new key
       [not found]     ` <mailman.2208.1166752483.2155.help-gnu-emacs@gnu.org>
@ 2006-12-22 13:47       ` rgb
  0 siblings, 0 replies; 7+ messages in thread
From: rgb @ 2006-12-22 13:47 UTC (permalink / raw)


> >> > 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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-12-22 13:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.