帮你精通Elisp:盘点elisp所有的操作对象

概要

分类 Elisp 操作的所有对象

1) character, string, line
2) point, mark, region
3) buffer and file
4) window and frame

其中第一类也就是文本,在《简明elisp教程》中也包含font, color等其他对象元素。

第一类 文本

// Number:

interactive-function (read-number)

// Character:
goto-char,point 是指针,char 则是特定的元素;
(char-to-string)
//interactive
(read-char)
// predicates
char-table-p
// 


//String:
interactive-function 符号 s (read-string)
(search-forward) (re-search-forward)
(count-word)

// Sentence 
(forward-sentence) (forward-paragraph)
(re-search-forward) (sentence-end)


第二类 Point

Point

(point), (point-min), (point-max)

(save-excursion)

// variable 
(kill-ring-yank-pointer)
// 

Mark

push-mark ;; interactive-function 中 (mark) 符号 m

Region

(region-beginning) (region-end) ;; interactive-function
(narrow-to-region),(widen)
(delete-and-extract-region)
(copy-region-as-kill)
;;varible 
kill-ring, 
// narrwo and widen 
(with-temp-buffer
  (insert "hello world")
  (narrow-to-region 1 6)
  (list (buffer-narrowed-p)
        (save-restriction
          (widen)
          (buffer-narrowed-p))
        (buffer-narrowed-p)))

: (t nil t)

Kill and Yank

// variable 
kill-ring-yank-pointer, kill-ring
// functions 
(yank), (yank-pop)
(kill-ring-save), 

第三类 Buff

Line

(forward-line), (what-line), (count-lines)

Buffer & File

Buffer

将buffer当作string。
(curret-buffer), (other-buffer), ;; (read-buffer) 字符 B
(set-buffer), (get-buffer), (get-buffer-create), (generate-new-buffer)
(insert-buffer-string), 复制,黏贴
(beginning-of-buffer), (end-of-buffer)
(mark-whole-buffer), (append-to-buffer)
(erase-buffer)

File

find-file-noselect 
expand-file-name


第四类

Window


Frame

五、List 方法

car, cdr, cons,
nthcdr, nth, setcar, setcdr, aref 
// 重新回到了通州的那段岁月。
(aref [1 2 3] 0)
: 1
(length)

六、Cutting and Storing Text

king-ring is a list containning text.

(kill-region)
(yank)


七、Conditionals and iterations

(when) ;; let是最外层的逻辑
(cond)
(while animals
  (setq animals (cdr animals))
(reverse)
dolist reduce
dotimes range
;; recursions的三种patterns
every, accumulate, 


八、apply and eval

(eval-last-sexp)

九、 devices

global-set-key
global-unset-key
展开阅读全文

页面更新:2024-04-28

标签:通州   对象   操作   概要   简明   指针   符号   字符   逻辑   元素   也就是   文本   岁月   方法   教程

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号

Top