Skip to content
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

Differences between rustic.el and rust-mode.el #407

Closed
wants to merge 9 commits into from

Conversation

tarsius
Copy link
Contributor

@tarsius tarsius commented Apr 15, 2021

These commits are not intended to be merged.

This demonstrates what differences remain between rustic.el and rust-mode.el after merging

(All the commits from #406 are included here as well.)

See #405 for an overview.

This pull-request was created by:

  1. Applying the above pull-requests.

  2. Evaluating:

    (progn
      (copy-file "~/.emacs.d/lib/rustic/rustic.el"
                 "~/.emacs.d/lib/rust-mode/rust-mode.el"
                 t)
      (with-current-buffer
          (find-file-noselect "~/.emacs.d/lib/rust-mode/rust-mode.el")
        (save-excursion
          (goto-char (point-min))
          (save-excursion (replace-regexp ":group 'rustic" ":group 'rust-mode"))
          (save-excursion (replace-regexp "rustic-mode" "rust-mode"))
          (save-excursion (replace-regexp "rustic" "rust"))
          (save-excursion (replace-regexp "\"1.2\"" "\"0.6.0\"")))))
  3. Manually spitting the differences across multiple commits.

@rust-highfive
Copy link

r? @brotzeit

(rust-highfive has picked a reviewer for you, use r? to override)

@tarsius tarsius marked this pull request as draft April 15, 2021 14:30
@brotzeit
Copy link
Contributor

@tarsius can you please open another pull request that only contains the commits that moves code to other files, this way I still got the diffs(thanks for that).

@brotzeit
Copy link
Contributor

Ah you did that already, thanks :P

@tarsius

This comment has been minimized.

@tarsius

This comment has been minimized.

@brotzeit
Copy link
Contributor

Instead you recommitted each commit (changing the committer name and date). I would like to understand why you do that because I cannot see any benefits (except for the one that you could instead get by using a merge commit).

I was told by several people in the past that performing a "rebase and merge"(in github) is the way to go since you don't have the merge commit and get a cleaner history ?

@tarsius

This comment has been minimized.

@tarsius

This comment has been minimized.

If `rust-load-optional-libraries' nil and the user did not explicitly
load `rust-rustfmt', then the functions `rust-before-save-hook' and
`rust-after-save-hook' are undefined.  Do not add them to the
respective hook variables if they are undefined.
@tarsius
Copy link
Contributor Author

tarsius commented Apr 23, 2021

What do you want to do about the commands that rustic no longer defines in rustic.el:

  • *-beginning-of-defun
  • *-end-of-defun
  • *-indent-line + helper functions

Should we do the same for rust-mode and move them to a separate library as you did with rustic-interactive.el. (But i would name it rust-commands.el; *-interactive.el is unusual.) Or should we instead move these commands back into rust-mode.el?

I looked at the differences and they are not big, so after a bit of backward and/or forward porting rustic can use the commands from rust-mode. I guess that means moving the commands back into rust-mode.el would be preferable. In any case I would like to first decide which package we rearrange to make it more like the other.

I favor moving these shared commands back into rustic.el.

While we don't use this new argument here,
`rustic' will soon start using it.
(progn
  (copy-file "~/.emacs.d/lib/rustic/rustic.el"
             "~/.emacs.d/lib/rust-mode/rust-mode.el"
             t)
  (with-current-buffer
      (find-file-noselect "~/.emacs.d/lib/rust-mode/rust-mode.el")
    (save-excursion
      (goto-char (point-min))
      ;; (re-search-forward "^;;; Code:$" nil t)
      ;; (kill-region (point-min) (match-beginning 0))
      (save-excursion (replace-regexp ":group 'rustic" ":group 'rust-mode"))
      (save-excursion (replace-regexp "rustic-mode" "rust-mode"))
      (save-excursion (replace-regexp "rustic" "rust"))
      (save-excursion (replace-regexp "\"1.2\"" "\"0.6.0\""))
      )))
@brotzeit
Copy link
Contributor

This pull request helped a lot, thanks again.

@brotzeit brotzeit closed this Dec 16, 2021
@tarsius
Copy link
Contributor Author

tarsius commented Dec 16, 2021

Great :)

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.

None yet

3 participants