From mboxrd@z Thu Jan 1 00:00:00 1970 From: S.P.Tseng Subject: Fwd: Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error Date: Sun, 7 Sep 2008 20:38:20 +0800 Message-ID: References: <85fxpqecss.fsf@modprobe.cn> <87hca65kmo.fsf@gollum.intra.norang.ca> <851w16e23i.fsf@modprobe.cn> <61B03E1B-7CD3-422F-B7CD-7414EC604CB4@uva.nl> <851vzw3zm9.fsf@modprobe.cn> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0217805733==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KcJX8-0004Aw-3A for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 08:38:26 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KcJX5-0004AA-2Y for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 08:38:24 -0400 Received: from [199.232.76.173] (port=41861 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KcJX4-00049n-BB for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 08:38:22 -0400 Received: from an-out-0708.google.com ([209.85.132.247]:60758) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KcJX3-0004th-Ra for emacs-orgmode@gnu.org; Sun, 07 Sep 2008 08:38:22 -0400 Received: by an-out-0708.google.com with SMTP id c38so171145ana.84 for ; Sun, 07 Sep 2008 05:38:20 -0700 (PDT) In-Reply-To: <851vzw3zm9.fsf@modprobe.cn> 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: emacs-orgmode@gnu.org --===============0217805733== Content-Type: multipart/alternative; boundary="----=_Part_57590_13295131.1220791100589" ------=_Part_57590_13295131.1220791100589 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline ---------- Forwarded message ---------- From: S. P. Tseng Date: Sun, Sep 7, 2008 at 8:32 PM Subject: Re: [Orgmode] Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error To: Carsten Dominik I think you misunderstand me. I never want to let the indentation function in Org apply to the entire file. The key '' default bind to functon 'org-cycle'. For example I press 'C-c '' in side SRC block as below, and edit, you know they can ident correctly and press 'C-c '' to back. Move cursor to line 4, press the TAB key, now the first "(" will auto move to the beginning of the line so I say indent will not be right. What I mean is when the cursor in side SRC block, press '' key do nothin. So I can write a function to indent the entire file. 1 #+BEGIN_SRC emacs-lisp 2 (defun org-xor (a b) 3 "Exclusive or." 4 (if a (not b) b)) <-------------- 5 #+END_SRC >>> Carsten Dominik writes: > Hi Tseng, > > I don't think the indentation function in Org is good enough to apply it to the entire file anyway, so no action on this > thread. Sorry. > > - Carsten > > On Aug 3, 2008, at 2:04 PM, S.P.Tseng wrote: > >> Bernt Hansen writes: >> >>> S.P.Tseng writes: >>> >>>> 2. Press tab at the line "Exclusive or.", indent error. >>>> #+BEGIN_SRC emacs-lisp >>>> (defun org-xor (a b) >>>> "Exclusive or." >>>> (if a (not b) b)) >>>> #+END_SRC >>> >>> Switch to the appropriate mode first with C-c ' anywhere inside the SRC >>> block and then indent works fine. You switch back to org-mode with >>> another C-c ' >> >> In fact I want to stop org-mode treat [[xxxx.xx][xxxx]] as link with >> #+BEGIN_EXAMPLE and #+END_EXAMPLE just like ":". >>> >>> I don't think it's reasonable that org-mode should know all of the >>> indentation requirements for all other modes. >> >> I do not mean org-mode should know all of the indentation requirements for all >> other modes. I think the code between #+BEGIN_SRC and #+END_SRC is better to >> stop indent when I press Tab in them. >> >> Then I can use follow code two indent the whole buffer. >> ,---- >> | (defun iwb () >> | "indent whole buffer" >> | (interactive) >> | (delete-trailing-whitespace) >> | (indent-region (point-min) (point-max) nil) >> | (untabify (point-min) (point-max))) >> `---- >> >> For the moment, If I use the function iwb to indent the whole buffer, the indent >> of the code between #+BEGIN_SRC and #+END_SRC will be destroy. >> >> >> >> _______________________________________________ >> Emacs-orgmode mailing list >> Remember: use `Reply All' to send replies to the list. >> Emacs-orgmode@gnu.org >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > -- The opposite of love is not hate; the opposite of love is solitude. ------=_Part_57590_13295131.1220791100589 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline


---------- Forwarded message ----------
From: S. P. Tseng <deftsp@gmail.com>
Date: Sun, Sep 7, 2008 at 8:32 PM
Subject: Re: [Orgmode] Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
To: Carsten Dominik <dominik@science.uva.nl>



I think you misunderstand me.

I never want to let the indentation function in Org apply to the entire file.
The key '<tab>' default bind to functon 'org-cycle'. For example I press 'C-c ''
in side SRC block as below, and edit, you know they can ident correctly and
press 'C-c '' to back. Move cursor to line 4, press the TAB key, now the first
"(" will auto move to the beginning of the line so I say indent will not be
right.

What I mean is when the cursor in side SRC block, press '<tab>' key do nothin.
So I can write a function to indent the entire file.

1 #+BEGIN_SRC emacs-lisp
2 (defun org-xor (a b)
3   "Exclusive or."
4   (if a (not b) b))   <--------------
5 #+END_SRC


>>>
Carsten Dominik <dominik@science.uva.nl> writes:

> Hi Tseng,
>
> I don't think the indentation function in Org is good enough to apply it to the entire file anyway, so no action on this
> thread.  Sorry.
>
> - Carsten
>
> On Aug 3, 2008, at 2:04 PM, S.P.Tseng wrote:
>
>> Bernt Hansen <bernt@norang.ca> writes:
>>
>>> S.P.Tseng <deftsp@gmail.com> writes:
>>>
>>>> 2. Press tab at the line "Exclusive or.", indent error.
>>>> #+BEGIN_SRC emacs-lisp
>>>> (defun org-xor (a b)
>>>>   "Exclusive or."
>>>>   (if a (not b) b))
>>>> #+END_SRC
>>>
>>> Switch to the appropriate mode first with C-c ' anywhere inside the SRC
>>> block and then indent works fine.  You switch back to org-mode with
>>> another C-c '
>>
>> In fact I want to stop org-mode treat [[xxxx.xx][xxxx]] as link with
>> #+BEGIN_EXAMPLE and #+END_EXAMPLE just like ":".
>>>
>>> I don't think it's reasonable that org-mode should know all of the
>>> indentation requirements for all other modes.
>>
>> I do not mean org-mode should know all of the  indentation requirements for all
>> other modes. I think the code between  #+BEGIN_SRC and  #+END_SRC is better to
>> stop indent when I press Tab in them.
>>
>> Then I can use follow code two indent the whole buffer.
>> ,----
>> | (defun iwb ()
>> |   "indent whole buffer"
>> |   (interactive)
>> |   (delete-trailing-whitespace)
>> |   (indent-region (point-min) (point-max) nil)
>> |   (untabify (point-min) (point-max)))
>> `----
>>
>> For the moment, If I use the function iwb to indent the whole buffer, the indent
>> of the code between  #+BEGIN_SRC and  #+END_SRC will be destroy.
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

--
The opposite of love is not hate;
the opposite of love is solitude.

------=_Part_57590_13295131.1220791100589-- --===============0217805733== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0217805733==--