From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Simon McFarlane Newsgroups: gmane.emacs.bugs Subject: bug#47652: 28.0.50; completion-at-point fails in verilog-mode Date: Thu, 8 Apr 2021 21:04:15 -0700 Message-ID: <83fd198e-503e-8f47-2bf7-1eb8ca549c49@desu.ne.jp> References: <49a4dea5-5707-03e3-acd2-5737a46c96ec@desu.ne.jp> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B945E151D4292D0D2E160430" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30489"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 To: 47652@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 09 11:51:13 2021 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 1lUnnF-0007qd-JX for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Apr 2021 11:51:13 +0200 Original-Received: from localhost ([::1]:48242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUnnE-0004u0-LF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Apr 2021 05:51:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUnn3-0004s7-VG for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2021 05:51:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUnn3-0002EW-NH for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2021 05:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUnn3-0004zf-LJ for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2021 05:51:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <49a4dea5-5707-03e3-acd2-5737a46c96ec@desu.ne.jp> Resent-From: Simon McFarlane Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Apr 2021 09:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47652 X-GNU-PR-Package: emacs Original-Received: via spool by 47652-submit@debbugs.gnu.org id=B47652.161796181619137 (code B ref 47652); Fri, 09 Apr 2021 09:51:01 +0000 Original-Received: (at 47652) by debbugs.gnu.org; 9 Apr 2021 09:50:16 +0000 Original-Received: from localhost ([127.0.0.1]:49113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUnmH-0004yZ-SY for submit@debbugs.gnu.org; Fri, 09 Apr 2021 05:50:16 -0400 Original-Received: from kanna.desu.ne.jp ([44.26.108.130]:19363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUiNc-00040p-6N for 47652@debbugs.gnu.org; Fri, 09 Apr 2021 00:04:27 -0400 Original-Received: from kanna.desu.ne.jp (localhost [::1]) by kanna.desu.ne.jp (OpenSMTPD) with ESMTP id a7afefc8 for <47652@debbugs.gnu.org>; Thu, 8 Apr 2021 21:04:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=desu.ne.jp; h=to:from :subject:message-id:date:mime-version:content-type; s=desu; bh=4 Bh4/pOLnJq0HwlGMwHru3mH4Hk=; b=g79xmHNFkG1mDZjNuiwb34f2tuaN8henG LyLH2DP2oGVqF0erPdj2pC2bRk8cb+Dr015LHx51bejQiN75f1gX7GVrg/2ieG9M oDo75RTEUm9NgggVPXfX3dzeniD4V84onb2/v1H7MktItgNzP6JkeJdHJ8jZyEUJ Yq8hrr2/Ag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=desu.ne.jp; h=to:from :subject:message-id:date:mime-version:content-type; q=dns; s= desu; b=k/Pr6kqBi6LjFAhz0TgNDXNR7UbcXSKVtQ7ZPyQRzT2CaRHwns+bEkbe +g2kROYAyE6gdrCVpR2wkYnVCaRQYjGEY4RrTC0i0SsyXuGyCaV54j10H3yJfigp Z0FKVXl0Oh8hgOtgT/5e4Iklqr7XAG+HLRVYLVi9OLRJsToovRY= Original-Received: by kanna.desu.ne.jp (OpenSMTPD) with ESMTPSA id b0fd3fb8 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for <47652@debbugs.gnu.org>; Thu, 8 Apr 2021 21:04:17 -0700 (PDT) Content-Language: en-US X-Mailman-Approved-At: Fri, 09 Apr 2021 05:50:13 -0400 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:203759 Archived-At: This is a multi-part message in MIME format. --------------B945E151D4292D0D2E160430 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi, After a very pleasant evening with Edebug (seriously, debugging Emacs is such a smooth experience) I found what I believe to be the culprit and have attached a patch that fixes the issue for me. This is my first time contributing to Emacs so I apologize if I've violated the mailing list convention or etiquette. Happy to make adjustments if my patch isn't quite right. Thanks, Simon --------------B945E151D4292D0D2E160430 Content-Type: text/x-patch; charset=UTF-8; name="0001-verilog-mode-add-save-excursion-to-fix-completion-at.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-verilog-mode-add-save-excursion-to-fix-completion-at.pa"; filename*1="tch" >From 5f80b93f0456a94efc9cf027b5f920cb63e13f38 Mon Sep 17 00:00:00 2001 From: Simon McFarlane Date: Thu, 8 Apr 2021 20:57:53 -0700 Subject: [PATCH] verilog-mode: add save-excursion to fix completion-at-word mangling cursor --- lisp/progmodes/verilog-mode.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index a7f72950b1..bc4f101c0a 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -7630,27 +7630,27 @@ nil otherwise." (let ((state (car (verilog-calculate-indent)))) (cond ((eq state 'defun) (save-excursion (verilog-var-completion)) - (verilog-func-completion 'module) + (save-excursion (verilog-func-completion 'module)) (verilog-keyword-completion verilog-defun-keywords)) ((eq state 'behavioral) (save-excursion (verilog-var-completion)) - (verilog-func-completion 'module) + (save-excursion (verilog-func-completion 'module)) (verilog-keyword-completion verilog-defun-keywords)) ((eq state 'block) (save-excursion (verilog-var-completion)) - (verilog-func-completion 'tf) + (save-excursion (verilog-func-completion 'tf)) (verilog-keyword-completion verilog-block-keywords)) ((eq state 'case) (save-excursion (verilog-var-completion)) - (verilog-func-completion 'tf) + (save-excursion (verilog-func-completion 'tf)) (verilog-keyword-completion verilog-case-keywords)) ((eq state 'tf) (save-excursion (verilog-var-completion)) - (verilog-func-completion 'tf) + (save-excursion (verilog-func-completion 'tf)) (verilog-keyword-completion verilog-tf-keywords)) ((eq state 'cpp) @@ -7662,7 +7662,7 @@ nil otherwise." (t;--Anywhere else (save-excursion (verilog-var-completion)) - (verilog-func-completion 'both) + (save-excursion (verilog-func-completion 'both)) (verilog-keyword-completion verilog-separator-keywords)))) ;; Now we have built a list of all matches. Give response to caller -- 2.31.1 --------------B945E151D4292D0D2E160430--