From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ilya Zakharevich Newsgroups: gmane.emacs.help Subject: Re: Heuristics for: is a major-mode a "programming language" mode? Date: Thu, 16 Sep 2010 23:40:05 +0000 (UTC) Organization: U.C. Berkeley Math. Department. Message-ID: References: <50407747-1f13-43c4-bb9a-ac53afdeca19@g6g2000pro.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1291873825 24864 80.91.229.12 (9 Dec 2010 05:50:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 05:50:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 06:50:21 2010 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.69) (envelope-from ) id 1PQZOW-0004YI-Lf for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 06:50:20 +0100 Original-Received: from localhost ([127.0.0.1]:60889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQZOV-0006fg-F5 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 00:50:19 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news.ripco.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 21 Injection-Date: Thu, 16 Sep 2010 23:40:05 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="LlLjF8LevGdIZWbTvv+SXA"; logging-data="3144"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19gSwR7oUYCZDiFBllxzWa/" User-Agent: slrn/0.9.8.1pl1 (Linux) Cancel-Lock: sha1:nMDFVYEBl2UCu7ycQ7EqOqfTvF4= Original-Xref: usenet.stanford.edu gnu.emacs.help:181343 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:76760 Archived-At: On 2010-09-15, Xah Lee wrote: > On Sep 15, 2:28 am, Ilya Zakharevich wrote: >> I want a certain keypress act as forward-sexp in "programming >> language" modes, and as forward-sentence (sp?) in other modes >> (likewise for go-to-function-begin (sp?) and forward-paragraph (sp?)). >> >> So there must be some code which decides "which type" is the given >> major mode.  I would prefer the bulk of the decision to be made >> programmatically, THEN let the user override if the auto-choice was >> wrong.  Anyone with ideas how to do this? > > a fool's answer: wouldn't just search for all the [] and {} heuristic > works pretty much? > > most top 10 langs follow c-like syntax, so am guessing checking some > () {} would work out... I'm puzzled: "search for [] {}" WHERE? Thanks, Ilya