diff options
| author | Simeon Simeonov | 2026-07-22 11:10:34 +0200 |
|---|---|---|
| committer | Simeon Simeonov | 2026-07-22 11:10:34 +0200 |
| commit | 85601f50f236686da662b1b00e01df0a0abe761b (patch) | |
| tree | ab188e994e2bc569e0f4291c8428e13721245ebe | |
| parent | 5ae7014a54984c194f103d406f9fbdbafb277885 (diff) | |
Update markdown-mode, rust-mode and yaml-mode. Remove unused snippets
| -rw-r--r-- | .emacs.d/lisp/markdown-mode.el | 63 | ||||
| -rw-r--r-- | .emacs.d/lisp/rust-compile.el | 7 | ||||
| -rw-r--r-- | .emacs.d/lisp/rust-mode-tests.el | 62 | ||||
| -rw-r--r-- | .emacs.d/lisp/rust-prog-mode.el | 9 | ||||
| -rw-r--r-- | .emacs.d/lisp/rust-utils.el | 35 | ||||
| -rw-r--r-- | .emacs.d/lisp/yaml-mode.el | 3 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode.statnett/from | 6 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode.statnett/try | 8 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode.statnett/with-open | 6 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/from | 6 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/try | 8 | ||||
| -rw-r--r-- | .emacs.d/snippets/python-mode/with-open | 6 |
12 files changed, 147 insertions, 72 deletions
diff --git a/.emacs.d/lisp/markdown-mode.el b/.emacs.d/lisp/markdown-mode.el index 160975c..08ed4bb 100644 --- a/.emacs.d/lisp/markdown-mode.el +++ b/.emacs.d/lisp/markdown-mode.el | |||
| @@ -1,12 +1,12 @@ | |||
| 1 | ;;; markdown-mode.el --- Major mode for Markdown-formatted text -*- lexical-binding: t; -*- | 1 | ;;; markdown-mode.el --- Major mode for Markdown-formatted text -*- lexical-binding: t; -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2007-2023 Jason R. Blevins and markdown-mode | 3 | ;; Copyright (C) 2007-2026 Jason R. Blevins and markdown-mode |
| 4 | ;; contributors (see the commit log for details). | 4 | ;; contributors (see the commit log for details). |
| 5 | 5 | ||
| 6 | ;; Author: Jason R. Blevins <jblevins@xbeta.org> | 6 | ;; Author: Jason R. Blevins <jblevins@xbeta.org> |
| 7 | ;; Maintainer: Jason R. Blevins <jblevins@xbeta.org> | 7 | ;; Maintainer: Jason R. Blevins <jblevins@xbeta.org> |
| 8 | ;; Created: May 24, 2007 | 8 | ;; Created: May 24, 2007 |
| 9 | ;; Version: 2.8-alpha | 9 | ;; Version: 2.9-alpha |
| 10 | ;; Package-Requires: ((emacs "28.1")) | 10 | ;; Package-Requires: ((emacs "28.1")) |
| 11 | ;; Keywords: Markdown, GitHub Flavored Markdown, itex | 11 | ;; Keywords: Markdown, GitHub Flavored Markdown, itex |
| 12 | ;; URL: https://jblevins.org/projects/markdown-mode/ | 12 | ;; URL: https://jblevins.org/projects/markdown-mode/ |
| @@ -2930,22 +2930,21 @@ This may be useful for tables and Pandoc's line_blocks extension." | |||
| 2930 | "Return t if PROP from BEGIN to END is equal to one of the given PROP-VALUES. | 2930 | "Return t if PROP from BEGIN to END is equal to one of the given PROP-VALUES. |
| 2931 | Also returns t if PROP is a list containing one of the PROP-VALUES. | 2931 | Also returns t if PROP is a list containing one of the PROP-VALUES. |
| 2932 | Return nil otherwise." | 2932 | Return nil otherwise." |
| 2933 | (let (props) | 2933 | (catch 'found |
| 2934 | (catch 'found | 2934 | (let ((loc begin)) |
| 2935 | (dolist (loc (number-sequence begin end)) | 2935 | (while (<= loc end) |
| 2936 | (when (setq props (get-text-property loc prop)) | 2936 | (when-let* ((props (get-text-property loc prop))) |
| 2937 | (cond ((listp props) | 2937 | (if (listp props) |
| 2938 | ;; props is a list, check for membership | 2938 | ;; props is a list, check for membership |
| 2939 | (dolist (val prop-values) | 2939 | (dolist (val prop-values) |
| 2940 | (when (memq val props) (throw 'found loc)))) | 2940 | (when (memq val props) (throw 'found loc))) |
| 2941 | (t | 2941 | (dolist (val prop-values) |
| 2942 | ;; props is a scalar, check for equality | 2942 | (when (eq val props) (throw 'found loc))))) |
| 2943 | (dolist (val prop-values) | 2943 | (setq loc (next-single-property-change loc prop nil (1+ end))))))) |
| 2944 | (when (eq val props) (throw 'found loc)))))))))) | ||
| 2945 | 2944 | ||
| 2946 | (defun markdown-range-properties-exist (begin end props) | 2945 | (defun markdown-range-properties-exist (begin end props) |
| 2947 | (cl-loop | 2946 | (cl-loop |
| 2948 | for loc in (number-sequence begin end) | 2947 | for loc from begin to end |
| 2949 | with result = nil | 2948 | with result = nil |
| 2950 | while (not | 2949 | while (not |
| 2951 | (setq result | 2950 | (setq result |
| @@ -3637,12 +3636,31 @@ SEQ may be an atom or a sequence." | |||
| 3637 | (add-text-properties fontified-start fontified-end heading-props))))) | 3636 | (add-text-properties fontified-start fontified-end heading-props))))) |
| 3638 | t)) | 3637 | t)) |
| 3639 | 3638 | ||
| 3639 | (defun markdown--fontify-table-alignment () | ||
| 3640 | "Visually align cell separators of the table line at point. | ||
| 3641 | Hiding markup makes the displayed content of a table cell | ||
| 3642 | narrower than the buffer text, which breaks the column alignment | ||
| 3643 | of tables that are aligned in the source. Give the whitespace | ||
| 3644 | before each cell separator a space display specification | ||
| 3645 | stretching it to the separator's buffer column, so that | ||
| 3646 | separators are displayed at the same column as in the source | ||
| 3647 | regardless of what is hidden before them." | ||
| 3648 | (beginning-of-line) | ||
| 3649 | (while (re-search-forward "[ \t]+|" (line-end-position) t) | ||
| 3650 | (let ((separator (1- (match-end 0)))) | ||
| 3651 | (unless (markdown-inline-code-at-pos-p separator) | ||
| 3652 | (put-text-property | ||
| 3653 | (match-beginning 0) separator | ||
| 3654 | 'display `(space :align-to ,(1- (current-column)))))))) | ||
| 3655 | |||
| 3640 | (defun markdown-fontify-tables (last) | 3656 | (defun markdown-fontify-tables (last) |
| 3641 | (when (re-search-forward "|" last t) | 3657 | (when (re-search-forward "|" last t) |
| 3642 | (when (markdown-table-at-point-p) | 3658 | (when (markdown-table-at-point-p) |
| 3643 | (font-lock-append-text-property | 3659 | (font-lock-append-text-property |
| 3644 | (line-beginning-position) (min (1+ (line-end-position)) (point-max)) | 3660 | (line-beginning-position) (min (1+ (line-end-position)) (point-max)) |
| 3645 | 'face 'markdown-table-face)) | 3661 | 'face 'markdown-table-face) |
| 3662 | (when (or markdown-hide-markup markdown-hide-urls) | ||
| 3663 | (markdown--fontify-table-alignment))) | ||
| 3646 | (forward-line 1) | 3664 | (forward-line 1) |
| 3647 | t)) | 3665 | t)) |
| 3648 | 3666 | ||
| @@ -7799,9 +7817,11 @@ Return the name of the output buffer used." | |||
| 7799 | markdown-command exit-code)))) | 7817 | markdown-command exit-code)))) |
| 7800 | output-buffer-name)) | 7818 | output-buffer-name)) |
| 7801 | 7819 | ||
| 7802 | (defun markdown-standalone (&optional output-buffer-name) | 7820 | (defun markdown-standalone (&optional output-buffer-name title) |
| 7803 | "Special function to provide standalone HTML output. | 7821 | "Special function to provide standalone HTML output. |
| 7804 | Insert the output in the buffer named OUTPUT-BUFFER-NAME." | 7822 | Insert the output in the buffer named OUTPUT-BUFFER-NAME. |
| 7823 | Set the HTML title to TITLE if provided, otherwise the name of the | ||
| 7824 | output buffer." | ||
| 7805 | (interactive) | 7825 | (interactive) |
| 7806 | (setq output-buffer-name (markdown output-buffer-name)) | 7826 | (setq output-buffer-name (markdown output-buffer-name)) |
| 7807 | (let ((css-path markdown-css-paths)) | 7827 | (let ((css-path markdown-css-paths)) |
| @@ -7809,7 +7829,7 @@ Insert the output in the buffer named OUTPUT-BUFFER-NAME." | |||
| 7809 | (set-buffer output-buffer-name) | 7829 | (set-buffer output-buffer-name) |
| 7810 | (setq-local markdown-css-paths css-path) | 7830 | (setq-local markdown-css-paths css-path) |
| 7811 | (unless (markdown-output-standalone-p) | 7831 | (unless (markdown-output-standalone-p) |
| 7812 | (markdown-add-xhtml-header-and-footer output-buffer-name)) | 7832 | (markdown-add-xhtml-header-and-footer (or title output-buffer-name))) |
| 7813 | (goto-char (point-min)) | 7833 | (goto-char (point-min)) |
| 7814 | (html-mode))) | 7834 | (html-mode))) |
| 7815 | output-buffer-name) | 7835 | output-buffer-name) |
| @@ -7890,7 +7910,8 @@ When OUTPUT-BUFFER-NAME is given, insert the output in the buffer with | |||
| 7890 | that name." | 7910 | that name." |
| 7891 | (interactive) | 7911 | (interactive) |
| 7892 | (browse-url-of-buffer | 7912 | (browse-url-of-buffer |
| 7893 | (markdown-standalone (or output-buffer-name markdown-output-buffer-name)))) | 7913 | (markdown-standalone (or output-buffer-name markdown-output-buffer-name) |
| 7914 | (buffer-name)))) | ||
| 7894 | 7915 | ||
| 7895 | (defun markdown-export-file-name (&optional extension) | 7916 | (defun markdown-export-file-name (&optional extension) |
| 7896 | "Attempt to generate a filename for Markdown output. | 7917 | "Attempt to generate a filename for Markdown output. |
| @@ -9773,7 +9794,7 @@ This function assumes point is on a table." | |||
| 9773 | (setq fmt (car fmtspec) fmtspec (cdr fmtspec)) | 9794 | (setq fmt (car fmtspec) fmtspec (cdr fmtspec)) |
| 9774 | (setq width (car widths) widths (cdr widths)) | 9795 | (setq width (car widths) widths (cdr widths)) |
| 9775 | (if (equal fmt 'c) | 9796 | (if (equal fmt 'c) |
| 9776 | (setq cell (concat (make-string (/ (- width (length cell)) 2) ?\s) cell))) | 9797 | (setq cell (concat (make-string (/ (- width (markdown--string-width cell)) 2) ?\s) cell))) |
| 9777 | (unless (equal fmt 'r) (setq width (- width))) | 9798 | (unless (equal fmt 'r) (setq width (- width))) |
| 9778 | (format (format " %%%ds " width) cell)) | 9799 | (format (format " %%%ds " width) cell)) |
| 9779 | cells "|"))) | 9800 | cells "|"))) |
diff --git a/.emacs.d/lisp/rust-compile.el b/.emacs.d/lisp/rust-compile.el index cbdf43a..87b8c57 100644 --- a/.emacs.d/lisp/rust-compile.el +++ b/.emacs.d/lisp/rust-compile.el | |||
| @@ -41,9 +41,10 @@ See `compilation-error-regexp-alist' for help on their format.") | |||
| 41 | See `compilation-error-regexp-alist' for help on their format.") | 41 | See `compilation-error-regexp-alist' for help on their format.") |
| 42 | 42 | ||
| 43 | (defvar rustc-panics-compilation-regexps | 43 | (defvar rustc-panics-compilation-regexps |
| 44 | (let ((re (concat "thread '[^']+' panicked at " rustc-compilation-location))) | 44 | (let ((re (concat "thread '[^']+'\\(?: ([0-9]+)\\)? panicked at " |
| 45 | (cons re '(2 3 4 nil 1))) | 45 | rustc-compilation-location))) |
| 46 | "Specifications for matching panics in rustc invocations. | 46 | (cons re '(2 3 4 nil 1))) |
| 47 | "Specifications for matching panics in rustc invocations. | ||
| 47 | See `compilation-error-regexp-alist' for help on their format.") | 48 | See `compilation-error-regexp-alist' for help on their format.") |
| 48 | 49 | ||
| 49 | ;; Match test run failures and panics during compilation as | 50 | ;; Match test run failures and panics during compilation as |
diff --git a/.emacs.d/lisp/rust-mode-tests.el b/.emacs.d/lisp/rust-mode-tests.el index 259afb2..c8e3e9a 100644 --- a/.emacs.d/lisp/rust-mode-tests.el +++ b/.emacs.d/lisp/rust-mode-tests.el | |||
| @@ -1979,6 +1979,28 @@ this_is_not_a_string();)" | |||
| 1979 | "union" font-lock-variable-name-face | 1979 | "union" font-lock-variable-name-face |
| 1980 | "bar" font-lock-type-face))) | 1980 | "bar" font-lock-type-face))) |
| 1981 | 1981 | ||
| 1982 | (ert-deftest rust-test-raw-context-sensitive () | ||
| 1983 | (rust-test-font-lock | ||
| 1984 | "let raw = 7; let foo = &raw const raw; let bar = &raw mut raw;" | ||
| 1985 | '("let" font-lock-keyword-face | ||
| 1986 | ;; The first raw is a variable name. | ||
| 1987 | "raw" font-lock-variable-name-face | ||
| 1988 | "let" font-lock-keyword-face | ||
| 1989 | "foo" font-lock-variable-name-face | ||
| 1990 | "&" rust-ampersand-face | ||
| 1991 | ;; The second raw is a contextual keyword. | ||
| 1992 | "raw" font-lock-keyword-face | ||
| 1993 | "const" font-lock-keyword-face | ||
| 1994 | ;; The third raw is a value. | ||
| 1995 | "let" font-lock-keyword-face | ||
| 1996 | "bar" font-lock-variable-name-face | ||
| 1997 | "&" rust-ampersand-face | ||
| 1998 | ;; The fourth raw is a contextual keyword. | ||
| 1999 | "raw" font-lock-keyword-face | ||
| 2000 | "mut" font-lock-keyword-face | ||
| 2001 | ;; The fifth raw is a value. | ||
| 2002 | ))) | ||
| 2003 | |||
| 1982 | (ert-deftest indent-method-chains-no-align () | 2004 | (ert-deftest indent-method-chains-no-align () |
| 1983 | (let ((rust-indent-method-chain nil)) (test-indent | 2005 | (let ((rust-indent-method-chain nil)) (test-indent |
| 1984 | " | 2006 | " |
| @@ -3693,6 +3715,7 @@ let b = 1;" | |||
| 3693 | (insert "note: `ZZZ` could also refer to the constant imported here -> b\n --> file4.rs:12:34\n\n") | 3715 | (insert "note: `ZZZ` could also refer to the constant imported here -> b\n --> file4.rs:12:34\n\n") |
| 3694 | (insert " ::: file5.rs:12:34\n\n") | 3716 | (insert " ::: file5.rs:12:34\n\n") |
| 3695 | (insert "thread 'main' panicked at src/file7.rs:12:34:\n\n") | 3717 | (insert "thread 'main' panicked at src/file7.rs:12:34:\n\n") |
| 3718 | (insert "thread 'aaa::bbb' (19178688) panicked at crates/a/src/b.rs:13:9:\n\n") | ||
| 3696 | (insert "[src/file8.rs:159:5] symbol_value(SOME_VAR) = Some(\n\n") | 3719 | (insert "[src/file8.rs:159:5] symbol_value(SOME_VAR) = Some(\n\n") |
| 3697 | (insert " at file9.rs:12:34\n\n") | 3720 | (insert " at file9.rs:12:34\n\n") |
| 3698 | ;; should not match | 3721 | ;; should not match |
| @@ -3714,7 +3737,8 @@ let b = 1;" | |||
| 3714 | (("file5.rs" "12" "34" compilation-info "file5.rs:12:34")) | 3737 | (("file5.rs" "12" "34" compilation-info "file5.rs:12:34")) |
| 3715 | ((like-previous-one "82" back-to-indentation compilation-info "82") | 3738 | ((like-previous-one "82" back-to-indentation compilation-info "82") |
| 3716 | (like-previous-one "132" back-to-indentation compilation-info "132")) | 3739 | (like-previous-one "132" back-to-indentation compilation-info "132")) |
| 3717 | (("src/file7.rs" "12" "34" nil "src/file7.rs:12:34")) | 3740 | (("src/file7.rs" "12" "34" nil "src/file7.rs:12:34") |
| 3741 | ("crates/a/src/b.rs" "13" "9" nil "crates/a/src/b.rs:13:9")) | ||
| 3718 | (("src/file8.rs" "159" "5" compilation-info "src/file8.rs:159:5")) | 3742 | (("src/file8.rs" "159" "5" compilation-info "src/file8.rs:159:5")) |
| 3719 | (("file9.rs" "12" "34" compilation-info "file9.rs:12:34"))) | 3743 | (("file9.rs" "12" "34" compilation-info "file9.rs:12:34"))) |
| 3720 | (mapcar #'rust-collect-matches | 3744 | (mapcar #'rust-collect-matches |
| @@ -3809,3 +3833,39 @@ let b = 1;" | |||
| 3809 | (string-match "^C-c C" ,match))) | 3833 | (string-match "^C-c C" ,match))) |
| 3810 | t)) | 3834 | t)) |
| 3811 | (should (< 0 match-count))))) | 3835 | (should (< 0 match-count))))) |
| 3836 | |||
| 3837 | ;; Toggle mutability tests | ||
| 3838 | |||
| 3839 | (ert-deftest rust-toggle-mutability-let () | ||
| 3840 | "Test toggling let <-> let mut." | ||
| 3841 | (with-temp-buffer | ||
| 3842 | (rust-mode) | ||
| 3843 | (insert " let x = 5;") | ||
| 3844 | (rust-toggle-mutability) | ||
| 3845 | (should (string= (buffer-string) " let mut x = 5;")) | ||
| 3846 | (rust-toggle-mutability) | ||
| 3847 | (should (string= (buffer-string) " let x = 5;")))) | ||
| 3848 | |||
| 3849 | (ert-deftest rust-toggle-mutability-ref () | ||
| 3850 | "Test toggling & <-> &mut." | ||
| 3851 | (with-temp-buffer | ||
| 3852 | (rust-mode) | ||
| 3853 | (insert " let y = & x;") | ||
| 3854 | (goto-char (line-end-position)) | ||
| 3855 | (rust-toggle-mutability) | ||
| 3856 | (should (string-match-p "&mut " (buffer-string))) | ||
| 3857 | (goto-char (line-end-position)) | ||
| 3858 | (rust-toggle-mutability) | ||
| 3859 | (should (string-match-p "& x" (buffer-string))))) | ||
| 3860 | |||
| 3861 | (ert-deftest rust-toggle-mutability-self () | ||
| 3862 | "Test toggling &self <-> &mut self." | ||
| 3863 | (with-temp-buffer | ||
| 3864 | (rust-mode) | ||
| 3865 | (insert " fn foo(&self) {") | ||
| 3866 | (goto-char (line-end-position)) | ||
| 3867 | (rust-toggle-mutability) | ||
| 3868 | (should (string-match-p "&mut self" (buffer-string))) | ||
| 3869 | (goto-char (line-end-position)) | ||
| 3870 | (rust-toggle-mutability) | ||
| 3871 | (should (string-match-p "&self" (buffer-string))))) | ||
diff --git a/.emacs.d/lisp/rust-prog-mode.el b/.emacs.d/lisp/rust-prog-mode.el index f2f3f0b..ea6ef82 100644 --- a/.emacs.d/lisp/rust-prog-mode.el +++ b/.emacs.d/lisp/rust-prog-mode.el | |||
| @@ -112,6 +112,14 @@ to the function arguments. When nil, `->' will be indented one level." | |||
| 112 | (or space line-start) | 112 | (or space line-start) |
| 113 | (group symbol-start "union" symbol-end) | 113 | (group symbol-start "union" symbol-end) |
| 114 | (+ space) (regexp ,rust-re-ident)))) | 114 | (+ space) (regexp ,rust-re-ident)))) |
| 115 | (defconst rust-re-raw | ||
| 116 | (rx-to-string | ||
| 117 | `(seq | ||
| 118 | "&" | ||
| 119 | (zero-or-more space) | ||
| 120 | (group "raw") | ||
| 121 | (one-or-more space) | ||
| 122 | (or "const" "mut")))) | ||
| 115 | 123 | ||
| 116 | (defun rust-re-item-def (itype) | 124 | (defun rust-re-item-def (itype) |
| 117 | (concat (rust-re-word itype) | 125 | (concat (rust-re-word itype) |
| @@ -269,6 +277,7 @@ Does not match type annotations of the form \"foo::<\"." | |||
| 269 | ;; Contextual keywords | 277 | ;; Contextual keywords |
| 270 | ("\\_<\\(default\\)[[:space:]]+fn\\_>" 1 font-lock-keyword-face) | 278 | ("\\_<\\(default\\)[[:space:]]+fn\\_>" 1 font-lock-keyword-face) |
| 271 | (,rust-re-union 1 font-lock-keyword-face) | 279 | (,rust-re-union 1 font-lock-keyword-face) |
| 280 | (,rust-re-raw 1 font-lock-keyword-face) | ||
| 272 | 281 | ||
| 273 | ;; Special types | 282 | ;; Special types |
| 274 | (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face) | 283 | (,(regexp-opt rust-special-types 'symbols) . font-lock-type-face) |
diff --git a/.emacs.d/lisp/rust-utils.el b/.emacs.d/lisp/rust-utils.el index d93bd0a..b0b0ae1 100644 --- a/.emacs.d/lisp/rust-utils.el +++ b/.emacs.d/lisp/rust-utils.el | |||
| @@ -108,15 +108,38 @@ if not. Move cursor to the end of macro." | |||
| 108 | ) | 108 | ) |
| 109 | ) | 109 | ) |
| 110 | 110 | ||
| 111 | ;;;###autoload | ||
| 111 | (defun rust-toggle-mutability () | 112 | (defun rust-toggle-mutability () |
| 112 | "Toggles the mutability of the variable defined on the current line" | 113 | "Toggle the mutability of the binding or reference near point. |
| 114 | Handles `let' <-> `let mut' and `&' <-> `&mut' (including `&self')." | ||
| 113 | (interactive) | 115 | (interactive) |
| 114 | (save-excursion | 116 | (save-excursion |
| 115 | (back-to-indentation) | 117 | (let ((line-start (line-beginning-position)) |
| 116 | (forward-word) | 118 | (line-end (line-end-position))) |
| 117 | (if (string= " mut" (buffer-substring (point) (+ (point) 4))) | 119 | (cond |
| 118 | (delete-region (point) (+ (point) 4)) | 120 | ;; Remove: &mut -> & |
| 119 | (insert " mut")))) | 121 | ((search-backward "&mut " line-start t) |
| 122 | (forward-char 1) | ||
| 123 | (delete-region (point) (+ (point) 4))) | ||
| 124 | ;; Remove: let mut -> let | ||
| 125 | ((progn (goto-char (line-beginning-position)) | ||
| 126 | (re-search-forward "\\_<let mut\\_>" line-end t)) | ||
| 127 | (replace-match "let")) | ||
| 128 | ;; Add: & -> &mut | ||
| 129 | ((progn (goto-char (line-end-position)) | ||
| 130 | (search-backward "& " line-start t)) | ||
| 131 | (forward-char 1) | ||
| 132 | (insert "mut ")) | ||
| 133 | ;; Add: &self -> &mut self | ||
| 134 | ((progn (goto-char (line-end-position)) | ||
| 135 | (search-backward "&self" line-start t)) | ||
| 136 | (forward-char 1) | ||
| 137 | (insert "mut ")) | ||
| 138 | ;; Add: let -> let mut | ||
| 139 | ((progn (goto-char (line-beginning-position)) | ||
| 140 | (re-search-forward "\\_<let\\_>" line-end t)) | ||
| 141 | (insert " mut")) | ||
| 142 | (t (message "No mutable/immutable binding or reference found on this line")))))) | ||
| 120 | ;;; _ | 143 | ;;; _ |
| 121 | (provide 'rust-utils) | 144 | (provide 'rust-utils) |
| 122 | ;;; rust-utils.el ends here | 145 | ;;; rust-utils.el ends here |
diff --git a/.emacs.d/lisp/yaml-mode.el b/.emacs.d/lisp/yaml-mode.el index c748b6c..1bfa43b 100644 --- a/.emacs.d/lisp/yaml-mode.el +++ b/.emacs.d/lisp/yaml-mode.el | |||
| @@ -272,7 +272,8 @@ that key is pressed to begin a block literal." | |||
| 272 | (sps (save-excursion (syntax-ppss (1- pt))))) | 272 | (sps (save-excursion (syntax-ppss (1- pt))))) |
| 273 | (when (not (nth 8 sps)) | 273 | (when (not (nth 8 sps)) |
| 274 | (cond | 274 | (cond |
| 275 | ((and (char-equal ?' (char-before (1- pt))) | 275 | ((and (char-before (1- pt)) |
| 276 | (char-equal ?' (char-before (1- pt))) | ||
| 276 | (char-equal ?' (char-before pt))) | 277 | (char-equal ?' (char-before pt))) |
| 277 | (put-text-property (- pt 2) pt | 278 | (put-text-property (- pt 2) pt |
| 278 | 'syntax-table (string-to-syntax "w")) | 279 | 'syntax-table (string-to-syntax "w")) |
diff --git a/.emacs.d/snippets/python-mode.statnett/from b/.emacs.d/snippets/python-mode.statnett/from deleted file mode 100644 index 3a4acfc..0000000 --- a/.emacs.d/snippets/python-mode.statnett/from +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: from | ||
| 3 | # key: from | ||
| 4 | # group : general | ||
| 5 | # -- | ||
| 6 | from ${1:lib} import ${2:funs} \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode.statnett/try b/.emacs.d/snippets/python-mode.statnett/try deleted file mode 100644 index 6e68e8d..0000000 --- a/.emacs.d/snippets/python-mode.statnett/try +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: try | ||
| 3 | # key: try | ||
| 4 | # -- | ||
| 5 | try: | ||
| 6 | $1 | ||
| 7 | except ${2:Exception} as e: | ||
| 8 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode.statnett/with-open b/.emacs.d/snippets/python-mode.statnett/with-open deleted file mode 100644 index 77c7210..0000000 --- a/.emacs.d/snippets/python-mode.statnett/with-open +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: with-open | ||
| 3 | # key: wo | ||
| 4 | # -- | ||
| 5 | with open(${1:"filename"}${2:, encoding="${3:utf-8}"}${4:, mode="${5:w}"}) as ${6:myfile}: | ||
| 6 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/from b/.emacs.d/snippets/python-mode/from deleted file mode 100644 index 3a4acfc..0000000 --- a/.emacs.d/snippets/python-mode/from +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: from | ||
| 3 | # key: from | ||
| 4 | # group : general | ||
| 5 | # -- | ||
| 6 | from ${1:lib} import ${2:funs} \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/try b/.emacs.d/snippets/python-mode/try deleted file mode 100644 index 6e68e8d..0000000 --- a/.emacs.d/snippets/python-mode/try +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: try | ||
| 3 | # key: try | ||
| 4 | # -- | ||
| 5 | try: | ||
| 6 | $1 | ||
| 7 | except ${2:Exception} as e: | ||
| 8 | $0 \ No newline at end of file | ||
diff --git a/.emacs.d/snippets/python-mode/with-open b/.emacs.d/snippets/python-mode/with-open deleted file mode 100644 index 77c7210..0000000 --- a/.emacs.d/snippets/python-mode/with-open +++ /dev/null | |||
| @@ -1,6 +0,0 @@ | |||
| 1 | # -*- mode: snippet -*- | ||
| 2 | # name: with-open | ||
| 3 | # key: wo | ||
| 4 | # -- | ||
| 5 | with open(${1:"filename"}${2:, encoding="${3:utf-8}"}${4:, mode="${5:w}"}) as ${6:myfile}: | ||
| 6 | $0 \ No newline at end of file | ||
