diff options
| author | Micah Chalmer <micah@micahchalmer.net> | 2016-03-07 23:04:57 -0500 |
|---|---|---|
| committer | Micah Chalmer <micah@micahchalmer.net> | 2016-03-07 23:04:57 -0500 |
| commit | 0914b48b082c326160fbce2e6d47a468514323cf (patch) | |
| tree | 57856928994a0e75e620cf4b31a86b7ac5ac1dae | |
| parent | 351732107d4073892b752038228072482b6ebdf6 (diff) | |
| parent | f8d94cb53cdfc22cf715edd16cf0f0f8fadffbf3 (diff) | |
| download | rust-mode-0914b48b082c326160fbce2e6d47a468514323cf.tar.gz | |
Merge pull request #133 from kraai/avoid-cl
Use catch and throw instead of block and return
| -rw-r--r-- | rust-mode.el | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rust-mode.el b/rust-mode.el index 56657d6..8590da2 100644 --- a/rust-mode.el +++ b/rust-mode.el @@ -14,7 +14,6 @@ ;;; Code: (eval-when-compile (require 'rx) - (require 'cl) (require 'compile) (require 'url-vars)) @@ -541,17 +540,18 @@ function or trait. When nil, where will be aligned with fn or trait." "Matches names like \"foo::\" or \"Foo::\" (depending on RE-IDENT, which should match the desired identifiers), but does not match type annotations \"foo::<\"." `(lambda (limit) - (block nil + (catch 'rust-path-font-lock-matcher (while t (let* ((symbol-then-colons (rx-to-string '(seq (group (regexp ,re-ident)) "::"))) (match (re-search-forward symbol-then-colons limit t))) (cond ;; If we didn't find a match, there are no more occurrences ;; of foo::, so return. - ((null match) (return nil)) + ((null match) (throw 'rust-path-font-lock-matcher nil)) ;; If this isn't a type annotation foo::<, we've found a ;; match, so a return it! - ((not (looking-at (rx (0+ space) "<"))) (return match)))))))) + ((not (looking-at (rx (0+ space) "<"))) + (throw 'rust-path-font-lock-matcher match)))))))) (defvar rust-mode-font-lock-keywords (append |
