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: Fri, 01 Oct 2021 17:04:00 +0800 Message-ID: <87o889ce0v.fsf@localhost> References: <875yuvlrz3.fsf@gnus.org> <87r1djixiw.fsf@gnus.org> <878rzrzpfz.fsf@localhost> <87zgs7y5wc.fsf@localhost> <87sfxyftrw.fsf@gnus.org> <87mto6ifd2.fsf@localhost> <83r1diz5k9.fsf@gnu.org> <87r1diqodc.fsf@localhost> <87ee9h27rm.fsf@gnus.org> <87wnmxcjhm.fsf@localhost> <87mtntw79p.fsf@gnus.org> <87tui1cirr.fsf@localhost> <87ee95w6pv.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="12893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , Stefan Kangas , arthur.miller@live.com, emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 01 11:07:15 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 1mWEVd-00035r-VR for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 11:07:13 +0200 Original-Received: from localhost ([::1]:38276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWEVc-0000Zz-MW for ged-emacs-devel@m.gmane-mx.org; Fri, 01 Oct 2021 05:07:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWERK-00026G-Uf for emacs-devel@gnu.org; Fri, 01 Oct 2021 05:02:46 -0400 Original-Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]:39760) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWERI-0005uM-VQ; Fri, 01 Oct 2021 05:02:46 -0400 Original-Received: by mail-pg1-x529.google.com with SMTP id g184so8835956pgc.6; Fri, 01 Oct 2021 02:02:44 -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=wUbGcsRnjLTVKTVP5DUWCK3loe0IQBrJozDU03iRQNc=; b=Cz4CF3e9zKakFI/CjOue26yGviUFjNu2pAyEQaXPuXt6kHrbjIgPj2vx2XpHYKXeLg rX8LdavyXaF5OihoV1BVJ7ueLaFyX8Ytv5oHOzVR/E82R/k//buAlNt7DEt2Is9hJ03H z0VogkO4qOw8Pd0fZS1/iUGJV0el8uLI6DBYpSp44Atyj75JyVJPIeu5KXXugdJ+OwEW ac7ZxXLCWH+LtvQFGxlGjatWbl26/Nw415b8esFoyS3Iw04aq6kj80CsxNfR3EyoF8Cb 9ba9KIk4m9qCAygx4cV0uaazxE1nL6KMw3y8Yzt0/F+lyQu+fWffi/likzE6SLclk1lt mTuQ== 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=wUbGcsRnjLTVKTVP5DUWCK3loe0IQBrJozDU03iRQNc=; b=fdsmyPUEEfbcSnIlU2IWGr4KNcggsw7xLzCD20BjqggKZeMmfxpUnwneLdAoJnVslX TMc5wOug1en4Y+xOLYKkc3K9WOxX8+llV/x8tgIXC437C7Mr8qgUfsYCCKE7rEQTO2E2 P9XPVDZS+ME6CBzwbJs9D89EDVZemSMAh7UvRCKq+pOUYDrl7XijsIQi499/ki7AcRhm bOLhk6VOkd5CXY3QneZuI1FUjogGuUlJugW95s5ZGgg8Jewo/HoWWkLYbBs8iFpbEC5w +OcEfl+9NREt0s0d6XXX9vdK8HblyrR5FSyCpTDuWlmMQy9HnmgM0XUc0+tr5Zka43gX Gmgw== X-Gm-Message-State: AOAM53166PKCBvqVYO6uAZGqyjz2+hbK0TayC5OJ0omkHciSw0JOwm71 Q+FJTWwv4QtCtwhpkf5JvPc= X-Google-Smtp-Source: ABdhPJwDZG+DrZARoK1jr18fwfykQhwYM2qQBnkpChurnavwiAjN3OLsWQqWmqO2E8MQJdGBUGiriA== X-Received: by 2002:a63:5c63:: with SMTP id n35mr8922849pgm.311.1633078963076; Fri, 01 Oct 2021 02:02:43 -0700 (PDT) Original-Received: from localhost ([210.3.160.230]) by smtp.gmail.com with ESMTPSA id e24sm5392392pfn.8.2021.10.01.02.02.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 02:02:41 -0700 (PDT) In-Reply-To: <87ee95w6pv.fsf@gnus.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=yantar92@gmail.com; helo=mail-pg1-x529.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:275968 Archived-At: --=-=-= Content-Type: text/plain Lars Ingebrigtsen writes: > Ihor Radchenko writes: > >> What about the other patch (Honor widen-automatically in >> help-function-def--button-function)? > > Could you re-post that patch? :-) Attached --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Honor-widen-automatically-in-help-function-def-butto.patch >From 635b8cab71d9f296bdef68dafd1d124213b777c2 Mon Sep 17 00:00:00 2001 Message-Id: <635b8cab71d9f296bdef68dafd1d124213b777c2.1633078979.git.yantar92@gmail.com> From: Ihor Radchenko Date: Fri, 1 Oct 2021 17:02:06 +0800 Subject: [PATCH] Honor widen-automatically in help-function-def--button-function * lisp/help-mode.el (help-function-def--button-function): Ask user to widen the buffer when `widen-automatically' is set to nil. --- lisp/help-mode.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/help-mode.el b/lisp/help-mode.el index d61b1bdc62..2132a143c7 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -268,11 +268,14 @@ help-function-def--button-function (pop-to-buffer (car location)) (run-hooks 'find-function-after-hook) (if position - (progn + (catch :exit ;; Widen the buffer if necessary to go to this position. (when (or (< position (point-min)) (> position (point-max))) - (widen)) + (if (or widen-automatically + (yes-or-no-p "The location is outside narrowing. Widen? ")) + (widen) + (throw :exit nil))) ;; Save mark for the old location, unless the point is not ;; actually going to move. (unless (= (point) position) -- 2.32.0 --=-=-=--