From: Aaron Jensen <aaronjensen@gmail.com>
To: emacs-orgmode@gnu.org
Cc: Noam Postavsky <npostavs@gmail.com>
Subject: [PATCH] Reduce scope of inhibit-modification-hooks
Date: Sun, 19 Mar 2017 13:56:02 -0700 [thread overview]
Message-ID: <CAHyO48zh2aph0uTXfFZBT9XLP2UmDPF=mignsMSFFEqn5ftu4w@mail.gmail.com> (raw)
This fixes the fontification error discussed here:
http://lists.gnu.org/archive/html/emacs-orgmode/2017-03/msg00423.html
and here:
http://lists.gnu.org/archive/html/emacs-orgmode/2017-02/msg00280.html
---
lisp/org-src.el | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/lisp/org-src.el b/lisp/org-src.el
index dfc422b..b0f952f 100644
--- a/lisp/org-src.el
+++ b/lisp/org-src.el
@@ -525,19 +525,19 @@ as `org-src-fontify-natively' is non-nil."
(let ((inhibit-modification-hooks nil))
(erase-buffer)
;; Add string and a final space to ensure property change.
- (insert string " ")
- (unless (eq major-mode lang-mode) (funcall lang-mode))
- (org-font-lock-ensure)
- (let ((pos (point-min)) next)
- (while (setq next (next-property-change pos))
- ;; Handle additional properties from font-lock, so as to
- ;; preserve, e.g., composition.
- (dolist (prop (cons 'face font-lock-extra-managed-props))
- (let ((new-prop (get-text-property pos prop)))
- (put-text-property
- (+ start (1- pos)) (1- (+ start next)) prop new-prop
- org-buffer)))
- (setq pos next)))))
+ (insert string " "))
+ (unless (eq major-mode lang-mode) (funcall lang-mode))
+ (org-font-lock-ensure)
+ (let ((pos (point-min)) next)
+ (while (setq next (next-property-change pos))
+ ;; Handle additional properties from font-lock, so as to
+ ;; preserve, e.g., composition.
+ (dolist (prop (cons 'face font-lock-extra-managed-props))
+ (let ((new-prop (get-text-property pos prop)))
+ (put-text-property
+ (+ start (1- pos)) (1- (+ start next)) prop new-prop
+ org-buffer)))
+ (setq pos next))))
;; Add Org faces.
(let ((src-face (nth 1 (assoc-string lang org-src-block-faces t))))
(when (or (facep src-face) (listp src-face))
--
2.10.0
reply other threads:[~2017-03-19 20:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAHyO48zh2aph0uTXfFZBT9XLP2UmDPF=mignsMSFFEqn5ftu4w@mail.gmail.com' \
--to=aaronjensen@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=npostavs@gmail.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).