<2022-09-03 Sat>
边读Emacs Lisp Intro
边做题(四)
打开emacs
,按C-h i
打开Info
页,找到Emacs Lisp Intro
。
原来是有答案可以参考的呀,见:“EmacsLispIntro”,即:“RenWenshan/emacs-lisp-intro-solutions”。
12.6
第一题中的pattern
参考自答案。
(defun exercise-12.6-1 (arg)
"exercise 12.6.1
Write a function to search for a regular expression that matches two or more
blank lines in sequence."
(interactive "p")
(or arg (setq arg 1))
(let ((opoint (point))
(pattern "^\n\n+"))
(while (> arg 0)
(let ((pattern-end (save-excursion (end-of-paragraph-text) (point))))
(if (re-search-forward pattern nil t)
()
(message "Not found")))
(setq arg (1- arg)))))