rust-lang / rust-mode

Emacs configuration for Rust
Apache License 2.0
1.12k stars 180 forks source link

Attributes beginning of defun #316

Closed mookid closed 3 years ago

mookid commented 5 years ago

Typical scenario where this can be useful:

I want to mark a test (of a type with a bunch of derive statements) to move some code around. Calling mark-defun (C-M-h) does not select the attribute (#[test] or #[derive(...)], respectively).

This tries to fix this state of affair.

This is still WIP. I'll try to fix #299 in the same.

rust-highfive commented 5 years ago

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

nikomatsakis commented 5 years ago

JFYI I'm on vacation and probably won't look at this for a few weeks at best! But thanks for the PR :)

nikomatsakis commented 5 years ago

This looks reasonable enough to me. I'm not really an elisp expert by any means. I'm not sure if it'll work with more complex attributes like #[foo(baz="blah")], but I guess that's ok. I appreciate that there are some tests. =) I'm happy to merge once tests are passing.

nikomatsakis commented 5 years ago

Removing myself as assignee =)