Git Product home page Git Product logo

Comments (9)

asok avatar asok commented on August 14, 2024

Yes I would accept both pull requests.

from projectile-rails.

Silex avatar Silex commented on August 14, 2024

Alright, take a look at https://github.com/Silex/projectile-rails/pull/1 and comment if needed.

Once #18 is solved I'll make a new PR for here.

from projectile-rails.

asok avatar asok commented on August 14, 2024

Looks good. What is you customization for emacs-lisp-mode? (setq indent-tabs-mode nil) I guess but something else maybe?

from projectile-rails.

Silex avatar Silex commented on August 14, 2024

Yeah that's pretty much it. That and some helpers.

(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)

;; Inspired from https://github.com/magnars/.emacs.d/blob/master/defuns/buffer-defuns.el
(defun tabify-buffer ()
  "Tabify the whole buffer."
  (interactive)
  (tabify (point-min) (point-max)))

(defun untabify-buffer ()
  "Untabify the whole buffer."
  (interactive)
  (untabify (point-min) (point-max)))

(defun indent-buffer ()
  "Reindent the whole buffer."
  (interactive)
  (indent-region (point-min) (point-max)))

(defun cleanup-region (start end)
  "Untabify, reindent and delete trailing whitespace for the selected region."
  (interactive "r")
  (untabify start end)
  (indent-region start end)
  (delete-trailing-whitespace start end))

(defun cleanup-buffer ()
  "Untabify, reindent and delete trailing whitespace for the whole buffer."
  (interactive)
  (cleanup-region (point-min) (point-max)))

In you case I just did M-x cleanup-buffer.

from projectile-rails.

Silex avatar Silex commented on August 14, 2024

Closing in favor of #18

from projectile-rails.

asok avatar asok commented on August 14, 2024

@Silex I think there some other option you have setup in your emacs. Because for me the indentation makes the function look like this:

;;;###autoload
(defun projectile-rails-on ()
  "Enable `projectile-rails-mode' minor mode if this is a rails project."
  (when (and
         (not (projectile-rails--ignore-buffer-p))
         (projectile-rails-root))
    (projectile-rails-mode +1)))

The (not (projectile-rails--ignore-buffer-p)) is indented according to the (and function and not to the (when function as in your setup.

from projectile-rails.

Silex avatar Silex commented on August 14, 2024

Hum, I'm not sure why this wasn't indented properly :/

I made a new PR to fix this. Maybe my work setup is different for some weird emacs version reason. I'll check wether emacs @ work indents it the same or not.

[EDIT], well there was still tabs in that file? not sure what happend.

from projectile-rails.

Silex avatar Silex commented on August 14, 2024

Bisect seems points at your weird merge :)

from projectile-rails.

asok avatar asok commented on August 14, 2024

Ok thanks! :)

from projectile-rails.

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.