Subject: 26.1; reftex-toc-rename-label prompt incorrect

From: Ryan Kavanagh <[email-masked]>
Date: Sat, 15 Jun 2019 18:26:59 -0400

Package: auctex
Tags: patch

The reftex-toc-rename-label function is used to rename labels from the
TOC buffer. When the proposed new label already exists, the function
warns the user of this fact and asks the user to confirm their intent.

Unfortunately, it uses the wrong label name in the prompt: it warns the
user that the old label already exists instead of warning the user that
their proposed label already exists

Please see attached for a patch fixing this issue.

Emacs  : GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version
3.24.4) of 2019-02-03, modified by Debian
Package: 26.1

current state:
==============
(setq
 window-system 'x
 reftex-plug-into-AUCTeX t
 )
-- 
|)|/  Ryan Kavanagh      | GPG: 4E46 9519 ED67 7734 268F
|\|\  https://rak.ac     |      BD95 8F7B F8FC 4A11 C97A
--- reftex-toc.el.old	2019-06-15 18:12:47.662071109 -0400
+++ reftex-toc.el	2019-06-15 18:16:25.422666122 -0400
@@ -872,7 +872,7 @@
     (setq newlabel (read-string (format "Rename label \"%s\" to:" label)))
     (if (assoc newlabel (symbol-value reftex-docstruct-symbol))
         (if (not (y-or-n-p
-                  (format-message "Label `%s' exists.  Use anyway? " label)))
+                  (format-message "Label `%s' exists.  Use anyway? " newlabel)))
             (error "Abort")))
     (save-excursion
       (save-window-excursion