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= - Added ~SPC m t m~ for =markdown-toggle-markup-hiding=
- Rename =markdown-jump= to =markdown-do= - Rename =markdown-jump= to =markdown-do=
- Hide MMM mode-line indicator (thanks to duianto) - Hide MMM mode-line indicator (thanks to duianto)
- Use =orgtbl-mode= only when the =org= layer is used (thanks to Boris Buliga)
**** Major modes **** Major modes
- Added SPARQL-mode (thanks to Dietrich Daroch) - Added SPARQL-mode (thanks to Dietrich Daroch)
- Move =extra-langs= to =major-modes= (thanks to Eivind Fonn) - Move =extra-langs= to =major-modes= (thanks to Eivind Fonn)

View file

@ -14,6 +14,7 @@
- [[#automatic-mmm-mode-generation][Automatic MMM-Mode Generation]] - [[#automatic-mmm-mode-generation][Automatic MMM-Mode Generation]]
- [[#usage][Usage]] - [[#usage][Usage]]
- [[#generate-a-toc][Generate a TOC]] - [[#generate-a-toc][Generate a TOC]]
- [[#editing-tables][Editing tables]]
- [[#key-bindings][Key bindings]] - [[#key-bindings][Key bindings]]
- [[#element-insertion][Element insertion]] - [[#element-insertion][Element insertion]]
- [[#element-removal][Element removal]] - [[#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: To generate a table of contents type on top of the buffer:
~SPC SPC markdown-toc-generate-toc RET~ ~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 * Key bindings
** Element insertion ** Element insertion

View file

@ -18,6 +18,7 @@
markdown-mode markdown-mode
markdown-toc markdown-toc
mmm-mode mmm-mode
org
smartparens smartparens
(vmd-mode :toggle (eq 'vmd markdown-live-preview-engine)) (vmd-mode :toggle (eq 'vmd markdown-live-preview-engine))
)) ))
@ -56,9 +57,6 @@
:defer t :defer t
:config :config
(progn (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 ;; Declare prefixes and bind keys
(dolist (prefix '(("mc" . "markdown/command") (dolist (prefix '(("mc" . "markdown/command")
("mh" . "markdown/header") ("mh" . "markdown/header")
@ -175,3 +173,9 @@
(dolist (mode markdown--key-bindings-modes) (dolist (mode markdown--key-bindings-modes)
(spacemacs/set-leader-keys-for-major-mode mode (spacemacs/set-leader-keys-for-major-mode mode
"cP" 'vmd-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)))