Class: Relisp::Marker
- Defined in:
- lib/relisp/type_conversion/editing_types.rb
Overview
A proxy to an Emacs marker.
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
- #buffer ⇒ Object
-
#initialize(*args) ⇒ Marker
constructor
args can be any of these forms: * (symbol, slave = Relisp.default_slave) * (slave = Relisp.default_slave).
- #insertion_type ⇒ Object
- #insertion_type=(type) ⇒ Object
- #position ⇒ Object
- #set(new_position, new_buffer = nil) ⇒ Object (also: #move, #position=)
Methods inherited from Proxy
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
#buffer ⇒ Object
277 278 279 |
# File 'lib/relisp/type_conversion/editing_types.rb', line 277 def buffer call_on_self :marker_buffer end |
#insertion_type ⇒ Object
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 |
#position ⇒ Object
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 |