emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ELPA] Update package: psgml: handle (compile-internal) obsoletion


From: Lucien Pullen
Subject: [ELPA] Update package: psgml: handle (compile-internal) obsoletion
Date: Thu, 18 May 2017 02:45:21 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (darwin)

It looks like (compile-internal) has been deleted, finally. This patch (see attached) adds a check to use the new (compilation-start) while
still being compatible with really old versions.

Is it really necessary to keep the legacy call in there?... how far back should we support old versions? My computer ships with v22, but my OS is from 2013, and the new procedure was already marked as the one to use
by that point.

Unrelated... ...

I'm not very familiar with Emacs' dynamic loader. Does it optimize
 out the branch instruction on load since it's a comparison of a
constant? or does compiled code get interpreted literally? It's only a quick branch and calling the external procedure takes much longer, but I used the version check instead of (fboundp) since it's probably faster than the obarray lookup if the check is performed every time
 you call the procedure.  Old assembly habits die hard.

Anyways, on to the patch file.

>From 810f33f50b7c47250e41fb23387a96d862162452 Mon Sep 17 00:00:00 2001
From: Lucien Pullen <address@hidden>
Date: Thu, 18 May 2017 01:54:05 -0600
Subject: [PATCH] * psgml.el (sgml-validate): use (compilation-start) for
 recent emacs

The procedure (compile-internal) has been deprecated since Emacs v22 and
is removed in at least v24.4.
---
 psgml.el | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/psgml.el b/psgml.el
index 9ab7eef..eb98071 100644
--- a/psgml.el
+++ b/psgml.el
@@ -1133,9 +1133,11 @@ and move to the line in the SGML document that caused 
it."
                               nil nil 'sgml-validate-command-history)))
   (if sgml-offer-save
       (save-some-buffers nil nil))
-  (compile-internal command "No more errors" "SGML validation"
-                   nil
-                   sgml-validate-error-regexps))
+  (if (< emacs-major-version 22)
+      (compile-internal command "No more errors" "SGML validation"
+                        nil
+                        sgml-validate-error-regexps)
+    (compilation-start command nil nil sgml-validate-error-regexps)))
 
 
 ;;;; Autoloads and hooks
-- 
2.3.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]