From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: Mark current column Date: 18 Oct 2005 11:59:53 -0700 Organization: http://groups.google.com Message-ID: <1129661993.706624.223700@f14g2000cwb.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1129662170 18566 80.91.229.2 (18 Oct 2005 19:02:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Oct 2005 19:02:50 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 18 21:02:50 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ERwhx-0000PC-NR for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Oct 2005 21:01:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ERwhw-0006Tv-Tq for geh-help-gnu-emacs@m.gmane.org; Tue, 18 Oct 2005 15:01:09 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 52 Original-NNTP-Posting-Host: 198.74.20.74 Original-X-Trace: posting.google.com 1129661999 31080 127.0.0.1 (18 Oct 2005 18:59:59 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 18 Oct 2005 18:59:59 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=198.74.20.74; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:134762 Original-To: help-gnu-emacs@gnu.org 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:30344 Archived-At: > Is it possible somehow easily (=using at most a few elisp lines in .emacs?) > to highlight the current column (in all the (visible) lines of the current > buffer) by a (custom)key sequence? This is a piece of a bigger package I've been putting together. Maybe I'll get this part polished up and posted to the wiki sometime later this week. Meanwhile you can either dump all the code into your .emacs or put it in a file named column-marker.el somewhere on your search path and then add something like this to your .emacs. (require 'column-marker) (global-set-key [?\C-c ?m] 'column-marker-here) You may want to change the color. I use something close to the gnome2 color theme. ;; Author: Rick Bielawski (c) 2005 ;; This file is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published ;; by the Free Software Foundation; either version 2. ;; This file is distributed in the hope that it will be useful, but ;; WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;; General Public License for more details. (defvar column-marker-face 'column-marker-face) (defface column-marker-face '((t (:background "sea green"))) "Face used to create a column marker" :group 'faces) (defvar column-marker nil "Holds font-lock-keyword spec for column marker") (make-variable-buffer-local 'column-marker) (defun column-marker-here () (interactive) (if column-marker (progn (font-lock-remove-keywords nil column-marker) (setq column-marker nil)) (setq column-marker (list (list (concat "^.\\{" (number-to-string (current-column)) "\\}\\(.\\)") '(1 column-marker-face prepend t)))) (font-lock-add-keywords nil column-marker t)) (font-lock-fontify-buffer)) (provide 'column-marker)