emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bookmark.el patch for 1) other window and 2) C-x p instead of C-x r


From: Karl Fogel
Subject: Re: bookmark.el patch for 1) other window and 2) C-x p instead of C-x r
Date: Fri, 13 Jul 2007 11:27:34 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

"Drew Adams" <address@hidden> writes:
> 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.

Thanks.  I've committed these (in separate commits, because they're
two independent changes).

Please speak up, folks, if you think this new mapping is not good.  I
understand that changing from a few keys under `C-x r' to a whole
keymap under `C-x p' might be controversial, as space under ctl-x-map
is scarce.  I'm happy to revert, remap in some other way, whatever.

For reference, the commits are:

   revision 1.90, commitid mWoPbju3pgNotDps
   revision 1.92, commitid iTjqYHP9NtkZuDps

-Karl

> ----------------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
>
>
>
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]