From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#4835: 23.1; Improper `Invalid face reference' messages. Performance degraded. Date: Fri, 30 Oct 2009 15:48:22 -0700 Message-ID: <26C434DFBD78465BB3861200D6CAE453@us.oracle.com> Reply-To: Drew Adams , 4835@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_007F_01CA5978.694AAE50" X-Trace: ger.gmane.org 1256944068 14594 80.91.229.12 (30 Oct 2009 23:07:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 30 Oct 2009 23:07:48 +0000 (UTC) To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 31 00:07:41 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N40ZF-0004jN-Ce for geb-bug-gnu-emacs@m.gmane.org; Sat, 31 Oct 2009 00:07:40 +0100 Original-Received: from localhost ([127.0.0.1]:56909 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N40ZE-0005RB-P8 for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Oct 2009 19:07:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N40Z1-0005EJ-9b for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 19:07:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N40Yw-00057a-Hf for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 19:07:22 -0400 Original-Received: from [199.232.76.173] (port=45937 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N40Yv-00057K-Ti for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 19:07:17 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:49111) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N40Yu-0006kC-VZ for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 19:07:17 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9UN7ElD001402; Fri, 30 Oct 2009 16:07:15 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n9UMt5vC031547; Fri, 30 Oct 2009 15:55:05 -0700 Resent-Date: Fri, 30 Oct 2009 15:55:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Fri, 30 Oct 2009 22:55:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4835 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.125694292130765 (code B ref -1); Fri, 30 Oct 2009 22:55:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 30 Oct 2009 22:48:41 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n9UMmdMO030762 for ; Fri, 30 Oct 2009 15:48:40 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N40Gs-0008GS-Pt for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 18:48:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N40Gn-0008G0-U1 for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 18:48:37 -0400 Original-Received: from [199.232.76.173] (port=51338 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N40Gn-0008Fu-Na for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 18:48:33 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:41356 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N40Gm-0004Fi-Uu for bug-gnu-emacs@gnu.org; Fri, 30 Oct 2009 18:48:33 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9UMm1TS017840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Oct 2009 22:48:02 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n9ULUVuR024914 for ; Fri, 30 Oct 2009 22:49:49 GMT Original-Received: from abhmt018.oracle.com by acsmt356.oracle.com with ESMTP id 20739385961256942903; Fri, 30 Oct 2009 15:48:23 -0700 Original-Received: from dradamslap1 (/24.5.185.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 30 Oct 2009 15:48:22 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcpZsxUoa6ZukRpeQJOKhw+ixm5YYA== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090201.4AEB6D3A.0025:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 30 Oct 2009 19:07:22 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:32295 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_007F_01CA5978.694AAE50 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit This sure seems like a bug to me. If not, please tell me what the problem is. Load the attached file, move point to, say, column 15 in some buffer (e.g. *scratch*), then do `M-x column-marker-1'. Move point a bit, to be sure to see the column highlighting. Check buffer `*Messages*'. You will see zillions of messages `Invalid face reference', logged by the C function `merge_face_ref' (in `xfaces.c'). If you click the mouse in `*Messages*', zillions more such messages will be displayed. This message logging degrades Emacs performance considerably. Also, binding `message-log-max' to nil has no effect - it does not inhibit the message logging. That seems like a bug in itself. But perhaps you will say that this message is coming from the display engine, and that it is appropriate for the display code to ignore `message-log-max' (but why, especially if it impacts performance so much?). At the very least, there is a doc bug, since neither the manual nor the doc string say anything about the display code ignoring this variable. Anyway, displaying the message at all seems like a bug in this case. But if not, I would appreciate understanding what is wrong with the code I'm using. In the attached code, `M-x column-marker-1' calls: (column-marker-internal 'column-marker-1 (1+ (current-column)) 'column-marker-1) That sets the value of symbol `column-marker-1' to the following list - call it KEYWORDS, where COL is the column that point was in when you did `M-x column-marker-1' (e.g. 15). KEYWORDS: (((lambda (end) (let ((start (point)) (message-log-max nil)) ; (Has no effect.) (when (> end (point-max)) (setq end (point-max))) (unless (< (current-column) COL) (forward-line 1)) (when (< (current-column) COL) (move-to-column COL)) (while (and (< (current-column) COL) (< (point) end) (= 0 (+ (forward-line 1) (current-column)))) (move-to-column COL)) (if (and (= COL (current-column)) (<= (point) end) (> (point) start)) (progn (set-match-data (list (1- (point)) (point))) t) (goto-char start) nil))) (0 column-marker-1 prepend t))) And then `column-marker-internal' calls this, where KEYWORDS is the list shown above: (font-lock-add-keywords nil KEYWORDS t) (font-lock-fontify-buffer) The effect is to highlight the column where you issued the command. It works well, apart from the message logging and its performance impact. The `font-lock-keywords' entry used has a lambda form as car and this as cadr: (0 column-marker-1 prepend t). Face `column-marker-1' is defined as follows: (defface column-marker-1 '((t (:background "gray"))) "Face used for a column marker. Usually a background color." :group 'faces) The lambda form is thus, AFAICT, just the kind of function that `font-lock(-add)-keywords' expects. Please let me know if I'm missing something. I think I am correctly using the form (MATCHER HIGHLIGHTER...), from node `Search-based Fontification' of the Elisp manual. MATCHER here is the lambda form shown above. There is only one HIGHLIGHTER, with form SUBEXP-HIGHLIGHTER. The SUBEXP-HIGHLIGHTER here is of form (SUBEXP FACESPEC OVERRIDE LAXMATCH), with SUBEXP=0, FACESPEC=the symbol (face name) `column-marker-1', OVERRIDE=`prepend', and LAXMATCH=t. I also tried removing the parens around (0 column-marker-1 prepend t), making it the cdr instead of the cadr, so it looked like this: (MATCHER 0 column-marker-1 prepend t), where MATCHER is the same lambda form. That should match the also-allowed form (MATCHER . SUBEXP-HIGHLIGHTER). But that didn't change anything. What's odd is that the message complains about a _face reference_, but the text included with the error message is code from the lambda form (i.e. from the MATCHER part, not from the HIGHLIGHTER part that specifies the face). The display code seems to be walking down the lambda form, spitting it out bit by bit progressively in the `Invalid face reference' messages. E.g.: Invalid face reference: end Invalid face reference: point Invalid face reference: <= Invalid face reference: current-column Invalid face reference: 37 Invalid face reference: = Invalid face reference: and Invalid face reference: if Invalid face reference: 37 Invalid face reference: move-to-column Invalid face reference: current-column Invalid face reference: 1 Invalid face reference: forward-line Invalid face reference: + Invalid face reference: 0 Invalid face reference: = Invalid face reference: end Invalid face reference: point Invalid face reference: < Invalid face reference: 37 Invalid face reference: current-column Invalid face reference: < Invalid face reference: and Invalid face reference: while Invalid face reference: 37 Invalid face reference: move-to-column Invalid face reference: 37 Invalid face reference: current-column Invalid face reference: < Invalid face reference: when Invalid face reference: 1 Invalid face reference: forward-line Invalid face reference: 37 Invalid face reference: current-column Invalid face reference: < Invalid face reference: unless Invalid face reference: point-max Invalid face reference: end Invalid face reference: setq Invalid face reference: point-max Invalid face reference: end Invalid face reference: > Invalid face reference: when Invalid face reference: nil Invalid face reference: message-log-max Invalid face reference: point Invalid face reference: start Invalid face reference: let Invalid face reference: end Invalid face reference: lambda Invalid face reference: t Invalid face reference: prepend Invalid face reference: 0 Invalid face reference: nil Invalid face reference: start Invalid face reference: goto-char Invalid face reference: t Invalid face reference: point [2 times] Invalid face reference: 1- Invalid face reference: list Invalid face reference: set-match-data Invalid face reference: progn Invalid face reference: start Invalid face reference: point Invalid face reference: > Invalid face... (repeated) It's as if the code were trying to get face specs from the lambda form, in order to merge those faces. Just a guess. At any rate, it seems bugged to me, but if not, please let me know what I'm doing wrong. Thx. In GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) of 2009-07-29 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 5.1.2600 configured using `configure --with-gcc (4.4)' ------=_NextPart_000_007F_01CA5978.694AAE50 Content-Type: application/octet-stream; name="column-marker.el" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="column-marker.el" ;;; column-marker.el --- Highlight certain character columns=0A= ;; =0A= ;; Filename: column-marker.el=0A= ;; Description: Highlight certain character columns=0A= ;; Author: Rick Bielawski =0A= ;; Maintainer: Rick Bielawski =0A= ;; Created: Tue Nov 22 10:26:03 2005=0A= ;; Version: =0A= ;; Last-Updated: Fri Oct 30 13:20:01 2009 (-0700)=0A= ;; By: dradams=0A= ;; Update #: 291=0A= ;; Keywords: tools convenience highlight=0A= ;; Compatibility: GNU Emacs 21, GNU Emacs 22=0A= ;; =0A= ;; Features that might be required by this library:=0A= ;;=0A= ;; None=0A= ;;=0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;;; Commentary: =0A= ;; =0A= ;; Highlights the background at a given character column.=0A= ;; =0A= ;; Commands `column-marker-1', `column-marker-2', and=0A= ;; `column-marker-3' each highlight a given column (using different=0A= ;; background colors, by default).=0A= ;;=0A= ;; - With no prefix argument, each highlights the current column=0A= ;; (where the cursor is).=0A= ;;=0A= ;; - With a non-negative numeric prefix argument, each highlights that=0A= ;; column.=0A= ;;=0A= ;; - With plain `C-u' (no number), each turns off its highlighting.=0A= ;;=0A= ;; - With `C-u C-u', each turns off all column highlighting.=0A= ;;=0A= ;; If two commands highlight the same column, the last-issued=0A= ;; highlighting command shadows the other - only the last-issued=0A= ;; highlighting is seen. If that "topmost" highlighting is then=0A= ;; turned off, the other highlighting for that column then shows=0A= ;; through.=0A= ;;=0A= ;; Examples:=0A= ;;=0A= ;; M-x column-marker-1 highlights the column where the cursor is, in=0A= ;; face `column-marker-1'.=0A= ;;=0A= ;; C-u 70 M-x column-marker-2 highlights column 70 in face=0A= ;; `column-marker-2'.=0A= ;;=0A= ;; C-u 70 M-x column-marker-3 highlights column 70 in face=0A= ;; `column-marker-3'. The face `column-marker-2' highlighting no=0A= ;; longer shows.=0A= ;;=0A= ;; C-u M-x column-marker-3 turns off highlighting for column-marker-3,=0A= ;; so face `column-marker-2' highlighting shows again for column 70.=0A= ;;=0A= ;; C-u C-u M-x column-marker-1 (or -2 or -3) erases all column=0A= ;; highlighting.=0A= ;;=0A= ;; These commands use `font-lock-fontify-buffer', so syntax=0A= ;; highlighting (`font-lock-mode') must be turned on. There might be=0A= ;; a performance impact during refontification.=0A= ;;=0A= ;;=0A= ;; Installation: Place this file on your load path, and put this in=0A= ;; your init file (`.emacs'):=0A= ;;=0A= ;; (require 'column-marker)=0A= ;;=0A= ;; Other init file suggestions (examples):=0A= ;;=0A= ;; ;; Highlight column 80 in foo mode.=0A= ;; (add-hook foo-mode-hook (lambda () (interactive) (column-marker-1 = 80)))=0A= ;;=0A= ;; ;; Use `C-c m' interactively to highlight with face `column-marker-1'.=0A= ;; (global-set-key [?\C-c ?m] 'column-marker-1)=0A= ;;=0A= ;;=0A= ;; Please report any bugs!=0A= ;;=0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;;; Change log:=0A= ;;=0A= ;; 2008/01/21 dadams=0A= ;; Renamed faces by dropping suffix "-face".=0A= ;; 2006/08/18 dadams=0A= ;; column-marker-create: Add newlines to doc-string sentences.=0A= ;; 2005/12/31 dadams=0A= ;; column-marker-create: Add marker to column-marker-vars inside the = defun,=0A= ;; so it is done in the right buffer, updating column-marker-vars = buffer-locally.=0A= ;; column-marker-find: Corrected comment. Changed or to progn for = clarity.=0A= ;; 2005/12/29 dadams=0A= ;; Updated wrt new version of column-marker.el (multi-column = characters).=0A= ;; Corrected stray occurrences of column-marker-here to = column-marker-1.=0A= ;; column-marker-vars: Added make-local-variable.=0A= ;; column-marker-create: Changed positive to non-negative.=0A= ;; column-marker-internal: Turn off marker when col is negative, not = < 1.=0A= ;; 2005-12-29 RGB=0A= ;; column-marker.el now supports multi-column characters.=0A= ;; 2005/11/21 dadams=0A= ;; Combined static and dynamic. =0A= ;; Use separate faces for each marker. Different interactive spec.=0A= ;; 2005/10/19 RGB=0A= ;; Initial release of column-marker.el.=0A= ;;=0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;;=0A= ;; This program is free software; you can redistribute it and/or modify=0A= ;; it under the terms of the GNU General Public License as published by=0A= ;; the Free Software Foundation; either version 2, or (at your option)=0A= ;; any later version.=0A= =0A= ;; This program is distributed in the hope that it will be useful,=0A= ;; but WITHOUT ANY WARRANTY; without even the implied warranty of=0A= ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the=0A= ;; GNU General Public License for more details.=0A= =0A= ;; You should have received a copy of the GNU General Public License=0A= ;; along with this program; see the file COPYING. If not, write to=0A= ;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth=0A= ;; Floor, Boston, MA 02110-1301, USA.=0A= ;;=0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;; =0A= ;;; Code:=0A= =0A= ;;;;;;;;;;;;;;;;;;;;;;=0A= =0A= =0A= (defface column-marker-1 '((t (:background "gray")))=0A= "Face used for a column marker. Usually a background color."=0A= :group 'faces)=0A= =0A= (defvar column-marker-1-face 'column-marker-1=0A= "Face used for a column marker. Usually a background color.=0A= Changing this directly affects only new markers.")=0A= =0A= (defface column-marker-2 '((t (:background "cyan3")))=0A= "Face used for a column marker. Usually a background color."=0A= :group 'faces)=0A= =0A= (defvar column-marker-2-face 'column-marker-2=0A= "Face used for a column marker. Usually a background color.=0A= Changing this directly affects only new markers." )=0A= =0A= (defface column-marker-3 '((t (:background "orchid3")))=0A= "Face used for a column marker. Usually a background color."=0A= :group 'faces)=0A= =0A= (defvar column-marker-3-face 'column-marker-3=0A= "Face used for a column marker. Usually a background color.=0A= Changing this directly affects only new markers." )=0A= =0A= (defvar column-marker-vars nil=0A= "List of all internal column-marker variables")=0A= (make-variable-buffer-local 'column-marker-vars) ; Buffer local in all = buffers.=0A= =0A= (defmacro column-marker-create (var &optional face)=0A= "Define a column marker named %%colmark%%-VAR.=0A= FACE is the face to use. If nil, then face `column-marker-1' is used."=0A= (setq face (or face 'column-marker-1))=0A= `(progn=0A= ;; define context variable ,VAR so marker can be removed if desired=0A= (defvar ,var ()=0A= "Buffer local. Used internally to store column marker spec.")=0A= ;; context must be buffer local since font-lock is =0A= (make-variable-buffer-local ',var)=0A= ;; Define wrapper function named ,VAR to call = `column-marker-internal'=0A= (defun ,var (arg)=0A= ,(concat "Highlight column with face `" (symbol-name face)=0A= "'.\nWith no prefix argument, highlight current = column.\n"=0A= "With non-negative numeric prefix arg, highlight that = column number.\n"=0A= "With plain `C-u' (no number), turn off this column = marker.\n"=0A= "With `C-u C-u' or negative prefix arg, turn off all = column-marker highlighting.")=0A= (interactive "P")=0A= (unless (memq ',var column-marker-vars) (push ',var = column-marker-vars))=0A= (cond ((null arg) ; Default: highlight current column.=0A= (column-marker-internal ',var (1+ (current-column)) ,face))=0A= ((consp arg)=0A= (if (=3D 4 (car arg))=0A= (column-marker-internal ',var nil) ; `C-u': Remove = this column highlighting.=0A= (dolist (var column-marker-vars)=0A= (column-marker-internal var nil)))) ; `C-u C-u': = Remove all column highlighting.=0A= ((and (integerp arg) (>=3D arg 0)) ; `C-u 70': Highlight = that column.=0A= (column-marker-internal ',var (1+ (prefix-numeric-value = arg)) ,face))=0A= (t ; `C-u -40': Remove all column highlighting.=0A= (dolist (var column-marker-vars)=0A= (column-marker-internal var nil)))))))=0A= =0A= (defun column-marker-find (col)=0A= "Returns a function to locate a character in column COL."=0A= `(lambda (end)=0A= (let ((start (point))=0A= (message-log-max nil))=0A= (when (> end (point-max)) (setq end (point-max)))=0A= =0A= ;; Try to keep `move-to-column' from going backward, though it = still can.=0A= (unless (< (current-column) ,col) (forward-line 1))=0A= =0A= ;; Again, don't go backward. Try to move to correct column.=0A= (when (< (current-column) ,col) (move-to-column ,col))=0A= =0A= ;; If not at target column, try to move to it.=0A= (while (and (< (current-column) ,col) (< (point) end)=0A= (=3D 0 (+ (forward-line 1) (current-column)))) ; = Should be bol.=0A= (move-to-column ,col))=0A= =0A= ;; If at target column, not past end, and not prior to start,=0A= ;; then set match data and return t. Otherwise go to start=0A= ;; and return nil.=0A= (if (and (=3D ,col (current-column)) (<=3D (point) end) (> (point) = start))=0A= (progn (set-match-data (list (1- (point)) (point)))=0A= t) ; Return t.=0A= (goto-char start)=0A= nil)))) ; Return nil.=0A= =0A= (defun column-marker-internal (sym col &optional face)=0A= "SYM is the symbol for holding the column marker context.=0A= COL is the column in which a marker should be set.=0A= Supplying nil or 0 for COL turns off the marker.=0A= FACE is the face to use. If nil, then face `column-marker-1' is used."=0A= (setq face (or face 'column-marker-1))=0A= (when (symbol-value sym) ; Remove any previously set column marker=0A= (font-lock-remove-keywords nil (symbol-value sym))=0A= (set sym nil))=0A= (when (or (listp col) (< col 0)) (setq col nil)) ; Allow nonsense = stuff to turn off the marker=0A= (when col ; Generate a new column marker=0A= (set sym `((,(column-marker-find col) (0 ,face prepend t))))=0A= (font-lock-add-keywords nil (symbol-value sym) t))=0A= (font-lock-fontify-buffer))=0A= =0A= ;; If you need more markers you can create your own similarly.=0A= ;; All markers can be in use at once, and each is buffer-local,=0A= ;; so there is no good reason to define more unless you need more=0A= ;; markers in a single buffer.=0A= (column-marker-create column-marker-1 column-marker-1-face)=0A= (column-marker-create column-marker-2 column-marker-2-face)=0A= (column-marker-create column-marker-3 column-marker-3-face)=0A= =0A= ;;;###autoload=0A= (autoload 'column-marker-1 "column-marker" "Highlight a column." t)=0A= =0A= ;;;;;;;;;;;;;;;;;;=0A= =0A= (provide 'column-marker)=0A= =0A= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;=0A= ;;; column-marker.el ends here=0A= ------=_NextPart_000_007F_01CA5978.694AAE50--