unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon McFarlane <sm@desu.ne.jp>
To: 47652@debbugs.gnu.org
Subject: bug#47652: 28.0.50; completion-at-point fails in verilog-mode
Date: Thu, 8 Apr 2021 21:04:15 -0700	[thread overview]
Message-ID: <83fd198e-503e-8f47-2bf7-1eb8ca549c49@desu.ne.jp> (raw)
In-Reply-To: <49a4dea5-5707-03e3-acd2-5737a46c96ec@desu.ne.jp>

[-- Attachment #1: Type: text/plain, Size: 391 bytes --]

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

[-- Attachment #2: 0001-verilog-mode-add-save-excursion-to-fix-completion-at.patch --]
[-- Type: text/x-patch, Size: 2223 bytes --]

From 5f80b93f0456a94efc9cf027b5f920cb63e13f38 Mon Sep 17 00:00:00 2001
From: Simon McFarlane <sm@desu.ne.jp>
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


  reply	other threads:[~2021-04-09  4:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08  4:13 bug#47652: 28.0.50; completion-at-point fails in verilog-mode Simon McFarlane
2021-04-09  4:04 ` Simon McFarlane [this message]
2021-04-12  9:46   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83fd198e-503e-8f47-2bf7-1eb8ca549c49@desu.ne.jp \
    --to=sm@desu.ne.jp \
    --cc=47652@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).