Mercurial > hg > xemacs-beta
comparison lisp/prim/modeline.el @ 201:eb5470882647 r20-3b27
Import from CVS: tag r20-3b27
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:01:22 +0200 |
parents | acd284d43ca1 |
children |
comparison
equal
deleted
inserted
replaced
200:f0deb0c0e6be | 201:eb5470882647 |
---|---|
1 ;;; modeline.el --- modeline hackery. | 1 ;;; modeline.el --- modeline hackery. |
2 | 2 |
3 ;; Copyright (C) 1988, 1992, 1993, 1994 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1988, 1992-1994, 1997 Free Software Foundation, Inc. |
4 ;; Copyright (C) 1995, 1996 Ben Wing. | 4 ;; Copyright (C) 1995, 1996 Ben Wing. |
5 | 5 |
6 ;; This file is part of XEmacs. | 6 ;; This file is part of XEmacs. |
7 | 7 |
8 ;; XEmacs is free software; you can redistribute it and/or modify it | 8 ;; XEmacs is free software; you can redistribute it and/or modify it |
19 ;; along with XEmacs; see the file COPYING. If not, write to the | 19 ;; along with XEmacs; see the file COPYING. If not, write to the |
20 ;; Free Software Foundation, 59 Temple Place - Suite 330, | 20 ;; Free Software Foundation, 59 Temple Place - Suite 330, |
21 ;; Boston, MA 02111-1307, USA. | 21 ;; Boston, MA 02111-1307, USA. |
22 | 22 |
23 ;;; Synched up with: Not in FSF. | 23 ;;; Synched up with: Not in FSF. |
24 | |
25 ;;; Commentary: | |
26 | |
27 ;;; Code: | |
24 | 28 |
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
26 ;;; General mouse modeline stuff ;;; | 30 ;;; General mouse modeline stuff ;;; |
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
28 | 32 |
465 (make-variable-buffer-local 'modeline-process) | 469 (make-variable-buffer-local 'modeline-process) |
466 | 470 |
467 (defvar modeline-modified-map (make-sparse-keymap 'modeline-modified-map) | 471 (defvar modeline-modified-map (make-sparse-keymap 'modeline-modified-map) |
468 "Keymap consulted for mouse-clicks on the modeline-modified string.") | 472 "Keymap consulted for mouse-clicks on the modeline-modified string.") |
469 (define-key modeline-modified-map 'button2 | 473 (define-key modeline-modified-map 'button2 |
470 (make-modeline-command-wrapper 'vc-toggle-read-only)) | 474 (make-modeline-command-wrapper 'modeline-toggle-read-only)) |
471 | 475 |
472 (defvar modeline-modified-extent (make-extent nil nil) | 476 (defvar modeline-modified-extent (make-extent nil nil) |
473 "Extent covering the modeline-modified string.") | 477 "Extent covering the modeline-modified string.") |
474 (set-extent-face modeline-modified-extent 'modeline-mousable) | 478 (set-extent-face modeline-modified-extent 'modeline-mousable) |
475 (set-extent-keymap modeline-modified-extent modeline-modified-map) | 479 (set-extent-keymap modeline-modified-extent modeline-modified-map) |
507 (purecopy ")%]----") | 511 (purecopy ")%]----") |
508 (purecopy '(line-number-mode "L%l--")) | 512 (purecopy '(line-number-mode "L%l--")) |
509 (purecopy '(column-number-mode "C%c--")) | 513 (purecopy '(column-number-mode "C%c--")) |
510 (purecopy '(-3 . "%p")) | 514 (purecopy '(-3 . "%p")) |
511 (purecopy "-%-"))) | 515 (purecopy "-%-"))) |
516 | |
517 ;;; Added for XEmacs 20.3. Provide wrapper for vc since it may not always be | |
518 ;;; present, and its symbols are not visible this early in the dump if it | |
519 ;;; is. | |
520 | |
521 (defun modeline-toggle-read-only () | |
522 "Change whether this buffer is visiting its file read-only. | |
523 With arg, set read-only iff arg is positive. | |
524 This function is designed to be called when the read-only indicator on the | |
525 modeline is clicked. It will call `vc-toggle-read-only' if available, | |
526 otherwise it will call the usual `toggle-read-only'." | |
527 (interactive) | |
528 (if (fboundp 'vc-toggle-read-only) | |
529 (vc-toggle-read-only) | |
530 (toggle-read-only))) | |
531 | |
532 ;;; modeline.el ends here |