From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Roberto Huelga Newsgroups: gmane.emacs.help Subject: Re: Abbrev , as ,_ Date: Thu, 30 Oct 2003 15:46:56 +0100 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1067525825 26451 80.91.224.253 (30 Oct 2003 14:57:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 30 Oct 2003 14:57:05 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Oct 30 15:57:03 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AFEER-00071F-00 for ; Thu, 30 Oct 2003 15:57:03 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFED1-0001Gt-6X for geh-help-gnu-emacs@m.gmane.org; Thu, 30 Oct 2003 09:55:35 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AFE6k-0006S7-B3 for help-gnu-emacs@gnu.org; Thu, 30 Oct 2003 09:49:06 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AFE5P-0005Pl-UQ for help-gnu-emacs@gnu.org; Thu, 30 Oct 2003 09:48:15 -0500 Original-Received: from [207.155.248.9] (helo=warspite.cnchost.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AFE5P-0004zo-Cd for help-gnu-emacs@gnu.org; Thu, 30 Oct 2003 09:47:43 -0500 Original-Received: from multinterior.com (62-14-212-119.es.jazztelbone.net [62.14.212.119]) by warspite.cnchost.com id JAA22022; Thu, 30 Oct 2003 09:47:07 -0500 (EST) [ConcentricHost SMTP Relay 1.15] Original-To: help-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.552) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13644 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13644 El Jueves, 30 octubre, 2003, a las 05:27 AM, Dan Anderson escribi=F3: > Out of curiosity, wouldn't that mean that typing in: > > foo =3D "1,2,3,4,5"; > > Would create: > > foo =3D "1, 2, 3, 4, 5"; > > And cause problems? Granted many times commas and spaces go hand in > hand, but in scenarios like a CSV list it would be horribly wrong. > > -Dan Here is the solution, it don't expand in comments, strings and others=20 contexts. (define-key c-mode-map "," (lambda () (interactive) (let* ((face (get-text-property (point) 'face ))) (if (or (equal face 'font-lock-comment-face) (equal face 'font-lock-string-face) (equal face 'font-lock-warning-face) (equal face 'font-lock-doc-face)) (insert ",") (insert ", ") ))))