From: Dan Nicolaescu <dann@ics.uci.edu>
Cc: Thien-Thi Nguyen <ttn@gnu.org>, JD Smith <jdsmith@as.arizona.edu>,
emacs-devel@gnu.org
Subject: Re: [jdsmith@as.arizona.edu: HideShow Click to show/hide]
Date: Mon, 27 Nov 2006 09:53:48 -0800 [thread overview]
Message-ID: <200611271753.kARHro58015420@oogie-boogie.ics.uci.edu> (raw)
In-Reply-To: <E1GmQMc-000645-KR@fencepost.gnu.org> (Richard Stallman's message of "Tue\, 21 Nov 2006 02\:48\:18 -0500")
Richard Stallman <rms@gnu.org> writes:
> Would you please tell us what to do here?
I think the patch is OK. JD can you please install it?
--dan
> From: JD Smith <jdsmith@as.arizona.edu>
> Subject: HideShow Click to show/hide
> To: emacs-devel@gnu.org
> Date: Mon, 20 Nov 2006 14:30:27 -0700
>
> HideShow seems to have an issue when collapsing blocks, in C or
> elsewhere, with Shift-mouse-2. Consider this:
>
> int main(int argc, char argv[]) {
> int i=0;
> for (i=0;i<5;i++) {
> printf("Got %d\n",i);
> }
> }
>
> Shift-Middle clicking anywhere after the first brace at the end of main
> properly produces:
>
> int main(int argc, char argv[]) {...
>
> S-mouse-2 on that line anywhere again unfolds it. But now in the for
> statement:
>
> int main(int argc, char argv[]) {
> int i=0;
> for (i=0;i<5;i++) {...
> }
>
> There is nowhere you can Shift-click to recover the for block. It
> always collapses the main block instead. The only reason it worked in
> the main case is because it was the outermost block, so it can't find
> a prior block to collapse.
>
> I believe a simple change to first move to the end of the line should
> fix this:
>
> *** hideshow.el 10 Feb 2006 02:00:30 -0700 1.58
> - --- hideshow.el 26 Oct 2006 12:49:10 -0700
> ***************
> *** 706,711 ****
> - --- 706,712 ----
> (if (and c-reg (nth 0 c-reg))
> ;; point is inside a comment, and that comment is hidable
> (goto-char (nth 0 c-reg))
> + (end-of-line)
> (when (and (not c-reg)
> (hs-find-block-beginning)
> (looking-at hs-block-start-regexp))
>
>
> This isn't really perfect, because it doesn't work naturally for continued
> lines before the block, e.g.
>
> int main(int argc, char argv[]) {
> int i=0;
> for (i=0;i<5;i++)
> {
> printf("Got %d\n",i);
> }
> }
>
> Really you'd want uncollapse the block below point if point is on a
> continued line (like the for... above) which begins the block. Not
> sure of an easy way to do this, but this simple fix at least gives you
> *somewhere* to click (on the line with the ellipsis).
>
> JD
>
>
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
> ----------
next prev parent reply other threads:[~2006-11-27 17:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-21 7:48 [jdsmith@as.arizona.edu: HideShow Click to show/hide] Richard Stallman
2006-11-22 2:11 ` JD Smith
2006-11-23 2:51 ` Richard Stallman
2006-11-27 17:53 ` Dan Nicolaescu [this message]
2006-11-27 20:29 ` JD Smith
2006-11-28 17:49 ` Richard Stallman
2006-11-28 18:28 ` JD Smith
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200611271753.kARHro58015420@oogie-boogie.ics.uci.edu \
--to=dann@ics.uci.edu \
--cc=emacs-devel@gnu.org \
--cc=jdsmith@as.arizona.edu \
--cc=ttn@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).