unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lucien Pullen <drurowin@gmail.com>
To: emacs-devel@gnu.org
Subject: [ELPA] Update package: psgml: handle (compile-internal) obsoletion
Date: Thu, 18 May 2017 02:45:21 -0600	[thread overview]
Message-ID: <m0shk2ime6.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-psgml.el-sgml-validate-use-compilation-start-for-rec.patch --]
[-- Type: text/x-patch, Size: 1115 bytes --]

From 810f33f50b7c47250e41fb23387a96d862162452 Mon Sep 17 00:00:00 2001
From: Lucien Pullen <drurowin@gmail.com>
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)))
 
 \f
 ;;;; Autoloads and hooks
-- 
2.3.4


             reply	other threads:[~2017-05-18  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18  8:45 Lucien Pullen [this message]
2017-05-18 13:04 ` [ELPA] Update package: psgml: handle (compile-internal) obsoletion Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0shk2ime6.fsf@gmail.com \
    --to=drurowin@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).