diff options
| author | Gerd Moellmann | 2001-01-29 20:04:42 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-29 20:04:42 +0000 |
| commit | fdbbf266572a721bbeafff414e3249765e0ac856 (patch) | |
| tree | ab5b486047c6b5a1dd79596c730745f854bbf386 /src | |
| parent | 34a419688d90de154170f9cc53b9d8baaa6aec90 (diff) | |
| download | emacs-fdbbf266572a721bbeafff414e3249765e0ac856.tar.gz emacs-fdbbf266572a721bbeafff414e3249765e0ac856.zip | |
Undo last change.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 57 |
1 files changed, 4 insertions, 53 deletions
diff --git a/src/keymap.c b/src/keymap.c index 73fa716d36d..f5b037ffa43 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* Manipulation of keymaps | 1 | /* Manipulation of keymaps |
| 2 | Copyright (C) 1985, 86,87,88,93,94,95,98,99, 2000, 2001 | 2 | Copyright (C) 1985, 86,87,88,93,94,95,98,99, 2000 |
| 3 | Free Software Foundation, Inc. | 3 | Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -114,9 +114,6 @@ static void describe_translation P_ ((Lisp_Object)); | |||
| 114 | static void describe_map P_ ((Lisp_Object, Lisp_Object, | 114 | static void describe_map P_ ((Lisp_Object, Lisp_Object, |
| 115 | void (*) P_ ((Lisp_Object)), | 115 | void (*) P_ ((Lisp_Object)), |
| 116 | int, Lisp_Object, Lisp_Object*, int)); | 116 | int, Lisp_Object, Lisp_Object*, int)); |
| 117 | static int mouse_key_p P_ ((Lisp_Object)); | ||
| 118 | static int ascii_sequence_p P_ ((Lisp_Object)); | ||
| 119 | |||
| 120 | 117 | ||
| 121 | /* Keymap object support - constructors and predicates. */ | 118 | /* Keymap object support - constructors and predicates. */ |
| 122 | 119 | ||
| @@ -2016,7 +2013,6 @@ Control characters turn into \"^char\", etc.") | |||
| 2016 | 2013 | ||
| 2017 | /* Return non-zero if SEQ contains only ASCII characters, perhaps with | 2014 | /* Return non-zero if SEQ contains only ASCII characters, perhaps with |
| 2018 | a meta bit. */ | 2015 | a meta bit. */ |
| 2019 | |||
| 2020 | static int | 2016 | static int |
| 2021 | ascii_sequence_p (seq) | 2017 | ascii_sequence_p (seq) |
| 2022 | Lisp_Object seq; | 2018 | Lisp_Object seq; |
| @@ -2039,48 +2035,6 @@ ascii_sequence_p (seq) | |||
| 2039 | return 1; | 2035 | return 1; |
| 2040 | } | 2036 | } |
| 2041 | 2037 | ||
| 2042 | |||
| 2043 | /* Value is non-zero if SEQ is a mouse key. | ||
| 2044 | |||
| 2045 | Note: We can't use the property lists of mouse-key symbols to | ||
| 2046 | determine this, because these symbols and their property lists are | ||
| 2047 | created only when a mouse-event has been seen. */ | ||
| 2048 | |||
| 2049 | static int | ||
| 2050 | mouse_key_p (seq) | ||
| 2051 | Lisp_Object seq; | ||
| 2052 | { | ||
| 2053 | int mouse_p = 0; | ||
| 2054 | |||
| 2055 | seq = Faref (seq, 0); | ||
| 2056 | if (SYMBOLP (seq)) | ||
| 2057 | { | ||
| 2058 | unsigned char *name = XSYMBOL (seq)->name->data; | ||
| 2059 | |||
| 2060 | while (*(name + 1) == '-' | ||
| 2061 | && (*name == 'S' || *name == 'C' || *name == 'M' | ||
| 2062 | || *name == 'A' || *name == 'H')) | ||
| 2063 | name += 2; | ||
| 2064 | |||
| 2065 | if (bcmp (name, "up-", 3) == 0) | ||
| 2066 | name += 3; | ||
| 2067 | else if (bcmp (name, "down-", 5) == 0) | ||
| 2068 | name += 5; | ||
| 2069 | |||
| 2070 | if (bcmp (name, "mouse-", 6) == 0) | ||
| 2071 | { | ||
| 2072 | name += 6; | ||
| 2073 | while (*name >= '0' && *name <= '9') | ||
| 2074 | ++name; | ||
| 2075 | } | ||
| 2076 | |||
| 2077 | mouse_p = *name == '\0'; | ||
| 2078 | } | ||
| 2079 | |||
| 2080 | return mouse_p; | ||
| 2081 | } | ||
| 2082 | |||
| 2083 | |||
| 2084 | 2038 | ||
| 2085 | /* where-is - finding a command in a set of keymaps. */ | 2039 | /* where-is - finding a command in a set of keymaps. */ |
| 2086 | 2040 | ||
| @@ -2148,7 +2102,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect) | |||
| 2148 | last_is_meta = (XINT (last) >= 0 | 2102 | last_is_meta = (XINT (last) >= 0 |
| 2149 | && EQ (Faref (this, last), meta_prefix_char)); | 2103 | && EQ (Faref (this, last), meta_prefix_char)); |
| 2150 | 2104 | ||
| 2151 | if (nomenus && !ascii_sequence_p (this) && !mouse_key_p (this)) | 2105 | if (nomenus && !ascii_sequence_p (this)) |
| 2152 | /* If no menu entries should be returned, skip over the | 2106 | /* If no menu entries should be returned, skip over the |
| 2153 | keymaps bound to `menu-bar' and `tool-bar' and other | 2107 | keymaps bound to `menu-bar' and `tool-bar' and other |
| 2154 | non-ascii prefixes. */ | 2108 | non-ascii prefixes. */ |
| @@ -2250,9 +2204,7 @@ where_is_internal (definition, keymaps, firstonly, noindirect) | |||
| 2250 | we find. */ | 2204 | we find. */ |
| 2251 | if (EQ (firstonly, Qnon_ascii)) | 2205 | if (EQ (firstonly, Qnon_ascii)) |
| 2252 | RETURN_UNGCPRO (sequence); | 2206 | RETURN_UNGCPRO (sequence); |
| 2253 | else if (!NILP (firstonly) | 2207 | else if (! NILP (firstonly) && ascii_sequence_p (sequence)) |
| 2254 | && (ascii_sequence_p (sequence) | ||
| 2255 | || mouse_key_p (sequence))) | ||
| 2256 | RETURN_UNGCPRO (sequence); | 2208 | RETURN_UNGCPRO (sequence); |
| 2257 | } | 2209 | } |
| 2258 | } | 2210 | } |
| @@ -2352,8 +2304,7 @@ indirect definition itself.") | |||
| 2352 | result = Qnil; | 2304 | result = Qnil; |
| 2353 | for (i = n - 1; i >= 0; --i) | 2305 | for (i = n - 1; i >= 0; --i) |
| 2354 | if (EQ (shadow_lookup (keymaps, defns[i], Qnil), definition) | 2306 | if (EQ (shadow_lookup (keymaps, defns[i], Qnil), definition) |
| 2355 | && (ascii_sequence_p (defns[i]) | 2307 | && ascii_sequence_p (defns[i])) |
| 2356 | || mouse_key_p (defns[i]))) | ||
| 2357 | break; | 2308 | break; |
| 2358 | 2309 | ||
| 2359 | result = i >= 0 ? defns[i] : Qnil; | 2310 | result = i >= 0 ? defns[i] : Qnil; |