{"action":"opened","issue":{"url":"https://api.github.com/repos/Singular/Sources/issues/746","repository_url":"https://api.github.com/repos/Singular/Sources","labels_url":"https://api.github.com/repos/Singular/Sources/issues/746/labels{/name}","comments_url":"https://api.github.com/repos/Singular/Sources/issues/746/comments","events_url":"https://api.github.com/repos/Singular/Sources/issues/746/events","html_url":"https://github.com/Singular/Sources/issues/746","id":131971831,"number":746,"title":"cannot open Singular on a running emacs","user":{"login":"rahkooy","id":3108916,"avatar_url":"https://avatars.githubusercontent.com/u/3108916?v=3","gravatar_id":"","url":"https://api.github.com/users/rahkooy","html_url":"https://github.com/rahkooy","followers_url":"https://api.github.com/users/rahkooy/followers","following_url":"https://api.github.com/users/rahkooy/following{/other_user}","gists_url":"https://api.github.com/users/rahkooy/gists{/gist_id}","starred_url":"https://api.github.com/users/rahkooy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rahkooy/subscriptions","organizations_url":"https://api.github.com/users/rahkooy/orgs","repos_url":"https://api.github.com/users/rahkooy/repos","events_url":"https://api.github.com/users/rahkooy/events{/privacy}","received_events_url":"https://api.github.com/users/rahkooy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-07T14:26:27Z","updated_at":"2016-02-07T14:26:27Z","closed_at":null,"body":"Here is my .emacs file content:\r\n(setq load-path (cons \"</Applications/Singular.app/Contents/share/singular/emacs/>\" load-path))\r\n(autoload 'singular \"singular\"\r\n  \"Start Singular using default values.\" t)\r\n(autoload 'singular-other \"singular\"\r\n  \"Ask for arguments and start Singular.\" t)\r\n\r\n(load-file \"~/.emacs-general\")\r\n\r\nAlso I've tried to modify .emacs-singular and replace it with .emacs; stil no success. Here is the modified .emacs-singular:\r\n;;; Emacs edit mode for this file is  -*- Emacs-Lisp -*-\r\n\r\n;;;\r\n;;; .emacs-singular - Emacs initialization file to use for\r\n;;;                   Singular interactive mode.\r\n;;;\r\n;;; If you run ESingular, then this file is loaded instead of the\r\n;;; default ~/.emacs initialization file.\r\n;;;\r\n;;; How you use this file very much depends on your attitude\r\n;;; towards Emacs:\r\n;;;\r\n;;; 1) If you are going to use Emacs solely as frontend to\r\n;;;    Singular you do not have to worry at all about this file.\r\n;;; 2) If you are already an experienced Emacs user you may\r\n;;;    want to copy this file's contents to your .emacs file.\r\n;;; 3) If you are planning to become an experienced Emacs user\r\n;;;    you may use this file as starting point for your .emacs\r\n;;;    file, that is, for your Emacs initialization file.  Simply\r\n;;;    copy it to your home directory and rename it to \".emacs\"\r\n;;;    (without the quotes, of course).  Then edit it as\r\n;;;    described below.\r\n;;;\r\n;;; In cases 2) and 3) you should be careful what exactly to copy\r\n;;; to your .emacs file.  In general, you need the following:\r\n;;;\r\n;;; o the hook-customizations with `add-hook';\r\n;;; o the pre-customized settings with `custom-set-variables' and\r\n;;;   `custom-set-faces';\r\n;;; o the code which creates menus for starting Singular;\r\n;;; o the code which loads singular.el (located at the end of\r\n;;;   this file) you have to replace by something else, for\r\n;;;   example, an `autoload'.\r\n;;; o the code which is in .emacs-general\r\n;;;\r\n;;; Here is how the Singular customization in your .emacs may\r\n;;; look like:\r\n;;;\r\n;;; ;; extra key bindings\r\n;;; (add-hook 'singular-interactive-mode-hook\r\n;;;            <... code omitted, see below for details ...>)\r\n;;;\r\n;;; ;; other, \"non-customizable\" settings\r\n;;; (add-hook 'singular-interactive-mode-hook\r\n;;;            <... code omitted, see below for details ...>)\r\n;;;\r\n;;; ;; pre-customized settings\r\n;;; (custom-set-variables\r\n;;;  <... code omitted, see below for details ...>)\r\n;;; (custom-set-faces\r\n;;;  <... code omitted, see below for details ...>)\r\n;;;\r\n;;; ;; add global menus for Singular\r\n;;; <... choose your version for either Emacs or XEmacs, see below ...>\r\n;;;\r\n;;; ;; add Singular toolbar for XEmacs\r\n;;; <... insert the code below if you are running XEmacs ...>\r\n;;;\r\n;;; ;; add Singular Emacs home directory to `load-path'\r\n;;; (setq load-path (cons \"<your-singular-emacs-home-directory>\" load-path))\r\n;;; (autoload 'singular \"singular\"\r\n;;;   \"Start Singular using default values.\" t)\r\n;;; (autoload 'singular-other \"singular\"\r\n;;;   \"Ask for arguments and start Singular.\" t)\r\n;;;\r\n\r\n;; extra key bindings\r\n(add-hook 'singular-interactive-mode-hook\r\n\t  (function (lambda ()\r\n\t\t      ;; control cursor keys\r\n\t\t      (cond\r\n\t\t       ;; Emacs\r\n\t\t       ((eq singular-emacs-flavor 'emacs)\r\n\t\t\t(local-set-key [C-prior] 'singular-scroll-right)\r\n\t\t\t(local-set-key [C-next] 'singular-scroll-left)\r\n\t\t\t(local-set-key [C-up] 'comint-previous-prompt)\r\n\t\t\t(local-set-key [C-down] 'comint-next-prompt))\r\n\t\t       ;; XEmacs\r\n\t\t       (t\r\n\t\t\t(local-set-key [(control prior)] 'singular-scroll-right)\r\n\t\t\t(local-set-key [(control next)] 'singular-scroll-left)\r\n\t\t\t(local-set-key [(control up)] 'comint-previous-prompt)\r\n\t\t\t(local-set-key [(control down)] 'comint-next-prompt))))))\r\n\r\n;; other, \"non-customizable\" settings\r\n\r\n;; put stuff here which should not be/only be executed under\r\n;; mswindows/unix\r\n(cond ((or (eq system-type 'cygwin32)\r\n\t   (eq system-type 'windows-nt))\r\n       ;; mswindows stuff\r\n\r\n       )\r\n      (t\r\n       ;; unix stuff\r\n\r\n       ;; lazy-lock seems to be broken under mswindows:\r\n       ;; causes delay of input (only reacts after mouse click), or even total\r\n       ;; hang\r\n       ;(add-hook 'font-lock-mode-hook 'lazy-lock-mode)\r\n       ;(setq font-lock-support-mode 'lazy-lock-mode)\r\n\r\n       ;; somewhat nicer scrolling This causes a core dump with 21.1.9\r\n       ;; under cygwin, when a file is opened with a button\r\n       ;; Fixed it with a simmple patch, by working around the\r\n       ;; assertion in file indent.c line 517 (or so). This was\r\n       ;; officially fixed in 21.1.10 -- still sometimes\r\n       ;; interactive windows disappeared. Hence, do not set it under\r\n       ;; Windows\r\n       (setq scroll-step 10)\r\n\r\n       )\r\n      )\r\n\r\n(add-hook 'singular-interactive-mode-hook\r\n\t  (function (lambda () (font-lock-mode 1))))\r\n\r\n;; turn on c++-mode for files ending in \".sing\" and \".lib\"\r\n(setq auto-mode-alist (cons '(\"\\\\.sing\\\\'\" . c++-mode) auto-mode-alist))\r\n(setq auto-mode-alist (cons '(\"\\\\.lib\\\\'\" .  c++-mode) auto-mode-alist))\r\n(add-hook 'c++-mode-hook\r\n\t  (function (lambda () (font-lock-mode 1))))\r\n\r\n\r\n\r\n;; this is a work-around for early version of Font Lock mode\r\n;; which do not use `defface' to define faces.  It forces\r\n;; `custom-set-faces' to define the faces immediately.\r\n(make-face 'font-lock-comment-face)\r\n(make-face 'font-lock-string-face)\r\n\r\n;; tricky stuff: these customization settings are not used any\r\n;; longer as soon as user saved her own to ~/.emacs-singular-cust\r\n(setq custom-file \"~/.emacs-singular-cust\")\r\n(if (file-exists-p custom-file)\r\n    (load-file custom-file)\r\n\r\n;; pre-customized settings\r\n(custom-set-variables\r\n '(mouse-yank-at-point t)\r\n '(font-lock-maximum-decoration t t)\r\n '(next-line-add-newlines nil)\r\n '(paren-mode (quote paren) nil (paren))\r\n '(show-paren-mode t nil (paren))\r\n '(singular-help-same-window t)\r\n '(singular-cursor-key-model (quote terminal))\r\n '(transient-mark-mode t)\r\n '(Info-button1-follows-hyperlink t)\r\n '(singular-section-face-alist (quote ((input . singular-section-input-face) (output)))))\r\n\r\n(custom-set-faces\r\n '(info-xref ((t (:foreground \"blue\" :bold t))))\r\n '(info-node ((t (:foreground \"blue\" :bold t :italic t))))\r\n '(show-paren-match-face ((((class color)) (:foreground \"Red\"))))\r\n '(font-lock-variable-name-face ((t (:foreground \"black\"))) t)\r\n '(paren-match ((t (:foreground \"Red\"))) t)\r\n '(singular-section-input-face ((t (:bold t))))\r\n '(font-lock-string-face ((((class color) (background light)) (:foreground \"green4\"))))\r\n '(font-lock-doc-string-face ((((class color) (background light)) (:foreground \"green4\"))))\r\n '(font-lock-keyword-face ((t (:bold t :foreground \"violet\"))) t)\r\n '(singular-section-output-face ((t (:bold nil))))\r\n '(font-lock-type-face ((t (:bold t :foreground \"violet\"))) t)\r\n '(font-lock-comment-face ((t (:bold nil :foreground \"Red\"))) t)\r\n '(font-lock-function-name-face ((t (:bold t :foreground \"blue3\"))) t))\r\n '(info-xref ((t (:foreground \"blue\" :bold t))))\r\n '(info-node ((t (:foreground \"blue\" :bold t :italic nil))))\r\n;; obachman: played around a little bit, found this better\r\n;;  '(singular-section-input-face ((t (:bold t))))\r\n;;  '(singular-section-output-face ((t (:bold nil))))\r\n;;  '(font-lock-comment-face ((t (:bold nil :foreground \"Grey30\"))) t)\r\n;;  '(font-lock-string-face ((((class color) (background light)) (:foreground \"Blue\")) (((class color) (background dark)) (:foreground \"LightSkyBlue\"))) t)\r\n;;  '(paren-match ((t (:foreground \"Red\"))) t)\r\n;;  '(show-paren-match-face ((((class color)) (:foreground \"Red\")))))\r\n)\r\n\r\n;; update singular-emacs-home-directory\r\n(setq singular-emacs-home-directory\r\n      (concat \"/Applications/Singular.app/Contents/share/singular/emacs/\"\r\n\t      ;; we check for trailing slash and backslash\r\n\t      ;; but unconditionally insert a slash.\r\n\t      ;; Hopefully that works on NT, too.\r\n\t      (if (memq (aref \"/Applications/Singular.app/Contents/share/singular/emacs/\"\r\n\t\t\t      (1- (length \"/Applications/Singular.app/Contents/share/singular/emacs/\")))\r\n\t\t\t'(?/ ?\\\\))\r\n\t\t  \"\" \"/\")))\r\n\r\n;; add global menus for Singular, Emacs version\r\n(unless (fboundp 'add-submenu)\r\n  (setq singular-start-map (make-sparse-keymap))\r\n  (define-key singular-start-map [menu-bar singular]\r\n    (cons \"Singular\" (make-sparse-keymap \"Singular\")))\r\n  (define-key singular-start-map [menu-bar singular restart]\r\n    '(\"Start...\" . singular-other))\r\n  (define-key singular-start-map [menu-bar singular start-default]\r\n    '(\"Start default\" . singular))\r\n  (setq menu-bar-final-item (append '(singular) menu-bar-final-items))\r\n  (use-local-map singular-start-map))\r\n\r\n;; add global menus for Singular, XEmacs version\r\n(when (fboundp 'add-submenu)\r\n  (add-submenu nil\r\n\t       '(\"Singular\"\r\n\t\t [\"Start default\" singular t]\r\n\t\t [\"Start...\" singular-other t]))\r\n  (setq-default current-menubar current-menubar))\r\n\r\n;; add Singular button to toolbar for XEmacs\r\n;(if (fboundp 'toolbar-add-item)\r\n;    (toolbar-add-item\r\n;     (vector\r\n;      (toolbar-make-button-list (concat singular-emacs-home-directory\r\n;\t\t\t\t\t\"singular.xpm\"))\r\n;      'singular t \"Start Singular\")\r\n;     (length (specifier-instance default-toolbar))))\r\n;\r\n;;;\r\n;;; - load singular.el and .emacs-general\r\n;;;\r\n\r\n; get rid of superfluous \"Load .emacs\" menu entry on XEmacs\r\n(when (fboundp 'delete-menu-item)\r\n  (delete-menu-item '(\"Load .emacs\"))\t\t; that is for the current buffer\r\n  (let ((current-menubar (default-value 'current-menubar)))\r\n    (delete-menu-item '(\"Load .emacs\"))\t\t; that is for all other buffers\r\n    (set-default 'current-menubar current-menubar)))\r\n\r\n; load singular.el from `singular-emacs-home-directory'\r\n(load-file (concat singular-emacs-home-directory \"singular.el\"))\r\n\r\n; load .emacs-general from home or `singular-emacs-home-directory'\r\n(if (file-exists-p \"~/.emacs-general\")\r\n    (load-file \"~/.emacs-general\")\r\n  (if (file-exists-p (concat singular-emacs-home-directory \".emacs-general\"))\r\n      (load-file (concat singular-emacs-home-directory \".emacs-general\"))))"}}