Mercurial > emacs
comparison lisp/help.el @ 44537:a80baec69a4e
(string-key-binding): Deal with margin events.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 12 Apr 2002 09:40:56 +0000 |
parents | bdf6c2baa447 |
children | fbd816e9e27d |
comparison
equal
deleted
inserted
replaced
44536:f7b9d913406b | 44537:a80baec69a4e |
---|---|
1 ;;; help.el --- help commands for Emacs | 1 ;;; help.el --- help commands for Emacs |
2 | 2 |
3 ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001 | 3 ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002 |
4 ;; Free Software Foundation, Inc. | 4 ;; Free Software Foundation, Inc. |
5 | 5 |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: help, internal | 7 ;; Keywords: help, internal |
8 | 8 |
431 "Value is the binding of KEY in a string. | 431 "Value is the binding of KEY in a string. |
432 If KEY is an event on a string, and that string has a `local-map' | 432 If KEY is an event on a string, and that string has a `local-map' |
433 or `keymap' property, return the binding of KEY in the string's keymap." | 433 or `keymap' property, return the binding of KEY in the string's keymap." |
434 (let* ((defn nil) | 434 (let* ((defn nil) |
435 (start (when (vectorp key) | 435 (start (when (vectorp key) |
436 (if (memq (aref key 0) '(mode-line header-line)) | 436 (if (memq (aref key 0) |
437 '(mode-line header-line left-margin right-margin)) | |
437 (event-start (aref key 1)) | 438 (event-start (aref key 1)) |
438 (and (consp (aref key 0)) | 439 (and (consp (aref key 0)) |
439 (event-start (aref key 0)))))) | 440 (event-start (aref key 0)))))) |
440 (string-info (and (consp start) (nth 4 start)))) | 441 (string-info (and (consp start) (nth 4 start)))) |
441 (when string-info | 442 (when string-info |
442 (let* ((string (car string-info)) | 443 (let* ((string (car string-info)) |
443 (pos (cdr string-info)) | 444 (pos (cdr string-info)) |
444 (local-map (and (> pos 0) | 445 (local-map (and (>= pos 0) |
445 (< pos (length string)) | 446 (< pos (length string)) |
446 (or (get-text-property pos 'local-map string) | 447 (or (get-text-property pos 'local-map string) |
447 (get-text-property pos 'keymap string))))) | 448 (get-text-property pos 'keymap string))))) |
448 (setq defn (and local-map (lookup-key local-map key))))) | 449 (setq defn (and local-map (lookup-key local-map key))))) |
449 defn)) | 450 defn)) |