From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: bookmark.el patch for 1) other window and 2) C-x p instead of C-x r Date: Fri, 13 Jul 2007 09:30:52 -0700 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184344355 25346 80.91.229.12 (13 Jul 2007 16:32:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Jul 2007 16:32:35 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 13 18:32:33 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I9O4G-00029Y-SN for ged-emacs-devel@m.gmane.org; Fri, 13 Jul 2007 18:32:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9O4F-0000tH-Um for ged-emacs-devel@m.gmane.org; Fri, 13 Jul 2007 12:32:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I9O4B-0000qP-QF for emacs-devel@gnu.org; Fri, 13 Jul 2007 12:32:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I9O4B-0000pn-7o for emacs-devel@gnu.org; Fri, 13 Jul 2007 12:32:27 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9O4B-0000pe-5y for emacs-devel@gnu.org; Fri, 13 Jul 2007 12:32:27 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I9O4A-0002S9-LE for emacs-devel@gnu.org; Fri, 13 Jul 2007 12:32:26 -0400 Original-Received: from rgmgw3.us.oracle.com (rgmgw3.us.oracle.com [138.1.186.112]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id l6DGWNJi018455 for ; Fri, 13 Jul 2007 10:32:23 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw3.us.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id l6DDL25o020979 for ; Fri, 13 Jul 2007 10:32:22 -0600 Original-Received: from dhcp-amer-csvpn-gw2-141-144-72-53.vpn.oracle.com by acsmt351.oracle.com with ESMTP id 3037202661184344256; Fri, 13 Jul 2007 09:30:56 -0700 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Importance: Normal X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74721 Archived-At: Here is a bookmark.el patch with a minor enhancement to let you use another window. It also replaces use of `C-x r' for bookmark commands by use of `C-x p'. I think that's better, because: 1. It reserves all of `C-x r' for register and rectangle commands. (Even those should be split, IMO.) 2. It lets you reuse the standard bookmark keys with `C-x p', instead of having, for instance, `j' mean jump in the bookmark-map, but `b' mean jump when used with `C-x r'. Nothing new to remember this way: just add `C-x p' in front of all bookmark-map keys. ----------------8<-------------------------------- *** bookmark-CVS-2007-07-13.el Fri Jul 13 09:09:08 2007 --- bookmark-CVS-patched-2007-07-13.el Fri Jul 13 09:23:58 2007 *************** *** 224,232 **** ;; Set up these bindings dumping time *only*; ;; if the user alters them, don't override the user when loading bookmark.el. ! ;;;###autoload (define-key ctl-x-map "rb" 'bookmark-jump) ! ;;;###autoload (define-key ctl-x-map "rm" 'bookmark-set) ! ;;;###autoload (define-key ctl-x-map "rl" 'bookmark-bmenu-list) ;;;###autoload (defvar bookmark-map nil --- 224,230 ---- ;; Set up these bindings dumping time *only*; ;; if the user alters them, don't override the user when loading bookmark.el. ! ;;;###autoload (define-key ctl-x-map "p" bookmark-map) ;;;###autoload (defvar bookmark-map nil *************** *** 243,248 **** --- 241,248 ---- ;;;###autoload (define-key bookmark-map "m" 'bookmark-set) ; "m" for "mark" ;;;###autoload (define-key bookmark-map "j" 'bookmark-jump) ;;;###autoload (define-key bookmark-map "g" 'bookmark-jump) ; "g" for "go" + ;;;###autoload (define-key bookmark-map "o" 'bookmark-jump-other-window) + ;;;###autoload (define-key bookmark-map "q" 'bookmark-jump-other-window) ;;;###autoload (define-key bookmark-map "i" 'bookmark-insert) ;;;###autoload (define-key bookmark-map "e" 'edit-bookmarks) ;;;###autoload (define-key bookmark-map "f" 'bookmark-insert-location) ; "f" for "find" *************** *** 1082,1087 **** --- 1082,1106 ---- ;; show it in a buffer. (bookmark-show-annotation bookmark))))) + ;;;###autoload + (defun bookmark-jump-other-window (bookmark) + "Jump to BOOKMARK (a point in some file) in another window. + See `bookmark-jump'." + (interactive + (let ((bkm (bookmark-completing-read "Jump to bookmark (in another window)" + bookmark-current-bookmark))) + (if (> emacs-major-version 21) + (list bkm) bkm))) + (when bookmark + (bookmark-maybe-historicize-string bookmark) + (let ((cell (bookmark-jump-noselect bookmark))) + (and cell + (switch-to-buffer-other-window (car cell)) + (goto-char (cdr cell)) + (if bookmark-automatically-show-annotations + ;; if there is an annotation for this bookmark, + ;; show it in a buffer. + (bookmark-show-annotation bookmark)))))) (defun bookmark-file-or-variation-thereof (file) "Return FILE (a string) if it exists, or return a reasonable