branch: externals/tempel commit 6c833ccd58e5fba28c48af9a191bedaeebcef481 Author: Daniel Mendler <m...@daniel-mendler.de> Commit: Daniel Mendler <m...@daniel-mendler.de>
Revert "Add support for markdown source blocks (See #48)" This reverts commit 006ec9c361e243365cc0c709bb1ef5b39516d42b. --- README.org | 9 ++++----- tempel.el | 16 +--------------- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/README.org b/README.org index 2594af0e1a..c6cccf53b4 100644 --- a/README.org +++ b/README.org @@ -39,11 +39,10 @@ bindings are defined in the ~tempel-map~ keymap. You can customize them there. A soon as you move before (behind) the first (last) field, the fields are finalized. -Tempel recognizes Org and Markdown source blocks and enables the appropriate -templates according to the language mode of the source block. Tempel can hook -into the abbrev mechanism of Emacs by enabling the ~tempel-abbrev-mode~ in a -buffer or by enabling the ~tempel-global-abbrev-mode~. Then the Tempel templates -will be available via ~expand-abbrev~ which is usually bound to ~C-x '~. +Tempel can hook into the abbrev mechanism of Emacs by enabling the +~tempel-abbrev-mode~ in a buffer or by enabling the ~tempel-global-abbrev-mode~. +Then the Tempel templates will be available via ~expand-abbrev~ which is usually +bound to ~C-x '~. Note that this package is not a competitor to the mature and widely used YASnippet library, which comes with many readily available snippet collections. diff --git a/tempel.el b/tempel.el index 00e5a48892..46ddf91fce 100644 --- a/tempel.el +++ b/tempel.el @@ -89,9 +89,7 @@ must return a list of templates which apply to the buffer or context." If a file is modified, added or removed, reload the templates." :type 'boolean) -(defcustom tempel-local-mode-hook - (list #'tempel-org-src-block-mode - #'tempel-markdown-block-mode) +(defcustom tempel-local-mode-hook (list #'tempel-org-src-block-mode) "Hooks which return the local mode at point, e.g., in Org source blocks." :type 'hook) @@ -488,18 +486,6 @@ This is meant to be a source in `tempel-template-sources'." (org-src-get-lang-mode lang) #'fundamental-mode))) -(declare-function markdown-code-block-at-point-p "markdown-mode") -(declare-function markdown-code-block-lang "markdown-mode") -(declare-function markdown-get-lang-mode "markdown-mode") -(defun tempel-markdown-block-mode () - "Return Markdown source block language mode when inside a source block." - (when (and (derived-mode-p 'markdown-mode) (markdown-code-block-at-point-p)) - (save-excursion - (if-let* ((lang (markdown-code-block-lang)) - (mode (markdown-get-lang-mode lang))) - mode - #'fundamental-mode)))) - (defun tempel--templates () "Return templates for current mode." (let (result)