From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vaidheeswaran C Newsgroups: gmane.emacs.devel Subject: Re: Background color past the end of the buffer Date: Fri, 10 Jul 2015 13:54:51 +0530 Message-ID: <559F8153.6020805@gmail.com> References: Reply-To: Emacs developers NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1436516959 4888 80.91.229.3 (10 Jul 2015 08:29:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2015 08:29:19 +0000 (UTC) To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 10 10:29:18 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZDTgM-0007bs-D4 for ged-emacs-devel@m.gmane.org; Fri, 10 Jul 2015 10:29:18 +0200 Original-Received: from localhost ([::1]:43594 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTgL-0001yt-U2 for ged-emacs-devel@m.gmane.org; Fri, 10 Jul 2015 04:29:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTby-0001pk-70 for emacs-devel@gnu.org; Fri, 10 Jul 2015 04:24:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZDTbt-0004GT-P4 for emacs-devel@gnu.org; Fri, 10 Jul 2015 04:24:46 -0400 Original-Received: from mail-pd0-x236.google.com ([2607:f8b0:400e:c02::236]:34388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZDTbt-0004F1-I5 for emacs-devel@gnu.org; Fri, 10 Jul 2015 04:24:41 -0400 Original-Received: by pdbep18 with SMTP id ep18so180532706pdb.1 for ; Fri, 10 Jul 2015 01:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=8nfofV59i20ccfKMbfPtc4z1ZPdHvtvC0pD2ADk4n5o=; b=SGl3VFW9sOVVS9KXImjlpO8QGdDM5m/DHDF+t4Jhi6L2hUXqzEJ8QTuo1kp5Q+Nmc1 wmwP8xVFi0jjonQ5LAaFj3WPkGtLBpMDSH8YnmMbk/O7+3i+sQHhsjJp8R9gHU/seEn2 /w9VGSw2pIgxJQM86Rn8KVPakP4Od7anF+83aUwT0iV0a14DJ1pauFhWIAlcUeASLKoP Z0iDqB461t6G69VSvtHFz9Y/bV7e6lu7YVHv1dUo3Ic27qFE1gnhaWd0GGVaRo7Mn0f1 OXp6xPmHfO7+on/hRg0p3513bil2l9KftFlIEGhbWbylBuWJ46AaMYhq88kjQdRppQdb /lQA== X-Received: by 10.68.253.135 with SMTP id aa7mr39975680pbd.159.1436516680908; Fri, 10 Jul 2015 01:24:40 -0700 (PDT) Original-Received: from [192.168.43.83] ([106.206.145.182]) by smtp.gmail.com with ESMTPSA id dl5sm8222599pbd.78.2015.07.10.01.24.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jul 2015 01:24:39 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.3.0 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:187795 Archived-At: 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.