4

I've been using emacs-pastebin but all my pastebins wind up as plain text. Is there a way to set emacs-pastebin so that pastebins are set to LISP format by default?

Better yet, is there a pastebin site that can disentangle Emacs discussions and highlight syntax correctly in lines based on SRC tags like the following, including both the code snippet and the non-lisp commentary?

* org-toggle-todo-heading 
Here's what I have so far. See if it works for you. 

#+BEGIN_SRC emacs-lisp 
(defun org-toggle-todo-heading ()
"Toggles the current line between a non-heading and TODO heading."
(interactive)
(let ((is-heading))
(save-excursion
(forward-line 0)
(when (looking-at "^\\*") 
(setq is-heading t)))
(if is-heading 
    (progn
      (org-todo 'none) ; remove TODO
      (org-toggle-heading)) ; remove heading
  (progn
    (org-toggle-heading) ; convert to heading
    (org-todo 'nextset))))) ; add TODO  #+END_SRC
#+END_SRC

I have it bound to M-S-8. 

And of course, I want be able to post regions/buffers to the site from within Emacs.

  • If you find a place that supports formatted text you can use github.com/Lindydancer/highlight2clipboard to copy content from Emacs complete with syntax highlighting (currently only for Win and OS X). This work, for example, in gmail. – Lindydancer Jul 17 '15 at 21:31
5

Better yet, is there a pastebin site that can disentangle Emacs discussions and highlight syntax correctly in lines based on SRC tags like the following, including both the code snippet and the non-lisp commentary?

There is a "gist mode" you can install from MELPA that can do that--Github and Gist both support Org-mode files.

After you have that repo, you can M-x package-list-packages, install "gist", and then upload whatever buffer, region, or have-at-you that you like.

For example, say I have this nifty little Org file I wrote that I wish to send to someome:

As you can see at the bottom, I am about to send this buffer with M-x gist-buffer.

It will then ask for a Github username and password, then spit out a link of the Gist's URL:

This is the result:

Now I can send this link in an E-Mail, IRC, or wherever I've been meaning to send the Org. (Or just keep it around for posterity.)

The Gist support allows for modifying Gists you posted, creating Gists from buffers or regions, as well as working with public or private posts.

3

I can't help with the org mode styling (I've never seen any pastebin that does that, but it sounds like an awesome feature).

One of my favorite pastebins has a nice emacs package that takes care of pasting with the correct language and syntax highlighting(based on major mode, I believe) https://www.refheap.com/.

As a bonus the pastebin supports "private" pastes and so does the emacs package!

The package is available on melpa: http://melpa.org/#/refheap

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.