all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: help-gnu-emacs@gnu.org
Subject: Re: Heuristics for: is a major-mode a "programming language" mode?
Date: Fri, 17 Sep 2010 11:50:42 +0200	[thread overview]
Message-ID: <jwv4odohfcm.fsf-monnier+gnu.emacs.help@gnu.org> (raw)
In-Reply-To: slrni95att.l51.nospam-abuse@powdermilk.math.berkeley.edu

>>>> 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.  ;-)

I think that if you ignore indent-relative, indent-relative-maybe, and
indent-to-left-margin, (you can add (default-value
'indent-line-function) to the mix if you want) you'll catch the vast
majority of non-programming modes (at least under Emacs).

>> 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 for the precision,


        Stefan


  reply	other threads:[~2010-09-17  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-15  9:28 Heuristics for: is a major-mode a "programming language" mode? Ilya Zakharevich
2010-09-15 13:12 ` Tim X
2010-09-15 14:27   ` Stefan Monnier
2010-09-15 14:43 ` Xah Lee
2010-09-15 15:08   ` Stefan Monnier
2010-09-15 15:32     ` Xah Lee
2010-09-15 23:22       ` Stefan Monnier
2010-09-16 23:43     ` Ilya Zakharevich
2010-09-17  9:50       ` Stefan Monnier [this message]
2010-09-16 23:40   ` Ilya Zakharevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwv4odohfcm.fsf-monnier+gnu.emacs.help@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.