[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Background color past the end of the buffer
From: |
Vaidheeswaran C |
Subject: |
Re: Background color past the end of the buffer |
Date: |
Fri, 10 Jul 2015 13:54:51 +0530 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 |
On Friday 10 July 2015 12:06 AM, Yuri D'Elia wrote:
> I'd like to highlight the region past the end of the buffer; that is:
> assuming the buffer ends somewhere halfway the current frame (either due
> to scrolling or due to the buffer being short), I'd like to set an
> highlight between (point-max) and down to the modeline.
>
> I assume it's not possible using markers, and thus overlays.
>
> I don't want to display anything important right now, just change the
> background color.
>
> Any other trick I could use?
Install these ... and then do M-x highlight-buffer-footer.
(defface buffer-footer
'((t (:background "gold1")))
"Face for buffer footer")
(defface buffer-text
'((t (:background "white")))
"Face for buffer text.")
(defun highlight-buffer-footer ()
(interactive)
(custom-set-variables
'(buffer-face-mode-face (quote buffer-footer)))
(buffer-face-mode 1)
(overlay-put (make-overlay (point-min) (point-max)) 'face 'buffer-text))
Use of overlays (as seen above) may not be a good idea. It would be
worth exploring if face remapping could be used (or improved upon) to
achieve the above effect.
----------------------------------------------------------------
If you are only intereseted in catching whitespaces at the tail end of
the buffer, you can turn on the `empty' style in M-x whitespace-mode
and M-x whitespace-toggle-options.
- Background color past the end of the buffer, Yuri D'Elia, 2015/07/09
- Re: Background color past the end of the buffer,
Vaidheeswaran C <=
- Re: Background color past the end of the buffer, Yuri D'Elia, 2015/07/12
- Re: Background color past the end of the buffer, Achim Gratz, 2015/07/12
- Re: Background color past the end of the buffer, Yuri D'Elia, 2015/07/12
- Re: Background color past the end of the buffer, Yuri D'Elia, 2015/07/12
- Re: Background color past the end of the buffer, Eli Zaretskii, 2015/07/12
- Re: Background color past the end of the buffer, Yuri D'Elia, 2015/07/12
- Re: Background color past the end of the buffer, Eli Zaretskii, 2015/07/12
- Re: Background color past the end of the buffer, Vaidheeswaran C, 2015/07/12
- Re: Background color past the end of the buffer, Eli Zaretskii, 2015/07/13
- Re: Background color past the end of the buffer, Achim Gratz, 2015/07/12