help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mark current column


From: Peter Tury
Subject: Re: Mark current column
Date: Wed, 02 Nov 2005 19:57:34 GMT
User-agent: 40tude_Dialog/2.0.15.1

On 2 Nov 2005 09:07:46 -0800, rgb wrote:

>>>> 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.
>>
>> Thanks! I can't see these things on your wiki, but I started to use your
>> column-marker posted here. It makes almost exactly what I wanted. (Though I
>> can't mark several lines at the same time (what would be good)
> 
> The version on the wiki lets you define as many markers as you want.
> For example:
> 
> (require 'column-marker)
> (column-marker-create-dynamic my-other-marker)
> 
> The new marker is named my-other-marker and works the same as
> column-marker-here.

Finally I find it in the wiki ;-) Thanks for it!

However, as I would like to learn elisp, I tried to understand it and
compare to my original needs. It seemed to be a little cryptic for me (as I
am a beginner in elisp), and I think it is not exactly what I imagined. So
I tried to create another solution. Here it is (as in my .emacs):

(defun vvb-toggle-curr-in-columns ()
   "Toggles the current column inside vvb-columns."
   (interactive)
   (if (member (current-column) vvb-columns)
       (setq vvb-columns (remove (current-column) vvb-columns))
     (setq vvb-columns (append vvb-columns (list (current-column))))))
(global-set-key [?\C-c ?l] 'vvb-toggle-curr-in-columns)

And this is what I wanted. However, unfortunately, it needs vvb-mode :-(

> 
>> + I can't
>> see the marker in shorter lines, however it would also be good.)
> 
> I think lots of people would like that, including me.
> If you pad all the shorter lines with blanks it makes the marker
> visible.  Maybe not a great solution but sometimes its viable.

Isn't it possible to highlight the "columns" somehow differently: not using
background colors for existing chars, but ... ?? E.g. put a "layer" (as in
some picture editor programs?) "onto" the original text, and highlight the
positions in this "layer"...?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]