From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Changing Color Of Column # In Modeline Date: Fri, 25 Nov 2005 10:54:33 -0800 Message-ID: References: <1132941310.085536.249420@g47g2000cwa.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1132968337 12653 80.91.229.2 (26 Nov 2005 01:25:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 26 Nov 2005 01:25:37 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 26 02:25:34 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Efong-00080r-D9 for geh-help-gnu-emacs@m.gmane.org; Sat, 26 Nov 2005 02:24:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Efonf-0006nE-Gt for geh-help-gnu-emacs@m.gmane.org; Fri, 25 Nov 2005 20:24:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EfonQ-0006ms-Lw for help-gnu-emacs@gnu.org; Fri, 25 Nov 2005 20:24:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EfonQ-0006md-0N for help-gnu-emacs@gnu.org; Fri, 25 Nov 2005 20:24:08 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EfonP-0006ma-Sb for help-gnu-emacs@gnu.org; Fri, 25 Nov 2005 20:24:07 -0500 Original-Received: from [141.146.126.228] (helo=agminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EfonP-0001yX-Me for help-gnu-emacs@gnu.org; Fri, 25 Nov 2005 20:24:08 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by agminet01.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jAPJ9BG3011206 for ; Fri, 25 Nov 2005 13:09:11 -0600 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jAPIshFm013800 for ; Fri, 25 Nov 2005 11:54:43 -0700 Original-Received: from dradamslap (dhcp-amer-rmdc-csvpn-gw6-141-144-113-35.vpn.oracle.com [141.144.113.35]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jAPIsgci013795 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 25 Nov 2005 11:54:43 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal In-Reply-To: <1132941310.085536.249420@g47g2000cwa.googlegroups.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31359 Archived-At: > > http://www.emacswiki.org/cgi-bin/wiki/ColumnMarker > > This one looks too restrictive. Some time ago I wrote this: > Ilya I always knew it should be done that way but I never use tabs or multi-column characters so it's been low on my to-do list. Perhaps now I can knock that item off my list. Well, "should be done that way" is not so clear, to me. I see different advantages with RGB's code and Ilya's code: - RGB's code lets you easily highlight multiple columns (with different faces), move those columns, and turn their highlighting on/off - Ilya's code treats multiple-column characters such as TAB correctly Of course, Ilya's code might be made more flexible, by wrapping it in commands that provide the advantages of RGB's code. For reference (for those who lost the thread), here is Ilya's code, with a variable substituted for `79', tabs untabified, and `secondary-selection' quoted (so it will also work in Emacs 20): (defvar limit-column 30) (defun match-at-column (end) (let (done c res) (while (and (not done) (< (point) end)) (cond ((< limit-column (current-column)) (forward-line 1)) ((< limit-column (move-to-column (1+ limit-column))) (setq done t res t) (forward-char -1) (re-search-forward ".")) ((eobp) (setq done t)) (t (forward-line 1)))) res)) (add-hook 'font-lock-mode-hook (lambda () (font-lock-add-keywords nil '((match-at-column 0 'secondary-selection t)) 'append)))