Module: EmacsLisp

Defined in:
lib/el4r/el4r-sub.rb

Overview

EmacsLisp depend: system_to_string

Instance Method Summary collapse

Instance Method Details

#dump_string(string) ⇒ Object

Converts a Ruby string to EmacsLisp string.

imported from el4r


563
564
565
566
567
568
569
570
571
572
# File 'lib/el4r/el4r-sub.rb', line 563

def dump_string(string)
  dumped = string.dup
  # \ -> \\
  dumped.gsub! %r"\\" do '\\\\' end
  # " -> \"
  dumped.gsub! %r'"' do '\\"' end
  # (zero byte) -> \0
  dumped.gsub! %r'\0' do "\\\0" end
  %Q'"#{dumped}"'
end

#elisp(lisp) ⇒ Object

Executes an EmacsLisp string by gnudoit.



557
558
559
# File 'lib/el4r/el4r-sub.rb', line 557

def elisp(lisp)
  system_to_string("gnudoit", lisp).chomp
end