From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel =?UTF-8?Q?Mart=C3=ADn?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58552: 29.0.50; [PATCH] dictionary-lookup-definition "Wrong type argument" error when there is no word at point Date: Sat, 15 Oct 2022 21:36:35 +0200 Message-ID: References: Reply-To: Daniel =?UTF-8?Q?Mart=C3=ADn?= 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="13334"; mail-complaints-to="usenet@ciao.gmane.io" To: 58552@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 15 21:37:17 2022 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 1ojmyC-0003HE-0o for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 21:37:16 +0200 Original-Received: from localhost ([::1]:49890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojmyA-0005QD-Nq for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Oct 2022 15:37:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojmxy-0005Pe-ES for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 15:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43598) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojmxy-0005i6-6R for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 15:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ojmxx-0002gc-NQ for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 15:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel =?UTF-8?Q?Mart=C3=ADn?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Oct 2022 19:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 58552 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.166586261310309 (code B ref -1); Sat, 15 Oct 2022 19:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Oct 2022 19:36:53 +0000 Original-Received: from localhost ([127.0.0.1]:42676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojmxo-0002gD-RG for submit@debbugs.gnu.org; Sat, 15 Oct 2022 15:36:53 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ojmxj-0002g1-Oy for submit@debbugs.gnu.org; Sat, 15 Oct 2022 15:36:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojmxj-0005NJ-JI for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 15:36:47 -0400 Original-Received: from sonic317-26.consmr.mail.bf2.yahoo.com ([74.6.129.81]:34077) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojmxg-0005gn-Ft for bug-gnu-emacs@gnu.org; Sat, 15 Oct 2022 15:36:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1665862599; bh=xZkEyvluUWkF97nfYk1YuEXj0iPCku/SxLvjxU0XXzY=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=HQMVJcugqraksEse2TZGwhe4HofVsO6x6cTEwbxz8NZ5Y1IjLHVCDqJ+TP35dGS1wbVETVMRkcTOyl5HsqAMJjHSxzuE6exlsnhBdkIdI2egj3aesuM47eBwZpH92yjG6YA+V2IhPXPFMz8h8yTnAfECPL7aWM/BRS0OEGb8YWZBhEzuCL9abNuW+rkMAfpphgsaG5xH+JXAgOuIJsida6oxyPDLXJcUPjXqpxb7hSyM4bMZGTY9FEJ+8sUtW0IxDI3zhvUyXxWks/PH+M0VLRqj0fgD4pifTfF1BzTMw7FQ/veOluhbF2edanTlFGDNG9LDZ3hGsxx+IZ52FJ18Qg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1665862599; bh=1yI2LEi0cD53DPme4X4qwC9/d3Vk5n/KhhgOwBp9wto=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=dRFCiNUn2jfiRmNj9y7mi/wgspkthvtukc9tmEdPc+JCSLXi9RtLWi6VoQAZpyz45swkcK1YePKigB2/uhiVLTCZWQKmm8q5dPEYQQoAMDrNvShYmXW1slOaUuw6ur7tflGv9gv/MLw1LjD3+T8uxyalXzOL4cuNlcbPg0CuhublyYxqNm4mV57hG6MMJZJCnfFf96AcNh3tRtU9afvPcqyrGXgfo/n03lKXqKxIyRquKLn9l9QSnmg7ecXgVdR3bN0uc/8PioNrceEKtdm2xVmyy2iDmSigeyA186Wl0tIoK/ivh39VB7TnUjWgxYkxsXlqmWYjYQ1BwBb/1C0EWg== X-YMail-OSG: LmdnuksVM1k7xCe3f38xYf4g5pZGzjOsIiUJWOQDu5yJW15Pn6YfvVGOxmFI58q ..foxHtEZt2GRdDnnddxSQKBapVXNq2GapdJaURI8GmM1YTa5Efhg3AY5J9c_XLsDmyHLGvi7T.T rsZezh9_KAA4J.0ixNLz0mchbaPbjvXD_E5en73dL54E53ua.70hwsHiOtEPx6SouxZTQPdfYyzF RJ6PqoePBaCQOMWUtnfNwj4vZ5YxlG_g4xJqUNt1qzUKIRgqqpj53XXX2m5SxoSfsk85bwFgZpVx VpH_579K_E.S86Wom19JRjEpUBJ2t94CRiCsyCbZd_UQBxadKhmUwFhQVo_7uvE0f2O55rT782hb q1QnH4nDizc8dyG3vMEv3tm.8tWp.7yWiFiSDV12fXuyQ2JyQAKc13rL.3YzYrI4YWK_yFgquDGO f8BGzdcoOJr3aLEFvBcrkulkjl2ZL4plsSwNI7rr7ZUz.xKegPfGJwclxiKmHIc6XiqXOjzVuPw3 L5HKpYit4xqtmxR2Lv8LPYOKIuuKtTocBs5rpN4I0LHHI9V5_fbD5z8c9EbCciZpTUIX3zgXkiaA pdyu10joc.m1zsiSBc08vNSyFLvTcRVjo4yswFrNMKXoQxWMdOBKhyDNaGERzwMkMWY_4kF83aXO pdxUc7Vxf178wcDLTgAsnphj0VhfWIm3eQffcJywuwcFkbNLoo6C3PUgwk1gP_gHK.RLmdPIiDrr McWgafggmbMM6ikDuxLN1jAFixTK8Gd35t6pn5fCtbdNQs7BezJy6CvbYaefPm6hHcRNrr92AGzj SzeVqjgDLYdNyS9m56cDx14NbAuRLYVfXJBI7L0dui X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.bf2.yahoo.com with HTTP; Sat, 15 Oct 2022 19:36:39 +0000 Original-Received: by hermes--production-ir2-6c65697d7-c5jqv (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 365b66ff89dddefa62bb5adb7b22ace2; Sat, 15 Oct 2022 19:36:37 +0000 (UTC) X-Mailer: WebService/1.1.20740 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=74.6.129.81; envelope-from=mardani29@yahoo.es; helo=sonic317-26.consmr.mail.bf2.yahoo.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: 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" Xref: news.gmane.io gmane.emacs.bugs:245586 Archived-At: --=-=-= Content-Type: text/plain Steps to reproduce the issue: emacs -Q M-x dictionary-lookup-definition RET Answer "y" if asked about using dict.org. Expected result: As there is no word at point to act on, the operation should inform the user right away. Actual result: dictionary-encode-charset: Wrong type argument: stringp, nil An empty dictionary buffer is shown, which is confusing. The attached patch informs the user that there is no word at point to act on and aborts the operation early. If you think it's a good patch, please install on my behalf. Thanks. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Signal-an-error-in-dictionary-lookup-if-there-s-no-w.patch >From ac9505d3105138c69b018d6432182e45d12a2bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=ADn?= Date: Sat, 15 Oct 2022 21:25:59 +0200 Subject: [PATCH] Signal an error in dictionary lookup if there's no word at point * lisp/net/dictionary.el (dictionary-lookup-definition): Signal an error when there is no word at point. --- lisp/net/dictionary.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/net/dictionary.el b/lisp/net/dictionary.el index 4c52382c67..b8f5018005 100644 --- a/lisp/net/dictionary.el +++ b/lisp/net/dictionary.el @@ -1173,7 +1173,10 @@ dictionary-search (defun dictionary-lookup-definition () "Unconditionally lookup the word at point." (interactive) - (dictionary-new-search (cons (current-word) dictionary-default-dictionary))) + (let ((word (current-word))) + (unless word + (error "No word at point")) + (dictionary-new-search (cons word dictionary-default-dictionary)))) (defun dictionary-previous () "Go to the previous location in the current buffer." -- 2.34.1 --=-=-=--