Changeset e8f1f9 in git


Ignore:
Timestamp:
Aug 6, 1998, 2:24:46 PM (26 years ago)
Author:
Tim Wichmann <wichmann@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
07c212cf798802e7865868eb06dba81881d3711a
Parents:
3610c28d8a05e7aef00bd0ee95069a76d0f6ee3e
Message:
	* singular.el (singular-emacs-simple-sec-start-at): Removed error:
       	(point) was used instead of pos
	(singular-emacs-simple-sec-end-at): Removed error: (point) was
	used instead of pos

	* singular.el (singular-xemacs-simple-sec-in): Written
	(singular-section-in): Written
	(singular-do-folding): Finished


git-svn-id: file:///usr/local/Singular/svn/trunk@2446 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • emacs/singular.el

    r3610c28 re8f1f9  
    11;;; singular.el --- Emacs support for Computer Algebra System Singular
    22
    3 ;; $Id: singular.el,v 1.18 1998-08-05 20:42:58 wichmann Exp $
     3;; $Id: singular.el,v 1.19 1998-08-06 12:24:46 wichmann Exp $
    44
    55;;; Commentary:
     
    329329     ;; XEmacs
    330330     ((eq singular-emacs-flavor 'xemacs)
    331       (message "installing main-menu")
    332331      (add-submenu nil
    333332                   '("Singular"
     
    421420      (setq which (list (singular-section-at (point)))))
    422421     ((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
    424432     (t
    425       (message "singular-do-folding: wrong argument")))
     433      (singular-debug 'interactive
     434                      (message "singular-do-folding: wrong argument"))))
    426435    (while which
    427436      (let* ((current (car which))
     
    739748  "Return start of clear section at position POS.
    740749Assumes that no narrowing is in effect."
    741   (let ((previous-overlay-change (1+ (point))))
     750  (let ((previous-overlay-change (1+ pos)))
    742751    ;; this `while' loop at last will run into the end of the next
    743752    ;; non-clear overlay or stop at bob.  Since POS may be right at the end
     
    753762  "Return end of clear section at position POS.
    754763Assumes that no narrowing is in effect."
    755   (let ((next-overlay-change (next-overlay-change (point))))
     764  (let ((next-overlay-change (next-overlay-change pos)))
    756765    ;; this `while' loop at last will run into the beginning of the next
    757766    ;; non-clear overlay or stop at eob.  Since POS may not be at the
     
    860869  ;; if previous-extent-change is called with an argument bigger
    861870  ;; 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))))
    865874    ;; this `while' loop at last will run into the end of the next
    866875    ;; non-clear extent or stop at bob.  Since POS may be right at the end
     
    876885  "Return end of clear section at position POS.
    877886Assumes that no narrowing is in effect."
    878   (let ((next-extent-change (next-extent-change (point))))
     887  (let ((next-extent-change (next-extent-change pos)))
    879888    ;; this `while' loop at last will run into the beginning of the next
    880889    ;; non-clear extent or stop at eob.  Since POS may not be at the
     
    912921The result contains both clear and non-clear simple sections in the
    913922order 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)))
    916961;;}}}
    917962
     
    9621007non-nil."
    9631008  (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))
    9641034
    9651035(defmacro singular-section-simple-sec (section)
Note: See TracChangeset for help on using the changeset viewer.