diff options
Diffstat (limited to 'lisp/bindings.el')
-rw-r--r-- | lisp/bindings.el | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/lisp/bindings.el b/lisp/bindings.el index 56f742a2704..8ae8c3d60ef 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -288,7 +288,7 @@ mnemonics of the following coding systems: Value is used for `mode-line-frame-identification', which see." (if (or (null window-system) (eq window-system 'pc)) - "-%F " + " %F " " ")) ;; We need to defer the call to mode-line-frame-control to the time @@ -501,8 +501,9 @@ mouse-1: Display Line and Column Mode Menu")) (defvar mode-line-position `((:propertize - mode-line-percent-position + ("" mode-line-percent-position) local-map ,mode-line-column-line-number-mode-map + display (min-width (5.0)) mouse-face mode-line-highlight ;; XXX needs better description help-echo "Window Scroll Percentage @@ -521,26 +522,31 @@ mouse-1: Display Line and Column Mode Menu"))) (10 (:propertize mode-line-position-column-line-format + display (min-width (10.0)) ,@mode-line-position--column-line-properties)) (10 (:propertize (:eval (string-replace "%c" "%C" (car mode-line-position-column-line-format))) + display (min-width (10.0)) ,@mode-line-position--column-line-properties))) (6 (:propertize mode-line-position-line-format + display (min-width (6.0)) ,@mode-line-position--column-line-properties)))) (column-number-mode (column-number-indicator-zero-based (6 (:propertize mode-line-position-column-format + display (min-width (6.0)) (,@mode-line-position--column-line-properties))) (6 (:propertize (:eval (string-replace "%c" "%C" (car mode-line-position-column-format))) + display (min-width (6.0)) ,@mode-line-position--column-line-properties)))))) "Mode line construct for displaying the position in the buffer. Normally displays the buffer percentage and, optionally, the @@ -597,10 +603,14 @@ By default, this shows the information specified by `global-mode-string'.") (let ((standard-mode-line-format (list "%e" 'mode-line-front-space - 'mode-line-mule-info - 'mode-line-client - 'mode-line-modified - 'mode-line-remote + (list + :propertize + (list "" + 'mode-line-mule-info + 'mode-line-client + 'mode-line-modified + 'mode-line-remote) + 'display '(min-width (5.0))) 'mode-line-frame-identification 'mode-line-buffer-identification " " @@ -644,6 +654,18 @@ By default, this shows the information specified by `global-mode-string'.") (with-selected-window (posn-window (event-start event)) (previous-buffer))) +(defun mode-line-window-selected-p () + "Return non-nil if we're updating the mode line for the selected window. +This function is meant to be called in `:eval' mode line +constructs to allow altering the look of the mode line depending +on whether the mode line belongs to the currently selected window +or not." + (let ((window (selected-window))) + (or (eq window (old-selected-window)) + (and (minibuffer-window-active-p (minibuffer-window)) + (with-selected-window (minibuffer-window) + (eq window (minibuffer-selected-window))))))) + (defmacro bound-and-true-p (var) "Return the value of symbol VAR if it is bound, else nil. Note that if `lexical-binding' is in effect, this function isn't @@ -1138,7 +1160,9 @@ if `inhibit-field-text-motion' is non-nil." ;(define-key global-map [delete] 'backward-delete-char) ;; natural bindings for terminal keycaps --- defined in X keysym order -(define-key global-map [Scroll_Lock] 'scroll-lock-mode) +(define-key global-map + (if (eq system-type 'windows-nt) [scroll] [Scroll_Lock]) + #'scroll-lock-mode) (define-key global-map [C-S-backspace] 'kill-whole-line) (define-key global-map [home] 'move-beginning-of-line) (define-key global-map [C-home] 'beginning-of-buffer) @@ -1251,6 +1275,8 @@ if `inhibit-field-text-motion' is non-nil." ;; (define-key global-map [kp-9] 'function-key-error) ;; (define-key global-map [kp-equal] 'function-key-error) +(define-key global-map [touch-end] 'ignore) + ;; X11 distinguishes these keys from the non-kp keys. ;; Make them behave like the non-kp keys unless otherwise bound. ;; FIXME: rather than list such mappings for every modifier-combination, |