summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/subr-x.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-04-02 16:53:24 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-04-02 16:53:24 +0200
commit781c43de3d017323b945088cdb39031d51a5e6ef (patch)
treef9c61b284ef0d898d0235305f69814bde1bea8d6 /lisp/emacs-lisp/subr-x.el
parent56fb536e78f3e3019b85995ba1d788065c3ac415 (diff)
downloademacs-781c43de3d017323b945088cdb39031d51a5e6ef.tar.gz
Fix bootstrap errors after previous easy-mmode change
* lisp/subr.el (ensure-empty-lines, string-lines): Moved from subr-x so that they can be used in early bootstrap files. * lisp/emacs-lisp/easy-mmode.el (easy-mmode--mode-docstring): Don't use string-empty-p because of bootstrap issues.
Diffstat (limited to 'lisp/emacs-lisp/subr-x.el')
-rw-r--r--lisp/emacs-lisp/subr-x.el32
1 files changed, 0 insertions, 32 deletions
diff --git a/lisp/emacs-lisp/subr-x.el b/lisp/emacs-lisp/subr-x.el
index 7ad4e9ba2ab..abf85ab6c67 100644
--- a/lisp/emacs-lisp/subr-x.el
+++ b/lisp/emacs-lisp/subr-x.el
@@ -320,12 +320,6 @@ than this function."
(end (substring string (- (length string) length)))
(t (substring string 0 length)))))
-;;;###autoload
-(defun string-lines (string &optional omit-nulls)
- "Split STRING into a list of lines.
-If OMIT-NULLS, empty lines will be removed from the results."
- (split-string string "\n" omit-nulls))
-
(defun string-pad (string length &optional padding start)
"Pad STRING to LENGTH using PADDING.
If PADDING is nil, the space character is used. If not nil, it
@@ -414,32 +408,6 @@ and return the value found in PLACE instead."
,(funcall setter val)
,val)))))
-;;;###autoload
-(defun ensure-empty-lines (&optional lines)
- "Ensure that there are LINES number of empty lines before point.
-If LINES is nil or omitted, ensure that there is a single empty
-line before point.
-
-If called interactively, LINES is given by the prefix argument.
-
-If there are more than LINES empty lines before point, the number
-of empty lines is reduced to LINES.
-
-If point is not at the beginning of a line, a newline character
-is inserted before adjusting the number of empty lines."
- (interactive "p")
- (unless (bolp)
- (insert "\n"))
- (let ((lines (or lines 1))
- (start (save-excursion
- (if (re-search-backward "[^\n]" nil t)
- (+ (point) 2)
- (point-min)))))
- (cond
- ((> (- (point) start) lines)
- (delete-region (point) (- (point) (- (point) start lines))))
- ((< (- (point) start) lines)
- (insert (make-string (- lines (- (point) start)) ?\n))))))
;;;###autoload
(defun string-pixel-width (string)