From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Chmouel Boudjnah Newsgroups: gmane.emacs.bugs Subject: bug#69426: 29.2; Let eglot-rename suggest thing-at-point when renaming Date: Tue, 27 Feb 2024 13:59:26 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6395"; mail-complaints-to="usenet@ciao.gmane.io" To: 69426@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 27 14:18:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rexLj-0001Tb-6y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Feb 2024 14:18:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rexLD-0004Wi-GN; Tue, 27 Feb 2024 08:17:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rexL2-0004To-Gn for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 08:17:43 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rexKy-00081Y-Uu for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 08:17:39 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rexLO-0005nG-HQ for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 08:18:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Chmouel Boudjnah Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Feb 2024 13:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69426 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170903982322144 (code B ref -1); Tue, 27 Feb 2024 13:18:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Feb 2024 13:17:03 +0000 Original-Received: from localhost ([127.0.0.1]:52266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rexKQ-0005kn-9A for submit@debbugs.gnu.org; Tue, 27 Feb 2024 08:17:03 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:57952) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rex4v-00050u-3P for submit@debbugs.gnu.org; Tue, 27 Feb 2024 08:01:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rex4U-0005VT-GR for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 08:00:34 -0500 Original-Received: from ci74p00im-qukt09081501.me.com ([17.57.156.4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rex4O-0004LX-AP for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 08:00:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chmouel.com; s=sig1; t=1709038804; bh=K2+osnwcWk3Y4JgJ6TycqKRvhttoFeuPpg+TaxJ8+go=; h=MIME-Version:From:Date:Message-ID:Subject:To:Content-Type; b=bTZyqyQlxDwf+O/4F3hxP1eCV/y6dQiUtzTPcp88Dpy8GCDsfnwKFutMafHFWEN7u wC8N/E2GYsP1RhAjjDHHbwfJvgDLPtID2Nf7AtFc/VEDDQIW2N6a9gfUef6w2M75zq 9dCAOKKf15v+vg1zK3ja65DESiw4oIzXKW4vM2S10I6nD+3xyiSLia8T2VTgzIDTFS zUtxImdkjbFAsvaew43Vafis7/FeUYp5oq1M0lgE7ab0za/MOd26dqn4F+oRhvRD6X a6O3XS45BBZzHJlz6WpR44dX0cYIeif0qdhaHbByBfy6koC/iDHJMPwvtUAbtW6DVx qbvMJ0lZQTWlA== Original-Received: from mail-oo1-f46.google.com (ci77p00im-dlb-asmtp-mailmevip.me.com [17.57.156.26]) by ci74p00im-qukt09081501.me.com (Postfix) with ESMTPSA id B1D0825C01FD for ; Tue, 27 Feb 2024 13:00:03 +0000 (UTC) Original-Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5a035a1124dso1559447eaf.1 for ; Tue, 27 Feb 2024 05:00:03 -0800 (PST) X-Gm-Message-State: AOJu0Yxk2cl3GEGb1TncwVfUhTBj3uBa58s0d6zjtokGBs078NmQDO5z qZHzApmzi47tntzry59lN0PU5nC1cbFbBHma1+6Gu6BkMnD0604MZUU27sOMgZi3zniM5lc/8Q1 hoP60xrigi1Cr0bVmcQJWwCYtZLs= X-Google-Smtp-Source: AGHT+IHGEk24ztJN5o1vEg9vHNo0Pu+FDlZGqlXHNfnbP4hUMbFJoTMgQNfUiUWrhmgvmCAKmUTzs09U34A+ngBZlPQ= X-Received: by 2002:a4a:3449:0:b0:5a0:b781:fddf with SMTP id n9-20020a4a3449000000b005a0b781fddfmr903962oof.3.1709038802586; Tue, 27 Feb 2024 05:00:02 -0800 (PST) X-Gmail-Original-Message-ID: X-Proofpoint-ORIG-GUID: aLftvM7g3L90OPCq0HwY013aswyPqe3S X-Proofpoint-GUID: aLftvM7g3L90OPCq0HwY013aswyPqe3S X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-26_11,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 bulkscore=0 clxscore=1030 spamscore=0 malwarescore=0 mlxlogscore=754 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2308100000 definitions=main-2402270101 Received-SPF: pass client-ip=17.57.156.4; envelope-from=chmouel@chmouel.com; helo=ci74p00im-qukt09081501.me.com X-Spam_score_int: -23 X-Spam_score: -2.4 X-Spam_bar: -- X-Spam_report: (-2.4 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 27 Feb 2024 08:16:59 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:280725 Archived-At: When using eglot-rename it asks for a new name (for the variable for example) to rename to, it would be nice if there was a way to have the current thing-at-point suggested as the new name. Usually when renaming a variable you want to rename it to something that is related to the current name with the defautl behavior you have to type the current name manually. I have a function like this that does it: (defun my-eglot-rename (newname) "Rename the current symbol to NEWNAME with initial input a." (interactive (list (read-from-minibuffer (format "Rename`%s' to: " (or (thing-at-point 'symbol t) "unknown symbol")) (or (thing-at-point 'symbol t) "") nil nil nil (symbol-name (symbol-at-point))))) (eglot--server-capable-or-lose :renameProvider) (eglot--apply-workspace-edit (jsonrpc-request (eglot--current-server-or-lose) :textDocument/rename `(,@(eglot--TextDocumentPositionParams) :newName ,newname)) which probably can work as advice to eglot-rename but it would be nice if we can have this builtin.