summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.emacs.d/lisp/markdown-mode.el31
-rw-r--r--.emacs.d/lisp/yaml-mode.el1
2 files changed, 23 insertions, 9 deletions
diff --git a/.emacs.d/lisp/markdown-mode.el b/.emacs.d/lisp/markdown-mode.el
index 114f9a1..aba9e6f 100644
--- a/.emacs.d/lisp/markdown-mode.el
+++ b/.emacs.d/lisp/markdown-mode.el
@@ -3585,13 +3585,26 @@ prefixed with an integer from 1 to the length of
3585 (insert (car markdown-hr-strings)))) 3585 (insert (car markdown-hr-strings))))
3586 (markdown-ensure-blank-line-after)) 3586 (markdown-ensure-blank-line-after))
3587 3587
3588(defun markdown--insert-common (start-delim end-delim regex start-group end-group face) 3588(defun markdown--insert-common (start-delim end-delim regex start-group end-group face
3589 &optional skip-space)
3589 (if (use-region-p) 3590 (if (use-region-p)
3590 ;; Active region 3591 ;; Active region
3591 (let ((bounds (markdown-unwrap-things-in-region 3592 (let* ((bounds (markdown-unwrap-things-in-region
3592 (region-beginning) (region-end) 3593 (region-beginning) (region-end)
3593 regex start-group end-group))) 3594 regex start-group end-group))
3594 (markdown-wrap-or-insert start-delim end-delim nil (car bounds) (cdr bounds))) 3595 (beg (car bounds))
3596 (end (cdr bounds)))
3597 (when (and beg skip-space)
3598 (save-excursion
3599 (goto-char beg)
3600 (skip-chars-forward "[ \t]")
3601 (setq beg (point))))
3602 (when (and end skip-space)
3603 (save-excursion
3604 (goto-char end)
3605 (skip-chars-backward "[ \t]")
3606 (setq end (point))))
3607 (markdown-wrap-or-insert start-delim end-delim nil beg end))
3595 (if (markdown--face-p (point) (list face)) 3608 (if (markdown--face-p (point) (list face))
3596 (save-excursion 3609 (save-excursion
3597 (while (and (markdown--face-p (point) (list face)) (not (bobp))) 3610 (while (and (markdown--face-p (point) (list face)) (not (bobp)))
@@ -3613,7 +3626,7 @@ bold word or phrase, remove the bold markup. Otherwise, simply
3613insert bold delimiters and place the point in between them." 3626insert bold delimiters and place the point in between them."
3614 (interactive) 3627 (interactive)
3615 (let ((delim (if markdown-bold-underscore "__" "**"))) 3628 (let ((delim (if markdown-bold-underscore "__" "**")))
3616 (markdown--insert-common delim delim markdown-regex-bold 2 4 'markdown-bold-face))) 3629 (markdown--insert-common delim delim markdown-regex-bold 2 4 'markdown-bold-face t)))
3617 3630
3618(defun markdown-insert-italic () 3631(defun markdown-insert-italic ()
3619 "Insert markup to make a region or word italic. 3632 "Insert markup to make a region or word italic.
@@ -3623,7 +3636,7 @@ italic word or phrase, remove the italic markup. Otherwise, simply
3623insert italic delimiters and place the point in between them." 3636insert italic delimiters and place the point in between them."
3624 (interactive) 3637 (interactive)
3625 (let ((delim (if markdown-italic-underscore "_" "*"))) 3638 (let ((delim (if markdown-italic-underscore "_" "*")))
3626 (markdown--insert-common delim delim markdown-regex-italic 1 3 'markdown-italic-face))) 3639 (markdown--insert-common delim delim markdown-regex-italic 1 3 'markdown-italic-face t)))
3627 3640
3628(defun markdown-insert-strike-through () 3641(defun markdown-insert-strike-through ()
3629 "Insert markup to make a region or word strikethrough. 3642 "Insert markup to make a region or word strikethrough.
@@ -3633,7 +3646,7 @@ strikethrough word or phrase, remove the strikethrough markup. Otherwise,
3633simply insert bold delimiters and place the point in between them." 3646simply insert bold delimiters and place the point in between them."
3634 (interactive) 3647 (interactive)
3635 (markdown--insert-common 3648 (markdown--insert-common
3636 "~~" "~~" markdown-regex-strike-through 2 4 'markdown-strike-through-face)) 3649 "~~" "~~" markdown-regex-strike-through 2 4 'markdown-strike-through-face t))
3637 3650
3638(defun markdown-insert-code () 3651(defun markdown-insert-code ()
3639 "Insert markup to make a region or word an inline code fragment. 3652 "Insert markup to make a region or word an inline code fragment.
@@ -9074,7 +9087,7 @@ This function assumes point is on a table."
9074 (indent (progn (looking-at "[ \t]*") (match-string 0))) 9087 (indent (progn (looking-at "[ \t]*") (match-string 0)))
9075 ;; Split table in lines and save column format specifier 9088 ;; Split table in lines and save column format specifier
9076 (lines (mapcar (lambda (l) 9089 (lines (mapcar (lambda (l)
9077 (if (string-match-p "\\`[ \t]*|[-:]" l) 9090 (if (string-match-p "\\`[ \t]*|[ \t]*[-:]" l)
9078 (progn (setq fmtspec (or fmtspec l)) nil) l)) 9091 (progn (setq fmtspec (or fmtspec l)) nil) l))
9079 (markdown--split-string (buffer-substring begin end) "\n"))) 9092 (markdown--split-string (buffer-substring begin end) "\n")))
9080 ;; Split lines in cells 9093 ;; Split lines in cells
diff --git a/.emacs.d/lisp/yaml-mode.el b/.emacs.d/lisp/yaml-mode.el
index 50d790b..91db316 100644
--- a/.emacs.d/lisp/yaml-mode.el
+++ b/.emacs.d/lisp/yaml-mode.el
@@ -5,6 +5,7 @@
5;; Author: Yoshiki Kurihara <clouder@gmail.com> 5;; Author: Yoshiki Kurihara <clouder@gmail.com>
6;; Marshall T. Vandegrift <llasram@gmail.com> 6;; Marshall T. Vandegrift <llasram@gmail.com>
7;; Maintainer: Vasilij Schneidermann <mail@vasilij.de> 7;; Maintainer: Vasilij Schneidermann <mail@vasilij.de>
8;; URL: https://github.com/yoshiki/yaml-mode
8;; Package-Requires: ((emacs "24.1")) 9;; Package-Requires: ((emacs "24.1"))
9;; Keywords: data yaml 10;; Keywords: data yaml
10;; Version: 0.0.15 11;; Version: 0.0.15