diff options
| author | Simeon Simeonov | 2021-02-20 21:03:18 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2021-02-20 21:03:18 +0100 |
| commit | 7a3b877abecb9b2f8ee1200bd2617202b325acd1 (patch) | |
| tree | 73cc0652375957c505795a07171c9330d4b0b95b /.emacs.d/lisp/markdown-mode.el | |
| parent | 31884d136fe18e402f8d1c83d68c005671a767c5 (diff) | |
Update markdown-mode and remove / cleanup some Python snippets
Diffstat (limited to '.emacs.d/lisp/markdown-mode.el')
| -rw-r--r-- | .emacs.d/lisp/markdown-mode.el | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/.emacs.d/lisp/markdown-mode.el b/.emacs.d/lisp/markdown-mode.el index 9522da4..6775bfa 100644 --- a/.emacs.d/lisp/markdown-mode.el +++ b/.emacs.d/lisp/markdown-mode.el | |||
| @@ -92,7 +92,7 @@ Any changes to the output buffer made by this hook will be saved.") | |||
| 92 | :group 'text | 92 | :group 'text |
| 93 | :link '(url-link "https://jblevins.org/projects/markdown-mode/")) | 93 | :link '(url-link "https://jblevins.org/projects/markdown-mode/")) |
| 94 | 94 | ||
| 95 | (defcustom markdown-command (let ((command (cl-loop for cmd in '("markdown" "pandoc") | 95 | (defcustom markdown-command (let ((command (cl-loop for cmd in '("markdown" "pandoc" "markdown_py") |
| 96 | when (executable-find cmd) | 96 | when (executable-find cmd) |
| 97 | return (file-name-nondirectory it)))) | 97 | return (file-name-nondirectory it)))) |
| 98 | (or command "markdown")) | 98 | (or command "markdown")) |
| @@ -9297,15 +9297,23 @@ Create new table lines if required." | |||
| 9297 | (unless (markdown-table-at-point-p) | 9297 | (unless (markdown-table-at-point-p) |
| 9298 | (user-error "Not at a table")) | 9298 | (user-error "Not at a table")) |
| 9299 | (markdown-table-align) | 9299 | (markdown-table-align) |
| 9300 | (when (markdown-table-hline-at-point-p) (end-of-line 1)) | 9300 | (when (markdown-table-hline-at-point-p) (beginning-of-line 1)) |
| 9301 | (condition-case nil | 9301 | (condition-case nil |
| 9302 | (progn | 9302 | (progn |
| 9303 | (re-search-backward "\\(?:^\\|[^\\]\\)|" (markdown-table-begin)) | 9303 | (re-search-backward "\\(?:^\\|[^\\]\\)|" (markdown-table-begin)) |
| 9304 | ;; When this function is called while in the first cell in a | ||
| 9305 | ;; table, the point will now be at the beginning of a line. In | ||
| 9306 | ;; this case, we need to move past one additional table | ||
| 9307 | ;; boundary, the end of the table on the previous line. | ||
| 9308 | (when (= (point) (line-beginning-position)) | ||
| 9309 | (re-search-backward "\\(?:^\\|[^\\]\\)|" (markdown-table-begin))) | ||
| 9304 | (re-search-backward "\\(?:^\\|[^\\]\\)|" (markdown-table-begin))) | 9310 | (re-search-backward "\\(?:^\\|[^\\]\\)|" (markdown-table-begin))) |
| 9305 | (error (user-error "Cannot move to previous table cell"))) | 9311 | (error (user-error "Cannot move to previous table cell"))) |
| 9306 | (while (looking-at "|\\([-:]\\|[ \t]*$\\)") | 9312 | (when (looking-at "\\(?:^\\|[^\\]\\)| ?") (goto-char (match-end 0))) |
| 9307 | (re-search-backward "\\(?:^\\|[^\\]\\)|" (markdown-table-begin))) | 9313 | |
| 9308 | (when (looking-at "| ?") (goto-char (match-end 0)))) | 9314 | ;; This may have dropped point on the hline. |
| 9315 | (when (markdown-table-hline-at-point-p) | ||
| 9316 | (markdown-table-backward-cell))) | ||
| 9309 | 9317 | ||
| 9310 | (defun markdown-table-transpose () | 9318 | (defun markdown-table-transpose () |
| 9311 | "Transpose table at point. | 9319 | "Transpose table at point. |
