yatex
diff yatexlib.el @ 482:9132c20372ec
Remove comment.el and incorporate it into yatexlib.el
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 10 Sep 2017 21:08:14 +0859 |
parents | 723f136edde5 |
children | 6dcd746db62e |
line diff
1.1 --- a/yatexlib.el Sun Sep 10 17:03:34 2017 +0859 1.2 +++ b/yatexlib.el Sun Sep 10 21:08:14 2017 +0859 1.3 @@ -1,7 +1,7 @@ 1.4 ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*- 1.5 ;;; 1.6 ;;; (c)1994-2017 by HIROSE Yuuji.[yuuji@yatex.org] 1.7 -;;; Last modified Sun Sep 10 09:53:33 2017 on firestorm 1.8 +;;; Last modified Sun Sep 10 18:12:33 2017 on firestorm 1.9 ;;; $Id$ 1.10 1.11 ;;; Code: 1.12 @@ -1666,6 +1666,34 @@ 1.13 (/ (nth 2 before) mil)))))) 1.14 1.15 ;;; 1.16 +;; Moved from comment.el 1.17 +;;; 1.18 +(defun YaTeX-comment-region-sub (string &optional beg end once) 1.19 + "Inserts STRING at the beginning of every line between BEG and END." 1.20 + (if (not (stringp string)) (setq string YaTeX-comment-prefix)) 1.21 + (let ((b (or beg (region-beginning))) (e (or end (region-end)))) 1.22 + (save-excursion 1.23 + (goto-char (max b e)) 1.24 + (if (bolp) 1.25 + (forward-line -1)) 1.26 + (save-restriction 1.27 + (narrow-to-region (min b e) (point)) 1.28 + (goto-char (point-min)) 1.29 + (message "%s" string) 1.30 + (while (re-search-forward "^" nil t) 1.31 + (insert string)))))) 1.32 + 1.33 +(defun YaTeX-uncomment-region-sub (string &optional beg end once) 1.34 + "Deletes STRING from the beginning of every line between BEG and END." 1.35 + (save-excursion 1.36 + (save-restriction 1.37 + (narrow-to-region (or beg (region-beginning)) (or end (region-end))) 1.38 + (goto-char (point-min)) 1.39 + (while (re-search-forward (concat "^" string) nil t) 1.40 + (replace-match "") 1.41 + (if once (end-of-line)))))) 1.42 + 1.43 +;;; 1.44 ;; Functions for the Installation time 1.45 ;;; 1.46