comparison lisp/utils/delbackspace.el @ 10:49a24b4fd526 r19-15b6

Import from CVS: tag r19-15b6
author cvs
date Mon, 13 Aug 2007 08:47:52 +0200
parents 376386a54a3c
children 131b0175ea99
comparison
equal deleted inserted replaced
9:6f2bbbbbe05a 10:49a24b4fd526
58 ;; (alt) backspace sentence before cursor; backspace sexp before cursor 58 ;; (alt) backspace sentence before cursor; backspace sexp before cursor
59 ;; in language modes 59 ;; in language modes
60 (define-key key-translation-map [(alt backspace)] 60 (define-key key-translation-map [(alt backspace)]
61 [intercepted_alt_backspace]) 61 [intercepted_alt_backspace])
62 (define-key global-map 'intercepted_alt_backspace 'backward-kill-sentence) 62 (define-key global-map 'intercepted_alt_backspace 'backward-kill-sentence)
63 (mapcar #'(lambda (map) 63 (if (boundp 'c-mode-map)
64 (define-key map [(alt backspace)] 'backward-kill-sexp)) 64 (mapcar (lambda (map)
65 (list 65 (define-key map [(alt backspace)] 'backward-kill-sexp))
66 c-mode-map c++-mode-map objc-mode-map java-mode-map 66 (list
67 emacs-lisp-mode-map lisp-mode-map minibuffer-local-map)) 67 c-mode-map c++-mode-map objc-mode-map java-mode-map
68 emacs-lisp-mode-map lisp-mode-map minibuffer-local-map))
69 (setq after-load-alist
70 (append '(("cc-mode"
71 (mapcar (lambda (map)
72 (define-key map
73 [(alt backspace)]
74 'backward-kill-sexp)
75 (define-key map [(alt delete)] 'kill-sexp))
76 (list
77 c-mode-map
78 c++-mode-map
79 objc-mode-map
80 java-mode-map))))
81 after-load-alist)))
82
68 83
69 ;; (meta shift) backspace paragraph before cursor 84 ;; (meta shift) backspace paragraph before cursor
70 (global-set-key [(meta shift backspace)] 'backward-kill-paragraph) 85 (global-set-key [(meta shift backspace)] 'backward-kill-paragraph)
71 86
72 ;; (alt) delete rest of line (erase EOF) 87 ;; (alt) delete rest of line (erase EOF)
80 ;; (alt) delete sentence forward; delete sexp forward 95 ;; (alt) delete sentence forward; delete sexp forward
81 ;; in language modes 96 ;; in language modes
82 (define-key key-translation-map [(alt delete)] 97 (define-key key-translation-map [(alt delete)]
83 [intercepted_alt_delete]) 98 [intercepted_alt_delete])
84 (define-key global-map 'intercepted_alt_delete 'kill-sentence) 99 (define-key global-map 'intercepted_alt_delete 'kill-sentence)
85 (mapcar #'(lambda (map) 100 (mapcar (lambda (map)
86 (define-key map [(alt delete)] 'kill-sexp)) 101 (define-key map [(alt delete)] 'kill-sexp))
87 (list 102 (list
88 c-mode-map c++-mode-map objc-mode-map java-mode-map
89 emacs-lisp-mode-map lisp-mode-map minibuffer-local-map)) 103 emacs-lisp-mode-map lisp-mode-map minibuffer-local-map))
104 (when (boundp 'c-mode-map)
105 (mapcar (lambda (map)
106 (define-key map [(alt delete)] 'kill-sexp))
107 (list
108 c-mode-map c++-mode-map objc-mode-map java-mode-map)))
90 109
91 ;; (meta shift) delete next paragraph 110 ;; (meta shift) delete next paragraph
92 (global-set-key [(meta shift delete)] 'kill-paragraph) 111 (global-set-key [(meta shift delete)] 'kill-paragraph)
112
113 (provide 'delbackspace)
114
115 ;;; delbackspace.el ends here