Can not run REPL sml-mode in Emacs (Mac) - macos

System: El Capitan v10.11.15
Installed Emacs and smlnj
which smlnj gives me: /usr/local/bin/sml
adjusted my .bash_profile : export PATH="$PATH:/usr/local/bin/sml"
and .emacs to :
(setenv "PATH" (concat "/usr/local/bin/sml:" (getenv "PATH")))
(setq exec-path (cons "/usr/local/bin/sml" exec-path))
and now when I do C-c C-s on sml file it gives me:
Searching for program: no such file or directory!
Any one can help me?

Assuming you have used homebrew or similar to install emacs and sml.
A few things to watch out for
Your PATH environment should be a list of directory paths, not file paths i.e.
export PATH=$PATH:/usr/local/bin
in your .bash_profile. Note that PATH settings should go in bash_profile rather than .bashrc. The difference is that bash_profile is sourced once on login while bashrc is sourced for every interactive shell, so it is good to keep bashrc as small as possible. However, with the path setting, there is another 'gotcha' if you plan to run emacs from launchpad because launchpad does not source your bash_profile OR bashrc file.
There are various ways to get environment settings into luanchpad configs, but the easiest solution for the PATH setting is to just add /usr/local/bin tot the global environment. Easiest way to do this is to just add /usr/local/bin on a line in the /etc/paths file (you will need to use sudo to edit that file).
There is a vary useful emacs ELPA package called exec-path-from-shell which makes setting up the exec path stuff vary easy. Recommend installing that package. There are some other useful OSX specific packages in the melpa archives which you may also find useful for improving Emacs and OSX integration.

