emacs - linum, disable linum-mode on help, and fix a bug
authorPeng Li <seudut@gmail.com>
Sat, 12 Sep 2015 14:25:58 +0000 (22:25 +0800)
committerPeng Li <seudut@gmail.com>
Sat, 12 Sep 2015 14:25:58 +0000 (22:25 +0800)
emacs.d/config/init-base.el
emacs.d/config/init-linum.el

index 6773f70..7caaace 100644 (file)
@@ -36,4 +36,7 @@
 (show-paren-mode t)
 
 
+(add-hook 'help-mode-hook
+         (lambda ()
+           (linum-mode -1)))
 (provide 'init-base)
index 142403b..fd43e27 100644 (file)
@@ -19,7 +19,7 @@
   "The current line number.")
 
 (defun my-linum-get-format-string ()
- (let* ((width (min 4 (1+ (length (number-to-string
+ (let* ((width (max 3 (1+ (length (number-to-string
                              (count-lines (point-min) (point-max)))))))
          (format (concat "%" (number-to-string width) "d "))
          (current-line-format (concat "%-" (number-to-string width) "d ")))