From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: compile.el legacy compatibility Date: Sat, 06 Apr 2019 18:50:32 -0400 Message-ID: References: <83mulcisde.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="24834"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , emacs-devel To: Troy Hinckley Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 07 00:50:49 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCu98-0006KT-Oj for ged-emacs-devel@m.gmane.org; Sun, 07 Apr 2019 00:50:46 +0200 Original-Received: from localhost ([127.0.0.1]:59877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCu97-0007pX-Jo for ged-emacs-devel@m.gmane.org; Sat, 06 Apr 2019 18:50:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:48238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hCu8z-0007ie-99 for emacs-devel@gnu.org; Sat, 06 Apr 2019 18:50:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hCu8x-0000Li-SA for emacs-devel@gnu.org; Sat, 06 Apr 2019 18:50:37 -0400 Original-Received: from pmta31.teksavvy.com ([76.10.157.38]:43306) by eggs.gnu.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.71) (envelope-from ) id 1hCu8v-0000Kj-Kt; Sat, 06 Apr 2019 18:50:33 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2GFAwDHLKlc//zyd0tlHQEBBQEHBQGBV?= =?us-ascii?q?AUBCwGCEG1+J4hAhEmKQAGCDBMiAYkCjyKBZxCEZgQCAoVTIzcGDQEBAwEBAQg?= =?us-ascii?q?BAwICAmkohUsBAQEBAgFWIwULCw4DAwECARwSFA0LDRYOExqEZgMNCK04h3kNg?= =?us-ascii?q?h+BMAGLXYF/gRGCFH4+ghqCBAoFhXgDilkEhwCTcDYJkD+DXoFhiWWJFpM4jDQ?= =?us-ascii?q?MgWUjgVYzGggwO4JskGgmMI4ggk0BAQ?= X-IPAS-Result: =?us-ascii?q?A2GFAwDHLKlc//zyd0tlHQEBBQEHBQGBVAUBCwGCEG1+J4h?= =?us-ascii?q?AhEmKQAGCDBMiAYkCjyKBZxCEZgQCAoVTIzcGDQEBAwEBAQgBAwICAmkohUsBA?= =?us-ascii?q?QEBAgFWIwULCw4DAwECARwSFA0LDRYOExqEZgMNCK04h3kNgh+BMAGLXYF/gRG?= =?us-ascii?q?CFH4+ghqCBAoFhXgDilkEhwCTcDYJkD+DXoFhiWWJFpM4jDQMgWUjgVYzGggwO?= =?us-ascii?q?4JskGgmMI4ggk0BAQ?= X-IronPort-AV: E=Sophos;i="5.60,318,1549947600"; d="scan'208";a="89773366" Original-Received: from 75-119-242-252.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([75.119.242.252]) by smtp.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Apr 2019 18:50:32 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id 14DFAAE8B1; Sat, 6 Apr 2019 18:50:32 -0400 (EDT) In-Reply-To: (Troy Hinckley's message of "Sat, 6 Apr 2019 07:14:00 -0600") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 76.10.157.38 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:235046 Archived-At: > I checked out the latest commit, and it looks like there is some more code > we need to remove to complete this. AFAICT what you're suggesting removes another backward compatibility feature, made obsolete around the same time but otherwise independent. Furthermore, this one is better documented in the code (e.g. with a make-obsolete-variable), so I think we can remove it when we decide to drop the other "obsolete since 24.1" features. Stefan > On Wed, Apr 3, 2019 at 9:21 AM Stefan Monnier > wrote: > >> >> > However since we changed to the new style at least 15 years ago, it >> >> > seems it would be best to drop the old compatibility (which is your >> >> > first preference as well). Who has the power to make that call? >> >> That would be Eli, >> > I have no opinion on this, provided that the incompatible change is >> > clearly documented in NEWS and in relevant places in compile.el (if >> > there are such places). >> >> Thanks, done. >> >> >> Stefan >> >> > From fad195eba10ced934d9bae3a81780ff45349fcd1 Mon Sep 17 00:00:00 2001 > From: CeleritasCelery > Date: Sat, 23 Mar 2019 06:04:57 -0700 > Subject: [PATCH] Remove obselete compile.el code > > --- > lisp/progmodes/compile.el | 67 +++++++++++++++++----------------------------- > lisp/progmodes/prolog.el | 15 +---------- > lisp/textmodes/tex-mode.el | 4 +-- > 3 files changed, 26 insertions(+), 60 deletions(-) > > diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el > index 1a0d9bdbb7..cbe36a30f7 100644 > --- a/lisp/progmodes/compile.el > +++ b/lisp/progmodes/compile.el > @@ -820,11 +820,6 @@ Faces `compilation-error-face', `compilation-warning-face', > (defvar compilation-leave-directory-face 'font-lock-builtin-face > "Face name to use for leaving directory messages.") > > -;; Used for compatibility with the old compile.el. > -(defvar compilation-parse-errors-function nil) > -(make-obsolete-variable 'compilation-parse-errors-function > - 'compilation-error-regexp-alist "24.1") > - > (defcustom compilation-auto-jump-to-first-error nil > "If non-nil, automatically jump to the first error during compilation." > :type 'boolean > @@ -1081,7 +1076,7 @@ POS and RES.") > (setq file (if (functionp file) (funcall file) > (match-string-no-properties file)))) > (let ((dir > - (unless (file-name-absolute-p file) > + (unless (file-name-absolute-p file) > (let ((pos (compilation--previous-directory > (match-beginning 0)))) > (when pos > @@ -1310,34 +1305,29 @@ FMTS is a list of format specs for transforming the file name. > (and proc (memq (process-status proc) '(run open)))) > (setq end (line-beginning-position)))) > (compilation--remove-properties start end) > - (if compilation-parse-errors-function > - ;; An old package! Try the compatibility code. > - (progn > - (goto-char start) > - (compilation--compat-parse-errors end)) > - > - ;; compilation-directory-matcher is the only part that really needs to be > - ;; parsed sequentially. So we could split it out, handle directories > - ;; like syntax-propertize, and the rest as font-lock-keywords. But since > - ;; we want to have it work even when font-lock is off, we'd then need to > - ;; use our own compilation-parsed text-property to keep track of the parts > - ;; that have already been parsed. > - (goto-char start) > - (while (re-search-forward (car compilation-directory-matcher) > - end t) > - (compilation--flush-directory-cache (match-beginning 0) (match-end 0)) > - (when compilation-debug > - (font-lock-append-text-property > - (match-beginning 0) (match-end 0) > - 'compilation-debug > - (vector 'directory compilation-directory-matcher))) > - (dolist (elt (cdr compilation-directory-matcher)) > - (add-text-properties (match-beginning (car elt)) > - (match-end (car elt)) > - (compilation-directory-properties > - (car elt) (cdr elt))))) > - > - (compilation-parse-errors start end))) > + > + ;; compilation-directory-matcher is the only part that really needs to be > + ;; parsed sequentially. So we could split it out, handle directories > + ;; like syntax-propertize, and the rest as font-lock-keywords. But since > + ;; we want to have it work even when font-lock is off, we'd then need to > + ;; use our own compilation-parsed text-property to keep track of the parts > + ;; that have already been parsed. > + (goto-char start) > + (while (re-search-forward (car compilation-directory-matcher) > + end t) > + (compilation--flush-directory-cache (match-beginning 0) (match-end 0)) > + (when compilation-debug > + (font-lock-append-text-property > + (match-beginning 0) (match-end 0) > + 'compilation-debug > + (vector 'directory compilation-directory-matcher))) > + (dolist (elt (cdr compilation-directory-matcher)) > + (add-text-properties (match-beginning (car elt)) > + (match-end (car elt)) > + (compilation-directory-properties > + (car elt) (cdr elt))))) > + > + (compilation-parse-errors start end)) > > (defun compilation--note-type (type) > "Note that a new message with severity TYPE was seen. > @@ -2878,15 +2868,6 @@ TRUE-DIRNAME is the `file-truename' of DIRNAME, if given." > (setq compilation-gcpro nil) > ;; FIXME: the old code reset the directory-stack, so maybe we should > ;; put a `directory change' marker of some sort, but where? -stef > - ;; > - ;; FIXME: The old code moved compilation-current-error (which was > - ;; virtually represented by a mix of compilation-parsing-end and > - ;; compilation-error-list) to point-min, but that was only meaningful for > - ;; the internal uses of compilation-forget-errors: all calls from external > - ;; packages seem to be followed by a move of compilation-parsing-end to > - ;; something equivalent to point-max. So we heuristically move > - ;; compilation-current-error to point-max (since the external package > - ;; won't know that it should do it). --Stef > (setq compilation-current-error nil) > (let* ((proc (get-buffer-process (current-buffer))) > (mark (if proc (process-mark proc))) > diff --git a/lisp/progmodes/prolog.el b/lisp/progmodes/prolog.el > index 296a7ac3c9..cd5a1a4ecc 100644 > --- a/lisp/progmodes/prolog.el > +++ b/lisp/progmodes/prolog.el > @@ -1711,13 +1711,10 @@ This function must be called from the source code buffer." > (remove-function (process-filter process) > #'prolog-consult-compile-filter)))) > > -(defvar compilation-error-list) > - > (defun prolog-parse-sicstus-compilation-errors (limit) > "Parse the prolog compilation buffer for errors. > Argument LIMIT is a buffer position limiting searching. > For use with the `compilation-parse-errors-function' variable." > - (setq compilation-error-list nil) > (message "Parsing SICStus error messages...") > (let (filepath dir file errorline) > (while > @@ -1736,17 +1733,7 @@ For use with the `compilation-parse-errors-function' variable." > (if (string-match "\\(.*/\\)\\([^/]*\\)$" filepath) > (progn > (setq dir (match-string 1 filepath)) > - (setq file (match-string 2 filepath)))) > - > - (setq compilation-error-list > - (cons > - (cons (save-excursion > - (beginning-of-line) > - (point-marker)) > - (list (list file dir) errorline)) > - compilation-error-list) > - )) > - )) > + (setq file (match-string 2 filepath))))))) > > (defun prolog-consult-compile-filter (process output) > "Filter function for Prolog compilation PROCESS. > diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el > index 9c91d27b94..2fdbba84cf 100644 > --- a/lisp/textmodes/tex-mode.el > +++ b/lisp/textmodes/tex-mode.el > @@ -2489,9 +2489,7 @@ Only applies the FSPEC to the args part of FORMAT." > (tex-send-command tex-shell-cd-command dir))) > (with-current-buffer (process-buffer (tex-send-command cmd)) > (setq compilation-last-buffer (current-buffer)) > - (compilation-forget-errors) > - ;; Don't parse previous compilations. > - (set-marker compilation-parsing-end (1- (point-max)))) > + (compilation-forget-errors)) > (tex-display-shell) > (setq tex-last-buffer-texed (current-buffer))) >