Class: Relisp::Window

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

Overview

A proxy to an Emacs window

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) ⇒ Window

args must be of the form (symbol, slave = Relisp.default_slave)

The symbol argument is considered to be the name of a pre-existing window in the slave process.



307
308
309
310
311
# File 'lib/relisp/type_conversion/editing_types.rb', line 307

def initialize(*args)
  super do 
    raise ArgumentError, "Cannot create Window using 'new' method."
  end
end

Instance Method Details

#==(window2) ⇒ Object



479
480
481
# File 'lib/relisp/type_conversion/editing_types.rb', line 479

def ==(window2)
  @slave.elisp_eval "(equal #{to_elisp} #{window2.to_elisp})"
end

#alive?Boolean

Returns:

  • (Boolean)


336
337
338
# File 'lib/relisp/type_conversion/editing_types.rb', line 336

def alive?
  call_on_self :window_live_p
end

#body_heightObject



441
442
443
# File 'lib/relisp/type_conversion/editing_types.rb', line 441

def body_height
  call_on_self :window_body_height
end

#bufferObject



352
353
354
# File 'lib/relisp/type_conversion/editing_types.rb', line 352

def buffer
  call_on_self :window_buffer
end

#buffer=(new_buffer) ⇒ Object



356
357
358
# File 'lib/relisp/type_conversion/editing_types.rb', line 356

def buffer=(new_buffer)
  call_on_self :set_window_buffer, new_buffer
end

#dedicatedObject



360
361
362
# File 'lib/relisp/type_conversion/editing_types.rb', line 360

def dedicated
  call_on_self :window_dedicated_p
end

#dedicated=(flag) ⇒ Object



364
365
366
# File 'lib/relisp/type_conversion/editing_types.rb', line 364

def dedicated=(flag)
  call_on_self :set_window_dedicated_p, flag
end

#deleteObject



340
341
342
# File 'lib/relisp/type_conversion/editing_types.rb', line 340

def delete
  call_on_self :delete_window
end

#delete_othersObject



344
345
346
# File 'lib/relisp/type_conversion/editing_types.rb', line 344

def delete_others
  call_on_self :delete_other_windows
end

#edgesObject



449
450
451
# File 'lib/relisp/type_conversion/editing_types.rb', line 449

def edges
  (call_on_self :window_edges).to_list
end

#endObject



385
386
387
# File 'lib/relisp/type_conversion/editing_types.rb', line 385

def end 
  call_on_self :window_end
end

#enlarge(vertical, horizontal = 0) ⇒ Object



465
466
467
468
# File 'lib/relisp/type_conversion/editing_types.rb', line 465

def enlarge(vertical, horizontal=0)
  eval_in_window "(enlarge-window #{vertical.to_elisp})"
  eval_in_window "(enlarge-window-horizontally #{horizontal.to_elisp})"
end

#frameObject



475
476
477
# File 'lib/relisp/type_conversion/editing_types.rb', line 475

def frame
  call_on_self :window_frame
end

#heightObject



437
438
439
# File 'lib/relisp/type_conversion/editing_types.rb', line 437

def height
  call_on_self :window_height
end

#hscrollObject



429
430
431
# File 'lib/relisp/type_conversion/editing_types.rb', line 429

def hscroll
  call_on_self :window_hscroll
end

#hscroll=(columns) ⇒ Object



433
434
435
# File 'lib/relisp/type_conversion/editing_types.rb', line 433

def hscroll=(columns)
  call_on_self :set_window_hscroll, columns
end

#inside_edgesObject



453
454
455
# File 'lib/relisp/type_conversion/editing_types.rb', line 453

def inside_edges
  (call_on_self :window_inside_edges).to_list
end

#inside_pixel_edgesObject



461
462
463
# File 'lib/relisp/type_conversion/editing_types.rb', line 461

def inside_pixel_edges
  (call_on_self :window_inside_pixel_edges).to_list
end

#pixel_edgesObject



457
458
459
# File 'lib/relisp/type_conversion/editing_types.rb', line 457

def pixel_edges
  (call_on_self :window_pixel_edges).to_list
end

#pointObject



368
369
370
# File 'lib/relisp/type_conversion/editing_types.rb', line 368

