четверг, 11 февраля 2010 г.

Emacs: находки дня

  1. В емаксе можно держать несколько независимых буферов info. Ура! M-n - клонирует текущий инфо-буфер. C-n C-h i - открывает буфер *info*<n>
  2. можно сохранить текущую раскладку window'ов по fram'у и буферов по window'ам в регистр: C-x r w R, а потом соответственно ее загрузить оттуда: C-x r j R. Осталось только разобраться: "можно ли и как?" - сохранять это в bookmark'и
P.S. аа!! наглое дублирование лиспо-кода:
(defun bookmark-make-record-default (&optional point-only)
"Return the record describing the location of a new bookmark.
Must be at the correct position in the buffer in which the bookmark is
being set.
If POINT-ONLY is non-nil, then only return the subset of the
record that pertains to the location within the buffer."

`(,@(unless point-only `((filename . ,(bookmark-buffer-file-name))))
(front-context-string
. ,(if (>= (- (point-max) (point)) bookmark-search-size)
(buffer-substring-no-properties
(point)
(+ (point) bookmark-search-size))
nil))
(rear-context-string
. ,(if (>= (- (point) (point-min)) bookmark-search-size)
(buffer-substring-no-properties
(point)
(- (point) bookmark-search-size))
nil))
(position . ,(point))))