jyp / boon

Ergonomic Command Mode for Emacs
GNU General Public License v3.0
323 stars 34 forks source link

V and C-v not honoring indent-tabs-mode #135

Open function2 opened 1 year ago

function2 commented 1 year ago

When editing code that uses tabs for indentation boon will insert spaces instead of \t. This happens with the function boon-open-line-and-insert when hitting Shift-v and C-v. I do think boon should respect indent-tabs-mode since many high profile projects (such as the linux kernel) use tabs.

As a work-around, I just rebind V and C-v to leave indentation up to the mode by have a macro press TAB for me:

  ;; ad-hoc solution for boon V and C-v to use proper indent tabs in coding styles.
  ;; rebind from boon-open-next-line-and-insert
  (fset 'my-boon-shift-v
    (kmacro-lambda-form [?\C-e ?\C-j tab ?v] 0 "%d"))
  (define-key boon-command-map "V" 'my-boon-shift-v)
  ;; rebind from boon-open-line-and-insert
  (fset 'my-boon-ctrl-v
    (kmacro-lambda-form [?\C-a ?\C-o tab ?v] 0 "%d"))
  (define-key boon-command-map (kbd "C-v") 'my-boon-ctrl-v)
function2 commented 1 year ago

actually I don't think it's possible for boon to get the correct indentation for boundary conditions where the newly opened line has different indent length