help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TRAMP and Ruby mode, tabs not being honored


From: Michael Albinus
Subject: Re: TRAMP and Ruby mode, tabs not being honored
Date: Sun, 19 Nov 2017 11:40:58 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Kevin Faulkner <kondor6c@lazytree.us> writes:

Hi Kevin,

> Hello, I tried to resolve this issue on freenode at #emacs, we made some 
> progress but we were not able to reach a resolution in TRAMP mode. 
>
> The problem I have is that over TRAMP mode while editing a chef (Ruby
> .rb) file remotely, I enter Ruby mode by nature of editing that file.
> When I try make a new block and press <tab> (or just press return from 
> the new block) it inserts two spaces. When I am editing previously
> written lines/blocks, I can press tab and it will be a tab character. My
> company mandates tabs (despite my best efforts to change that) in this
> repository. While on IRC I added the hook which seems to work
> (suggestion found here: https://stackoverflow.com/a/38901225/9903). It
> changed the behavior locally (a tab is a tab), but not over TRAMP, which
> is what I'm really looking to achieve. I have made a .dir-locals file
> and tried many variations on the options but it generally looks like
> this:
> ```::
> (
> (setq indent-tabs-mode t)
> (ruby-mode . ((indent-tabs-mode . t)
> (add-hook 'ruby-mode-hook (lambda ()
> (setq indent-tabs-mode t)
> (setq tab-width 2)))
> (tab-width . 3))))
> ::```
> I know for a fact that the dir-locals file is being read and respected
> because I can change the tab-width to be crazy like 10 and it works.
> I would prefer not to make a secondary script to change the spaces into
> tabs, because I feel this is a configuration/user issue. I can include
> my .emacs (init) file, if you like, I don't have anything too extreme
> included but here is part of it:
> ```::
> '(bmkp-last-as-first-bookmark-file "/home/kfaulkne/.emacs.d/bookmarks")
> '(custom-enabled-themes (quote (misterioso)))
> '(enable-remote-dir-locals t)
> '(package-selected-packages
> (quote
> (dired+ elscreen bookmark+ org-notebook async-await magit leanote
>        elpy dokuwiki-mode dokuwiki)))
> '(safe-local-variable-values (quote ((ruby-indent-tabs-mode . t))))
> ;;This was because I kept adding various options I had kept finding.
> '(tramp-default-method "sshx"))
> ::```
> Please excuse any inefficiencies, I have I have tried diligently in vain
> for a full day and I hope that I might get this resolved. Thank you all
> for your time.

I have tried to reproduce the problem with the most simple
configuration. I have written a file ~/tmp/foo.el:

--8<---------------cut here---------------start------------->8---
(setq indent-tabs-mode t
      tab-width 3)
(add-hook 'ruby-mode-hook
          (lambda ()
            (setq indent-tabs-mode t
                  tab-width 2)))
--8<---------------cut here---------------end--------------->8---

Then I have opened Emacs 27 with a test ruby file, simulating the sshx
method:

$ ~/src/emacs/src/emacs -Q -l ~/tmp/foo.el -l tramp /sshx::~/tmp/estcall.rb

When I edit estcall.rb, and press <RET> after a block, <TAB> is inserted.

Could you, pls, check this recipe in your environment?

> -Kevin

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]