all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake
@ 2012-04-16 12:49 Leo
  2012-07-14 12:06 ` Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2012-04-16 12:49 UTC (permalink / raw)
  To: 11253

[-- Attachment #1: Type: text/plain, Size: 25 bytes --]

Please comment. Thanks.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Support-fringe-indicators-in-flymake.patch --]
[-- Type: text/x-diff, Size: 3125 bytes --]

From 359a9c49a4e3031de64c51f2b0b6eff23a193c41 Mon Sep 17 00:00:00 2001
From: Leo Liu <sdl.web@gmail.com>
Date: Thu, 1 Mar 2012 12:13:55 +0800
Subject: [PATCH] Support fringe indicators in flymake

---
 lisp/progmodes/flymake.el |   39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 07393c69..432b318d 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -763,15 +763,39 @@ (defun flymake-overlay-p (ov)
   "Determine whether overlay OV was created by flymake."
   (and (overlayp ov) (overlay-get ov 'flymake-overlay)))
 
-(defun flymake-make-overlay (beg end tooltip-text face mouse-face)
+(defcustom flymake-error-bitmap 'question-mark
+  "Bitmap used in the fringe for indicating errors."
+  :group 'flymake
+  :type 'symbol)
+
+(defcustom flymake-warning-bitmap 'question-mark
+  "Bitmap used in the fringe for indicating warnings."
+  :group 'flymake
+  :type 'symbol)
+
+(defcustom flymake-fringe-indicator-position 'left-fringe
+  "The position to put flymake fringe indicator.
+The value can be nil, left-fringe or right-fringe.
+Fringe indicators are disabled if nil."
+  :group 'flymake
+  :type '(choice (const left-fringe)
+		 (const right-fringe)
+		 (const :tag "No fringe indicators" nil)))
+
+(defun flymake-make-overlay (beg end tooltip-text face bitmap mouse-face)
   "Allocate a flymake overlay in range BEG and END."
   (when (not (flymake-region-has-flymake-overlays beg end))
-    (let ((ov (make-overlay beg end nil t t)))
+    (let ((ov (make-overlay beg end nil t t))
+	  (fringe (and flymake-fringe-indicator-position
+		       (propertize "!" 'display
+				   (list flymake-fringe-indicator-position
+					 bitmap)))))
       (overlay-put ov 'face           face)
       (overlay-put ov 'mouse-face     mouse-face)
       (overlay-put ov 'help-echo      tooltip-text)
       (overlay-put ov 'flymake-overlay  t)
       (overlay-put ov 'priority 100)
+      (overlay-put ov 'before-string fringe)
       ;;+(flymake-log 3 "created overlay %s" ov)
       ov)
     (flymake-log 3 "created an overlay at (%d-%d)" beg end)))
@@ -819,7 +843,8 @@ (defun flymake-highlight-line (line-no line-err-info-list)
 	 (beg      line-beg)
 	 (end      line-end)
 	 (tooltip-text (flymake-ler-text (nth 0 line-err-info-list)))
-	 (face     nil))
+	 (face     nil)
+	 (bitmap   nil))
 
     (goto-char line-beg)
     (while (looking-at "[ \t]")
@@ -843,10 +868,12 @@ (defun flymake-highlight-line (line-no line-err-info-list)
       (setq end (point)))
 
     (if (> (flymake-get-line-err-count line-err-info-list "e") 0)
-	(setq face 'flymake-errline)
-      (setq face 'flymake-warnline))
+	(setq face 'flymake-errline
+	      bitmap flymake-error-bitmap)
+      (setq face 'flymake-warnline
+	    bitmap flymake-warning-bitmap))
 
-    (flymake-make-overlay beg end tooltip-text face nil)))
+    (flymake-make-overlay beg end tooltip-text face bitmap nil)))
 
 (defun flymake-parse-err-lines (err-info-list lines)
   "Parse err LINES, store info in ERR-INFO-LIST."
-- 
1.7.10


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake
  2012-04-16 12:49 bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake Leo
@ 2012-07-14 12:06 ` Leo
  2012-07-14 14:14   ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2012-07-14 12:06 UTC (permalink / raw)
  To: 11253-done

