From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: Fontification of blocks Date: Thu, 03 Feb 2011 20:57:15 +0100 Message-ID: <80vd10q4bo.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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 Hi Eric, "Eric Schulte" wrote: > +(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-block-background nil > + "Face used for the source block background.") > + > (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 52de784..35da334 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -5141,21 +5141,24 @@ will be prompted for." > (add-text-properties > beg end > '(font-lock-fontified t font-lock-multiline t)) > - (add-text-properties beg beg1 '(face org-meta-line)) > - (add-text-properties end1 (+ end 1) '(face org-meta-line)) > - ; 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=3D block-type "quote") > - (add-text-properties beg1 end1 '(face org-quote))) > + (add-text-properties beg1 (1+ end1) '(face org-quote))) > ((string=3D 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-meta-line)) > + (add-text-properties beg beg1 '(face org-block-begin-line)) > + (add-text-properties (1+ end) (1+ end1) '(face org-meta-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:" > > I noticed a couple of issues in the applied patch (possibly due to a > transcription error on my part). Namely > - I believe your default faces only work for white backgrounds Yes in my example test file -- I'm only using a "light theme". Not in the patch to come, as it simply is a copy of org-meta-line; so, if y= our org-meta-line is "dark theme"-compatible, the patch won't alter anything for you. > - I didn't notice a change in background for the code blocks I guess because your defface does not contain any background property? > - it seems that the #+end_src line is fontified but the #+begin_src line > is not That was not the case for me. > An image of my Emacs after applying the patch is available at: > http://i.imgur.com/2eu3z.png I'll now make a proper patch of what I want to submit, and let you review i= t. I'll share an image as well, of a possible customization. Thanks for your comments, Eric(s) and Dan. Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ 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