From unknown Tue Jun 17 01:48:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12742 <12742@debbugs.gnu.org> To: bug#12742 <12742@debbugs.gnu.org> Subject: Status: 24.2; [PATCH] flymake cannot goto errors correctly in narrowed buffers Reply-To: bug#12742 <12742@debbugs.gnu.org> Date: Tue, 17 Jun 2025 08:48:39 +0000 retitle 12742 24.2; [PATCH] flymake cannot goto errors correctly in narrowe= d buffers reassign 12742 emacs submitter 12742 Leo severity 12742 wishlist tag 12742 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 27 05:28:09 2012 Received: (at submit) by debbugs.gnu.org; 27 Oct 2012 09:28:09 +0000 Received: from localhost ([127.0.0.1]:35468 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS2ga-00079S-P1 for submit@debbugs.gnu.org; Sat, 27 Oct 2012 05:28:09 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54206) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS2gY-00079K-CW for submit@debbugs.gnu.org; Sat, 27 Oct 2012 05:28:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TS2eN-0004xG-Eh for submit@debbugs.gnu.org; Sat, 27 Oct 2012 05:25:52 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:34328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS2eN-0004xA-10 for submit@debbugs.gnu.org; Sat, 27 Oct 2012 05:25:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS2eM-0001qi-3Z for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:25:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TS2eK-0004wj-T3 for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:25:50 -0400 Received: from mail-da0-f41.google.com ([209.85.210.41]:37413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS2eK-0004we-MT for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 05:25:48 -0400 Received: by mail-da0-f41.google.com with SMTP id i14so1721407dad.0 for ; Sat, 27 Oct 2012 02:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=rwlOZe3hcuFBN0BZzbatagxeeD9mZv85H0KuGIjI0lE=; b=i3AFGBelRSw+4vmupdEJiI5XaBxUtMHOexYrmuaAGhTHgK5O+exRPoozDM07kRqs52 7BGUn+4QMJpPesQpMkLlblGaLb1YsmNpRbs8N0c8lypbtj1wJGV9p0lv+5xLXundG2b+ dexZXZh89UBLbBm4YrXb9J8CpzDUKNsCyndPKEyDhafUK2lD51/uiK/+FrcrA5pWEdPp o36gejvtIWjBPoRDqfHtb5o0e0pn53+/sKGkp3ex1VDbOBmFPm6F9R0Gb1HZ+QJJn3K0 tsB165OH9AnDLRaZWUQ8n9ev5wb2WsbzazLGPZyzT7sRZZgUeTWl1gnTRCCJHPeFagSI /BOg== Received: by 10.68.235.2 with SMTP id ui2mr8292867pbc.163.1351329947572; Sat, 27 Oct 2012 02:25:47 -0700 (PDT) Received: from localhost ([119.255.41.67]) by mx.google.com with ESMTPS id qi2sm1289654pbc.22.2012.10.27.02.25.45 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Oct 2012 02:25:46 -0700 (PDT) From: Leo To: bug-gnu-emacs@gnu.org Subject: 24.2; [PATCH] flymake cannot goto errors correctly in narrowed buffers Date: Sat, 27 Oct 2012 17:25:35 +0800 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: -3.4 (---) --=-=-= Content-Type: text/plain In a narrowed buffer, both flymake-goto-next-error and flymake-goto-prev-error stop working correctly. Any objection to install the attached fix in the emacs-24 branch? (ChangeLog change omitted for now). Leo --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-flymake-error-navigation-in-narrowed-buffers.patch >From 09158f75e02a5e1814f2f00d0083dfc80e8f0bc1 Mon Sep 17 00:00:00 2001 From: Leo Liu Date: Sat, 27 Oct 2012 17:14:42 +0800 Subject: [PATCH] Fix flymake error navigation in narrowed buffers --- lisp/progmodes/flymake.el | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el index 2614af9f..8ef09466 100644 --- a/lisp/progmodes/flymake.el +++ b/lisp/progmodes/flymake.el @@ -1262,7 +1262,9 @@ (defun flymake-on-timer-event (buffer) (defun flymake-current-line-no () "Return number of current line in current buffer." - (count-lines (point-min) (if (eobp) (point) (1+ (point))))) + (save-restriction + (widen) + (count-lines (point-min) (if (eobp) (point) (1+ (point)))))) (defun flymake-count-lines () "Return number of lines in buffer BUFFER." @@ -1491,16 +1493,13 @@ (defun flymake-get-prev-err-line-no (err-info-list line-no) (if (> count 0) (flymake-er-get-line (nth (1- count) err-info-list)))))) -(defun flymake-skip-whitespace () - "Move forward until non-whitespace is reached." - (while (looking-at "[ \t]") - (forward-char))) - (defun flymake-goto-line (line-no) "Go to line LINE-NO, then skip whitespace." - (goto-char (point-min)) - (forward-line (1- line-no)) - (flymake-skip-whitespace)) + (save-restriction + (widen) + (goto-char (point-min)) + (forward-line (1- line-no)) + (skip-chars-forward "[[:blank:]]"))) (defun flymake-goto-next-error () "Go to next error in err ring." -- 1.8.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 27 06:11:51 2012 Received: (at 12742) by debbugs.gnu.org; 27 Oct 2012 10:11:52 +0000 Received: from localhost ([127.0.0.1]:35477 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS3Mt-00087M-Jv for submit@debbugs.gnu.org; Sat, 27 Oct 2012 06:11:51 -0400 Received: from mail-pb0-f44.google.com ([209.85.160.44]:56938) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS3Mr-00087C-4G for 12742@debbugs.gnu.org; Sat, 27 Oct 2012 06:11:50 -0400 Received: by mail-pb0-f44.google.com with SMTP id ro8so3158200pbb.3 for <12742@debbugs.gnu.org>; Sat, 27 Oct 2012 03:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; bh=DIhRLFaFCWgO+tpDv4hT1ENs+VHrwLn5PUSkcjVlndQ=; b=NeGVNW1pnGHd9tyGePAIvL3D2aRRPpjTk4DPX8h2ETKhi/PBne2AO6scKE04278AoV D9OrUWoA6/uox+zX+w6Yo9sPii7+79AWmxf8whKqNXvZ2MkPa75cjRr0qoDl+EungxMG GqWwwmVXa8aZT2skg7YzWe3LhOkv+oUsRVY/dXxlIzAZm3kBnKbICbjxjLvwKmVC9eF8 AbCNwecY3l3Ppgkd3pxFoOj9EhS4AlbORQGRITIxpjOp2H+oq8NdRIwuF1ZPGhl4dfhO hlmGTmJ0/DTFpXIeKsVnyUiDpAOH1UcpNWfWNFht6+6xQ58LwVi7afzCV49UvxuGps8k gIng== Received: by 10.66.85.40 with SMTP id e8mr68458908paz.64.1351332573447; Sat, 27 Oct 2012 03:09:33 -0700 (PDT) Received: from localhost ([119.255.41.67]) by mx.google.com with ESMTPS id x6sm2483984pav.29.2012.10.27.03.09.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 27 Oct 2012 03:09:32 -0700 (PDT) From: Leo To: 12742@debbugs.gnu.org Subject: Re: bug#12742: 24.2; [PATCH] flymake cannot goto errors correctly in narrowed buffers References: Date: Sat, 27 Oct 2012 18:09:23 +0800 In-Reply-To: (Leo's message of "Sat, 27 Oct 2012 17:25:35 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (OS X 10.8.2) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.1 (/) X-Debbugs-Envelope-To: 12742 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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: 0.1 (/) Flymake.el wasn't written with narrowed buffers in mind so the patch only fix the problem partially. I'll work out a thorough patch later. Leo From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 13 18:54:22 2014 Received: (at 12742-done) by debbugs.gnu.org; 13 Feb 2014 23:54:22 +0000 Received: from localhost ([127.0.0.1]:51312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE66n-0001Kh-70 for submit@debbugs.gnu.org; Thu, 13 Feb 2014 18:54:21 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:50090 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WE66k-0001KU-I8 for 12742-done@debbugs.gnu.org; Thu, 13 Feb 2014 18:54:19 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1WE66j-0000g1-LJ; Thu, 13 Feb 2014 18:54:17 -0500 From: Glenn Morris To: 12742-done@debbugs.gnu.org Subject: Re: bug#12742 References: X-Spook: Telex lynch interception Attorney General Marxist Soviet X-Ran: u4-BsLD(6R#K2Lh|d^V[W72v=ged8(Q_6'@7jrkE4H?q>X}&W!nodUMZ(\0|H>mZO>rwp* X-Hue: cyan X-Attribution: GM Date: Thu, 13 Feb 2014 18:54:17 -0500 In-Reply-To: (Daniel Colascione's message of "Thu, 13 Feb 2014 22:38:05 +0000") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.7 (-----) X-Debbugs-Envelope-To: 12742-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -5.7 (-----) Version: 24.4 Daniel Colascione wrote: > ------------------------------------------------------------ > revno: 116436 > revision-id: dancol@dancol.org-20140213223729-66wcs7wdtxjgbuu3 > parent: eliz@gnu.org-20140213205407-wn5kv46oq3hw5sv8 > committer: Daniel Colascione > branch nick: trunk > timestamp: Thu 2014-02-13 14:37:29 -0800 > message: > Fix flymake in narrowed buffers > modified: > lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432 > lisp/progmodes/flymake.el flymake.el-20091113204419-o5vbwnq5f7feedwu-3065 > > === modified file 'lisp/ChangeLog' > --- a/lisp/ChangeLog 2014-02-13 18:23:36 +0000 > +++ b/lisp/ChangeLog 2014-02-13 22:37:29 +0000 > @@ -1,3 +1,9 @@ > +2014-02-13 Daniel Colascione > + > + * progmodes/flymake.el (flymake-post-syntax-check): Widen buffer > + when adding overlays so that line numbers from compiler match line > + numbers we use. > + > 2014-02-13 Glenn Morris > > * mail/rmail.el (rmail-probe): Be less strict. (Bug#16743) > > === modified file 'lisp/progmodes/flymake.el' > --- a/lisp/progmodes/flymake.el 2014-01-25 19:15:42 +0000 > +++ b/lisp/progmodes/flymake.el 2014-02-13 22:37:29 +0000 > @@ -555,29 +555,31 @@ > (setq flymake-is-running nil)))))))) > > (defun flymake-post-syntax-check (exit-status command) > - (setq flymake-err-info flymake-new-err-info) > - (setq flymake-new-err-info nil) > - (setq flymake-err-info > - (flymake-fix-line-numbers > - flymake-err-info 1 (count-lines (point-min) (point-max)))) > - (flymake-delete-own-overlays) > - (flymake-highlight-err-lines flymake-err-info) > - (let (err-count warn-count) > - (setq err-count (flymake-get-err-count flymake-err-info "e")) > - (setq warn-count (flymake-get-err-count flymake-err-info "w")) > - (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)" > - (buffer-name) err-count warn-count > - (- (float-time) flymake-check-start-time)) > - (setq flymake-check-start-time nil) > + (save-restriction > + (widen) > + (setq flymake-err-info flymake-new-err-info) > + (setq flymake-new-err-info nil) > + (setq flymake-err-info > + (flymake-fix-line-numbers > + flymake-err-info 1 (count-lines (point-min) (point-max)))) > + (flymake-delete-own-overlays) > + (flymake-highlight-err-lines flymake-err-info) > + (let (err-count warn-count) > + (setq err-count (flymake-get-err-count flymake-err-info "e")) > + (setq warn-count (flymake-get-err-count flymake-err-info "w")) > + (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)" > + (buffer-name) err-count warn-count > + (- (float-time) flymake-check-start-time)) > + (setq flymake-check-start-time nil) > > - (if (and (equal 0 err-count) (equal 0 warn-count)) > - (if (equal 0 exit-status) > - (flymake-report-status "" "") ; PASSED > - (if (not flymake-check-was-interrupted) > - (flymake-report-fatal-status "CFGERR" > - (format "Configuration error has occurred while running %s" command)) > - (flymake-report-status nil ""))) ; "STOPPED" > - (flymake-report-status (format "%d/%d" err-count warn-count) "")))) > + (if (and (equal 0 err-count) (equal 0 warn-count)) > + (if (equal 0 exit-status) > + (flymake-report-status "" "") ; PASSED > + (if (not flymake-check-was-interrupted) > + (flymake-report-fatal-status "CFGERR" > + (format "Configuration error has occurred while running %s" command)) > + (flymake-report-status nil ""))) ; "STOPPED" > + (flymake-report-status (format "%d/%d" err-count warn-count) ""))))) > > (defun flymake-parse-output-and-residual (output) > "Split OUTPUT into lines, merge in residual if necessary." From unknown Tue Jun 17 01:48:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 14 Mar 2014 11: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