Changeset 6a9b5a in git
- Timestamp:
- Dec 18, 2000, 4:44:32 PM (22 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
- Children:
- b39d4dc5adb2ce64a3babd5df6ac99eb7f4ed311
- Parents:
- 532abf0934d39be85692d986605908304c84a226
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emacs/singular.el
r532abf r6a9b5a 1 1 ;;; singular.el --- Emacs support for Computer Algebra System Singular 2 2 3 ;; $Id: singular.el,v 1.6 0 2000-05-19 11:13:32 wichmann Exp $3 ;; $Id: singular.el,v 1.61 2000-12-18 15:44:32 wichmann Exp $ 4 4 5 5 ;;; Commentary: … … 625 625 This should be a list of vectors.") 626 626 627 (defun singular-menu-build-libraries-menu (definition) 628 "Given a description of the libraries and their categories, builds up a 629 menu definition including submenus which can be given to 630 `easy-menu-change'. By side effect sets the variable 631 `singular-standard-libraries-alist' to the alist of all library names. 632 This alist can be used for completion." 633 (let ((menudef ()) 634 (libs definition) 635 elem) 636 (while libs 637 (setq elem (car libs)) 638 (if (> (length elem) 1) 639 (setq menudef 640 (append 641 (list 642 (append (list (car elem)) 643 (singular-menu-build-libraries-menu (cdr elem)))) 644 menudef)) 645 (setq menudef 646 (append (list (vector (car elem) 647 (list 'singular-load-library nil 648 (car elem)) 649 t)) 650 menudef)) 651 (setq singular-standard-libraries-alist 652 (append (list elem) singular-standard-libraries-alist))) 653 (setq libs (cdr libs))) 654 menudef)) 655 627 656 (defun singular-menu-install-libraries () 628 657 "Update the singular command menu with libraries. 629 S teps through the alist `singular-standard-libraries-alist' and for630 each entry add a new menu element in the submenu 631 (\"Commands\" \"libraries\")." ;" font-lock-trick 658 Scans the variable `singular-standard-libraries-with-categories' and builds 659 up a menu with submenues for each category in the submenu (\"Commands\" 660 \"Libraries\")." 632 661 (singular-debug 'interactive (message "Installing library menu")) 633 (let ((libs singular-standard-libraries-alist) 634 current 635 (menudef (append '("---") singular-menu-initial-library-menu))) 636 (while libs 637 (setq current (car (car libs))) 638 (setq menudef (append (list (vector current 639 (list 'singular-load-library nil current) 640 t)) 641 menudef)) 642 (setq libs (cdr libs))) 643 (easy-menu-change '("Commands") "Libraries" menudef))) 662 ;; To be compatible with older versions of singular.el (resp. of lib-cmpl.el) 663 ;; we check whether the variable 664 ;; `singular-standard-libraries-with-categories' is set. If not, we use the 665 ;; value of `singular-standard-libraries-alist' instead. 666 (if (not singular-standard-libraries-with-categories) 667 (setq singular-standard-libraries-with-categories 668 singular-standard-libraries-alist)) 669 (easy-menu-change '("Commands") 670 "Libraries" 671 (append 672 (singular-menu-build-libraries-menu 673 singular-standard-libraries-with-categories) 674 (append '("---") singular-menu-initial-library-menu)))) 675 676 (defun singular-menu-init () 677 "Initialize menu stuff for Singular interactive mode. 678 679 This function is called by `singular-exec'." 680 (singular-debug 'interactive (message "Initializing menue stuff")) 681 (make-local-variable 'singular-standard-libraries-alist) 682 (make-local-variable 'singular-standard-libraries-with-categories)) 644 683 645 684 (defun singular-menu-deinstall-libraries () … … 2627 2666 This variable is buffer-local.") 2628 2667 2668 (defvar singular-standard-libraries-with-categories nil 2669 "A list containing all Singular standard library names and their category. 2670 2671 This variable is buffer-local.") 2672 2629 2673 (defvar singular-standard-libraries-alist nil 2630 "An alist containing all Singular standard libraries names. 2674 "An alist containing all Singular standard library names. 2675 This variable is set automatically by `singular-menu-install-libraries' 2676 using the value of `singular-standard-libraries-with-categories'. 2631 2677 2632 2678 This variable is buffer-local.") … … 2840 2886 Otherwise performs completion of Singular commands." 2841 2887 (interactive) 2842 ;; Check if we are inside a string. The search is done back to the2888 ;; Check if we are inside a string. The search is done back to the 2843 2889 ;; process-mark which should be the beginning of the current input. 2844 2890 ;; No check at this point whether there is a process! … … 3975 4021 (singular-completion-init) 3976 4022 (singular-scan-header-init) 4023 (singular-menu-init) 3977 4024 3978 4025 ;; feed process with start file and read input ring. Take
Note: See TracChangeset
for help on using the changeset viewer.