emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Thorsten Jolitz <tjolitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC] Org Minor Mode?
Date: Fri, 30 May 2014 16:15:23 +0200	[thread overview]
Message-ID: <87y4xjnyis.fsf@gmail.com> (raw)
In-Reply-To: 87lhtj8j8t.fsf@bzg.ath.cx

Bastien <bzg@gnu.org> writes:

Hi Bastien,

> Thorsten Jolitz <tjolitz@gmail.com> writes:

>> What will be copied to the temp-buffer? Only the comment-section at
>> point? The subtree at point? The (outcommented) element at point? Won't
>> some Org functions fail without the subtree/buffer context? What if text
>> is inserted as side-effect? E.g state change logs when going from TODO
>> to done, or even footnotes?
>
> Well, I don't know.  Again, all this feels certainly dirty, but I'm
> trying to find something that will feel less awkward than making tons
> of Org regexps relative to their contexts, including the context for
> non-org-mode buffers...

I thought about a very low level solution, i.e. at the syntax table
level, giving "^ ... $" a different meaning, but thats a bit over my
head and I have my doubt if its possible at all. 

BTW, I think I already implemented your idea for when porting the speed
commands to outshine:

,--------------------------------------------------
| (defconst outshine-speed-commands-default
|   '(
|     ("Outline Navigation")
|     ("n" . (outshine-speed-move-safe
|             'outline-next-visible-heading))
|     [...]
|     ("j" . (outshine-use-outorg 'org-goto))
|     ("g" . (outshine-use-outorg 'org-refile))
|     ("Outline Visibility")
|     ("c" . outline-cycle)
|     ("C" . outshine-cycle-buffer)
|     ;; FIXME needs to be improved!
|     (" " . (outshine-use-outorg
|             (lambda ()
|               (message
|                "%s" (substring-no-properties
|                      (org-display-outline-path)))
|                (sit-for 1))
|             'WHOLE-BUFFER-P))
|    [...]
`--------------------------------------------------

This `outshine-use-outorg' function does more or less what you talk
about:

#+begin_src emacs-lisp
(eval-after-load 'outorg
  '(defun outshine-use-outorg (fun &optional whole-buffer-p &rest funargs)
     "Use outorg to call FUN with FUNARGS on subtree.

FUN should be an Org-mode function that acts on the subtree at
point. Optionally, with WHOLE-BUFFER-P non-nil,
`outorg-edit-as-org' can be called on the whole buffer.

Sets the variable `outshine-use-outorg-last-headline-marker' so
that it always contains a point-marker to the last headline this
function was called upon.

The old marker is removed first. Then a new point-marker is
created before `outorg-edit-as-org' is called on the headline."
     (save-excursion
       (unless (outline-on-heading-p)
	 (outline-previous-heading))
       (outshine--set-outorg-last-headline-marker)
       (if whole-buffer-p
	   (outorg-edit-as-org '(4))
	 (outorg-edit-as-org))
       (if funargs
	   (funcall fun funargs)
	 (funcall fun))
       (outorg-copy-edits-and-exit))))
#+end_src

So maybe I should stop insisting on an org-minor-mode, because outshine
and outorg together already do the trick? 

I just thought it would be better, faster and more powerfull if Org's
regexps would be more abstract and Org functions could act directly in
the programming mode buffers. 

-- 
cheers,
Thorsten

  reply	other threads:[~2014-05-30 14:15 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-10 17:55 [RFC] Org Minor Mode? Thorsten Jolitz
2014-04-10 19:19 ` Nicolas Goaziou
2014-04-11 10:07   ` Bastien
2014-04-11 17:22     ` Richard Lawrence
2014-04-13 16:28       ` Thorsten Jolitz
2014-04-19  5:37       ` Samuel Wales
2014-04-19 10:25         ` Thorsten Jolitz
2014-04-13 16:07     ` Thorsten Jolitz
2014-04-18 13:27       ` Bastien
2014-04-13 16:00   ` Thorsten Jolitz
2014-04-18 13:29     ` Bastien
2014-04-18 15:54       ` Thorsten Jolitz
2014-04-19  5:23         ` Bastien
2014-04-19 10:11           ` Thorsten Jolitz
2014-04-19 12:57             ` Bastien
2014-04-24 21:06               ` Ilya Shlyakhter
2014-04-25  8:00                 ` Thorsten Jolitz
2014-04-29 12:24                 ` Bastien
2014-04-29 18:44                   ` Ilya Shlyakhter
2014-05-06  9:06                     ` Bastien
2014-04-24 21:16   ` Ilya Shlyakhter
2014-04-25  7:49     ` Thorsten Jolitz
2014-05-06  9:20       ` Bastien
2014-05-27  9:20         ` Thorsten Jolitz
2014-05-28 21:47           ` Bastien
2014-05-28 22:19             ` Thorsten Jolitz
2014-05-29  0:01               ` Bastien
2014-05-29 17:47                 ` Thorsten Jolitz
2014-05-29 18:57                   ` Bastien
2014-05-30  8:52                     ` Thorsten Jolitz
2014-05-30 12:13                       ` Bastien
2014-05-30 13:41                         ` Thorsten Jolitz
2014-05-30 13:54                           ` Bastien
2014-05-30 14:15                             ` Thorsten Jolitz [this message]
2014-05-30 14:22                               ` Bastien
2014-05-30 14:38                                 ` Thorsten Jolitz

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=87y4xjnyis.fsf@gmail.com \
    --to=tjolitz@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).