From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#23842: 24.4; Runaway background process Date: Sat, 13 Aug 2016 22:36:53 -0400 Message-ID: <874m6ovzy2.fsf@users.sourceforge.net> References: <576F977E.8060405@cs.ucla.edu> <57703204.9090402@cs.ucla.edu> <02ecaa18-2108-e5c7-c7c4-56896a9c2869@cornell.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1471142247 7271 195.159.176.226 (14 Aug 2016 02:37:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 14 Aug 2016 02:37:27 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Paul Eggert , 23842@debbugs.gnu.org To: Ian Perryman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 14 04:37:23 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYlIg-0001f8-2U for geb-bug-gnu-emacs@m.gmane.org; Sun, 14 Aug 2016 04:37:22 +0200 Original-Received: from localhost ([::1]:59284 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlIa-0001P4-GT for geb-bug-gnu-emacs@m.gmane.org; Sat, 13 Aug 2016 22:37:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlIQ-0001NA-SA for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYlIL-00083M-Pu for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYlIL-00083I-M1 for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bYlIL-0008Pj-IN for bug-gnu-emacs@gnu.org; Sat, 13 Aug 2016 22:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Aug 2016 02:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23842 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23842-submit@debbugs.gnu.org id=B23842.147114221532332 (code B ref 23842); Sun, 14 Aug 2016 02:37:01 +0000 Original-Received: (at 23842) by debbugs.gnu.org; 14 Aug 2016 02:36:55 +0000 Original-Received: from localhost ([127.0.0.1]:56675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYlIE-0008PL-Lj for submit@debbugs.gnu.org; Sat, 13 Aug 2016 22:36:55 -0400 Original-Received: from mail-io0-f179.google.com ([209.85.223.179]:33027) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bYlIC-0008Oz-4Y; Sat, 13 Aug 2016 22:36:52 -0400 Original-Received: by mail-io0-f179.google.com with SMTP id 38so56044645iol.0; Sat, 13 Aug 2016 19:36:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=AHBdUIznF+wn9loPalegqRLn+Qo0wZPvZacB6XRF+x4=; b=rY2Z4EQNDY+z1gH5xC5cZbKtctJ+lALhbX01FFhoXiCnPSkiBrFpDmEUN+SrJx9Ol6 R7LmlLuIh9+7ydLlCYvaSjR8L3zO1c1n+DaYvUzTKyazV63tgWeLjz1oM2TOp1JjHkOZ WCylPrnFeAgDb5qmyh4sHMB2Rnjgxc66CREAUsclcBsTXJiC1MA9ccE/cpVaq/myMS7V sR5jqKIyVtV1zchV3ngl7HZaTFc0hudSGdygMI2mUQe7gi3ciQ1dvO6xCxErgtkiU8El OfEYK8dYcyBLGzll9KVHckzJ5tadCLFKEewZXh7D3tjLFs8RPMIB1jO+5AaxOk9HaymI RxOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=AHBdUIznF+wn9loPalegqRLn+Qo0wZPvZacB6XRF+x4=; b=CfAwQyhUUINDjt3vWHYQ3d5wYTXF4w3F0YlMZq2acScQn6rEdor0bDXEvXRQCekzed m3y7rHfuIvdfrQOAvVV7i0ve+OMma4pnm8QYL65GVR2JpbB0LSoo9gPBaaUxYDhzC1eJ 7XfPlCD++ySvhr4wezHGULZGydSlP7Isi7//d7ekD549N5HHxnYPgs8j6Q/KgNydNBoK KKQdKoHch06+lqd7SNdNcVLnFoHo0BsbH1yZ0sRhf67K1V9X2IGSHTWfmwQ8WRAM+LOZ svv4GZQiaGKXQgbXW3FdAoDqZgH5UivI6DqY2AGdK88QjlW1cWY6YNvebmEbRPFMVoZh 4ZFA== X-Gm-Message-State: AEkooutzRrLbVTWIMUPl6/9bDC6koOdo9HFj/BPtpwU83BnSE5wXb8qZPkdZirOliTFKHA== X-Received: by 10.107.131.11 with SMTP id f11mr26743373iod.136.1471142206430; Sat, 13 Aug 2016 19:36:46 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id o15sm5683027ith.2.2016.08.13.19.36.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 13 Aug 2016 19:36:45 -0700 (PDT) In-Reply-To: (Ian Perryman's message of "Mon, 27 Jun 2016 09:51:47 -0400") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:122188 Archived-At: --=-=-= Content-Type: text/plain tags 23842 patch quit Ian Perryman writes: > I am not the author of the verilog mode. I have alerted the maintainer > to the issue at > http://www.veripool.org/issues/1070-Verilog-mode-Auto-completion-results-in-runaway-emacs-process-in-emacs-24-4-on-Debian-using-2016-04-23-5f6855e-vpo > > Not sure what the intended behaviour is. My guess is that the list of > possible completions was to be presented in the temporary buffer, and > then user could select the completion they wanted with a mouse click > and it should be inserted back in the original buffer. > > Did the definition of with-output-to-temp-buffer change over the > years? I am not certain when this code was developed, but it was quite > a while back. I am surprised that no one else has complained about it. Probably most Emacs users don't use the mouse much. > > Perhaps the paradigm for completion is not being followed by this mode? > > Any suggestions? I can't really figure out how that completion window code is supposed to work, but it seems to be duplicating completion-at-point functionality. Patch below just replaces most of it with completion-at-point and it seems to work fine. But I see at the top of the file ;; This code supports Emacs 21.1 and later ;; And XEmacs 21.1 and later ;; Please do not make changes that break Emacs 21. Thanks! So it may need some adjustments for Emacs 21... --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=v1-0001-Use-completion-at-point-in-verilog-mode.patch Content-Description: patch >From ed885f166108945b8e99d09feaac53ee470a3f2c Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 13 Aug 2016 22:13:56 -0400 Subject: [PATCH v1] Use completion-at-point in verilog-mode There were some functions in verilog-mode that implemented in-buffer completion, but this needlessly duplicates completion-at-point functionality, and the popup window management had problems (see Bug #23842). * lisp/progmodes/verilog-mode.el (verilog-toggle-completions): Mark obsolete, it does the same job as `completion-cycle-threshold'. (verilog-completion-at-point): New function. (verilog-show-completions): Remove, replace calls with `completion-help-at-point'. (verilog-complete-word): Remove, replace calls with `completion-at-point'. --- lisp/progmodes/verilog-mode.el | 109 +++++++++-------------------------------- 1 file changed, 23 insertions(+), 86 deletions(-) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index fd2e96a..e5b9ee8 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -1374,8 +1374,8 @@ verilog-mode-map (define-key map "\M-\C-b" 'electric-verilog-backward-sexp) (define-key map "\M-\C-f" 'electric-verilog-forward-sexp) (define-key map "\M-\r" `electric-verilog-terminate-and-indent) - (define-key map "\M-\t" 'verilog-complete-word) - (define-key map "\M-?" 'verilog-show-completions) + (define-key map "\M-\t" 'completion-at-point) + (define-key map "\M-?" 'completion-help-at-point) ;; Note \C-c and letter are reserved for users (define-key map "\C-c`" 'verilog-lint-off) (define-key map "\C-c*" 'verilog-delete-auto-star-implicit) @@ -1498,7 +1498,7 @@ verilog-mode-map :help "Take a signal vector on the current line and expand it to multiple lines"] ["Insert begin-end block" verilog-insert-block :help "Insert begin ... end"] - ["Complete word" verilog-complete-word + ["Complete word" completion-at-point :help "Complete word at point"] "----" ["Recompute AUTOs" verilog-auto @@ -3762,7 +3762,7 @@ verilog-mode Some other functions are: - \\[verilog-complete-word] Complete word with appropriate possibilities. + \\[completion-at-point] Complete word with appropriate possibilities. \\[verilog-mark-defun] Mark function. \\[verilog-beg-of-defun] Move to beginning of current function. \\[verilog-end-of-defun] Move to end of current function. @@ -3876,6 +3876,9 @@ verilog-mode verilog-forward-sexp-function) hs-special-modes-alist)))) + (add-hook 'completion-at-point-functions + #'verilog-completion-at-point nil 'local) + ;; Stuff for autos (add-hook 'write-contents-hooks 'verilog-auto-save-check nil 'local) ;; verilog-mode-hook call added by define-derived-mode @@ -7143,10 +7146,9 @@ verilog-pred (defvar verilog-buffer-to-use nil) (defvar verilog-flag nil) (defvar verilog-toggle-completions nil - "True means \\\\[verilog-complete-word] should try all possible completions one by one. -Repeated use of \\[verilog-complete-word] will show you all of them. -Normally, when there is more than one possible completion, -it displays a list of all possible completions.") + "Obsolete, use `completion-cycle-threshold' instead.") +(make-obsolete-variable + 'verilog-toggle-completions 'completion-cycle-threshold "25.2") (defvar verilog-type-keywords @@ -7429,85 +7431,20 @@ verilog-last-word-numb (defvar verilog-last-word-shown nil) (defvar verilog-last-completions nil) -(defun verilog-complete-word () - "Complete word at current point. -\(See also `verilog-toggle-completions', `verilog-type-keywords', -and `verilog-separator-keywords'.)" - ;; FIXME: Provide completion-at-point-function. - (interactive) - (let* ((b (save-excursion (skip-chars-backward "a-zA-Z0-9_") (point))) - (e (save-excursion (skip-chars-forward "a-zA-Z0-9_") (point))) - (verilog-str (buffer-substring b e)) - ;; The following variable is used in verilog-completion - (verilog-buffer-to-use (current-buffer)) - (allcomp (if (and verilog-toggle-completions - (string= verilog-last-word-shown verilog-str)) - verilog-last-completions - (all-completions verilog-str 'verilog-completion))) - (match (if verilog-toggle-completions - "" (try-completion - verilog-str (mapcar (lambda (elm) - (cons elm 0)) allcomp))))) - ;; Delete old string - (delete-region b e) - - ;; Toggle-completions inserts whole labels - (if verilog-toggle-completions - (progn - ;; Update entry number in list - (setq verilog-last-completions allcomp - verilog-last-word-numb - (if (>= verilog-last-word-numb (1- (length allcomp))) - 0 - (1+ verilog-last-word-numb))) - (setq verilog-last-word-shown (elt allcomp verilog-last-word-numb)) - ;; Display next match or same string if no match was found - (if (not (null allcomp)) - (insert "" verilog-last-word-shown) - (insert "" verilog-str) - (message "(No match)"))) - ;; The other form of completion does not necessarily do that. - - ;; Insert match if found, or the original string if no match - (if (or (null match) (equal match 't)) - (progn (insert "" verilog-str) - (message "(No match)")) - (insert "" match)) - ;; Give message about current status of completion - (cond ((equal match 't) - (if (not (null (cdr allcomp))) - (message "(Complete but not unique)") - (message "(Sole completion)"))) - ;; Display buffer if the current completion didn't help - ;; on completing the label. - ((and (not (null (cdr allcomp))) (= (length verilog-str) - (length match))) - (with-output-to-temp-buffer "*Completions*" - (display-completion-list allcomp)) - ;; Wait for a key press. Then delete *Completion* window - (momentary-string-display "" (point)) - (delete-window (get-buffer-window (get-buffer "*Completions*"))) - ))))) - -(defun verilog-show-completions () - "Show all possible completions at current point." - (interactive) +(defun verilog-completion-at-point () + "Used as an element of `completion-at-point-functions'. +\(See also `verilog-type-keywords' and +`verilog-separator-keywords'.)" (let* ((b (save-excursion (skip-chars-backward "a-zA-Z0-9_") (point))) - (e (save-excursion (skip-chars-forward "a-zA-Z0-9_") (point))) - (verilog-str (buffer-substring b e)) - ;; The following variable is used in verilog-completion - (verilog-buffer-to-use (current-buffer)) - (allcomp (if (and verilog-toggle-completions - (string= verilog-last-word-shown verilog-str)) - verilog-last-completions - (all-completions verilog-str 'verilog-completion)))) - ;; Show possible completions in a temporary buffer. - (with-output-to-temp-buffer "*Completions*" - (display-completion-list allcomp)) - ;; Wait for a key press. Then delete *Completion* window - (momentary-string-display "" (point)) - (delete-window (get-buffer-window (get-buffer "*Completions*"))))) - + (e (save-excursion (skip-chars-forward "a-zA-Z0-9_") (point))) + (verilog-str (buffer-substring b e)) + ;; The following variable is used in verilog-completion + (verilog-buffer-to-use (current-buffer)) + (allcomp (if (and verilog-toggle-completions + (string= verilog-last-word-shown verilog-str)) + verilog-last-completions + (all-completions verilog-str 'verilog-completion)))) + (list b e allcomp))) (defun verilog-get-default-symbol () "Return symbol around current point as a string." -- 2.9.2 --=-=-=--