aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-11-17 00:27:08 +0000
committerStefan Monnier2001-11-17 00:27:08 +0000
commitd1bf2a73b3a12c691bf74205ef196db01d02fb7f (patch)
tree4e05cd17534e5b3389185560c19ddf0552ca14cd
parent4e0a3971fab4b8281c626241262efc1feae1a266 (diff)
downloademacs-d1bf2a73b3a12c691bf74205ef196db01d02fb7f.tar.gz
emacs-d1bf2a73b3a12c691bf74205ef196db01d02fb7f.zip
(mode-line-mode-name): Only put the help-echo property
if the local-map property was put as well. (global-map): Bind switch-frame, delete-frame, iconify-frame and make-frame-visible events.
-rw-r--r--lisp/bindings.el76
1 files changed, 45 insertions, 31 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el
index d52587fda02..1e7e9716249 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -169,8 +169,8 @@ mnemonics of the following coding systems:
169 coding system for keyboard input (if Emacs is running on terminal) 169 coding system for keyboard input (if Emacs is running on terminal)
170 coding system for terminal output (if Emacs is running on terminal)" 170 coding system for terminal output (if Emacs is running on terminal)"
171;; Currently not: 171;; Currently not:
172;;; coding system for decoding output of buffer process (if any) 172;; coding system for decoding output of buffer process (if any)
173;;; coding system for encoding text to send to buffer process (if any)." 173;; coding system for encoding text to send to buffer process (if any)."
174) 174)
175 175
176(make-variable-buffer-local 'mode-line-mule-info) 176(make-variable-buffer-local 'mode-line-mule-info)
@@ -230,11 +230,11 @@ Normally nil in most modes, since there is no process to display.")
230(let* ((help-echo 230(let* ((help-echo
231 ;; The multi-line message doesn't work terribly well on the 231 ;; The multi-line message doesn't work terribly well on the
232 ;; bottom mode line... Better ideas? 232 ;; bottom mode line... Better ideas?
233;;; "\ 233 ;; "\
234;;; mouse-1: select window, mouse-2: delete others, mouse-3: delete, 234 ;; mouse-1: select window, mouse-2: delete others, mouse-3: delete,
235;;; drag-mouse-1: resize, C-mouse-2: split horizontally" 235 ;; drag-mouse-1: resize, C-mouse-2: split horizontally"
236 "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete") 236 "mouse-1: select (drag to resize), mouse-2: delete others, mouse-3: delete")
237 (dashes (propertize "--" 'help-echo help-echo))) 237 (dashes (propertize "--" 'help-echo help-echo)))
238 (setq-default mode-line-format 238 (setq-default mode-line-format
239 (list 239 (list
240 (propertize "-" 'help-echo help-echo) 240 (propertize "-" 'help-echo help-echo)
@@ -309,21 +309,26 @@ Menu of mode operations in the mode line.")
309 309
310(defun mode-line-mode-name () "\ 310(defun mode-line-mode-name () "\
311Return a string to display in the mode line for the current mode name." 311Return a string to display in the mode line for the current mode name."
312 (let (length (result mode-name)) 312 (when (stringp mode-name)
313 (let ((local-map (get-text-property 0 'local-map result)) 313 (let ((local-map (get-text-property 0 'local-map mode-name))
314 (help-echo (get-text-property 0 'help-echo result))) 314 (help-echo (get-text-property 0 'help-echo mode-name)))
315 (setq result (copy-sequence result)) 315 ;; For correctness, we shouldn't modify mode-name. But adding some
316 ;; text-properties to those mode-name strings can't hurt, really, and
317 ;; furthermore, by doing it in-place, we make sure that we don't need to
318 ;; do the work over and over and over and .... -stef
319 (unless (and local-map help-echo)
320 (setq mode-name (copy-sequence mode-name)))
316 ;; Add `local-map' property if there isn't already one. 321 ;; Add `local-map' property if there isn't already one.
317 (when (and (null local-map) 322 (unless (or local-map
318 (null (next-single-property-change 0 'local-map result))) 323 (next-single-property-change 0 'local-map mode-name))
319 (put-text-property 0 (length result) 324 (put-text-property 0 (length mode-name)
320 'local-map mode-line-minor-mode-keymap result)) 325 'local-map mode-line-minor-mode-keymap mode-name)
321 ;; Add `help-echo' property if there isn't already one. 326 ;; Add `help-echo' property if there isn't already one.
322 (when (and (null help-echo) 327 (unless (or help-echo
323 (null (next-single-property-change 0 'help-echo result))) 328 (next-single-property-change 0 'help-echo mode-name))
324 (put-text-property 0 (length result) 329 (put-text-property 0 (length mode-name) 'help-echo
325 'help-echo "mouse-3: minor mode menu" result))) 330 "mouse-3: minor mode menu" mode-name)))))
326 result)) 331 mode-name)
327 332
328(defmacro bound-and-true-p (var) 333(defmacro bound-and-true-p (var)
329 "Return the value of symbol VAR if it is bound, else nil." 334 "Return the value of symbol VAR if it is bound, else nil."
@@ -543,9 +548,10 @@ is okay. See `mode-line-format'.")
543(make-variable-buffer-local 'indent-tabs-mode) 548(make-variable-buffer-local 'indent-tabs-mode)
544 549
545;; We have base64 and md5 functions built in now. 550;; We have base64 and md5 functions built in now.
546(add-to-list 'features 'base64) 551(provide 'base64)
547(add-to-list 'features 'md5) 552(provide 'md5)
548(add-to-list 'features 'overlay) 553(provide 'overlay '(display syntax-table field))
554(provide 'text-properties '(display syntax-table field point-entered))
549 555
550(define-key esc-map "\t" 'complete-symbol) 556(define-key esc-map "\t" 'complete-symbol)
551 557
@@ -582,6 +588,17 @@ language you are using."
582 588
583(make-variable-buffer-local 'minor-mode-overriding-map-alist) 589(make-variable-buffer-local 'minor-mode-overriding-map-alist)
584 590
591;; From macros.c
592(define-key ctl-x-map "(" 'start-kbd-macro)
593(define-key ctl-x-map ")" 'end-kbd-macro)
594(define-key ctl-x-map "e" 'call-last-kbd-macro)
595;; From frame.c
596(global-set-key [switch-frame] 'handle-switch-frame)
597(global-set-key [delete-frame] 'handle-delete-frame)
598(global-set-key [iconify-frame] 'ignore-event)
599(global-set-key [make-frame-visible] 'ignore-event)
600
601
585;These commands are defined in editfns.c 602;These commands are defined in editfns.c
586;but they are not assigned to keys there. 603;but they are not assigned to keys there.
587(put 'narrow-to-region 'disabled t) 604(put 'narrow-to-region 'disabled t)
@@ -589,9 +606,6 @@ language you are using."
589(define-key ctl-x-map "nw" 'widen) 606(define-key ctl-x-map "nw" 'widen)
590;; (define-key ctl-x-map "n" 'narrow-to-region) 607;; (define-key ctl-x-map "n" 'narrow-to-region)
591;; (define-key ctl-x-map "w" 'widen) 608;; (define-key ctl-x-map "w" 'widen)
592(define-key ctl-x-map "(" 'start-kbd-macro)
593(define-key ctl-x-map ")" 'end-kbd-macro)
594(define-key ctl-x-map "e" 'call-last-kbd-macro)
595 609
596(define-key global-map "\C-j" 'newline-and-indent) 610(define-key global-map "\C-j" 'newline-and-indent)
597(define-key global-map "\C-m" 'newline) 611(define-key global-map "\C-m" 'newline)
@@ -961,9 +975,9 @@ language you are using."
961 975
962(define-key ctl-x-map "z" 'repeat) 976(define-key ctl-x-map "z" 'repeat)
963 977
964;;; Don't look for autoload cookies in this file. 978;; Don't look for autoload cookies in this file.
965;;; Local Variables: 979;; Local Variables:
966;;; no-update-autoloads: t 980;; no-update-autoloads: t
967;;; End: 981;; End:
968 982
969;;; bindings.el ends here 983;;; bindings.el ends here