From 59a1f58695d09ab29ddf992b2c0711c94a4039ea Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 3 Jan 2023 23:03:03 -0600 Subject: Switch to use-package --- lisp/scule.el | 61 ----------------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 lisp/scule.el (limited to 'lisp/scule.el') diff --git a/lisp/scule.el b/lisp/scule.el deleted file mode 100644 index 3ed58bb..0000000 --- a/lisp/scule.el +++ /dev/null @@ -1,61 +0,0 @@ -;;; scule.el --- -scule twiddling -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 Case Duckworth - -;; Author: Case Duckworth -;; Keywords: convenience - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: - -;; DWIM functions for twiddling "scule", or text case (a fancy word for "upper -;; case" is "magiscule", for example, and "lower case" is "miniscule"). - -;;; Code: - -(require 'thingatpt) - -;;; Utility macro -;;;###autoload -(defmacro defscule (name &optional region-fn word-fn) - (let ((fn-name (intern (format "scule-%s" name))) - (region-fn (or region-fn (intern (format "%s-region" name)))) - (word-fn (or word-fn (intern (format "%s-word" name))))) - `(defun ,fn-name (arg) - ,(concat (capitalize (symbol-name name)) " words in the region if active, or word at point.\n" - "If the region is active, call `" (symbol-name region-fn) "'.\n" - "Otherwise, it calls `" (symbol-name word-fn) "' on the word at point and\n" - "the following ARG - 1 words.") - (interactive "*p") - (if (use-region-p) - (,region-fn (region-beginning) (region-end) (region-noncontiguous-p)) - (let ((word-bound (save-excursion - (skip-chars-forward "^[:word:]") - (bounds-of-thing-at-point 'word)))) - (when (and (car word-bound) (cdr word-bound)) - (,region-fn (car word-bound) (cdr word-bound)) - (goto-char (cdr word-bound)) - (,word-fn (1- arg)))))))) - -;;;###autoload -(progn (defscule upcase) - (autoload 'scule-upcase "scule" nil t) - (defscule downcase) - (autoload 'scule-downcase "scule" nil t) - (defscule capitalize) - (autoload 'scule-capitalize "scule" nil t)) - -(provide 'scule) -;;; scule.el ends here -- cgit 1.4.1-21-gabe81