[-- Attachment #1: Type: text/plain, Size: 46 bytes --]

Applied in trunk.

A screen shot is attached.

[-- Attachment #2: flymake-fringe-bitmap.png --]
[-- Type: image/png, Size: 17158 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake
  2012-07-14 12:06 ` Leo
@ 2012-07-14 14:14   ` Eli Zaretskii
  2012-07-14 14:34     ` Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2012-07-14 14:14 UTC (permalink / raw)
  To: Leo; +Cc: 11253

> From: Leo <sdl.web@gmail.com>
> Date: Sat, 14 Jul 2012 20:06:51 +0800
> 
> Applied in trunk.

Thanks.  Could you please document the new bitmap should in NEWS and
in the ELisp manual?





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake
  2012-07-14 14:14   ` Eli Zaretskii
@ 2012-07-14 14:34     ` Leo
  2012-07-14 15:02       ` Eli Zaretskii
  0 siblings, 1 reply; 6+ messages in thread
From: Leo @ 2012-07-14 14:34 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 11253

On 2012-07-14 22:14 +0800, Eli Zaretskii wrote:
> Thanks.  Could you please document the new bitmap should in NEWS and
> in the ELisp manual?

Would something like the following (excluding ChangeLogs) suffice?

=== modified file 'doc/lispref/display.texi'
--- doc/lispref/display.texi	2012-06-17 05:13:40 +0000
+++ doc/lispref/display.texi	2012-07-14 14:31:46 +0000
@@ -3550,7 +3550,7 @@
 @itemx @code{vertical-bar}, @code{horizontal-bar}
 Used for different types of fringe cursors.
 
-@item @code{empty-line}, @code{question-mark}
+@item @code{empty-line}, @code{question-mark}, @code{exclamation-mark}
 Unused.
 @end table
 

=== modified file 'etc/NEWS'
--- etc/NEWS	2012-07-14 02:19:07 +0000
+++ etc/NEWS	2012-07-14 14:33:03 +0000
@@ -113,6 +113,8 @@
 ** Face underlining can now use a wave.
 See the "Face Attributes" section of the Elisp manual.
 
+** New fringe bitmap exclamation-mark
+
 ** String values for `initial-buffer-choice' also apply to emacsclient
 frames, if emacsclient is only told to open a new frame without
 specifying any file to visit or expression to evaluate.

=== modified file 'src/fringe.c'
--- src/fringe.c	2012-07-14 11:44:39 +0000
+++ src/fringe.c	2012-07-14 14:28:30 +0000
@@ -107,7 +107,7 @@
 static unsigned short question_mark_bits[] = {
   0x3c, 0x7e, 0x7e, 0x0c, 0x18, 0x18, 0x00, 0x18, 0x18};
 
-/* A exclamation mark.  */
+/* An exclamation mark.  */
 /*
   ...XX...
   ...XX...






^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake
  2012-07-14 14:34     ` Leo
@ 2012-07-14 15:02       ` Eli Zaretskii
  2012-07-15  0:57         ` Leo
  0 siblings, 1 reply; 6+ messages in thread
From: Eli Zaretskii @ 2012-07-14 15:02 UTC (permalink / raw)
  To: Leo; +Cc: 11253

> From:  Leo <sdl.web@gmail.com>
> Cc: 11253@debbugs.gnu.org
> Date: Sat, 14 Jul 2012 22:34:46 +0800
> 
> On 2012-07-14 22:14 +0800, Eli Zaretskii wrote:
> > Thanks.  Could you please document the new bitmap should in NEWS and
> > in the ELisp manual?
> 
> Would something like the following (excluding ChangeLogs) suffice?

Yes, but...

> +** New fringe bitmap exclamation-mark

This needs a period at the end of the sentence.

Also, don't we want to advertise the new feature in flymake.el?

Thanks.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake
  2012-07-14 15:02       ` Eli Zaretskii
@ 2012-07-15  0:57         ` Leo
  0 siblings, 0 replies; 6+ messages in thread
From: Leo @ 2012-07-15  0:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 11253

On 2012-07-14 23:02 +0800, Eli Zaretskii wrote:
> This needs a period at the end of the sentence.
>
> Also, don't we want to advertise the new feature in flymake.el?

Thank you for the feedback. I have made the changes in trunk.

Leo





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-07-15  0:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-16 12:49 bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake Leo
2012-07-14 12:06 ` Leo
2012-07-14 14:14   ` Eli Zaretskii
2012-07-14 14:34     ` Leo
2012-07-14 15:02       ` Eli Zaretskii
2012-07-15  0:57         ` Leo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.