emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?
@ 2014-10-31 22:51 Brady Trainor
  2014-11-01  2:24 ` Brady Trainor
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Brady Trainor @ 2014-10-31 22:51 UTC (permalink / raw)
  To: emacs-orgmode


When reading articles /from/ gmane.emacs.orgmode /in/ Gnus, I've observed that source blocks such as 

#+BEGIN_SRC emacs-lisp
(if this
    (then that))
#+END_SRC

and 

#+BEGIN_SRC org
,* TODO some headlines and                        :atag:
SCHEDULED: <2014-10-29 Wed>
- [ ] some other org-mode stuff
#+END_SRC

do receive syntax highlighting. But to take advantage of this and to write articles in this way my workflow is very awkward. Here is my present workflow, and I hope there is some simple or complex solution where others have a better workflow they can share: 

1. Cut some pieces from my .el or .org files, 
2. Paste into the scratch buffer,
3. Convert scratch buffer to Major mode org, 
4. Add src blocks using org-mode shortcuts ("<s TAB org" or "selisp SPC"),
5. Edit as needed for email, for instance taking advantage of indenting etc. in "C-c '" mode
6. Cut and paste from scratch buffer to email draft
7. Edit email
8. If extensive editing of src blocks is needed while drafting, may consider switching back to scratch buffer including further cutting and pasting

This seems wholly inefficient, and I'm hoping there is some obviously easier way to do it, no matter how much elisp is needed. 

I am not sure it is relevant, but my rather vanilla Gnus setup includes drafting mail in Message buffer. I didn't quickly find how to switch to drafting with Gnus, so I make the cursory assumption that this is not the trick to at least seeing highlighting of src blocks while drafting emails. 

--
Brady

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

* Re: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?
  2014-10-31 22:51 How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Brady Trainor
@ 2014-11-01  2:24 ` Brady Trainor
  2014-11-01 10:58 ` Thorsten Jolitz
  2014-11-01 13:01 ` How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Alexander Baier
  2 siblings, 0 replies; 9+ messages in thread
From: Brady Trainor @ 2014-11-01  2:24 UTC (permalink / raw)
  To: emacs-orgmode


Brady Trainor <algebrat@uw.edu> writes:

> ... Here is my
> present workflow, and I hope there is some simple or complex solution
> where others have a better workflow they can share:
>
> 1. Cut some pieces from my .el or .org files, 
> 2. Paste into the scratch buffer,
> 3. Convert scratch buffer to Major mode org, 
> 4. Add src blocks using org-mode shortcuts ("<s TAB org" or "selisp SPC"),
> 5. Edit as needed for email, for instance taking advantage of indenting etc. in "C-c '" mode
> 6. Cut and paste from scratch buffer to email draft
> 7. Edit email
> 8. If extensive editing of src blocks is needed while drafting, may
> consider switching back to scratch buffer including further cutting
> and pasting
> ...

I think I have found a rather peculiar solution (to my lengthy workflow). 

A normal solution:
  Based off a simple solution, of simply changing the mode of the email-draft (message) buffer to org-mode. Than C-c ' to edit in another mode, C-c ' to return, and M-x message-mode RET to view the normal message-mode hightlighting of headers and quoted messages. 

Strangish solution:
  C-x 4 c to clone the buffer, then switch to org-mode. But strangely, the syntax highlighting of message-mode is preserved! Simultaneously I get both modes' syntax highlighting, and <s TAB and C-c ' work!

(Heh heh, C-c C-c did not work... but M-x message-send-and-exit RET does!) 

--
Brady

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

* Re: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?
  2014-10-31 22:51 How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Brady Trainor
  2014-11-01  2:24 ` Brady Trainor
@ 2014-11-01 10:58 ` Thorsten Jolitz
  2014-11-03  1:26   ` Grant Rettke
  2014-11-01 13:01 ` How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Alexander Baier
  2 siblings, 1 reply; 9+ messages in thread
From: Thorsten Jolitz @ 2014-11-01 10:58 UTC (permalink / raw)
  To: emacs-orgmode

Brady Trainor <algebrat@uw.edu> writes:

> 1. Cut some pieces from my .el or .org files, 
> 2. Paste into the scratch buffer,
> 3. Convert scratch buffer to Major mode org, 
> 4. Add src blocks using org-mode shortcuts ("<s TAB org" or "selisp SPC"),
> 5. Edit as needed for email, for instance taking advantage of
> indenting etc. in "C-c '" mode
> 6. Cut and paste from scratch buffer to email draft
> 7. Edit email
> 8. If extensive editing of src blocks is needed while drafting, may
> consider switching back to scratch buffer including further cutting
> and pasting
>
> This seems wholly inefficient, and I'm hoping there is some obviously
> easier way to do it, no matter how much elisp is needed.

