]> git.eshelyaron.com Git - emacs.git/commitdiff
New library dwim.el
authorEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 21:12:52 +0000 (22:12 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 21:12:52 +0000 (22:12 +0100)
lisp/dwim.el [new file with mode: 0644]
lisp/progmodes/elisp-mode.el
lisp/progmodes/prog-mode.el

diff --git a/lisp/dwim.el b/lisp/dwim.el
new file mode 100644 (file)
index 0000000..fa3949d
--- /dev/null
@@ -0,0 +1,29 @@
+;;; dwim.el --- Do what I mean   -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2025  Eshel Yaron
+
+;; Author: Eshel Yaron <me@eshelyaron.com>
+;; 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 <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+(defvar dwim-hook nil)
+
+;;;###autoload
+(defun dwim () (interactive) (run-hooks 'dwim-hook))
+
+(provide 'dwim)
+;;; dwim.el ends here
index a2f6272415a22d4644f5de8de765ef8bf7b40909..b6b49bc3a7fde783e7ea8b1d755b4523313856f0 100644 (file)
@@ -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)
index 664f2551af966f94b582405ed50b6340b092ee6b..23594f22ad4848335d956f2062831b0ff1933778 100644 (file)
   :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