From 56d62ee1fba23e69035e5146a12323cdfb60ea9b Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 25 Jun 2008 20:17:07 +0000 Subject: [PATCH] (goto-map): New variable. Rebind goto-related commands to this `M-g' prefix keymap. (search-map): New variable for `M-s' prefix keymap. Bind `M-s o' to `occur', `M-shr' to `highlight-regexp', `M-shp' to `highlight-phrase', `M-shl' to `highlight-lines-matching-regexp', `M-shu' to `unhighlight-regexp', `M-shf' to `hi-lock-find-patterns', `M-shw' to `hi-lock-write-interactive-patterns'. --- lisp/bindings.el | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/lisp/bindings.el b/lisp/bindings.el index cb97209924c..3a5a13745de 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -804,16 +804,31 @@ language you are using." (define-key ctl-x-map "\C-n" 'set-goal-column) (define-key global-map "\C-a" 'move-beginning-of-line) (define-key global-map "\C-e" 'move-end-of-line) -(define-key esc-map "g" (make-sparse-keymap)) -(define-key esc-map "g\M-g" 'goto-line) -(define-key esc-map "gg" 'goto-line) -(define-key esc-map "gn" 'next-error) -(define-key esc-map "g\M-n" 'next-error) (define-key ctl-x-map "`" 'next-error) -(define-key esc-map "gp" 'previous-error) -(define-key esc-map "g\M-p" 'previous-error) +(defvar goto-map (make-sparse-keymap) + "Keymap for navigation commands.") +(define-key esc-map "g" goto-map) + +(define-key goto-map "g" 'goto-line) +(define-key goto-map "\M-g" 'goto-line) +(define-key goto-map "n" 'next-error) +(define-key goto-map "\M-n" 'next-error) +(define-key goto-map "p" 'previous-error) +(define-key goto-map "\M-p" 'previous-error) + +(defvar search-map (make-sparse-keymap) + "Keymap for search related commands.") +(define-key esc-map "s" search-map) + +(define-key search-map "o" 'occur) +(define-key search-map "hr" 'highlight-regexp) +(define-key search-map "hp" 'highlight-phrase) +(define-key search-map "hl" 'highlight-lines-matching-regexp) +(define-key search-map "hu" 'unhighlight-regexp) +(define-key search-map "hf" 'hi-lock-find-patterns) +(define-key search-map "hw" 'hi-lock-write-interactive-patterns) ;;(defun function-key-error () ;; (interactive) -- 2.39.5