emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Jambunathan K <kjambunathan@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BABEL] Seemless editing of Babel Blocks
Date: Tue, 20 Jul 2010 15:58:07 -0700	[thread overview]
Message-ID: <87k4opu5fk.fsf@gmail.com> (raw)
In-Reply-To: <4C459236.3@gmail.com> (Jambunathan K.'s message of "Tue, 20 Jul 2010 17:40:30 +0530")

Hi Jambunathan,

I like the idea of displaying the begin/end_src lines as commented
sections in the org-edit-special code buffer, and then potentially using
them to change the values of the begin/end_src lines in the original
org-mode buffer after exiting the src-edit buffer.  It would be very
cool to be able to edit header arguments while editing source code.  It
may be hard to implement, but could be worth the effort.

I'm afraid I don't see how the code snippet you pasted below could be
applied, could you reformat it as a patch to Org-mode with usage
instructions?

As for different key-bindings for exiting src edit buffers, you could
certainly setup your own in your personal configuration using the
org-src-mode-hook.

Thanks for the neat idea -- Eric

Jambunathan K <kjambunathan@gmail.com> writes:

> I am presenting a code snippet that would make editing of babel blocks
> quite seemless. The editor parallels (inline!) editing of table
> blocks. A suitable variation thereof could be considered for inclusion
> in the core distribution.
>
> Few other suggestions:
> 1. While invoking babel editor, offer babel guard lines as comment
>    blocks in the native mode.
>    
> 2. On saving code blocks, do the reverse.
>    
> For example, in case of emacs-lisp
>    
> #+begin_src emacs_lisp:
> (message "Hello World")
> #+end_src
>
> could be offered as:
>
> ;; begin_src emacs_lisp:
> (message "Hello World")
> ;; end_src
>
> One could then add say a ':tangle ...' directive and have it persisted
> as 
>
> #+begin_src emacs_lisp: :tangle HelloWorld.el
> (message "Hello World")
> #+end_src
>
> 2. Is it possible to do org-edit-src-exit with more 'natural'
>    keybinding like C-x C-w or C-x C-s. Furthermore, C-x C-w could fix
>    up '#+srcname: ' directive as well.
>
>    
> ;; CODE SNIPPET   
>
> ;; make org-cycle look for babel blocks
> ((org-at-babel-p)
>  (call-interactively 'org-edit-special))
>
> ;; A semicolon followed by <TAB> would invoke the babel editor.
> ;; A tab within the babel block would invoke the babel editor.
>
> (defconst org-babel-invoke-editor-regexp "^[ \t]*\\(;\\)"
>   "Detect beginning of babel src code")
>
> (defun org-at-babel-p () 
>   ""
>   (beginning-of-line 1)
>
>   (cond 
>    ((looking-at org-babel-invoke-editor-regexp)
>     (unless  (org-babel-where-is-src-block-head)
>       (insert  "#+begin_src emacs-lisp :\n\n")
>         
>       (insert  "#+end_src")
>       (kill-line)
>       (forward-line  -1)
>       t)
>     )
>
>    ((org-babel-where-is-src-block-head) t)
>    (t nil)
>    )
>   )
>

I have no idea how/where the above could be applied.

>
> _______________________________________________
> 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-07-20 22:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 12:10 [BABEL] Seemless editing of Babel Blocks Jambunathan K
2010-07-20 22:58 ` Eric Schulte [this message]
2010-08-16  8:38   ` Jambunathan K
2010-08-16  9:20     ` [BABEL] [PROPOSAL] " Jambunathan K
2010-09-02 23:41       ` Dan Davison
2010-09-02 23:50         ` Erik Iverson
2010-09-03 19:08         ` Tom Short
2010-09-03 20:45           ` Dan Davison
2010-09-04  8:58         ` Jambunathan K
2010-09-04 15:04           ` Eric Schulte
2010-09-05  9:55             ` Jambunathan K
2010-09-05 15:58               ` Dan Davison
2010-09-05 19:12                 ` Eric Schulte
2010-09-05 20:22               ` Eric Schulte

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=87k4opu5fk.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=kjambunathan@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).