From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lele Gaifax Newsgroups: gmane.emacs.devel Subject: Re: New Flymake rewrite in emacs-26 Date: Wed, 04 Oct 2017 20:11:30 +0200 Organization: Nautilus Entertainments Message-ID: <87efqiailp.fsf@metapensiero.it> References: <8760bwz5qf.fsf@gmail.com> <83infw1dkz.fsf@gnu.org> <87tvzf9lbg.fsf@metapensiero.it> <87poa39gjb.fsf@metapensiero.it> <87lgkqampq.fsf@metapensiero.it> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1507140721 15002 195.159.176.226 (4 Oct 2017 18:12:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 4 Oct 2017 18:12:01 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.60 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 04 20:11:57 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzo99-0002o1-Nc for ged-emacs-devel@m.gmane.org; Wed, 04 Oct 2017 20:11:51 +0200 Original-Received: from localhost ([::1]:36351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzo9H-0001Yx-2e for ged-emacs-devel@m.gmane.org; Wed, 04 Oct 2017 14:11:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzo96-0001YW-TR for emacs-devel@gnu.org; Wed, 04 Oct 2017 14:11:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzo93-0006TT-M3 for emacs-devel@gnu.org; Wed, 04 Oct 2017 14:11:48 -0400 Original-Received: from [195.159.176.226] (port=39510 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dzo93-0006Rx-Ap for emacs-devel@gnu.org; Wed, 04 Oct 2017 14:11:45 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dzo8q-0000uk-Mf for emacs-devel@gnu.org; Wed, 04 Oct 2017 20:11:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 202 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:tRUfNaWlX830Q7iEhtpLs68KctU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 195.159.176.226 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:219083 Archived-At: Lele Gaifax writes: > João Távora writes: > >> I wonder if you've read the docstrings in the .el files, too, since that's >> where most of the new documentation is right now. > > Yes, and I will be doing that until I figure out the details about replacing > my current flymake-python-pyflakes based configuration with a new "native" > backend. Speaking of which, while reading the -proc source I found recipes for Perl and PHP, is there any interest in out-of-the-box Python equivalents? Here is an updated diff: there is a "[???]" marker for a sentence that seems wrong but I could not understand exactly its meaning. ciao, lele. diff --git a/doc/misc/flymake.texi b/doc/misc/flymake.texi index 5dd72f81e2..5ff5537d04 100644 --- a/doc/misc/flymake.texi +++ b/doc/misc/flymake.texi @@ -182,7 +182,7 @@ Syntax check statuses @cindex Syntax check statuses After syntax check is finished, its status is displayed in the mode line. -The following statuses are defined. +The following statuses are defined: @multitable @columnfractions 0.25 0.75 @item @code{Wait} @@ -356,7 +356,7 @@ Adding support for a new syntax check tool @code{init-function} is required to initialize the syntax check, usually by creating a temporary copy of the buffer contents. The function must return @code{(list cmd-name arg-list)}. If -@code{init-function} returns null, syntax check is aborted, by +@code{init-function} returns null, syntax check is aborted, but @code{flymake-mode} is not switched off. @item cleanup-function @@ -375,7 +375,7 @@ Adding support for a new syntax check tool @end table To add support for a new syntax check tool, write corresponding -@code{init-function}, and, optionally @code{cleanup-function} and +@code{init-function} and, optionally, @code{cleanup-function} and @code{getfname-function}. If the format of error messages reported by the new tool is not yet supported by Flymake, add a new entry to the @code{flymake-proc-err-line-patterns} list. @@ -493,7 +493,7 @@ Implementation overview @code{flymake-proc-legacy-backend} saves a copy of the buffer in a temporary file in the buffer's directory (or in the system temp -directory, for java files), creates a syntax check command and +directory, for Java files), creates a syntax check command and launches a process with this command. The output is parsed using a list of error message patterns, and error information (file name, line number, type and text) is saved. After the process has finished, @@ -631,7 +631,7 @@ Locating the buildfile using some build tool, like Make or Ant. All Make configuration data is usually stored in a file called -@code{Makefile}. To allow for future extensions, flymake uses a notion of +@code{Makefile}. To allow for future extensions, Flymake uses a notion of buildfile to reference the 'project configuration' file. Special function, @code{flymake-proc-find-buildfile} is provided for locating buildfiles. diff --git a/lisp/progmodes/flymake-proc.el b/lisp/progmodes/flymake-proc.el index 47ec27f611..766dae312c 100644 --- a/lisp/progmodes/flymake-proc.el +++ b/lisp/progmodes/flymake-proc.el @@ -113,7 +113,7 @@ flymake-proc--current-process "Currently active Flymake process for a buffer, if any.") (defvar flymake-proc--report-fn nil - "If bound, function used to report back to flymake's UI.") + "If bound, function used to report back to Flymake's UI.") (defun flymake-proc-reformat-err-line-patterns-from-compile-el (original-list) "Grab error line patterns from ORIGINAL-LIST in compile.el format. @@ -265,7 +265,6 @@ flymake-proc--included-file-name (defun flymake-proc--find-possible-master-files (file-name master-file-dirs masks) "Find (by name and location) all possible master files. - Name is specified by FILE-NAME and location is specified by MASTER-FILE-DIRS. Master files include .cpp and .c for .h. Files are searched for starting from the .h directory and max @@ -626,7 +625,7 @@ flymake-proc--process-sentinel (defun flymake-proc--panic (problem explanation) "Tell Flymake UI about a fatal PROBLEM with this backend. May only be called in a dynamic environment where -`flymake-proc--dynamic-report-fn' is bound" +`flymake-proc--dynamic-report-fn' is bound." (flymake-log 0 "%s: %s" problem explanation) (if (and (boundp 'flymake-proc--report-fn) flymake-proc--report-fn) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 0b28dc31cf..003cf93acf 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -198,7 +198,7 @@ flymake-log `(flymake--log-1 ,level ',sublog ,msg ,@args))) (defun flymake-error (text &rest args) - "Format TEXT with ARGS and signal an error for flymake." + "Format TEXT with ARGS and signal an error for Flymake." (let ((msg (apply #'format-message text args))) (flymake-log :error msg) (error (concat "[Flymake] " msg)))) @@ -335,7 +335,7 @@ flymake-diagnostic-functions * the remaining arguments are keyword-value pairs in the form (:KEY VALUE :KEY2 VALUE2...). Currently, Flymake provides no such arguments, but backend functions must be prepared to - accept to accept and possibly ignore any number of them. + accept and possibly ignore any number of them. Backend functions are expected to initiate the buffer check, but aren't required to complete it check before exiting: if the @@ -378,8 +378,8 @@ flymake-diagnostic-functions * ‘:explanation’: value should give user-readable details of the situation encountered, if any. -* ‘:force’: value should be a boolean suggesting that the Flymake - considers the report even if was somehow unexpected.") +* ‘:force’: value should be a boolean suggesting that Flymake + considers the report even if it was somehow unexpected.") (defvar flymake-diagnostic-types-alist `((:error @@ -396,7 +396,7 @@ flymake-diagnostic-types-alist * Every property pertaining to overlays, except `category' and `evaporate' (see Info Node `(elisp)Overlay Properties'), used - affect the appearance of Flymake annotations. + to affect the appearance of Flymake annotations. * `bitmap', an image displayed in the fringe according to `flymake-fringe-indicator-position'. The value actually @@ -515,12 +515,12 @@ flymake--backend-state "Buffer-local hash table of a Flymake backend's state. The keys to this hash table are functions as found in `flymake-diagnostic-functions'. The values are structures -of the type `flymake--backend-state', with these slots +of the type `flymake--backend-state', with these slots: `running', a symbol to keep track of a backend's replies via its REPORT-FN argument. A backend is running if this key is present. If the key is absent if the backend isn't expecting any -replies from the backend. +replies from the backend. [???] `diags', a (possibly empty) list of diagnostic objects created with `flymake-make-diagnostic'. This key is absent if the @@ -556,7 +556,6 @@ flymake-is-running &key explanation force &allow-other-keys) "Handle reports from BACKEND identified by TOKEN. - BACKEND, REPORT-ACTION and EXPLANATION, and FORCE conform to the calling convention described in `flymake-diagnostic-functions' (which see). Optional FORCE says to handle a report even if TOKEN was @@ -643,7 +642,7 @@ flymake-reporting-backends (defun flymake--disable-backend (backend &optional explanation) "Disable BACKEND because EXPLANATION. -If is is running also stop it." +If it is running also stop it." (flymake-log :warning "Disabling backend %s because %s" backend explanation) (flymake--with-backend-state backend state (setf (flymake--backend-state-running state) nil @@ -659,7 +658,7 @@ flymake--run-backend (flymake--backend-state-disabled state) nil (flymake--backend-state-diags state) nil (flymake--backend-state-reported-p state) nil)) - ;; FIXME: Should use `condition-case-unless-debug' here, for don't + ;; FIXME: Should use `condition-case-unless-debug' here, it doesn't ;; for two reasons: (1) that won't let me catch errors from inside ;; `ert-deftest' where `debug-on-error' appears to be always ;; t. (2) In cases where the user is debugging elisp somewhere @@ -799,7 +798,6 @@ flymake-find-file-hook (defun flymake-goto-next-error (&optional n filter interactive) "Go to Nth next Flymake error in buffer matching FILTER. - Interactively, always move to the next error. Interactively, and with a prefix arg, skip any diagnostics with a severity less than ‘:warning’. @@ -855,7 +853,6 @@ flymake-goto-next-error (defun flymake-goto-prev-error (&optional n filter interactive) "Go to Nth previous Flymake error in buffer matching FILTER. - Interactively, always move to the previous error. Interactively, and with a prefix arg, skip any diagnostics with a severity less than ‘:warning’. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.