emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: David Maus <maus.david@gmail.com>
To: Chao Lu <loochao@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Org-style outline
Date: Fri, 12 Feb 2010 09:47:12 +0100	[thread overview]
Message-ID: <87r5oqx2lr.wl%maus.david@gmail.com> (raw)
In-Reply-To: <3cbb63d01002112138l2a10bbfk60e12e1034bfc418@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4309 bytes --]

Hi Chao,

At Fri, 12 Feb 2010 00:38:42 -0500,
Chao Lu wrote:
>
> Dear all,
>
> I'm writing to see if there's anyway to use org-like outline in ALL
> kinds of files, like my emacs configuration file, whose suffix is
> .el. Could I tell Emacs
>
> ;;; headline 1
> ;; headline 2
>
> And it begin to have the ability to display my el file just as Org
> does?
>

I don't think so.

First, on Major Modes:

If you edit a particular sort of text (.el - elisp source code or .org
- orgmode text files) Emacs uses a so called /Major Mode/ that "tells"
Emacs about the common structure of these kind of files and contains
helpful functions to edit such a file. You may think of the Major
Modes as a collection of functions that define the /structure/ of a
particular kind of files (elisp source, c++ source etc.) and the
/meaning/ of the structures.

The assumption thereby is, that if you edit a file you are editing a
special kind or class of a text file -- and that all classes of
text files are distinct from each other. So an Orgmode file and an
elisp source file are both text files but of distinct classes -- that
is: of distinct structure with distinct meaning.

Quoting from the section on Major Modes in the Emacs manual[1]

,----
| Emacs provides many alternative major modes, each of which customizes
| Emacs for editing text of a particular sort. The major modes are
| mutually exclusive, and each buffer has one major mode at any time.
`----

Having Orgmode's outline functions in all classes of files may seem as
a good idea on the first glance but is nothing one could implement
/without limiting the functionality of Emacs itself/. Why? Because
enabling Orgmode's outline functions for all classes of texts is equal
to making Orgmode the superclass of all classes. And this in turn
means that every (!) subclass has to take structure and meaning of
Orgmode's outline into account, that is: MUST define functions that
handle outline functionality -- whether it is useful for this
particular subclass or not.

In contrast the power of Emacsen lies in having raw text files and
hence the /simplest/ form of text files as superclass providing only
functions for the "basic stuff" (e.g. character encoding). This gives
us the freedom to work on files as we like and need. The only thing a
developer of a new Major Mode has to deal with is the smallest
possible set of functions, necessary to deal with text files.

So even if it is technically possible to make Orgmode's outline
functions available in all other modes it would require either to take
in account all ways text files are or could be handled in past,
present and future (impossible) or to impose harsh limitations (read:
break) all existing modes because we would (re)define structure and
meaning for all these modes.

Second, Orgmode as superclass:

On the other hand in certain circumstances it would be extremely useful
to enable Orgmode's features for, say, programming or maintaining a
configuration file. And thanks to the aforementioned freedom Emacsen
give, it is possible to personally use Orgmode as kind of a superclass
for /your/ files.

There is this incredible piece of software called: Org-babel[2]:

,----
| Org-babel extends the very excellent Org-mode with the ability to
| execute source code within Org-mode documents. Org-mode is an Emacs
| major mode for doing almost anything with plain text. If you are not
| familiar with Org-mode please take a moment to read the Org-mode
| homepage before continuing.
`----

And the introduction[3] deals with your wish, maintaining source code
with the help of Orgmode, especially "embedding your Emacs
initialization into Org-mode files".[4]


Third:

> Besides, is there any active mailing list of common Emacs questions?

There is: help-gnu-emacs@gnu.org[5]

HTH
 -- David

[1] http://www.gnu.org/software/emacs/manual/html_node/emacs/Major-Modes.html

[2] http://orgmode.org/worg/org-contrib/babel/index.php

[3] http://orgmode.org/worg/org-contrib/babel/intro.php

[4] Of course using Orgmode/Org-babel to facilitate your coding means
accepting the limitations Orgmode/Org-babel -- as this is a different
topic this is just a hint.

[5] http://www.gnu.org/software/emacs/#HelpMailing
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... maus.david@gmail.com

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-02-12  8:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-12  5:38 Org-style outline Chao Lu
2010-02-12  8:47 ` David Maus [this message]
2010-02-12 10:31   ` Giovanni Ridolfi
2010-02-12 10:53   ` Giovanni Ridolfi
2010-02-12 16:14 ` Thomas S. Dye

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87r5oqx2lr.wl%maus.david@gmail.com \
    --to=maus.david@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=loochao@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).