summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimeon Simeonov2021-02-20 21:03:18 +0100
committerSimeon Simeonov2021-02-20 21:03:18 +0100
commit7a3b877abecb9b2f8ee1200bd2617202b325acd1 (patch)
tree73cc0652375957c505795a07171c9330d4b0b95b
parent31884d136fe18e402f8d1c83d68c005671a767c5 (diff)
Update markdown-mode and remove / cleanup some Python snippets
-rw-r--r--.emacs.d/lisp/markdown-mode.el18
-rw-r--r--.emacs.d/snippets/python-mode.statnett/classmethod10
-rw-r--r--.emacs.d/snippets/python-mode.statnett/cls8
-rw-r--r--.emacs.d/snippets/python-mode.statnett/dec14
-rw-r--r--.emacs.d/snippets/python-mode.statnett/function8
-rw-r--r--.emacs.d/snippets/python-mode.statnett/import7
-rw-r--r--.emacs.d/snippets/python-mode.statnett/method7
-rw-r--r--.emacs.d/snippets/python-mode.statnett/not_impl2
-rw-r--r--.emacs.d/snippets/python-mode.statnett/pass5
-rw-r--r--.emacs.d/snippets/python-mode.statnett/property_getter3
-rw-r--r--.emacs.d/snippets/python-mode.statnett/property_setter2
-rw-r--r--.emacs.d/snippets/python-mode.statnett/scls7
-rw-r--r--.emacs.d/snippets/python-mode.statnett/script4
-rw-r--r--.emacs.d/snippets/python-mode.statnett/selfassign2
-rw-r--r--.emacs.d/snippets/python-mode.statnett/while7
-rw-r--r--.emacs.d/snippets/python-mode.statnett/with7
-rw-r--r--.emacs.d/snippets/python-mode/classmethod10
-rw-r--r--.emacs.d/snippets/python-mode/cls8
-rw-r--r--.emacs.d/snippets/python-mode/dec14
-rw-r--r--.emacs.d/snippets/python-mode/function8
-rw-r--r--.emacs.d/snippets/python-mode/import7
-rw-r--r--.emacs.d/snippets/python-mode/method7
-rw-r--r--.emacs.d/snippets/python-mode/not_impl2
-rw-r--r--.emacs.d/snippets/python-mode/pass5
-rw-r--r--.emacs.d/snippets/python-mode/property_getter3
-rw-r--r--.emacs.d/snippets/python-mode/property_setter2
-rw-r--r--.emacs.d/snippets/python-mode/scls7
-rw-r--r--.emacs.d/snippets/python-mode/script1
-rw-r--r--.emacs.d/snippets/python-mode/selfassign2
-rw-r--r--.emacs.d/snippets/python-mode/while7
-rw-r--r--.emacs.d/snippets/python-mode/with7
31 files changed, 23 insertions, 178 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.
diff --git a/.emacs.d/snippets/python-mode.statnett/classmethod b/.emacs.d/snippets/python-mode.statnett/classmethod
deleted file mode 100644
index aa78440..0000000
--- a/.emacs.d/snippets/python-mode.statnett/classmethod
+++ /dev/null
@@ -1,10 +0,0 @@
1# -*- mode: snippet -*-
2# name: classmethod
3# key: cm
4# group: object oriented
5# --
6@classmethod
7def ${1:meth}(cls, $2):
8 """
9 """
10 $3 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/cls b/.emacs.d/snippets/python-mode.statnett/cls
deleted file mode 100644
index 3dbd391..0000000
--- a/.emacs.d/snippets/python-mode.statnett/cls
+++ /dev/null
@@ -1,8 +0,0 @@
1# -*- mode: snippet -*-
2# name: cls
3# key: cls
4# group: object oriented
5# --
6class ${1:class}(${2:object}):
7 """"""
8 $0
diff --git a/.emacs.d/snippets/python-mode.statnett/dec b/.emacs.d/snippets/python-mode.statnett/dec
deleted file mode 100644
index b22c9e9..0000000
--- a/.emacs.d/snippets/python-mode.statnett/dec
+++ /dev/null
@@ -1,14 +0,0 @@
1# -*- mode: snippet -*-
2# name: dec
3# key: dec
4# group : definitions
5# --
6def ${1:decorator}(func):
7 $2
8 def _$1(*args, **kwargs):
9 $3
10 ret = func(*args, **kwargs)
11 $4
12 return ret
13
14 return _$1 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/function b/.emacs.d/snippets/python-mode.statnett/function
deleted file mode 100644
index 5a39d8f..0000000
--- a/.emacs.d/snippets/python-mode.statnett/function
+++ /dev/null
@@ -1,8 +0,0 @@
1# -*- mode: snippet -*-
2# name: function
3# key: fn
4# group: definitions
5# --
6def ${1:fun}(${2:args}):
7 """"""
8 $0
diff --git a/.emacs.d/snippets/python-mode.statnett/import b/.emacs.d/snippets/python-mode.statnett/import
deleted file mode 100644
index f34bc39..0000000
--- a/.emacs.d/snippets/python-mode.statnett/import
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: import
3# key: imp
4# group : general
5# --
6import ${1:lib}${2: as ${3:alias}}
7$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/method b/.emacs.d/snippets/python-mode.statnett/method
deleted file mode 100644
index 985ef0c..0000000
--- a/.emacs.d/snippets/python-mode.statnett/method
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: method
3# key: m
4# group: object oriented
5# --
6def ${1:method}(self${2:, $3}):
7 $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/not_impl b/.emacs.d/snippets/python-mode.statnett/not_impl
index 515e353..97a6cb0 100644
--- a/.emacs.d/snippets/python-mode.statnett/not_impl
+++ b/.emacs.d/snippets/python-mode.statnett/not_impl
@@ -1,5 +1,5 @@
1# -*- mode: snippet -*- 1# -*- mode: snippet -*-
2# name: not_impl 2# name: not_impl
3# key: not_impl 3# key: ni
4# -- 4# --
5raise NotImplementedError \ No newline at end of file 5raise NotImplementedError \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/pass b/.emacs.d/snippets/python-mode.statnett/pass
deleted file mode 100644
index 4734f7f..0000000
--- a/.emacs.d/snippets/python-mode.statnett/pass
+++ /dev/null
@@ -1,5 +0,0 @@
1# -*- mode: snippet -*-
2# name: pass
3# key: ps
4# --
5pass \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/property_getter b/.emacs.d/snippets/python-mode.statnett/property_getter
index 8bb99dd..408428a 100644
--- a/.emacs.d/snippets/python-mode.statnett/property_getter
+++ b/.emacs.d/snippets/python-mode.statnett/property_getter
@@ -7,5 +7,4 @@
7def ${1:name}(self): 7def ${1:name}(self):
8 """$1-property""" 8 """$1-property"""
9 return self.${2:value} 9 return self.${2:value}
10 10$0 \ No newline at end of file
11$0
diff --git a/.emacs.d/snippets/python-mode.statnett/property_setter b/.emacs.d/snippets/python-mode.statnett/property_setter
index a74be67..aa0288d 100644
--- a/.emacs.d/snippets/python-mode.statnett/property_setter
+++ b/.emacs.d/snippets/python-mode.statnett/property_setter
@@ -12,4 +12,4 @@ def ${1:name}(self):
12def $1(self, value): 12def $1(self, value):
13 """$1-property setter""" 13 """$1-property setter"""
14 self.$2 = value 14 self.$2 = value
15$0 15$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/scls b/.emacs.d/snippets/python-mode.statnett/scls
deleted file mode 100644
index 4a10e28..0000000
--- a/.emacs.d/snippets/python-mode.statnett/scls
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: subclass
3# key: scls
4# group: object oriented
5# --
6class ${1:class}(${2:super-class}):
7 $0
diff --git a/.emacs.d/snippets/python-mode.statnett/script b/.emacs.d/snippets/python-mode.statnett/script
index 3246334..2e8cc35 100644
--- a/.emacs.d/snippets/python-mode.statnett/script
+++ b/.emacs.d/snippets/python-mode.statnett/script
@@ -3,12 +3,12 @@
3# key: script 3# key: script
4# -- 4# --
5#!/usr/bin/env python 5#!/usr/bin/env python
6# -*- coding: utf-8 -*-
6 7
7 8
8def main(inargs=None): 9def main(inargs=None):
9 """main entry point""" 10 """main entry point"""
10 $0 11 $0
11 12
12 13if __name__ == '__main__':
13if __name__ == "__main__":
14 main() 14 main()
diff --git a/.emacs.d/snippets/python-mode.statnett/selfassign b/.emacs.d/snippets/python-mode.statnett/selfassign
index 95d7b2b..efdfaa0 100644
--- a/.emacs.d/snippets/python-mode.statnett/selfassign
+++ b/.emacs.d/snippets/python-mode.statnett/selfassign
@@ -3,4 +3,4 @@
3# key: sn 3# key: sn
4# group: object oriented 4# group: object oriented
5# -- 5# --
6self.$1 = $1 \ No newline at end of file 6self._$1 = $1 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/while b/.emacs.d/snippets/python-mode.statnett/while
deleted file mode 100644
index 7b3539c..0000000
--- a/.emacs.d/snippets/python-mode.statnett/while
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: while
3# key: wh
4# group: control structure
5# --
6while ${1:True}:
7 $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode.statnett/with b/.emacs.d/snippets/python-mode.statnett/with
deleted file mode 100644
index 7fcbd38..0000000
--- a/.emacs.d/snippets/python-mode.statnett/with
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: with
3# key: with
4# group : control structure
5# --
6with ${1:expr}${2: as ${3:alias}}:
7 $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/classmethod b/.emacs.d/snippets/python-mode/classmethod
deleted file mode 100644
index aa78440..0000000
--- a/.emacs.d/snippets/python-mode/classmethod
+++ /dev/null
@@ -1,10 +0,0 @@
1# -*- mode: snippet -*-
2# name: classmethod
3# key: cm
4# group: object oriented
5# --
6@classmethod
7def ${1:meth}(cls, $2):
8 """
9 """
10 $3 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/cls b/.emacs.d/snippets/python-mode/cls
deleted file mode 100644
index 3dbd391..0000000
--- a/.emacs.d/snippets/python-mode/cls
+++ /dev/null
@@ -1,8 +0,0 @@
1# -*- mode: snippet -*-
2# name: cls
3# key: cls
4# group: object oriented
5# --
6class ${1:class}(${2:object}):
7 """"""
8 $0
diff --git a/.emacs.d/snippets/python-mode/dec b/.emacs.d/snippets/python-mode/dec
deleted file mode 100644
index b22c9e9..0000000
--- a/.emacs.d/snippets/python-mode/dec
+++ /dev/null
@@ -1,14 +0,0 @@
1# -*- mode: snippet -*-
2# name: dec
3# key: dec
4# group : definitions
5# --
6def ${1:decorator}(func):
7 $2
8 def _$1(*args, **kwargs):
9 $3
10 ret = func(*args, **kwargs)
11 $4
12 return ret
13
14 return _$1 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/function b/.emacs.d/snippets/python-mode/function
deleted file mode 100644
index 5a39d8f..0000000
--- a/.emacs.d/snippets/python-mode/function
+++ /dev/null
@@ -1,8 +0,0 @@
1# -*- mode: snippet -*-
2# name: function
3# key: fn
4# group: definitions
5# --
6def ${1:fun}(${2:args}):
7 """"""
8 $0
diff --git a/.emacs.d/snippets/python-mode/import b/.emacs.d/snippets/python-mode/import
deleted file mode 100644
index f34bc39..0000000
--- a/.emacs.d/snippets/python-mode/import
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: import
3# key: imp
4# group : general
5# --
6import ${1:lib}${2: as ${3:alias}}
7$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/method b/.emacs.d/snippets/python-mode/method
deleted file mode 100644
index 985ef0c..0000000
--- a/.emacs.d/snippets/python-mode/method
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: method
3# key: m
4# group: object oriented
5# --
6def ${1:method}(self${2:, $3}):
7 $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/not_impl b/.emacs.d/snippets/python-mode/not_impl
index 515e353..97a6cb0 100644
--- a/.emacs.d/snippets/python-mode/not_impl
+++ b/.emacs.d/snippets/python-mode/not_impl
@@ -1,5 +1,5 @@
1# -*- mode: snippet -*- 1# -*- mode: snippet -*-
2# name: not_impl 2# name: not_impl
3# key: not_impl 3# key: ni
4# -- 4# --
5raise NotImplementedError \ No newline at end of file 5raise NotImplementedError \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/pass b/.emacs.d/snippets/python-mode/pass
deleted file mode 100644
index 4734f7f..0000000
--- a/.emacs.d/snippets/python-mode/pass
+++ /dev/null
@@ -1,5 +0,0 @@
1# -*- mode: snippet -*-
2# name: pass
3# key: ps
4# --
5pass \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/property_getter b/.emacs.d/snippets/python-mode/property_getter
index 8bb99dd..408428a 100644
--- a/.emacs.d/snippets/python-mode/property_getter
+++ b/.emacs.d/snippets/python-mode/property_getter
@@ -7,5 +7,4 @@
7def ${1:name}(self): 7def ${1:name}(self):
8 """$1-property""" 8 """$1-property"""
9 return self.${2:value} 9 return self.${2:value}
10 10$0 \ No newline at end of file
11$0
diff --git a/.emacs.d/snippets/python-mode/property_setter b/.emacs.d/snippets/python-mode/property_setter
index a74be67..aa0288d 100644
--- a/.emacs.d/snippets/python-mode/property_setter
+++ b/.emacs.d/snippets/python-mode/property_setter
@@ -12,4 +12,4 @@ def ${1:name}(self):
12def $1(self, value): 12def $1(self, value):
13 """$1-property setter""" 13 """$1-property setter"""
14 self.$2 = value 14 self.$2 = value
15$0 15$0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/scls b/.emacs.d/snippets/python-mode/scls
deleted file mode 100644
index 4a10e28..0000000
--- a/.emacs.d/snippets/python-mode/scls
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: subclass
3# key: scls
4# group: object oriented
5# --
6class ${1:class}(${2:super-class}):
7 $0
diff --git a/.emacs.d/snippets/python-mode/script b/.emacs.d/snippets/python-mode/script
index ac15584..2e8cc35 100644
--- a/.emacs.d/snippets/python-mode/script
+++ b/.emacs.d/snippets/python-mode/script
@@ -10,6 +10,5 @@ def main(inargs=None):
10 """main entry point""" 10 """main entry point"""
11 $0 11 $0
12 12
13
14if __name__ == '__main__': 13if __name__ == '__main__':
15 main() 14 main()
diff --git a/.emacs.d/snippets/python-mode/selfassign b/.emacs.d/snippets/python-mode/selfassign
index 95d7b2b..efdfaa0 100644
--- a/.emacs.d/snippets/python-mode/selfassign
+++ b/.emacs.d/snippets/python-mode/selfassign
@@ -3,4 +3,4 @@
3# key: sn 3# key: sn
4# group: object oriented 4# group: object oriented
5# -- 5# --
6self.$1 = $1 \ No newline at end of file 6self._$1 = $1 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/while b/.emacs.d/snippets/python-mode/while
deleted file mode 100644
index 7b3539c..0000000
--- a/.emacs.d/snippets/python-mode/while
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: while
3# key: wh
4# group: control structure
5# --
6while ${1:True}:
7 $0 \ No newline at end of file
diff --git a/.emacs.d/snippets/python-mode/with b/.emacs.d/snippets/python-mode/with
deleted file mode 100644
index 7fcbd38..0000000
--- a/.emacs.d/snippets/python-mode/with
+++ /dev/null
@@ -1,7 +0,0 @@
1# -*- mode: snippet -*-
2# name: with
3# key: with
4# group : control structure
5# --
6with ${1:expr}${2: as ${3:alias}}:
7 $0 \ No newline at end of file