Yup. 

Outorg works with message-mode too, so I write my mails in message-mode,
and do

,----
| M-# # (outorg-edit-as-org)
`----

whenever I need Org-mode functionality like src-blocks, and then

,----
| M-# (outorg-copy-edits-and-exit)
`----

in the *outorg-edit-buffer* when I'm done with editing in
Org-mode. Makes it easy to edit you emails in full Org-mode.

There are some extra benefits, like automatic (optionally temporary)
insertion of export headers, automatic backup files in a /tmp folder
(one file for each explicit save with C-x C-s, and one saved when
killing the *outorg-edit-buffer*). 

And there is a new library

[[http://goo.gl/pYYzS6][outorg-export]]

by Jonathan Leech-Pepin that keeps source-files and (Org) exports in
sync.

-- 
cheers,
Thorsten

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

* Re: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?
  2014-10-31 22:51 How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Brady Trainor
  2014-11-01  2:24 ` Brady Trainor
  2014-11-01 10:58 ` Thorsten Jolitz
@ 2014-11-01 13:01 ` Alexander Baier
  2 siblings, 0 replies; 9+ messages in thread
From: Alexander Baier @ 2014-11-01 13:01 UTC (permalink / raw)
  To: Brady Trainor; +Cc: emacs-orgmode

On 2014-10-31 23:51 Brady Trainor wrote:
> This seems wholly inefficient, and I'm hoping there is some obviously
> easier way to do it, no matter how much elisp is needed.
>
> I am not sure it is relevant, but my rather vanilla Gnus setup
> includes drafting mail in Message buffer. I didn't quickly find how to
> switch to drafting with Gnus, so I make the cursory assumption that
> this is not the trick to at least seeing highlighting of src blocks
> while drafting emails.

I use the setup described in this thread:
http://permalink.gmane.org/gmane.emacs.orgmode/86234

Regards,
-- 
Alexander Baier

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

* Re: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?
  2014-11-01 10:58 ` Thorsten Jolitz
@ 2014-11-03  1:26   ` Grant Rettke
  2014-11-03  8:06     ` Thorsten Jolitz
  0 siblings, 1 reply; 9+ messages in thread
From: Grant Rettke @ 2014-11-03  1:26 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode@gnu.org

On Sat, Nov 1, 2014 at 5:58 AM, Thorsten Jolitz <tjolitz@gmail.com> wrote:
> And there is a new library
>
> [[http://goo.gl/pYYzS6][outorg-export]]

I just used http://goo.gl/pYYzS6 and it worked fine; that looks like
an org mode link.

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

* Re: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?
  2014-11-03  1:26   ` Grant Rettke
@ 2014-11-03  8:06     ` Thorsten Jolitz
  2014-11-06 18:22       ` org links and outshine (Was: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?) Alan Schmitt
  0 siblings, 1 reply; 9+ messages in thread
From: Thorsten Jolitz @ 2014-11-03  8:06 UTC (permalink / raw)
  To: emacs-orgmode

Grant Rettke <gcr@wisdomandwonder.com> writes:

> On Sat, Nov 1, 2014 at 5:58 AM, Thorsten Jolitz <tjolitz@gmail.com> wrote:
>> And there is a new library
>>
>> [[http://goo.gl/pYYzS6][outorg-export]]
>
> I just used http://goo.gl/pYYzS6 and it worked fine; that looks like
> an org mode link.

It is an Org-mode link inserted with C-c C-l while writing the post in
the *outorg-edit-buffer*, in case this was a question.

-- 
cheers,
Thorsten

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

* org links and outshine (Was: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?)
  2014-11-03  8:06     ` Thorsten Jolitz
@ 2014-11-06 18:22       ` Alan Schmitt
  2014-11-07 10:16         ` org links and outshine Thorsten Jolitz
  0 siblings, 1 reply; 9+ messages in thread
From: Alan Schmitt @ 2014-11-06 18:22 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 908 bytes --]

On 2014-11-03 09:06, Thorsten Jolitz <tjolitz@gmail.com> writes:

> Grant Rettke <gcr@wisdomandwonder.com> writes:
>
>> On Sat, Nov 1, 2014 at 5:58 AM, Thorsten Jolitz <tjolitz@gmail.com> wrote:
>>> And there is a new library
>>>
>>> [[http://goo.gl/pYYzS6][outorg-export]]
>>
>> I just used http://goo.gl/pYYzS6 and it worked fine; that looks like
>> an org mode link.
>
> It is an Org-mode link inserted with C-c C-l while writing the post in
> the *outorg-edit-buffer*, in case this was a question.

I'll seize this opportunity to ask about this: I have my emacs init file
in outshine syntax, and inside it there are several links (to info
pages, to gnus messages, and so on). They look great and can be acted
upon in org mode, but not so great in lisp mode. Could it be possible
for outshine to nicely display these links?

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

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

* Re: org links and outshine
  2014-11-06 18:22       ` org links and outshine (Was: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?) Alan Schmitt
@ 2014-11-07 10:16         ` Thorsten Jolitz
  2014-11-08 18:15           ` Alan Schmitt
  0 siblings, 1 reply; 9+ messages in thread
From: Thorsten Jolitz @ 2014-11-07 10:16 UTC (permalink / raw)
  To: emacs-orgmode

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

Hi Alan,

> On 2014-11-03 09:06, Thorsten Jolitz <tjolitz@gmail.com> writes:
>
>> Grant Rettke <gcr@wisdomandwonder.com> writes:
>>
>>> On Sat, Nov 1, 2014 at 5:58 AM, Thorsten Jolitz <tjolitz@gmail.com>
>>> wrote:
>>>> And there is a new library
>>>>
>>>> [[http://goo.gl/pYYzS6][outorg-export]]
>>>
>>> I just used http://goo.gl/pYYzS6 and it worked fine; that looks like
>>> an org mode link.
>>
>> It is an Org-mode link inserted with C-c C-l while writing the post in
>> the *outorg-edit-buffer*, in case this was a question.
>
> I'll seize this opportunity to ask about this: I have my emacs init file
> in outshine syntax, and inside it there are several links (to info
> pages, to gnus messages, and so on). They look great and can be acted
> upon in org mode, but not so great in lisp mode. Could it be possible
> for outshine to nicely display these links?

nice display of links is done with overlays in Org-mode, see e.

#+BEGIN_SRC emacs-lisp
(defun org-toggle-link-display ()
  "Toggle the literal or descriptive display of links."
  (interactive)
  (if org-descriptive-links
      (progn (org-remove-from-invisibility-spec '(org-link))
	     (org-restart-font-lock)
	     (setq org-descriptive-links nil))
    (progn (add-to-invisibility-spec '(org-link))
	   (org-restart-font-lock)
	   (setq org-descriptive-links t))))
#+END_SRC

and it might be easy to port this to outshine, unfortunately I have _no_
time right now, maybe you could have a look yourself (patches very
welcome). 

Another requested feature is making the :ARCHIVE: tag work in outshine,
something I definitely would like to have too, maybe thats related to
'invisibility-spec' too (hide archived subtrees when doing visibility
cycling), but unfortuntely right now I cannot investigate.

--
cheers,
Thorsten

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

* Re: org links and outshine
  2014-11-07 10:16         ` org links and outshine Thorsten Jolitz
@ 2014-11-08 18:15           ` Alan Schmitt
  0 siblings, 0 replies; 9+ messages in thread
From: Alan Schmitt @ 2014-11-08 18:15 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

On 2014-11-07 11:16, Thorsten Jolitz <tjolitz@gmail.com> writes:

>> I'll seize this opportunity to ask about this: I have my emacs init file
>> in outshine syntax, and inside it there are several links (to info
>> pages, to gnus messages, and so on). They look great and can be acted
>> upon in org mode, but not so great in lisp mode. Could it be possible
>> for outshine to nicely display these links?
>
> nice display of links is done with overlays in Org-mode, see e.
>
> #+BEGIN_SRC emacs-lisp
> (defun org-toggle-link-display ()
>   "Toggle the literal or descriptive display of links."
>   (interactive)
>   (if org-descriptive-links
>       (progn (org-remove-from-invisibility-spec '(org-link))
> 	     (org-restart-font-lock)
> 	     (setq org-descriptive-links nil))
>     (progn (add-to-invisibility-spec '(org-link))
> 	   (org-restart-font-lock)
> 	   (setq org-descriptive-links t))))
> #+END_SRC
>
> and it might be easy to port this to outshine, unfortunately I have _no_
> time right now, maybe you could have a look yourself (patches very
> welcome). 

I'm not overloaded by time either, but if I find some to look into it
I'll report of the list.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 494 bytes --]

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

end of thread, other threads:[~2014-11-08 18:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-31 22:51 How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Brady Trainor
2014-11-01  2:24 ` Brady Trainor
2014-11-01 10:58 ` Thorsten Jolitz
2014-11-03  1:26   ` Grant Rettke
2014-11-03  8:06     ` Thorsten Jolitz
2014-11-06 18:22       ` org links and outshine (Was: How do you interact with org src blocks for your gmane.emacs.orgmode correspondence?) Alan Schmitt
2014-11-07 10:16         ` org links and outshine Thorsten Jolitz
2014-11-08 18:15           ` Alan Schmitt
2014-11-01 13:01 ` How do you interact with org src blocks for your gmane.emacs.orgmode correspondence? Alexander Baier

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