🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by John S Cooper Mon, 22 Mar 1993 15:59
Lightbrite problem with hooks.
#1019
Author: John S Cooper
Date: Mon, 22 Mar 1993 15:59
60 lines
2477 bytes
When I try to specify my own hook function for mail-setup-hook, I get an
'Error in init file' message.

My code is as follows:

(defun hack-mail-reply ()
	 "Perform some hacks to new mail messages that are replies,
and insert X-Mailer: line into the header of all outgoing messages."
	 (interactive)
	 (save-excursion
	   (mail-position-on-field "X-Mailer")
	   (if (bolp)
	       (insert "X-Mailer: "))
	   (insert "VM " vm-version " under "
		   (let ((len (if running-epoch 9 18)))
		     (substring (emacs-version) 0 len)))))

(setq mail-setup-hook 'hack-mail-reply)


I tracked this down to some code in lightbrite which attempts to
postpend another hook function to this variable:

(brite::postpend-unique-hook 'mail-setup-hook 'brite::do-highlight-on-mail)

;; Author: Daniel LaLiberte (liberte@cs.uiuc.edu).

(defun brite::postpend-unique-hook (hook-var hook-function)
  "Postpend HOOK-VAR with HOOK-FUNCTION, if it is not already an element.
hook-var's value may be a single function or a list of functions."
  (if (boundp hook-var)
      (let ((value (symbol-value hook-var)))
        (if (and (listp value) (not (eq (car value) 'lambda)))
            (and (not (memq hook-function value))
                 (set hook-var (append value (list hook-function))))
          (and (not (eq hook-function value))
               (set hook-var (append value (list hook-function))))))
    (set hook-var (list hook-function))))


This somehow seems to be causing my error message.

If I comment this line out of lightbrite:
; (brite::postpend-unique-hook 'mail-setup-hook 'brite::do-highlight-on-mail)

.. and change my .emacs to this:

(setq mail-setup-hook (list 'hack-mail-reply 'brite::do-highlight-on-mail))

all works well.

I guess the lightbrite function is broken?

Can someone please explain this?

Thanks,
--

    --- John
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads