Tom Tromey writes:
 > Here is an excerpt from the function documentation for "defconst":
 > 
 > Note: do not use `defconst' for user options in libraries that are not
 > normally loaded, since it is useful for users to be able to specify
 > their own values for such variables before loading the library.
 > Since `defconst' unconditionally assigns the variable,
 > it would override the user's choice.
 > 
 > Your other fixes look pretty nice though (haven't tried them).
 > 
 > Tom
 > ---
 > This reporter is tromey@cns.caltech.edu    "Totally Objective"
 > "`Nova heat moving in,' dig?"  -- Robert Anton Wilson

Dave Gillespie writes:
 > > - change all `defvar's in `defconst's (they are easily re-evaluable
 > >   after modifications).
 > 
 > But users will not be able to override them in their .emacs files.
 > 
 > 								-- Dave

Well, I wasn't sure whether the variables defining menus are user
options, i.e., whether they are ment to be custommized in .emacs or
elsewhere.  What users most probably will want to do is adding or
removing some buttons, which can always be done with `add-menu-item'
and `delete-menu-item'.

I found it a good idea to use defconst instead of defvar because it
allows updating of a variable with M-C-x or C-x C-e, just after having
done some modifications.  But I agree that this is the wrong way to do
it. So ignore the `defconst'- parts of my patch.


Here is a (hopfully) better solution to my problem: making defvar
forms changing the variable value when evaluated with `eval-last-sexp'
(C-x C-e) and `eval-defun' (M-C-x). (I think I've seen this on
Lispmachine before)

Enjoy,
	Guido


-------------------------- lisp-mode-patch --------------------------
*** lisp-mode.el~	Thu Jul 30 01:43:08 1992
--- lisp-mode.el	Fri Oct 16 11:28:49 1992
***************
*** 202,208 ****
  (defun eval-print-last-sexp (arg)
    "Evaluate sexp before point; print value into current buffer."
    (interactive "P")
!   (eval-region
      (let ((stab (syntax-table)))
        (unwind-protect
  	  (save-excursion
--- 202,208 ----
  (defun eval-print-last-sexp (arg)
    "Evaluate sexp before point; print value into current buffer."
    (interactive "P")
!   (eval-region-hack-defvar
      (let ((stab (syntax-table)))
        (unwind-protect
  	  (save-excursion
***************
*** 217,223 ****
    "Evaluate sexp before point; print value in minibuffer.
  With argument, print output into current buffer."
    (interactive "P")
!   (eval-region
      (let ((stab (syntax-table)))
        (unwind-protect
  	  (save-excursion
--- 217,223 ----
    "Evaluate sexp before point; print value in minibuffer.
  With argument, print output into current buffer."
    (interactive "P")
!   (eval-region-hack-defvar
      (let ((stab (syntax-table)))
        (unwind-protect
  	  (save-excursion
***************
*** 237,244 ****
      (end-of-defun)
      (let ((end (point)))
        (beginning-of-defun)
!       (eval-region (point) end
  		   (if arg (current-buffer) t)))))
  
  (defun lisp-comment-indent ()
    (if (looking-at "\\s<\\s<\\s<")
--- 237,257 ----
      (end-of-defun)
      (let ((end (point)))
        (beginning-of-defun)
!       (eval-region-hack-defvar (point) end
  		   (if arg (current-buffer) t)))))
+ 
+ (defun eval-region-hack-defvar (b e &optional printflag)
+   "Same as `eval-region', but treats forms starting with `\(defvar' as
+ if they would be `defconst's, i.e., change the variable's value (which
+ is not the case for `defvar')."
+   (if (save-excursion
+ 	(goto-char b)
+ 	(looking-at "(defvar"))
+       (let ((form (car (read-from-string (buffer-substring b e)))))
+ 	(rplaca form 'defconst)
+ 	(print (eval form) printflag))
+     (eval-region b e printflag)))
+ 
  
  (defun lisp-comment-indent ()
    (if (looking-at "\\s<\\s<\\s<")
Newsgroups: alt.lucid-emacs.bug