【问题标题】:Set the stack trace limit in rinari-console在 rinari-console 中设置堆栈跟踪限制
【发布时间】:2015-12-23 19:12:51
【问题描述】:

this question 可以看出,Rails 控制台中的回溯限制是通过将新值传递给context.back_trace_limit 来设置的。虽然这可以在 .irbc 文件中设置,但我更希望 Emacs 为我设置它,因为我通常不会在编辑器之外使用 irb,而且我的 .emacs 会在我使用的各种系统之间同步。

有没有办法在我启动 rinari-console 时传入这个值?

【问题讨论】:

    标签: ruby-on-rails emacs console rinari


    【解决方案1】:

    rinari.el中rinari-console函数的完整定义为:

    (defun rinari-console (&optional edit-cmd-args)
      "Run a Rails console in a compilation buffer.
    The buffer will support command history and links between errors
    and source code.  Optional prefix argument EDIT-CMD-ARGS lets the
    user edit the console command arguments."
      (interactive "P")
      (let* ((default-directory (rinari-root))
             (command (rinari--maybe-wrap-with-ruby
                       (rinari--wrap-rails-command "console"))))
    
        ;; Start console in correct environment.
        (when rinari-rails-env
          (setq command (concat command " " rinari-rails-env)))
    
        ;; For customization of the console command with prefix arg.
        (setq command (if edit-cmd-args
                          (read-string "Run Ruby: " (concat command " "))
                        command))
        (with-current-buffer (run-ruby command "rails console")
          (rinari-launch)))
    

    所以没有内置的方法可以将值传递给 irb 会话。但是,我已停止使用 Rinari,因此不再致力于解决方案。

    【讨论】:

      猜你喜欢
      • 2023-03-15
      • 2017-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-25
      • 2011-05-13
      • 1970-01-01
      相关资源
      最近更新 更多