From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 09 01:55:43 2010 Received: (at submit) by debbugs.gnu.org; 9 Apr 2010 05:55:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O07Bu-0002pH-Pp for submit@debbugs.gnu.org; Fri, 09 Apr 2010 01:55:43 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O07Bs-0002pC-27 for submit@debbugs.gnu.org; Fri, 09 Apr 2010 01:55:40 -0400 Received: from lists.gnu.org ([199.232.76.165]:37694) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O07Bo-0007kZ-Nt for submit@debbugs.gnu.org; Fri, 09 Apr 2010 01:55:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O07Bo-0000xd-4O for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 01:55:36 -0400 Received: from [140.186.70.92] (port=53323 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O07Bk-0000ws-Gq for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 01:55:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RECEIVED_FROM_WINDOWS_HOST, T_RP_MATCHES_RCVD autolearn=no version=3.3.0 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O07Bj-0002No-4q for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 01:55:32 -0400 Received: from col0-omc1-s5.col0.hotmail.com ([65.55.34.15]:63288) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O07Bi-0002Nd-QT for bug-gnu-emacs@gnu.org; Fri, 09 Apr 2010 01:55:31 -0400 Received: from COL124-DS24 ([65.55.34.7]) by col0-omc1-s5.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 8 Apr 2010 22:45:02 -0700 X-Originating-IP: [98.111.252.155] X-Originating-Email: [dpchiesa@hotmail.com] Message-ID: From: "D Chiesa" To: Subject: flymake.el - enhancement request - flymake-goto-next-error should go to the column, if possible Date: Fri, 9 Apr 2010 01:44:59 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8089.726 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726 X-OriginalArrivalTime: 09 Apr 2010 05:45:02.0044 (UTC) FILETIME=[CC4AB9C0:01CAD7A7] X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP4, XP SP1+ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.7 (-----) I use emacs v22.2.1 on Windows. Flymake relies on compilation error patterns, similar to compilation-error-regexp-alist , to detect errors and warnings. But flymake discards column information for any errors, and as a result, the functions flymake-goto-next-error and flymake-goto-prev-error do not position the cursor on the error column. This discards useful information, and also makes it more difficult to add enhancements to flymake - such as the ability to offer a menu of "quick fixes" that can be applied on the spot, through flymake-display-err-menu-for-current-line . The fix is to: 1- modify the flymake-ler struct, like so: (defstruct (flymake-ler (:constructor nil) ;; cheeso = 2010 apr 8 - add col-no field (:constructor flymake-ler-make-ler (file line type text &optional full-file col-no))) file line type text full-file col-no) 2- modify the flymake-ler functions, accordingly (defun flymake-ler-set-file (line-err-info file) (flymake-ler-make-ler file (flymake-ler-line line-err-info) (flymake-ler-type line-err-info) (flymake-ler-text line-err-info) (flymake-ler-full-file line-err-info) ;; cheeso - 2010 apr 8 (flymake-ler-col-no line-err-info) )) (defun flymake-ler-set-full-file (line-err-info full-file) (flymake-ler-make-ler (flymake-ler-file line-err-info) (flymake-ler-line line-err-info) (flymake-ler-type line-err-info) (flymake-ler-text line-err-info) full-file ;; cheeso - 2010 apr 8 (flymake-ler-col-no line-err-info) )) (defun flymake-ler-set-line (line-err-info line) (flymake-ler-make-ler (flymake-ler-file line-err-info) line (flymake-ler-type line-err-info) (flymake-ler-text line-err-info) (flymake-ler-full-file line-err-info) ;; cheeso - 2010 apr 8 (flymake-ler-col-no line-err-info) )) 3- modify flymake-parse-line to capture the column number, and store it in the flymake-ler struct that is created. (same as line-no, but use index 3, instead of 2) (defun flymake-parse-line (line) "Parse LINE to see if it is an error or warning. Return its components if so, nil otherwise." (let ((raw-file-name nil) (line-no 0) (col-no 0) (err-type "e") (err-text nil) (patterns flymake-err-line-patterns) (matched nil)) (while (and patterns (not matched)) (when (string-match (car (car patterns)) line) (let* ((file-idx (nth 1 (car patterns))) (line-idx (nth 2 (car patterns))) (col-idx (nth 3 (car patterns))) ) (setq raw-file-name (if file-idx (match-string file-idx line) nil)) (setq line-no (if line-idx (string-to-number (match-string line-idx line)) 0)) (setq col-no (if col-idx (string-to-number (match-string col-idx line)) 0)) (setq err-text (if (> (length (car patterns)) 4) (match-string (nth 4 (car patterns)) line) (flymake-patch-err-text (substring line (match-end 0))))) (or err-text (setq err-text "")) (if (and err-text (string-match "^[wW]arning" err-text)) (setq err-type "w") ) (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx raw-file-name line-no err-text) (setq matched t))) (setq patterns (cdr patterns))) (if matched ;; cheeso ;;(flymake-ler-make-ler raw-file-name line-no err-type err-text) (flymake-ler-make-ler raw-file-name line-no err-type err-text nil col-no) ()))) 4 - introduce new fn flymake-er-get-line-col , which returns (LINE COL) for the error. (defun flymake-er-get-line-col (err-info) (list (nth 0 err-info) (flymake-ler-col-no (car (nth 1 err-info))) ;; xxxx )) 5- transform all fns that get line number info, to get line+col info: (defun flymake-get-first-err-line-col (err-info-list) "Return first line with error." (when err-info-list (flymake-er-get-line-col (car err-info-list)))) (defun flymake-get-last-err-line-col (err-info-list) "Return last line with error." (when err-info-list (flymake-er-get-line-col (nth (1- (length err-info-list)) err-info-list)))) (defun flymake-get-next-err-line-col (err-info-list line-no) "Return next line with error." (when err-info-list (let* ((count (length err-info-list)) (idx 0)) (while (and (< idx count) (>= line-no (flymake-er-get-line (nth idx err-info-list)))) (setq idx (1+ idx))) (if (< idx count) (flymake-er-get-line-col (nth idx err-info-list)))))) (defun flymake-get-prev-err-line-col (err-info-list line-no) "Return previous line with error." (when err-info-list (let* ((count (length err-info-list))) (while (and (> count 0) (<= line-no (flymake-er-get-line (nth (1- count) err-info-list)))) (setq count (1- count))) (if (> count 0) (flymake-er-get-line-col (nth (1- count) err-info-list)))))) 6- modify flymake-goto-next-error to use the column information (defun flymake-goto-next-error () "Go to next error in error ring. Return (LINE COL), or nil if there are no errors." (interactive) (let* ((line-col (flymake-get-next-err-line-col flymake-err-info (flymake-current-line-no))) (line-no (car line-col)) (col-no (cadr line-col)) ) (when (not line-no) (setq line-col (flymake-get-first-err-line-col flymake-err-info)) (setq line-no (car line-col) col-no (cadr line-col)) (flymake-log 1 "passed end of file")) (if line-no (flymake-goto-line line-col) (flymake-log 1 "no errors in current buffer")))) 7- same for flymake-goto-prev-error (defun flymake-goto-prev-error () "Go to previous error in err ring." (interactive) (let* ((line-col (flymake-get-prev-err-line-col flymake-err-info (flymake-current-line-no))) (line-no (car line-col)) (col-no (cadr line-col)) ) (when (not line-no) (setq line-col (flymake-get-last-err-line-col flymake-err-info)) (setq line-no (car line-col) col-no (cadr line-col)) (flymake-log 1 "passed beginning of file")) (if line-no (flymake-goto-line line-col) (flymake-log 1 "no errors in current buffer")))) 8- modify flymake-goto-line to accept a (LINE COL) list, and act accordingly (defun flymake-goto-line (line-col) "LINE-COL contains (LINE-NO COL-NO). Go to line LINE-NO, then skip to the COL-NO column." (let ((line-no (car line-col)) (col-no (cadr line-col)) ) (goto-line line-no) (when col-no (while (> col-no 1) (setq col-no (1- col-no)) (forward-char)))) line-col) -Dino Chiesa From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 14 15:39:04 2011 Received: (at control) by debbugs.gnu.org; 14 Jun 2011 19:39:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QWZS3-00043C-GK for submit@debbugs.gnu.org; Tue, 14 Jun 2011 15:39:03 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QWZS2-00042k-4F for control@debbugs.gnu.org; Tue, 14 Jun 2011 15:39:02 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QWZRw-0001JG-UQ for control@debbugs.gnu.org; Tue, 14 Jun 2011 15:38:57 -0400 Date: Tue, 14 Jun 2011 15:38:56 -0400 Message-Id: Subject: control message for bug 8723 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) merge 5911 8723 From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 12 03:50:37 2022 Received: (at 5911-done) by debbugs.gnu.org; 12 Dec 2022 08:50:37 +0000 Received: from localhost ([127.0.0.1]:51539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4eWD-0004yx-DS for submit@debbugs.gnu.org; Mon, 12 Dec 2022 03:50:37 -0500 Received: from mail-ot1-f41.google.com ([209.85.210.41]:34524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4eWC-0004yo-Im; Mon, 12 Dec 2022 03:50:36 -0500 Received: by mail-ot1-f41.google.com with SMTP id db10-20020a0568306b0a00b0066d43e80118so6870936otb.1; Mon, 12 Dec 2022 00:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:from:to:cc:subject:date :message-id:reply-to; bh=PaOcGmRc+dnzlv+eS/NMMw8h9icHOM3d0V0k+woxr4M=; b=jVunMsngccX0z9vggSmQErpmBIoOQQC7xx+SjkdJ6KXjrHpT4ulLwTiHutX8Trkmzk gZ6xrn5qhizlMd6B3G8npO3P6UrthW7dDePgoSp4Ycjjj6vGhXG+w7qecG/q/XIYhk3s 37q6Q/h1GEyiUv1BOCersYi6VG89Udw6eQ1oWdxMH/YszEO5AwfsQayYakdluK++0pIq zM6l88zbaIksT9Hhfex3SEPK9szBw3wNncrpcjzyWOxzvOvKASj5IAYUYin/wdaDcSZt qD/Eynw8UCpo8gP+Wh5lIwleJSqLVvmyffy83R+jZ1vzQROa9GKSmAJjlIxyOz/FfKsK h16Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=PaOcGmRc+dnzlv+eS/NMMw8h9icHOM3d0V0k+woxr4M=; b=K+XmJZPC2eRn/I3NEe6CrftFdMG9H0HpRnz4Vk3CM3lGjDqi0vODuUQy7j32Zc42bn 8yPM9YpfstZBswoWmziN79h5YaG6T0kk609rJ7ApTHYLmmUHSOtWG3NRwmiZ15LCJvQp e11I4lmBEx8Vf3LlmzCnUAeBOqm8KSJRE6vPFb9k98yyH2YRkBXcP9r3qJuMBcv9uyUo 1oStLvLfeeHafmVY3lMRZnzzYHARg3KyeFFPja5CMhgf0afOtFwYjnh1ROYthD9y8JwZ WZbDNDDby/h/WmK0e5EjWQaYef9YrTLebR10trxSw/uzQDGjm+stntPL2gxAlbygV79X lDkQ== X-Gm-Message-State: ANoB5pkZxi9uU3N9eXCG+jPzl4B2SK2S6jsOiTaaOdi59/IgoUi9QXaw 13eJB4Z4LcvHm8eSQ8hdv0TYveYpCfRw+u4VIGg= X-Google-Smtp-Source: AA0mqf5HPpl3ogi0W83Cv6aQg0T63CcKNsEGT6CAc3t3dsZ10d16/cRpBrfM7uKwn15/RQBShfC8VSi3dehns7EX+NE= X-Received: by 2002:a05:6830:11cd:b0:66e:7741:ed1d with SMTP id v13-20020a05683011cd00b0066e7741ed1dmr11321776otq.224.1670835030817; Mon, 12 Dec 2022 00:50:30 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 12 Dec 2022 00:50:30 -0800 From: Stefan Kangas In-Reply-To: (D. Chiesa's message of "Fri, 9 Apr 2010 01:44:59 -0400") References: X-Hashcash: 1:20:221212:joaotavora@gmail.com::UvIGrylSrdU3/6oM:2Mr1 MIME-Version: 1.0 Date: Mon, 12 Dec 2022 00:50:30 -0800 Message-ID: Subject: Re: bug#8723: 23.2; Flymake should go to error column To: D Chiesa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 5911-done Cc: 8723-done@debbugs.gnu.org, 5911-done@debbugs.gnu.org, =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) "D Chiesa" writes: > Flymake relies on compilation error patterns, similar to > compilation-error-regexp-alist , to detect errors and warnings. But > flymake discards column information for any errors, and as a result, > the functions flymake-goto-next-error and flymake-goto-prev-error do > not position the cursor on the error column. I don't think this is the case these days, after the redesign of flymake that Jo=C3=A3o did in 2017 or so. I'm therefore closing this bug report. If this conclusion is incorrect and this is still an issue, please reply to this email (use "Reply to all" in your email client) and we can reopen the bug report. From unknown Sat Aug 16 19:19:42 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 09 Jan 2023 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator