all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bookmark.el patch for 1) other window and 2) C-x p instead of C-x r
@ 2007-07-13 16:30 Drew Adams
  2007-07-13 18:27 ` Karl Fogel
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Drew Adams @ 2007-07-13 16:30 UTC (permalink / raw)
  To: Emacs-Devel

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

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

end of thread, other threads:[~2007-07-27 11:34 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13 16:30 bookmark.el patch for 1) other window and 2) C-x p instead of C-x r Drew Adams
2007-07-13 18:27 ` 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

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.