Skip to content

Commit

Permalink
updated hs-mode support
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/emacs-rails/trunk@210 cc5033d0-740f-0410-afc7-949910e492f2
  • Loading branch information
dimaexe committed Aug 16, 2007
1 parent bfc5b8f commit aea5974
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions rails-ruby.el
Expand Up @@ -59,12 +59,15 @@ See the variable `align-rules-list' for more details.")
(defun display-code-line-counts (ov) (defun display-code-line-counts (ov)
(when (eq 'code (overlay-get ov 'hs)) (when (eq 'code (overlay-get ov 'hs))
(overlay-put ov 'face 'font-lock-comment-face) (overlay-put ov 'face 'font-lock-comment-face)
; (overlay-put ov 'help-echo (buffer-substring-no-properties (overlay-start ov) (overlay-end ov)))
(overlay-put ov 'display (overlay-put ov 'display
(format " ··· %d lines" (format " ··· %d lines"
(count-lines (overlay-start ov) (count-lines (overlay-start ov)
(overlay-end ov)))))) (overlay-end ov))))))


(eval-after-load "hs-mode"
(unless hs-set-up-overlay
(setq hs-set-up-overlay 'display-code-line-counts)))

(defun ruby-hs-minor-mode (&optional arg) (defun ruby-hs-minor-mode (&optional arg)
(interactive) (interactive)
(require 'hideshow) (require 'hideshow)
Expand All @@ -79,8 +82,6 @@ See the variable `align-rules-list' for more details.")
;(lambda (&rest args) (ruby-beginning-of-defun)) ;(lambda (&rest args) (ruby-beginning-of-defun))
) )
hs-special-modes-alist))) hs-special-modes-alist)))
(unless hs-set-up-overlay
(setq hs-set-up-overlay 'display-code-line-counts))
(hs-minor-mode arg)) (hs-minor-mode arg))


;; flymake ruby support ;; flymake ruby support
Expand Down

0 comments on commit aea5974

Please sign in to comment.