Skip to content

Add defun motions for rust-mode. #10873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2013
Merged

Conversation

pradeep90
Copy link
Contributor

Specifically, we can now use:

  • beginning-of-defun
  • end-of-defun
  • mark-defun

where "defun" means a Rust item.

  • Add tests in rust-mode-tests.el
  • Fix indentation in rust-mode-tests.el
  • Add support for trait to Imenu

Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
@metajack
Copy link
Contributor

metajack commented Dec 9, 2013

Things I noticed:

  • mark-defun has an extra line before the item included
  • beginning-of-defun when outside a method takes you to the previous method instead of the beginning of the impl. also at after an impl block, it takes you to the last method. Is this the expected behavior?

@metajack
Copy link
Contributor

metajack commented Dec 9, 2013

r=me otherwise

@pradeep90
Copy link
Contributor Author

Hi @metajack

mark-defun has an extra line before the item included

Yes, it is the expected behaviour. It works that way even in the default emacs-lisp-mode.

beginning-of-defun when outside a method takes you to the previous method instead of the beginning of the impl. also at after an impl block, it takes you to the last method. Is this the expected behavior?

Yes. It goes to the first item before point, not the previous item at the same level.

backward-up-list (C-M-u) generally works for going to the enclosing defun. So, we can use that in a separate function to do what you asked for if people really need it.

bors added a commit that referenced this pull request Dec 10, 2013
Specifically, we can now use:
+ beginning-of-defun
+ end-of-defun
+ mark-defun

where "defun" means a Rust item.

+ Add tests in rust-mode-tests.el
+ Fix indentation in rust-mode-tests.el
+ Add support for trait to Imenu
@bors bors closed this Dec 10, 2013
@bors bors merged commit 04d852a into rust-lang:master Dec 10, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jun 30, 2023
…flip1995

Move `redundant_clone` to `nursery`

changelog: [`redundant_clone`]: Move to `nursery`

A bunch of FPs in `redundant_clone` have sprung up after upstream MIR changes: rust-lang#108944

- rust-lang/rust-clippy#10870
- rust-lang/rust-clippy#10577
- rust-lang/rust-clippy#10545
- rust-lang/rust-clippy#10517

r? `@flip1995`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants