all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "José A. Romero L." <escherdragon@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: easy-to-use bookmarks functionality
Date: Tue, 16 Mar 2010 13:58:22 -0700 (PDT)	[thread overview]
Message-ID: <ad28fd36-baf6-4513-b4dc-15944afa12a3@v34g2000prm.googlegroups.com> (raw)
In-Reply-To: d8825ea0-e095-42b9-8c22-c756df47dc93@k17g2000yqb.googlegroups.com

On 16 Mar, 16:51, alex_sv <avshaba...@gmail.com> wrote:
> Hi all,
>
> For my own needs I wrote a small function that provides easy-to-use
> bookmarking: C-[1..9] - sets "bookmark" (in fact remembers point in
> the corresponding register), M-[1..9] - jumps to the corresponding
> position.
(...)

Cool idea. Here is a somewhat shorter implementation:

(defun jarl/bind-navigation-command-to-numkeys ()
  (dotimes (i 9)
    (local-set-key
     (read-kbd-macro (concat "C-" (number-to-string (1+ i))))
     `(lambda () (interactive) (point-to-register ,(1+ i))))
    (local-set-key
     (read-kbd-macro (concat "M-" (number-to-string (1+ i))))
     `(lambda () (interactive) (register-to-point ,(1+ i))))))

Cheers,
--
José A. Romero L.
escherdragon at gmail
"We who cut mere stones must always be envisioning cathedrals."
(Quarry worker's creed)


  reply	other threads:[~2010-03-16 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 15:51 [elisp] easy-to-use bookmarks functionality alex_sv
2010-03-16 20:58 ` José A. Romero L. [this message]
2010-03-17  9:48   ` alex_sv
2010-03-19 16:47     ` Christian Dietrich

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad28fd36-baf6-4513-b4dc-15944afa12a3@v34g2000prm.googlegroups.com \
    --to=escherdragon@gmail.com \
    --cc=help-gnu-emacs@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 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.