On Thu, Apr 07 2011, Ted Zlatanov wrote: > Like this? Or should I say "text" as a fallback? > > #+begin_src emacs-lisp > (defun tzz-copy-region-with-mode-property (beg end) > (interactive "r") > (let ((text (buffer-substring beg end)) > (mode (symbol-name major-mode))) > (with-temp-buffer > (insert text) > (goto-char (point-min)) > (insert "#+begin_src" > (if (string-match "\\(.+\\)-mode" mode) > (concat " " (match-string 1 mode)) > "") > "\n") > (goto-char (point-max)) > (insert "\n" > "#+end_src" > "\n") > (copy-region-as-kill (point-min) (point-max))))) You do not need a fallback AFAIK, you would just end without any fontification. :) > This doesn't syntax-highlight like "lisp" does. So "lisp" is still > better currently. It does here. > Huh, "lisp" is also not highlighted correctly in Gnus. I distinctly > recall the Emacs Lisp highlighting was applied to some examples you > posted, Julien. Is my example wrong or have I misconfigured something? Check `org-src-fontify-natively' value? -- Julien Danjou ❱ http://julien.danjou.info