unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Matthew Bregg <bregg@google.com>
To: 33516@debbugs.gnu.org
Subject: bug#33516: Should the docstring for flymake-diag-region mention behavior with narrowing?
Date: Mon, 26 Nov 2018 11:46:18 -0600	[thread overview]
Message-ID: <CALUFx9D5Fc8U00-QZYDOcm4KoXKVORWhGTw=uZ1guSZU2XMfhQ@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 183 bytes --]

Currently it can be confusing when developing a flymake checker that
flymake-diag-region does not handle narrowing.

Updating the comment to mention this seems useful to me.

Thanks!

[-- Attachment #1.2: Type: text/html, Size: 252 bytes --]

[-- Attachment #2: 0001-Update-documentation-for-flymake.patch --]
[-- Type: text/x-patch, Size: 1119 bytes --]

From 0b4712c8553b918227bd58a2071a0dbdecaa04c0 Mon Sep 17 00:00:00 2001
From: Matthew Bregg <bregg@google.com>
Date: Fri, 16 Nov 2018 15:01:14 -0500
Subject: [PATCH] Update documentation for flymake.

Flymake flymake-diag-region does not mention behavior with narrowing, which can be confusing.
---
 lisp/progmodes/flymake.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index f0f93f1087..58bbbd500e 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -384,7 +384,9 @@ verify FILTER, a function, and sort them by COMPARE (using KEY)."
 (defun flymake-diag-region (buffer line &optional col)
   "Compute BUFFER's region (BEG . END) corresponding to LINE and COL.
 If COL is nil, return a region just for LINE.  Return nil if the
-region is invalid."
+region is invalid.
+If the BUFFER has been narrowed,
+the region returned will correspond to the BUFFER's narrowed state."
   (condition-case-unless-debug _err
       (with-current-buffer buffer
         (let ((line (min (max line 1)
-- 
2.19.1.1215.g8438c0b245-goog


             reply	other threads:[~2018-11-26 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26 17:46 Matthew Bregg [this message]
2019-07-09 23:48 ` bug#33516: Should the docstring for flymake-diag-region mention behavior with narrowing? Lars Ingebrigtsen

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='CALUFx9D5Fc8U00-QZYDOcm4KoXKVORWhGTw=uZ1guSZU2XMfhQ@mail.gmail.com' \
    --to=bregg@google.com \
    --cc=33516@debbugs.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).