|
77 | 77 | (defun rust-rewind-irrelevant ()
|
78 | 78 | (let ((starting (point)))
|
79 | 79 | (skip-chars-backward "[:space:]\n")
|
80 |
| - (if (looking-back "\\*/") (backward-char)) |
| 80 | + (if (looking-back "\\*/" nil) (backward-char)) |
81 | 81 | (if (rust-in-str-or-cmnt)
|
82 | 82 | (rust-rewind-past-str-cmnt))
|
83 | 83 | (if (/= starting (point))
|
|
104 | 104 | (backward-up-list)
|
105 | 105 | (back-to-indentation))))
|
106 | 106 |
|
| 107 | +(defconst rust-re-ident "[[:word:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*") |
| 108 | + |
107 | 109 | (defun rust-align-to-method-chain ()
|
108 | 110 | (save-excursion
|
109 | 111 | ;; for method-chain alignment to apply, we must be looking at
|
|
139 | 141 | ;;
|
140 | 142 | ((skip-dot-identifier
|
141 | 143 | (lambda ()
|
142 |
| - (when (looking-back (concat "\\." rust-re-ident)) |
| 144 | + (when (looking-back (concat "\\." rust-re-ident) nil) |
143 | 145 | (forward-thing 'symbol -1)
|
144 | 146 | (backward-char)
|
145 | 147 | (- (current-column) rust-indent-offset)))))
|
146 | 148 | (cond
|
147 | 149 | ;; foo.bar(...)
|
148 |
| - ((looking-back ")") |
| 150 | + ((looking-back ")" nil) |
149 | 151 | (backward-list 1)
|
150 | 152 | (funcall skip-dot-identifier))
|
151 | 153 |
|
|
269 | 271 | ;; ..or if the previous line ends with any of these:
|
270 | 272 | ;; { ? : ( , ; [ }
|
271 | 273 | ;; then we are at the beginning of an expression, so stay on the baseline...
|
272 |
| - (looking-back "[(,:;?[{}]\\|[^|]|") |
| 274 | + (looking-back "[(,:;?[{}]\\|[^|]|" nil) |
273 | 275 | ;; or if the previous line is the end of an attribute, stay at the baseline...
|
274 | 276 | (progn (rust-rewind-to-beginning-of-current-level-expr) (looking-at "#")))))
|
275 | 277 | baseline
|
|
318 | 320 | "bool"
|
319 | 321 | "str" "char"))
|
320 | 322 |
|
321 |
| -(defconst rust-re-ident "[[:word:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*") |
322 | 323 | (defconst rust-re-CamelCase "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*")
|
323 | 324 | (defun rust-re-word (inner) (concat "\\<" inner "\\>"))
|
324 | 325 | (defun rust-re-grab (inner) (concat "\\(" inner "\\)"))
|
@@ -666,7 +667,7 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
|
666 | 667 | "If the most recently inserted character is a `>`, briefly moves point to matching `<` (if any)."
|
667 | 668 | (interactive)
|
668 | 669 | (when (and rust-blink-matching-angle-brackets
|
669 |
| - (looking-back ">")) |
| 670 | + (looking-back ">" nil)) |
670 | 671 | (let ((matching-angle-bracket-point (save-excursion
|
671 | 672 | (backward-char 1)
|
672 | 673 | (rust-find-matching-angle-bracket))))
|
|
0 commit comments