]> code.delx.au - gnu-emacs/blobdiff - lisp/bindings.el
Remove some face aliases obsoleted in 22.1
[gnu-emacs] / lisp / bindings.el
index 7093b8e662f1221275c02eb797b35abb0977cb7d..c13f4b156a17cc14190669fb96bc3d024a289c60 100644 (file)
@@ -1,6 +1,6 @@
 ;;; bindings.el --- define standard key bindings and some variables
 
-;; Copyright (C) 1985-1987, 1992-1996, 1999-2014 Free Software
+;; Copyright (C) 1985-1987, 1992-1996, 1999-2016 Free Software
 ;; Foundation, Inc.
 
 ;; Maintainer: emacs-devel@gnu.org
@@ -36,7 +36,7 @@ corresponding to the mode line clicked."
 
 
 (defun mode-line-toggle-read-only (event)
-  "Like `toggle-read-only', for the mode-line."
+  "Like toggling `read-only-mode', for the mode-line."
   (interactive "e")
   (with-selected-window (posn-window (event-start event))
     (read-only-mode 'toggle)))
@@ -229,11 +229,13 @@ mnemonics of the following coding systems:
         'help-echo (purecopy (lambda (window _object _point)
                                (format "%s"
                                        (with-selected-window window
-                                         (concat
-                                          (if (file-remote-p default-directory)
-                                              "Current directory is remote: "
-                                            "Current directory is local: ")
-                                          default-directory)))))))
+                                         (if (stringp default-directory)
+                                             (concat
+                                              (if (file-remote-p default-directory)
+                                                  "Current directory is remote: "
+                                                "Current directory is local: ")
+                                              default-directory)
+                                           "Current directory is nil")))))))
   "Mode line construct to indicate a remote buffer.")
 ;;;###autoload
 (put 'mode-line-remote 'risky-local-variable t)
