Changeset 99e62ad in git
- Timestamp:
- Aug 14, 1998, 8:57:23 AM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- c43e7bd9453af42df855704f07c6fe2ef772df1a
- Parents:
- 39bc68d5d5208b0f0db79bc07072fed1944fad02
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emacs/singular.el
r39bc68d r99e62ad 1 1 ;;; singular.el --- Emacs support for Computer Algebra System Singular 2 2 3 ;; $Id: singular.el,v 1.2 5 1998-08-07 14:56:27wichmann Exp $3 ;; $Id: singular.el,v 1.26 1998-08-14 06:57:23 wichmann Exp $ 4 4 5 5 ;;; Commentary: … … 174 174 ;; Additional faces for font locking 175 175 (make-face 'font-lock-singular-error-face) 176 177 (defvar font-lock-singular-error-face 'font-lock-singular-error-face 178 "Additional font-lock face for singular errors.") 179 176 180 (cond 177 181 ;; XEmacs 178 182 ((eq singular-emacs-flavor 'xemacs) 183 ;; That 'append avoids to overwrite the face if it is already set 179 184 (set-face-foreground 'font-lock-singular-error-face "Red" 180 185 'global nil 'append))) 181 (defvar font-lock-singular-error-face 'font-lock-singular-error-face182 "NOT READY [docu]")183 186 184 187 (make-face 'font-lock-singular-warn-face) 188 189 (defvar font-lock-singular-warn-face 'font-lock-singular-warn-face 190 "Additional font-lock face for singular warnings.") 191 185 192 (cond 186 193 ;; XEmacs 187 194 ((eq singular-emacs-flavor 'xemacs) 195 ;; That 'append avoids to overwrite the face if it is already set 188 196 (set-face-foreground 'font-lock-singular-warn-face "Orange" 189 197 'global nil 'append))) 190 (defvar font-lock-singular-warn-face 'font-lock-singular-warn-face191 "NOT READY [docu]")192 198 193 199 (make-face 'font-lock-singular-prompt-face) 200 201 (defvar font-lock-singular-warn-face 'font-lock-singular-prompt-face 202 "Addition font-lock face for the singular prompt.") 203 194 204 (cond 195 205 ;; XEmacs 196 206 ((eq singular-emacs-flavor 'xemacs) 207 ;; That 'append avoids to overwrite the face if it is already set 197 208 (set-face-foreground 'font-lock-singular-prompt-face "Gray50" 198 209 'global nil 'append))) 199 (defvar font-lock-singular-warn-face 'font-lock-singular-prompt-face200 "NOT READY [docu]")201 210 ;;}}} 202 211 … … 436 445 437 446 (defun singular-load-file (file &optional noexpand) 438 "docu NOT READY" 447 "Read a file in Singular (via '< \"FILE\";'). 448 If optional argument NOEXPAND is nil, FILE is expanded using 449 `expand-file-name'." 439 450 (interactive "fLoad file: ") 440 451 (let* ((filename (if noexpand file (expand-file-name file))) … … 445 456 446 457 (defun singular-load-library (file &optional noexpand) 447 "docu NOT READY" 458 "Read a Singular library (via 'LIB \"FILE\";'). 459 If optional argument NOEXPAND is nil, FILE is expanded using 460 `expand-file-name'." 448 461 (interactive "fLoad Library: ") 449 462 (let* ((filename (if noexpand file (expand-file-name file))) … … 454 467 455 468 (defun singular-exit-singular () 456 "NOT READY [docu]" 469 "Exit Singular and kill Singular buffer. 470 Sends string \"quit;\" to Singular process." 457 471 (interactive) 458 472 (let ((string "quit;") … … 462 476 (kill-buffer (current-buffer))) 463 477 478 ;; The function `singular-toggle-truncate-lines' is obsolete in XEmacs 479 ;; but not in Emacs. So define it anyway. 464 480 (defun singular-toggle-truncate-lines () 465 481 "Toggle truncate-lines." 466 482 (interactive) 467 (setq truncate-lines (not truncate-lines))) 483 (setq truncate-lines (not truncate-lines)) 484 (recenter)) 468 485 ;;}}} 469 486 … … 1197 1214 1198 1215 (defun singular-do-folding (where &optional unfold) 1199 "NOT READY [docu] 1200 WHERE= 'last or 'all --> just output sections 1201 WHERE= 'at-point --> whatever is at point" 1216 "Fold or unfold certain sections. 1217 WHERE may be 'last, 'all, or 'at-point. If WHERE equals 'last or 1218 'all, only output sections are affected. If WHERE equals 'at-point, 1219 the section at point is affected (input or output). 1220 If optional argument UNFOLD is non-nil, then unfold section instead 1221 of folding it." 1202 1222 (let (which) 1203 1223 (cond 1204 1224 ((eq where 'last) 1205 1225 (setq which (list (singular-latest-output-section t)))) 1226 1206 1227 ((eq where 'at-point) 1207 1228 (setq which (list (singular-section-at (point))))) 1229 1208 1230 ((eq where 'all) 1209 1231 (setq which (singular-section-in (point-min) (point-max))) … … 1866 1888 (setq major-mode 'singular-interactive-mode) 1867 1889 (setq mode-name "Singular Interaction") 1890 1891 ;; key bindings, syntax tables and menus 1868 1892 (use-local-map singular-interactive-mode-map) 1869 1893 (set-syntax-table singular-interactive-mode-syntax-table) … … 1873 1897 (easy-menu-add singular-interactive-mode-menu-1) 1874 1898 (easy-menu-add singular-interactive-mode-menu-2))) 1899 1875 1900 (setq comment-start "// ") 1876 1901 (setq comment-start-skip "// *") … … 2018 2043 (singular-simple-sec-init (point)) 2019 2044 2045 ;; NOT READY: SINGULAR-LOGO 2046 ; (cond 2047 ; ((eq singular-emacs-flavor 'xemacs) 2048 ; (set-extent-begin-glyph (make-extent (point-min) (point-min)) 2049 ; singular-logo) 2050 ; (insert "\n"))) 2051 2020 2052 ;; feed process with start file and read input ring. Take 2021 2053 ;; care about the undo information. … … 2039 2071 (set-buffer old-buffer)))) 2040 2072 2073 ;; NOT READY: SINGULAR-LOGO 2074 ;(cond 2075 ; ((eq singular-emacs-flavor 'xemacs) 2076 ; (defvar singular-logo (make-glyph)) 2077 ; (set-glyph-image singular-logo 2078 ; (concat "~/" "singlogo.xpm") 2079 ; 'global 'x))) 2080 2041 2081 ;; Note: 2042 2082 ;; … … 2085 2125 (setq buffer (get-buffer-create buffer-name)) 2086 2126 (set-buffer buffer) 2127 2087 2128 (singular-debug 'interactive (message "Calling `singular-interactive-mode'")) 2088 2129 (singular-interactive-mode))) … … 2103 2144 2104 2145 (defun singular-generate-new-buffer-name (name) 2105 "NOT READY [docu] 2106 name: should be without stars. 2107 Try to create a buffer named *name*. 2108 If fails, try to create buffer named *name<number>* 2109 Return buffer name with stars at start/end" 2110 (let ((new-name (singular-process-name-to-buffer-name name)) 2146 "Generate a unique buffer name for a singular interactive buffer. 2147 The string NAME is the desired name for the singular interactive 2148 buffer, without surrounding stars. 2149 The string returned is surrounded by stars. 2150 2151 If no buffer with name \"*NAME*\" exists, return \"*NAME*\". 2152 Otherwise check for buffer called \"*NAME<n>*\" where n is a 2153 increasing number and return \"*NAME<n>*\" if no such buffer 2154 exists." 2155 (let ((new-name (singular-process-name-to-buffer-name name)) 2111 2156 (count 2)) 2112 2157 (while (get-buffer new-name) … … 2117 2162 2118 2163 (defun singular-other (file) 2119 "NOT READY [docu]" 2164 "Start a new Singular, different to the default Singular. 2165 FILE is a Singular executable. 2166 2167 Asks in the minibuffer for a buffer-name and for Singular options. 2168 Calls `singular' with the appropriate arguments." 2120 2169 (interactive "fSingular executable: ") 2121 2170 ;; NOT READY [code] … … 2126 2175 2127 2176 ;; Read buffer name from minibuffer at strip surrounding stars 2128 (setq name (read-from-minibuffer "Singular buffer name: " name)) 2177 ;; NOT READY: This code is not very beautyful. 2178 (let ((buffer-exists t) 2179 (new-name name)) 2180 (while buffer-exists 2181 (setq new-name (read-from-minibuffer "Singular buffer name: " name)) 2182 (if (get-buffer new-name) 2183 (progn 2184 (message "This buffer already exists.") 2185 (sleep-for 1)) 2186 (setq buffer-exists nil) 2187 (setq name new-name)))) 2188 2189 2129 2190 (if (string-match "^\\*\\(.*\\)\\*$" name) 2130 2191 (setq name (substring name (match-beginning 1) (match-end 1))))
Note: See TracChangeset
for help on using the changeset viewer.