emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode 3da5817 383/495: refactor/rename: allow passing -f


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 3da5817 383/495: refactor/rename: allow passing -force flag from Emacs
Date: Sat, 7 Aug 2021 09:05:53 -0400 (EDT)

branch: elpa/go-mode
commit 3da5817df778a80e090fe8156750ff6d63d2cf02
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>

    refactor/rename: allow passing -force flag from Emacs
    
    Change-Id: Iac9355bc8a98cf61cb3d4ff871723ce466d38531
    Reviewed-on: https://go-review.googlesource.com/2912
    Reviewed-by: Alan Donovan <adonovan@google.com>
---
 rename_import/refactor/rename/rename.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/rename_import/refactor/rename/rename.el 
b/rename_import/refactor/rename/rename.el
index 9268358..ea6c744 100644
--- a/rename_import/refactor/rename/rename.el
+++ b/rename_import/refactor/rename/rename.el
@@ -25,10 +25,12 @@
   :type 'string
   :group 'go-rename)
 
-(defun go-rename (new-name)
+(defun go-rename (new-name &optional force)
   "Rename the entity denoted by the identifier at point, using
-the `gorename' tool."
-  (interactive (list (read-string "New name: " (thing-at-point 'symbol))))
+the `gorename' tool. With FORCE, call `gorename' with the
+`-force' flag."
+  (interactive (list (read-string "New name: " (thing-at-point 'symbol))
+                     current-prefix-arg))
   (if (not buffer-file-name)
       (error "Cannot use go-rename on a buffer without a file name"))
   ;; It's not sufficient to save the current buffer if modified,
@@ -50,7 +52,7 @@ the `gorename' tool."
     (with-current-buffer (get-buffer-create "*go-rename*")
       (setq buffer-read-only nil)
       (erase-buffer)
-      (let ((args (list go-rename-command nil t nil posflag "-to" new-name)))
+      (let ((args (append (list go-rename-command nil t nil posflag "-to" 
new-name) (if force '("-force")))))
         ;; Log the command to *Messages*, for debugging.
         (message "Command: %s:" args)
         (message "Running gorename...")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]