X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=lisp%2Fkeymap.el;h=bfd8c87a9c925980c25f6d54daf038a876379f2f;hp=9f3f69dce8cd5fa75352fcc9ad6da90156b6f323;hb=98a6e4055a1fa624c592ac06f79287d55196ca37;hpb=557a8105b1bfe98e9a52f16fc2d4b10107f66b19 diff --git a/lisp/keymap.el b/lisp/keymap.el index 9f3f69d..bfd8c87 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -70,8 +70,8 @@ but optional second arg NODIGITS non-nil treats them like other chars." In other words, OLDDEF is replaced with NEWDEF wherever it appears. Prefix keymaps are checked recursively. If optional fourth argument OLDMAP is specified, we redefine in KEYMAP as NEWDEF those chars which are defined -as OLDDEF in OLDMAP, unless that keybinding is already present in keymap. -If optional fifth argument PREFIX is defined, then only those occurrences of +as OLDDEF in OLDMAP, unless that keybinding is already present in KEYMAP. +If optional fifth argument PREFIX is non-nil, then only those occurrences of OLDDEF found in keymaps accessible through the keymap bound to PREFIX in KEYMAP are redefined. See also `accessible-keymaps'." (let ((maps (accessible-keymaps (or oldmap keymap) prefix)) @@ -103,8 +103,6 @@ KEYMAP are redefined. See also `accessible-keymaps'." ))) -;; From Bill Dubuque - ;; This used to wrap forms into an interactive lambda. It is unclear ;; to me why this is needed in this function. Anyway, ;; `key-or-menu-binding' doesn't do it, so this function no longer @@ -119,7 +117,6 @@ KEYMAP are redefined. See also `accessible-keymaps'." (setq defn (key-binding defn))) ;; a keyboard macro (insert (format "%s" defn))))) -;; From Bill Dubuque (defun read-command-or-command-sexp (prompt) "Read a command symbol or command sexp. A command sexp is wrapped in an interactive lambda if needed. @@ -136,7 +133,7 @@ Prompts with PROMPT." ,result) result))) -(defun local-key-binding (keys) +(defun local-key-binding (keys &optional accept-defaults) "Return the binding for command KEYS in current local keymap only. KEYS is a string, a vector of events, or a vector of key-description lists as described in the documentation for the `define-key' function. @@ -144,17 +141,16 @@ The binding is probably a symbol with a function definition; see the documentation for `lookup-key' for more information." (let ((map (current-local-map))) (if map - (lookup-key map keys) + (lookup-key map keys accept-defaults) nil))) -(defun global-key-binding (keys) +(defun global-key-binding (keys &optional accept-defaults) "Return the binding for command KEYS in current global keymap only. KEYS is a string or vector of events, a sequence of keystrokes. The binding is probably a symbol with a function definition; see the documentation for `lookup-key' for more information." - (lookup-key (current-global-map) keys)) + (lookup-key (current-global-map) keys accept-defaults)) -;; from Bill Dubuque (defun global-set-key (key command) "Give KEY a global binding as COMMAND. COMMAND is a symbol naming an interactively-callable function. @@ -172,7 +168,6 @@ that local binding will continue to shadow any global binding." (define-key (current-global-map) key command) nil) -;; from Bill Dubuque (defun local-set-key (key command) "Give KEY a local binding as COMMAND. COMMAND is a symbol naming an interactively-callable function.