Code Monkey home page Code Monkey logo

Comments (5)

ejmr avatar ejmr commented on July 17, 2024

That would be nice to have in php-mode, as I like the idea a lot. However, I do not believe we should explicitly redefine fixup-whitespace. It provides the same behavior for modes besides php-mode, but now we have a potential future problem whenever Emacs changes the default behavior of that function; I honestly don't know how likely that is, but I would still prefer to avoid it. A different approach would be to write the PHP-specific logic for fixup-whitespace into another function and then, inside of php-mode, wrap fixup-whitespace with a call to defadvice that uses our specific logic. I am just brainstorming out-loud, so I have not tested that idea, but something like that would give us a cleaner separation between php-mode and something built into Emacs which other modes rely on.

from php-mode.

kalifg avatar kalifg commented on July 17, 2024

Yeah, I see how I could do that. I will get on that. I think we can do post advice that checks for the current mode and then looks at the character at point. if it sees `" \(->\|::\)`` then we can delete the added space.

from php-mode.

kalifg avatar kalifg commented on July 17, 2024

Here, I think I have an adequate solution, that can be expanded upon when necessary. Do you think this is something that should be defcustom'd?

from php-mode.

ejmr avatar ejmr commented on July 17, 2024

Thanks for providing a patch with tests and everything. It works as advertised for me so I merged it as b764847 so other people can start using it. I think whether or not it should be controlled by defcustom will be determined if anyone raises an issue here with the change. If everyone thinks delete-indentation is just "Doing the Right Thing" then there is no reason to make it customizable.

from php-mode.

kalifg avatar kalifg commented on July 17, 2024

Great!

from php-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.