Tab-width not honored in multi major mode buffers?

Bug #900520 reported by lborgman on 2011-12-05
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nXhtml
Medium
Unassigned

Bug Description

Hi,

I am working in a large codebase which is all using 4-space tabs for indentation. I have added the following (based on your suggestion in question 102938), which sets the tab width for viewing, but indent-tabs-mode does not have any effect when I press TAB to indent code:

(defun tab-width-4 ()
  (setq tab-width 4)
  (setq indent-tabs-mode t))
(add-hook 'mumamo-after-change-major-mode-hook 'tab-width-4 t)

If I switch to a component mode (e.g. straight nxhtml-mode) there is no problem. I tried tracing down into mumamo-indent* but I got pretty confused as the indentation code is quite complex. It seems the problem may be that the variables are not being propagated into the mirror buffer; at least, if I evaluate tab-width and indent-tabs-mode in it, they are not as I expect (8 and nil). Is there a simple way to do this? I've been having to manually fix indentation issues for months now and I'm willing to try anything...

Thanks!

lborgman (lennart-borgman) wrote :

Thanks for finding this, Riley. It looks like a bug so I am converting it to a bug report.

I have just updated mumamo-cmirr.el in the nXhtml repository so that it copies tab-width to the mirror buffer as you suggested. Can you please try it?

Changed in nxhtml:
status: New → In Progress
importance: Undecided → Medium
Nicholas Riley (njriley) wrote :

Yes, it works! Thanks.

Changed in nxhtml:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions