emacs-devel
[Top][All Lists]
Advanced

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

Re: Customizing the mode line


From: Chong Yidong
Subject: Re: Customizing the mode line
Date: Sat, 31 Oct 2009 10:33:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

Here's one small simplification to the mode-line that we can easily
introduce: define a variable mode-line-help-echo, which serves as the
default help echo for any mode-line element not having its own
help-echo.

Now, bindings.el won't need to manuall apply the default help-echo to
"neutral" mode-line elements like spaces.  This makes the value shown in
`C-h v mode-line-format' less of a mess:

Value:
("%e-" mode-line-mule-info mode-line-client mode-line-modified mode-line-remote 
mode-line-frame-identification mode-line-buffer-identification "   " 
mode-line-position
 (vc-mode vc-mode)
 "  " mode-line-modes
 (which-func-mode
  ("" which-func-format "--"))
 (global-mode-string
  ("" global-mode-string "--"))
 "-%-")

Do you think that helps?


*** emacs/src/xdisp.c.~1.1316.~ 2009-10-22 10:28:39.000000000 -0400
--- emacs/src/xdisp.c   2009-10-31 10:24:42.000000000 -0400
***************
*** 230,235 ****
--- 230,236 ----
  
  extern Lisp_Object Qface;
  extern Lisp_Object Qmode_line, Qmode_line_inactive, Qheader_line;
+ Lisp_Object Vmode_line_help_echo;
  
  extern Lisp_Object Voverriding_local_map;
  extern Lisp_Object Voverriding_local_map_menu_flag;
***************
*** 23421,23426 ****
--- 23422,23429 ----
        if (NILP (help))
        {
          help = Fget_text_property (pos, Qhelp_echo, string);
+         if (NILP (help) && !NILP (Vmode_line_help_echo))
+           help = Vmode_line_help_echo;
          if (!NILP (help))
            {
              help_echo_string = help;
***************
*** 24914,24919 ****
--- 24917,24930 ----
  `header-line', or `menu' respectively.  */);
    mode_line_inverse_video = 1;
  
+   DEFVAR_LISP ("mode-line-help-echo", &Vmode_line_help_echo,
+              doc: /* Default help-echo (tooltip) for mode-line elements.
+ This help-echo applies to any mode-line elements lacking a `help-echo'
+ property (see `mode-line-format'.  */);
+   Vmode_line_help_echo = build_string ("mouse-1: Select (drag to resize)\n\
+ mouse-2: Make current window occupy the whole frame\n\
+ mouse-3: Remove current window from display");
+ 
    DEFVAR_LISP ("line-number-display-limit", &Vline_number_display_limit,
      doc: /* *Maximum buffer size for which line number should be displayed.
  If the buffer is bigger than this, the line number does not appear




reply via email to

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