Human-written demonstration (OpenAssistant volunteers)· OpenAssistant (human-written)
OpenAssistant Conversations (oasst2)
write emacs lisp function that will transform info buffer table of contents to org-mode…
In OpenAssistant data, “assistant” turns were written by human volunteers as demonstrations. They are not model outputs.
- User
write emacs lisp function that will transform info buffer table of contents to org-mode tree
- Assistant
Here's an example Emacs Lisp function that converts an Info buffer table of contents to an Org-mode tree:
code(defun info-toc-to-org-tree () "Convert an Info buffer table of contents to an Org-mode tree." (interactive) (let ((toc-buffer (get-buffer "*info-toc*")) (org-tree-buffer (get-buffer-create "*org-tree*"))) (with-current-buffer org-tree-buffer (erase-buffer) (if (not (buffer-live-p toc-buffer)) (message "No Info buffer table of contents found.") (with-current-buffer toc-buffer (goto-char (point-min)) (while (not (eobp)) (let ((level (string-to-number (match-string 1))) (name (match-string 2)) (link (match-string 3))) (insert (make-string (* level 2) ? ) name "\n"))) (forward-line)))) (switch-to-buffer org-tree-buffer))) - User
Thank you!
- Assistant
Most Welcome!
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.