From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Heuristics for: is a major-mode a "programming language" mode? Date: Wed, 15 Sep 2010 23:12:00 +1000 Organization: Unlimited download news at news.astraweb.com Message-ID: <87tylrup5r.fsf@puma.rapttech.com.au> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291873190 22799 80.91.229.12 (9 Dec 2010 05:39:50 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 05:39:50 +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:39:43 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 1PQZED-0001J7-OS for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 06:39:41 +0100 Original-Received: from localhost ([127.0.0.1]:39139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQZED-0003dT-10 for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 00:39:41 -0500 Original-Path: usenet.stanford.edu!news.glorb.com!news2.glorb.com!news.alt.net!news.astraweb.com!border2.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:lwDv0VtFSph+0lsdZV4kIdtvefI= Original-Lines: 31 Original-NNTP-Posting-Host: 691261ac.news.astraweb.com Original-X-Trace: DXC=B6ZMF9PVQNKc3B4XnEnO9AL?0kYOcDh@Ji=VFiPm?<[E]4KQVDL7O?dKPB Original-Xref: usenet.stanford.edu gnu.emacs.help:181325 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:76751 Archived-At: Ilya Zakharevich writes: > 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? > > Thanks, > Ilya > > P.S. In addition to sexp/sentence and function/paragraph, are there > other "merges" one can do to do navigation? Hi Ilya, Not sure if this will help, but in current emacs 24, there is note in the NEWS file about a new mode called prog-mode, which is supposed to be a parent mode for programming modes. I believe the supplied prog modes in emacs have/are being updated to be derived from this mode. The main role of this mode appears to be to run the hook prog-mode-hook. Maybe this could be useful? Tim -- tcross (at) rapttech dot com dot au