emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: show-ifdef-block does not work when hide-ifdef-lines


From: martin rudalics
Subject: Re: address@hidden: show-ifdef-block does not work when hide-ifdef-lines is t]
Date: Sun, 14 May 2006 16:40:13 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> What is the relationship between the two patches?
> Do they fix different bugs?
> Are they alternatives?  If so, which do you recommend?

The patches are alternatives.  However, the second patch does not fit
into the usual pattern established by `hif-possibly-hide' where two
lines of ellipses are displayed when `hide-ifdef-lines' is non-nil.
Hence I won't recommend it.  Attached find a corrected version of the
first patch.

2006-05-14  Martin Rudalics  <address@hidden>

        * progmodes/hideif.el (show-ifdef-block): Fix bug where parts of
        a hidden block remained hidden if `hide-ifdef-lines' is non-nil.


*** hideif.el   Sat Nov  5 19:46:04 2005
--- hideif.el   Sun May 14 15:18:24 2006
***************
*** 928,942 ****
      (setq hide-ifdef-hiding t))
    (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only)))

- 
  (defun show-ifdef-block ()
    "Show the ifdef block (true or false part) enclosing or before the cursor."
    (interactive)
!   (if hide-ifdef-lines
!       (save-excursion
!       (beginning-of-line)
!       (hif-show-ifdef-region (1- (point)) (progn (end-of-line) (point))))
!     (let ((top-bottom (hif-find-ifdef-block)))
        (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))


--- 928,944 ----
      (setq hide-ifdef-hiding t))
    (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only)))

  (defun show-ifdef-block ()
    "Show the ifdef block (true or false part) enclosing or before the cursor."
    (interactive)
!   (let ((top-bottom (hif-find-ifdef-block)))
!     (if hide-ifdef-lines
!       (hif-show-ifdef-region
!        (save-excursion
!          (goto-char (car top-bottom)) (line-beginning-position))
!        (save-excursion
!          (goto-char (1+ (cdr top-bottom)))
!          (hif-end-of-line) (point)))
        (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]