Changeset 9ad353 in git


Ignore:
Timestamp:
Aug 31, 1999, 9:17:22 PM (25 years ago)
Author:
Tim Wichmann <wichmann@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
Children:
bea8e4949cfcc6e1d11dc01708c1681709b8cb9f
Parents:
26ceba03e259fe48e4f20d862f2f20832f8fa15e
Message:
	* singular.el (singular-dynamic-complete): regexp
	  singular-prompt-regexp now is obsolete. Used
	  (singular-prompt-skip-forward) instead
	  key pattern for "C-c $" and "C-c <" changed (did not work
	  for emacs20)
	  (singular-interactive-mode-menu-1/2): updated
	  (singular-expand-emacs-file-name): conditionally append "/" to
	  singular-emacs-home-directory


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

Legend:

Unmodified
Added
Removed
  • emacs/singular.el

    r26ceba r9ad353  
    11;;; singular.el --- Emacs support for Computer Algebra System Singular
    22
    3 ;; $Id: singular.el,v 1.38 1999-08-30 20:05:14 wichmann Exp $
     3;; $Id: singular.el,v 1.39 1999-08-31 19:17:22 wichmann Exp $
    44
    55;;; Commentary:
     
    494494
    495495  ;; global settings
    496   (define-key help-map [?\C-s]                            'singular-help)
     496  (define-key help-map [?\C-s]                                'singular-help)
    497497
    498498  ;; settings for `singular-interactive-map'
     
    500500                             singular-interactive-mode-map global-map)
    501501
    502   (define-key singular-interactive-mode-map "\t"        'singular-dynamic-complete)
    503   (define-key singular-interactive-mode-map [?\C-m]       'singular-send-or-copy-input)
    504   (define-key singular-interactive-mode-map [?\C-l]       'singular-recenter)
     502  (define-key singular-interactive-mode-map "\t"              'singular-dynamic-complete)
     503  (define-key singular-interactive-mode-map [?\C-m]           'singular-send-or-copy-input)
     504  (define-key singular-interactive-mode-map [?\C-l]           'singular-recenter)
    505505
    506506  ;; Comint functions
    507   (define-key singular-interactive-mode-map [?\M-r]       'comint-previous-matching-input)
    508   (define-key singular-interactive-mode-map [?\M-s]       'comint-next-matching-input)
     507  (define-key singular-interactive-mode-map [?\M-r]           'comint-previous-matching-input)
     508  (define-key singular-interactive-mode-map [?\M-s]           'comint-next-matching-input)
    509509
    510510  ;; C-c prefix
    511   (define-key singular-interactive-mode-map [?\C-c ?\C-t] 'singular-toggle-truncate-lines)
    512 
    513   (define-key singular-interactive-mode-map [?\C-c ?\C-f] 'singular-folding-toggle-fold-at-point-or-all)
    514   (define-key singular-interactive-mode-map [?\C-c ?\C-o] 'singular-folding-toggle-fold-latest-output)
    515   (define-key singular-interactive-mode-map [?\C-c ?\C-w] 'singular-section-kill)
    516 
    517   (define-key singular-interactive-mode-map [?\C-c ?\C-d] 'singular-demo-load)
    518   (define-key singular-interactive-mode-map [?\C-c ?\C-l] 'singular-load-library)
    519   (define-key singular-interactive-mode-map [?\C-c <]    'singular-load-file)
    520 
    521   (define-key singular-interactive-mode-map [?\C-c ?\C-r] 'singular-restart)
    522   (define-key singular-interactive-mode-map [?\C-c $]    'singular-exit-singular))
     511  (define-key singular-interactive-mode-map [?\C-c ?\C-t]     'singular-toggle-truncate-lines)
     512
     513  (define-key singular-interactive-mode-map [?\C-c ?\C-f]     'singular-folding-toggle-fold-at-point-or-all)
     514  (define-key singular-interactive-mode-map [?\C-c ?\C-o]     'singular-folding-toggle-fold-latest-output)
     515  (define-key singular-interactive-mode-map [?\C-c ?\C-w]     'singular-section-kill)
     516
     517  (define-key singular-interactive-mode-map [?\C-c ?\C-d]     'singular-demo-load)
     518  (define-key singular-interactive-mode-map [?\C-c ?\C-l]     'singular-load-library)
     519  (define-key singular-interactive-mode-map [(control c) (<)] 'singular-load-file)
     520
     521  (define-key singular-interactive-mode-map [?\C-c ?\C-r]     'singular-restart)
     522  (define-key singular-interactive-mode-map [(control c) ($)] 'singular-exit-singular))
    523523
    524524(defun singular-cursor-key-model-set (key-model)
     
    635635                            menudef))
    636636      (setq libs (cdr libs)))
    637     (easy-menu-change '("Commands") "libraries" menudef)))
     637    (easy-menu-change '("Commands") "Libraries" menudef)))
    638638
    639639(defun singular-menu-deinstall-libraries ()
    640640  "Initialize library submenu from singular command menu.
    641 Sets the submenu (\"Commands\" \"libraries\") to the value of
     641Sets the submenu (\"Commands\" \"Libraries\") to the value of
    642642`singular-menu-initial-library-menu'."
    643643  (singular-debug 'interactive
    644644                  (message "Removing libraries from menu"))
    645   (easy-menu-change '("Commands") "libraries" singular-menu-initial-library-menu))
     645  (easy-menu-change '("Commands") "Libraries" singular-menu-initial-library-menu))
    646646
    647647;; For some reasons emacs inserts new menus in the oppsite order.
     
    655655     (list
    656656      "Commands"
    657       ["load file..." singular-load-file t]
     657      ["Fold Latest Output" singular-folding-fold-latest-output t]
     658      ["Fold All Output" singular-folding-fold-all-output t]
     659      ["Fold At Point" singular-folding-fold-at-point t]
     660      "---"
     661      ["Unfold Latest Output" singular-folding-unfold-latest-output t]
     662      ["Unfold All Output" singular-folding-unfold-all-output t]
     663      ["Unfold At Point" singular-folding-unfold-at-point t]
     664      "--"
    658665      (append
    659        '("libraries")
     666       '("Libraries")
    660667       singular-menu-initial-library-menu)
     668      ["Load File..." singular-load-file t]
    661669      "---"
    662       ["load demo" singular-demo-load (not singular-demo-mode)]
    663       ["exit demo" singular-demo-exit singular-demo-mode]
    664       "--"
    665       ["truncate lines" singular-toggle-truncate-lines
     670      ["Load Demo" singular-demo-load (not singular-demo-mode)]
     671      ["Exit Demo" singular-demo-exit singular-demo-mode]
     672      "---"
     673      ["Truncate Lines" singular-toggle-truncate-lines
    666674       :style toggle :selected truncate-lines]
    667       "---"
    668       ["fold last output" singular-fold-last-output t]
    669       ["fold all output" singular-fold-all-output t]
    670       ["fold at point" singular-fold-at-point t]
    671       "---"
    672       ["unfold last output" singular-unfold-last-output t]
    673       ["unfold all output" singular-unfold-all-output t]
    674       ["unfold at point" singular-unfold-at-point t]
    675675      )))
    676676
     
    679679                      singular-interactive-mode-map ""
    680680                      '("Singular"
    681                         ["start default" singular t]
    682                         ["start..." singular-other t]
    683                         ["restart" singular-restart t]
    684                         ["exit" singular-exit-singular t])))
     681                        ["Start Default" singular t]
     682                        ["Start..." singular-other t]
     683                        ["Restart" singular-restart t]
     684                        "---"
     685                        ["Exit" singular-exit-singular t]
     686                        "---"
     687                        ["Preferences" (customize-group 'singular-interactive) t]
     688                        ["Help" singular-help t])))
     689
     690(defun customize-singular-interactive ()
     691  (interactive)
     692  (customize-group 'singular-interactive))
    685693
    686694(defun singular-interactive-mode-menu-init ()
     
    10061014    (singular-send-string process string)))
    10071015
    1008 (defun singular-load-library (file &optional noexpand)
    1009   "Read a Singular library (via 'LIB \"FILE\";').
    1010 If optional argument NOEXPAND is non-nil, FILE is left as it is entered by
    1011 the user, otherwise it is expanded using `expand-file-name'."
    1012   (interactive "fLoad Library: ")
    1013   (let* ((filename (if noexpand file (expand-file-name file)))
    1014          (string (concat "LIB \"" filename "\";"))
    1015          (process (singular-process)))
     1016(defun singular-load-library (nonstdlib &optional file)
     1017  "Read a Singular library (via 'LIB \"FILE\";')."
     1018  (interactive "P")
     1019  (let ((string (or file
     1020                    (if nonstdlib
     1021                        (read-file-name "Library file: ")
     1022                      (completing-read "Library: " singular-standard-libraries-alist
     1023                                       nil nil nil 'singular-load-library-history))))
     1024        (process (singular-process)))
     1025    (setq string (concat "LIB \"" string "\";"))
    10161026    (singular-input-filter process string)
    10171027    (singular-send-string process string)))
     
    20942104argument NO-ERROR is non-nil.
    20952105This is for safety only: The result may be confusing to the user.
    2096 If optional argument INVISIBILITY-OVERLAY-OR_EXTENT is non-nil it should be
     2106If optional argument INVISIBILITY-OVERLAY-OR-EXTENT is non-nil it should be
    20972107the invisibility overlay or extent, respectively, of the section to
    20982108unfold."
     
    27252735an error unless optional argument NOERROR is not nil."
    27262736  (if singular-emacs-home-directory
    2727       (concat singular-emacs-home-directory "/" file)
     2737      (concat singular-emacs-home-directory
     2738              (if (memq (aref singular-emacs-home-directory
     2739                              (1- (length singular-emacs-home-directory)))
     2740                        '(?/ ?\\))
     2741                  "" "/")
     2742              file)
    27282743    (if noerror
    27292744        nil
     
    27812796      (if (save-excursion
    27822797            (beginning-of-line)
    2783             (re-search-forward (concat singular-prompt-regexp
    2784                                        "[ \t]*\\([\\?]\\|help \\)[ \t]*\\(.*\\)")
    2785                                end t))
     2798            (singular-prompt-skip-forward)
     2799            (looking-at "[ \t]*\\([\\?]\\|help \\)[ \t]*\\(.*\\)"))
    27862800          ;; then: help completion
    27872801          (if singular-help-topics-alist
     
    36333647  (singular-prompt-init)
    36343648
    3635   ;; other input or output filters
    3636   (add-hook 'singular-post-output-filter-functions
    3637             'singular-remove-prompt-filter nil t)
    3638 
    36393649  ;; Font Lock mode initialization for Emacs.  For XEmacs, it is done at
    36403650  ;; singular.el loading time.
     
    36523662
    36533663;;{{{ Starting singular
     3664(defcustom singular-same-window t
     3665  "*Specifies how to open the window for Singular sessions.
     3666If this variable equals t, Singular comes up in the selected window.
     3667If this variable equals nil, Singular comes up in another window.
     3668If this variable equals neither t nor nil, the standard Emacs behaviour to
     3669open the window is adopted (which very much depends on the settings of
     3670`same-window-buffer-names')."
     3671  :initialize 'custom-initialize-default
     3672  :type '(choice (const :tag "This window" t)
     3673                 (const :tag "Other window" nil)
     3674                 (const :tag "Default" default))
     3675  :group 'singular-interactive-miscellaneous)
     3676
    36543677(defcustom singular-start-file "~/.emacs_singularrc"
    36553678  "*Name of start-up file to pass to Singular.
     
    37233746
    37243747(defvar singular-name-last singular-name-default
    3725   "provess name of the last Singular command used.
     3748  "process name of the last Singular command used.
    37263749
    37273750This variable is buffer-local.")
     
    38713894    ;; pop to buffer
    38723895    (singular-debug 'interactive (message "Calling `pop-to-buffer'"))
    3873     (singular-pop-to-buffer singular-same-window buffer)))
     3896    (singular-pop-to-buffer singular-same-window buffer))
    38743897
    38753898  ;; Set buffer local singular-*-last-values
     
    39463969                     singular-name-last))
    39473970
    3948 (defun singular-other ()
     3971(defun singular-other (executable directory switches name)
    39493972  "Run an inferior Singular process.
    39503973Starts a Singular process, with I/O through an Emacs buffer.
Note: See TracChangeset for help on using the changeset viewer.