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

DDOC support? #80

Open
biocyberman opened this issue May 23, 2017 · 5 comments
Open

DDOC support? #80

biocyberman opened this issue May 23, 2017 · 5 comments

Comments

@biocyberman
Copy link

biocyberman commented May 23, 2017

Is there someone adding support for DDOC? If none, would like to try working on it if there is interest from others. In doing that, I also need some more information:

  1. About DDOC, the best documentation I can get so far is https://dlang.org/spec/ddoc.html. Any better sources?
  2. Should I modify d-mode.el or what is the better way? I am thinking about doing the former, but it may mess up with functionality for normal d files.
@russel
Copy link
Member

russel commented May 23, 2017

Having DDOC support in the comments is something a number of people would like, both formatting and font-lock. I believe the URL you highlight is the definitive statement of DDOC.

As for process:

  • Use a feature branch and work on d-mode.el. The master branch is the rolling release branch, and we need to get something fairly complete before we merge it in.
  • It would be good if we can get into doing some tests for this, to avoid the historic Emacs mode problem of untested code. There are already a few tests in place for some of the comment formatting.

@CyberShadow
Copy link
Member

Ideally, DDoc support would also support highlighting .ddoc and .dd files.

I started working on one, a very early / rudimentary draft is here:
https://github.com/CyberShadow/ddoc-mode

There are already a few tests in place for some of the comment formatting.

That information is outdated. d-mode now has 91% test coverage.

@russel
Copy link
Member

russel commented May 23, 2017

OK, that coverage figure works for me. :-) Let's try and keep it high enough for our confidence.

Might it be worth having separate modes for .d, and .ddoc and .dd files with some shared code?

@CyberShadow
Copy link
Member

Might it be worth having separate modes for .d, and .ddoc and .dd files with some shared code?

Yes, that makes sense.

I was planning to do some research on how to properly have a region of code highlighted in some way different from the rest of the code. Apparently doing it correctly is really, really hard in Emacs. (This is also why we still get glitches with string escapes that disappear when you make some edit and undo it.)

@biocyberman
Copy link
Author

biocyberman commented May 24, 2017

@CyberShadow great initiative on ddoc-mode.

I was planning to do some research on how to properly have a region of code highlighted in some way different from the rest of the code. Apparently doing it correctly is really, really hard in Emacs. (This is also why we still get glitches with string escapes that disappear when you make some edit and undo it.)

Have you looked at org-mode way to handle syntax highlighting in code blocks? http://orgmode.org/
It works quite smoothly in my experience. Another example is polymode:

Polymode is an emacs package that offers generic support for multiple major modes inside a single emacs buffer. It is lightweight, object oriented and highly extensible. Creating new polymodes typically takes a few lines of code.

Polymode does not seem to be as stable as orgmode considering only this aspect of multi-mode support.

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

No branches or pull requests

3 participants