From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Jos=E9_A=2E_Romero_L=2E?= Newsgroups: gmane.emacs.help Subject: Re: easy-to-use bookmarks functionality Date: Tue, 16 Mar 2010 13:58:22 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1272994455 23771 80.91.229.12 (4 May 2010 17:34:15 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 4 May 2010 17:34:15 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 04 19:34:14 2010 connect(): No such file or directory Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9M0Y-0001eN-5V for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 19:34:10 +0200 Original-Received: from localhost ([127.0.0.1]:42883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O9M0X-0001lZ-Ib for geh-help-gnu-emacs@m.gmane.org; Tue, 04 May 2010 13:34:09 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!v34g2000prm.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Original-NNTP-Posting-Host: 89.78.68.41 Original-X-Trace: posting.google.com 1268773207 27332 127.0.0.1 (16 Mar 2010 21:00:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 16 Mar 2010 21:00:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v34g2000prm.googlegroups.com; posting-host=89.78.68.41; posting-account=mkEKGAoAAACAV2vhv5r9WHXWqsdL_niD User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6,gzip(gfe),gzip(gfe) Original-Xref: usenet.stanford.edu gnu.emacs.help:177482 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:72990 Archived-At: On 16 Mar, 16:51, alex_sv 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=E9 A. Romero L. escherdragon at gmail "We who cut mere stones must always be envisioning cathedrals." (Quarry worker's creed)