Changeset e8f1f9 in git
- Timestamp:
- Aug 6, 1998, 2:24:46 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 07c212cf798802e7865868eb06dba81881d3711a
- Parents:
- 3610c28d8a05e7aef00bd0ee95069a76d0f6ee3e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emacs/singular.el
r3610c28 re8f1f9 1 1 ;;; singular.el --- Emacs support for Computer Algebra System Singular 2 2 3 ;; $Id: singular.el,v 1.1 8 1998-08-05 20:42:58wichmann Exp $3 ;; $Id: singular.el,v 1.19 1998-08-06 12:24:46 wichmann Exp $ 4 4 5 5 ;;; Commentary: … … 329 329 ;; XEmacs 330 330 ((eq singular-emacs-flavor 'xemacs) 331 (message "installing main-menu")332 331 (add-submenu nil 333 332 '("Singular" … … 421 420 (setq which (list (singular-section-at (point))))) 422 421 ((eq where 'all) 423 (setq which (singular-section-in (point-min) (point-max)))) 422 (setq which (singular-section-in (point-min) (point-max))) 423 424 ;; just use the output sections: 425 (let (newwhich) 426 (while which 427 (if (eq (singular-section-type (car which)) 'output) 428 (setq newwhich (append (list (car which)) newwhich))) 429 (setq which (cdr which))) 430 (setq which newwhich))) 431 424 432 (t 425 (message "singular-do-folding: wrong argument"))) 433 (singular-debug 'interactive 434 (message "singular-do-folding: wrong argument")))) 426 435 (while which 427 436 (let* ((current (car which)) … … 739 748 "Return start of clear section at position POS. 740 749 Assumes that no narrowing is in effect." 741 (let ((previous-overlay-change (1+ (point))))750 (let ((previous-overlay-change (1+ pos))) 742 751 ;; this `while' loop at last will run into the end of the next 743 752 ;; non-clear overlay or stop at bob. Since POS may be right at the end … … 753 762 "Return end of clear section at position POS. 754 763 Assumes that no narrowing is in effect." 755 (let ((next-overlay-change (next-overlay-change (point))))764 (let ((next-overlay-change (next-overlay-change pos))) 756 765 ;; this `while' loop at last will run into the beginning of the next 757 766 ;; non-clear overlay or stop at eob. Since POS may not be at the … … 860 869 ;; if previous-extent-change is called with an argument bigger 861 870 ;; than (1+ (buffer-size)) (not (point-max)!), we get an error! 862 (let ((previous-extent-change (if (> (point)(buffer-size))863 (point)864 (1+ (point)))))871 (let ((previous-extent-change (if (> pos (buffer-size)) 872 pos 873 (1+ pos)))) 865 874 ;; this `while' loop at last will run into the end of the next 866 875 ;; non-clear extent or stop at bob. Since POS may be right at the end … … 876 885 "Return end of clear section at position POS. 877 886 Assumes that no narrowing is in effect." 878 (let ((next-extent-change (next-extent-change (point))))887 (let ((next-extent-change (next-extent-change pos))) 879 888 ;; this `while' loop at last will run into the beginning of the next 880 889 ;; non-clear extent or stop at eob. Since POS may not be at the … … 912 921 The result contains both clear and non-clear simple sections in the 913 922 order they appear in the region." 914 ;; NOT READY 915 nil) 923 ;; NOT READY [order of sections???] 924 (let ((extent-list)) 925 (map-extents 926 (function (lambda (ext arg) 927 928 ;; if start of first extent is not point-min, insert 929 ;; a clear-simple-sec first: 930 (or extent-list 931 (= (extent-start-position ext) (point-min)) 932 (setq extent-list (append (list nil) extent-list))) 933 934 ;; if end of previous simple-sec is not equal start of 935 ;; current simple-sec than we have to insert a 936 ;; clear-simple-sec first: 937 (and (car extent-list) 938 (not (= (extent-end-position (car extent-list)) 939 (extent-start-position ext))) 940 (setq extent-list (append (list nil) extent-list))) 941 942 ;; finally insert this non-clear simple-sec: 943 (setq extent-list (append (list ext) extent-list)) 944 nil)) 945 (current-buffer) beg end nil nil 'singular-type) 946 947 ;; if extent-list is still nil at this point, then no non-clear 948 ;; simple-sec intersects with region (BEG END). 949 ;; Then insert a clear simple-sec: 950 (or extent-list 951 (setq extent-list '(nil))) 952 953 ;; if last inserted simple-sec is non-clear and its end is smaller 954 ;; than END, then insert another clear simple sec: 955 (and (car extent-list) 956 (<= (extent-end-position (car extent-list)) end) 957 (setq extent-list (append (list nil) extent-list))) 958 959 ;; we set up the list in decreasing order, so reverse the list 960 (reverse extent-list))) 916 961 ;;}}} 917 962 … … 962 1007 non-nil." 963 1008 (singular-section-at (max 1 (1- pos)) restricted)) 1009 1010 (defun singular-section-in (reg-beg reg-end) 1011 "NOT READY [docu]" 1012 (let ((simple-secs (singular-simple-sec-in reg-beg reg-end)) 1013 sections current last-end 1014 type beg end) 1015 (save-restriction 1016 (widen) 1017 (while simple-secs 1018 (setq current (car simple-secs)) 1019 (setq type (singular-simple-sec-type current)) 1020 (if current 1021 ;; current is a non-clear simple-sec 1022 (setq beg (singular-simple-sec-start current) 1023 end (singular-simple-sec-end current) 1024 last-end end) 1025 ;; current is a clear simple-sec 1026 (setq beg (singular-simple-sec-start-at (or last-end 1027 (point-min))) 1028 end (singular-simple-sec-end-at (or last-end 1029 (point-min))))) 1030 ;; NOT READY [RESTRICTED] 1031 (setq sections (append sections (list (vector current type beg end)))) 1032 (setq simple-secs (cdr simple-secs)))) 1033 sections)) 964 1034 965 1035 (defmacro singular-section-simple-sec (section)
Note: See TracChangeset
for help on using the changeset viewer.