emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Göktuğ Kayaalp" <self@gkayaalp.com>
Cc: Org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: Issues w/ hacking Org font-lock for variable pitch prose
Date: Sat, 05 Dec 2015 14:05:38 +0100	[thread overview]
Message-ID: <87a8ppqc4d.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87oaebm8be.fsf@gkayaalp.com> ("Göktuğ Kayaalp"'s message of "Tue, 01 Dec 2015 00:27:49 +0200")

Hello,

Göktuğ Kayaalp <self@gkayaalp.com> writes:

> /I’ll first explain the situation and append the code to the message./
> 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 ‘variable-pitch-mode’  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’t understand why.  With previous Org 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’t work.   For example,  if I’m
> 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, nil
> ;; See end of message for the backtrace…
> ;; [ 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,

-- 
Nicolas Goaziou

  reply	other threads:[~2015-12-05 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-30 22:27 Issues w/ hacking Org font-lock for variable pitch prose Göktuğ Kayaalp
2015-12-05 13:05 ` Nicolas Goaziou [this message]
2015-12-05 22:41   ` Göktuğ Kayaalp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8ppqc4d.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=self@gkayaalp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).