From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#11253: 24.0.95; [PATCH] Support fringe indicators in flymake Date: Mon, 16 Apr 2012 20:49:42 +0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1334580687 20970 80.91.229.3 (16 Apr 2012 12:51:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 16 Apr 2012 12:51:27 +0000 (UTC) To: 11253@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 16 14:51:26 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SJlOu-0006Xc-31 for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Apr 2012 14:51:24 +0200 Original-Received: from localhost ([::1]:55351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJlOp-0007OV-W2 for geb-bug-gnu-emacs@m.gmane.org; Mon, 16 Apr 2012 08:51:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJlOi-0007O9-3f for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:51:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJlOX-0003sE-Ks for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:51:11 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJlOX-0003sA-FD for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:51:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SJlOY-00066C-Fd for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Apr 2012 12:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11253 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.133458062423393 (code B ref -1); Mon, 16 Apr 2012 12:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Apr 2012 12:50:24 +0000 Original-Received: from localhost ([127.0.0.1]:36520 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJlNw-00065F-7p for submit@debbugs.gnu.org; Mon, 16 Apr 2012 08:50:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47525) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SJlNs-00064y-78 for submit@debbugs.gnu.org; Mon, 16 Apr 2012 08:50:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJlNf-0003Ke-0W for submit@debbugs.gnu.org; Mon, 16 Apr 2012 08:50:12 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:45802) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJlNe-0003K6-R8 for submit@debbugs.gnu.org; Mon, 16 Apr 2012 08:50:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJlNY-0006e6-G8 for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:50:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SJlNW-00036C-G7 for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:49:59 -0400 Original-Received: from mail-pz0-f52.google.com ([209.85.210.52]:59514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SJlNW-000364-6a for bug-gnu-emacs@gnu.org; Mon, 16 Apr 2012 08:49:58 -0400 Original-Received: by dake40 with SMTP id e40so6293512dak.39 for ; Mon, 16 Apr 2012 05:49:55 -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=nsjR8QPlSXgVKpnX5/yrY0Fyrcla1TY41Jh/PAKFA64=; b=NgJVx6PBbsUQqIpCZerX0/u6smGEEzYky808LTThF8qvdVNSaLW2dyK/xG1viURvu8 CTZG4EJ2qilSIWaFy12pAkMnaQB2kN7Iz9y+DNcxoxV2xQF6iththhtYYWALs5yR78W+ fQ8NSCkH9kCYdKKtRTX2ABYPuUciDO2VFV8Cyn/YOv+J2dMHkfnZKf3lkMdOew+WV3lz KVC36pZQNESq7xdd8WzFu2Z9agsL9tlVKqpqMFdJ/URCiXY7KFcZSD3+qe+F4tcrWjCo bqxNeQlnv/ka6LGFD4tjx6g0bBacxIVD9e3IuDDmqMgmWkzDoBcwg/Xgi2U68JnNaz2Q 59QQ== Original-Received: by 10.68.233.234 with SMTP id tz10mr28051820pbc.68.1334580595342; Mon, 16 Apr 2012 05:49:55 -0700 (PDT) Original-Received: from Victoria.local ([222.130.128.204]) by mx.google.com with ESMTPS id i5sm17646693pbf.19.2012.04.16.05.49.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Apr 2012 05:49:54 -0700 (PDT) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59114 Archived-At: --=-=-= Content-Type: text/plain Please comment. Thanks. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Support-fringe-indicators-in-flymake.patch Content-Description: 0001-Support-fringe-indicators-in-flymake.patch >From 359a9c49a4e3031de64c51f2b0b6eff23a193c41 Mon Sep 17 00:00:00 2001 From: Leo Liu 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 --=-=-=--