From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: info faces for strings and quotations Date: Tue, 5 Oct 2004 09:11:02 -0700 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1096992697 12933 80.91.229.6 (5 Oct 2004 16:11:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 5 Oct 2004 16:11:37 +0000 (UTC) Cc: Lennart Borgman , Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 05 18:11:25 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CEruP-0000uq-00 for ; Tue, 05 Oct 2004 18:11:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CEs13-0004or-Cg for ged-emacs-devel@m.gmane.org; Tue, 05 Oct 2004 12:18:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CEs0t-0004mV-Fu for emacs-devel@gnu.org; Tue, 05 Oct 2004 12:18:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CEs0r-0004m1-KR for emacs-devel@gnu.org; Tue, 05 Oct 2004 12:18:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CEs0r-0004lg-JA for emacs-devel@gnu.org; Tue, 05 Oct 2004 12:18:05 -0400 Original-Received: from [141.146.126.229] (helo=agminet02.oracle.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CEruA-0001K3-N4 for emacs-devel@gnu.org; Tue, 05 Oct 2004 12:11:10 -0400 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.191.11]) by agminet02.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i95GB7mw003286; Tue, 5 Oct 2004 09:11:08 -0700 Original-Received: from rgmgw2.us.oracle.com (localhost [127.0.0.1]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i95GB82k004585; Tue, 5 Oct 2004 10:11:08 -0600 Original-Received: from dradamslap (dhcp-amer-csvpn-gw2-141-144-81-47.vpn.oracle.com [141.144.81.47]) by rgmgw2.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id i95GB7bP004548; Tue, 5 Oct 2004 10:11:07 -0600 Original-To: "Stefan" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 In-Reply-To: Importance: Normal X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:27942 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:27942 Thanks for lots of good input, Stephan. You made several good points about the implementation, which I'll put into practice immediately. As you know, in my first message, I used just these (separate) simple regexp searches, which didn't take care of escaped "s but worked 99% of the time: (re-search-forward "`\\([^']+\\)'" nil t) (re-search-forward "\"\\([^\"]+\\)\"" nil t) I mentioned the fact that the regexps could be improved, and Lennart was kind enough to do some coding and testing. He came up with something that solved the escaped "s pb, which I tried and sent along to the list (though I mistakenly left off the non-greedy "?"). I sent the updated code because it improved the functionality, taking care of some corner cases. I'll make the implementation changes you suggest. Besides the implementation issues, you asked this question about the _functionality_: Why fontify the interior of `...' but fontify both the interior and the quotes for "..." ? Is it just because your quoted face is bold and you don't like to see the ` and ' in bold, or is there a deeper reason? Good question. That was by design. In most Info files, `...' is used to identify commands, key sequences, filenames and the like; "..." is used (usually) to identify strings in code. I found that not highlighting the single-quotes and highlighting the double-quotes improved readability. Try different combinations of highlighting the quotes (or not), yourself, and see what you think. My second choice would be to not highlight either kind of delimiter. BTW, I didn't test this with a terminal Emacs; I just threw the bold-italic and italic face attributes in there at the last minute to have something for the non-(class color) case. Do you have a suggestion on what to use in that case? (In fact, just before I sent the email, the version I use had face variables with defvar, which is why I used the names *-face -- a no-no nowadays, as Miles pointed out.) The code will be cleaner & leaner thanks to input from Lennart, Miles, and you. So, what do you and others think of the _desirability_ of (optionally) highlighting quoted expressions in Info? - Drew