unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t]
@ 2006-05-13  4:52 Richard Stallman
  2006-05-13 10:11 ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2006-05-13  4:52 UTC (permalink / raw)


Can someone please DTRT, and ack?

------- Start of forwarded message -------
Date: Fri, 12 May 2006 11:22:53 +0200 (MEST)
From: Klaus Zeitler <kzeitler@sfsws1.de.lucent.com>
To: emacs-pretest-bug@gnu.org
Subject: show-ifdef-block does not work when hide-ifdef-lines is t
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed 
	version=3.0.4

1. load a C file with an ifdef block
2. turn on hide-ifdef-mode
3. hide-ifdef-block and show-ifdef-block work fine
4. set hide-ifdef-lines to t
5. hide-ifdef-block works, but show-ifdef-block only brings back one line
   of this block each time it is called


In GNU Emacs 22.0.50.12 (sparc-sun-solaris2.8, Motif Version 2.1.0)
 of 2006-05-12 on sfsws4
X server distributor `Sun Microsystems, Inc.', version 11.0.6410
configured using `configure '--with-gcc' '--prefix=/vol/freeware/SunOS-5.8/emacs/cvs' '--sharedstatedir=/vol/freeware/SunOS-5.8/emacs/cvs/share' '--with-x-toolkit=motif' '--x-includes=/usr/openwin/include:/usr/local/gnu/include:/opt/exp/gnu/include:/opt/exp/include:/opt/exp/lib/xpm/include' '--x-libraries=/usr/openwin/lib:/usr/local/gnu/lib:/opt/exp/gnu/lib:/opt/exp/lib:/opt/exp/lib/xpm/lib' '--with-pop' 'CC=gcc''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: C/l

Minor modes in effect:
  hide-ifdef-mode: t
  tooltip-mode: t
  auto-compression-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent input:
. c <return> <escape> x h i d e i f SPC <backspace> 
<backspace> SPC i SPC SPC <return> <down-mouse-1> <mouse-movement> 
<mouse-1> <escape> x <help-echo> <down-mouse-2> <mouse-2> 
<return> <help-echo> <escape> x <up> <right> <right> 
<right> <right> <right> <left> <backspace> <backspace> 
<backspace> <backspace> s h o w <return> M-: <help-echo> 
<down-mouse-2> <mouse-2> <help-echo> <left> <left> 
<left> <right> <backspace> <backspace> <backspace> 
<help-echo> <backspace> <backspace> <right> <right> 
<return> <escape> x <up> <up> <return> <escape> x <up> 
<up> <return> <escape> x <up> <return> <escape> x <up> 
<return> <right> <right> <left> <escape> x <up> <return> 
<up> <down> <left> <left> <help-echo> <help-echo> <help-echo> 
<menu-bar> <help-menu> <report-emacs-bug>

Recent messages:
(/usr/local/gnu/cvs/head/bin/emacs -Q)
For information about the GNU Project and its goals, type C-h C-p.
Loading cc-mode...done
Loading hideif...done
Hide-Ifdef mode enabled
t
Loading emacsbug...done


_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t]
  2006-05-13  4:52 [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t] Richard Stallman
@ 2006-05-13 10:11 ` martin rudalics
  2006-05-13 20:41   ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2006-05-13 10:11 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

 > 1. load a C file with an ifdef block
 > 2. turn on hide-ifdef-mode
 > 3. hide-ifdef-block and show-ifdef-block work fine
 > 4. set hide-ifdef-lines to t
 > 5. hide-ifdef-block works, but show-ifdef-block only brings back one line
 >    of this block each time it is called

Attached find two patches.  The first patches just `show-ifdef-block'.
The second uses one invisibility overlay only to cover the ifdef lines
and the enclosed block.  Without any warranty.

[-- Attachment #2: hideif1.patch --]
[-- Type: text/plain, Size: 1220 bytes --]

*** hideif.el	Sat Nov  5 19:46:04 2005
--- hideif.el	Sat May 13 11:57:14 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,943 ----
      (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)))
        (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))



[-- Attachment #3: hideif2.patch --]
[-- Type: text/plain, Size: 2044 bytes --]

*** hideif.el	Sat Nov  5 19:46:04 2005
--- hideif.el	Sat May 13 11:38:20 2006
***************
*** 921,945 ****
    (interactive)
    (unless hide-ifdef-mode (hide-ifdef-mode 1))
    (let ((top-bottom (hif-find-ifdef-block)))
!     (hide-ifdef-region (car top-bottom) (cdr top-bottom))
!     (when hide-ifdef-lines
!       (hif-hide-line (car top-bottom))
!       (hif-hide-line (1+ (cdr top-bottom))))
      (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)))))

- 
  ;;;  definition alist support

  (defvar hide-ifdef-define-alist nil
--- 921,948 ----
    (interactive)
    (unless hide-ifdef-mode (hide-ifdef-mode 1))
    (let ((top-bottom (hif-find-ifdef-block)))
!     (if hide-ifdef-lines
! 	(hide-ifdef-region-internal
! 	 (save-excursion
! 	   (goto-char (car top-bottom)) (line-beginning-position))
! 	 (save-excursion
! 	   (goto-char (cdr top-bottom)) (line-end-position 2)))
!       (hide-ifdef-region (car top-bottom) (cdr top-bottom)))
      (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 (cdr top-bottom)) (line-end-position 2)))
        (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))

  ;;;  definition alist support

  (defvar hide-ifdef-define-alist nil

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t]
  2006-05-13 10:11 ` martin rudalics
@ 2006-05-13 20:41   ` Richard Stallman
  2006-05-14 14:40     ` martin rudalics
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2006-05-13 20:41 UTC (permalink / raw)
  Cc: emacs-devel

    Attached find two patches.  The first patches just `show-ifdef-block'.
    The second uses one invisibility overlay only to cover the ifdef lines
    and the enclosed block.  Without any warranty.

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

Would you please send the change logs?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t]
  2006-05-13 20:41   ` Richard Stallman
@ 2006-05-14 14:40     ` martin rudalics
  2006-05-15  7:34       ` Klaus Zeitler
  0 siblings, 1 reply; 5+ messages in thread
From: martin rudalics @ 2006-05-14 14:40 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

 > 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.


[-- Attachment #2: hideif.patch --]
[-- Type: text/plain, Size: 1423 bytes --]

2006-05-14  Martin Rudalics  <rudalics@gmx.at>

	* 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)))))



[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t]
  2006-05-14 14:40     ` martin rudalics
@ 2006-05-15  7:34       ` Klaus Zeitler
  0 siblings, 0 replies; 5+ messages in thread
From: Klaus Zeitler @ 2006-05-15  7:34 UTC (permalink / raw)
  Cc: rms, emacs-devel

>>>>> "martin" == martin rudalics <rudalics@gmx.at> writes:
    martin> 
    martin> Attached find a corrected version of the first patch.

Yes, works fine. Thanks for the quick fix.

Klaus

-- 
 ------------------------------------------
|  Klaus Zeitler      Lucent Technologies  |
|  Email:             kzeitler@lucent.com  |
 ------------------------------------------
---
Left to themselves, things tend to go from bad to worse.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-05-15  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-13  4:52 [kzeitler@sfsws1.de.lucent.com: show-ifdef-block does not work when hide-ifdef-lines is t] Richard Stallman
2006-05-13 10:11 ` martin rudalics
2006-05-13 20:41   ` Richard Stallman
2006-05-14 14:40     ` martin rudalics
2006-05-15  7:34       ` Klaus Zeitler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).