lisp/*.el: Lexical-binding cleanup.
[bpt/emacs.git] / lisp / bindings.el
index d19db2c..8c48bdc 100644 (file)
@@ -1,7 +1,6 @@
 ;;; bindings.el --- define standard key bindings and some variables
 
-;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994, 1995, 1996, 1999,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+;; Copyright (C) 1985-1987, 1992-1996, 1999-2011
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -154,17 +153,17 @@ mouse-3: Describe current input method"))
     ,(propertize
       "%z"
       'help-echo
-      #'(lambda (window object point)
-         (with-current-buffer (window-buffer window)
-           ;; Don't show this tip if the coding system is nil,
-           ;; it reads like a bug, and is not useful anyway.
-           (when buffer-file-coding-system
-             (format "Buffer coding system %s\nmouse-1: describe coding system"
-                     (if enable-multibyte-characters
-                         (concat "(multi-byte): "
-                                 (symbol-name buffer-file-coding-system))
-                       (concat "(unibyte): "
-                               (symbol-name buffer-file-coding-system)))))))
+      (lambda (window _object _point)
+       (with-current-buffer (window-buffer window)
+         ;; Don't show this tip if the coding system is nil,
+         ;; it reads like a bug, and is not useful anyway.
+         (when buffer-file-coding-system
+           (format "Buffer coding system %s\nmouse-1: describe coding system"
+                   (if enable-multibyte-characters
+                       (concat "(multi-byte): "
+                               (symbol-name buffer-file-coding-system))
+                     (concat "(unibyte): "
+                             (symbol-name buffer-file-coding-system)))))))
       'mouse-face 'mode-line-highlight
       'local-map mode-line-coding-system-map)
     (:eval (mode-line-eol-desc)))
@@ -210,7 +209,7 @@ Normally nil in most modes, since there is no process to display.")
 (defvar mode-line-modified
   (list (propertize
         "%1*"
-        'help-echo (purecopy (lambda (window object point)
+        'help-echo (purecopy (lambda (window _object _point)
                                (format "Buffer is %s\nmouse-1 toggles"
                                        (save-selected-window
                                          (select-window window)
@@ -223,7 +222,7 @@ Normally nil in most modes, since there is no process to display.")
         'mouse-face 'mode-line-highlight)
        (propertize
         "%1+"
-        'help-echo  (purecopy (lambda (window object point)
+        'help-echo  (purecopy (lambda (window _object _point)
                                 (format "Buffer is %sodified\nmouse-1 toggles modified state"
                                         (save-selected-window
                                           (select-window window)
@@ -243,7 +242,7 @@ Normally nil in most modes, since there is no process to display.")
   (list (propertize
         "%1@"
         'mouse-face 'mode-line-highlight
-        'help-echo (purecopy (lambda (window object point)
+        'help-echo (purecopy (lambda (window _object _point)
                                (format "%s"
                                        (save-selected-window
                                          (select-window window)
@@ -318,7 +317,7 @@ Keymap to display on column and line numbers.")
 mouse-2: Make current window occupy the whole frame\n\
 mouse-3: Remove current window from display")
        (recursive-edit-help-echo "Recursive edit, type C-M-c to get out")
-       (dashes (propertize "--" 'help-echo help-echo))
+       (spaces (propertize " " 'help-echo help-echo))
        (standard-mode-line-format
        (list
         "%e"
@@ -334,9 +333,10 @@ mouse-3: Remove current window from display")
         '(vc-mode vc-mode)
         (propertize "  " 'help-echo help-echo)
         'mode-line-modes
-        `(which-func-mode ("" which-func-format ,dashes))
-        `(global-mode-string ("" global-mode-string ,dashes))
-        (propertize "-%-" 'help-echo help-echo)))
+        `(which-func-mode ("" which-func-format ,spaces))
+        `(global-mode-string ("" global-mode-string ,spaces))
+        `(:eval (unless (display-graphic-p)
+                  ,(propertize "-%-" 'help-echo help-echo)))))
        (standard-mode-line-modes
        (list
         (propertize "%[" 'help-echo recursive-edit-help-echo)
@@ -362,7 +362,7 @@ mouse-3: Toggle minor modes"
                                 'mouse-2 #'mode-line-widen))
         (propertize ")" 'help-echo help-echo)
         (propertize "%]" 'help-echo recursive-edit-help-echo)
-        (propertize "--" 'help-echo help-echo)))
+        spaces))
 
        (standard-mode-line-position
        `((-3 ,(propertize
@@ -654,6 +654,16 @@ is okay.  See `mode-line-format'.")
 
 (define-key esc-map "\t" 'complete-symbol)
 
+(defun complete-symbol (arg)
+  "Perform completion on the text around point.
+The completion method is determined by `completion-at-point-functions'.
+
+With a prefix argument, this command does completion within
+the collection of symbols listed in the index of the manual for the
+language you are using."
+  (interactive "P")
+  (if arg (info-complete-symbol) (completion-at-point)))
+
 ;; Reduce total amount of space we must allocate during this function
 ;; that we will not need to keep permanently.
 (garbage-collect)
@@ -824,7 +834,7 @@ if `inhibit-field-text-motion' is non-nil."
 (define-key global-map [?\C-\M--] 'negative-argument)
 
 (define-key global-map "\177" 'delete-backward-char)
-(define-key global-map "\C-d" 'delete-forward-char)
+(define-key global-map "\C-d" 'delete-char)
 
 (define-key global-map "\C-k" 'kill-line)
 (define-key global-map "\C-w" 'kill-region)
@@ -933,7 +943,7 @@ if `inhibit-field-text-motion' is non-nil."
 ;; (define-key global-map [clearline]  'function-key-error)
 (define-key global-map [insertline]    'open-line)
 (define-key global-map [deleteline]    'kill-line)
-(define-key global-map [deletechar]    'delete-char)
+(define-key global-map [deletechar]    'delete-forward-char)
 ;; (define-key global-map [backtab]    'function-key-error)
 ;; (define-key global-map [f1]         'function-key-error)
 ;; (define-key global-map [f2]         'function-key-error)
@@ -1203,5 +1213,4 @@ if `inhibit-field-text-motion' is non-nil."
 ;; no-update-autoloads: t
 ;; End:
 
-;; arch-tag: 23b5c7e6-e47b-49ed-8c6c-ed213c5fffe0
 ;;; bindings.el ends here