ledger/lisp
Konstantin Nazarov c98af897f7 [emacs] Fontification should work independentily on where the point currently is
This is a subtle bug that happens only when org-src-fontify-natively is
enabled:

(setq org-src-fontify-natively t)

If then you create a Babel block with ledger text, it won't be
fontified.

This happens because the 'ledger-fontify-buffer-part' starts
fontification from the current 'point', which in case of
org-src-font-lock-fontify-block happens to _not_ point to the beginning
of buffer. Instead it points to the original org-mode buffer.
This doesn't happen when one opens regular files, because the
'point' is almost always at the beginning of the file.

To reproduce the bug, you can do the following:

(defun fontify-test()
  (let ((lang-mode 'ledger-mode) pos next)

  (with-current-buffer
      (get-buffer-create
       "ledger-fontification-bug")
    (unless (eq major-mode lang-mode) (funcall lang-mode))
    (erase-buffer)
    (insert "2015/01/09 asdf\n  foo\n  bar\n" " ")
    (font-lock-fontify-buffer)
    (switch-to-buffer "ledger-fontification-bug")
    )))

Call 'fontify-test' and see that the buffer is not fontified.

[ci skip]
2015-01-11 02:33:10 +03:00
..
CMakeLists.txt Merge commit 'b58a872fba7909371d47bc2eb8468e5ba82cfac0' 2014-09-22 22:18:25 -07:00
ledger-commodities.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-complete.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-context.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-exec.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-fontify.el [emacs] Fontification should work independentily on where the point currently is 2015-01-11 02:33:10 +03:00
ledger-fonts.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-init.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-mode.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-navigate.el [emacs] Fix byte compilation warnings 2014-12-09 19:38:00 +00:00
ledger-occur.el Merge commit '8e79b3c7c74081b63f9d8b1e0ec97478f61d4ba8' 2014-12-30 20:48:52 -08:00
ledger-post.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-reconcile.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-regex.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-report.el ledger-mode bug 1089 introduce sticky cursor for report auto refresh 2015-01-04 22:46:26 +01:00
ledger-schedule.el Fix ledger-schedule-upcoming so that is honor input file names. 2014-12-14 09:28:24 -07:00
ledger-sort.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-state.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-test.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-texi.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00
ledger-xact.el Bump copyright notice to 2015 2014-12-27 11:24:55 +01:00