Mon Jan 2 16:44:47 GMT 2017
[Can't add a comment as just shy of 50 reputation points.]
A few details that were left out in the info provided:
$PATH and exec-path need directories - not the file name to the sml binary.
export PATH=$PATH:/usr/local/bin
It would be better to put this in .bashrc (so it is available in a newly started shell)
What version of emacs
What version of smlnj
What related sml packages do you have installed?
Is an sml related mode active when the file is opened?
Does the file have the correct extension that will activate an sml mode?
What is C-c C-s bound to? [I've got tuareg installed and C-c C-s is bound to run utop]
A point of note - which smlnj should produce smlnj not found. (which sml will produce /usr/local/bin/sml)

Related

How can I set up correctly malabar- mode in emacs?

I been trying to install malabar mode in emacs, and I saw that I should have installed maven. Well, the problem is that I currently installed malabar-mode and already put the load path.
;;Malabar mode
(require 'cedet)
;(semantic-load-enable-minimum-features) ;; or enable more if you wish ---(I don't know the function of this line but doesn't let me start emacs correctly)
(require 'malabar-mode)
(setq malabar-groovy-lib-dir "~/.emacs.d/elpa/malabar-mode-20140303.946")
(add-to-list 'auto-mode-alist '("\\.java\\'" . malabar-mode))
I don't know what is the load path of "malabar-groovy-lib-dir".
The malabar commands are available when emacs starts but when I call for example:
malabar-compile-file
In the minibuffer says:
searching for program: does not exist the file or directory, mvn
I've already installed maven and exported the load path for execute in terminal.
So I don't know how to set up correctly malabar-mode.
Also there is not much information about it.
somebody can help me?

package-refresh-contents hangs at Contacting host: elpa.gnu.org:80

I'm running Emacs 24.4 for Windows (installed through Chocolatey) and trying to install CIDER.
When I run M-x package-install [RET] cider [RET], I get [No match]. When I run M-x package-refresh-contents [RET], it hangs on Contacting host: elpa.gnu.org:80.
~/.emacs.d is populated with the GitHub repo recommended by braveclojure.com (here). I've reinstalled Emacs and I'm still getting the same problem.
I had this same problem on emacs ELPA wiki they say to set un ELPA you have to modify the emacs init file located at ~/.emacs or _emacs or ~/.emacs.d/init.el for me it was ~/.emacs-live.el since I have this version.
I just updated that file with the following:
(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
("marmalade" . "http://marmalade-repo.org/packages/")
("melpa" . "http://melpa.org/packages/")))
Seems that I needed the configuration from where ELPA is going to look for packages.
After that i just ran M-x package-refresh-contents [RET] and M-x package-install [RET] cider [RET] that installed cider.
This guide fixed it for me: http://www.lonecpluspluscoder.com/2015/08/adding-tls-support-to-emacs-24-5-on-windows/
Basically go to: http://sourceforge.net/projects/ezwinports/files/, grab the gnutls library and just uncompress the archive at the root of your Emacs directory.
Afterwards, doing list-packages became near-instant for me. Using Emacs 24.5.1.
I had the same problem with Emacs 24 in Ubuntu 16.04 and nothing seemed to solve the problem. Finally, installing Emacs 25 solved the problem.
New Emacs packages are available here
sudo add-apt-repository ppa:kelleyk/emacs
sudo apt-get update
apt-get install emacs27
The problem is that the ELPA package signing key has expired. A new Emacs version will include a new key. Note that currently (2020 Oct) there is Emacs 27 available for Ubuntu 16.04.
Also make sure that you use https urls (and not plain http).
Another possibility may be to install new keys to an older Emacs version.
Windows binaries may also be available somewhere.
Other than setting up your package archives, like a previous answer mentions (FWIW I'm using HTTPS directly)
(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "https://melpa.org/packages/")))
one might encounter another problem but with the same symptom of getting stuck at "Contacting host" due to running gpg in batch mode to verify the packages, but needing some input. You can disable that via
(setq package-check-signature nil)
Stack Overflow sometimes deletes chats. Fortunately it seems like I've still got access to a read-only version of the transcript.
From my perspective we didn't get a satisfactory answer. Here are the highlights:
We determined that the variable package-archives contained only GNU ELPA.
After discovering this, the OP wrote
I edited the package.el file. It works!
I suggested that editing a core Emacs Lisp file is not a good solution, but didn't hear anything back from the OP.
Since the referenced init.el file tries to add MELPA, I think there's something else going on. Perhaps the .emacs.d/ directory is in the wrong location, for example.
Editing package.el is certainly not a good solution. Doing more work to determine why the config isn't being properly loaded would be a good approach.
I have faced this issue on Emacs 24.5.1.
I searched here in SO and outside SO, nothing worked for me. I had to circumvent the problem by installing a newer version of Emacs: emacs25.

Emacs 24: Unable to find theme file for `solarized-dark.

I am on Mac 10.9.5 using Emacs 24.4
Following the instruction in here: https://github.com/sellout/emacs-color-theme-solarized , I downloaded the emacs-color-theme-solarized directory and added it to my Emacs custom-theme-load-path. That directory (Emacs was installed with Macports) looks like this :
ls /opt/local/share/emacs/24.4/etc/themes/
adwaita-theme.el light-blue-theme.el tsdh-dark-theme.el
deeper-blue-theme.el manoj-dark-theme.el tsdh-light-theme.el
dichromacy-theme.el misterioso-theme.el wheatgrass-theme.el
emacs-color-theme-solarized tango-dark-theme.el whiteboard-theme.el
leuven-theme.el tango-theme.el wombat-theme.el
where emacs-color-theme-solarized is the directory. Then I added (load-theme 'solarized-dark t) to my .emacs file and when I re-initiate emacs I get the error: Unable to find theme file for 'solarized-dark .
I have tried to move all file within the emacs-color-theme-solarized directory directly into the /opt/local/share/emacs/24.4/etc/themes/ directory, so that:
ls /opt/local/share/emacs/24.4/etc/themes/
LICENSE leuven-theme.el tango-dark-theme.el
README.md light-blue-theme.el tango-theme.el
adwaita-theme.el makepkg.sh tsdh-dark-theme.el
color-theme-solarized-pkg.el manoj-dark-theme.el tsdh-light-theme.el
color-theme-solarized.el misterioso-theme.el wheatgrass-theme.el
deeper-blue-theme.el solarized-dark-theme.el whiteboard-theme.el
dichromacy-theme.el solarized-definitions.el wombat-theme.el
emacs-color-theme-solarized solarized-light-theme.el
follow the same process and obtained the same result. Finally, I read here: Emacs 24 Package System Initialization Problems that a possible solution is adding the following two lines at the beginning of my .emacs file:
(setq package-enable-at-startup nil)
(package-initialize)
So I did and obtained the same result. Even loading the theme manually: load-theme and then solarized-dark is not solving the issue. It seems like any changes done to that directory are ignored by .emacs.
By the way, I also tried to add (add-to-list 'load-path " /opt/local/share/emacs/24.4/etc/themes") to my .emacs file as well as (add-to-list 'load-path " ~/emacs.d/themes"), and it was, also, unsuccessful.
In case is of any use, any of the themes that come with the instalation, e.g (load-theme 'tsdh-dark t), work perfectly
Any ideas of how to solve this issue for the solarized theme?
thanks and happy new year!
Emacs 24 includes package.el, and I strongly recommend using that to install packages whenever possible. Versions of the Solarized theme are available from MELPA Stable, MELPA, and Marmalade.
If you haven't used any of these package repositories yet, you'll need to add one by putting something like this in your init file:
(require 'package)
(package-initialize)
(add-to-list 'package-archives
'("melpa-stable" . "http://stable.melpa.org/packages/") t)
Then use M-x package-list-packages, search for color-theme-sanityinc-solarized, mark it for installation with i and then install marked packages with x. I find this package list interface very handy for discovering new packages.
Packages installed this way generally go into ~/.emacs.d/elpa/, e.g. ~/.emacs.d/elpa/color-theme-solarized-2.27/. This should automatically be added to your custom-theme-load-path, which is required for load-theme to work.
Note that this particular version includes two themes prefixed with the package maintainer's name, so you'll have to do something like
(load-theme 'sanityinc-solarized-dark) ; or
(load-theme 'sanityinc-solarized-light)
to make the theme load. Interactively, load-theme supports tab completion, which is probably the best way to see what installed themes are actually called.
As an aside, you might also want to look into tools for automating the package.el install process, which is especially handy if you work on multiple machines.

where do I install custom completions for a python command line script on OSX

In the bash-completions read me it states:
Q. I author/maintain package X and would like to maintain my own
completion code for this package. Where should I put it to be sure
that interactive bash shells will find it and source it?
Install it in one of the directories pointed to by
bash-completion's pkgconfig file variables. There are two
alternatives: the recommended one is 'completionsdir' (get it with
"pkg-config --variable=completionsdir bash-completion") from which
completions are loaded on demand based on invoked commands' names,
so be sure to name your completion file accordingly, and to include
for example symbolic links in case the file provides completions
for more than one command. The other one which is present for
backwards compatibility reasons is 'compatdir' (get it with
"pkg-config --variable=compatdir bash-completion") from which files
are loaded when bash_completion is loaded.
However, on OS X after installing bash-comletion via homebrew this doesn't work:
pkg-config --variable=completionsdir bash-completion
Package bash-completion was not found in the pkg-config search path.
Perhaps you should add the directory containing `bash-completion.pc'
to the PKG_CONFIG_PATH environment variable
No package 'bash-completion' found
How/where would I install custom completions for a command line script I've written and will install via pip?
use echo $BASH_COMPLETION in the terminal to get where the bash completion are installed
if you used homebrew it's most likely in /usr/local/etc/bash_completion.d/

auctex and emacs on mac

What I'd like is to be able to use emacs and auctex successfully.
Some system information:
ProductName: Mac OS X
ProductVersion: 10.8.5
BuildVersion: 12F45
Emacs
Version 24.3 (9.0)
AUCTeX-version is a variable defined in `tex-site.el'.
Its value is "11.87"
There's two things that I've tried. First, installing auctex interactively from within emacs as recommended:
M-x package-list-packages RET
On the surface things seem to be working as expected:
\documentclass{article}
\bein{document}
Hello world
\section{Here lies a section}
Hello people.
\end{doument}
You can't see it in the code, but on my emacs screen the syntax highlighting is working, and the auctex icons are visible. Also environment completion commands work expected (like filling in \begin and \figure stuff). Now issuing the compile command:
C-c C-c
I get the following message:
LaTeX: problems after [0] pages
looking at the source there is two mistakes that are not picked up, furthermore it seems like the document is not even compiled even if there are no mistakes, there is no dvi or pdf or aux files created. Also testing the viewing functional, nothing happens. So it seems like something isn't configured properly.
Second, without uninstalling or removing auctex (which I suspect could have to do with something but I'm not sure as we'll see later) I found the webpage: http://algorithmicallyrandom.blogspot.com/2012/08/getting-auctex-working-on-mac-os-x.html That recommends building from source:
*) ./configure --with-emacs=/Applications/Emacs.app/Contents/MacOS/Emacs --disable-preview --with-lispdir=/Applications/Emacs.app/Contents/Resources/site-lisp/
*) make
*) sudo make install
Then add these lines to your .emacs file
(load "auctex.el" nil t t)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode)
(add-hook 'LaTeX-mode-hook 'flyspell-mode)
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
Something that makes me think this installation was successful is the source I downloaded is for version 11.87 and thats the version of auctex that I'm currently running. However, the same behavior continues, basically none of the compiling or viewing functionality seems to be working.
Another thing, from reading around it seems like you also need the preview-latex.el package, when including it in my .emacs file
(load "preview-latex.el" nil t t)
I get an error so I'm pretty sure that package isn't installed properly. So my question is mainly, what am I missing here? How can I successfully run emacs and auctex (and maybe the preview-latex.el package also) together?
Maybe this includes removing auctex completely and installing it again. How do I remove an emacs package when I installed it interactively (try one)? How do I remove the emacs package when I installed it from source (try two)?
Also its possible that I haven't installed ghost script but I'm not sure how to check.
Man, I know this is a lot, I'm trying to provide any information that is required. If you've waded through this and can help me I'd be so grateful.
You may need to configure emacs to recognize shell path. To do that, simply install exec-path-from-shell package. There is some help from the following link.
PATH and exec-path set, but emacs does not find executable
A comment from #lawlist helped me:
Do you have texbin in your $PATH? If not, you could add this inside
your .emacs or init.el file:
(setenv "PATH" (concat (getenv "PATH") ":/usr/texbin"))

Resources