Class: LangHelp::FindXXX

Inherits:
ElApp
  • Object
show all
Includes:
DisplayResult
Defined in:
lib/el4r/emacsruby/langhelp.rb

Instance Method Summary collapse

Methods included from DisplayResult

#display_result, #display_result_buffer, #flash_line, #search_anchor, #search_line

Constructor Details

#initialize(x = {}) ⇒ FindXXX

Returns a new instance of FindXXX.



88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/el4r/emacsruby/langhelp.rb', line 88

def initialize(x={})
  name = x[:name]
  cmd = x[:cmd]
  
  # lh_sh is defined at (view-fline buffer-file-name '(4988 "    defun(:lh_sh" "_view_functions\n"))
  defun("lh-#{name}") do |arg|
    lh_sh "#{cmd} #{arg.dump}", arg
  end
  
  meth = "override_#{name}"
  respond_to? meth and __send__ meth
end

Instance Method Details

#override_riObject



103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/el4r/emacsruby/langhelp.rb', line 103

def override_ri
  if locate_library "ri-ruby"
    el_load "ri-ruby"
    defun("lh-ri") do |x|
      display_result {
        ri x
        unless fboundp :with_displaying_help_buffer # for FSF Emacs
          other_window 1
        end
      }
    end
  end
end

#override_test0Object



117
118
119
120
121
122
# File 'lib/el4r/emacsruby/langhelp.rb', line 117

def override_test0
  # Mock-up for unit-test
  defun("lh-test0") do |x|
    newbuf(:name=>"test0", :contents=>"0\n", :display=>:pop)
  end
end