From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: Fontification of blocks Date: Fri, 04 Feb 2011 10:21:18 +0100 Message-ID: <80vd10noj5.fsf@missioncriticalit.com> References: <80aakevw4w.fsf@missioncriticalit.com> <8739q1ihas.fsf@gmail.com> <80r5dlpfj6.fsf@missioncriticalit.com> <87ei9jkl0l.fsf@gmail.com> <80sjw7qxem.fsf@missioncriticalit.com> <80ei7q9is6.fsf@missioncriticalit.com> <871v3pp3e3.fsf@gmail.com> <87sjw4ubnp.fsf@ucl.ac.uk> <80aaicvoep.fsf@missioncriticalit.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, As spotted by Eric Fraga: S=C3=A9bastien Vauban wrote: > --- a/lisp/org-faces.el > +++ b/lisp/org-faces.el > @@ -1,6 +1,6 @@ > ;;; org-faces.el --- Face definitions for Org-mode. >=20=20 > -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 > +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 > ;; Free Software Foundation, Inc. >=20=20 > ;; Author: Carsten Dominik > @@ -511,6 +511,16 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." > :group 'org-faces > :version "22.1") >=20=20 > +(defface org-block-background > + '((t (:background "#FFFFEA"))) > + "Face used for the source block background.") > + > +(org-copy-face 'org-meta-line 'org-block-begin-line > + "Face used for the line delimiting the begin of source blocks.") > + > +(org-copy-face 'org-meta-line 'org-block-begin-line > + "Face used for the line delimiting the end of source blocks.") > + > (defface org-verbatim > (org-compatible-face 'shadow > '((((class color grayscale) (min-colors 88) (background light)) you should read the following at the 2nd =3Dorg-copy-face=3D command: > +(org-copy-face 'org-meta-line 'org-block-end-line > + "Face used for the line delimiting the end of source blocks.") ie, s/begin/end/ I guess it worked for me (I restarted completely Emacs for the test), as th= at face is defined in my color-theme now. So, it was created anyway. Corrected patch is attached to this post. Best regards, Seb --=20 S=C3=A9bastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001.patch diff --git a/lisp/org-faces.el b/lisp/org-faces.el index c237a0e..2e9d2a3 100644 --- a/lisp/org-faces.el +++ b/lisp/org-faces.el @@ -1,6 +1,6 @@ ;;; org-faces.el --- Face definitions for Org-mode. -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; Free Software Foundation, Inc. ;; Author: Carsten Dominik @@ -511,6 +511,16 @@ follows a #+DATE:, #+AUTHOR: or #+EMAIL: keyword." :group 'org-faces :version "22.1") +(defface org-block-background + '((t (:background "#FFFFEA"))) + "Face used for the source block background.") + +(org-copy-face 'org-meta-line 'org-block-begin-line + "Face used for the line delimiting the begin of source blocks.") + +(org-copy-face 'org-meta-line 'org-block-end-line + "Face used for the line delimiting the end of source blocks.") + (defface org-verbatim (org-compatible-face 'shadow '((((class color grayscale) (min-colors 88) (background light)) diff --git a/lisp/org.el b/lisp/org.el index 8acf5a9..70fda86 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -1,6 +1,6 @@ ;;; org.el --- Outline-based notes management and organizer ;; Carstens outline-mode for keeping track of everything. -;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; Free Software Foundation, Inc. ;; ;; Author: Carsten Dominik @@ -5146,16 +5146,19 @@ will be prompted for." ; for end_src (cond ((and lang org-src-fontify-natively) - (org-src-font-lock-fontify-block lang block-start block-end)) + (org-src-font-lock-fontify-block lang block-start block-end) + (overlay-put (make-overlay beg1 block-end) + 'face 'org-block-background)) (quoting - (add-text-properties beg1 (+ end1 1) '(face - org-block))) + (add-text-properties beg1 (+ end1 1) '(face org-block))) ; end of source block ((not org-fontify-quote-and-verse-blocks)) ((string= block-type "quote") - (add-text-properties beg1 end1 '(face org-quote))) + (add-text-properties beg1 (1+ end1) '(face org-quote))) ((string= block-type "verse") - (add-text-properties beg1 end1 '(face org-verse)))) + (add-text-properties beg1 (1+ end1) '(face org-verse)))) + (add-text-properties beg beg1 '(face org-block-begin-line)) + (add-text-properties (1+ end) (1+ end1) '(face org-block-end-line)) t)) ((member dc1 '("title:" "author:" "email:" "date:")) (add-text-properties @@ -5171,7 +5174,7 @@ will be prompted for." ((not (member (char-after beg) '(?\ ?\t))) ;; just any other in-buffer setting, but not indented (add-text-properties - beg (match-end 0) + beg (1+ (match-end 0)) '(font-lock-fontified t face org-meta-line)) t) ((or (member dc1 '("begin:" "end:" "caption:" "label:" --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --=-=-=--