Code Monkey home page Code Monkey logo

Comments (8)

xenodium avatar xenodium commented on June 1, 2024 1

You can select the response and the M-x write-region does what you want.

Check out chatgpt-shell-mark-output, which quickly gives ya the first part.

from chatgpt-shell.

hajovonta avatar hajovonta commented on June 1, 2024 1

So then, as an example:

(defun chatgpt-shell--send-output (&optional filename)
  (interactive)
  (let ((filename (or filename (read-from-minibuffer "Enter filename: "))))
    (chatgpt-shell-mark-output)
    (write-region (region-beginning) (region-end) filename)))

from chatgpt-shell.

xenodium avatar xenodium commented on June 1, 2024 1

Added chatgpt-shell-save-output in a6f0e1d

Will close as it seems fairly close to initial request for chatgpt-shell--send-output

from chatgpt-shell.

xenodium avatar xenodium commented on June 1, 2024

Hi @OrionRandD

Could you implement a chatgpt-shell--send-output function as well?

Could you describe what it does?
Are you keen to contribute an implementation?

from chatgpt-shell.

OrionRandD avatar OrionRandD commented on June 1, 2024

Hi @OrionRandD

Could you implement a chatgpt-shell--send-output function as well?

Could you describe what it does? Are you keen to contribute an implementation?

I would love to... But, unfortunately, I am not a lisper. I am still learning it...
It redirect the output (answer to a file). In unix, linux, ">" greater than sign means "redirect to". And if you want to output (stdout) to appear in the terminal itself and, at the same time, to save it to a file you can use the command "tee" with a pipe "|"
Then the output will appear both in the screen and will be saved in a file...
https://linuxize.com/post/bash-redirect-stderr-stdout/
https://linuxize.com/post/linux-tee-command/

from chatgpt-shell.

OrionRandD avatar OrionRandD commented on June 1, 2024

Another interesting Open-AI project:
Have you seen this?
https://vicuna.lmsys.org/

from chatgpt-shell.

hajovonta avatar hajovonta commented on June 1, 2024

You can select the response and the M-x write-region does what you want.

from chatgpt-shell.

xenodium avatar xenodium commented on June 1, 2024

I couldn't get a nicer way to deal with restoring region, but here are some tweaks... For example, calling chatgpt-shell-mark-output before selecting file name, so you see what you're about to save.

(defun chatgpt-shell-send-output ()
  (interactive)
  (let ((orig-point (point))
        (orig-region-active (region-active-p))
        (orig-region-start (region-beginning))
        (orig-region-end (region-end)))
    (unwind-protect
        (progn
          (chatgpt-shell-mark-output)
          (write-region (region-beginning)
                        (region-end)
                        (read-file-name "Write file: ")))
      (if orig-region-active
          (progn
            (set-mark orig-region-start)
            (goto-char orig-region-end))
        (setq mark-active nil)
        (goto-char orig-point)))))

from chatgpt-shell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.