From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Issues w/ hacking Org font-lock for variable pitch prose Date: Sat, 05 Dec 2015 14:05:38 +0100 Message-ID: <87a8ppqc4d.fsf@nicolasgoaziou.fr> References: <87oaebm8be.fsf@gkayaalp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5CVC-0005Oh-3W for emacs-orgmode@gnu.org; Sat, 05 Dec 2015 08:03:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5CVB-0006FP-38 for emacs-orgmode@gnu.org; Sat, 05 Dec 2015 08:03:50 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:34675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5CVA-0006FJ-Sd for emacs-orgmode@gnu.org; Sat, 05 Dec 2015 08:03:49 -0500 In-Reply-To: <87oaebm8be.fsf@gkayaalp.com> (=?utf-8?B?IkfDtmt0dcSf?= Kayaalp"'s message of "Tue, 01 Dec 2015 00:27:49 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?B?R8O2a3R1xJ8=?= Kayaalp Cc: Org-mode mailing list Hello, G=C3=B6ktu=C4=9F Kayaalp writes: > /I=E2=80=99ll first explain the situation and append the code to the mess= age./ > Go to code: [ M-x re-search-forward RET ^CODE RET ] > > I read in Org mode a lot, and I dislike reading prose in monospace > fonts. So I have turned on =E2=80=98variable-pitch-mode=E2=80=99 for = Org mode. But > because some stuff has to stay in stoichedon, so I set some faces to be > monospace: > > I have also add a keyword to font-lock keywords as part of the Org hook, > so that I can have a face attached to initial whitespace and lists (-, > and 1., 2. etc). I set this face to monospace too, so that I have nice > aligned left line, while the actual prose stays in variable pitch. > > I just updated today, from the default Org mode of Emacs 24.5 to the > latest release (8.3.2, from git). > > The problems are as follows: > > 1. My code is buggy, and I can=E2=80=99t understand why. With previous O= rg some > font-lock actions were happening only after I hit enter at the end of a > line, and if I have less than 3 newlines at the end of the file > sometimes font-locking of headings didn=E2=80=99t work. For example, = if I=E2=80=99m > writing a paragraph, I write it in a single physical line, and I use > word wrapping. If that paragraph happended to contain an inline > footnote, which I use very often, that note is not highlighted until I > insert a line-feed. > > And with the new version, while the problem persists, when I hit enter, > thus inserting a newline at the end of a line, Emacs hangs up, and > sometimes I see this error: > > org-element--current-element: Wrong type argument: integer-or-marker-p, n= il > ;; See end of message for the backtrace=E2=80=A6 > ;; [ M-x re-search-forward RET ^BACK RET ] Your code is probably not buggy. You are encountering a cache error. Does it happen on a fresh buffer (e.g., open a new buffer, and copy contents there, then let your code apply appropriate fontification)? Regards, --=20 Nicolas Goaziou