help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Narrowing: highlighting "Narrow" lighter?


From: Raffaele Ricciardi
Subject: Re: Narrowing: highlighting "Narrow" lighter?
Date: Sat, 04 Aug 2012 14:00:16 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120713 Thunderbird/14.0

On 08/04/2012 12:29 PM, Christopher Schmidt wrote:
Raffaele Ricciardi <rfflrccrd@gmail.com> writes:
I've thought about highlighting the "Narrow" lighter in the Mode Line, but as
there is no Narrow mode and narrowing commands are defined in C source code, I
can't find a way to do that without resorting to advices or writing a Narrow
minor mode myself that manipulates the Mode Line.

     (loop
      for d in-ref mode-line-modes
      until
      (when (and (stringp d) (string= d "%n"))
        (setf d '(:eval
                  (unless (and (eq (point-min) 1)
                               (eq (point-max) (1+ (buffer-size))))
                    (propertize
                     " Liebe"
                     'face '(:foreground "pink")
                     'help-echo "mouse-2: Weniger Liebe für diesen Buffer :x"
                     'mouse-face 'mode-line-highlight
                     'local-map (make-mode-line-mouse-map 'mouse-2
                                                          
'mode-line-widen)))))))

         Christopher


Perfect.  Thank you.


reply via email to

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