From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: [Patch] Org-fontify Date: Fri, 13 Aug 2010 22:19:54 +0200 Message-ID: <87sk2iw9hx.fsf@mundaneum.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 Hello, Champagne! My very first patch... Hopefully one that will be followed by m= any more... Goal: to *fontify whole lines* of code-block or meta-lines. See the results on this minimal example: --8<---------------cut here---------------start------------->8--- #+TITLE: Better identification of source blocks and results #+DATE: 2010-08-13 #+DESCRIPTION:=20 #+KEYWORDS:=20 #+LANGUAGE: en_US This is #+BEGIN_SRC org ** Totals *** Using a table formula #+END_SRC random text #+LaTeX: \thisismycommand{}{param2} inserted between #+begin_src R :session woodland names(woodland) str(woodland) summary(woodland) #+end_src code blocks #+begin_src R :session woodland woodland #+end_src copy from different #+srcname:woodland #+begin_src R :colnames t read.table("/tmp/woodlands.txt",header=3DTRUE) #+end_src #+results: woodland | "ID" | "wood" | "A.reptans" | "E.amygdaloides" | |------+---------+-------------+------------------| | "a" | "wood1" | 5 | 10 | | "b" | "wood2" | 1 | 0 | postings on org-mode... --8<---------------cut here---------------end--------------->8--- with *faces with background*, such as: --8<---------------cut here---------------start------------->8--- (org-block ((t (:foreground "blue1" :background "#EAFFEA")))) (org-code ((t (:foreground "blue1" :background "#EAFFEA")))) (org-meta-line ((t (:foreground "#008ED1" :background "#FFEAEA")))) (org-table ((t (:foreground "blue1" :background "#EAEAFF")))) --8<---------------cut here---------------end--------------->8--- Only feature: I did not succeed highlighting full lines containing =3Dsrcna= me=3D or =3Dresults=3D. Not a big deal. Though, if someone can do it, that would definitely please me... Best regards, Seb --=20 S=C3=A9bastien Vauban --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=org-fontify.patch diff --git a/lisp/org.el b/lisp/org.el index af4f793..64deb53 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5036,8 +5036,9 @@ will be prompted for." '(display t invisible t intangible t)) (add-text-properties (match-beginning 1) (match-end 3) '(font-lock-fontified t face org-meta-line)) - (add-text-properties (match-beginning 6) (match-end 6) + (add-text-properties (match-beginning 6) (+ (match-end 6) 1) '(font-lock-fontified t face org-block)) + ; for backend-specific code t) ((and (match-end 4) (equal dc3 "begin")) ;; Truly a block @@ -5054,10 +5055,13 @@ will be prompted for." beg end '(font-lock-fontified t font-lock-multiline t)) (add-text-properties beg beg1 '(face org-meta-line)) - (add-text-properties end1 end '(face org-meta-line)) + (add-text-properties end1 (+ end 1) '(face org-meta-line)) + ; for end_src (cond (quoting - (add-text-properties beg1 end1 '(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))) --=-=-= 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 --=-=-=--