This is an archive of the discontinued LLVM Phabricator instance.

[clang-rename] add basic Emacs integration
ClosedPublic

Authored by omtcyfz on Aug 1 2016, 2:35 AM.

Details

Summary

This patch aims to add very basic Emacs integration. My experience with Emacs is limited to few days, so I'm not sure whether I've done things correctly.

Diff Detail

Repository
rL LLVM

Event Timeline

omtcyfz updated this revision to Diff 66289.Aug 1 2016, 2:35 AM
omtcyfz retitled this revision from to [clang-rename] add basic Emacs integration.
omtcyfz updated this object.
omtcyfz added reviewers: bkramer, alexfh, klimek.
omtcyfz added a subscriber: cfe-commits.
omtcyfz updated this revision to Diff 66292.Aug 1 2016, 2:52 AM

Update docs by adding information about Emacs integration.

klimek added inline comments.Aug 1 2016, 3:16 AM
clang-rename/tool/clang-rename.el
7 ↗(On Diff #66292)

s/clang-format/clang-rename/, and fix docs in general :)

17 ↗(On Diff #66292)

Typo.

omtcyfz updated this revision to Diff 66296.Aug 1 2016, 3:19 AM
omtcyfz marked 2 inline comments as done.
omtcyfz added inline comments.
clang-rename/tool/clang-rename.el
7 ↗(On Diff #66292)

Aw, yeah. This block was just copied :D

Manuel, any other comments? Jens seems to be missing and I don't know about anyone else who is familiar with Emacs :(

omtcyfz edited reviewers, added: hokein; removed: massberg, bkramer.Aug 1 2016, 6:27 AM
hokein added inline comments.Aug 1 2016, 8:08 AM
clang-rename/tool/clang-rename.el
16 ↗(On Diff #66296)

I think we should make clang-rename binary path configurable by making it a custom variable (using defcustom).

20 ↗(On Diff #66296)

s is an extra character here?

27 ↗(On Diff #66296)

Any reason why not use call-process-region?

docs/clang-rename.rst
106 ↗(On Diff #66296)

missing two "=".

114 ↗(On Diff #66296)

print doesn't make sense here? I think user should type clang-rename and new name.

alexfh added inline comments.Aug 1 2016, 8:17 AM
clang-rename/tool/clang-rename.el
18 ↗(On Diff #66296)

The name should be just "clang-rename".

docs/clang-rename.rst
100 ↗(On Diff #66296)

Remove the linebreak after "The".

114 ↗(On Diff #66296)

Yep, just s/print/type/.

omtcyfz updated this revision to Diff 66328.Aug 1 2016, 8:40 AM
omtcyfz marked 8 inline comments as done.
omtcyfz added inline comments.
clang-rename/tool/clang-rename.el
20 ↗(On Diff #66296)

No, it tells Emacs to read a string.

27 ↗(On Diff #66296)

/* discussed */

All the comments seem to be addressed.

alexfh added inline comments.Aug 1 2016, 10:19 AM
clang-rename/tool/clang-rename.el
28 ↗(On Diff #66328)

For posterity, please add a short summary of the offline discussion.

docs/clang-rename.rst
104 ↗(On Diff #66328)

Either Clang-rename Emacs integration or just Emacs integration.

omtcyfz updated this revision to Diff 66341.Aug 1 2016, 10:28 AM
omtcyfz marked 2 inline comments as done.
omtcyfz added inline comments.
clang-rename/tool/clang-rename.el
28 ↗(On Diff #66328)

call-process-region is used while contents of current buffer are to be replaced, but in case of clang-rename changes might affect all buffers, which doesn't make sense to take care of one buffer only.

omtcyfz marked an inline comment as done.Aug 1 2016, 1:42 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.EditedAug 1 2016, 4:55 PM

Please add install rule for clang-rename.el. See clang-format CMakeLists.txt as example.

omtcyfz updated this revision to Diff 66434.Aug 2 2016, 12:00 AM

Please add install rule for clang-rename.el. See clang-format CMakeLists.txt as example.

Good point! Thank you!

Done.

hokein accepted this revision.Aug 2 2016, 12:59 AM
hokein edited edge metadata.

lgtm with two nits.

clang-rename/tool/CMakeLists.txt
14 ↗(On Diff #66434)

Also include the vim integration clang-rename.py?

docs/clang-rename.rst
99 ↗(On Diff #66434)

s/print/type

This revision is now accepted and ready to land.Aug 2 2016, 12:59 AM
omtcyfz updated this revision to Diff 66437.Aug 2 2016, 1:04 AM
omtcyfz edited edge metadata.
  • s/print/type
  • Add clang-rename.py to the CMakeLists.txt installation instructions.
omtcyfz marked 2 inline comments as done.Aug 2 2016, 1:05 AM

Thanks! Fixed.

Waiting few more hours just in case anyone will jump in and write few comments.

alexfh accepted this revision.Aug 2 2016, 1:55 AM
alexfh edited edge metadata.

LG

This revision was automatically updated to reflect the committed changes.