def point
  call_on_self :window_point
end

#point=(position) ⇒ Object



372
373
374
# File 'lib/relisp/type_conversion/editing_types.rb', line 372

def point=(position)
  call_on_self :set_window_point, position
end

#recenter(count = nil) ⇒ Object



401
402
403
# File 'lib/relisp/type_conversion/editing_types.rb', line 401

def recenter(count=nil)
  eval_in_window "(recenter #{count.to_elisp})"
end

#scroll_down(count = nil) ⇒ Object



397
398
399
# File 'lib/relisp/type_conversion/editing_types.rb', line 397

def scroll_down(count=nil)
  eval_in_window "(scroll-down #{count.to_elisp})"
end

#scroll_left(count = nil) ⇒ Object



421
422
423
# File 'lib/relisp/type_conversion/editing_types.rb', line 421

def scroll_left(count=nil)
  eval_in_window "(scroll-left #{count.to_elisp})"
end

#scroll_right(count = nil) ⇒ Object



425
426
427
# File 'lib/relisp/type_conversion/editing_types.rb', line 425

def scroll_right(count=nil)
  eval_in_window "(scroll-right #{count.to_elisp})"
end

#scroll_up(count = nil) ⇒ Object



393
394
395
# File 'lib/relisp/type_conversion/editing_types.rb', line 393

def scroll_up(count=nil)
  eval_in_window "(scroll-up #{count.to_elisp})"
end

#selectObject



348
349
350
# File 'lib/relisp/type_conversion/editing_types.rb', line 348

def select
  call_on_self :select_window
end

#shrink(vertical, horizontal = 0) ⇒ Object



470
471
472
473
# File 'lib/relisp/type_conversion/editing_types.rb', line 470

def shrink(vertical, horizontal=0)
  eval_in_window "(shrink-window #{vertical.to_elisp})"
  eval_in_window "(shrink-window-horizontally #{horizontal.to_elisp})"
end

#split(size = nil, horizontal = false) ⇒ Object



324
325
326
# File 'lib/relisp/type_conversion/editing_types.rb', line 324

def split(size=nil, horizontal=false)
  call_on_self :split_window, size, horizontal
end

#split_horizontally(size = nil) ⇒ Object



328
329
330
# File 'lib/relisp/type_conversion/editing_types.rb', line 328

def split_horizontally(size=nil)
  split(size, true)
end

#split_vertically(size = nil) ⇒ Object



332
333
334
# File 'lib/relisp/type_conversion/editing_types.rb', line 332

def split_vertically(size=nil)
  split(size, false)
end

#startObject



376
377
378
379
# File 'lib/relisp/type_conversion/editing_types.rb', line 376

def start
#      eval_in_window "(window-start)"
  call_on_self :window_start
end

#start=(position) ⇒ Object



381
382
383
# File 'lib/relisp/type_conversion/editing_types.rb', line 381

def start=(position)
  call_on_self :set_window_start, position
end

#visible?(position) ⇒ Boolean

Returns:

  • (Boolean)


389
390
391
# File 'lib/relisp/type_conversion/editing_types.rb', line 389

def visible?(position)
  @slave.elisp_eval( "(pos-visible-in-window-p #{position.to_elisp} #{@elisp_variable})" )
end

#vscrollObject



405
406
407
# File 'lib/relisp/type_conversion/editing_types.rb', line 405

def vscroll
  call_on_self :window_vscroll
end

#vscroll=(lines) ⇒ Object



413
414
415
# File 'lib/relisp/type_conversion/editing_types.rb', line 413

def vscroll=(lines)
  call_on_self :set_window_vscroll, lines
end

#vscroll_in_pixelsObject



409
410
411
# File 'lib/relisp/type_conversion/editing_types.rb', line 409

def vscroll_in_pixels
  call_on_self :window_vscroll, true
end

#vscroll_in_pixels=(pixels) ⇒ Object



417
418
419
# File 'lib/relisp/type_conversion/editing_types.rb', line 417

def vscroll_in_pixels=(pixels)
  call_on_self :set_window_vscroll, pixels, true
end

#widthObject



445
446
447
# File 'lib/relisp/type_conversion/editing_types.rb', line 445

def width
  call_on_self :window_width
end