From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.bugs Subject: bug#18620: 25.0.50; cfengine3-make-syntax-cache Date: Mon, 06 Oct 2014 22:31:09 -0400 Organization: =?UTF-8?Q?=D0=A2=D0=B5=D0=BE=D0=B4=D0=BE=D1=80_?= =?UTF-8?Q?=D0=97=D0=BB=D0=B0=D1=82=D0=B0=D0=BD=D0=BE=D0=B2?= @ Cienfuegos Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1412649147 13212 80.91.229.3 (7 Oct 2014 02:32:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2014 02:32:27 +0000 (UTC) Cc: 18620@debbugs.gnu.org To: Leo Liu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 07 04:32:21 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XbKZT-0000AK-OX for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Oct 2014 04:32:15 +0200 Original-Received: from localhost ([::1]:55789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbKZT-0004sB-DS for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Oct 2014 22:32:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbKZL-0004rw-Mz for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 22:32:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbKZG-00087C-GL for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 22:32:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44497) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbKZG-000878-Aj for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 22:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XbKZF-0005PE-Rd for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 22:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ted Zlatanov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Oct 2014 02:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18620 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18620-submit@debbugs.gnu.org id=B18620.141264907620723 (code B ref 18620); Tue, 07 Oct 2014 02:32:01 +0000 Original-Received: (at 18620) by debbugs.gnu.org; 7 Oct 2014 02:31:16 +0000 Original-Received: from localhost ([127.0.0.1]:36061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbKYV-0005OA-5a for submit@debbugs.gnu.org; Mon, 06 Oct 2014 22:31:15 -0400 Original-Received: from mail-vc0-f170.google.com ([209.85.220.170]:50210) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbKYS-0005O2-ME for 18620@debbugs.gnu.org; Mon, 06 Oct 2014 22:31:13 -0400 Original-Received: by mail-vc0-f170.google.com with SMTP id hy10so4107089vcb.15 for <18620@debbugs.gnu.org>; Mon, 06 Oct 2014 19:31:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lifelogs.com; s=google; h=from:to:cc:subject:organization:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=qdRSyBgbnQZ2jLcCAHIOvTZQYh2rfPYU9y8MItAZrmc=; b=V6WB1tgOSMmhgVV7RpBFqtGCn/rMteHVUSoCRN5utR0tQR5a94enlxLH0dAPgxQl2G qrqrYlRl1R8AADmV6RhAkKqw0DgmPqTb64ztwsWxLFEvGR4C/bXrh+3U1FgB7fP+0v8c PFSV+NB1dkFVlAV9ZiUSRTyDNfaTIWRqUUxNM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:organization:references :mail-copies-to:gmane-reply-to-list:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=qdRSyBgbnQZ2jLcCAHIOvTZQYh2rfPYU9y8MItAZrmc=; b=UOnBRhBndTICnX4OfGCZES0n/yeorVOXdISlq+J8A5PEVpeOBQ9Xrja5BSvgrMVASm Gyw/En5lAnU5Ays5jvapIyEB1p8P61BZR4rECHl2Pq7XeRrLr+G9LD5ZWp9pw8KdsoSg rca4dX1l9fWNkEKJbuqTJf7f0pZ44PepvdeXVSDm2A1KRP72oF+sGdV1V/CBjlA/MK3R 1byc/HIbHskC3CjARcRC/2HRNffZJPUTOjHkvN2SNnwO3cFQqaOclGaeilHXf4XppwWL ZyOB7Xrcgl24zMo38azx5KiD5EaHe789V+ZTLh73deDg3uNkGndL0KbTCrHPFT8Oy3TF QZXA== X-Gm-Message-State: ALoCoQmR6R1fYo/zyNFjbP9URNOphL3IUmDmxt8KGOclX4uTPe630Y+T4Ua7CN4B5VaD5VsMcfxr X-Received: by 10.52.166.2 with SMTP id zc2mr555069vdb.4.1412649071751; Mon, 06 Oct 2014 19:31:11 -0700 (PDT) Original-Received: from bug.local ([166.170.35.2]) by mx.google.com with ESMTPSA id pj5sm1631894vdb.21.2014.10.06.19.31.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Oct 2014 19:31:11 -0700 (PDT) X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: (Leo Liu's message of "Fri, 03 Oct 2014 18:28:22 +0800") User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (darwin) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:94218 Archived-At: --=-=-= Content-Type: text/plain On Fri, 03 Oct 2014 18:28:22 +0800 Leo Liu wrote: LL> There are multiple problems with cfengine3-make-syntax-cache: LL> 1. call-process-shell-command changed in trunk; simply replace it with LL> process-file. LL> 2. it doesn't always return a `syntax' value Thanks for catching this, I had not noticed it sooner. Please see the patch below; does it work for you? If so I will commit and close the bug. LL> 3. cf-promises doesn't have -s option in Centos 6.5 (cfengine 3.3) I think that's all right, we will default to the fallback syntax. The `-s' option was added after 3.3 but IMO the fallback syntax is good enough for all 3.x work. (Unfortunately the Red Hat ecosystem has no CFEngine package maintainers so to get the latest you have to install from the official CFEngine package repo as directed by their website.) Thanks Ted --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=18620-cfengine-syntax.patch === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-06 17:47:56 +0000 +++ lisp/ChangeLog 2014-10-07 02:18:14 +0000 @@ -1,3 +1,9 @@ +2014-10-07 Teodor Zlatanov + + * progmodes/cfengine.el (cfengine3-make-syntax-cache): Use + `process-file' instead of `call-process-shell-command'. Check if + the returned CFEngine syntax is reasonably valid (bug#18620). + 2014-10-06 Stefan Monnier * term/w32-win.el: Move all code from 32-common-fns.el here. === modified file 'lisp/progmodes/cfengine.el' --- lisp/progmodes/cfengine.el 2014-01-30 07:42:57 +0000 +++ lisp/progmodes/cfengine.el 2014-10-07 02:15:16 +0000 @@ -1238,21 +1238,25 @@ (or syntax (with-demoted-errors (with-temp-buffer - (call-process-shell-command cfengine-cf-promises - nil ; no input - t ; current buffer - nil ; no redisplay - "-s" "json") + (process-file cfengine-cf-promises + nil ; no input + t ; current buffer + nil ; no redisplay + "-s" "json") (goto-char (point-min)) (setq syntax (json-read)) - (setq cfengine-mode-syntax-cache - (cons (cons cfengine-cf-promises syntax) - cfengine-mode-syntax-cache)) - (setq cfengine-mode-syntax-functions-regex - (regexp-opt (mapcar (lambda (def) - (format "%s" (car def))) - (cdr (assq 'functions syntax))) - 'symbols)))))) + + ;; if we got a valid syntax... + (when (and (listp syntax) + (assq 'functions syntax)) + (setq cfengine-mode-syntax-cache + (cons (cons cfengine-cf-promises syntax) + cfengine-mode-syntax-cache)) + (setq cfengine-mode-syntax-functions-regex + (regexp-opt (mapcar (lambda (def) + (format "%s" (car def))) + (cdr (assq 'functions syntax))) + 'symbols))))))) cfengine3-fallback-syntax)) (defun cfengine3-documentation-function () --=-=-=--