From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Liu Newsgroups: gmane.emacs.bugs Subject: bug#18620: 25.0.50; cfengine3-make-syntax-cache Date: Tue, 07 Oct 2014 11:22:46 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1412652215 14283 80.91.229.3 (7 Oct 2014 03:23:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Oct 2014 03:23:35 +0000 (UTC) To: 18620@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 07 05:23:29 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 1XbLMw-00022I-Ru for geb-bug-gnu-emacs@m.gmane.org; Tue, 07 Oct 2014 05:23:23 +0200 Original-Received: from localhost ([::1]:56137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbLMw-0003PC-Fx for geb-bug-gnu-emacs@m.gmane.org; Mon, 06 Oct 2014 23:23:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbLMn-0003P2-CJ for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 23:23:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbLMc-000618-T9 for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 23:23:13 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44531) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbLMc-000614-PD for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 23:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XbLMc-0007wL-B6 for bug-gnu-emacs@gnu.org; Mon, 06 Oct 2014 23:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Liu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 07 Oct 2014 03:23:02 +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.141265217530504 (code B ref 18620); Tue, 07 Oct 2014 03:23:02 +0000 Original-Received: (at 18620) by debbugs.gnu.org; 7 Oct 2014 03:22:55 +0000 Original-Received: from localhost ([127.0.0.1]:36095 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbLMU-0007vu-Di for submit@debbugs.gnu.org; Mon, 06 Oct 2014 23:22:54 -0400 Original-Received: from mail-pd0-f181.google.com ([209.85.192.181]:55823) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XbLMS-0007vm-KO for 18620@debbugs.gnu.org; Mon, 06 Oct 2014 23:22:53 -0400 Original-Received: by mail-pd0-f181.google.com with SMTP id z10so4301290pdj.40 for <18620@debbugs.gnu.org>; Mon, 06 Oct 2014 20:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:face:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=eZkFc2cYylPCmwo5zjmahAb2SANXQnL3cezfpBAvH38=; b=obaGmvBaMZNkrZrVK4VpUKhgJfIdjZlk/MWi5IAkHu4pC64MJG8n33swAEvludWhw9 BnoWVUw5KCVHSo9ntk4Q2gIiVlQtgTWwTOBlXjeKHAOfhl1ZKReVo6SKwaihIqvy15+B m5EXc7EQPum6y2eT1QviNZRKQQMc5Xe7WePu+oLFVg1NpKmZFT+yiX7g4GhzdlkKf8TT ssO5dGZK4uoymMW5Ree4wjeBDnqHsbb7iWXaRyt+20d/8HTBlIzFrXf9HSZwJcPG5fwc /MY7Myml/XlEfmXagh6EoyHUGMrmzYMEWH7XervVDaxYoDkeWdBRP0DJ8XIOsT2+hwqz bLAQ== X-Received: by 10.68.102.100 with SMTP id fn4mr953149pbb.46.1412652171566; Mon, 06 Oct 2014 20:22:51 -0700 (PDT) Original-Received: from fortuna ([221.222.150.213]) by mx.google.com with ESMTPSA id pg2sm14534512pbb.43.2014.10.06.20.22.49 for <18620@debbugs.gnu.org> (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Mon, 06 Oct 2014 20:22:50 -0700 (PDT) Face: iVBORw0KGgoAAAANSUhEUgAAACgAAAAoAgMAAADxkFD+AAAADFBMVEUvT09qWs3/pQD///+J kUVcAAAAAWJLR0QAiAUdSAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9cBBwMLOd3veKQA AACuSURBVBjTldE9CgIxEAXgB+lEyFUC2wo5ikdZ8DSypxhMY7H9VuIVwlqkGRgnm59VsHGafIQ3 CZlAtmKIRaHETgYa12lqvEsPYKf8wXHsPGfqPaUM0g9aJPKFXkmNQmSDqwzz4Fpgpz+6WAPY2z5o uPJJpu0uypcl4nyCibMLQ8lCiVjayLoQvw5LsVKQuHPRR958HZbOcVsKeepcLxpByjycGvnKmY+c MBvrtyjfe0vmuLvdq/kAAAAASUVORK5CYII= In-Reply-To: (Ted Zlatanov's message of "Mon, 06 Oct 2014 22:31:09 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (CentOS 6.5) 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:94220 Archived-At: On 2014-10-06 22:31 -0400, Ted Zlatanov wrote: > 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. cfengine3-make-syntax-cache may still return a regexp and it won't fall back on cfengine3-fallback-syntax when `cf-promises -s json' fails; how about something along these lines? =3D=3D=3D modified file 'lisp/progmodes/cfengine.el' --- lisp/progmodes/cfengine.el 2014-01-30 07:42:57 +0000 +++ lisp/progmodes/cfengine.el 2014-10-07 03:10:44 +0000 @@ -1231,29 +1231,31 @@ (setq cfengine-mode-syntax-cache nil)) =20 (defun cfengine3-make-syntax-cache () - "Build the CFEngine 3 syntax cache. + "Build the CFEngine 3 syntax cache and return it. Calls `cfengine-cf-promises' with \"-s json\"" - (let ((syntax (cddr (assoc cfengine-cf-promises cfengine-mode-syntax-cac= he)))) - (if cfengine-cf-promises - (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") - (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)))))) - cfengine3-fallback-syntax)) + (or (cddr (assoc cfengine-cf-promises cfengine-mode-syntax-cache)) + (when cfengine-cf-promises + (with-demoted-errors "cfengine3-make-syntax-cache: %S" + (with-temp-buffer + (process-file cfengine-cf-promises + nil ; no input + t ; current buffer + nil ; no redisplay + "-s" "json") + (goto-char (point-min)) + (let ((syntax (json-read))) + (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)) + syntax))))) + cfengine3-fallback-syntax)) =20 (defun cfengine3-documentation-function () "Document CFengine 3 functions around point. @@ -1265,7 +1267,6 @@ =20 (defun cfengine3-completion-function () "Return completions for function name around or before point." - (cfengine3-make-syntax-cache) (let* ((bounds (save-excursion (let ((p (point))) (skip-syntax-backward "w_" (point-at-bol)) > > 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.) Agreed. Sad to see this and the cf community seems not very active. BTW, do you know if CF is still part of GNU? I only see version 2 on GNU=B9. > > Thanks > Ted Thanks, Leo Footnotes:=20 =B9 http://www.gnu.org/software/cfengine/