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:
(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)))To use this function, open an Info buffer and navigate to its table of contents. Then, execute the function
info-toc-to-org-treeeither by calling it from Emacs Lisp or by binding it to a keybinding. The function will create a new buffer called and insert the Org-mode tree into it. You can then copy the Org-mode tree to the clipboard and paste it into an Org-mode file.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.