Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-repl: use history file #110

Merged
merged 1 commit into from Sep 15, 2020
Merged

Conversation

leungbk
Copy link
Member

@leungbk leungbk commented Sep 12, 2020


@leungbk leungbk force-pushed the repl-history branch 2 times, most recently from 33fea48 to b89a38b Compare September 14, 2020 02:16
nix-repl.el Outdated
(define-derived-mode nix-repl-mode comint-mode "Nix-REPL"
"Interactive prompt for Nix."
(setq-local comint-prompt-regexp nix-prompt-regexp)
(setq-local comint-prompt-read-only t)
(let* ((is-remote (file-remote-p default-directory))
(maybe-xdg-data-home (shell-command-to-string "echo -n $XDG_DATA_HOME"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use getenv to avoid a subprocess

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I used getenv for non-remote. I don't really know how things work in remote settings; I saw that Emacs' shell.el used a subprocess for remote settings and getenv for local settings:

(when remote
        ;; `shell-snarf-envar' does not work trustworthy.
        (setq hsize (shell-command-to-string "echo -n $HISTSIZE")
              hfile (shell-command-to-string "echo -n $HISTFILE")))

So I updated this patch to do the same thing. Is that the right way of doing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants