RE: How to highlight columns?

"Dan Bar Dov" <[email protected]> Mon, 5 Sep 2005 19:06:30 +0300
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>
Thanks but your suggestions do not work.
The problem is that regex counts TAB character as 1. The requirement is to limit lines to 80 characters long, where each TAB count as tab-width.
This beats all regex methods including font-lock-mode.

The best I have so far (when I'll make it work) is
;(defun highlight-tail1 ()
;  (interactive)
;  (let ((face (find-face 'highlight)))
;    (while (not (equal (point) (point-max)))
;      (let* ((start (progn (beginning-of-line 1)
;			   (while (and (count < 80) (not (equal (point) (end-of-line))))
;			     (setq count (+ count (if (looking-at '\t') tab-width 1)))
;			     (forward-char))
;			   (point)))
;	     (end (end-of-line))
;	     (extent (make-extent start end)))
;	(set-extent-property extent 'face face)
;	(goto-char end)))))

Dan

> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]] On Behalf Of 
> [email protected]
> Sent: Monday, August 22, 2005 6:27 PM
> To: [email protected]
> Subject: Re: How to highlight columns?
> 
> Sorry, forgot:
> 
> list-matching-lines for regex .\{80\}.+
> will show lines longer than 80 chars (i.e., without using foint-lock).
> 
> ----- Forwarded by Matthew Miner/IQFS on 08/22/2005 11:25 AM -----
>                                                               
>                                                          
>                       Matthew Miner                           
>                                                          
>                                                To:      
> <[email protected]>                                       
>                       08/22/2005 11:25         cc:            
>                                                          
>                       AM                       Subject: Re: 
> How to highlight columns?(Document link: Matthew Miner)    
>                                                               
>                                                          
>                                                               
>                                                          
> 
> 
> 
> Sorry, no time to test in font lock, but, start with the regex:
> 
> .\{80\}.+
> 
> Shows lines longer than 80 chars.
> 
> Add a grouping to isolate the after 80 stuff:
> .\{80\}\(.+\)
> 
> Then add to your font-lock list...
> ...
> '(".\\{80\\}\\(.\\)"                  1 font-lock-string-face)
> ...
> 
> I'm guessing that's a start...
> Hope it helps.
> 
> 
> 
>                                                               
>                                                            
>                       "Dan Bar Dov"                           
>                                                            
>                       <[email protected]>        To:       
> <[email protected]>                                      
>                       Sent by:                   cc:          
>                                                            
>                       xemacs-news-bounces        Subject:  
> How to highlight columns?                                     
>                       @xemacs.org                             
>                                                            
>                                                               
>                                                            
>                                                               
>                                                            
>                       08/21/2005 04:38 AM                     
>                                                            
>                                                               
>                                                            
>                                                               
>                                                            
> 
> 
> 
> 
> 
> I'd like to highlight all text/code that's beyond column 80.
> I cannot figure how to set font-lock to do that, not how to write an
> interactive functions to do that.
> 
> Any ideas?
> 
> Dan
> 
> 
> 
> 
> 
> 
> 
> This email and any attachments have been scanned for known 
> viruses using
> multiple scanners. We believe that this email and any 
> attachments are virus
> free, however the recipient must take full responsibility for virus
> checking. This email message is intended for the named 
> recipient only. It
> may be privileged and/or confidential. If you are not the 
> intended named
> recipient of this email then you should not copy it or use it for any
> purpose, nor disclose its contents to any other person. You 
> should contact
> the Misys Banking and Securities Division as shown below so 
> that we can
> take appropriate action at no cost to yourself.  Misys Banking and
> Securities Division, 1 St George's Road, Wimbledon, London, SW19 4DR,
> England. Email: [email protected]. Tel: +44 (0) 20 
> 8879 1188
> Fax: +44 (0) 20 8947 3373
> 
> 
> 
>