Annotation of reports/tools.el, revision 1.9

1.1       boris       1: (defun add-spaces (&optional num)
                      2:   "Add spaces until the line has num spaces"
                      3:   (interactive "p")
                      4:   (if (<= num 1) (setq num 70))
                      5:   (end-of-line)
                      6:   (while (> num (- (line-end-position) (line-beginning-position)))
                      7:     (insert " "))
                      8:   (beginning-of-line))
1.3       boris       9: 
1.4       boris      10: (defun convert-utf-to-html-entites  ()
                     11:   "Convert utf entities to html"
                     12:   (interactive)
                     13:   (save-excursion
1.6       boris      14:     (setq case-fold-search nil)
1.4       boris      15:     (beginning-of-buffer)
                     16:     (while (search-forward "«" nil t)
                     17:     (replace-match "&laquo;" nil t))
1.8       boris      18:     (beginning-of-buffer)
1.4       boris      19:     (while (search-forward "»" nil t) 
                     20:     (replace-match "&raquo;" nil t))
1.8       boris      21:     (beginning-of-buffer)
1.5       boris      22:     (while (search-forward "–" nil t) 
                     23:     (replace-match "&ndash;" nil t))
1.8       boris      24:     (beginning-of-buffer)
                     25:     (while (search-forward "—" nil t) 
                     26:     (replace-match "&mdash;" nil t))
                     27:     (beginning-of-buffer)
1.4       boris      28:     (while (search-forward "Є" nil t) ; YE
                     29:     (replace-match "&#x404;" nil t))
                     30:     (beginning-of-buffer)
1.9     ! boris      31:     (while (search-forward "є" nil t) ; YE
        !            32:     (replace-match "&#x454;" nil t))
        !            33:     (beginning-of-buffer)
1.4       boris      34:     (while (search-forward "і" nil t) ; i
                     35:     (replace-match "&#1110;" nil t))
                     36:     (beginning-of-buffer)
                     37:     (while (search-forward "ї" nil t) ; yi
                     38:     (replace-match "&#1111;" nil t))
1.7       boris      39:     (beginning-of-buffer)
                     40:     (while (search-forward "І" nil t) ; yi
                     41:     (replace-match "&#x406;" nil t))
1.4       boris      42:   ))

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>