@@ -336,6 +338,10 @@ mouse-3: Toggle minor modes"
 (defvar mode-line-column-line-number-mode-map
   (let ((map (make-sparse-keymap))
        (menu-map (make-sparse-keymap "Toggle Line and Column Number Display")))
+    (bindings--define-key menu-map [size-indication-mode]
+      '(menu-item "Display Size Indication" size-indication-mode
+                 :help "Toggle displaying a size indication in the mode-line"
+                 :button (:toggle . size-indication-mode)))
     (bindings--define-key menu-map [line-number-mode]
       '(menu-item "Display Line Numbers" line-number-mode
                  :help "Toggle displaying line numbers in the mode-line"
@@ -428,11 +434,9 @@ Major modes that edit things other than ordinary files may change this
 (make-variable-buffer-local 'mode-line-buffer-identification)
 
 (defvar mode-line-misc-info
-  '((which-func-mode ("" which-func-format " "))
-    (global-mode-string ("" global-mode-string " ")))
+  '((global-mode-string ("" global-mode-string " ")))
   "Mode line construct for miscellaneous information.
-By default, this shows the information specified by
-`which-func-mode' and `global-mode-string'.")
+By default, this shows the information specified by `global-mode-string'.")
 (put 'mode-line-misc-info 'risky-local-variable t)
 
 (defvar mode-line-end-spaces '(:eval (unless (display-graphic-p) "-%-"))
@@ -631,7 +635,7 @@ okay.  See `mode-line-format'.")
       ;; file-supersession should all be user-errors!
       `(beginning-of-line beginning-of-buffer end-of-line
        end-of-buffer end-of-file buffer-read-only
-       file-supersession
+       file-supersession mark-inactive
         user-error ;; That's the main one!
         ))
 
@@ -837,11 +841,11 @@ if `inhibit-field-text-motion' is non-nil."
 (let ((map minibuffer-local-map))
   (define-key map "\en"   'next-history-element)
   (define-key map [next]  'next-history-element)
-  (define-key map [down]  'next-history-element)
+  (define-key map [down]  'next-line-or-history-element)
   (define-key map [XF86Forward] 'next-history-element)
   (define-key map "\ep"   'previous-history-element)
   (define-key map [prior] 'previous-history-element)
-  (define-key map [up]    'previous-history-element)
+  (define-key map [up]    'previous-line-or-history-element)
   (define-key map [XF86Back] 'previous-history-element)
   (define-key map "\es"   'next-matching-history-element)
   (define-key map "\er"   'previous-matching-history-element)
@@ -923,14 +927,15 @@ if `inhibit-field-text-motion' is non-nil."
   "Keymap for search related commands.")
 (define-key esc-map "s" search-map)
 
-(define-key search-map "o"  'occur)
-(define-key search-map "hr" 'highlight-regexp)
-(define-key search-map "hp" 'highlight-phrase)
-(define-key search-map "hl" 'highlight-lines-matching-regexp)
-(define-key search-map "h." 'highlight-symbol-at-point)
-(define-key search-map "hu" 'unhighlight-regexp)
-(define-key search-map "hf" 'hi-lock-find-patterns)
-(define-key search-map "hw" 'hi-lock-write-interactive-patterns)
+(define-key search-map "o"    'occur)
+(define-key search-map "\M-w" 'eww-search-words)
+(define-key search-map "hr"   'highlight-regexp)
+(define-key search-map "hp"   'highlight-phrase)
+(define-key search-map "hl"   'highlight-lines-matching-regexp)
+(define-key search-map "h."   'highlight-symbol-at-point)
+(define-key search-map "hu"   'unhighlight-regexp)
+(define-key search-map "hf"   'hi-lock-find-patterns)
+(define-key search-map "hw"   'hi-lock-write-interactive-patterns)
 
 ;;(defun function-key-error ()
 ;;  (interactive)
@@ -1075,10 +1080,14 @@ if `inhibit-field-text-motion' is non-nil."
              (kp-5 ?5) (kp-6 ?6) (kp-7 ?7) (kp-8 ?8) (kp-9 ?9)
              (kp-add ?+) (kp-subtract ?-) (kp-multiply ?*) (kp-divide ?/))))
   (dolist (pair keys)
-    (dolist (mod modifiers)
-      (define-key function-key-map
-       (vector (append mod (list (nth 0 pair))))
-       (vector (append mod (list (nth 1 pair))))))))
+    (let ((keypad (nth 0 pair))
+         (normal (nth 1 pair)))
+      (when (characterp normal)
+       (put keypad 'ascii-character normal))
+      (dolist (mod modifiers)
+       (define-key function-key-map
+         (vector (append mod (list keypad)))
+         (vector (append mod (list normal))))))))
 
 (define-key function-key-map [backspace] [?\C-?])
 (define-key function-key-map [delete] [?\C-?])
@@ -1123,6 +1132,7 @@ if `inhibit-field-text-motion' is non-nil."
 (define-key esc-map "j" 'indent-new-comment-line)
 (define-key esc-map "\C-j" 'indent-new-comment-line)
 (define-key ctl-x-map ";" 'comment-set-column)
+(define-key ctl-x-map [?\C-\;] 'comment-line)
 (define-key ctl-x-map "f" 'set-fill-column)
 (define-key ctl-x-map "$" 'set-selective-display)
 
@@ -1257,9 +1267,9 @@ if `inhibit-field-text-motion' is non-nil."
 (define-key abbrev-map "e" 'expand-abbrev)
 (define-key abbrev-map "'" 'expand-abbrev)
 ;; (define-key ctl-x-map "\C-a" 'add-mode-abbrev)
-;; (define-key ctl-x-map "\+" 'add-global-abbrev)
+;; (define-key ctl-x-map "+" 'add-global-abbrev)
 ;; (define-key ctl-x-map "\C-h" 'inverse-add-mode-abbrev)
-;; (define-key ctl-x-map "\-" 'inverse-add-global-abbrev)
+;; (define-key ctl-x-map "-" 'inverse-add-global-abbrev)
 (define-key esc-map "'" 'abbrev-prefix-mark)
 (define-key ctl-x-map "'" 'expand-abbrev)
 (define-key ctl-x-map "\C-b" 'list-buffers)