Sml Mode In Emacs For Mac

broken image


Table of Contents

  • For use within Emacs
  • For use outside Emacs
    • org-mac-protocol – create links and remember notes from a variety of OS X applications

Assorted hacks to interact with org-mode whilst working with OS Xapplications other than Emacs…

Edit a file with extension.sml. You should be in SML-mode, using Tab to indent your code well. To open the SML/NJ REPL within Emacs, type C-c C-s (and then Enter to accept the sml interpreter) while working in an SML-mode buffer. This command creates an.sml. buffer unless one exists and starts an SML/NJ REPL in that buffer unless one is.

For use within Emacs

Pull information from other applications into org-mode.

To open the SML/NJ REPL within Emacs, type C-c C-s(and then Enterto accept the smlinterpreter) while working in an SML-mode buffer. This command creates an.sml.buffer unless one exists and starts an SML/NJ REPL in that buffer unless one is already running there. Type this key sequence works onlyin SML-mode buffers (e.g., not.scratch.). For more inspiration and examples, look into the source of the Emacs starter configurations such as the ones found here. Installing individual Emacs Lisp files. Some Emacs Lisp libraries or configuration snippets not available as packages. To install them, see LoadPath. Configuring packages. SML Mode is an extension to Emacs that is not Emacs itself or SML/NJ itself. It displays SML code nicely with syntax coloring and clean indentation, and provides a way to run SML from within Emacs.1. Sml-mode doesn't know you're about to write then (because it doesn't pay attention to types or even distinguishes between variables and numbers), so it presumes you might be about to write an argument that you might pass to the function 0 we know 0 can't be a function, but sml-mode doesn't, so it indents to the place where this hypothetical argument would be written.

org-mac-iCal – import OS X iCal.app events into Emacs diary

org-mac-link – Hyperlink to items in mac applications

grab the current link or selection from an open mac application andinsert it as a hyperlink at point in an org-mode document. Writtenby Anthony Lander.

For use outside Emacs

Push information from the current application into org-mode.

org-mac-protocol – create links and remember notes from a variety of OS X applications

Written by Christopher Suckling.Address Book support by Alexander Poslavsky.

A suite of scripts that allow the user to annotate their org-modebuffers without switching focus from other OS X applications.

The following applications are currently supported:

  • Safari, including links to multiple tabs
  • Mail
  • Address Book
  • Pages
  • Numbers
  • Finder
  • Terminal

Obtaining

A git repository, together with full documentation, can be found at http://github.com/claviclaws/org-mac-protocol.

org-mac-maillink – linking to messages in OS X Microsoft Entourage app

A short Applescript/terminal hack that allows the user to create a link to amessage from within the Microsoft Entourage application andpaste it directly into an Org-mode file. The link uses the email'ssubject line as its description.Written by Matt Strickland.

alfred-org-capture - Use Alfred to run org-capture

Use Alfred to call up org-capture from only a couple key strokesWritten by JJ Asghar. With acknowledged work by Haider Rizvi,Robert P. Goldman, Alan Schmitt, Alexander Baier, and Damon Haley

Haskellers are not exactly blessed with an abundance of IDEs. After trying Vim, Atom and Haskell for Mac I converged on Emacs with the Intero package. First let's run through a selection of alternatives that all have great features but are each lacking in some particular way.

Haskell for Mac

Haskell for Mac was nice while I was learning Haskell basics, but it's not adequate for larger projects because the .cabal file inside the project folder can't be edited and it doesn't allow for multiple executables, or any custom project structure. On the upside, no other tool I've seen integrates the REPL as nicely as Haskell for Mac does. For beginners, this is a very good choice.

Emacs C++ Mode

Vim

I struggled to configure Vim until I discovered Haskell-Vim-Now, which promises that 'in less than ten minutes your Vim will transform into a beautiful Haskell paradise'. I had some problems with the installation but these were resolved quickly thanks to very dedicated maintainers.
(See Issue #199 of Haskell-Vim-Now and Issue #63 of the Haskell codex package)

My remaining grief with Vim is the speed of type lookups and linter runs (Issue #201).

Atom

In general I really like Atom, and after some fiddling with path settings, it worked very well. What I don't like about Atom for Haskell is that the REPL isn't that well integrated, yet. The IDE-Haskell REPL package is in beta and currently offers a rather minimal interface into ghci.

Emacs

A hassle-free, complete, one-stop solution is Intero for Emacs, and this is what is described here. It's really straightforward and does all the things you'd want, such as:

  • syntax highlighting etc.
  • ghci backend
  • type checking
  • type identification
  • auto-complete
  • Haskell stack based

First, lets' pick a theme. Here's a reminder of how to do that in Emacs:

for theme-name plug in any theme available in MELPA, such as dracula or atom-dark (see below). Then make a theme the default with this line in .emacs:

The default font size is set as follows:

where the value is 1/10pt. (See Q on stackexchange.)

Nice themes

  • https://draculatheme.com/emacs/. Name is dracula.
  • https://github.com/whitlockjc/atom-dark-theme-emacs. Name is atom-dark.

Fonts

A nice list of monospace fonts for programming is at narga.net.

To set the font use this:

This Q on stackexchange has more info.

Intero for emacs

Intero is a complete interactive development program for Haskell

Follow the instructions here: http://commercialhaskell.github.io/intero/.

Default key bindings:

Key bindingDescription
M-. Jump to definition
C-c C-i Show information of identifier at point
C-c C-t Show the type of thing at point, or the selection
C-u C-c C-t Insert a type signature for the thing at point
C-c C-l Load this module in the REPL
C-c C-r Apply suggestions from GHC
C-c C-k Clear REPL
C-c C-z Switch to and from the REPL

Why does C-c C-l start the session, not the process?

Don't use emacs' haskell-session-, instead use haskell-process-: Harbor breeze ceiling fan remote reser.

CommandDescription
haskell-process-cabalPrompts for a Cabal command to run
haskell-process-cabal-buildBuild the Cabal project
haskell-process-cdChange directory
haskell-process-restartRestart the inferior Haskell process
haskell-process-clearClear the current process
haskell-process-reloadReload the current buffer file
haskell-process-load-fileLoad the current buffer file

Here's how this looks in action:

Helm

Helm is an incremental completion and selection narrowing framework for Emacs. Cannot delete section break next page word for mac.

Right now I only have this in my init.el:

What I get is a nicer C-x b for switching between buffers.

hindent

Mac

and add this to the init.el: The thing 1982 full movie.

Install hindent emacs package.
Then, by calling M-q, you can reformat the current declaration.

flymake-haskell-multi

https://github.com/purcell/flymake-haskell-multi: no success.

company GHC

https://github.com/iquiw/company-ghc: no success

manage emacs packages

Install Emacs Mac

actiondescription
M-x package-list-packageslist available packages
M-x package-refresh-contentsrefresh list of packages
Emacs c++ mode

and add this to the init.el: The thing 1982 full movie.

Install hindent emacs package.
Then, by calling M-q, you can reformat the current declaration.

flymake-haskell-multi

https://github.com/purcell/flymake-haskell-multi: no success.

company GHC

https://github.com/iquiw/company-ghc: no success

manage emacs packages

Install Emacs Mac

actiondescription
M-x package-list-packageslist available packages
M-x package-refresh-contentsrefresh list of packages

find init.el file:

M-: (find-file user-init-file)

See this Q on stackexchange for a review of the different Emacs versions on Mac OS X, and how to best compile Emacs using Homebrew on Mac:





broken image