emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mode-line with Tramp


From: Nick Roberts
Subject: Re: mode-line with Tramp
Date: Tue, 24 Jul 2007 10:46:31 +1200

 > >  >     Maybe it would be better to use "@" instead of "R" to indicate the 
 > > remote
 > >  >     directory?
 > >  > 
 > >  >     -RRR:address@hidden
 > >  > 
 > >  > I prefer @.
 > >
 > > OK I've committed a patch with "@".
 > 
 > Not a big deal, but wouldn't it be better to use %@ format instead of %R
 > for consistency with its display in the mode line?

Well, %R isn't a user level change (mode-line-format is described in the
Elisp manual, not the Emacs manual).  I had thought there might be a clash
but there isn't, so I could do this as there is no cost.

Currently the double-end arrow pointer shape that indicates the mode-line
can be dragged obscures the character underneath.  How about the change
below?  I realise that Richard thinks that mixing the mouse and keyboard is
bad UI (although Emacs already does this from the menu-bar and, now with
vc-mode, from the mode-line with some VC commands) but it changes the
pointer shape to a hand and gives functionality consistent with the bindings
for the two previous characters on the mode line (mode-line-toggle-read-only
and mode-line-toggle-modified) which I think is good UI.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


*** bindings.el 23 Jul 2007 11:01:09 +1200      1.179
--- bindings.el 24 Jul 2007 10:24:57 +1200      
*************** corresponding to the mode line clicked."
*** 74,79 ****
--- 74,90 ----
      (force-mode-line-update)))
  
  
+ (defun mode-line-cd (event)
+   "Make DIR become the current buffer's default directory.
+ See `cd'."
+   (interactive "e")
+   (save-selected-window
+     (select-window (posn-window (event-start event)))
+     (let ((arg (read-from-minibuffer "Change default directory: ")))
+       (cd arg))
+     (force-mode-line-update)))
+ 
+ 
  (defun mode-line-widen (event)
    "Widen a buffer from the mode-line."
    (interactive "e")
*************** Normally nil in most modes, since there 
*** 250,265 ****
  
  (defvar mode-line-remote
    (list (propertize
!        "%1R"
         '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)
--- 261,277 ----
  
  (defvar mode-line-remote
    (list (propertize
!        "%1@"
         'help-echo (purecopy (lambda (window object point)
                                (format "%s"
                                        (save-selected-window
                                          (select-window window)
                                          (concat 
!                                         default-directory
!                                         ": mouse-1 changes")))))
!        'local-map (purecopy (make-mode-line-mouse-map
!                              'mouse-1 #'mode-line-cd))
!        'mouse-face 'mode-line-highlight))
    "Mode-line flag to show if default-directory for current buffer is remote.")
  
  (make-variable-buffer-local 'mode-line-remote)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]