Class: Relisp::Marker

Inherits:
Proxy show all
Defined in:
lib/relisp/type_conversion/editing_types.rb

Overview

A proxy to an Emacs marker.

Instance Attribute Summary

Attributes inherited from Proxy

#elisp_variable, #slave

Instance Method Summary collapse

Methods inherited from Proxy

from_elisp, #to_elisp

Constructor Details

#initialize(*args) ⇒ Marker

args can be any of these forms:

  • (symbol, slave = Relisp.default_slave)

  • (slave = Relisp.default_slave)

When a symbol is given it is considered to be the name of a pre-existing marker in the slave process. Otherwise a new, empty marker is created (make-marker).



267
268
269
270
271
# File 'lib/relisp/type_conversion/editing_types.rb', line 267

def initialize(*args)
  super do 
    @slave.elisp_exec( "(setq #{@elisp_variable} (make-marker))" )
  end
end

Instance Method Details

#bufferObject



277
278
279
# File 'lib/relisp/type_conversion/editing_types.rb', line 277

def buffer
  call_on_self :marker_buffer
end

#insertion_typeObject



281
282
283
# File 'lib/relisp/type_conversion/editing_types.rb', line 281

def insertion_type
  call_on_self :marker_insertion_type
end

#insertion_type=(type) ⇒ Object



285
286
287
# File 'lib/relisp/type_conversion/editing_types.rb', line 285

def insertion_type=(type)
  @slave.elisp_eval( "(set-marker-insertion-type #{@elisp_variable} #{type.to_elisp})" )
end

#positionObject



273
274
275
# File 'lib/relisp/type_conversion/editing_types.rb', line 273

def position
  call_on_self :marker_position
end

#set(new_position, new_buffer = nil) ⇒ Object Also known as: move, position=



289
290
291
# File 'lib/relisp/type_conversion/editing_types.rb', line 289

def set(new_position, new_buffer=nil)
  @slave.elisp_exec( "(set-marker #{@elisp_variable} #{new_position} #{new_buffer})" )
end