Giter Site home page Giter Site logo

Comments (10)

russel avatar russel commented on June 8, 2024

Everything is possible in Emacs, the question is whether anyone has the patience to write the E-Lisp to do it. Is this alignment something people in C++ are going to start to want? It may certainly become a demand for Java mode now (with Java 8) if it hasn't already. Currently Java just uses continuation indent here as D and C++ do. Mayhap just relent and use:

  foreach (file; dirPath
           .expandTilde()
           .buildNormalizedPath()
           .dirEntries(SpanMode.shallow)()
           .filter!(name => name.extension == ".csv")) { // I love D :)
  }

from emacs-d-mode.

nordlow avatar nordlow commented on June 8, 2024

I just got an answer and here

https://stackoverflow.com/questions/25797945/adjusting-alignment-rules-for-ucfs-chains-in-d/25843155#25843155

My first try didn't have any effect unfortunately. I'll try some more in Vanilla Emacs later on. Maybe you could try it out?

Correction: It works only with function calls with parens.

Update: The latest update works flawlessly in my Emacs!

from emacs-d-mode.

russel avatar russel commented on June 8, 2024

So I guess we add the function to the d-mode.el but leave people to use it via a d-mode-hook if they wish to?

I have prepared the ground by adding the code from the StackOverflow page in my clone of the repository. I can push the changes and the you can send in a pull request for the necessary changes to make things work?

from emacs-d-mode.

nordlow avatar nordlow commented on June 8, 2024

Sounds like a good plan.

Here's what I use:

https://github.com/nordlow/elisp/blob/master/mine/dotemacs.el#L1581

from emacs-d-mode.

russel avatar russel commented on June 8, 2024

I committed code and pushed to the mainline repository before reading the above. Apologies for that. Could I get you to do a diff of what you know works against what we now have in mainline and create a pull request?

from emacs-d-mode.

snosov1 avatar snosov1 commented on June 8, 2024

You have a typo in the comment above the function - it adds c-lineup... instead of d-lineup... function to the list.

from emacs-d-mode.

russel avatar russel commented on June 8, 2024

Sergei, thanks for spotting that. I had just cut and paste from the StackOverflow page, so I'll blame StackOverflow rather than me not checking things properly :-) It will be corrected momentarily.

from emacs-d-mode.

snosov1 avatar snosov1 commented on June 8, 2024

Great! Thanks!

Also, as a side note. I really think that this kind of stuff (i.e. available options and customization) should be put to the readme file and not to the source code alone. Because I doubt that a lot of people dig through the source looking for documentation.

So maybe it makes sense to move the appropriate comments from the heading of the d-mode.el file and info about this hack (and possibly other useful info) to readme to give it more publicity.

from emacs-d-mode.

russel avatar russel commented on June 8, 2024

Not so much a side note, more "I should have done that in the first place!" :-) I'll transfer more material onto the README.md file and/or take pull requests.

from emacs-d-mode.

russel avatar russel commented on June 8, 2024

I believe this issue was addressed in changesets f487a71 , 86930c3 and f4176c0 so I am closing this issue. Please re-open if there is still and issue to be addressed.

from emacs-d-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.