Pergunta

I want to be able to disable strikethrough happening when I type + in an org-mode document. Specifically it is for entries in a table. Is there an easy way of doing this for a specific org-mode document since I only want to disable it for one document in particular. If not a way to toggle this would be nice.

I know I can have a literal + symbol with \plus but I would like to be able to see it in the document rather than reading the \plus.

Foi útil?

Solução 3

You can set org-emphasis-alist for just one file:

-*- org-emphasis-alist: nil -*-

+not struckout+

Of course, this removes all emphasis (bold, italic, etc.). I cannot figure out how to remove just strikeout in just one file (specifically, I can't figure out how to delete an element of the alist locally).

Outras dicas

To disable strikethrough in a specific file, add the following to your file:

-*- org-emphasis-alist: (("*" bold) ("/" italic) ("_" underline) ("=" org-verbatim verbatim) ("~" org-code verbatim) ("+" (:strike-through nil))); -*-

The down-side is that it will complain that the file may contain values that are not safe (see here). You can also use the longer version at the bottom of your file, as mentioned here.

To do it for all your org files is a simpler, and will not ask questions:

(setq org-emphasis-alist (quote (("*" bold "<b>" "</b>")
                                 ("/" italic "<i>" "</i>")
                                 ("_" underline "<span style=\"text-decoration:underline;\">" "</span>")
                                 ("=" org-code "<code>" "</code>" verbatim)
                                 ("~" org-verbatim "<code>" "</code>" verbatim))))

Sources: Bernt Hansen's org-mode notes(a must-read) and the org manual

I was able to do it by using local variables in the file

# Local Variables:
# org-emphasis-alist: (everything but strike through)
# End:

You might be able to achieve this by defining an overlay (+) for the literal plus (\plus). There is a library called "Auto Overlays" that

allows you to define overlays that are created (and updated and destroyed) automatically when text in a buffer matches a regular expression

(quoted from the home page of the author).

You can download a standalone version of the library from here. If you are on Emacs 24 and have the Marmalade Repo enabled, you can install the predictive package via

M-x package-install RET predictive RET

which apparently includes "Auto Overlays".

The documentation for this library is here.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top