* bug#5013: Enhancement to hideif.el
[not found] ` <fp1vjqnlet.fsf@fencepost.gnu.org>
@ 2011-03-01 4:31 ` Tony Hecker
2016-02-28 6:34 ` Lars Ingebrigtsen
2016-02-29 2:26 ` Lars Ingebrigtsen
2 siblings, 0 replies; 4+ messages in thread
From: Tony Hecker @ 2011-03-01 4:31 UTC (permalink / raw)
To: 5013
[-- Attachment #1: Type: text/plain, Size: 335 bytes --]
Hi,
I tested the hideif.el patch from Joe. It works in some cases but does not
seem to work with a series of #elif's like this case:
#if 0
function1();
#elif 1
function2(); // should not be hidden but is hidden
#elif 0
function3();
#elif 0
function4();
#endif
I do not have a fix (at least not right now).
Thanks,
Tony
[-- Attachment #2: Type: text/html, Size: 391 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#5013: Enhancement to hideif.el
[not found] ` <fp1vjqnlet.fsf@fencepost.gnu.org>
2011-03-01 4:31 ` bug#5013: Enhancement to hideif.el Tony Hecker
@ 2016-02-28 6:34 ` Lars Ingebrigtsen
2016-02-28 10:05 ` Andreas Schwab
2016-02-29 2:26 ` Lars Ingebrigtsen
2 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-28 6:34 UTC (permalink / raw)
To: Joe Matarazzo; +Cc: 5013
Joe Matarazzo <joe.matarazzo@gmail.com> writes:
> Severity: wishlist
> Tags: patch
>
> [ Resent from
> http://lists.gnu.org/archive/html/emacs-devel/2009-11/msg00426.html ]
>
> Hi - I've attached both a patch file and the modified version.
>
> I look forward to any feedback you might have to offer.
[...]
> ;;; hideif.el --- hides selected code within ifdef
>
> ;; Copyright (C) 1988, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
> ;; Free Software Foundation, Inc.
Included was the entire changed version of hideif.el, so it's difficult
to review. If this is still an issue all these years later, could you
submit a patch instead?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#5013: Enhancement to hideif.el
[not found] ` <fp1vjqnlet.fsf@fencepost.gnu.org>
2011-03-01 4:31 ` bug#5013: Enhancement to hideif.el Tony Hecker
2016-02-28 6:34 ` Lars Ingebrigtsen
@ 2016-02-29 2:26 ` Lars Ingebrigtsen
2 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2016-02-29 2:26 UTC (permalink / raw)
To: Joe Matarazzo; +Cc: 5013
Joe Matarazzo <joe.matarazzo@gmail.com> writes:
> (defun hif-ifdef-to-endif ()
> - "If positioned at #ifX or #else form, skip to corresponding #endif."
> + "If positioned at #ifX, #elif, or #else form, skip to corresponding #endif."
> ;; (message "hif-ifdef-to-endif at %d" (point)) (sit-for 1)
> (hif-find-next-relevant)
> (cond ((hif-looking-at-ifX)
> (hif-ifdef-to-endif) ; find endif of nested if
> (hif-ifdef-to-endif)) ; find outer endif or else
> + ((hif-looking-at-elif)
> + (hif-ifdef-to-endif))
> ((hif-looking-at-else)
> (hif-ifdef-to-endif)) ; find endif following else
> ((hif-looking-at-endif)
> @@ -585,11 +590,14 @@
> (cond ((hif-looking-at-endif)
> (hif-endif-to-ifdef) ; find beginning of nested if
> (hif-endif-to-ifdef)) ; find beginning of outer if or else
> + ((hif-looking-at-elif)
> + (hif-endif-to-ifdef))
> ((hif-looking-at-else)
> (hif-endif-to-ifdef))
> ((hif-looking-at-ifX)
> 'done)
> - (t))) ; never gets here
> + (t
> + (error "Mismatched #endif")))) ; never gets here
This looks very much like the code currently in hideif.el, so I guess
this was applied already? Closing.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread