unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* vbb-mode for GNU Emacs
@ 2002-09-05 11:44 Ludwig Weinzierl
  2002-09-05 12:20 ` lawrence mitchell
  2002-09-06 18:35 ` Stefan Monnier <foo@acm.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Ludwig Weinzierl @ 2002-09-05 11:44 UTC (permalink / raw)


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?

 ;; show the bar
  (let ((column (current-column))
	(case-fold-search nil)
	)
    (if (>= column vvb-column)
	(if vvb-visible-p
	    nil
	  (let ((start (window-start))
		(end (window-end))
		(cnt 0)
		)
	    (save-excursion
	      (goto-char start)
	      (while (<= (point) end)
		(move-to-column vvb-column)
		(if (<= vvb-column (current-column))
		    (let (b e)
		      (setq b (point))
		      (if vvb-right-on-eol-p
			  (progn (end-of-line)
				 (setq e (point)))
			(setq e (1+ b)))
		      
		      (set-extent-properties (make-extent b e)
					     (list 'face vvb-face
						   'vvb t))
		      (setq cnt (1+ cnt))))
		
		(or (search-forward "\n" nil t)
		    (setq end -1))))
	    
	    (if (> cnt 0)
		(setq vvb-visible-p t))
	    ))

      ;;else - clean up previous act if any
      (vvb-hide))
    )
)

;; attach it to the XEmacs system
(or (assoc 'vvb-mode minor-mode-alist)
    (setq minor-mode-alist (cons '(vvb-mode " VBar")
minor-mode-alist)))

This is a code snippet from an early version of vvb-mode.el available
at
http://www.ee.ed.ac.uk/~ssp/Info/Email_and_News/Emacs/msg00036.html
The whole file is not very long, and the rest of it is pretty straight
forward.
If I load vbb-mode.el emacs does not complain, its just that the bar
does not
show up.

There are more recent versions of it, but i don't need the
functionality.
The more recent versions give me some errors with GNU Emacs.

Ludwig Weinzierl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vbb-mode for GNU Emacs
  2002-09-05 11:44 vbb-mode for GNU Emacs Ludwig Weinzierl
@ 2002-09-05 12:20 ` lawrence mitchell
  2002-09-06 18:35 ` Stefan Monnier <foo@acm.com>
  1 sibling, 0 replies; 5+ messages in thread
From: lawrence mitchell @ 2002-09-05 12:20 UTC (permalink / raw)


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 <wence@gmx.li>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vbb-mode for GNU Emacs
  2002-09-05 11:44 vbb-mode for GNU Emacs Ludwig Weinzierl
  2002-09-05 12:20 ` lawrence mitchell
@ 2002-09-06 18:35 ` Stefan Monnier <foo@acm.com>
  2002-09-07  1:09   ` Miles Bader
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-09-06 18:35 UTC (permalink / raw)


>>>>> "Ludwig" == Ludwig Weinzierl <weinzierl@case-m.de> writes:
> Sadly it works only with X-Emacs.

It's not `X-Emacs', it's `XEmacs'.

> 1. Is there a similar package for GNU Emacs?

And since `XEmacs' is a single word, it is clearly distinct from `Emacs',
so there's no need for anything like `GNU' to disambiguate ;-)

> 2. Does anyone know of version of vbb-mode.el for GNU Emacs?

Have you tried to (require 'lucid) ?
Emacs' `lucid' package provides an incomplete and somewhat broken
compatibility with some XEmacs-specific functions such as extents.
I'm not sure whether it's enough, but it's worth a try.


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vbb-mode for GNU Emacs
  2002-09-06 18:35 ` Stefan Monnier <foo@acm.com>
@ 2002-09-07  1:09   ` Miles Bader
  2002-09-09 14:40     ` Stefan Monnier <foo@acm.com>
  0 siblings, 1 reply; 5+ messages in thread
From: Miles Bader @ 2002-09-07  1:09 UTC (permalink / raw)


"Stefan Monnier <foo@acm.com>" <monnier+gnu.emacs.help/news/@flint.cs.yale.edu> writes:
> And since `XEmacs' is a single word, it is clearly distinct from `Emacs',
> so there's no need for anything like `GNU' to disambiguate ;-)

Yeah, but `emacs' is also a valid generic term referring to the both,
and even if you consider `Emacs' to be more specific, relying on
capitalization is a bit dodgy.

In contexts where the two terms are used in very close proximity so that
the comparison is obvious, e.g., `Emacs and XEmacs', then I think the
meaning is obvious, but if you use `Emacs' in isolation, or physically
distant from the corresponding `XEmacs', it's often not clear what the
intent is.

[Of course, it also depends on how knowledgable your audience is.]

In other words, it's a mess; I never know what to write...  :-)

-Miles
-- 
Quidquid latine dictum sit, altum viditur.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vbb-mode for GNU Emacs
  2002-09-07  1:09   ` Miles Bader
@ 2002-09-09 14:40     ` Stefan Monnier <foo@acm.com>
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier <foo@acm.com> @ 2002-09-09 14:40 UTC (permalink / raw)


> Yeah, but `emacs' is also a valid generic term referring to the both,
> and even if you consider `Emacs' to be more specific, relying on
> capitalization is a bit dodgy.

It works fine in my experience.

> In other words, it's a mess; I never know what to write...

I just stick to `Emacs' and `XEmacs' and use `emacsen' and things like
that for more generic cases.  It's also shorter.


        Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-09-09 14:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-05 11:44 vbb-mode for GNU Emacs Ludwig Weinzierl
2002-09-05 12:20 ` lawrence mitchell
2002-09-06 18:35 ` Stefan Monnier <foo@acm.com>
2002-09-07  1:09   ` Miles Bader
2002-09-09 14:40     ` Stefan Monnier <foo@acm.com>

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).