all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: Abbrev , as ,_
@ 2003-10-30 14:46 Roberto Huelga
  0 siblings, 0 replies; 5+ messages in thread
From: Roberto Huelga @ 2003-10-30 14:46 UTC (permalink / raw)



El Jueves, 30 octubre, 2003, a las 05:27 AM, Dan Anderson escribió:

> Out of curiosity, wouldn't that mean that typing in:
>
> foo = "1,2,3,4,5";
>
> Would create:
>
> foo = "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 
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 ", ")
       ))))

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Abbrev , as ,_
@ 2003-10-30  0:27 Jiri Pejchal
  2003-10-30  1:27 ` Jesper Harder
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Pejchal @ 2003-10-30  0:27 UTC (permalink / raw)



When I code in Java or C++ I always type space after ",".
For example foo(a, f)
                  ^                
                  |
                  
Can Emacs put the space there automatically?
I tried to make an abbrev for it, but it didn't work for me.


--
Jiri Pejchal

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-10-30 17:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2813.1067525348.21628.help-gnu-emacs@gnu.org>
2003-10-30 17:06 ` Abbrev , as ,_ Stefan Monnier
2003-10-30 14:46 Roberto Huelga
  -- strict thread matches above, loose matches on Subject: below --
2003-10-30  0:27 Jiri Pejchal
2003-10-30  1:27 ` Jesper Harder
2003-10-30  4:27   ` Dan Anderson

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.