From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.help Subject: Insert appropriate line-end character (like ';' for C*) Date: Tue, 10 Jun 2008 15:11:07 -0700 (PDT) Organization: http://groups.google.com Message-ID: <333b2bc9-8ad4-4f0e-b508-eb143fd9d2fe@c58g2000hsc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213154851 23651 80.91.229.12 (11 Jun 2008 03:27:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Jun 2008 03:27:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 11 05:28:14 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K6H0Q-0004CT-Ah for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jun 2008 05:28:14 +0200 Original-Received: from localhost ([127.0.0.1]:50061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K6Gzc-0003eJ-PY for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Jun 2008 23:27:24 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!c58g2000hsc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 14 Original-NNTP-Posting-Host: 72.85.252.29 Original-X-Trace: posting.google.com 1213135867 32598 127.0.0.1 (10 Jun 2008 22:11:07 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 10 Jun 2008 22:11:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c58g2000hsc.googlegroups.com; posting-host=72.85.252.29; posting-account=altyoAkAAACZyvWAdscIIqznbtG0RJDD User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9) Gecko/2008060517 (Gentoo) Firefox/3.0,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:159339 X-Mailman-Approved-At: Tue, 10 Jun 2008 23:21:55 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54712 Archived-At: I think I've seen this behavior in Emacs somewhere, but I can't remember where and I'm either using the wrong terms when searching or I'm looking in the wrong places because I can't find anything about it. What I'm looking for is a emacs command that inserts the appropriate end-of-line character based on mode. For example, if you're in c-mode or java-mode or whatever it would insert a ';'. Ideally it would be context aware so that if you were in python-mode it would add a ':' where appropriate, but not elsewhere (and even a ',' if you're making a list), but that's not essential. Does this already exist? If not, does anyone have any pointers on how I could go about writing it? The only part I can't figure out is how to determine what the right character is.