From unknown Thu Aug 14 17:25:40 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77628 <77628@debbugs.gnu.org> To: bug#77628 <77628@debbugs.gnu.org> Subject: Status: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. Reply-To: bug#77628 <77628@debbugs.gnu.org> Date: Fri, 15 Aug 2025 00:25:40 +0000 retitle 77628 [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn ha= s no docstring. reassign 77628 emacs submitter 77628 Elijah Gabe P=C3=A9rez severity 77628 normal tag 77628 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 08 01:07:06 2025 Received: (at submit) by debbugs.gnu.org; 8 Apr 2025 05:07:06 +0000 Received: from localhost ([127.0.0.1]:58211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u21Aw-00060T-Ap for submit@debbugs.gnu.org; Tue, 08 Apr 2025 01:07:06 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47268) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u21Au-0005wt-F4 for submit@debbugs.gnu.org; Tue, 08 Apr 2025 01:07:04 -0400 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 1u21Ai-000728-Rf for bug-gnu-emacs@gnu.org; Tue, 08 Apr 2025 01:06:53 -0400 Received: from mail-oo1-xc43.google.com ([2607:f8b0:4864:20::c43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u21Ag-0001hN-Ss for bug-gnu-emacs@gnu.org; Tue, 08 Apr 2025 01:06:52 -0400 Received: by mail-oo1-xc43.google.com with SMTP id 006d021491bc7-601ad30bc0cso3585458eaf.0 for ; Mon, 07 Apr 2025 22:06:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744088807; x=1744693607; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=ElLUyOGXq1M5qKSdKQl0TxXljSRC3Cg/7PX5trlFWDM=; b=Cu86+pPjHKeQz6DLLsYIoF8R7fXBcw/TqSJj0HyycDvoY1SAWh03sOtQSENB0go70J ozmobWCicKM0ouDkkpdXq/wOYc1AMV6u+OeGhHtq/e24XMdbiwkCViFhZQ9lIG4MmsPn tkKlAWjbEn3V1RELiUIv1sW2UtGiGSurtOYcRgY4BosMQGuRtk3rPTXcSg8/kPVylg/G 7HRmrkkc2qI0cVw1QrgFx6tr1V7pZBBX/2ETbdeNDzh4qjAUIzd5bWfBB8C23Cjavh4/ 7Fv1rCeKQmjcZXsC4JmgpziNCnlQ5zPsuwHFUa3QLQbBN1QTarCaN5gKgKJHdJHCfAC/ BYkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744088807; x=1744693607; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ElLUyOGXq1M5qKSdKQl0TxXljSRC3Cg/7PX5trlFWDM=; b=nve13gyhRMknVg/chQfx99xyBm/Cdqu1P1A9FD70aX+pJW9Z8GGhSyGT4mbjsjGDqD FGyuIiXmm5GxvBBAqUdvGyniaqYiVEawmWdoVrTRXfZm/0oPsGkSc6NTjmHyqXx3PzKw iP2sP6oH+rlH2vVMZ2nLtDfScArvsikDTHygdJ3clfUGdB6KUEwLHMi6Ldc0Q6g1ckQW ELuoxCLpSihJhm74ikKFO5vGiYAe9QoYI4rAPTNdhLmMnSey6ttsLIkoZS5qfTt78Nxd kUqZrUOBzWsQsgKMG+YkVPu4vzFxOlVWUqVYCnyWx4Ymx1nDMdDP2nt5ercuAn8woQwN lFIQ== X-Gm-Message-State: AOJu0YzleOx1BORHbd7rdozduhmMGjABG1hJw051ZsudLyys1P58Mviq UodM/9TGP0EKEowM9mDWgBdu0pT8Lxsfom86d+qAGty7mR7AI1hZwC/l2ufi X-Gm-Gg: ASbGncuMtR3xDD9hbLpgssp7/9RkPY7phKoLjZHFFMHPofcrcega9RhVWfPradVPRlx ZeFYxkEb7trFIyAq6aKK/GbmuFK9on7GuKvVs9VmkGKM2FA+iWar3QmQFtajAhURiZ+P2AWVAF9 NK8GkSwcqmMLs4Nrl6ToE/smwLgLEHp1dhcoo0Dh8FZeUxOqhNv3PKvswcaGAFJG9OXUgcLPr3M qHSQIhowS31+iLN8b7xV6aR8LLv1w0SQrSZuLatBo3+uy06YE7FkkFGFk93ohHOr2pedbMlLDZC i3aGTbTcpspR X-Google-Smtp-Source: AGHT+IGLIY7my+zka7pb/vgwU0tHM3K0Fyy3LgsS4hXNrdjK8q3yPhVKP+eAxWsY2vgtod6A29OqHg== X-Received: by 2002:a05:6870:fe85:b0:2b1:db0e:e22d with SMTP id 586e51a60fabf-2d064324a78mr1326230fac.0.1744088807192; Mon, 07 Apr 2025 22:06:47 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-72e652544fbsm270736a34.49.2025.04.07.22.06.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 22:06:46 -0700 (PDT) From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= To: bug-gnu-emacs@gnu.org Subject: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. X-Debbugs-Cc: Date: Mon, 07 Apr 2025 23:06:45 -0600 Message-ID: <877c3vxmvu.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::c43; envelope-from=eg642616@gmail.com; helo=mail-oo1-xc43.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-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Tags: patch This patch makes `elisp-eldoc-funcall-with-docstring' handle functions without a docstring and limit docstring to 1000 characters. -- - E.G via GNU Emacs and Org. Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (eg642616[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (eg642616[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) Tags: patch This patch makes `elisp-eldoc-funcall-with-docstring' handle functions without a docstring and limit docstring to 1000 characters. -- - E.G via GNU Emacs and Org. From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 08 01:08:29 2025 Received: (at 77628) by debbugs.gnu.org; 8 Apr 2025 05:08:29 +0000 Received: from localhost ([127.0.0.1]:58217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u21CG-00069d-TV for submit@debbugs.gnu.org; Tue, 08 Apr 2025 01:08:29 -0400 Received: from mail-ot1-x343.google.com ([2607:f8b0:4864:20::343]:50542) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u21CE-000697-NT for 77628@debbugs.gnu.org; Tue, 08 Apr 2025 01:08:27 -0400 Received: by mail-ot1-x343.google.com with SMTP id 46e09a7af769-72bd5f25ea6so1206633a34.1 for <77628@debbugs.gnu.org>; Mon, 07 Apr 2025 22:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744088900; x=1744693700; darn=debbugs.gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=lyT4qqLYKffqjvAld6/8jkTKlPojlCzbPuzPu1AhPKQ=; b=Z+E2zB+bxMisYAUynjDu3Er2QVLyXNDJvlCqcyr1n4Iu/PAb4w8jtixKd2cklK2MJ4 uxrkRhujmshAQOdxfzfcfFk6bceKduMxmQpKk6uykpD7GNEi2yD2SLou27bDTNrjVV3P 3LF5H06y1fxBK1XK0HWScn9FaiMRzzJSW8GSH0UZae8s0MwD4ol3gQAH3i4tRZOnFVUi w/KTX6RUnVw1rr5KQrDzePO7JueCGaJ4X4k6VqAS4Nv8dh7A5cnPXHCfaWTleqZvDw3H JR234d+g0GaMSYnXZj7mHJWanfUeaTD0hwlnuuzafk/QyqOHzMT2ghW4V0ruGxUQiMpD P8NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744088900; x=1744693700; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lyT4qqLYKffqjvAld6/8jkTKlPojlCzbPuzPu1AhPKQ=; b=kxa+sJ4zv/AqXnsHHQ+qSv+Fgkh/Mgxy6qDNzopWi366yxnv6bfJtC2UJEdgJ3nWXG RiwVN0ngCbLXJo3PE1YWaec9+kbxorD8D+mMbVnD8gFTZ0nZkWducYqxRjdwuiZboeVD VPLlRawB52g1yFX+3zRmRuFhwZvbI4NyUKCZcI/GnfDOlUDB2JBlMym0e3y/4DsdftJA EX4eKRiBAqP127Fp4IaUXZwA9g9qtwhdhYogJZuZhRKu89J0v/9MiKyVFETOCNy4k+EA BEdZ0lXjDj7dwIuQPfIOdwgrbi59SWWednjrTK03Qy5DKn5dP82Tfyrz6AJRLNaVijX5 7gaw== X-Gm-Message-State: AOJu0YzbSGnciDVccOrZ2U4Z8q3Qnk5YOqklOzDRoobMP9//TyoNg2wy foTp+LEMK45vnWTcVqKAElV9KDwEHA7nWCQ6Kp0+KDLodQZJn1tRqi0prWMq X-Gm-Gg: ASbGnctkN1/+1eSsE/8EmzdmIc3lvLTi15O/btaLYk2DMTs5FZMrx0/OKbSO3TyYGaM S37C8N3L8EoWr0t7wAQRvjOz4mOOnK2NxNP0MTzUXNnREUONs3yxmr1IbIAtR5I39kdYrHjE4oG 9QhMxLjKKvS4o8F4U13ROswhyMG6jTwYsiSN+p67o7mBRrCCJQJD+L03EOYhL60Q9FKGcck+yjx OpvLfgxL4WGKA9pQPT9T90AS5ryaLqgBHjPdb03bA4hL8gZmVVq4xHTcrLM8U14OOfSRHr2bmbL +DeTbtUaTqvV X-Google-Smtp-Source: AGHT+IGvHnXjXGu7Q0EmQLmZ3skXDBITHVyQQMG3dgEJ6Uo3uNTCLk7owA98VMGXRet/qbTBJFu5kQ== X-Received: by 2002:a05:6830:6116:b0:72b:9d5e:941c with SMTP id 46e09a7af769-72e3667a5a7mr9249973a34.13.1744088900427; Mon, 07 Apr 2025 22:08:20 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2cc84b26e5asm2418183fac.35.2025.04.07.22.08.19 for <77628@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Apr 2025 22:08:19 -0700 (PDT) From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= To: 77628@debbugs.gnu.org Subject: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. Date: Mon, 07 Apr 2025 23:08:18 -0600 Message-ID: <874iyzxmt9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 77628 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-elisp-eldoc-funcall-with-docstring-when-fn-has-n.patch >From 0aefc44cd151725cceb755776c497b62746465cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= Date: Mon, 7 Apr 2025 23:00:20 -0600 Subject: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall-with-docstring): Add "Undocumented" as docstring if the function as no docstring, and limit docstring length to 1000 characters. (bug#) --- lisp/progmodes/elisp-mode.el | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 748d2f11360..7b8f4af746b 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1861,17 +1861,22 @@ elisp-eldoc-funcall-with-docstring Compared to `elisp-eldoc-funcall', this also includes the current function doc string, doc string length depends on `elisp-eldoc-funcall-with-docstring-length'." - (let* ((sym-info (elisp--fnsym-in-current-sexp)) - (fn-sym (car sym-info)) - (doc (when (fboundp fn-sym) - (propertize - (cdr (help-split-fundoc - (condition-case nil (documentation fn-sym t) - (invalid-function nil)) - fn-sym)) - 'face 'font-lock-doc-face)))) - (when fn-sym - (funcall callback + (when-let* ((sym-info (elisp--fnsym-in-current-sexp)) + (fn-sym (car sym-info)) + (fn-doc (or (cdr (help-split-fundoc + (condition-case nil (documentation fn-sym t) + (invalid-function nil)) + fn-sym)) + "Undocumented.")) + (more (- (length fn-doc) 1000)) + (doc (when (fboundp fn-sym) + (concat + (propertize + (string-limit fn-doc 1000) + 'face 'font-lock-doc-face) + (when (> more 0) + (format "[%sc more]" more)))))) + (funcall callback (concat (apply #'elisp-get-fnsym-args-string sym-info) ;; Ensure not display the docstring in the ;; mode-line. @@ -1887,7 +1892,7 @@ elisp-eldoc-funcall-with-docstring :thing fn-sym :face (if (functionp fn-sym) 'font-lock-function-name-face - 'font-lock-keyword-face))))) + 'font-lock-keyword-face)))) (defun elisp-eldoc-var-docstring (callback &rest _ignored) "Document variable at point by calling CALLBACK. -- 2.49.0 --=-=-= Content-Type: text/plain -- - E.G via GNU Emacs and Org. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 12 07:17:52 2025 Received: (at 77628) by debbugs.gnu.org; 12 Apr 2025 11:17:52 +0000 Received: from localhost ([127.0.0.1]:54250 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3Yrv-0003iP-Tz for submit@debbugs.gnu.org; Sat, 12 Apr 2025 07:17:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47344) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3Yrt-0003i5-CH for 77628@debbugs.gnu.org; Sat, 12 Apr 2025 07:17:49 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3Yro-0003ok-2P; Sat, 12 Apr 2025 07:17:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=0+IcEnSIKSVqfjT7049+8CKmLZxQL8JOaF5LqAXiQmw=; b=dVkuOuB/rrfXGD1PnNrl PEpKrTW0FCzFy3UN0qwjMh1yIfGWogimjBRIODIs7VpIdy+dqQcFw19hLHBjRXq7ZKUgnioowaAkQ 6/6EuJnnWvqM+pz+48Q20XZ86nxv4Lf9NI2RVFcta2w6UoupHJ613qByaPmpDC1Yr4c/q0aMKDhnU TSnkhb42LtFr/ubWhckkFxw5CxkxQZivqUFWiBkX4jabcwoXUpy1hlXF0CSgicJ0Spz3Zy9x5YL3P bDa52JZYhIWkTYasCMBWjuDC3FthUvSp8utAbvuTnnkH87YoeuQbaRrVyLNWW1UC+BEcm7FFRCmem EHEBjw9F9yORKw==; Date: Sat, 12 Apr 2025 14:17:42 +0300 Message-Id: <86fridmxwp.fsf@gnu.org> From: Eli Zaretskii To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= In-Reply-To: <874iyzxmt9.fsf@gmail.com> (message from Elijah Gabe =?utf-8?Q?P=C3=A9rez?= on Mon, 07 Apr 2025 23:08:18 -0600) Subject: Re: bug#77628: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. References: <877c3vxmvu.fsf@gmail.com> <874iyzxmt9.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77628 Cc: 77628@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Elijah Gabe Pérez > Date: Mon, 07 Apr 2025 23:08:18 -0600 > > * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall-with-docstring): > Add "Undocumented" as docstring if the function as no docstring, > and limit docstring length to 1000 characters. (bug#) Thanks, but should 1000 be hard-coded, or should we perhaps have a variable for it? From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 12 14:23:18 2025 Received: (at 77628) by debbugs.gnu.org; 12 Apr 2025 18:23:18 +0000 Received: from localhost ([127.0.0.1]:58966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3fVc-000729-Nt for submit@debbugs.gnu.org; Sat, 12 Apr 2025 14:23:18 -0400 Received: from mail-ot1-x341.google.com ([2607:f8b0:4864:20::341]:45386) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u3fVa-00071R-He for 77628@debbugs.gnu.org; Sat, 12 Apr 2025 14:23:15 -0400 Received: by mail-ot1-x341.google.com with SMTP id 46e09a7af769-72bbc03d436so1885139a34.3 for <77628@debbugs.gnu.org>; Sat, 12 Apr 2025 11:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744482188; x=1745086988; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=6LoWlHUJQJ7lympumWlUTDb7roJGjUYhJdEIxXQWDfA=; b=TUfqOkW4jtd513ReKzv5G1s7B8cGfR6g+rUnKWiYNfmk24grQlFjYwUrXikjNRCNm8 fnYKzt0y/3aGgJHCbzCqENHSL8UJybwIPO6ooC2KuKC3MutbEDVSAulNyGWLalSrse8w SAtNFM1wtEf7UfXTDONn3USXMZ+d4MBe5ePgt3Tyj00G0Fg1IYrXN0s74WUgSwx0FAqL SJY5YFDoGKehkz7nsn8HN5pNixgfJHEjuFelqk9pjZPcgEv9Ey4Kh7GQ+uawvS3JWfVE ZJ3tyNF1y+BiROTE5IlkqZFZaDV725l6NGurv7YjnCvzPnQNEePGm5yiR5/Tuj1E66hg UttA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744482188; x=1745086988; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6LoWlHUJQJ7lympumWlUTDb7roJGjUYhJdEIxXQWDfA=; b=QRtCi0g6iRJWdePTWN1CDEwJLEQ4fsbrrpMy4RjsWV3lCo966cXqYHKrNjqsrwCeIu FbUf3+EZ8lF27qxprmTRqWPdec3fNd5hibGrY8WO64pQQ9wrsrpKIWqJ6C2AuT5UFIDZ 1Z4O6iVcZE3jrXcKKja7dDgg2O3eVG9KupPDl6ycRGjfzUYvbZ80Q1MHujKq6o7xthQi pHHQ55MLrcNhiSpfaGLfhB8rlrtbtjXTpGi7NuUMe5C5Qxx/3MgPpPQjzMJ7p7xm+2Oo Qd14rSray3wB8YQiUX9KAS5w3MEjnX9ijSKMnq4JuiuyqQNxPcmv81O9ya4I5kJ5wK3z gpZA== X-Gm-Message-State: AOJu0YzbAxHHW2Ttxaq/qFAVVHsa4p9Yv0ycHF3z6KNnh+kLyJp1Wsn3 rXuY3sTPlHxrr4osBr549IOYnYuYZdyiUK/jIBgPD/QLXDgo8cTke/vZlMJJ X-Gm-Gg: ASbGncsIODsO3Q+0W/A4K7+ebrJAnxeNeJdRpPHoAFYJqFfUiMaMarNVg7GopDTO0Bw aBOo37a3zGM2+PEisr9Qeh6lignqoE1+Ez4JZsUZOmjvOPEAMZtal1GSS/hl6FWOn1NZ6jv0gNm hmvbpTFhB1VKbEiMaXBbYjZIDd8M5ks/V3vu8HjLJmay4L2+BJDMa4tL30nXCn8/XtzU7BuQtgB 6UzlzGxqvXJlXh3qp8Sdn28mP/zcxcmQCozTndb3O3rL/8plWqinTHHDmhrz3TMU3AsHuxJ17HI T6K2k1fX X-Google-Smtp-Source: AGHT+IHRh/zvW2hOxe4o36KivZJowr2gi6zUbrpQXueXeHh05MAE5oPtdEKKbn9zBGB75PPWqte90Q== X-Received: by 2002:a05:6830:6812:b0:72b:92aa:b69f with SMTP id 46e09a7af769-72e86334ba3mr4482434a34.16.1744482188236; Sat, 12 Apr 2025 11:23:08 -0700 (PDT) Received: from fedora ([2806:10ae:e:79da::1]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-2d096d4af4esm1605024fac.45.2025.04.12.11.23.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Apr 2025 11:23:07 -0700 (PDT) From: =?utf-8?Q?Elijah_Gabe_P=C3=A9rez?= To: Eli Zaretskii Subject: Re: bug#77628: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. In-Reply-To: <86fridmxwp.fsf@gnu.org> References: <877c3vxmvu.fsf@gmail.com> <874iyzxmt9.fsf@gmail.com> <86fridmxwp.fsf@gnu.org> Date: Sat, 12 Apr 2025 12:23:06 -0600 Message-ID: <877c3pfddh.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 77628 Cc: 77628@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii writes: >> From: Elijah Gabe P=C3=A9rez >> Date: Mon, 07 Apr 2025 23:08:18 -0600 >>=20 >> * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall-with-docstring): >> Add "Undocumented" as docstring if the function as no docstring, >> and limit docstring length to 1000 characters. (bug#) > > Thanks, but should 1000 be hard-coded, or should we perhaps have a > variable for it? I've added a variable for limit both `elisp-eldoc-funcall-with-docstring' and `elisp-eldoc-var-docstring-with-value'. `elisp-eldoc-var-docstring-with-value' also set a limit. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-variable-for-control-docstring-length-in-elisp-e.patch >From e9dac14448717cc60f840874147d9097d33f9902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= Date: Mon, 7 Apr 2025 23:00:20 -0600 Subject: [PATCH] Add variable for control docstring length in elisp eldoc functions * etc/NEWS: Announce new variable. * lisp/progmodes/elisp-mode.el (elisp-eldoc-docstring-length-limit): New user option. (elisp-eldoc-funcall-with-docstring): Add "Undocumented" as docstring if the function has no docstring. (elisp-eldoc-var-docstring-with-value): Use `elisp-eldoc-docstring-length-limit'. (bug#77628) --- etc/NEWS | 7 ++++++ lisp/progmodes/elisp-mode.el | 41 +++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index c08b0052639..5a9425054bd 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -585,6 +585,13 @@ displayed in 'elisp-eldoc-funcall-with-docstring'. If set to 'short' (the default), only display the first sentence of the doc string. Otherwise, if set to 'full', display the full doc string.' +--- +*** New user option 'elisp-eldoc-docstring-length-limit'. +This user option controls maximum docstring character limit displayed by +'elisp-eldoc-funcall-with-docstring' and +'elisp-eldoc-var-docstring-with-value'. By default it is set to 1000 +characters + --- ** Buffer Menu diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index 748d2f11360..bcd6d02ae8f 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1845,6 +1845,12 @@ elisp-eldoc-funcall 'font-lock-function-name-face 'font-lock-keyword-face))))) +(defcustom elisp-eldoc-docstring-length-limit 1000 + "Maximum docstring character limit displayed by elisp eldoc functions." + :type 'natnum + :group 'elisp + :version "31.1") + (defcustom elisp-eldoc-funcall-with-docstring-length 'short "Control length of doc string shown by `elisp-eldoc-funcall-with-docstring'. If set to `short', only show the first sentence of the doc string. @@ -1861,21 +1867,26 @@ elisp-eldoc-funcall-with-docstring Compared to `elisp-eldoc-funcall', this also includes the current function doc string, doc string length depends on `elisp-eldoc-funcall-with-docstring-length'." - (let* ((sym-info (elisp--fnsym-in-current-sexp)) - (fn-sym (car sym-info)) - (doc (when (fboundp fn-sym) - (propertize - (cdr (help-split-fundoc - (condition-case nil (documentation fn-sym t) - (invalid-function nil)) - fn-sym)) - 'face 'font-lock-doc-face)))) - (when fn-sym - (funcall callback + (when-let* ((sym-info (elisp--fnsym-in-current-sexp)) + (fn-sym (car sym-info)) + ((fboundp fn-sym)) + (fn-doc (or (cdr (help-split-fundoc + (condition-case nil (documentation fn-sym t) + (invalid-function nil)) + fn-sym)) + "Undocumented.")) + (more (- (length fn-doc) elisp-eldoc-docstring-length-limit)) + (doc (concat + (propertize + (string-limit fn-doc elisp-eldoc-docstring-length-limit) + 'face 'font-lock-doc-face) + (when (> more 0) + (format "[%sc more]" more))))) + (funcall callback (concat (apply #'elisp-get-fnsym-args-string sym-info) ;; Ensure not display the docstring in the ;; mode-line. - (when (and doc (not (minibufferp))) + (when (not (minibufferp)) (concat "\n" (pcase elisp-eldoc-funcall-with-docstring-length @@ -1887,7 +1898,7 @@ elisp-eldoc-funcall-with-docstring :thing fn-sym :face (if (functionp fn-sym) 'font-lock-function-name-face - 'font-lock-keyword-face))))) + 'font-lock-keyword-face)))) (defun elisp-eldoc-var-docstring (callback &rest _ignored) "Document variable at point by calling CALLBACK. @@ -1915,12 +1926,12 @@ elisp-eldoc-var-docstring-with-value (symbol-value cs) (let* ((doc (documentation-property cs 'variable-documentation t)) - (more (- (length doc) 1000))) + (more (- (length doc) elisp-eldoc-docstring-length-limit))) (concat (propertize (string-limit (if (string= doc "nil") "Undocumented." doc) - 1000) + elisp-eldoc-docstring-length-limit) 'face 'font-lock-doc-face) (when (> more 0) (format "[%sc more]" more))))) -- 2.49.0 --=-=-= Content-Type: text/plain -- - E.G via GNU Emacs and Org. --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 13 06:05:20 2025 Received: (at 77628-done) by debbugs.gnu.org; 13 Apr 2025 10:05:20 +0000 Received: from localhost ([127.0.0.1]:39581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3uDG-0005TL-Ij for submit@debbugs.gnu.org; Sun, 13 Apr 2025 06:05:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58172) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3uDD-0005Pv-C8 for 77628-done@debbugs.gnu.org; Sun, 13 Apr 2025 06:05:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3uD6-000860-5Z; Sun, 13 Apr 2025 06:05:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=ysKJjMyIe+NzqVfVPqJPAgedUpBrLpnuSPivrh/XIdU=; b=g3JnG9yEc5ZEziqvpdnU 0/79S1EOKic+hkQCmIn1X5LeMuZPHL11ZBQtkNwFp5z/h4eUbXso36NiXfvOeoTedC4vrWkYa61UO LBNBZ5Eb9dVv12uts29/7hplTh+ooKhTo1WG76SavA9ZvG7BuswFQdoedKl6G0+Yg/4bXwfLCx7lI 5idavHvhdkROnLcEbzvoy1TUfnyEw8xY1S8nNqaZOofGwQi40nEF8k857nloYUUc3ZgIK848d0Dqt C/2Wgp4LWVkLWndh1SoUZXwSJH0ZPXsvhallA2A0R9rrW4XI9C7JiKNzeIvOYTPOy8LaIZr5meNp5 GPvNXCAeIfGkxw==; Date: Sun, 13 Apr 2025 13:05:02 +0300 Message-Id: <86tt6sjs1d.fsf@gnu.org> From: Eli Zaretskii To: Elijah Gabe =?utf-8?Q?P=C3=A9rez?= In-Reply-To: <877c3pfddh.fsf@gmail.com> (message from Elijah Gabe =?utf-8?Q?P=C3=A9rez?= on Sat, 12 Apr 2025 12:23:06 -0600) Subject: Re: bug#77628: [PATCH] ; Fix `elisp-eldoc-funcall-with-docstring' when fn has no docstring. References: <877c3vxmvu.fsf@gmail.com> <874iyzxmt9.fsf@gmail.com> <86fridmxwp.fsf@gnu.org> <877c3pfddh.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77628-done Cc: 77628-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Elijah Gabe Pérez > Cc: 77628@debbugs.gnu.org > Date: Sat, 12 Apr 2025 12:23:06 -0600 > > Eli Zaretskii writes: > > >> From: Elijah Gabe Pérez > >> Date: Mon, 07 Apr 2025 23:08:18 -0600 > >> > >> * lisp/progmodes/elisp-mode.el (elisp-eldoc-funcall-with-docstring): > >> Add "Undocumented" as docstring if the function as no docstring, > >> and limit docstring length to 1000 characters. (bug#) > > > > Thanks, but should 1000 be hard-coded, or should we perhaps have a > > variable for it? > > I've added a variable for limit both > `elisp-eldoc-funcall-with-docstring' and > `elisp-eldoc-var-docstring-with-value'. > > `elisp-eldoc-var-docstring-with-value' also set a limit. Thanks, installed with a few minor corrections. From unknown Thu Aug 14 17:25:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 11 May 2025 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator