Files
.emacs.d/modules/text-editing/siren-shift-text.el
Jim Myhrberg fe6a4e7ce5 fix(elisp): add lexical-binding comment to all files to suppress new Emacs 31 warnings
I've set `lexical-binding` to `nil` in all Emacs Lisp files to suppress
the warnings introduced in Emacs 31 requiring all elisp files to have a
`lexical-binding` comment.

This retains the default behavior of dynamic binding when no
`lexical-binding` comment is present. With it set to `t` across the
board, various things break, and fixing those is a task for another day.
2025-06-29 12:23:03 +01:00

32 lines
939 B
EmacsLisp

;;; siren-shift-text.el --- jimeh's Emacs Siren: shift-text -*- lexical-binding: nil; -*-
;;; Commentary:
;; Configuration for shift-text
;;; Code:
(defun siren-shift-right (&optional arg)
"Shift the line or region to the ARG places to the right.
A place is considered `tab-width' character columns."
(interactive)
(let ((deactivate-mark nil)
(beg (or (and mark-active (region-beginning))
(line-beginning-position)))
(end (or (and mark-active (region-end)) (line-end-position))))
(indent-rigidly beg end (* (or arg 1) tab-width))))
(defun siren-shift-left (&optional arg)
"Shift the line or region to the ARG places to the left."
(interactive)
(siren-shift-right (* -1 (or arg 1))))
(siren-general-define-key
"C-c [" 'siren-shift-left
"C-c ]" 'siren-shift-right
"M-{" 'siren-shift-left
"M-}" 'siren-shift-right)
(provide 'siren-shift-text)
;;; siren-shift-text.el ends here