From f0f982a0dba09b0373693b68ce0189f5541e6865 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 20 Jan 2025 22:12:52 +0100 Subject: [PATCH] New library dwim.el --- lisp/dwim.el | 29 +++++++++++++++++++++++++++++ lisp/progmodes/elisp-mode.el | 1 - lisp/progmodes/prog-mode.el | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 lisp/dwim.el diff --git a/lisp/dwim.el b/lisp/dwim.el new file mode 100644 index 00000000000..fa3949d4dc1 --- /dev/null +++ b/lisp/dwim.el @@ -0,0 +1,29 @@ +;;; dwim.el --- Do what I mean -*- lexical-binding: t; -*- + +;; Copyright (C) 2025 Eshel Yaron + +;; Author: Eshel Yaron +;; Keywords: tools + +;; 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: + +(defvar dwim-hook nil) + +;;;###autoload +(defun dwim () (interactive) (run-hooks 'dwim-hook)) + +(provide 'dwim) +;;; dwim.el ends here diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index a2f6272415a..b6b49bc3a7f 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -2574,7 +2574,6 @@ for each element of ARGS." (defun elisp-create-missing-defun () (apply #'elisp-create-defun (elisp-create-defun-interactive-arguments))) - (defvar avy-action) (defvar elisp-extract-local-variable-name-history nil) diff --git a/lisp/progmodes/prog-mode.el b/lisp/progmodes/prog-mode.el index 664f2551af9..23594f22ad4 100644 --- a/lisp/progmodes/prog-mode.el +++ b/lisp/progmodes/prog-mode.el @@ -107,6 +107,7 @@ :doc "Keymap used for programming modes." "C-M-q" #'prog-indent-sexp "M-q" #'prog-fill-reindent-defun + "C-M-m" #'dwim "M-s M-r" #'refactor) (defvar prog-indentation-context nil -- 2.39.5