From 33c7ddb09e0eae0796686c64ffa022a181145cc1 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 4 Jan 2023 23:21:15 -0600 Subject: Restart ... again ... again --- lisp/+hungry-delete.el | 53 -------------------------------------------------- 1 file changed, 53 deletions(-) delete mode 100644 lisp/+hungry-delete.el (limited to 'lisp/+hungry-delete.el') diff --git a/lisp/+hungry-delete.el b/lisp/+hungry-delete.el deleted file mode 100644 index 601aecf..0000000 --- a/lisp/+hungry-delete.el +++ /dev/null @@ -1,53 +0,0 @@ -;;; +hungry-delete.el -*- lexical-binding: t; -*- - -;; Copyright (C) 2022 Case Duckworth - -;;; Code: - -(require 'hungry-delete) - -(defmacro +hungry-delete-define-alternative (func hd-func &optional direction) - "Define a `hungry-delete' alternative for FUNC. -If the adjacent characters in DIRECTION are one of -`hungry-delete-chars-to-skip', call HD-FUNC. Otherwise, call -FUNC. - -If DIRECTION is a positive integer or `forward', look forward. -If it's negative or `backward', look backward. If it's absent, -this macro will try to guess based on the names of FUNC and -HD-FUNC. - -This macro creates a function taking a prefix argument that's -passed to both of FUNC and HD-FUNC." - (let ((name (intern (format "%s|%s" func hd-func))) - (lookfn (cond - ((or (and (string-match-p "forward" (symbol-name func)) - (string-match-p "forward" (symbol-name hd-func)) - (not direction)) - (and (integerp direction) - (< 0 direction)) - (eq direction 'forward)) - 'looking-at) - ((or (and (string-match-p "backward" (symbol-name func)) - (string-match-p "backward" (symbol-name hd-func)) - (not direction)) - (and (integerp direction) - (> 0 direction)) - (eq direction 'backward)) - 'looking-back) - (:else (error "Bad direction: %S" direction)))) - (arg (gensym))) - `(defun ,name (,arg) - ,(concat (format "Do `%s' or `%s', depending on whitespace.\n" - func hd-func) - (format "Pass prefix argument %s to the underlying functions.\n" - (upcase (symbol-name arg))) - "This function was defined by `define-hungry-delete-alternative'.") - (interactive "*p") ; This is brittle - (if (,lookfn (format "[%s]" hungry-delete-chars-to-skip)) - (,hd-func (or ,arg 1)) - (,func ,arg))))) - -(provide '+hungry-delete) -;;; +hungry-delete.el ends here - -- cgit 1.4.1-21-gabe81