emacs - Create a minor mode that sets tab space -


i want have minor mode that, when enabled, changes tab space 4 2 (and when disabled returns tab space 4). haven't written mode before i'm not sure how go this.

no need create minor mode. tab-width buffer-local variable:

(defvar my-tab-toggle-values '(2 4))  (defun my-toggle-tab-width ()   (interactive)   (setq tab-width      (if  (= tab-width (first my-tab-toggle-values))         (second my-tab-toggle-values)       (first my-tab-toggle-values)))) 

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -