all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "Emacs-Devel" <emacs-devel@gnu.org>
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	[thread overview]
Message-ID: <BDEIJAFNGDOAGCJIPKPBAELOCFAA.drew.adams@oracle.com> (raw)

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

             reply	other threads:[~2007-07-13 16:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13 16:30 Drew Adams [this message]
2007-07-13 18:27 ` bookmark.el patch for 1) other window and 2) C-x p instead of C-x r Karl Fogel
2007-07-13 23:09 ` Richard Stallman
2007-07-13 23:21   ` Karl Fogel
2007-07-13 23:29     ` Drew Adams
2007-07-13 23:37 ` Kim F. Storm
2007-07-13 23:55   ` Karl Fogel
2007-07-14 18:17     ` Karl Fogel
2007-07-14 22:33     ` Richard Stallman
2007-07-14 22:47       ` Karl Fogel
2007-07-15 20:46         ` Juri Linkov
2007-07-16 15:49           ` Richard Stallman
2007-07-27 11:07             ` Dieter Wilhelm
2007-07-27 11:11               ` David Kastrup
2007-07-27 11:34                 ` Dieter Wilhelm
2007-07-14  0:01   ` Drew Adams

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=BDEIJAFNGDOAGCJIPKPBAELOCFAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@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.