* Org-style outline
@ 2010-02-12 5:38 Chao Lu
2010-02-12 8:47 ` David Maus
2010-02-12 16:14 ` Thomas S. Dye
0 siblings, 2 replies; 5+ messages in thread
From: Chao Lu @ 2010-02-12 5:38 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 386 bytes --]
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?
Besides, is there any active mailing list of common Emacs questions?
Any suggestion is welcomed, thanks!
Chao
[-- Attachment #1.2: Type: text/html, Size: 441 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Org-style outline
2010-02-12 5:38 Org-style outline Chao Lu
@ 2010-02-12 8:47 ` David Maus
2010-02-12 10:31 ` Giovanni Ridolfi
2010-02-12 10:53 ` Giovanni Ridolfi
2010-02-12 16:14 ` Thomas S. Dye
1 sibling, 2 replies; 5+ messages in thread
From: David Maus @ 2010-02-12 8:47 UTC (permalink / raw)
To: Chao Lu; +Cc: emacs-orgmode
[-- 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Org-style outline
2010-02-12 8:47 ` David Maus
@ 2010-02-12 10:31 ` Giovanni Ridolfi
2010-02-12 10:53 ` Giovanni Ridolfi
1 sibling, 0 replies; 5+ messages in thread
From: Giovanni Ridolfi @ 2010-02-12 10:31 UTC (permalink / raw)
To: David Maus; +Cc: Chao Lu, emacs-orgmode
David Maus <maus.david@gmail.com> writes:
> At Fri, 12 Feb 2010 00:38:42 -0500,
> Chao Lu wrote:
>>
>> 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.
I think so, is a FAQ:
http://orgmode.org/faq.html#sec-1.2
cheers,
Giovanni
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Org-style outline
2010-02-12 8:47 ` David Maus
2010-02-12 10:31 ` Giovanni Ridolfi
@ 2010-02-12 10:53 ` Giovanni Ridolfi
1 sibling, 0 replies; 5+ messages in thread
From: Giovanni Ridolfi @ 2010-02-12 10:53 UTC (permalink / raw)
To: David Maus; +Cc: Chao Lu, emacs-orgmode
David Maus <maus.david@gmail.com> writes:
> 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.
Sorry for my previous email. I still think so:
please have a look at:
http://www.emacswiki.org/emacs/OrgMode Specific Tasks
Org Mode can be easily configured to help edit Wikipedia articles
by changing outline-regexp in the mode hook:
(add-hook 'org-mode-hook '(lambda () (setq outline-regexp "=+")))
If you use WThreeM, add the following instead:
(setq w3m-form-textarea-edit-mode 'org-mode)
(add-hook 'w3m-form-input-textarea-mode-hook
'(lambda nil
(setq outline-regexp "=+")))
and a look at
http://www.emacswiki.org/emacs/OutlineMode Customizing Heading Definition
may give some suggestions.
cheers,
Giovanni
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Org-style outline
2010-02-12 5:38 Org-style outline Chao Lu
2010-02-12 8:47 ` David Maus
@ 2010-02-12 16:14 ` Thomas S. Dye
1 sibling, 0 replies; 5+ messages in thread
From: Thomas S. Dye @ 2010-02-12 16:14 UTC (permalink / raw)
To: Chao Lu; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1104 bytes --]
On Feb 11, 2010, at 7:38 PM, 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?
>
> Besides, is there any active mailing list of common Emacs questions?
>
> Any suggestion is welcomed, thanks!
>
> Chao
Aloha Chao,
Org-babel lets you keep source code for many languages in Org-mode
files. You have to tangle the Org-mode file to create the source code
file, so there are some intermediate steps, but it does bring many of
the advantages of Org-mode to editing and maintaining source code in
other languages. The Org-babel Introduction includes an example of
how to manage an emacs configuration in Org-mode:
http://orgmode.org/worg/org-contrib/babel/intro.php#literate-programming
Eric Schulte has an emacs starter kit with a very useful
implementation of this idea:
http://eschulte.github.com/emacs-starter-kit/
hth,
Tom
[-- Attachment #1.2: Type: text/html, Size: 1625 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-02-12 16:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-12 5:38 Org-style outline Chao Lu
2010-02-12 8:47 ` David Maus
2010-02-12 10:31 ` Giovanni Ridolfi
2010-02-12 10:53 ` Giovanni Ridolfi
2010-02-12 16:14 ` Thomas S. Dye
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).