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

pry syntax highlighting/color #88

Open
jrab89 opened this issue Sep 28, 2016 · 6 comments
Open

pry syntax highlighting/color #88

jrab89 opened this issue Sep 28, 2016 · 6 comments

Comments

@jrab89
Copy link

jrab89 commented Sep 28, 2016

Using pry from inf-ruby looks like this:

screen shot 2016-09-28 at 5 38 51 pm

Using pry from iTerm2 looks like this:

screen shot 2016-09-28 at 5 40 14 pm

Is there a way to get pry's syntax highlighting from within inf-ruby?

Here's what my inf-ruby configuration looks like:

(require 'inf-ruby)
(setq inf-ruby-default-implementation "pry")
(add-hook 'inf-ruby-mode-hook
  (function
    (lambda ()
      (setq show-trailing-whitespace nil)
      (linum-mode 0))))

Here's my ~/.pryrc:

Pry.config.correct_indent = false if ENV['INSIDE_EMACS']

Thanks for your help!

@dgutov
Copy link
Collaborator

dgutov commented Sep 28, 2016

Over here, I do have the return values highlighted. But IIUC you're asking about the input text.

That sounds difficult, because comint-mode doesn't replace the input lines with their echoes from the external process. Not sure how that could work in practice, with different kinds of REPLs.

@Trevoke
Copy link
Contributor

Trevoke commented Sep 29, 2016

Could we do something like.. Turn on the echo in the REPL and colorize the
echo?

On Wed, Sep 28, 2016 at 7:08 PM Dmitry Gutov [email protected]
wrote:

Over here, I do have the return values highlighted. But IIUC you're asking
about the input text.

That sounds difficult, because comint-mode doesn't replace the input
lines with their echoes from the external process. Not sure how that could
work in practice, with different kinds of REPLs.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#88 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAEJSZWkrspDO9BANSfiGH1MBDQ-g1o8ks5quvNPgaJpZM4KJZgI
.

@dgutov
Copy link
Collaborator

dgutov commented Sep 30, 2016

It might be possible, and it would need to happen in comint.el. If you're interested, please give it a try.

@jrab89
Copy link
Author

jrab89 commented Sep 30, 2016

@dgutov That's strange that you're getting return values highlighted and I'm not.

I'm getting the same result too when I replace my .emacs with this minimal one:

(setq package-archives
  '(("gnu" . "https://elpa.gnu.org/packages/")
    ("marmalade" . "https://marmalade-repo.org/packages/")))

(require 'package)
(setq package-enable-at-startup nil)
(package-initialize)
(package-refresh-contents)

(defvar my-packages '(inf-ruby exec-path-from-shell))

(dolist (p my-packages)
  (when (not (package-installed-p p))
    (package-install p)))

(require 'inf-ruby)
(setq inf-ruby-default-implementation "pry")
(add-hook 'inf-ruby-mode-hook
  (function
    (lambda ()
      (setq show-trailing-whitespace nil)
      (linum-mode 0))))

(when (memq window-system '(mac ns))
  (exec-path-from-shell-initialize))

Here's what I see:

screen shot 2016-09-30 at 1 16 22 pm

Any ideas what could be going wrong on my end? I'm using emacs 24.5.1 from https://emacsformacosx.com

@jrab89
Copy link
Author

jrab89 commented Sep 30, 2016

I'm not sure why, but my Pry.color was false when running pry within inf-ruby. I added Pry.color = true to my ~/.pryrc and now I get colorized return values.

@dgutov
Copy link
Collaborator

dgutov commented Sep 30, 2016

Ah yup, I have that in my .pryrc as well.

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

No branches or pull requests

3 participants