;;; bookmark+-key.el --- Bookmark+ key and menu bindings. ;; ;; Filename: bookmark+-key.el ;; Description: Bookmark+ key and menu bindings. ;; Author: Drew Adams ;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com") ;; Copyright (C) 2010-2011, Drew Adams, all rights reserved. ;; Created: Fri Apr 1 15:34:50 2011 (-0700) ;; Version: ;; Last-Updated: Mon Apr 25 06:54:55 2011 (-0700) ;; By: dradams ;; Update #: 256 ;; URL: http://www.emacswiki.org/cgi-bin/wiki/bookmark+-key.el ;; Keywords: bookmarks, bookmark+, placeholders, annotations, search, info, url, w3m, gnus ;; Compatibility: GNU Emacs: 20.x, 21.x, 22.x, 23.x ;; ;; Features that might be required by this library: ;; ;; None ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: ;; ;; The Bookmark+ libraries are these: ;; ;; `bookmark+.el' - main (driver) library ;; `bookmark+-mac.el' - Lisp macros ;; `bookmark+-lit.el' - (optional) code for highlighting bookmarks ;; `bookmark+-bmu.el' - code for the `*Bookmark List*' (bmenu) ;; `bookmark+-1.el' - other (non-bmenu) required code ;; `bookmark+-key.el' - key and menu bindings (this file) ;; ;; `bookmark+-doc.el' - documentation (comment-only file) ;; `bookmark+-chg.el' - change log (comment-only file) ;; ;; The documentation (in `bookmark+-doc.el') includes how to ;; byte-compile and install Bookmark+. The documentation is also ;; available in these ways: ;; ;; 1. From the bookmark list (`C-x r l'): ;; Use `?' to show the current bookmark-list status and general ;; help, then click link `Doc in Commentary' or link `Doc on the ;; Web'. ;; ;; 2. From the Emacs-Wiki Web site: ;; http://www.emacswiki.org/cgi-bin/wiki/BookmarkPlus. ;; ;; 3. From the Bookmark+ group customization buffer: ;; `M-x customize-group bookmark-plus', then click link ;; `Commentary'. ;; ;; (The commentary links in #1 and #3 work only if you have library ;; `bookmark+-doc.el' in your `load-path'.) ;; ;; ;; Internal variables defined here: ;; ;; `bmkp-find-file-menu', `bmkp-highlight-menu', `bmkp-jump-map', ;; `bmkp-jump-menu', `bmkp-options-menu', ;; `bmkp-jump-other-window-map', `bmkp-jump-tags-menu', ;; `bmkp-set-map', `bmkp-tags-map', `bmkp-tags-menu'. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; *This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as ;; published by the Free Software Foundation; either version 3, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth ;; Floor, Boston, MA 02110-1301, USA. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Code: ;;;;;;;;;;;;;;;;;;;;; ;; Quiet the byte-compiler (defvar bmkp-bmenu-menubar-menu) ; Defined in `bookmark+-bmu.el'. (defvar bmkp-crosshairs-flag) ; Defined in `bookmark+-1.el'. (defvar bmkp-prompt-for-tags-flag) ; Defined in `bookmark+-1.el'. (defvar bmkp-save-new-location-flag) ; Defined in `bookmark+-1.el'. (defvar diredp-menu-bar-subdir-menu) ; Defined in `dired+.el'. (defvar gnus-summary-mode-map) ; Defined in `gnus-sum.el'. (defvar Info-mode-map) ; Defined in `info.el'. (defvar Info-mode-menu) ; Defined in `info.el'. (defvar Man-mode-map) ; Defined in `man.el'. (defvar mouse-wheel-down-event) ; Defined in `mwheel.el'. (defvar mouse-wheel-up-event) ; Defined in `mwheel.el'. (defvar w3m-minor-mode-map) ; Defined in `w3m.el'. (defvar w3m-mode-map) ; Defined in `w3m.el'. (defvar woman-menu) ; Defined in `woman.el'. (defvar woman-mode-map) ; Defined in `woman.el'. ;;(@* "Keymaps") ;;; Keymaps ---------------------------------------------------------- ;; `bookmark-map' (define-key ctl-x-map "p" bookmark-map) (define-key ctl-x-map "pj" 'bookmark-jump-other-window) (define-key ctl-x-map "rK" 'bmkp-set-desktop-bookmark) (define-key bookmark-map "0" 'bmkp-empty-file) (define-key bookmark-map "B" 'bmkp-choose-navlist-from-bookmark-list) (define-key bookmark-map "E" 'bmkp-edit-bookmark) (define-key bookmark-map "I" 'bookmark-insert-location) ; The original in `bookmark.el' was `f'. (define-key bookmark-map "K" 'bmkp-set-desktop-bookmark) (define-key bookmark-map "L" 'bmkp-switch-bookmark-file) (define-key bookmark-map "N" 'bmkp-navlist-bmenu-list) (define-key bookmark-map "o" 'bookmark-jump-other-window) (define-key bookmark-map "q" 'bookmark-jump-other-window) (define-key bookmark-map "x" 'bmkp-set-bookmark-file-bookmark) (when (featurep 'bookmark+-lit) (define-key bookmark-map "h" 'bmkp-light-bookmark-this-buffer) (define-key bookmark-map "H" 'bmkp-light-bookmarks) (define-key bookmark-map "u" 'bmkp-unlight-bookmark-this-buffer) (define-key bookmark-map "U" 'bmkp-unlight-bookmarks) (define-key bookmark-map "\C-u" 'bmkp-unlight-bookmark-here) (define-key bookmark-map "=" 'bmkp-bookmarks-lighted-at-point)) (define-key bookmark-map "." 'bmkp-this-buffer-bmenu-list) (define-key bookmark-map "?" 'bmkp-describe-bookmark) (define-key bookmark-map ":" 'bmkp-choose-navlist-of-type) (define-key bookmark-map "\r" 'bmkp-toggle-autonamed-bookmark-set/delete) (define-key bookmark-map [delete] 'bmkp-delete-bookmarks) ;; If you use Emacs before Emacs 22, then you will want to bind the commands ;; whose names do *not* end in `-repeat' to keys that are easily repeatable. ;; For example, you might want to bind `bmkp-next-bookmark-this-buffer' ;; (not `bmkp-next-bookmark-this-buffer-repeat') to a key such as [f2]. ;; (when (> emacs-major-version 21) (define-key bookmark-map [down] 'bmkp-next-bookmark-this-buffer-repeat) (define-key bookmark-map "n" 'bmkp-next-bookmark-this-buffer-repeat) (define-key bookmark-map "\C-n" 'bmkp-next-bookmark-this-buffer-repeat) ;; This requires the fix for Emacs bug #6256, which is in Emacs 23.3 (presumably). ;; For older Emacs versions you can bind the wheel event to `bmkp-next-bookmark-this-buffer' ;; in the global map. IOW, prior to Emacs 23.3 a mouse event won't work with `repeat'. (when (and (boundp 'mouse-wheel-up-event) (or (> emacs-major-version 23) (and (= emacs-major-version 23) (> emacs-minor-version 2)))) (define-key bookmark-map (vector (list mouse-wheel-up-event)) 'bmkp-next-bookmark-this-buffer-repeat)) (define-key bookmark-map [up] 'bmkp-previous-bookmark-this-buffer-repeat) (define-key bookmark-map "p" 'bmkp-previous-bookmark-this-buffer-repeat) (define-key bookmark-map "\C-p" 'bmkp-previous-bookmark-this-buffer-repeat) ;; This requires the fix for Emacs bug #6256, which is in Emacs 23.3 (presumably). ;; For older Emacs versions you can bind the wheel event to `bmkp-previous-bookmark-this-buffer' ;; in the global map. IOW, prior to Emacs 23.3 a mouse event won't work with `repeat'. (when (and (boundp 'mouse-wheel-down-event) (or (> emacs-major-version 23) (and (= emacs-major-version 23) (> emacs-minor-version 2)))) (define-key bookmark-map (vector (list mouse-wheel-down-event)) 'bmkp-previous-bookmark-this-buffer-repeat)) (define-key bookmark-map [right] 'bmkp-next-bookmark-repeat) (define-key bookmark-map "f" 'bmkp-next-bookmark-repeat) (define-key bookmark-map "\C-f" 'bmkp-next-bookmark-repeat) (define-key bookmark-map [left] 'bmkp-previous-bookmark-repeat) (define-key bookmark-map "b" 'bmkp-previous-bookmark-repeat) (define-key bookmark-map "\C-b" 'bmkp-previous-bookmark-repeat) (define-key bookmark-map [next] 'bmkp-next-bookmark-w32-repeat) (define-key bookmark-map [prior] 'bmkp-previous-bookmark-w32-repeat) (when (featurep 'bookmark+-lit) (define-key bookmark-map [C-down] 'bmkp-next-lighted-this-buffer-repeat) (define-key bookmark-map [C-up] 'bmkp-previous-lighted-this-buffer-repeat))) ;; `bmkp-set-map': prefix `C-x p c' (defvar bmkp-set-map nil "Keymap containing bindings for bookmark set commands.") (define-prefix-command 'bmkp-set-map) (define-key bookmark-map "c" bmkp-set-map) ; `C-x p c' for create (define-key bmkp-set-map "a" 'bmkp-autofile-set) ; `C-x p c a' (define-key bmkp-set-map "f" 'bmkp-file-target-set) ; `C-x p c f' (define-key bmkp-set-map "K" 'bmkp-set-desktop-bookmark) ; `C-x p c K' (define-key bmkp-set-map "m" 'bookmark-set) ; `C-x p c m' (define-key bmkp-set-map "u" 'bmkp-url-target-set) ; `C-x p c u' (define-key bmkp-set-map "x" 'bmkp-set-bookmark-file-bookmark) ; `C-x p c x' (define-key bmkp-set-map "\r" 'bmkp-toggle-autonamed-bookmark-set/delete) ; `C-x p c RET' ;; Add set commands to other keymaps: occur, compilation: `C-c C-b', `C-c C-M-b', `C-c C-M-B'. ;; See `dired+.el' for Dired bookmarking keys, which are different. (add-hook 'occur-mode-hook #'(lambda () (unless (lookup-key occur-mode-map "\C-c\C-b") (define-key occur-mode-map "\C-c\C-b" 'bmkp-occur-target-set)) (unless (lookup-key occur-mode-map "\C-c\C-\M-b") (define-key occur-mode-map "\C-c\C-\M-b" 'bmkp-occur-target-set-all)) (unless (lookup-key occur-mode-map [(control ?c) (control meta shift ?b)]) (define-key occur-mode-map [(control ?c) (control meta shift ?b)] 'bmkp-occur-create-autonamed-bookmarks)))) (add-hook 'compilation-mode-hook #'(lambda () (unless (lookup-key occur-mode-map "\C-c\C-b") (define-key occur-mode-map "\C-c\C-b" 'bmkp-compilation-target-set)) (unless (lookup-key occur-mode-map "\C-c\C-\M-b") (define-key occur-mode-map "\C-c\C-\M-b" 'bmkp-compilation-target-set-all)))) (add-hook 'compilation-minor-mode-hook #'(lambda () (unless (lookup-key occur-mode-map "\C-c\C-b") (define-key occur-mode-map "\C-c\C-b" 'bmkp-compilation-target-set)) (unless (lookup-key occur-mode-map "\C-c\C-\M-b") (define-key occur-mode-map "\C-c\C-\M-b" 'bmkp-compilation-target-set-all)))) ;; `bmkp-tags-map': prefix `C-x p t' (defvar bmkp-tags-map nil "Keymap containing bindings for bookmark tag commands.") (define-prefix-command 'bmkp-tags-map) (define-key bookmark-map "t" bmkp-tags-map) ; `C-x p t' for tags (define-key bmkp-tags-map "0" 'bmkp-remove-all-tags) ; `C-x p t 0' (define-key bmkp-tags-map "+" nil) ; For Emacs 20 (define-key bmkp-tags-map "+b" 'bmkp-add-tags) ; `C-x p t + b' (define-key bmkp-tags-map "-b" 'bmkp-remove-tags) ; `C-x p t - b' (define-key bmkp-tags-map "+a" 'bmkp-tag-a-file) ; `C-x p t + a' (define-key bmkp-tags-map "-a" 'bmkp-untag-a-file) ; `C-x p t - a' (define-key bmkp-tags-map "c" 'bmkp-copy-tags) ; `C-x p t c' (define-key bmkp-tags-map "d" 'bmkp-remove-tags-from-all) ; `C-x p t d' (define-key bmkp-tags-map "e" 'bmkp-edit-tags) ; `C-x p t e' (define-key bmkp-tags-map "l" 'bmkp-list-all-tags) ; `C-x p t l' (define-key bmkp-tags-map "p" 'bmkp-paste-add-tags) ; `C-x p t p' (define-key bmkp-tags-map "q" 'bmkp-paste-replace-tags) ; `C-x p t q' (define-key bmkp-tags-map "r" 'bmkp-rename-tag) ; `C-x p t r' (define-key bmkp-tags-map "v" 'bmkp-set-tag-value) ; `C-x p t v' (define-key bmkp-tags-map "V" 'bmkp-set-tag-value-for-navlist) ; `C-x p t V' (define-key bmkp-tags-map "\M-w" 'bmkp-copy-tags) ; `C-x p t M-w' (define-key bmkp-tags-map "\C-y" 'bmkp-paste-add-tags) ; `C-x p t C-y' ;; `bmkp-jump-map' and `bmkp-jump-other-window-map': prefixes `C-x j' and `C-x 4 j' (defvar bmkp-jump-map nil "Keymap containing bindings for bookmark jump commands.") (defvar bmkp-jump-other-window-map nil "Keymap containing bindings for bookmark jump other-window commands.") (define-prefix-command 'bmkp-jump-map) (define-prefix-command 'bmkp-jump-other-window-map) (define-key ctl-x-map "j" bmkp-jump-map) (define-key ctl-x-4-map "j" bmkp-jump-other-window-map) (define-key bmkp-jump-map "." 'bmkp-this-buffer-jump) ; `C-x j .' (define-key bmkp-jump-other-window-map "." 'bmkp-this-buffer-jump-other-window) ; `C-x 4 j .' (define-key bmkp-jump-map "#" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "#" nil) ; For Emacs 20 (define-key bmkp-jump-map "##" 'bmkp-autonamed-jump) ; `C-x j # #' (define-key bmkp-jump-other-window-map "##" 'bmkp-autonamed-jump-other-window) ; `C-x 4 j # #' (define-key bmkp-jump-map "#." 'bmkp-autonamed-this-buffer-jump) ; `C-x j # .' (define-key bmkp-jump-other-window-map "#." 'bmkp-autonamed-this-buffer-jump-other-window) ; `C-x 4 j # .' (define-key bmkp-jump-map "=" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "=" nil) ; For Emacs 20 (define-key bmkp-jump-map "=b" 'bmkp-specific-buffers-jump) ; `C-x j = b' (define-key bmkp-jump-other-window-map "=b" 'bmkp-specific-buffers-jump-other-window) ; `C-x 4 j = b' (define-key bmkp-jump-map "=f" 'bmkp-specific-files-jump) ; `C-x j = f' (define-key bmkp-jump-other-window-map "=f" 'bmkp-specific-files-jump-other-window) ; `C-x 4 j = f' (when (> emacs-major-version 21) ; Needs `read-file-name' with a PREDICATE arg. (define-key bmkp-jump-map "a" 'bmkp-find-file) ; `C-x j a' (define-key bmkp-jump-other-window-map "a" 'bmkp-find-file-other-window)) ; `C-x 4 j a' (define-key bmkp-jump-map "b" 'bmkp-non-file-jump) ; `C-x j b' (define-key bmkp-jump-other-window-map "b" 'bmkp-non-file-jump-other-window) ; `C-x 4 j b' (define-key bmkp-jump-map "B" 'bmkp-bookmark-list-jump) ; `C-x j B' (define-key bmkp-jump-other-window-map "B" 'bmkp-bookmark-list-jump) ; SAME (define-key bmkp-jump-map "d" 'bmkp-dired-jump) ; `C-x j d' (define-key bmkp-jump-other-window-map "d" 'bmkp-dired-jump-other-window) ; `C-x 4 j d' (define-key bmkp-jump-map "\C-d" 'bmkp-dired-this-dir-jump) ; `C-x j C-d' (define-key bmkp-jump-other-window-map "\C-d" 'bmkp-dired-this-dir-jump-other-window) ; `C-x 4 j C-d' (define-key bmkp-jump-map "f" 'bmkp-file-jump) ; `C-x j f' (define-key bmkp-jump-other-window-map "f" 'bmkp-file-jump-other-window) ; `C-x 4 j f' (define-key bmkp-jump-map "\C-f" 'bmkp-file-this-dir-jump) ; `C-x j C-f' (define-key bmkp-jump-other-window-map "\C-f" 'bmkp-file-this-dir-jump-other-window) ; `C-x 4 j C-f' (define-key bmkp-jump-map "g" 'bmkp-gnus-jump) ; `C-x j g' (define-key bmkp-jump-other-window-map "g" 'bmkp-gnus-jump-other-window) ; `C-x 4 j g' (define-key bmkp-jump-map "h" 'bmkp-lighted-jump) ; `C-x j h' (define-key bmkp-jump-other-window-map "h" 'bmkp-lighted-jump-other-window) ; `C-x 4 j h' (define-key bmkp-jump-map "i" 'bmkp-info-jump) ; `C-x j i' (define-key bmkp-jump-other-window-map "i" 'bmkp-info-jump-other-window) ; `C-x 4 j i' (define-key bmkp-jump-map "j" 'bookmark-jump) ; `C-x j j' (put 'bookmark-jump :advertised-binding "\C-xjj") (define-key bmkp-jump-other-window-map "j" 'bookmark-jump-other-window) ; `C-x 4 j j' (put 'bookmark-jump-other-window :advertised-binding "\C-x4jj") (put 'jump-other :advertised-binding "\C-x4jj") (define-key bmkp-jump-map "K" 'bmkp-desktop-jump) ; `C-x j K' (define-key bmkp-jump-other-window-map "K" 'bmkp-desktop-jump) ; SAME (define-key bmkp-jump-map "l" 'bmkp-local-file-jump) ; `C-x j l' (define-key bmkp-jump-other-window-map "l" 'bmkp-local-file-jump-other-window) ; `C-x 4 j l' (define-key bmkp-jump-map "m" 'bmkp-man-jump) ; `C-x j m' (define-key bmkp-jump-other-window-map "m" 'bmkp-man-jump-other-window) ; `C-x 4 j m' (define-key bmkp-jump-map "n" 'bmkp-remote-file-jump) ; `C-x j n' ("_n_etwork") (define-key bmkp-jump-other-window-map "n" 'bmkp-remote-file-jump-other-window) ; `C-x 4 j n' (define-key bmkp-jump-map "N" 'bmkp-jump-in-navlist) ; `C-x j N' (define-key bmkp-jump-other-window-map "N" 'bmkp-jump-in-navlist-other-window) ; `C-x 4 j N' (define-key bmkp-jump-map "r" 'bmkp-region-jump) ; `C-x j r' (define-key bmkp-jump-other-window-map "r" 'bmkp-region-jump-other-window) ; `C-x 4 j r' (define-key bmkp-jump-map "t" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "t" nil) ; For Emacs 20 (define-key bmkp-jump-map "t*" 'bmkp-all-tags-jump) ; `C-x j t *' (define-key bmkp-jump-other-window-map "t*" 'bmkp-all-tags-jump-other-window) ; `C-x 4 j t *' (define-key bmkp-jump-map "t+" 'bmkp-some-tags-jump) ; `C-x j t +' (define-key bmkp-jump-other-window-map "t+" 'bmkp-some-tags-jump-other-window) ; `C-x 4 j t +' (define-key bmkp-jump-map "t%" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "t%" nil) ; For Emacs 20 (define-key bmkp-jump-map "t%*" 'bmkp-all-tags-regexp-jump) ; `C-x j t % *' (define-key bmkp-jump-other-window-map "t%*" 'bmkp-all-tags-regexp-jump-other-window) ; `C-x 4 j t % *' (define-key bmkp-jump-map "t%+" 'bmkp-some-tags-regexp-jump) ; `C-x j t % +' (define-key bmkp-jump-other-window-map "t%+" 'bmkp-some-tags-regexp-jump-other-window) ; `C-x 4 j t % +' (when (> emacs-major-version 21) ; Needs `read-file-name' with a PREDICATE arg. (define-key bmkp-jump-map "ta*" 'bmkp-find-file-all-tags) ; `C-x j t a *' (define-key bmkp-jump-other-window-map "ta*" 'bmkp-find-file-all-tags-other-window) ; `C-x 4 j t a *' (define-key bmkp-jump-map "ta+" 'bmkp-find-file-some-tags) ; `C-x j t a +' (define-key bmkp-jump-other-window-map "ta+" 'bmkp-find-file-some-tags-other-window) ; `C-x 4 j t a +' (define-key bmkp-jump-map "ta%*" 'bmkp-find-file-all-tags-regexp) ; `C-x j t a % *' (define-key bmkp-jump-other-window-map "ta%*" 'bmkp-find-file-all-tags-regexp-other-window) ; `C-x 4 j t a % *' (define-key bmkp-jump-map "ta%+" 'bmkp-find-file-some-tags-regexp) ; `C-x j t a % +' (define-key bmkp-jump-other-window-map "ta%+" 'bmkp-find-file-some-tags-regexp-other-window)) ; `C-x 4 j t a % +' (define-key bmkp-jump-map "tf" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "tf" nil) ; For Emacs 20 (define-key bmkp-jump-map "tf*" 'bmkp-file-all-tags-jump) ; `C-x j t f *' (define-key bmkp-jump-other-window-map "tf*" 'bmkp-file-all-tags-jump-other-window) ; `C-x 4 j t f *' (define-key bmkp-jump-map "tf+" 'bmkp-file-some-tags-jump) ; `C-x j t f +' (define-key bmkp-jump-other-window-map "tf+" 'bmkp-file-some-tags-jump-other-window) ; `C-x 4 j t f +' (define-key bmkp-jump-map "tf%" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "tf%" nil) ; For Emacs 20 (define-key bmkp-jump-map "tf%*" 'bmkp-file-all-tags-regexp-jump) ; `C-x j t f % *' (define-key bmkp-jump-other-window-map "tf%*" 'bmkp-file-all-tags-regexp-jump-other-window) ; `C-x 4 j t f % *' (define-key bmkp-jump-map "tf%+" 'bmkp-file-some-tags-regexp-jump) ; `C-x j t f % +' (define-key bmkp-jump-other-window-map "tf%+" 'bmkp-file-some-tags-regexp-jump-other-window) ; `C-x 4 j t f % +' (define-key bmkp-jump-map "t\C-f" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "t\C-f" nil) ; For Emacs 20 (define-key bmkp-jump-map "t\C-f*" 'bmkp-file-this-dir-all-tags-jump) ; `C-x j t C-f *' (define-key bmkp-jump-other-window-map "t\C-f*" 'bmkp-file-this-dir-all-tags-jump-other-window) ; `C-x 4 j t C-f *' (define-key bmkp-jump-map "t\C-f+" 'bmkp-file-this-dir-some-tags-jump) ; `C-x j t C-f +' (define-key bmkp-jump-other-window-map "t\C-f+" 'bmkp-file-this-dir-some-tags-jump-other-window) ; `C-x 4 j t C-f +' (define-key bmkp-jump-map "t\C-f%" nil) ; For Emacs 20 (define-key bmkp-jump-other-window-map "t\C-f%" nil) ; For Emacs 20 (define-key bmkp-jump-map "t\C-f%*" 'bmkp-file-this-dir-all-tags-regexp-jump) ; `C-x j t C-f % *' (define-key bmkp-jump-other-window-map "t\C-f%*" 'bmkp-file-this-dir-all-tags-regexp-jump-other-window) ; `C-x 4 j t C-f % *' (define-key bmkp-jump-map "t\C-f%+" 'bmkp-file-this-dir-some-tags-regexp-jump) ; `C-x j t C-f % +' (define-key bmkp-jump-other-window-map "t\C-f%+" 'bmkp-file-this-dir-some-tags-regexp-jump-other-window) ; `C-x 4 j t C-f % +' (define-key bmkp-jump-map "u" 'bmkp-url-jump) ; `C-x j u' (define-key bmkp-jump-other-window-map "u" 'bmkp-url-jump-other-window) ; `C-x 4 j u' (define-key bmkp-jump-map "v" 'bmkp-variable-list-jump) ; `C-x j v' (define-key bmkp-jump-map "w" 'bmkp-w3m-jump) ; `C-x j w' (define-key bmkp-jump-other-window-map "w" 'bmkp-w3m-jump-other-window) ; `C-x 4 j w' (define-key bmkp-jump-map "x" 'bmkp-bookmark-file-jump) ; `C-x j x' (define-key bmkp-jump-map ":" 'bmkp-jump-to-type) ; `C-x j :' (define-key bmkp-jump-other-window-map ":" 'bmkp-jump-to-type-other-window) ; `C-x 4 j :' ;; Add jump commands to other keymaps: Buffer-menu, Dired, Gnus, Info, Man, Woman, W3M. (add-hook 'buffer-menu-mode-hook #'(lambda () (unless (lookup-key Buffer-menu-mode-map "j") (define-key Buffer-menu-mode-map "j" 'bmkp-non-file-jump)))) (add-hook 'dired-mode-hook #'(lambda () (let ((now (lookup-key dired-mode-map "J"))) ;; Uppercase, since `j' is `dired-goto-file'. (unless (and now (not (eq now 'undefined))) ; `dired+.el' uses `undefined'. (define-key dired-mode-map "J" 'bmkp-dired-jump)) (setq now (lookup-key dired-mode-map "\C-j")) (unless (and now (not (eq now 'undefined))) ; `dired+.el' uses `undefined'. (define-key dired-mode-map "\C-j" 'bmkp-dired-this-dir-jump))) (let ((map dired-mode-map) (sep '(menu-bar subdir separator-bmkp)) (bdj '(menu-bar subdir bmkp-dired-jump)) (bdjc '(menu-bar subdir bmkp-dired-this-dir-jump))) (when (boundp 'diredp-menu-bar-subdir-menu) ; In `dired+el'. (setq map diredp-menu-bar-subdir-menu sep (cddr sep) bdj (cddr bdj) bdjc (cddr bdjc))) (define-key map (apply #'vector sep) '("--")) (define-key map (apply #'vector bdj) '(menu-item "Jump to a Dired Bookmark" bmkp-dired-jump :help "Jump to a bookmarked Dired buffer")) (define-key map (apply #'vector bdjc) '(menu-item "Show This Dir Using a Bookmark" bmkp-dired-this-dir-jump :help "Use a bookmarked version of this directory"))))) (add-hook 'gnus-summary-mode-hook #'(lambda () (unless (lookup-key gnus-summary-mode-map "j") (define-key gnus-summary-mode-map "j" 'bmkp-gnus-jump)))) (add-hook 'Info-mode-hook #'(lambda () (unless (lookup-key Info-mode-map "j") (define-key Info-mode-map "j" 'bmkp-info-jump)) (define-key-after Info-mode-menu [bmkp-info-jump] '(menu-item "Jump to an Info Bookmark" bmkp-info-jump :help "Jump to a bookmarked Info node") 'Go\ to\ Node\.\.\.))) ; Used by `info(+).el' - corresponds to `Info-goto-node'. (add-hook 'Man-mode-hook #'(lambda () (unless (lookup-key Man-mode-map "j") (define-key Man-mode-map "j" 'bmkp-man-jump)))) (add-hook 'woman-mode-hook #'(lambda () (unless (lookup-key woman-mode-map "j") (define-key woman-mode-map "j" 'bmkp-man-jump)) (when (boundp 'woman-menu) (define-key-after woman-menu [bmkp-man-jump] '(menu-item "Jump to a `man'-page Bookmark" bmkp-man-jump :help "Jump to a bookmarked `man' page") 'WoMan\.\.\.)))) ; Used by `woman.el' - corresponds to command `woman'. (add-hook 'w3m-minor-mode-hook #'(lambda () (unless (lookup-key w3m-minor-mode-map "j") (define-key w3m-minor-mode-map "j" 'bmkp-w3m-jump)))) (add-hook 'w3m-mode-hook #'(lambda () (unless (lookup-key w3m-mode-map "j") (define-key w3m-mode-map "j" 'bmkp-w3m-jump)))) ;;; Vanilla Emacs `Bookmarks' menu (see also [jump] from `Bookmark+' menu, below). (define-key-after menu-bar-bookmark-map [separator-set] '("--") 'jump) (define-key-after menu-bar-bookmark-map [set] '(menu-item "Set Bookmark..." (lambda () (interactive) (call-interactively #'bookmark-set)) :help "Set a bookmark at point") 'separator-set) (define-key-after menu-bar-bookmark-map [bmkp-autofile-set] '(menu-item "Set Autofile Bookmark..." bmkp-autofile-set :help "Set and automatically name a bookmark for a given file") 'set) (define-key-after menu-bar-bookmark-map [bmkp-file-target-set] '(menu-item "Set Bookmark for File..." bmkp-file-target-set :help "Set a bookmark with a given name for a given file") 'bmkp-autofile-set) (define-key-after menu-bar-bookmark-map [bmkp-url-target-set] '(menu-item "Set Bookmark for URL..." bmkp-url-target-set :help "Set a bookmark for a given URL") 'bmkp-file-target-set) (define-key-after menu-bar-bookmark-map [bmkp-set-desktop-bookmark] '(menu-item "Set Bookmark for Desktop" bmkp-set-desktop-bookmark :help "Save the current desktop as a bookmark") 'bmkp-url-target-set) (define-key-after menu-bar-bookmark-map [bmkp-set-bookmark-file-bookmark] '(menu-item "Set Bookmark for Bookmark File..." bmkp-set-bookmark-file-bookmark :help "Set a bookmark that loads a bookmark file when jumped to") 'bmkp-set-desktop-bookmark) (define-key-after menu-bar-bookmark-map [bmkp-toggle-autoname-bookmark-set] '(menu-item "Set Autonamed Bookmark" bmkp-toggle-autonamed-bookmark-set/delete :help "Set an autonamed bookmark at point" :visible (not (bookmark-get-bookmark (funcall bmkp-autoname-bookmark-function (point)) 'noerror))) 'bmkp-set-bookmark-file-bookmark) (define-key-after menu-bar-bookmark-map [separator-delete] '("--") 'bmkp-toggle-autoname-bookmark-set) (define-key-after menu-bar-bookmark-map [bmkp-toggle-autoname-bookmark-delete] '(menu-item "Delete Autonamed Bookmark" bmkp-toggle-autonamed-bookmark-set/delete :help "Delete the autonamed bookmark at point" :visible (bookmark-get-bookmark (funcall bmkp-autoname-bookmark-function (point)) 'noerror)) 'bmkp-set-bookmark-file-bookmark) (define-key-after menu-bar-bookmark-map [bmkp-delete-all-autonamed-for-this-buffer] '(menu-item "Delete All Autonamed Bookmarks Here..." bmkp-delete-all-autonamed-for-this-buffer :help "Delete all autonamed bookmarks for the current buffer" :enable (mapcar #'bookmark-name-from-full-record (bmkp-autonamed-this-buffer-alist-only))) 'bmkp-toggle-autonamed-bookmark-set/delete) (define-key-after menu-bar-bookmark-map [bmkp-delete-bookmarks] '(menu-item "Delete Bookmarks Here..." bmkp-delete-bookmarks :help "Delete some bookmarks at point or, with `C-u', all bookmarks in the buffer" :enable (mapcar #'bookmark-name-from-full-record (bmkp-this-buffer-alist-only))) 'bmkp-delete-all-autonamed-for-this-buffer) (define-key-after menu-bar-bookmark-map [delete] '(menu-item "Delete Bookmark..." bookmark-delete :help "Delete the bookmark you choose by name" :enable bookmark-alist) 'bmkp-delete-bookmarks) (define-key-after menu-bar-bookmark-map [rename] '(menu-item "Rename Bookmark..." bookmark-rename :help "Rename the bookmark you choose by name" :enable bookmark-alist) 'delete) (define-key-after menu-bar-bookmark-map [bmkp-purge-notags-autofiles] '(menu-item "Purge Autofiles with No Tags..." bmkp-purge-notags-autofiles :help "Delete all autofile bookmarks that have no tags" :enable bookmark-alist) 'rename) (define-key-after menu-bar-bookmark-map [separator-0] '("--") 'bmkp-purge-notags-autofiles) (define-key-after menu-bar-bookmark-map [edit] '(menu-item "Show Bookmark List" bookmark-bmenu-list :help "Open the list of bookmarks in buffer `*Bookmark List*'") 'separator-0) (define-key-after menu-bar-bookmark-map [bmkp-this-buffer-bmenu-list] '(menu-item "Show Bookmark List for This Buffer" bmkp-this-buffer-bmenu-list :help "Open `*Bookmark List*' for the bookmarks in the current buffer (only)" :enable (mapcar #'bookmark-name-from-full-record (bmkp-this-buffer-alist-only))) 'edit) (define-key-after menu-bar-bookmark-map [bmkp-navlist-bmenu-list] '(menu-item "Show Bookmark List for Navlist" bmkp-navlist-bmenu-list :help "Open `*Bookmark List*' for bookmarks in navlist (only)" :enable bmkp-nav-alist) 'bmkp-this-buffer-bmenu-list) (define-key-after menu-bar-bookmark-map [separator-2] '("--") 'bmkp-navlist-bmenu-list) (define-key-after menu-bar-bookmark-map [bmkp-choose-navlist-of-type] '(menu-item "Set Navlist to Bookmarks of Type..." bmkp-choose-navlist-of-type :help "Set the navigation list to the bookmarks of a certain type") 'separator-2) (define-key-after menu-bar-bookmark-map [bmkp-choose-navlist-from-bookmark-list] '(menu-item "Set Navlist from Bookmark-List Bookmark..." bmkp-choose-navlist-from-bookmark-list :help "Set the navigation list from a bookmark-list bookmark") 'bmkp-choose-navlist-of-type) (define-key-after menu-bar-bookmark-map [bmkp-list-defuns-in-commands-file] '(menu-item "List User-Defined Bookmark Commands" bmkp-list-defuns-in-commands-file :help "List the functions defined in `bmkp-bmenu-commands-file'" :enable (and bmkp-bmenu-commands-file (file-readable-p bmkp-bmenu-commands-file))) 'bmkp-choose-navlist-from-bookmark-list) (define-key-after menu-bar-bookmark-map [bmkp-make-function-bookmark] '(menu-item "New Function Bookmark..." bmkp-make-function-bookmark :help "Create a bookmark that will invoke FUNCTION when \"jumped\" to") 'bmkp-list-defuns-in-commands-file) (define-key-after menu-bar-bookmark-map [insert] '(menu-item "Insert Bookmark Contents..." bookmark-insert :help "Insert bookmarked text") 'bmkp-make-function-bookmark) (define-key-after menu-bar-bookmark-map [locate] '(menu-item "Insert Bookmark Location..." bookmark-locate ; Alias for `bookmark-insert-location'. :help "Insert a bookmark's file or buffer name") 'insert) (define-key-after menu-bar-bookmark-map [separator-3] '("--") 'locate) (define-key-after menu-bar-bookmark-map [save] '(menu-item "Save Bookmarks" bookmark-save :help "Save currently defined bookmarks") 'separator-3) (define-key-after menu-bar-bookmark-map [write] '(menu-item "Save Bookmarks As..." bookmark-write :help "Write current bookmarks to a bookmark file") 'save) (define-key-after menu-bar-bookmark-map [bmkp-empty-file] '(menu-item "New (Empty) Bookmark File..." bmkp-empty-file :help "Create a new, empty bookmark file, or empty an existing bookmark file") 'write) (define-key-after menu-bar-bookmark-map [load] '(menu-item "Add Bookmarks from File..." bookmark-load :help "Load additional bookmarks from a bookmark file") 'bmkp-empty-file) (define-key-after menu-bar-bookmark-map [load-read-only] '(menu-item "Switch to Bookmark File..." bmkp-switch-bookmark-file :help "Switch to a different bookmark file, *replacing* the current set of bookmarks") 'load) ;; `bmkp-highlight-menu' of `Bookmarks' menu (when (featurep 'bookmark+-lit) (defvar bmkp-highlight-menu (make-sparse-keymap) "`Highlight' submenu for menu-bar `Bookmarks' menu.") (define-key menu-bar-bookmark-map [highlight] (cons "Highlight" bmkp-highlight-menu)) (define-key bmkp-highlight-menu [bmkp-unlight-bookmarks] '(menu-item "Unhighlight All" bmkp-unlight-bookmarks :help "Unhighlight all bookmarks (everywhere).")) (define-key bmkp-highlight-menu [bmkp-unlight-this-buffer] '(menu-item "Unhighlight All in Buffer" bmkp-unlight-this-buffer :help "Unhighlight all bookmarks in this buffer.")) (define-key bmkp-highlight-menu [bmkp-unlight-non-autonamed-this-buffer] '(menu-item "Unhighlight All Non-Autonamed in Buffer" bmkp-unlight-non-autonamed-this-buffer :help "Unhighlight all non-autonamed bookmarks in this buffer.")) (define-key bmkp-highlight-menu [bmkp-unlight-autonamed-this-buffer] '(menu-item "Unhighlight All Autonamed in Buffer" bmkp-unlight-autonamed-this-buffer :help "Unhighlight all autonamed bookmarks in this buffer.")) (define-key bmkp-highlight-menu [bmkp-unlight-bookmark] '(menu-item "Unhighlight One..." bmkp-unlight-bookmark :help "Unhighlight a bookmark.")) (define-key bmkp-highlight-menu [bmkp-unlight-bookmark-this-buffer] '(menu-item "Unhighlight One in Buffer..." bmkp-unlight-bookmark-this-buffer :help "Unhighlight a bookmark in this buffer.")) (define-key bmkp-highlight-menu [bmkp-unlight-bookmark-here] '(menu-item "Unhighlight This One" bmkp-unlight-bookmark-here :help "Unhighlight a bookmark at point or on its line.")) (define-key bmkp-highlight-menu [separator-1] '("--")) (define-key bmkp-highlight-menu [bmkp-light-bookmarks-in-region] '(menu-item "Highlight All in Region" bmkp-light-bookmarks-in-region :help "Highlight all bookmarks in the region.")) (define-key bmkp-highlight-menu [bmkp-light-this-buffer] '(menu-item "Highlight All in Buffer" bmkp-light-this-buffer :help "Highlight all bookmarks in this buffer.")) (define-key bmkp-highlight-menu [bmkp-light-non-autonamed-this-buffer] '(menu-item "Highlight All Non-Autonamed in Buffer" bmkp-light-non-autonamed-this-buffer :help "Highlight all non-autonamed bookmarks in this buffer.")) (define-key bmkp-highlight-menu [bmkp-light-autonamed-this-buffer] '(menu-item "Highlight All Autonamed in Buffer" bmkp-light-autonamed-this-buffer :help "Highlight all autonamed bookmarks in this buffer.")) (define-key bmkp-highlight-menu [bmkp-light-navlist-bookmarks] '(menu-item "Highlight All in Navigation List" bmkp-light-navlist-bookmarks :help "Highlight all bookmarks in the navigation list.")) (define-key bmkp-highlight-menu [bmkp-light-bookmark-this-buffer] '(menu-item "Highlight One in Buffer..." bmkp-light-bookmark-this-buffer :help "Highlight a bookmark in this buffer.")) (define-key bmkp-highlight-menu [bmkp-light-bookmark] '(menu-item "Highlight One..." bmkp-light-bookmark :help "Highlight a bookmark.")) (define-key bmkp-highlight-menu [separator-0] '("--")) (define-key bmkp-highlight-menu [bmkp-next-lighted-this-buffer] '(menu-item "Next in Buffer" bmkp-next-lighted-this-buffer :help "Cycle to the next highlighted bookmark in this buffer.")) (define-key bmkp-highlight-menu [bmkp-previous-lighted-this-buffer] '(menu-item "Previous in Buffer" bmkp-previous-lighted-this-buffer :help "Cycle to the previous highlighted bookmark in this buffer.")) (define-key bmkp-highlight-menu [bmkp-bookmarks-lighted-at-point] '(menu-item "List Highlighted at Point" bmkp-bookmarks-lighted-at-point :help "List the bookmarks at point that are highlighted.")) (define-key bmkp-highlight-menu [bmkp-set-lighting-for-bookmark] '(menu-item "Set Highlighting for One..." bmkp-set-lighting-for-bookmark :help "Set individual highlighting for a bookmark."))) ;; `bmkp-options-menu' of `Bookmarks' menu (defvar bmkp-options-menu (make-sparse-keymap) "`Toggle Option' submenu for menu-bar `Bookmarks' menu.") (define-key menu-bar-bookmark-map [options] (cons "Toggle Option" bmkp-options-menu)) (define-key bmkp-options-menu [bmkp-crosshairs-flag] (bmkp-menu-bar-make-toggle bmkp-crosshairs-flag bmkp-crosshairs-flag "Highlight Jump using Crosshairs" "Crosshairs highlighting is %s" "Temporarily highlight visited bookmarks using crosshairs")) (define-key bmkp-options-menu [bmkp-save-new-location-flag] (bmkp-menu-bar-make-toggle bmkp-save-new-location-flag bmkp-save-new-location-flag "Save after Relocating" "Saving relocated bookmarks is %s" "Save a bookmark after automatically relocating it")) (define-key bmkp-options-menu [bmkp-prompt-for-tags-flag] (bmkp-menu-bar-make-toggle bmkp-prompt-for-tags-flag bmkp-prompt-for-tags-flag "Prompt for Tags when Setting" "Prompting for tags when setting a bookmark is %s" "Prompt for tags when setting a bookmark interactively")) ;; `bmkp-tags-menu' of `Bookmarks' menu (defvar bmkp-tags-menu (make-sparse-keymap) "`Tags' submenu for menu-bar `Bookmarks' menu.") (define-key menu-bar-bookmark-map [tags] (cons "Tags" bmkp-tags-menu)) (define-key bmkp-tags-menu [bmkp-list-all-tags] '(menu-item "List All Tags" bmkp-list-all-tags :help "List all tags used for any bookmarks")) (define-key bmkp-tags-menu [bmkp-purge-notags-autofiles] '(menu-item "Purge Autofiles with No Tags..." bmkp-purge-notags-autofiles :help "Delete all autofile bookmarks that have no tags")) (define-key bmkp-tags-menu [bmkp-untag-a-file] '(menu-item "Untag a File (Remove Some)..." bmkp-untag-a-file :help "Remove some tags from autofile bookmark for a file")) (define-key bmkp-tags-menu [bmkp-tag-a-file] '(menu-item "Tag a File (Add Some)..." bmkp-tag-a-file :help "Add some tags to the autofile bookmark for a file")) (define-key bmkp-tags-menu [bmkp-rename-tag] '(menu-item "Rename Tag..." bmkp-rename-tag :help "Rename a tag in all bookmarks")) (define-key bmkp-tags-menu [bmkp-set-tag-value] '(menu-item "Set Tag Value..." bmkp-set-tag-value :help "Set the tag value for a given bookmark")) (define-key bmkp-tags-menu [bmkp-remove-tags-from-all] '(menu-item "Remove Some Tags from All..." bmkp-remove-tags-from-all :help "Remove a set of tags from all bookmarks")) (define-key bmkp-tags-menu [bmkp-remove-tags] '(menu-item "Remove Some Tags..." bmkp-remove-tags :help "Remove a set of tags from a bookmark")) (define-key bmkp-tags-menu [bmkp-add-tags] '(menu-item "Add Some Tags..." bmkp-add-tags :help "Add a set of tags to a bookmark")) (define-key bmkp-tags-menu [bmkp-paste-replace-tags] '(menu-item "Paste Tags (Replace)..." bmkp-paste-replace-tags :help "Replace tags for a bookmark with tags copied from another")) (define-key bmkp-tags-menu [bmkp-paste-add-tags] '(menu-item "Paste Tags (Add)..." bmkp-paste-add-tags :help "Add tags to a bookmark that were previously copied from another")) (define-key bmkp-tags-menu [bmkp-copy-tags] '(menu-item "Copy Tags..." bmkp-copy-tags :help "Copy the tags from a bookmark, so you can paste them to another")) ;; `bmkp-jump-menu' of `Bookmarks' menu (defvar bmkp-jump-menu (make-sparse-keymap) "`Jump To' submenu for menu-bar `Bookmarks' menu.") ;; Add jump menu to vanilla Emacs `Bookmarks' menu and remove the two jump commands already there. (define-key menu-bar-bookmark-map [jump] nil) (define-key menu-bar-bookmark-map [jump-other] nil) (define-key menu-bar-bookmark-map [bmkp-jump] (cons "Jump To" bmkp-jump-menu)) ;; `Jump To': Add jump menu also to the `Bookmark+' menu, and remove the two jump commands there. (define-key bmkp-bmenu-menubar-menu [jump] (cons "Jump To" bmkp-jump-menu)) (define-key bmkp-jump-menu [bmkp-autonamed-this-buffer-jump] '(menu-item "Autonamed for This Buffer..." bmkp-autonamed-this-buffer-jump :help "Jump to an autonamed bookmark in this buffer")) (define-key bmkp-jump-menu [bmkp-autonamed-jump-other-window] '(menu-item "Autonamed..." bmkp-autonamed-jump-other-window :help "Jump to an autonamed bookmark")) (define-key bmkp-jump-menu [bmkp-specific-files-jump-other-window] '(menu-item "For Specific Files..." bmkp-specific-files-jump-other-window :help "Jump to a bookmark for specific files")) (define-key bmkp-jump-menu [bmkp-specific-buffers-jump-other-window] '(menu-item "For Specific Buffers..." bmkp-specific-buffers-jump-other-window :help "Jump to a bookmark for specific buffers")) (define-key bmkp-jump-menu [bmkp-this-buffer-jump] '(menu-item "For This Buffer..." bmkp-this-buffer-jump :help "Jump to a bookmark for the current buffer" :enable (mapcar #'bookmark-name-from-full-record (bmkp-this-buffer-alist-only)))) (when (featurep 'bookmark+-lit) (define-key bmkp-jump-menu [bmkp-lighted-jump-other-window] '(menu-item "Highlighted..." bmkp-lighted-jump-other-window :help "Jump to a highlighted bookmark" :enable (bmkp-lighted-alist-only)))) (define-key bmkp-jump-menu [bmkp-jump-in-navlist-other-window] '(menu-item "In Navigation List..." bmkp-jump-in-navlist-other-window :help "Jump to a bookmark that is in the navigation list" :enable bmkp-nav-alist)) (define-key bmkp-jump-menu [jump-sep0] '("--")) (define-key bmkp-jump-menu [bmkp-url-jump-other-window] '(menu-item "URL..." bmkp-url-jump-other-window :help "Jump to a URL bookmark" :enable (bmkp-url-alist-only))) (define-key bmkp-jump-menu [bmkp-gnus-jump-other-window] '(menu-item "Gnus..." bmkp-gnus-jump-other-window :help "Jump to a Gnus bookmark" :enable (bmkp-gnus-alist-only))) (define-key bmkp-jump-menu [bmkp-man-jump-other-window] '(menu-item "Man Page..." bmkp-man-jump-other-window :help "Jump to a `man'-page bookmark" :enable (bmkp-man-alist-only))) (define-key bmkp-jump-menu [bmkp-info-jump-other-window] '(menu-item "Info Node..." bmkp-info-jump-other-window :help "Jump to an Info bookmark" :enable (bmkp-info-alist-only))) (define-key bmkp-jump-menu [bmkp-non-file-jump-other-window] '(menu-item "Buffer (Non-File)..." bmkp-non-file-jump-other-window :help "Jump to a non-file (buffer) bookmark" :enable (bmkp-non-file-alist-only))) (define-key bmkp-jump-menu [bmkp-region-jump-other-window] '(menu-item "Region..." bmkp-region-jump-other-window :help "Jump to a bookmark that defines the active region" :enable (bmkp-region-alist-only))) (define-key bmkp-jump-menu [bmkp-remote-file-jump-other-window] '(menu-item "Remote File..." bmkp-remote-file-jump-other-window :help "Jump to a remote file or directory bookmark" :enable (bmkp-remote-file-alist-only))) (define-key bmkp-jump-menu [bmkp-local-file-jump-other-window] '(menu-item "Local File..." bmkp-local-file-jump-other-window :help "Jump to a local file or directory bookmark" :enable (bmkp-local-file-alist-only))) (define-key bmkp-jump-menu [bmkp-file-this-dir-jump-other-window] '(menu-item "File in This Dir..." bmkp-file-this-dir-jump-other-window :help "Jump to a bookmark for a file or subdirectory in the `default-directory'." :enable (bmkp-file-alist-only))) (define-key bmkp-jump-menu [bmkp-file-jump-other-window] '(menu-item "File..." bmkp-file-jump-other-window :help "Jump to a file or directory bookmark" :enable (bmkp-file-alist-only))) (define-key bmkp-jump-menu [bmkp-dired-this-dir-jump-other-window] '(menu-item "Dired for This Dir..." bmkp-dired-this-dir-jump-other-window :help "Jump to a Dired bookmark for `default-directory', restoring recorded state" :enable (bmkp-dired-alist-only))) (define-key bmkp-jump-menu [bmkp-dired-jump-other-window] '(menu-item "Dired..." bmkp-dired-jump-other-window :help "Jump to a Dired bookmark, restoring the recorded Dired state" :enable (bmkp-dired-alist-only))) (define-key bmkp-jump-menu [bmkp-variable-list-jump] '(menu-item "Variable List..." bmkp-variable-list-jump :help "Jump to a variable-list bookmark" :enable (bmkp-variable-list-alist-only))) (define-key bmkp-jump-menu [bmkp-bookmark-file-jump] '(menu-item "Bookmark File..." bmkp-bookmark-file-jump :help "Jump to (load) a bookmark-file bookmark" :enable (bmkp-bookmark-file-alist-only))) (define-key bmkp-jump-menu [bmkp-bookmark-list-jump] '(menu-item "Bookmark List..." bmkp-bookmark-list-jump :help "Jump to a bookmark-list bookmark" :enable (bmkp-bookmark-list-alist-only))) (define-key bmkp-jump-menu [bmkp-desktop-jump] '(menu-item "Desktop..." bmkp-desktop-jump :help "Jump to a desktop bookmark" :enable (bmkp-desktop-alist-only))) (define-key bmkp-jump-menu [bmkp-jump-to-type-other-window] '(menu-item "Of Type..." bmkp-jump-to-type-other-window :help "Jump to a bookmark of a type that you specify")) (defvar bmkp-jump-tags-menu (make-sparse-keymap) "`With Tags' submenu for `Jump To' submenu of `Bookmarks' menu.") (define-key bmkp-jump-menu [bmkp-tags] (cons "With Tags" bmkp-jump-tags-menu)) (define-key bmkp-jump-tags-menu [bmkp-file-this-dir-all-tags-regexp-jump-other-window] '(menu-item "File in This Dir, All Tags Matching Regexp..." bmkp-file-this-dir-all-tags-regexp-jump-other-window :help "Jump to a file bookmark in this dir where each tag matches a regexp")) (define-key bmkp-jump-tags-menu [bmkp-file-this-dir-some-tags-regexp-jump-other-window] '(menu-item "File in This Dir, Any Tag Matching Regexp..." bmkp-file-this-dir-some-tags-regexp-jump-other-window :help "Jump to a file bookmark in this dir where at least one tag matches a regexp")) (define-key bmkp-jump-tags-menu [bmkp-file-this-dir-all-tags-jump-other-window] '(menu-item "File in This Dir, All Tags in Set..." bmkp-file-this-dir-all-tags-jump-other-window :help "Jump to a file bookmark in this dir that has all of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [bmkp-file-this-dir-some-tags-jump-other-window] '(menu-item "File in This Dir, Any Tag in Set..." bmkp-file-this-dir-some-tags-jump-other-window :help "Jump to a file bookmark in this dir that has some of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [jump-sep4] '("--")) (define-key bmkp-jump-tags-menu [bmkp-file-all-tags-regexp-jump-other-window] '(menu-item "File, All Tags Matching Regexp..." bmkp-file-all-tags-regexp-jump-other-window :help "Jump to a file or dir bookmark where each tag matches a regexp that you enter")) (define-key bmkp-jump-tags-menu [bmkp-file-some-tags-regexp-jump-other-window] '(menu-item "File, Any Tag Matching Regexp..." bmkp-file-some-tags-regexp-jump-other-window :help "Jump to a file or dir bookmark where at least one tag matches a regexp that you enter")) (define-key bmkp-jump-tags-menu [bmkp-file-all-tags-jump-other-window] '(menu-item "File, All Tags in Set..." bmkp-file-all-tags-jump-other-window :help "Jump to a file or dir bookmark that has all of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [bmkp-file-some-tags-jump-other-window] '(menu-item "File, Any Tag in Set..." bmkp-file-some-tags-jump-other-window :help "Jump to a file or dir bookmark that has some of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [jump-sep3] '("--")) (define-key bmkp-jump-tags-menu [bmkp-find-file-all-tags-regexp-other-window] '(menu-item "Autofile, All Tags Matching Regexp..." bmkp-find-file-all-tags-regexp-other-window :help "Jump to a file or dir bookmark where each tag matches a regexp that you enter")) (define-key bmkp-jump-tags-menu [bmkp-find-file-some-tags-regexp-other-window] '(menu-item "Autofile, Any Tag Matching Regexp..." bmkp-find-file-some-tags-regexp-other-window :help "Jump to a file or dir bookmark where at least one tag matches a regexp that you enter")) (define-key bmkp-jump-tags-menu [bmkp-find-file-all-tags-other-window] '(menu-item "Autofile, All Tags in Set..." bmkp-find-file-all-tags-other-window :help "Jump to a file or dir bookmark that has all of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [bmkp-find-file-some-tags-other-window] '(menu-item "Autofile, Any Tag in Set..." bmkp-find-file-some-tags-other-window :help "Jump to a file or dir bookmark that has some of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [jump-sep2] '("--")) (define-key bmkp-jump-tags-menu [bmkp-all-tags-regexp-jump-other-window] '(menu-item "All Tags Matching Regexp..." bmkp-all-tags-regexp-jump-other-window :help "Jump to a bookmark that has each tag matching a regexp that you enter")) (define-key bmkp-jump-tags-menu [bmkp-some-tags-regexp-jump-other-window] '(menu-item "Any Tag Matching Regexp..." bmkp-some-tags-regexp-jump-other-window :help "Jump to a bookmark that has at least one tag matching a regexp that you enter")) (define-key bmkp-jump-tags-menu [bmkp-all-tags-jump-other-window] '(menu-item "All Tags in Set..." bmkp-all-tags-jump-other-window :help "Jump to a bookmark that has all of a set of tags that you enter")) (define-key bmkp-jump-tags-menu [bmkp-some-tags-jump-other-window] '(menu-item "Any Tag in Set..." bmkp-some-tags-jump-other-window :help "Jump to a bookmark that has some of a set of tags that you enter")) (define-key bmkp-jump-menu [bookmark-jump-other-window] '(menu-item "Any in Other Window..." bookmark-jump-other-window :help "Jump to a bookmark of any type, in another window")) (define-key bmkp-jump-menu [bookmark-jump] '(menu-item "Any..." bookmark-jump :help "Jump to a bookmark of any type, in this window")) ;; `bmkp-find-file-menu' submenu of `File' menu (defvar bmkp-find-file-menu (make-sparse-keymap) "`Bookmarked File' submenu for menu-bar `File' menu.") (define-key menu-bar-file-menu [bmkp-find-file] (list 'menu-item "Bookmarked File" bmkp-find-file-menu)) (define-key bmkp-find-file-menu [bmkp-find-file-all-tags-regexp-other-window] '(menu-item "All Tags Matching Regexp..." bmkp-find-file-all-tags-regexp-other-window :help "Visit a file or dir where each tag matches a regexp that you enter")) (define-key bmkp-find-file-menu [bmkp-find-file-some-tags-regexp-other-window] '(menu-item "Any Tag Matching Regexp..." bmkp-find-file-some-tags-regexp-other-window :help "Jump to a file or dir bookmark where at least one tag matches a regexp that you enter")) (define-key bmkp-find-file-menu [bmkp-find-file-all-tags-other-window] '(menu-item "All Tags in Set..." bmkp-find-file-all-tags-other-window :help "Visit a file or dir that has all of a set of tags that you enter")) (define-key bmkp-find-file-menu [bmkp-find-file-some-tags-other-window] '(menu-item "Any Tag in Set..." bmkp-find-file-some-tags-other-window :help "Visit a file or dir that has some of a set of tags that you enter")) (define-key bmkp-find-file-menu [bmkp-find-file-other-window] '(menu-item "File..." bmkp-find-file-other-window :help "Visit a bookmarked file or directory: an autofile bookmark.")) ;;;;;;;;;;;;;;;;;;;;; (provide 'bookmark+-key) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; bookmark+-key.el ends here