aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2018-07-25 22:23:12 -0500
committerJesús <heckyel@hyperbola.info>2018-07-25 22:23:12 -0500
commit9392325a5b2a815cdf95e727c348d6f1ad0abc15 (patch)
treef4b3d61792a767c10d686e0463ac6cf93c8907b1
parentb5062a4097288f831e4c1cef4c7aacb3d1d71d89 (diff)
downloademacs-base-9392325a5b2a815cdf95e727c348d6f1ad0abc15.tar.lz
emacs-base-9392325a5b2a815cdf95e727c348d6f1ad0abc15.tar.xz
emacs-base-9392325a5b2a815cdf95e727c348d6f1ad0abc15.zip
Added support Markdown
-rw-r--r--custom.el4
-rw-r--r--init.el2
-rw-r--r--lisp/init-markdown.el35
3 files changed, 39 insertions, 2 deletions
diff --git a/custom.el b/custom.el
index 540260a..317da69 100644
--- a/custom.el
+++ b/custom.el
@@ -8,7 +8,9 @@
'(anzu-replace-threshold 1000)
'(anzu-replace-to-string-separator " => ")
'(anzu-search-threshold 1000)
- '(package-selected-packages (quote (flycheck nlinum sublime-themes fullframe))))
+ '(package-selected-packages
+ (quote
+ (markdown-mode sublime-themes sml-modeline smart-mode-line-powerline-theme nlinum flycheck anzu))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
diff --git a/init.el b/init.el
index 7ebc0d6..3b6d552 100644
--- a/init.el
+++ b/init.el
@@ -36,7 +36,7 @@
;; Tools
(require 'init-flycheck)
;; Languages
-
+(require 'init-markdown)
;;; Loads custom file
(when (file-exists-p custom-file)
diff --git a/lisp/init-markdown.el b/lisp/init-markdown.el
new file mode 100644
index 0000000..fec2b24
--- /dev/null
+++ b/lisp/init-markdown.el
@@ -0,0 +1,35 @@
+;;----------------------------------------------------------------------------
+;; Markdown mode
+;;----------------------------------------------------------------------------
+(require-package 'markdown-mode)
+
+(autoload 'markdown-mode "markdown-mode"
+ "Major mode for editing Markdown files" t)
+(add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode))
+(add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode))
+
+(eval-after-load "markdown-mode"
+ '(defalias 'markdown-add-xhtml-header-and-footer 'as/markdown-add-xhtml-header-and-footer))
+
+;;----------------------------------------------------------------------------
+;; Generated HTML 5 and UTF-8 with Markdown
+;;----------------------------------------------------------------------------
+(defun as/markdown-add-xhtml-header-and-footer (title)
+ "Wrap XHTML header and footer with given TITLE around current buffer."
+ (goto-char (point-min))
+ (insert "<!DOCTYPE html>\n"
+ "<html>\n"
+ "<head>\n<title>")
+ (insert title)
+ (insert "</title>\n")
+ (insert "<meta charset=\"utf-8\" />\n")
+ (when (> (length markdown-css-paths) 0)
+ (insert (mapconcat 'markdown-stylesheet-link-string markdown-css-paths "\n")))
+ (insert "\n</head>\n\n"
+ "<body>\n\n")
+ (goto-char (point-max))
+ (insert "\n"
+ "</body>\n"
+ "</html>\n"))
+
+(provide 'init-markdown)