Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!NSWC-OAS.ARPA!dsill From: dsill@NSWC-OAS.ARPA (Dave Sill) Newsgroups: comp.emacs Subject: Re: Hiding comments in C mode Message-ID: <8801251758.AA13325@ucbvax.Berkeley.EDU> Date: 25 Jan 88 17:47:57 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 87 In article <17561@topaz.rutgers.edu> Silver writes: >Check out outline-mode, and see if it's capable of doing what you >want. I think that if you define outline-regexp carefully, you might >just pull it off, and then you'll have a lot of functionality. I don't lisp. One of these days I'll convince myself to learn. >To be honest, I wonder at the original request. You want to hide the >comments, and not the code? Right. For example: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #define TRUE 1 /* For function return values only */ #define FALSE 0 /* For fn returns or comparisons */ int foo (x) int x; /* Input, number of widgets */ { /* This function blah blah blah... : Returns TRUE if blah blah blah... /* int n; register char *s; : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ would be displayed as: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #define TRUE 1 /* */ #define FALSE 0 /* */ int foo (x) int x; /* */ { /* */ int n; register char *s; : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >Are they especially rude and offensive, or do I just not [see] the >reasoning? They're neither rude nor offensive, just in the way at the moment. A fringe benefit would be that unclosed comments would be easier to spot. E.g.: : x=y/*z; *z=foo(y); /* blah blah blah... */ : would display as: : x=y/* */ : making the unintentional /* more obvious. (Of course appropriate white-space would have prevented the problem in the first place.) There should be the following commands: c-hide-comment c-expose-comment c-hide-comments-region c-expose-comments-region c-hide-all-comments c-expose-all-comments and maybe more. Of course, writing out a C-mode buffer should be automatically preceded by a call to c-expose-all-comments. It would be nice if attempts to modify a "/* */" automatically called c-expose-comment. ========= The opinions expressed above are mine. "There's no sensation to compare with this/ Suspended animation, state of bliss." -- Pink Floyd