Mercurial > hg > xemacs-beta
comparison lisp/keymap.el @ 272:c5d627a313b1 r21-0b34
Import from CVS: tag r21-0b34
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:28:48 +0200 |
parents | 677f6a0ee643 |
children | 6330739388db |
comparison
equal
deleted
inserted
replaced
271:c7b7086b0a39 | 272:c5d627a313b1 |
---|---|
17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | 17 ;; WITHOUT ANY WARRANTY; without even the implied warranty of |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
19 ;; General Public License for more details. | 19 ;; General Public License for more details. |
20 | 20 |
21 ;; You should have received a copy of the GNU General Public License | 21 ;; You should have received a copy of the GNU General Public License |
22 ;; along with XEmacs; see the file COPYING. If not, write to the | 22 ;; along with XEmacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, 59 Temple Place - Suite 330, | 23 ;; Free Software Foundation, 59 Temple Place - Suite 330, |
24 ;; Boston, MA 02111-1307, USA. | 24 ;; Boston, MA 02111-1307, USA. |
25 | 25 |
26 ;;; Synched up with: FSF 19.28. | 26 ;;; Synched up with: FSF 19.28. |
27 | 27 |
74 maps (cdr maps)) | 74 maps (cdr maps)) |
75 ;; Substitute in this keymap | 75 ;; Substitute in this keymap |
76 (map-keymap #'(lambda (key binding) | 76 (map-keymap #'(lambda (key binding) |
77 (if (eq binding olddef) | 77 (if (eq binding olddef) |
78 ;; The new bindings always go in KEYMAP even if we | 78 ;; The new bindings always go in KEYMAP even if we |
79 ;; found them in OLDMAP or one of it's children. | 79 ;; found them in OLDMAP or one of its children. |
80 ;; If KEYMAP will be shadowing OLDMAP, then do not | 80 ;; If KEYMAP will be shadowing OLDMAP, then do not |
81 ;; redefine the key if there is another binding | 81 ;; redefine the key if there is another binding |
82 ;; in KEYMAP that will shadow OLDDEF. | 82 ;; in KEYMAP that will shadow OLDDEF. |
83 (or (and shadowing | 83 (or (and shadowing |
84 (lookup-key keymap key)) | 84 (lookup-key keymap key)) |
85 ;; define-key will give an error if a prefix | 85 ;; define-key will give an error if a prefix |
86 ;; of the key is already defined. Otherwise | 86 ;; of the key is already defined. Otherwise |
87 ;; it will define the key in the map. | 87 ;; it will define the key in the map. |
88 ;; #### - Perhaps this should be protected? | 88 ;; #### - Perhaps this should be protected? |
89 (define-key | 89 (define-key |
90 keymap | 90 keymap |
91 (vconcat prefix (list key)) | 91 (vconcat prefix (list key)) |
92 newdef)))) | 92 newdef)))) |
293 (or (eventp ce) (setq ce (character-to-event ce))) | 293 (or (eventp ce) (setq ce (character-to-event ce))) |
294 ;; Normalize `c' to `?c' and `(control k)' to `?\C-k' | 294 ;; Normalize `c' to `?c' and `(control k)' to `?\C-k' |
295 ;; By passing t for the `allow-meta' arg we could get kbd macros | 295 ;; By passing t for the `allow-meta' arg we could get kbd macros |
296 ;; with meta in them to translate to the string form instead of | 296 ;; with meta in them to translate to the string form instead of |
297 ;; the list/symbol form; but I expect that would cause confusion, | 297 ;; the list/symbol form; but I expect that would cause confusion, |
298 ;; so let's use the list/symbol form whenever there's | 298 ;; so let's use the list/symbol form whenever there's |
299 ;; any ambiguity. | 299 ;; any ambiguity. |
300 (setq c (event-to-character ce)) | 300 (setq c (event-to-character ce)) |
301 (if (and c | 301 (if (and c |
302 character-set-property | 302 character-set-property |
303 (key-press-event-p ce)) | 303 (key-press-event-p ce)) |
340 (event-function event) | 340 (event-function event) |
341 (event-object event)))) | 341 (event-object event)))) |
342 ((or (button-press-event-p event) | 342 ((or (button-press-event-p event) |
343 (button-release-event-p event)) | 343 (button-release-event-p event)) |
344 (if no-mice | 344 (if no-mice |
345 (error | 345 (error |
346 "Mouse events can't be saved in keyboard macros.")) | 346 "Mouse events can't be saved in keyboard macros.")) |
347 (setq mods (event-modifiers event) | 347 (setq mods (event-modifiers event) |
348 key (intern (concat "button" | 348 key (intern (concat "button" |
349 (event-button event) | 349 (event-button event) |
350 (if (button-release-event-p event) | 350 (if (button-release-event-p event) |