home *** CD-ROM | disk | FTP | other *** search
- x-gateway: rodan.UU.NET from help-lucid-emacs to alt.lucid-emacs.help; Fri, 11 Sep 1992 22:38:14 EDT
- From: dmason%plg.uwaterloo.ca@lucid.com (Dave Mason)
- Subject: Re: 19.3 installation on decstation/ultrix4.2 with native cc
- Message-ID: <92Sep11.223453edt.28714@plg.uwaterloo.ca>
- Date: Fri, 11 Sep 1992 22:34:50 -0400
- Newsgroups: alt.lucid-emacs.help
- Path: sparky!uunet!wendy-fate.uu.net!help-lucid-emacs
- Sender: help-lucid-emacs-request@lucid.com
- Lines: 54
-
- Here is some better menubar Buffers functions that you might want to
- include in the distribution.
-
- ../Dave
-
- -------------------------------
- (add-menu-item '("Buffers" "Change to...") "" nil t)
- (add-menu-item '("Buffers" "Save...") "" nil t)
- (add-menu-item '("Buffers" "Delete...") "" nil t)
- (add-menu-item '("Buffers") "Save All Buffers" 'save-some-buffers t)
- (add-menu-item '("Buffers") "List All Buffers" 'list-buffers t)
-
- (defun build-buffers-each (buffer-menu func buffers)
- (let (name)
- (if (not buffer-menu)
- nil
- ;;(if (> (length buffers) 10)
- ;; (setcdr (nthcdr 10 buffers) nil))
- (setq buffers
- (mapcar (function
- (lambda (buffer)
- (if (setq name (format-buffers-menu-line buffer))
- (vector name
- (list func (buffer-name buffer))
- t))))
- buffers))
- ;; slightly (only slightly) more efficient to not install the menubar
- ;; if it hasn't visibly changed.
- (if (equal buffers (cdr buffer-menu))
- t ; return t meaning "no change"
- (setcdr buffer-menu buffers)
- ;; return the now-modified menubar to install.
- ))))
-
- (defun build-buffers-menu-hook (nothing)
- "For use as a value of activate-menubar-hook.
- This function changes the contents of the \"Buffers\" menu to correspond
- to the current set of buffers. You can control how the text of the menu
- items are generated by redefining the function `format-buffers-menu-line'."
- (let ((buffers (buffer-list)))
- (build-buffers-each (car (find-menu-item current-menubar
- '("Buffers" "Change to...")))
- 'switch-to-buffer
- buffers)
- (build-buffers-each (car (find-menu-item current-menubar
- '("Buffers" "Save...")))
- 'save-buffer
- buffers)
- (build-buffers-each (car (find-menu-item current-menubar
- '("Buffers" "Delete...")))
- 'kill-buffer
- buffers)
- )
- nil)
-