unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#53417: reftex-change-label behavior
@ 2022-01-21 18:03 Joseph Helfer
  2022-01-22 12:02 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Helfer @ 2022-01-21 18:03 UTC (permalink / raw)
  To: 53417

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

Hello,

I apologize if I am not following the usual protocols for bug reports.

This is somewhere between a bug report and a feature request.

The function `reftex-change-label' defined in
`lisp/textmodes/reftex-global.el' asks for the label you want to
change (`from') and what you want to change it to (`to'). The default
value for `from' is the label under point, which is good. I think the
initial input for `to' should be this as well (or rather, whatever was
entered for `from'), since usually, one just wants to make a small
change.

This is a trivial edit. I have attached an appropriate patch for the file
https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/textmodes/reftex-global.el?h=emacs-28.0.91

It could be better to add a customizable variable to control this
behavior, but I am not familiar enough with the reftex code to provide
a patch for that now. However, I think the new proposed behavior is
better, and I doubt that any existing code depends on the old
behavior.

Best,
Joj

[-- Attachment #2: reftex-global.el.patch --]
[-- Type: text/x-patch, Size: 473 bytes --]

--- reftex-global.el	2022-01-21 09:49:22.089091968 -0800
+++ reftex-global-patched.el	2022-01-21 09:51:20.594179163 -0800
@@ -183,7 +183,7 @@
     (if (string= from "") (setq from default))
     (unless to
       (setq to (read-string (format "Replace label %s with: "
-                                    from))))
+                                    from) from)))
     (reftex-query-replace-document
      (concat "{" (regexp-quote from) "}")
      (format "{%s}" to))))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#53417: reftex-change-label behavior
  2022-01-21 18:03 bug#53417: reftex-change-label behavior Joseph Helfer
@ 2022-01-22 12:02 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 2+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-22 12:02 UTC (permalink / raw)
  To: Joseph Helfer; +Cc: 53417

Joseph Helfer <joseph.helfer@gmail.com> writes:

> The function `reftex-change-label' defined in
> `lisp/textmodes/reftex-global.el' asks for the label you want to
> change (`from') and what you want to change it to (`to'). The default
> value for `from' is the label under point, which is good. I think the
> initial input for `to' should be this as well (or rather, whatever was
> entered for `from'), since usually, one just wants to make a small
> change.

Makes sense to me.  However, we're moving away from using INITIAL-INPUT
for these functions, and instead putting things like this into
DEFAULT-VALUE, which means that the user can hit `M-n' to edit it.  So
I've now done that in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-22 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 18:03 bug#53417: reftex-change-label behavior Joseph Helfer
2022-01-22 12:02 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).