From mboxrd@z Thu Jan 1 00:00:00 1970 Path: quimby.gnus.org!not-for-mail From: no-spam@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Idea: Allow faces to have text-like properties Date: 28 Feb 2002 11:25:45 +0100 Message-ID: <5xbse93nti.fsf@kfs2.cua.dk> NNTP-Posting-Host: quimby2.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: quimby2.netfonds.no 1014892309 20271 195.204.10.66 (28 Feb 2002 10:31:49 GMT) X-Complaints-To: usenet@quimby2.netfonds.no NNTP-Posting-Date: 28 Feb 2002 10:31:49 GMT Cc: tzz@beld.net Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby2.netfonds.no with esmtp (Exim 3.12 #1 (Debian)) id 16gNqm-0005Gr-00 for ; Thu, 28 Feb 2002 11:31:48 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.33 #1 (Debian)) id 16gNmO-0007z9-00; Thu, 28 Feb 2002 05:27:16 -0500 Original-Received: from mail.filanet.dk ([195.215.206.179]) by fencepost.gnu.org with smtp (Exim 3.33 #1 (Debian)) id 16gNjx-0007rx-00 for ; Thu, 28 Feb 2002 05:24:45 -0500 Original-Received: from kfs2.cua.dk.cua.dk (kfs2.local.filanet.dk [192.168.1.182]) by mail.filanet.dk (Postfix) with SMTP id D63057C049; Thu, 28 Feb 2002 10:24:39 +0000 (GMT) Original-To: emacs-devel@gnu.org Original-Lines: 64 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: quimby.gnus.org gmane.emacs.devel:1626 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:1626 I saw the article below in comp.emacs, and it got me wondering whether it would make sense for a `face' to have an `invisible' property. That would - among other things, make it very easy to toggle visibility of comments in a buffer by simply changing the `invisible' property of the comment face (or setting font-lock-comment-face to a face derived from the original comment face with the invisible property set). In general, maybe a `face' could have all the normal `text properties' like keymap, invisible, intangible, etc. (except face of course). I don't know whether it is worth any efforts to pursue this, but it might open up some interesting possibilities -- e.g. clicking mouse-3 on a comment will open a pop-up menu with the options to spell check it, refill it, uncomment it, ... That could be achieved simply by adding the keymap property to the comment face. What do you think? ++kfs ------------- comp.emacs article follows ---------------- From: Ted Zlatanov eugene kim writes: > i think i found a lisp package which does what i wanted... > hideshow.. > > but i can't figure out how i can hide/show all comments in buffer.. > could u help a newbie? Hideshow is overkill, I think. You could temporarily set the comment face (a face is like a combination of font size and text color properties as far as the user is concerned) color to be invisible. This may not be the way to achieve the results you were looking for, but the effect will be the same, and likely much easier to do. Put this in your .emacs: (make-face 'fl1-comment-face) ;; comment (set-face-foreground 'fl1-comment-face "white") (set-face-background 'fl1-comment-face "black") (setq font-lock-comment-face 'fl1-comment-face) Bind a key to a lambda function that executes (set-face-foreground 'fl1-comment-face "black") (set-face-background 'fl1-comment-face "black") And another one to a lambda that executes (set-face-foreground 'fl1-comment-face "white") (set-face-background 'fl1-comment-face "black") You can use colors other than black and white, if you wish. The idea is just to make the foreground temporarily invisible by making it the same as the background. Ted _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel