Mercurial > emacs
comparison src/keymap.c @ 83550:17e0dd217877
Merged from emacs@sv.gnu.org.
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-536
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-537
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-538
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-539
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-540
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-541
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-542
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-543
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-544
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-545
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-546
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-547
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-548
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-549
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-550
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-551
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-552
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-553
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-554
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-555
erc-iswitchb: Temporarily enable iswitchb mode
* emacs@sv.gnu.org/emacs--devo--0--patch-556
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-557
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-558
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-559
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-560
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-561
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-562
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-563
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-564
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-565
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-566
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-567
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-568
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-569
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-570
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-571
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-572
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-573
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-574
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-575
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-576
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-577
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-578
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-579
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-580
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-581
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-582
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-583
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-584
Fix admin/quick-install-emacs to work with recent versions of autoconf
* emacs@sv.gnu.org/gnus--rel--5.10--patch-171
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-172
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-173
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-174
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-175
Update from CVS: lisp/legacy-gnus-agent.el: Add Copyright notice.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-176
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-177
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-178
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-179
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-180
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-181
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-182
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-183
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-184
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-185
Merge from emacs--devo--0
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-590
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Mon, 01 Jan 2007 17:38:32 +0000 |
parents | 2d56e13fd23d 489131611785 |
children | b8d9a391daf3 |
comparison
equal
deleted
inserted
replaced
83549:8d80de0a1ac6 | 83550:17e0dd217877 |
---|---|
1115 a symbol (when the key is looked up, the symbol will stand for its | 1115 a symbol (when the key is looked up, the symbol will stand for its |
1116 function definition, which should at that time be one of the above, | 1116 function definition, which should at that time be one of the above, |
1117 or another symbol whose function definition is used, etc.), | 1117 or another symbol whose function definition is used, etc.), |
1118 a cons (STRING . DEFN), meaning that DEFN is the definition | 1118 a cons (STRING . DEFN), meaning that DEFN is the definition |
1119 (DEFN should be a valid definition in its own right), | 1119 (DEFN should be a valid definition in its own right), |
1120 or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP. | 1120 or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP, |
1121 or an extended menu item definition. (See info node `Extended Menu Items'.) | |
1121 | 1122 |
1122 If KEYMAP is a sparse keymap with a binding for KEY, the existing | 1123 If KEYMAP is a sparse keymap with a binding for KEY, the existing |
1123 binding is altered. If there is no binding for KEY, the new pair | 1124 binding is altered. If there is no binding for KEY, the new pair |
1124 binding KEY to DEF is added at the front of KEYMAP. */) | 1125 binding KEY to DEF is added at the front of KEYMAP. */) |
1125 (keymap, key, def) | 1126 (keymap, key, def) |
1238 /* Value is number if KEY is too long; nil if valid but has no definition. */ | 1239 /* Value is number if KEY is too long; nil if valid but has no definition. */ |
1239 /* GC is possible in this function if it autoloads a keymap. */ | 1240 /* GC is possible in this function if it autoloads a keymap. */ |
1240 | 1241 |
1241 DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0, | 1242 DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0, |
1242 doc: /* In keymap KEYMAP, look up key sequence KEY. Return the definition. | 1243 doc: /* In keymap KEYMAP, look up key sequence KEY. Return the definition. |
1243 nil means undefined. See doc of `define-key' for kinds of definitions. | 1244 A value of nil means undefined. See doc of `define-key' |
1245 for kinds of definitions. | |
1244 | 1246 |
1245 A number as value means KEY is "too long"; | 1247 A number as value means KEY is "too long"; |
1246 that is, characters or symbols in it except for the last one | 1248 that is, characters or symbols in it except for the last one |
1247 fail to be a valid sequence of prefix characters in KEYMAP. | 1249 fail to be a valid sequence of prefix characters in KEYMAP. |
1248 The number is how many characters at the front of KEY | 1250 The number is how many characters at the front of KEY |
1613 | 1615 |
1614 /* Key sequences beginning with mouse clicks | 1616 /* Key sequences beginning with mouse clicks |
1615 are read using the keymaps of the buffer clicked on, not | 1617 are read using the keymaps of the buffer clicked on, not |
1616 the current buffer. So we may have to switch the buffer | 1618 the current buffer. So we may have to switch the buffer |
1617 here. */ | 1619 here. */ |
1618 | 1620 |
1619 if (CONSP (position)) | 1621 if (CONSP (position)) |
1620 { | 1622 { |
1621 Lisp_Object window; | 1623 Lisp_Object window; |
1622 | 1624 |
1623 window = POSN_WINDOW (position); | 1625 window = POSN_WINDOW (position); |
1624 | 1626 |
1625 if (WINDOWP (window) | 1627 if (WINDOWP (window) |
1626 && BUFFERP (XWINDOW (window)->buffer) | 1628 && BUFFERP (XWINDOW (window)->buffer) |
1627 && XBUFFER (XWINDOW (window)->buffer) != current_buffer) | 1629 && XBUFFER (XWINDOW (window)->buffer) != current_buffer) |
1628 { | 1630 { |
1629 /* Arrange to go back to the original buffer once we're done | 1631 /* Arrange to go back to the original buffer once we're done |
1631 save_excursion_{save,restore} here, in analogy to | 1633 save_excursion_{save,restore} here, in analogy to |
1632 `read-key-sequence' to avoid saving point. Maybe this | 1634 `read-key-sequence' to avoid saving point. Maybe this |
1633 would not be a problem here, but it is easier to keep | 1635 would not be a problem here, but it is easier to keep |
1634 things the same. | 1636 things the same. |
1635 */ | 1637 */ |
1636 | 1638 |
1637 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | 1639 record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); |
1638 | 1640 |
1639 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); | 1641 set_buffer_internal (XBUFFER (XWINDOW (window)->buffer)); |
1640 } | 1642 } |
1641 } | 1643 } |
1642 | 1644 |
1643 if (! NILP (current_kboard->Voverriding_terminal_local_map)) | 1645 if (! NILP (current_kboard->Voverriding_terminal_local_map)) |
1644 { | 1646 { |
1645 value = Flookup_key (current_kboard->Voverriding_terminal_local_map, | 1647 value = Flookup_key (current_kboard->Voverriding_terminal_local_map, |
1646 key, accept_default); | 1648 key, accept_default); |
1647 if (! NILP (value) && !INTEGERP (value)) | 1649 if (! NILP (value) && !INTEGERP (value)) |
1660 | 1662 |
1661 pt = INTEGERP (position) ? XINT (position) | 1663 pt = INTEGERP (position) ? XINT (position) |
1662 : MARKERP (position) ? marker_position (position) | 1664 : MARKERP (position) ? marker_position (position) |
1663 : PT; | 1665 : PT; |
1664 | 1666 |
1665 local_map = get_local_map (pt, current_buffer, Qlocal_map); | 1667 local_map = get_local_map (pt, current_buffer, Qlocal_map); |
1666 keymap = get_local_map (pt, current_buffer, Qkeymap); | 1668 keymap = get_local_map (pt, current_buffer, Qkeymap); |
1667 | 1669 |
1668 if (CONSP (position)) | 1670 if (CONSP (position)) |
1669 { | 1671 { |
1670 Lisp_Object string; | 1672 Lisp_Object string; |
1671 | 1673 |
1672 /* For a mouse click, get the local text-property keymap | 1674 /* For a mouse click, get the local text-property keymap |
1673 of the place clicked on, rather than point. */ | 1675 of the place clicked on, rather than point. */ |
1674 | 1676 |
1675 if (POSN_INBUFFER_P (position)) | 1677 if (POSN_INBUFFER_P (position)) |
1676 { | 1678 { |
1677 Lisp_Object pos; | 1679 Lisp_Object pos; |
1678 | 1680 |
1679 pos = POSN_BUFFER_POSN (position); | 1681 pos = POSN_BUFFER_POSN (position); |
1680 if (INTEGERP (pos) | 1682 if (INTEGERP (pos) |
1681 && XINT (pos) >= BEG && XINT (pos) <= Z) | 1683 && XINT (pos) >= BEG && XINT (pos) <= Z) |
1682 { | 1684 { |
1683 local_map = get_local_map (XINT (pos), | 1685 local_map = get_local_map (XINT (pos), |
1684 current_buffer, Qlocal_map); | 1686 current_buffer, Qlocal_map); |
1685 | 1687 |
1686 keymap = get_local_map (XINT (pos), | 1688 keymap = get_local_map (XINT (pos), |
1687 current_buffer, Qkeymap); | 1689 current_buffer, Qkeymap); |
1688 } | 1690 } |
1689 } | 1691 } |
1690 | 1692 |
1691 /* If on a mode line string with a local keymap, | 1693 /* If on a mode line string with a local keymap, |
1692 or for a click on a string, i.e. overlay string or a | 1694 or for a click on a string, i.e. overlay string or a |
1693 string displayed via the `display' property, | 1695 string displayed via the `display' property, |
1694 consider `local-map' and `keymap' properties of | 1696 consider `local-map' and `keymap' properties of |
1695 that string. */ | 1697 that string. */ |
1696 | 1698 |
1697 if (string = POSN_STRING (position), | 1699 if (string = POSN_STRING (position), |
1698 (CONSP (string) && STRINGP (XCAR (string)))) | 1700 (CONSP (string) && STRINGP (XCAR (string)))) |
1699 { | 1701 { |
1700 Lisp_Object pos, map; | 1702 Lisp_Object pos, map; |
1701 | 1703 |
1702 pos = XCDR (string); | 1704 pos = XCDR (string); |
1703 string = XCAR (string); | 1705 string = XCAR (string); |
1704 if (INTEGERP (pos) | 1706 if (INTEGERP (pos) |
1705 && XINT (pos) >= 0 | 1707 && XINT (pos) >= 0 |
1706 && XINT (pos) < SCHARS (string)) | 1708 && XINT (pos) < SCHARS (string)) |
1712 map = Fget_text_property (pos, Qkeymap, string); | 1714 map = Fget_text_property (pos, Qkeymap, string); |
1713 if (!NILP (map)) | 1715 if (!NILP (map)) |
1714 keymap = map; | 1716 keymap = map; |
1715 } | 1717 } |
1716 } | 1718 } |
1717 | 1719 |
1718 } | 1720 } |
1719 | 1721 |
1720 if (! NILP (keymap)) | 1722 if (! NILP (keymap)) |
1721 { | 1723 { |
1722 value = Flookup_key (keymap, key, accept_default); | 1724 value = Flookup_key (keymap, key, accept_default); |