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: Mon, 19 Dec 2016 22:58:29 -0500 Message-ID: <87h95zb6ai.fsf@users.sourceforge.net> References: <576F977E.8060405@cs.ucla.edu> <57703204.9090402@cs.ucla.edu> <02ecaa18-2108-e5c7-c7c4-56896a9c2869@cornell.edu> <874m6ovzy2.fsf@users.sourceforge.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1482206296 21131 195.159.176.226 (20 Dec 2016 03:58:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Dec 2016 03:58:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: Paul Eggert , 23842@debbugs.gnu.org, Wilson Snyder To: Ian Perryman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 20 04:58:11 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 1cJBZ1-00041u-Ng for geb-bug-gnu-emacs@m.gmane.org; Tue, 20 Dec 2016 04:58:07 +0100 Original-Received: from localhost ([::1]:48881 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJBZ5-0006PY-Or for geb-bug-gnu-emacs@m.gmane.org; Mon, 19 Dec 2016 22:58:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJBYz-0006PT-Fk for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2016 22:58:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJBYw-0008TQ-CF for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2016 22:58:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:32789) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJBYw-0008TH-8G for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2016 22:58:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cJBYv-0006Ay-VO for bug-gnu-emacs@gnu.org; Mon, 19 Dec 2016 22:58:01 -0500 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: Tue, 20 Dec 2016 03:58: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: patch Original-Received: via spool by 23842-submit@debbugs.gnu.org id=B23842.148220625423703 (code B ref 23842); Tue, 20 Dec 2016 03:58:01 +0000 Original-Received: (at 23842) by debbugs.gnu.org; 20 Dec 2016 03:57:34 +0000 Original-Received: from localhost ([127.0.0.1]:48188 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJBYT-0006AF-RV for submit@debbugs.gnu.org; Mon, 19 Dec 2016 22:57:34 -0500 Original-Received: from mail-io0-f195.google.com ([209.85.223.195]:32974) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJBYS-0006A0-ED for 23842@debbugs.gnu.org; Mon, 19 Dec 2016 22:57:32 -0500 Original-Received: by mail-io0-f195.google.com with SMTP id p13so21293273ioi.0 for <23842@debbugs.gnu.org>; Mon, 19 Dec 2016 19:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=F3JA9jx1vtpdm501ROo05Yc/lU/9Njqqqe0CZh7oI/M=; b=D8MRbpZSSvem00+EJwP4G9soMvoMX/UWre9irR3xIocve0LoAfNXI5s0u1lIB563dg 6+gyqOKg+edKT65f2EXjiLkGx7i1Cuk40+PQ3GM+S6qJsW3VQ1X1ruZFlaquN8f60lnH zVf1E8OobXoREVpOUjbTtgSKXq4qMNmarFrfLoCaLb3OzIrJZ/tsuhPY4xnyT7DszR/d T/gbvbrUsCWcIIaRRS/9nK9AAzI2EqEnEwZMUTsWfgGJCmt6hjArLZuaZK+ijtGYxpZr hc6SeYCDOmV6cqB3/JQuM78x0zX4QsacWKsiJFkdrJ+FHP6SpKBdXJcIOtrCBMWiAk4z myDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=F3JA9jx1vtpdm501ROo05Yc/lU/9Njqqqe0CZh7oI/M=; b=Xu2yLxAisUznKc0vc8IcyX2hAOvjkMZW4Wp1JvN1Fok6iJeBQzgdJm/JotYa/RTUOr 3dssbXRhOcKkywsyGacMFfAaYOeEyuogFS8eLU4ctOeDznKwIGS0to/tcwedpW7iuIoE 3gqWvGDt+cqbvopKHijarNMrzJGoUKwXuSTSQuh/JTdqMoew0nSJafkri8dWRvxIkqsW NZ7VyTRetA8oiVgOkknFXjZtas75wQ6JkuZ9WcYDTOKvWtjzgObg/s5kyNR8i3N+Z1og CyjuuKhKalt+VBKxToaIHRE2L9JA0uisGqVALtICmw2eGzg41Rb72Vqjl0KYqKuNcMdj nzKA== X-Gm-Message-State: AIkVDXK1uRgKDHiKt+1SxlhJzEt61Wmhk+pQ2XGQcl2H3TsXhhvc+GfcIF77T3EMYzLVcQ== X-Received: by 10.107.142.194 with SMTP id q185mr21353958iod.147.1482206246724; Mon, 19 Dec 2016 19:57:26 -0800 (PST) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id j143sm5108477ita.1.2016.12.19.19.57.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Dec 2016 19:57:25 -0800 (PST) In-Reply-To: <874m6ovzy2.fsf@users.sourceforge.net> (npostavs@users.sourceforge.net's message of "Sat, 13 Aug 2016 22:36:53 -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:127229 Archived-At: --=-=-= Content-Type: text/plain Wilson Snyder wrote: > It's perhaps reasonable to break a small number of things in > say Emacs 21, but this patch also breaks Emacs 23.1, which > is still relatively widely deployed for those on Redhat > distros, such as at my employer. I have only Emacs versions back to 23.4 built. I think the patch below should work, but I haven't tested it on 23.1. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v2-0001-Use-completion-at-point-in-verilog-mode.patch Content-Description: patch >From c7257a3e1d32c1c66b99c4794a4ae2b75524377c Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 13 Aug 2016 22:13:56 -0400 Subject: [PATCH v2] 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). We need to keep them for backwards compatibility with older emacs versions, but use completion-at-point if available. * lisp/progmodes/verilog-mode.el (verilog-toggle-completions): Mark as obsolete if completion-cycle-threshold is available. (verilog-mode-map, verilog-menu): Bind completion-at-point and completion-help-at-point in preference to verilog-complete-word and verilog-show-completions, respectively. (verilog-mode): Add verilog-completion-at-point to completion-at-point-functions. (verilog-completion-at-point): New function. (verilog-show-completions, verilog-complete-word): Use it to avoid code duplication. --- lisp/progmodes/verilog-mode.el | 71 ++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/lisp/progmodes/verilog-mode.el b/lisp/progmodes/verilog-mode.el index 5368b61..7c7242f 100644 --- a/lisp/progmodes/verilog-mode.el +++ b/lisp/progmodes/verilog-mode.el @@ -1416,8 +1416,10 @@ 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" (if (fboundp 'completion-at-point) + 'completion-at-point 'verilog-complete-word)) + (define-key map "\M-?" (if (fboundp 'completion-help-at-point) + 'completion-help-at-point 'verilog-show-completions)) ;; 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) @@ -1448,7 +1450,7 @@ verilog-mode-map (easy-menu-define verilog-menu verilog-mode-map "Menu for Verilog mode" (verilog-easy-menu-filter - '("Verilog" + `("Verilog" ("Choose Compilation Action" ["None" (progn @@ -1540,7 +1542,8 @@ 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" ,(if (fboundp 'completion-at-point) + 'completion-at-point 'verilog-complete-word) :help "Complete word at point"] "----" ["Recompute AUTOs" verilog-auto @@ -3806,7 +3809,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. @@ -3920,6 +3923,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 @@ -7198,6 +7204,9 @@ verilog-toggle-completions 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.") +(when (boundp 'completion-cycle-threshold) + (make-obsolete-variable + 'verilog-toggle-completions 'completion-cycle-threshold "26.1")) (defvar verilog-type-keywords @@ -7480,21 +7489,33 @@ verilog-last-word-numb (defvar verilog-last-word-shown nil) (defvar verilog-last-completions nil) +(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)))) + (list b e allcomp))) + (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. + ;; NOTE: This is just a fallback for Emacs versions lacking + ;; `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))) + (let* ((comp-info (verilog-completion-at-point)) + (b (nth 0 comp-info)) + (e (nth 1 comp-info)) (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))) + (allcomp (nth 2 comp-info)) (match (if verilog-toggle-completions "" (try-completion verilog-str (mapcar (lambda (elm) @@ -7543,22 +7564,12 @@ verilog-complete-word (defun verilog-show-completions () "Show all possible completions at current point." (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)))) - ;; 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*"))))) - + ;; Show possible completions in a temporary buffer. + (with-output-to-temp-buffer "*Completions*" + (display-completion-list (nth 2 (verilog-completion-at-point)))) + ;; Wait for a key press. Then delete *Completion* window + (momentary-string-display "" (point)) + (delete-window (get-buffer-window (get-buffer "*Completions*")))) (defun verilog-get-default-symbol () "Return symbol around current point as a string." -- 2.9.3 --=-=-=--