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: Wed, 6 Oct 2004 14:32:58 -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: multipart/mixed; boundary="----=_NextPart_000_002E_01C4ABB1.600AFB30" X-Trace: sea.gmane.org 1097098443 17721 80.91.229.6 (6 Oct 2004 21:34:03 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Oct 2004 21:34:03 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 06 23:33:51 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 1CFJPy-0004zp-00 for ; Wed, 06 Oct 2004 23:33:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFJWg-00049o-AM for ged-emacs-devel@m.gmane.org; Wed, 06 Oct 2004 17:40:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CFJWX-00049j-M9 for emacs-devel@gnu.org; Wed, 06 Oct 2004 17:40:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CFJWX-00049T-5i for emacs-devel@gnu.org; Wed, 06 Oct 2004 17:40:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CFJWX-00049J-13 for emacs-devel@gnu.org; Wed, 06 Oct 2004 17:40:37 -0400 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CFJPC-00009q-RC for emacs-devel@gnu.org; Wed, 06 Oct 2004 17:33:03 -0400 Original-Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.191.10]) by agminet01.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i96LWxUj010034 for ; Wed, 6 Oct 2004 14:33:00 -0700 Original-Received: from rgmgw1.us.oracle.com (localhost [127.0.0.1]) by rgmgw1.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with ESMTP id i96LWxb5019808 for ; Wed, 6 Oct 2004 15:32:59 -0600 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmgw1.us.oracle.com (Switch-3.1.4/Switch-3.1.0) with SMTP id i96LWxoF019789 for ; Wed, 6 Oct 2004 15:32:59 -0600 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 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:28007 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:28007 This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C4ABB1.600AFB30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Here's an updated patch, which replaces the previous one. It does everything the previous version did, but also correctly treats some of the common pbs I saw yesterday, such as `\' and `C-\'. In fact, it just allows _any_ character (except ') inside `...'. Sorry about sending two patches. I don't expect to change this again. - Drew From: Drew Adams [mailto:drew.adams@oracle.com] Here's the patch to info.el that highlights `...' and "...". ------=_NextPart_000_002E_01C4ABB1.600AFB30 Content-Type: text/plain; name="diff-info-highlight-quotations-second.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="diff-info-highlight-quotations-second.txt" cd c:/drews-lisp-20/=0A= diff -c "c:/emacs-21.3.50/lisp/info.el" = "c:/drews-lisp-20/info-w-quotes-second.el"=0A= *** c:/emacs-21.3.50/lisp/info.el Mon Jul 26 09:42:06 2004=0A= --- c:/drews-lisp-20/info-w-quotes-second.el Wed Oct 6 13:51:18 2004=0A= ***************=0A= *** 65,70 ****=0A= --- 65,91 ----=0A= The Lisp code is executed when the node is selected.")=0A= (put 'Info-enable-active-nodes 'risky-local-variable t)=0A= =0A= + (defcustom Info-fontify-quotations-flag t=0A= + "*Non-nil means `info' fontifies text between quotes.=0A= + This applies to double-quote strings (\"...\") and text between=0A= + single-quotes (`...')."=0A= + :type 'boolean=0A= + :group 'info)=0A= + =0A= + (defface info-quoted-name=0A= + '((((class color) (background light)) :foreground "red3")=0A= + (((class color) (background dark)) :foreground "white")=0A= + (t :weight bold :slant italic))=0A= + "Face used for quoted names (`...') in `info'."=0A= + :group 'info)=0A= + =0A= + (defface info-string=0A= + '((((class color) (background light)) :foreground "green4")=0A= + (((class color) (background dark)) :foreground "yellow")=0A= + (t :slant italic))=0A= + "Face used for strings (\"...\") in `info'."=0A= + :group 'info)=0A= + =0A= (defface info-node=0A= '((((class color) (background light)) :foreground "brown" :weight = bold :slant italic)=0A= (((class color) (background dark)) :foreground "white" :weight = bold :slant italic)=0A= ***************=0A= *** 3669,3676 ****=0A= '(font-lock-face info-xref=0A= mouse-face highlight=0A= help-echo "mouse-2: go = to this URL"))))=0A= ! =0A= (set-buffer-modified-p nil))))=0A= =0C=0A= =0A= ;; When an Info buffer is killed, make sure the associated tags buffer=0A= --- 3690,3721 ----=0A= '(font-lock-face info-xref=0A= mouse-face highlight=0A= help-echo "mouse-2: go = to this URL"))))=0A= ! (goto-char (point-min))=0A= ! (when Info-fontify-quotations-flag (info-fontify-quotations))=0A= (set-buffer-modified-p nil))))=0A= + =0A= + =0A= + ;; The regexp has these parts: double-quoted string or single-quoted = stuff.=0A= + ;;=0A= + ;; String has, inside "...", zero or more of these characters:=0A= + ;; - any character except \ and "=0A= + ;; - \ followed by any character=0A= + ;;=0A= + ;; Single-quoted stuff has, inside `...': any character except '=0A= + ;;=0A= + (defun info-fontify-quotations ()=0A= + "Fontify double-quote strings (\"...\") and text between = single-quotes (`...')=0A= + For single-quotes, use face `info-quoted-name'.=0A= + For double-quotes, use face `info-string'."=0A= + (while=0A= + (re-search-forward=0A= + "\"\\(?:[^\\\"]\\|\\\\\\(?:.\\|[\n]\\)\\)*\"\\|`[^']+'"=0A= + nil t)=0A= + (if (eq ?` (aref (match-string 0) 0))=0A= + (put-text-property (1+ (match-beginning 0)) (1- (match-end = 0))=0A= + 'face 'info-quoted-name)=0A= + (put-text-property (match-beginning 0) (match-end 0)=0A= + 'face 'info-string))))=0A= =0C=0A= =0A= ;; When an Info buffer is killed, make sure the associated tags buffer=0A= =0A= Diff finished at Wed Oct 06 13:51:40=0A= ------=_NextPart_000_002E_01C4ABB1.600AFB30 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_NextPart_000_002E_01C4ABB1.600AFB30--