简体   繁体   中英

cannot open Singular on a running emacs

I am a newbies in Singular. I just downloaded Singular4-0-2_64.dmg, mounted the image, right-ckick, show the package contents, then moved the contents folder to the Applications directory. double-clicking Contents/MacOS/Singular (or Esingular) I have Singular running in a terminal (or via emacs in a terminal). But when I try Mx singular in a running emacs, it says "cannot open load file : no such file or directory, singular".

Then I copied .emacs-general and .emacs-singular to the home directory. Adding the following lines to .emacs

(setq load-path (cons "" load-path)) (autoload 'singular "singular" "Start Singular using default values." t) (autoload 'singular-other "singular" "Ask for arguments and start Singular." t)

changing singular-emacs-home-directory into /Applications/Singular.app/Contents/share/singular/emacs/ it still doesn't work. Also when I replace .emacs with .emacs-singular, replacing the above directory, it gives the error: Warning (initialization): An error occurred while loading `/Users/Me/.emacs':

Symbol's value as variable is void: /Applications/Singular.app/Contents/share/singular/emacs

Am I not finding the right singular-emacs-home-directroty or is there any other problem?

I appreciate your help.

Also I must mention that I am a user of emacs for Macaulay2. For that I have changed .emacs and .emacs-Macaulay2 in order to teach emacs where to look for M2. Is there anything similar to be done for Singular? Shall I have a file .emacs-singular somewhere?

Thanks for your help.

Here are some basic settings that assume the Singular.app has been installed to the /Applications folder. I chose to set the absolute path to the executable, instead of setting the PATH in Emacs. The PATH in Emacs on OSX is (by default) not the same as what one would generally except to see in let's say Terminal.app. [But, setting the PATH is beyond the scope of this basic answer.]

My personal preference is to have all of the lisp and configuration files in a custom directory for purposes of editing and backup up. This limited example just leaves everything where they are.

In the Emacs master branch (February 7, 2016), there is no built-in variable named current-menubar -- the configuration files are looking for the existence of that variable. I did not spend the time to debug the built-in configuration files to find out what version of Emacs they were designed for, and I did not spend the time to make the Singular elisp libraries compatible with the latest Emacs master branch.

Add the following lines of code to the .emacs file in the home directory, save the file, and restart Emacs. Then type Mx singular RET

(add-to-list 'load-path "/Applications/Singular.app/Contents/share/singular/emacs/")
(require 'singular)
(setq singular-emacs-home-directory "/Applications/Singular.app/Contents/share/singular/emacs/")
(defvar current-menubar nil)
(setq singular-executable-default "/Applications/Singular.app/Contents/MacOS/Singular")
(load-file "/Applications/Singular.app/Contents/share/singular/emacs/.emacs-general")
(load-file "/Applications/Singular.app/Contents/share/singular/emacs/.emacs-singular")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM