emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Bug: Export to html inserts strange unicode characters at line b


From: Kaushal
Subject: Re: [O] Bug: Export to html inserts strange unicode characters at line breaks because of fci-mode [8.2.7c (8.2.7c-64-g01f736-elpa @ /home/kmodi/.emacs.d/elpa/org-20140915/)]
Date: Thu, 04 Jun 2015 20:10:43 +0000

Hi all,

I was finally able to solve this problem without tweaking anything inside ox-html.el

I noticed that htmlize has provided few hooks and I used those.

Here is the code that I now have in my emacs init to disable fci (and flyspell too) while htmlize-region is doing its job:

    (defvar modi/htmlize-initial-fci-state nil
      "Variable to store the state of `fci-mode' when `htmlize-buffer' is called.")
    (defvar modi/htmlize-initial-flyspell-state nil
      "Variable to store the state of `flyspell-mode' when `htmlize-buffer' is called.")

    (defun modi/htmlize-before-hook-fn ()
      (when (fboundp 'fci-mode)
        (setq modi/htmlize-initial-fci-state fci-mode)
        (when fci-mode
          (fci-mode -1)))
      (when (fboundp 'flyspell-mode)
        (setq modi/htmlize-initial-flyspell-state flyspell-mode)
        (when flyspell-mode
          (flyspell-mode -1))))
    (add-hook 'htmlize-before-hook #'modi/htmlize-before-hook-fn)

    (defun modi/htmlize-after-hook-fn ()
      (when (fboundp 'fci-mode)
        (when modi/htmlize-initial-fci-state
          (fci-mode 1)))
      (when (fboundp 'flyspell-mode)
        (when modi/htmlize-initial-flyspell-state
          (flyspell-mode 1))))
    (add-hook 'htmlize-after-hook #'modi/htmlize-after-hook-fn)

I would suggest that that fci-mode specific code be removed from the master.


On Sat, Sep 27, 2014 at 3:25 PM Aaron Ecay <address@hidden> wrote:
Hi Nicolas and Kaushal,

2014ko irailak 26an, Nicolas Goaziou-ek idatzi zuen:
>
> Hello,
>
> Kaushal <address@hidden> writes:
>
>> I have fci-mode installed and enabled for programming modes.
>>
>> When org exports to html, htmlize figures out the syntax highlighting of
>> the code by calling  =(funcall lang-mode)=.
>>
>> That activates =fci-mode=.
>>
>> =fci-mode= shows the fill column using a unicode character. The issue is
>> that org export to html exports that character as well.
>>
>> Those characters show up in html as below!
>> http://i.imgur.com/8WplTqw.png
>>
>> So the solution is to fix the =orx-html-fontify-code= function.
>
> I don't think so. `fill-column-indicator' is not even in core Emacs. We
> shouldn't provide a workaround for every package out there.

For better or for worse, Bastien already installed this fix on master as
commit 44aaaad8, in response to Kaushal’s earlier bug report on this
issue.  See <http://mid.gmane.org/address@hidden>.

The fix has not yet been merged to the release branch, so it won’t yet
show up in the ELPA version of org which Kaushal seems to be using.

--
Aaron Ecay

reply via email to

[Prev in Thread] Current Thread [Next in Thread]