Mercurial > emacs
comparison lisp/bindings.el @ 65524:d4001c18bf64
(mode-line-eol-desc, mode-line-coding-system-map)
(mode-line-mule-info, mode-line-modified): Move bindings from
mouse-3 to mouse-1.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Thu, 15 Sep 2005 04:12:27 +0000 |
parents | 41bb365f41c4 |
children | d5c276f89641 d84f940244dc fa0da9b57058 |
comparison
equal
deleted
inserted
replaced
65523:9ab66cb89208 | 65524:d4001c18bf64 |
---|---|
121 (purecopy map))) | 121 (purecopy map))) |
122 | 122 |
123 | 123 |
124 (defvar mode-line-coding-system-map | 124 (defvar mode-line-coding-system-map |
125 (let ((map (make-sparse-keymap))) | 125 (let ((map (make-sparse-keymap))) |
126 (define-key map [mode-line mouse-3] | 126 (define-key map [mode-line mouse-1] |
127 (lambda (e) | 127 (lambda (e) |
128 (interactive "e") | 128 (interactive "e") |
129 (save-selected-window | 129 (save-selected-window |
130 (select-window (posn-window (event-start e))) | 130 (select-window (posn-window (event-start e))) |
131 (when (and enable-multibyte-characters | 131 (when (and enable-multibyte-characters |
154 (cddr desc) | 154 (cddr desc) |
155 (if desc (setq mode-line-eol-desc-cache nil)) ;Flush the cache if stale. | 155 (if desc (setq mode-line-eol-desc-cache nil)) ;Flush the cache if stale. |
156 (setq desc | 156 (setq desc |
157 (propertize | 157 (propertize |
158 mnemonic | 158 mnemonic |
159 'help-echo (format "%s end-of-line; mouse-3 to cycle" | 159 'help-echo (format "%s end-of-line; mouse-1 to cycle" |
160 (if (eq eol 0) "Unix-style LF" | 160 (if (eq eol 0) "Unix-style LF" |
161 (if (eq eol 1) "Dos-style CRLF" | 161 (if (eq eol 1) "Dos-style CRLF" |
162 (if (eq eol 2) "Mac-style CR" | 162 (if (eq eol 2) "Mac-style CR" |
163 "Undecided")))) | 163 "Undecided")))) |
164 'keymap | 164 'keymap |
165 (eval-when-compile | 165 (eval-when-compile |
166 (let ((map (make-sparse-keymap))) | 166 (let ((map (make-sparse-keymap))) |
167 (define-key map [mode-line mouse-3] 'mode-line-change-eol) | 167 (define-key map [mode-line mouse-1] 'mode-line-change-eol) |
168 map)) | 168 map)) |
169 'mouse-face 'mode-line-highlight)) | 169 'mouse-face 'mode-line-highlight)) |
170 (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache) | 170 (push (cons eol (cons mnemonic desc)) mode-line-eol-desc-cache) |
171 desc))) | 171 desc))) |
172 | 172 |
188 ;; Don't show this tip if the coding system is nil, | 188 ;; Don't show this tip if the coding system is nil, |
189 ;; it reads like a bug, and is not useful anyway. | 189 ;; it reads like a bug, and is not useful anyway. |
190 (when buffer-file-coding-system | 190 (when buffer-file-coding-system |
191 (if enable-multibyte-characters | 191 (if enable-multibyte-characters |
192 (concat (symbol-name buffer-file-coding-system) | 192 (concat (symbol-name buffer-file-coding-system) |
193 " buffer; mouse-3: describe coding system") | 193 " buffer; mouse-1: describe coding system") |
194 (concat "Unibyte " (symbol-name buffer-file-coding-system) | 194 (concat "Unibyte " (symbol-name buffer-file-coding-system) |
195 " buffer"))))) | 195 " buffer"))))) |
196 'mouse-face 'mode-line-highlight | 196 'mouse-face 'mode-line-highlight |
197 'local-map mode-line-coding-system-map) | 197 'local-map mode-line-coding-system-map) |
198 (:eval (mode-line-eol-desc))) | 198 (:eval (mode-line-eol-desc))) |
228 | 228 |
229 (defvar mode-line-modified | 229 (defvar mode-line-modified |
230 (list (propertize | 230 (list (propertize |
231 "%1*" | 231 "%1*" |
232 'help-echo (purecopy (lambda (window object point) | 232 'help-echo (purecopy (lambda (window object point) |
233 (format "%sead-only: mouse-3 toggles" | 233 (format "%sead-only: mouse-1 toggles" |
234 (save-selected-window | 234 (save-selected-window |
235 (select-window window) | 235 (select-window window) |
236 (if buffer-read-only | 236 (if buffer-read-only |
237 "R" | 237 "R" |
238 "Not r"))))) | 238 "Not r"))))) |
239 'local-map (purecopy (make-mode-line-mouse-map | 239 'local-map (purecopy (make-mode-line-mouse-map |
240 'mouse-3 | 240 'mouse-1 |
241 #'mode-line-toggle-read-only)) | 241 #'mode-line-toggle-read-only)) |
242 'mouse-face 'mode-line-highlight) | 242 'mouse-face 'mode-line-highlight) |
243 (propertize | 243 (propertize |
244 "%1+" | 244 "%1+" |
245 'help-echo (purecopy (lambda (window object point) | 245 'help-echo (purecopy (lambda (window object point) |
246 (format "%sodified: mouse-3 toggles" | 246 (format "%sodified: mouse-1 toggles" |
247 (save-selected-window | 247 (save-selected-window |
248 (select-window window) | 248 (select-window window) |
249 (if (buffer-modified-p) | 249 (if (buffer-modified-p) |
250 "M" | 250 "M" |
251 "Not m"))))) | 251 "Not m"))))) |
252 'local-map (purecopy (make-mode-line-mouse-map | 252 'local-map (purecopy (make-mode-line-mouse-map |
253 'mouse-3 #'mode-line-toggle-modified)) | 253 'mouse-1 #'mode-line-toggle-modified)) |
254 'mouse-face 'mode-line-highlight)) | 254 'mouse-face 'mode-line-highlight)) |
255 "Mode-line control for displaying whether current buffer is modified.") | 255 "Mode-line control for displaying whether current buffer is modified.") |
256 | 256 |
257 (make-variable-buffer-local 'mode-line-modified) | 257 (make-variable-buffer-local 'mode-line-modified) |
258 | 258 |