*** help.el 25 Mar 2006 20:49:31 +0100 1.308 --- help.el 26 Apr 2006 14:09:59 +0200 *************** *** 525,550 **** (princ string))))) nil) ! (defun string-key-binding (key) ! "Value is the binding of KEY in a string. ! If KEY is an event on a string, and that string has a `local-map' ! or `keymap' property, return the binding of KEY in the string's keymap." (let* ((defn nil) ! (start (when (vectorp key) ! (if (memq (aref key 0) '(mode-line header-line left-margin right-margin)) ! (event-start (aref key 1)) ! (and (consp (aref key 0)) ! (event-start (aref key 0)))))) (string-info (and (consp start) (nth 4 start)))) (when string-info (let* ((string (car string-info)) (pos (cdr string-info)) ! (local-map (and (>= pos 0) ! (< pos (length string)) ! (or (get-text-property pos 'local-map string) ! (get-text-property pos 'keymap string))))) ! (setq defn (and local-map (lookup-key local-map key))))) defn)) (defun help-key-description (key untranslated) --- 525,554 ---- (princ string))))) nil) ! (defun string-key-binding (event &optional key) ! "With some EVENT on a string, return the local binding of KEY. ! If EVENT is an event on a string, and that string has a `local-map' ! or `keymap' property, return the binding of KEY in the string's keymap. ! If KEY is not specified, it is taken from the event." (let* ((defn nil) ! (start (when (vectorp event) ! (if (memq (aref event 0) '(mode-line header-line left-margin right-margin)) ! (event-start (aref event 1)) ! (and (consp (aref event 0)) ! (event-start (aref event 0)))))) (string-info (and (consp start) (nth 4 start)))) (when string-info (let* ((string (car string-info)) (pos (cdr string-info)) ! (maps '(keymap local-map)) ! local-map) ! (when (and (>= pos 0) ! (< pos (length string))) ! (while (and maps (not defn)) ! (when ! (setq local-map (get-text-property pos (pop maps) string)) ! (setq defn (lookup-key local-map (or key event)))))))) defn)) (defun help-key-description (key untranslated)