From b51fbeb3a2052b50fa4d2daa9062f5bc1483ae2e Mon Sep 17 00:00:00 2001 From: Dale Sedivec Date: Sun, 7 Aug 2011 18:07:28 -0500 Subject: [PATCH] Allow irb switches to set the prompt mode Emacs uses irb --inf-ruby-mode to, among other things, set a specific prompt mode. However, RVM's irbrc.rb was unconditionally overriding the prompt mode. The user could still set the prompt mode in ~/.irbrc, but I didn't see any easy way to check if irb was called with --inf-ruby-mode or --prompt[-mode] from irbrc, so I'd just be swapping out one unconditional prompt mode override (:RVM) for another (e.g. :INF_RUBY) which isn't what I wanted--I should get the nice RVM prompt when I run irb from a shell but Emacs should also be able to get the prompt mode it wants. Hence this change, which only changes PROMPT_MODE if it's set to :DEFAULT, which should be the case unless the user supplied a prompt mode on the command line. --- scripts/irbrc.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/irbrc.rb b/scripts/irbrc.rb index 91844f6f14..cca22175db 100644 --- a/scripts/irbrc.rb +++ b/scripts/irbrc.rb @@ -50,7 +50,7 @@ } IRB.conf[:PROMPT] ||= {} IRB.conf[:PROMPT][:RVM] = @prompt -IRB.conf[:PROMPT_MODE] = :RVM +IRB.conf[:PROMPT_MODE] = :RVM if IRB.conf[:PROMPT_MODE] == :DEFAULT # Load the user's irbrc file, if possible. # Report any errors that occur.