Changeset eebb93b in git


Ignore:
Timestamp:
Dec 6, 1999, 7:36:37 PM (24 years ago)
Author:
Tim Wichmann <wichmann@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
772c6006e5f2992e642422ea0fb91ddb98106303
Parents:
c34e3dd63c952cffb9e1aa1402c32cbdc0bf3bbb
Message:
1999-12-06  T. Wichmann  <wichmann@arboretum.itwm.uni-kl.de>

	* singular.el (singular-internal): Removed bug: Adding of trailing
	slash crashed if directory was nil
	(singular-completion-do): Added completion of examples


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

Legend:

Unmodified
Added
Removed
  • emacs/singular.el

    rc34e3d reebb93b  
    11;;; singular.el --- Emacs support for Computer Algebra System Singular
    22
    3 ;; $Id: singular.el,v 1.52 1999-12-06 16:07:00 obachman Exp $
     3;; $Id: singular.el,v 1.53 1999-12-06 18:36:37 wichmann Exp $
    44
    55;;; Commentary:
     
    26492649  "Load Singular completion and libraries files.
    26502650Assumes that `singular-emacs-home-directory' is set to the appropriate
    2651 value and loads the files \"cmd-cmpl.el\", \"hlp-cmpl.el\", and
    2652 \"lib-cmpl.el\".
     2651value and loads the files \"cmd-cmpl.el\", \"hlp-cmpl.el\", \"ex-cmpl.el\",
     2652and \"lib-cmpl.el\".
    26532653On success calls `singular-menu-install-libraries'."
    26542654  (or (load (singular-expand-emacs-file-name "cmd-cmpl.el" t) t t t)
     
    26562656  (or (load (singular-expand-emacs-file-name "hlp-cmpl.el" t) t t t)
    26572657      (message "Can't find help topic completion file! Help completion disabled."))
     2658  (or (load (singular-expand-emacs-file-name "ex-cmpl.el" t) t t t)
     2659      (message "Can't find examples completion file! Examples completion disabled."))
    26582660  (if (load (singular-expand-emacs-file-name "lib-cmpl.el" t) t t t)
    26592661      (singular-menu-install-libraries)
     
    27852787(defun singular-completion-init ()
    27862788  "Initialize completion for Singular interactive mode.
    2787 Initializes completion of file names, commands and help topics.
     2789Initializes completion of file names, commands, examples, and help topics.
    27882790
    27892791This function is called by `singular-exec'."
    27902792  (singular-debug 'interactive (message "Initializing completion"))
    27912793  (set (make-local-variable 'singular-commands-alist) nil)
     2794  (set (make-local-variable 'singular-examples-alist) nil)
    27922795  (set (make-local-variable 'singular-help-topics-alist) nil))
    27932796
     
    28182821Performs completion of Singular help topics if point is at the end of a
    28192822help command (\"help\" or \"?\").
     2823Performs completion of Singular examples if point is at the end of an
     2824example command (\"example\").
    28202825Otherwise performs completion of Singular commands."
    28212826  (interactive)
     
    28292834    ;; else: expand command or help
    28302835    (let ((end (point))
     2836          (post-prompt (save-excursion
     2837                         (beginning-of-line)
     2838                         (singular-prompt-skip-forward)))
    28312839          beg)
    2832       (if (save-excursion
    2833             (beginning-of-line)
    2834             (singular-prompt-skip-forward)
    2835             (looking-at "[ \t]*\\([\\?]\\|help \\)[ \t]*\\(.*\\)"))
    2836           ;; then: help completion
    2837           (if singular-help-topics-alist
    2838               (singular-completion-do (match-string 2) (match-beginning 2)
    2839                                       end singular-help-topics-alist)
    2840             (message "Completion of Singular help topics disabled.")
    2841             (ding))
     2840      (cond
     2841       ((save-excursion
     2842          (goto-char post-prompt)
     2843          (looking-at "[ \t]*\\([\\?]\\|help \\)[ \t]*\\(.*\\)"))
     2844        ;; then: help completion
     2845        (if singular-help-topics-alist
     2846            (singular-completion-do (match-string 2) (match-beginning 2)
     2847                                    end singular-help-topics-alist)
     2848          (message "Completion of Singular help topics disabled.")
     2849          (ding)))
     2850       ((save-excursion
     2851          (goto-char post-prompt)
     2852          (looking-at "[ \t]*\\(example \\)[ \t]*\\(.*\\)"))
     2853        ;; then: example completion
     2854        (if singular-help-topics-alist
     2855            (singular-completion-do (match-string 2) (match-beginning 2)
     2856                                    end singular-examples-alist)
     2857          (message "Completion of Singular help topics disabled.")
     2858          (ding)))
     2859       (t
    28422860        ;; else: command completion
    28432861        (save-excursion
     
    28482866                                    end singular-commands-alist)
    28492867          (message "Completion of Singular commands disabled.")
    2850           (ding))))))
     2868          (ding)))))))
    28512869;;}}}
    28522870
     
    38713889  "Interrupt the Singular process running in the current buffer.
    38723890If called interactiveley, asks whether to (a)bort the current Singular
    3873 command, (q)uit or (r) restart the current Singular process,
    3874 or (c)ontinue without doing anything (default).
     3891command, (q)uit or (r) restart the current Singular process, or (c)ontinue
     3892without doing anything (default).
    38753893
    38763894If called non-interactiveley, MODE should be one of 'abort, 'quit, 'restart,
     
    39793997         (buffer (get-buffer buffer-name)))
    39803998   
    3981     ;; make sure directory contains a "/" at the end
    3982     (setq directory
    3983       (concat directory
    3984               ;; we check for trailing slash and backslash
    3985               ;; but unconditionally insert a slash.
    3986               ;; Hopefully that works on NT, too.
    3987               (if (memq (aref directory
    3988                               (1- (length directory)))
    3989                         '(?/ ?\\))
    3990                   "" "/")))
     3999    ;; If directory is set, make sure that it ends in a "/" at the end.
     4000    ;; The check is done on both slash and backslash, but we unconditionally
     4001    ;; insert a slash. Hopefully that works on NT, too.
     4002    (and directory
     4003         (memq (aref directory (1- (length directory))) '(?/ ?\\))
     4004         (setq directory (concat directory "/")))
    39914005   
    39924006    (if (not buffer)
Note: See TracChangeset for help on using the changeset viewer.