]> code.delx.au - gnu-emacs/blobdiff - lisp/bindings.el
Merge from emacs--devo--0
[gnu-emacs] / lisp / bindings.el
index 27d27946122193512550c7e4f5560117e310a5d4..38184ae88a4bc9c6ca2c19edc02e621c325256b2 100644 (file)
@@ -10,7 +10,7 @@
 
 ;; GNU Emacs is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
@@ -254,6 +254,22 @@ Normally nil in most modes, since there is no process to display.")
 
 (make-variable-buffer-local 'mode-line-modified)
 
+(defvar mode-line-remote
+  (list (propertize
+        "%1@"
+        'help-echo (purecopy (lambda (window object point)
+                               (format "%s"
+                                       (save-selected-window
+                                         (select-window window)
+                                         (concat 
+                                         (if (file-remote-p default-directory)
+                                             "Remote: "
+                                           "Local: ")
+                                         default-directory)))))))
+  "Mode-line flag to show if default-directory for current buffer is remote.")
+
+(make-variable-buffer-local 'mode-line-remote)
+
 ;; Actual initialization is below.
 (defvar mode-line-position nil
   "Mode-line control for displaying the position in the buffer.
@@ -294,6 +310,7 @@ Keymap to display on minor modes.")
         'mode-line-mule-info
         'mode-line-client
         'mode-line-modified
+        'mode-line-remote
         'mode-line-frame-identification
         'mode-line-buffer-identification
         (propertize "   " 'help-echo help-echo)