diff options
| author | Felix S Klock II <pnkfelix@pnkfx.org> | 2015-05-04 18:12:34 +0200 |
|---|---|---|
| committer | Felix S Klock II <pnkfelix@pnkfx.org> | 2015-05-04 18:12:34 +0200 |
| commit | f2f4d67a73748cfa3266b2d5d12d22b2454f03e9 (patch) | |
| tree | 0e4b8e61328ca8de47771e26f9104e7842ec6a9e | |
| parent | 1be7a946ed1cce8a2e4c462af8003c628770fed4 (diff) | |
| parent | 96f7f79da777618232eb8d794c46b1ff3c4c7b72 (diff) | |
| download | rust-mode-f2f4d67a73748cfa3266b2d5d12d22b2454f03e9.tar.gz | |
Merge pull request #59 from lunaryorn/fix-byte-compiler-warnings
Fix some byte compiler warnings on Emacs 25.1
| -rw-r--r-- | rust-mode.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/rust-mode.el b/rust-mode.el index 27250a2..bb800da 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -77,7 +77,7 @@ (defun rust-rewind-irrelevant () (let ((starting (point))) (skip-chars-backward "[:space:]\n") - (if (looking-back "\\*/") (backward-char)) + (if (looking-back "\\*/" nil) (backward-char)) (if (rust-in-str-or-cmnt) (rust-rewind-past-str-cmnt)) (if (/= starting (point)) @@ -104,6 +104,8 @@ (backward-up-list) (back-to-indentation)))) +(defconst rust-re-ident "[[:word:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*") + (defun rust-align-to-method-chain () (save-excursion ;; for method-chain alignment to apply, we must be looking at @@ -139,13 +141,13 @@ ;; ((skip-dot-identifier (lambda () - (when (looking-back (concat "\\." rust-re-ident)) + (when (looking-back (concat "\\." rust-re-ident) nil) (forward-thing 'symbol -1) (backward-char) (- (current-column) rust-indent-offset))))) (cond ;; foo.bar(...) - ((looking-back ")") + ((looking-back ")" nil) (backward-list 1) (funcall skip-dot-identifier)) @@ -269,7 +271,7 @@ ;; ..or if the previous line ends with any of these: ;; { ? : ( , ; [ } ;; then we are at the beginning of an expression, so stay on the baseline... - (looking-back "[(,:;?[{}]\\|[^|]|") + (looking-back "[(,:;?[{}]\\|[^|]|" nil) ;; or if the previous line is the end of an attribute, stay at the baseline... (progn (rust-rewind-to-beginning-of-current-level-expr) (looking-at "#"))))) baseline @@ -318,7 +320,6 @@ "bool" "str" "char")) -(defconst rust-re-ident "[[:word:][:multibyte:]_][[:word:][:multibyte:]_[:digit:]]*") (defconst rust-re-CamelCase "[[:upper:]][[:word:][:multibyte:]_[:digit:]]*") (defun rust-re-word (inner) (concat "\\<" inner "\\>")) (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." "If the most recently inserted character is a `>`, briefly moves point to matching `<` (if any)." (interactive) (when (and rust-blink-matching-angle-brackets - (looking-back ">")) + (looking-back ">" nil)) (let ((matching-angle-bracket-point (save-excursion (backward-char 1) (rust-find-matching-angle-bracket)))) |
