comparison lisp/emulation/crisp.el @ 104922:c603ee2aac17

* keymap.c (QCadvertised_binding): New constant. (syms_of_keymap): Initialize it. (Fwhere_is_internal): Try and use bindings from :advertised-binding if applicable. * progmodes/xscheme.el (xscheme-evaluation-commands): Put a :advertised-binding property rather than using advertised-xscheme-send-previous-expression. (advertised-xscheme-send-previous-expression): Declare obsolete. * emulation/crisp.el (crisp-mode-map): Use `undo' rather than `advertised-undo'. (crisp-mode): Add corresponding bindings to undo's :advertised-binding instead. * dired.el (dired-mode-map): Put a :advertised-binding property rather than using dired-advertised-find-file. (dired-advertised-find-file): * simple.el (advertised-undo): * wid-edit.el (advertised-widget-backward): Declare obsolete. (widget-keymap): Put a :advertised-binding property rather than using advertised-widget-backward. * bindings.el (ctl-x-map): Put a :advertised-binding property rather than using advertised-undo. * tutorial.el (tutorial--default-keys): Adjust accordingly.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 11 Sep 2009 00:58:59 +0000
parents a9dc0e7c3f2b
children 360dda0c7586
comparison
equal deleted inserted replaced
104921:05feb973bfa0 104922:c603ee2aac17
52 ;; being displayed there. 52 ;; being displayed there.
53 53
54 ;; All these overrides should go *before* the (require 'crisp) statement. 54 ;; All these overrides should go *before* the (require 'crisp) statement.
55 55
56 ;;; Code: 56 ;;; Code:
57
58 (eval-when-compile (require 'cl))
57 59
58 ;; local variables 60 ;; local variables
59 61
60 (defgroup crisp nil 62 (defgroup crisp nil
61 "Emulator for CRiSP and Brief key bindings." 63 "Emulator for CRiSP and Brief key bindings."
203 (define-key crisp-mode-map [(meta j)] 'bookmark-jump) 205 (define-key crisp-mode-map [(meta j)] 'bookmark-jump)
204 (define-key crisp-mode-map [(meta l)] 'crisp-mark-line) 206 (define-key crisp-mode-map [(meta l)] 'crisp-mark-line)
205 (define-key crisp-mode-map [(meta m)] 'set-mark-command) 207 (define-key crisp-mode-map [(meta m)] 'set-mark-command)
206 (define-key crisp-mode-map [(meta n)] 'bury-buffer) 208 (define-key crisp-mode-map [(meta n)] 'bury-buffer)
207 (define-key crisp-mode-map [(meta p)] 'crisp-unbury-buffer) 209 (define-key crisp-mode-map [(meta p)] 'crisp-unbury-buffer)
208 (define-key crisp-mode-map [(meta u)] 'advertised-undo) 210 (define-key crisp-mode-map [(meta u)] 'undo)
209 (define-key crisp-mode-map [(f14)] 'advertised-undo) 211 (define-key crisp-mode-map [(f14)] 'undo)
210 (define-key crisp-mode-map [(meta w)] 'save-buffer) 212 (define-key crisp-mode-map [(meta w)] 'save-buffer)
211 (define-key crisp-mode-map [(meta x)] 'crisp-meta-x-wrapper) 213 (define-key crisp-mode-map [(meta x)] 'crisp-meta-x-wrapper)
212 (define-key crisp-mode-map [(meta ?0)] (lambda () 214 (define-key crisp-mode-map [(meta ?0)] (lambda ()
213 (interactive) 215 (interactive)
214 (bookmark-set "0"))) 216 (bookmark-set "0")))
355 (interactive "P") 357 (interactive "P")
356 (setq crisp-mode (if (null arg) 358 (setq crisp-mode (if (null arg)
357 (not crisp-mode) 359 (not crisp-mode)
358 (> (prefix-numeric-value arg) 0))) 360 (> (prefix-numeric-value arg) 0)))
359 (when crisp-mode 361 (when crisp-mode
362 ;; Make menu entries show M-u or f14 in preference to C-x u.
363 (put 'undo :advertised-binding
364 (list* [?\M-u] [f14] (get 'undo :advertised-binding)))
360 ;; Force transient-mark-mode, so that the marking routines work as 365 ;; Force transient-mark-mode, so that the marking routines work as
361 ;; expected. If the user turns off transient mark mode, most 366 ;; expected. If the user turns off transient mark mode, most
362 ;; things will still work fine except the crisp-(copy|kill) 367 ;; things will still work fine except the crisp-(copy|kill)
363 ;; functions won't work quite as nicely when regions are marked 368 ;; functions won't work quite as nicely when regions are marked
364 ;; differently and could really confuse people. Caveat emptor. 369 ;; differently and could really confuse people. Caveat emptor.