]> git.eshelyaron.com Git - emacs.git/commitdiff
; Fix compilation warning in string-edit.el
authorEli Zaretskii <eliz@gnu.org>
Sat, 26 Apr 2025 15:01:42 +0000 (18:01 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sun, 27 Apr 2025 13:28:59 +0000 (15:28 +0200)
* lisp/textmodes/string-edit.el (string-edit): Avoid shadowing the
global 'major-mode'.

(cherry picked from commit 191b4cd9a76aa31ff9711370842394f37955c06a)

lisp/textmodes/string-edit.el

index c8fdffe5f4c06ae167616c8e81653ad7286d35e5..dda70437f78b532cf28bd0119d7c10ea7692dd88 100644 (file)
 
 ;;;###autoload
 (cl-defun string-edit (prompt string success-callback
-                              &key abort-callback major-mode read)
+                              &key abort-callback major-mode-sym read)
   "Switch to a new buffer to edit STRING.
 
-Call MAJOR-MODE (defaulting to `string-edit-mode') to set up the new
+Call MAJOR-MODE-SYM (defaulting to `string-edit-mode') to set up the new
 buffer, and insert PROMPT (defaulting to nothing) at the start of the
 buffer.
 
@@ -79,7 +79,7 @@ Also see `read-string-from-buffer'."
 
     (set-buffer-modified-p nil)
     (setq buffer-undo-list nil)
-    (funcall (or major-mode #'string-edit-mode))
+    (funcall (or major-mode-sym #'string-edit-mode))
     (string-edit-minor-mode)
     (setq-local string-edit--success-callback success-callback)
     (setq-local string-edit--abort-callback abort-callback)