From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Org-style outline Date: Fri, 12 Feb 2010 09:47:12 +0100 Message-ID: <87r5oqx2lr.wl%maus.david@gmail.com> References: <3cbb63d01002112138l2a10bbfk60e12e1034bfc418@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============1956807232==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfrBR-000547-EI for emacs-orgmode@gnu.org; Fri, 12 Feb 2010 03:47:29 -0500 Received: from [140.186.70.92] (port=51587 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfrBQ-00052r-EH for emacs-orgmode@gnu.org; Fri, 12 Feb 2010 03:47:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NfrBK-0006d0-SN for emacs-orgmode@gnu.org; Fri, 12 Feb 2010 03:47:28 -0500 Received: from fg-out-1718.google.com ([72.14.220.157]:2246) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NfrBK-0006cf-Kd for emacs-orgmode@gnu.org; Fri, 12 Feb 2010 03:47:22 -0500 Received: by fg-out-1718.google.com with SMTP id l26so653081fgb.12 for ; Fri, 12 Feb 2010 00:47:21 -0800 (PST) In-Reply-To: <3cbb63d01002112138l2a10bbfk60e12e1034bfc418@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Chao Lu Cc: emacs-orgmode@gnu.org --===============1956807232== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Fri_Feb_12_09:47:09_2010-1"; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Fri_Feb_12_09:47:09_2010-1 Content-Type: text/plain; charset=US-ASCII 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 --pgp-sign-Multipart_Fri_Feb_12_09:47:09_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkt1FZAACgkQma24O1pEeObGzAD+JZnYdglcbKkl2M9h1kQHpX1p 3LIe+6pPJQ94E6Gk0FUBAJjdkwsbjq2YrMDOoGoT3V3OtY2fja+wxukyH+9pzM0s =L5uq -----END PGP SIGNATURE----- --pgp-sign-Multipart_Fri_Feb_12_09:47:09_2010-1-- --===============1956807232== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1956807232==--