use orgtbl-mode only when org layer is used

1. Fixes #6535 - when org layer is not used, user will see an error upon
   visiting markdown file.
2. Mention orgtbl-mode in readme.
This commit is contained in:
Boris Buliga 2018-11-07 09:56:16 +02:00 committed by duianto
parent 3868a5364f
commit 06730f24cc
3 changed files with 15 additions and 3 deletions

View File

@ -1756,6 +1756,7 @@ Other:
- Added ~SPC m t m~ for =markdown-toggle-markup-hiding=
- Rename =markdown-jump= to =markdown-do=
- Hide MMM mode-line indicator (thanks to duianto)
- Use =orgtbl-mode= only when the =org= layer is used (thanks to Boris Buliga)
**** Major modes
- Added SPARQL-mode (thanks to Dietrich Daroch)
- Move =extra-langs= to =major-modes= (thanks to Eivind Fonn)

View File

@ -14,6 +14,7 @@
- [[#automatic-mmm-mode-generation][Automatic MMM-Mode Generation]]
- [[#usage][Usage]]
- [[#generate-a-toc][Generate a TOC]]
- [[#editing-tables][Editing tables]]
- [[#key-bindings][Key bindings]]
- [[#element-insertion][Element insertion]]
- [[#element-removal][Element removal]]
@ -89,6 +90,12 @@ new languages instead of overriding the variable in your dotfile.
To generate a table of contents type on top of the buffer:
~SPC SPC markdown-toc-generate-toc RET~
** Editing tables
While =markdown-mode= provides functionality to edit tables, users of =org=
layer benefit from more sophisticated =orgtbl-mode=.
In order to use =orgtabl-mode=, add =org= layer to your =~/.spacemacs=.
* Key bindings
** Element insertion

View File

@ -18,6 +18,7 @@
markdown-mode
markdown-toc
mmm-mode
org
smartparens
(vmd-mode :toggle (eq 'vmd markdown-live-preview-engine))
))
@ -56,9 +57,6 @@
:defer t
:config
(progn
(add-hook 'markdown-mode-hook 'orgtbl-mode)
(spacemacs|diminish orgtbl-mode)
(add-hook 'markdown-mode-hook 'spacemacs//cleanup-org-tables-on-save)
;; Declare prefixes and bind keys
(dolist (prefix '(("mc" . "markdown/command")
("mh" . "markdown/header")
@ -175,3 +173,9 @@
(dolist (mode markdown--key-bindings-modes)
(spacemacs/set-leader-keys-for-major-mode mode
"cP" 'vmd-mode))))
(defun markdown/post-init-org ()
(when (configuration-layer/layer-used-p 'org)
(add-hook 'markdown-mode-hook 'orgtbl-mode)
(spacemacs|diminish orgtbl-mode)
(add-hook 'markdown-mode-hook 'spacemacs//cleanup-org-tables-on-save)))