andelf fledna Feather

2010年5月8日星期六

disable linum-mode in temp buffers, Emacs 23

define personal globalize linum mode to solve it. :)
;;; linum-mode
(setq linum-format
(lambda (line)
(propertize
(format (let ((w (length (number-to-string
(count-lines (point-min) (point-max))))))
(concat "%4d |")) line) 'face 'linum)))
(defun my-linum-on () ; linum should turn off in non-editor buffer
(unless (or (minibufferp)
(equal frame-title-format "Speedbar 1.0")
(equal (string-match "\\*.*\\*" (buffer-name)) 0))
(linum-mode 1)))
(define-globalized-minor-mode my-global-linum-mode linum-mode my-linum-on)
(my-global-linum-mode 1)


--
__ _
/ ) / // /)
/--/ ____ __/ _ // //
/ (_/ / <_(_/_</_</_//_
/>
</

没有评论: