See here.
Tag: Ide
Calling Java Under Cygwin
While trying to set up Clojure under Cygwin I found that doing mixed-mode between Cygwin and Java isn’t very happy due to the ‘;’ vs ‘:’ in the classpath.
This post (via this post) provided an obfuscated Ruby program to take care of that for you… thanks!
#!/bin/ruby
# Slightly obfuscated cygwin + windows java wrapper, automate cygpath
cpi = ARGV.index("-cp") + 1
cp = ARGV[cpi] if cpi
XBCP = "-Xbootclasspath/a:"
xbcpi = ARGV.index{|i|i=~/^#{XBCP}.*/}
xbcp = ARGV[xbcpi] if xbcpi
if cp or xbcpi
def convert_paths(paths)
paths = paths.gsub(':', ';').split(';')
paths.map{|p|`cygpath -aw #{p}`.strip}.join ';'
end
ARGV[cpi] = convert_paths(cp) if cp
ARGV[xbcpi] = XBCP + convert_paths(xbcp.sub(XBCP, '')) if xbcp
end
java = '/cygdrive/c/Program Files/Java/jdk1.6.0_18/bin/java'
cmd = .concat ARGV
def e(s); "\"#{s.strip.gsub('"','\"')}\""; end
exec(cmd.map{|a|e a}.join(' '))
DrScheme Style Buffer Evaluation for OCaml in Emacs
When you want to evaluate code inside of DrScheme, you hit the F5 key and the entire editor buffer gets evaluated inside of a new REPL. Unlike Emacs, the ability to send the current expression, region, or buffer to the REPL isn’t available. It might sound constricting, but in practice it is very nice because you are always working with the most up-to-date versions of your definitions. It might sound slow to start a new REPL on each run, but it isn’t; on my older desktop the new REPL comes up before my finger even comes off of the F5 key. This approach seemed like a nice to have for working with OCaml in Tuareg mode on Emacs, so I pieced together a function to do so against Tuareg 1.45.6:
(defun tuareg-eval-buffer-drscheme-style ()
"Send the buffer to a brand new Tuareg Interactive process."
(interactive)
(tuareg-kill-caml)
(sleep-for 0.25)
(if (get-buffer tuareg-interactive-buffer-name)
(kill-buffer tuareg-interactive-buffer-name))
(tuareg-eval-buffer)
(switch-to-buffer tuareg-interactive-buffer-name))
Out of the box Tuareg mode will ask you what program name to run to start OCaml each and every time you evaluate the buffer, even when the variable storing that name is defined. I didn’t find a way to avoid this prompt so I patched Tuareg such that it will not ask you if a value is already defined for the program name. Here is the patch.
Thus far it has been nice to have the option of evaluating the whole buffer in a new REPL in addition to the existing incremental evaluation options.
Tuareg mode has new maintainers
Emacs 23.2 is out
Display names of defined colors and show what they look like in Emacs
The ‘list-colors-display’ function call displays a list of colors, how they look, and their RGB names in its own window.
(via Got Emacs?)
Russian and Ukrainian localization files for DrScheme
Here is a link to a post on plt-dev about Russian and Ukrainian localization files for DrScheme.
They live here: russian-string-constants.ss and ukrainian-string-constants.ss.
ParEdit for Editing Lispy Languages
ParEdit (paredit.el) is a minor mode for performing structured editing of S-expression data. The typical example of this would be Lisp or Scheme source code.
ParEdit helps keep parentheses balanced and adds many keys for moving S-expressions and moving around in S-expressions.
That quote from EmacsWiki really undersells Paredit, though.
Paredit makes it virtually impossible to un-balance parentheses (aka round, square, and curly brackets).
This mode would be especially interesting for folks avoiding Lisp because of the nightmare of balancing parentheses is too much of an obstacle to overcome (in practice of course it really isn’t, even if you don’t use Paredit).
A Review of Scheme Modes in Emacs
Here is a nice review of Scheme modes for Emacs.
Adding Unicode Fonts to Windows
Today I set up pretty-mode.el and found that the laptop had all of the Unicode fonts but the desktop did not. I ended up installing Arial Unicode MS as suggested by unicode.org, and that installed all of the missing fonts.
If you have Microsoft Office 2000 and newer versions, you can get the Arial Unicode MS font, which is the most complete. To get it, insert the Office CD, and do a custom install. Choose Add or Remove Features. Click the (+) next to Office Tools, then International Support, then the Universal Font icon, and choose the installation option you want.