Changeset b8d197 in git
- Timestamp:
- Jul 15, 1999, 9:03:09 AM (24 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 457bd7daf379c8a6dd5fa01fc2193ed676a5f9f3
- Parents:
- 6652179b387ece88868cec40491432e4e627d7fc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
emacs/singular.el
r665217 rb8d197 1 1 ;;; singular.el --- Emacs support for Computer Algebra System Singular 2 2 3 ;; $Id: singular.el,v 1.2 7 1999-07-02 13:45:24 obachman Exp $3 ;; $Id: singular.el,v 1.28 1999-07-15 07:03:09 wichmann Exp $ 4 4 5 5 ;;; Commentary: … … 216 216 ; "ring" "string" "vector")) 217 217 218 (defvar singular-font-lock-keywords- 0218 (defvar singular-font-lock-keywords-1 219 219 '( 220 ("^\\(> \\| . \\)" . font-lock-singular-prompt-face)220 ("^\\(> \\|\\. \\)" . font-lock-singular-prompt-face) 221 221 ("^ [\\?].*" 0 font-lock-singular-error-face t) 222 222 ("^// \\(\\*\\*.*\\)" 1 font-lock-singular-warn-face t) … … 224 224 "Subdued level for highlighting in singular-(interactive)-mode") 225 225 226 (defvar singular-font-lock-keywords-1 227 '( 228 ("\\<def\\|i\\(deal\\|nt\\(\\|mat\\|vec\\)\\)\\|li\\(nk\\|st\\)\\|m\\(a\\(p\\|trix\\)\\|odule\\)\\|number\\|p\\(oly\\|roc\\)\\|qring\\|r\\(esolution\\|ing\\)\\|string\\|vector\\>" . font-lock-type-face) 229 ("^\\(> \\|. \\)" . font-lock-singular-prompt-face) 230 ("^ [\\?].*" 0 font-lock-singular-error-face t) 231 ("^// \\(\\*\\*.*\\)" 1 font-lock-singular-warn-face t) 232 ) 233 "Subdued level for highlighting in singular-(interactive)-mode") 234 235 (defvar singular-font-lock-keywords-2 226 (defvar singular-font-lock-keywords-2 236 227 (append 237 228 singular-font-lock-keywords-1 229 '( 230 ("\\<\\(def\\|i\\(deal\\|nt\\(\\|mat\\|vec\\)\\)\\|li\\(nk\\|st\\)\\|m\\(a\\(p\\|trix\\)\\|odule\\)\\|number\\|p\\(oly\\|roc\\)\\|qring\\|r\\(esolution\\|ing\\)\\|string\\|vector\\)\\>" . font-lock-type-face) 231 )) 232 "Medium level for highlighting in singular-(interactive)-mode") 233 234 (defvar singular-font-lock-keywords-3 235 (append 236 singular-font-lock-keywords-2 238 237 '( 239 238 ("^ [\\?].*`\\(\\sw\\sw+\\)`" 1 font-lock-reference-name-face t) … … 242 241 "Gaudy level for highlihgting in singular-(interactive)-mode") 243 242 244 (defvar singular-font-lock-keywords singular-font-lock-keywords- 0243 (defvar singular-font-lock-keywords singular-font-lock-keywords-1 245 244 "Default highlighting for singular-(interactive)-mode") 246 245 247 246 (defvar singular-font-lock-defaults 248 247 '((singular-font-lock-keywords 249 singular-font-lock-keywords- 0250 singular-font-lock-keywords- 0)248 singular-font-lock-keywords-1 singular-font-lock-keywords-2 249 singular-font-lock-keywords-3) 251 250 nil ;; KEYWORDS-ONLY 252 251 nil ;; CASE-FOLD (ignore case when non-nil) … … 262 261 singular-font-lock-defaults))) 263 262 ;;}}} 263 264 264 ;;}}} 265 265 266 266 ;;{{{ Singular interactive mode 267 267 268 ;;{{{ Key map and menus 268 269 (defvar singular-interactive-mode-map () … … 283 284 'singular-interactive-mode-map))) 284 285 (define-key singular-interactive-mode-map "\C-m" 'singular-send-or-copy-input) 286 (define-key singular-interactive-mode-map "\t" 'singular-dynamic-complete) 285 287 (define-key singular-interactive-mode-map "\C-c\C-f" 'singular-load-file) 286 288 (define-key singular-interactive-mode-map "\C-c\C-l" 'singular-load-library) … … 381 383 (add-submenu nil 382 384 singular-start-menu-definition)))) 385 ;;}}} 383 386 384 387 ;;{{{ Syntax table … … 551 554 552 555 This variable is used to initialize `comint-input-filter' when 556 Singular interactive mode starts up.") 557 558 (defvar singular-completion-addsuffix '("/" . "") 559 "*Specifies suffixes to be added on completed file names and directories. 560 If a cons pair, it should be of the form (DIRSUFFIX . FILESUFFIX) where 561 DIRSUFFIX and FILESUFFIX are strings added on unambiguous or exact completion. 562 If non-nil, add a `/' to completed directories, ` ' to file names. 563 This mirrors the optional behavior of tcsh. 564 565 This variable is used to initialize `comint-completion-addsuffix' when 553 566 Singular interactive mode starts up.") 554 567 ;;}}} … … 1867 1880 ;;}}} 1868 1881 1882 ;;{{{ Filename, Command, and Help Completion 1883 ;; NOT READY 1884 ;; how to find and load the completion files? 1885 (load-file "cmd-cmpl.el") 1886 (load-file "hlp-cmpl.el") 1887 1888 (defun singular-dynamic-complete () 1889 "NOT READY: docu" 1890 (interactive) 1891 (if (eq (buffer-syntactic-context) 'string) 1892 ;; then: expand filename 1893 (comint-dynamic-complete-as-filename) 1894 ;; else: expand command or help 1895 (let ((end (point)) 1896 beg 1897 pattern 1898 completion-list 1899 completion) 1900 (save-excursion 1901 (beginning-of-line) 1902 (if (re-search-forward (concat singular-prompt-regexp 1903 "[ \t]*\\([\\?]\\|help \\)[ \t]*\\(.*\\)") 1904 end t) 1905 (setq pattern (match-string 2) 1906 beg (match-beginning 2) 1907 completion-list singular-completion-help-list) 1908 (goto-char end) 1909 (skip-chars-backward "a-zA-Z0-9") 1910 (setq pattern (buffer-substring (point) end) 1911 beg (point) 1912 completion-list singular-completion-command-list))) 1913 1914 (setq completion (try-completion pattern 1915 completion-list)) 1916 (cond ((eq completion t) 1917 (message "[Sole completion]")) ;; nothing to complete 1918 ((null completion) ;; no completion found 1919 (message "Can't find completion for \"%s\"" pattern) 1920 (ding)) 1921 ((not (string= pattern completion)) 1922 (delete-region beg end) 1923 (insert completion)) 1924 (t 1925 (message "Making completion list...") 1926 (let ((list (all-completions pattern 1927 completion-list))) 1928 (with-output-to-temp-buffer "*Completions*" 1929 (display-completion-list list))) 1930 (message "Making completion list...%s" "done")))))) 1931 ;;}}} 1932 1869 1933 ;;{{{ Singular interactive mode 1870 1934 (defun singular-interactive-mode () … … 1919 1983 (setq comint-input-ring-size singular-input-ring-size) 1920 1984 (setq comint-input-filter singular-history-filter) 1985 (setq comint-completion-addsuffix singular-completion-addsuffix) 1921 1986 1922 1987 ;; get name of history file (if any)
Note: See TracChangeset
for help on using the changeset viewer.