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

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

Re: vbb-mode for GNU Emacs


From: lawrence mitchell
Subject: Re: vbb-mode for GNU Emacs
Date: Thu, 05 Sep 2002 13:20:33 +0100
User-agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2.90 (i386-mingw-windows98.2222)

Ludwig Weinzierl wrote:

> Hello,

> there is a minor-mode for X-Emacs called vvb-mode which shows a
> vertikal bar in a certain column (eg column 72).
> Sadly it works only with X-Emacs.
> 1. Is there a similar package for GNU Emacs?
> 2. Does anyone know of version of vbb-mode.el for GNU Emacs?
> 3. Has anyone an idea how to get this part of code working with GNU
> emacs?

GNU Emacs uses overlays rather than extents, (which, I believe, are
somewhat less efficient, however, no matter).  Hence, you have to
change two functions in vvb-mode.  `vvb-show' and `vvb-hide'.

If you replace `vvb-hide' with the following definition:
`cl-map-overlays' is part of the cl package which ships with Emacs.

(defun vvb-hide ()
  "Hide the transient visual vertical bar if any."
  (if vvb-visible-p
      (progn (setq vvb-visible-p nil)
             (cl-map-overlays #'(lambda (overlay dummy)
                                  (delete-overlay overlay))
                              nil nil nil 'vvb))))

[...]
>                     (set-extent-properties (make-extent b e)
>                                            (list 'face vvb-face
>                                                  'vvb t))

Change these lines to:
(let ((overlay (make-overlay b e)))
  (overlay-put overlay 'face vvb-face)
  (overlay-put overlay 'vvb t))
[...]

-- 
lawrence mitchell <address@hidden>


reply via email to

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