Changeset ef85f4 in git for emacs/singular.el
- Timestamp:
- Aug 5, 1998, 9:07:05 AM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d950c52d07929c4629546c9ad477819d8410ffb3
- Parents:
- c208430266c3139d247d2d6ba7592901d76426bf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emacs/singular.el
rc20843 ref85f4 1 1 ;;; singular.el --- Emacs support for Computer Algebra System Singular 2 2 3 ;; $Id: singular.el,v 1.1 6 1998-07-31 21:05:53 schmidtExp $3 ;; $Id: singular.el,v 1.17 1998-08-05 07:07:05 wichmann Exp $ 4 4 5 5 ;;; Commentary: … … 172 172 ((eq face-type 'output) singular-output-face))) 173 173 ;;}}} 174 175 ;;{{{ Font-locking 176 (defvar singular-font-lock-keywords-1 177 '( 178 ("\\<\\(poly\\|ideal\\)\\>" 1 font-lock-keyword-face) 179 ("\\<\\(ring\\)\\>)" 1 font-lock-variable-face) 180 ;; ("\\<^ \\? no\\>" font-lock-warn-face) 181 ) 182 "Subdued level for highlighting in singular-(interactive)-mode") 183 184 (defvar singular-font-lock-keywords-2 185 (append 186 singular-font-lock-keywords-1 187 '( 188 ("skipping" font-lock-warn-face) 189 ;; ())) 190 )) 191 "Gaudy level for highlihgting in singular-(interactive)-mode") 192 193 (defvar singular-font-lock-keywords singular-font-lock-keywords-1 194 "Default highlighting for singular-(interactive)-mode") 195 196 (defvar singular-emacs-font-lock-defaults 197 '((singular-font-lock-keywords 198 singular-font-lock-keywords-1 199 singular-font-lock-keywords-2) 200 ;; KEYWORDS-ONLY (don't fontify comments/strings when non-nil) 201 nil 202 ;; CASE-FOLD (ignore case when non-nil) 203 nil 204 ;; SYNTAX-ALIST 205 ((?_ . "w")) 206 ;;; was soll ich da nehmen NOT READY (( . )) 207 ;; SYNTAX_BEGIN 208 (beginning-of-defun) 209 ;; beginning-of-line 210 (font-lock-comment-start-regexp . "//")) ;; gibt es nich im XEmacs 211 "Emacs-default for font-lock-mode in singular-(interactive)-mode") 212 213 (defvar singular-xemacs-font-lock-defaults 214 '((singular-font-lock-keywords 215 singular-font-lock-keywords-1 216 singular-font-lock-keywords-2) 217 218 ;; KEYWORDS-ONLY (don't fontify comments/strings when non-nil) 219 nil 220 221 ;; CASE-FOLD (ignore case when non-nil) 222 nil 223 224 ;; SYNTAX-ALIST 225 nil;;; was soll ich da nehmen NOT READY (( . )) 226 227 ;; SYNTAX_BEGIN 228 nil) ;; beginning-of-line 229 "XEmacs-default for font-lock-mode in singular-(interactive)-mode") 230 231 (cond 232 ;; XEmacs 233 ((eq singular-emacs-flavor 'xemacs) 234 (singular-debug 'interactive (message "setting up font-lock for XEmacs")) 235 (put 'singular-interactive-mode 'font-lock-defaults 236 singular-xemacs-font-lock-defaults))) 237 238 239 ;;}}} 174 240 ;;}}} 175 241 176 242 ;;{{{ Singular interactive mode 177 ;;{{{ Key map 243 ;;{{{ Key map and menus 178 244 (defvar singular-interactive-mode-map () 179 245 "Key map to use in Singular interactive mode.") … … 193 259 'singular-interactive-mode-map))) 194 260 (define-key singular-interactive-mode-map "\C-m" 'singular-send-or-copy-input)) 261 262 ;; NOT READY 263 ;; This is just a temporary hack for XEmacs demo. 264 (defvar singular-interactive-mode-menu nil) 265 (defvar singular-interactive-mode-menu-2 266 (purecopy '("Singular" 267 ["start default" singular-other t] 268 ["start..." singular t] 269 ["exit" singular t]))) 270 271 (defvar singular-interactive-mode-menu-1 272 '("Commands" 273 ["load file..." singular-load-file t] 274 ("load library" 275 ["all.lib" (singular-load-library "all.lib" t) t] 276 ["general.lib" (singular-load-library "general.lib" t) t] 277 ["matrix.lib" (singular-load-library "matrix.lib" t) t] 278 ["sing.lib" (singular-load-library "sing.lib" t) t] 279 ["elim.lib" (singular-load-library "elim.lib" t) t] 280 ["inout.lib" (singular-load-library "inout.lib" t) t] 281 ["random.lib" (singular-load-library "random.lib" t) t] 282 ["deform.lib" (singular-load-library "deform.lib" t) t] 283 ["homolg.lib" (singular-load-library "homolog.lib" t) t] 284 ["poly.lib" (singular-load-library "poly.lib" t) t] 285 ["factor.lib" (singular-load-library "factor.lib" t) t] 286 ["ring.lib" (singular-load-library "ring.lib" t) t] 287 ["primdec.lib" (singular-load-library "primdex.lib" t) t] 288 "---" 289 ["other..." singular-load-library t]) 290 "---" 291 ["load demo" singular-demo-load (not singular-demo-mode)] 292 ["exit demo" singular-demo-exit singular-demo-mode] 293 "---" 294 ["truncate lines" (setq truncate-lines (not truncate-lines)) 295 :style toggle :selected truncate-lines] 296 ["fold last section" singular t] 297 ["fold current section" singular t] 298 ["fold all sections" singular t] 299 )) 300 301 ;;(add-menu-button nil ["Singular" (singular) t] "Start Singular") 302 ;;}}} 303 304 ;;{{{ Syntax table 305 (defvar singular-interactive-mode-syntax-table nil 306 "Syntax table for singular-interactive-mode") 307 (if singular-interactive-mode-syntax-table 308 () 309 (setq singular-interactive-mode-syntax-table (make-syntax-table)) 310 (modify-syntax-entry ?/ ". 1456" singular-interactive-mode-syntax-table)) 195 311 ;;}}} 196 312 … … 233 349 "Return process mark of current buffer." 234 350 (process-mark (get-buffer-process (current-buffer)))) 351 352 (defun singular-load-file (file &optional noexpand) 353 "docu NOT READY" 354 (interactive "fLoad file: ") 355 (let ((filename (if noexpand 356 file 357 (expand-file-name file)))) 358 (singular-send-string (get-buffer-process (current-buffer)) 359 (concat "< \"" filename "\";")))) 360 361 (defun singular-load-library (file &optional noexpand) 362 "docu NOT READY" 363 (interactive "fLoad Library: ") 364 (let ((filename (if noexpand 365 file 366 (expand-file-name file)))) 367 (singular-send-string (get-buffer-process (current-buffer)) 368 (concat "LIB \"" filename "\";")))) 235 369 ;;}}} 236 370 … … 1483 1617 (setq mode-name "Singular Interaction") 1484 1618 (use-local-map singular-interactive-mode-map) 1619 (set-syntax-table singular-interactive-mode-syntax-table) 1620 (if singular-interactive-mode-menu 1621 () 1622 (easy-menu-define singular-interactive-mode-menu 1623 singular-interactive-mode-map "" 1624 singular-interactive-mode-menu-1)) 1625 (easy-menu-add singular-interactive-mode-menu) 1626 (setq comment-start "// ") 1627 (setq comment-start-skip "// *") 1628 (setq comment-end "") 1485 1629 1486 1630 ;; customize comint for Singular … … 1538 1682 (add-hook 'singular-post-output-filter-functions 1539 1683 'singular-remove-prompt-filter nil t) 1684 1685 ;; font-locking 1686 (cond 1687 ;; Emacs 1688 ((eq singular-emacs-flavor 'emacs) 1689 (make-local-variable 'font-lock-defaults) 1690 (singular-debug 'interactive (message "Setting up font-lock for emacs")) 1691 (setq font-lock-defaults singular-font-lock-defaults))) 1540 1692 1541 1693 (run-hooks 'singular-interactive-mode-hook))
Note: See TracChangeset
for help on using the changeset viewer.