emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
@ 2008-07-31  7:24 S.P.Tseng
  2008-07-31 12:00 ` Bernt Hansen
  0 siblings, 1 reply; 6+ messages in thread
From: S.P.Tseng @ 2008-07-31  7:24 UTC (permalink / raw)
  To: emacs-orgmode

1. As follow example, [[xxxx.xx][xxxx]] will be subjected to markup. 
,----
| #+BEGIN_EXAMPLE
| [[xxxx.xx][xxxx]]
| #+END_EXAMPLE
`----

However start the example lines with a colon works fine.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
  2008-07-31  7:24 [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error S.P.Tseng
@ 2008-07-31 12:00 ` Bernt Hansen
  2008-08-03 12:04   ` S.P.Tseng
  0 siblings, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2008-07-31 12:00 UTC (permalink / raw)
  To: S.P.Tseng; +Cc: emacs-orgmode

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 '

I don't think it's reasonable that org-mode should know all of the
indentation requirements for all other modes.

-Bernt

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
  2008-07-31 12:00 ` Bernt Hansen
@ 2008-08-03 12:04   ` S.P.Tseng
  2008-09-07  7:09     ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: S.P.Tseng @ 2008-08-03 12:04 UTC (permalink / raw)
  To: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
  2008-08-03 12:04   ` S.P.Tseng
@ 2008-09-07  7:09     ` Carsten Dominik
       [not found]       ` <851vzw3zm9.fsf@modprobe.cn>
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2008-09-07  7:09 UTC (permalink / raw)
  To: S.P.Tseng; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Fwd: Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
       [not found]       ` <851vzw3zm9.fsf@modprobe.cn>
@ 2008-09-07 12:38         ` S.P.Tseng
       [not found]         ` <C13F6320-306D-4B16-8BB1-0F16C35A2B4D@uva.nl>
  1 sibling, 0 replies; 6+ messages in thread
From: S.P.Tseng @ 2008-09-07 12:38 UTC (permalink / raw)
  To: emacs-orgmode


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

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

[-- Attachment #1.2: Type: text/html, Size: 4353 bytes --]

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

_______________________________________________
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Fwd: Re: [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error
       [not found]           ` <85abej31br.fsf@modprobe.cn>
@ 2008-09-08  0:57             ` S.P.Tseng
  0 siblings, 0 replies; 6+ messages in thread
From: S.P.Tseng @ 2008-09-08  0:57 UTC (permalink / raw)
  To: emacs-orgmode


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

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


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

> Well, I am confused.
>
>> I never want to let the indentation function in Org apply to the entire
file.
>
> This was statement 1.
>
>>
>> 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.
>
> And this was statement 2, seems to be the exact oposite. What am I
> misunderstading?

In statement 1, I meant "I never want to let the indentation function *in
Org*
apply to the entire file".

In statement 2, I meant "The function to indent the entire file can be
writed
*by USER*, only if Org-mode's indentation function do nothing when current
line
is in SRC block."

The indentation function Statement 1 is to Org-mode.
The indentation function Statement 2 is to user's.
Are they oposite?

>
> Anyway, the parsing effort to figure out if we are in a SRC or EXAMPLE
region
> is not negligible, and it would burden the indentation function and make
it slow.
>
I have readed the source of funcion 'org-edit-special', that's right the
parsing
effort to figure out if we are is a SRC block or not cost too much. But I
still
think it's worth. In face, I turned from muse, and muse is do like that.

[-- Attachment #1.2: Type: text/html, Size: 2580 bytes --]

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

_______________________________________________
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-09-08  0:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-31  7:24 [bug]x2 #+BEGIN_EXAMPLE can not work and #+BEGIN_SRC indent error S.P.Tseng
2008-07-31 12:00 ` Bernt Hansen
2008-08-03 12:04   ` S.P.Tseng
2008-09-07  7:09     ` Carsten Dominik
     [not found]       ` <851vzw3zm9.fsf@modprobe.cn>
2008-09-07 12:38         ` Fwd: " S.P.Tseng
     [not found]         ` <C13F6320-306D-4B16-8BB1-0F16C35A2B4D@uva.nl>
     [not found]           ` <85abej31br.fsf@modprobe.cn>
2008-09-08  0:57             ` S.P.Tseng

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