--- hideshow.el.original_emacs_22.2 2008-01-10 12:15:42.000000000 -0800 +++ hideshow_my.el 2008-08-12 15:39:12.000000000 -0700 @@ -541,7 +541,10 @@ (q ;; `q' is the point at the end of the block (progn (hs-forward-sexp mdata 1) - (end-of-line) + ;; see http://www.emacswiki.org/cgi-bin/wiki/HideShow and search page for "hs-block-includes-last-line" + ;(forward-line -1) + ;(end-of-line) + (backward-char 1) ; better (point))) ov) (when (and (< p (point)) (> (count-lines p q) 1)) @@ -672,10 +675,13 @@ (forward-comment (buffer-size)) (and (< (point) maxp) (re-search-forward hs-block-start-regexp maxp t))) - (if (> arg 1) - (hs-hide-level-recursive (1- arg) minp maxp) - (goto-char (match-beginning hs-block-start-mdata-select)) - (hs-hide-block-at-point t))) + (when (not (nth 4 (syntax-ppss))) ; not inside comments + (if (> arg 1) + (hs-hide-level-recursive (1- arg) minp maxp) + (goto-char (match-beginning hs-block-start-mdata-select)) + (hs-hide-block-at-point t)) + ) + ) (goto-char maxp)) (defmacro hs-life-goes-on (&rest body)