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:43:57 +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 1291869920 11810 80.91.229.12 (9 Dec 2010 04:45:20 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 04:45:20 +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 05:45:13 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 1PQYNV-0000XA-2h for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 05:45:13 +0100 Original-Received: from localhost ([127.0.0.1]:48475 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQYNU-0002Zb-9b for geh-help-gnu-emacs@m.gmane.org; Wed, 08 Dec 2010 23:45:12 -0500 Original-Path: usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!news2.euro.net!feeder.news-service.com!85.214.198.2.MISMATCH!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Lines: 20 Injection-Date: Thu, 16 Sep 2010 23:43:57 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="LlLjF8LevGdIZWbTvv+SXA"; logging-data="3144"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jgcD8fZTVk2hOGOwkW3g+" User-Agent: slrn/0.9.8.1pl1 (Linux) Cancel-Lock: sha1:8lJ+jU5QIMCbVsY60cxsc/QQ0zU= Original-Xref: usenet.stanford.edu gnu.emacs.help:181344 comp.emacs:100507 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:76672 Archived-At: On 2010-09-15, Stefan Monnier wrote: >>> 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? > > BTW, it occurred to me that maybe checking indent-line-function is > a good way to figure out whether the current mode is a programming mode. That's a cool idea! Now I need to check emacs v19-24 and see what is/was the default value for this. ;-) > In theory we already have 2 commands to do that: > - indent-region (C-M-\): works well in practice, but limited to > re-indenting; i.e. it won't add/remove newlines. It will. At least in CPerl, if the user desires (configurable). Thanks, Ilya