;;; -*- lexical-binding: t -*- ;;; ;;; this file: ;;; http://user.it.uu.se/~embe8573/emacs-init/my-string.el ;;; https://dataswamp.org/~incal/emacs-init/my-string.el (defun hline (&optional char) (interactive "P") (let ((len (- (window-width) (current-column) 1)) (c (or char ?-)) ) (insert (make-string len c)) )) (when nil (hline)------------------------------------------------------------------------ (hline 43)+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ M-x hline RET------------------------------------------------------------------ C-u 59 M-x hline RET;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ) (defun empty-string-p (str) (string= "" str) ) (defun region-to-string () "Return the region text as a string. Replace newlines with spaces." (when (use-region-p) (let ((text (buffer-substring-no-properties (mark) (point)))) (replace-regexp-in-string "\n" " " text) ))) (provide 'my-string)