2022-04-11 18:54:30 +02:00
|
|
|
;;; x-lib.el -*- lexical-binding: t -*-
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +x/indent-region-or-buffer ()
|
|
|
|
"Indent a region if selected, otherwise the whole buffer."
|
|
|
|
(interactive)
|
|
|
|
(if (region-active-p)
|
|
|
|
(indent-region (region-beginning) (region-end))
|
|
|
|
(indent-region (point-min) (point-max))))
|
|
|
|
|
2022-04-13 01:41:52 +02:00
|
|
|
;;;###autoload
|
|
|
|
(defun +x/kill-buffer ()
|
|
|
|
"Kill current buffer without prompting for which buffer."
|
|
|
|
(interactive)
|
|
|
|
(kill-buffer))
|
|
|
|
|
2022-04-11 18:54:30 +02:00
|
|
|
;;;###autoload
|
|
|
|
(defun +x/scroll-down-one ()
|
|
|
|
"Scroll text (but not the point) of selected window downward one line."
|
|
|
|
(interactive)
|
|
|
|
(let ((scroll-preserve-screen-position nil))
|
|
|
|
(scroll-down 1)))
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +x/scroll-up-one ()
|
|
|
|
"Scroll text (but not the point) of selected window upward one line."
|
|
|
|
(interactive)
|
|
|
|
(let ((scroll-preserve-screen-position nil))
|
|
|
|
(scroll-up 1)))
|
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +x/unfill-paragraph (&optional region)
|
|
|
|
"Takes a multi-line paragraph and makes it into a single line of text."
|
|
|
|
(interactive (progn (barf-if-buffer-read-only) '(t)))
|
|
|
|
(let ((fill-column (point-max))
|
|
|
|
;; This would override `fill-column' if it's an integer.
|
|
|
|
(emacs-lisp-docstring-fill-column t))
|
|
|
|
(fill-paragraph nil region)))
|
|
|
|
|
|
|
|
(provide 'x-lib)
|
|
|
|
;;; x-lib.el ends here
|