From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Patch proposal: display symbol source code in help buffers Date: Tue, 21 Sep 2021 14:59:05 +0800 Message-ID: <87mto6ifd2.fsf@localhost> References: <875yuvlrz3.fsf@gnus.org> <87r1djixiw.fsf@gnus.org> <878rzrzpfz.fsf@localhost> <87zgs7y5wc.fsf@localhost> <87sfxyftrw.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22994"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Kangas , Arthur Miller , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Sep 21 09:18:37 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mSa32-0005lA-VG for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 09:18:36 +0200 Original-Received: from localhost ([::1]:42826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSa31-0004bb-RW for ged-emacs-devel@m.gmane-mx.org; Tue, 21 Sep 2021 03:18:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSZj5-0003ic-9O for emacs-devel@gnu.org; Tue, 21 Sep 2021 02:57:59 -0400 Original-Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]:43960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSZj2-0006VF-Tl for emacs-devel@gnu.org; Tue, 21 Sep 2021 02:57:58 -0400 Original-Received: by mail-pl1-x62d.google.com with SMTP id y1so5791415plk.10 for ; Mon, 20 Sep 2021 23:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Gue5ZTABKIrSXAv5Un50YMRLn9ZKaFxR/mVwYpXxj0c=; b=lel6/+c3l7VkASOWwKt7zzGq0rxqFDTkXMRZTKGWlOEnyLW7hub/O8jzSrgJF5u0Bb vXTzvCFHt+gBbQwyame4BtHJ60a3ytyOZN8jvpP82wEyqNQjyMOhdpzvZjmL/A5OfVtb FErz7pin8Tx87t5MYocDWsrjdGRI5asNXoeV3ZrXlcTM6nODmlwnKImJhObLI6gV14w0 EL0AO473Fb/wsdtmR8PQX2LbgeWmHEsfLodVdxFNxNeD3suQOmLpYgWv4c32AFL1FyeX 93zGdFUQt0YuqTjt2Th8Zf+4bieDDdvamHGvgcLzf6U1/hrwGJG/UBBybvMGORkcgM+2 bmuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Gue5ZTABKIrSXAv5Un50YMRLn9ZKaFxR/mVwYpXxj0c=; b=dp65w+crc+0Aqc/rkI+nMfcG5vA0KqGRQjubxYO68XQKxbfXm+V28HBNj77H6yLG20 qJpqRpVzV6LS9bzEQtcm+9Ogr36e5PHn61kpHoIXRoH+044ORcUyM8bGwNcQBCHp4D1Z gJmsNyjZdBnbLFRvaQN8zgYMi2hsDJ1Aqw5h7Fp14KeB4LMEtbrsYelvRO6OfY2cEOia nxeoF3QkGnMiHPbMnr0KRnddVaA5SntKS9XuKV4PdyFeFAPJFw/f7yO4Q49u2LM3z5Dh kvmbagPAH1cssh0e91JdAlGQtMqpT3Ba3Rhq/7Cjth/TDDuyfPiCbMufIIjFs03BDGCS kZEg== X-Gm-Message-State: AOAM531+32MOUA/UuKSK5LmEhhYCYeQnyd8m+P0lml0jXaqB8lO9N/8K qynC0ITx5UMjRbuZl376ewU= X-Google-Smtp-Source: ABdhPJyGzJBrL65s/TlrThYNQveQ77RAAIh2aGpiw1eAC51e8RLLaGnweJjuimCFrtO1eMa8i95OWA== X-Received: by 2002:a17:902:9009:b0:13b:9cae:5dd7 with SMTP id a9-20020a170902900900b0013b9cae5dd7mr26270480plp.53.1632207474786; Mon, 20 Sep 2021 23:57:54 -0700 (PDT) Original-Received: from localhost ([50.7.251.66]) by smtp.gmail.com with ESMTPSA id o14sm16856334pfh.84.2021.09.20.23.57.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 23:57:53 -0700 (PDT) In-Reply-To: <87sfxyftrw.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=yantar92@gmail.com; helo=mail-pl1-x62d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275200 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Ihor Radchenko writes: > >> That would make sense. Yet, even without narrowing, I personally do not >> like that the point moves from the defun I am working on to other >> function definition. > > Yes, that is pretty annoying. Perhaps > `help-function-def--button-function' should push-mark before going to > the position? Then `C-x C-x' would bring you back to where you were... I like this idea. Maybe we can simply change the default value of find-function-after-hook like in the attached patch? Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Save-position-in-mark-ring-before-jumping-to-definit.patch >From 31f841b1e3921f7b2039656ed8f409b3b715741f Mon Sep 17 00:00:00 2001 Message-Id: <31f841b1e3921f7b2039656ed8f409b3b715741f.1632207397.git.yantar92@gmail.com> From: Ihor Radchenko Date: Tue, 21 Sep 2021 14:50:52 +0800 Subject: [PATCH] Save position in mark ring before jumping to definition * lisp/emacs-lisp/find-func.el (find-function-after-hook): `push-mark' is added to default value of the hook. Following up: https://lists.gnu.org/archive/html/emacs-devel/2021-09/msg01561.html --- etc/NEWS | 3 +++ lisp/emacs-lisp/find-func.el | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/etc/NEWS b/etc/NEWS index 2bdcb6434b..2132e8babc 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -648,7 +648,10 @@ clicking the "X" icon in the tool bar. --- *** 'g' ('revert-buffer') in 'help-mode' no longer requires confirmation. +*** Jumping to function/variable source now saves mark before moving point +Jumping to source from "*Help*" buffer moves the point when the source buffer is already open. Now, the old point is pushed to mark ring. +--- ** File Locks +++ diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 303039d653..b984fb3870 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -165,7 +165,7 @@ find-function-recenter-line :group 'find-function :version "20.3") -(defcustom find-function-after-hook nil +(defcustom find-function-after-hook '(push-mark) "Hook run after finding symbol definition. See the functions `find-function' and `find-variable'." -- 2.32.0 --=-=-=--