>>>> "NVP" == Nick V Pakoulin
<npak(a)kazbek.ispras.ru> writes:
NVP> xemacs -vanilla
NVP> provides a nice button 'Load .emacs' in menubar, but it seems to me that
there
NVP> is a bug.
NVP> Suppose you start xemacs -vanilla, then open several buffers with different
NVP> major modes. In each buffer the menubar contains 'Load .emacs'. Fine.
NVP> But: pressing this button in a buffer with one major mode does still keep it in
NVP> buffers with other major modes. And those buttons load .emacs again and again.
This should fix it.
lisp/ChangeLog:
2000-02-28 Martin Buchholz <martin(a)xemacs.org>
* menubar-items.el (maybe-add-init-button): Remove the "Load
.emacs" button from all menubars.
Index: lisp/menubar-items.el
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/lisp/menubar-items.el,v
retrieving revision 1.6.2.19
diff -u -w -r1.6.2.19 menubar-items.el
--- menubar-items.el 2000/02/27 21:22:57 1.6.2.19
+++ menubar-items.el 2000/02/28 18:40:26
@@ -988,17 +988,19 @@
(defun maybe-add-init-button ()
"Don't call this.
Adds `Load .emacs' button to menubar when starting up with -q."
- ;; by Stig(a)hackvan.com
- (cond
- (load-user-init-file-p nil)
- ((file-exists-p (expand-file-name ".emacs" "~"))
- (add-menu-button nil
+ (when (and (not load-user-init-file-p)
+ (file-exists-p (expand-file-name ".emacs" "~")))
+ (add-menu-button
+ nil
["Load .emacs"
- (progn (delete-menu-item '("Load .emacs"))
+ (progn
+ (mapc #'(lambda (buf)
+ (with-current-buffer buf
+ (delete-menu-item '("Load .emacs"))))
+ (buffer-list))
(load-user-init-file))
]
- "Help"))
- (t nil)))
+ "Help")))
(add-hook 'before-init-hook 'maybe-add-init-button)