Finding and using clojure.contrib.string - eclipse

I have CounterClockwise for Eclipse and believe clojure.contrib should be installed. However, I can't seem to use it or any of the subfiles such as clojure.contrib.string. If I type as I get the following errors
If I type (require 'clojure-contrib.string) I get:
FileNotFoundException Could not locate clojure_contrib/string__init.class or clojure_contrib/string.clj on classpath: clojure.lang.RT.load (RT.java:443)

Long ago in an internet far far away Clojure had a large utility library called clojure.contrib which turned out to be rather hard to maintain, so it was broken up into many libraries, each of which uses the Clojure contributors agreement. In this process clojure.contrib.string became just clojure.string and the names of all the other projects changed and they are released independently now. Seeing references to clojure.contrib is a sign that you are looking at outdated documentation. Also watch out for tutorials that make references to installing Clojure or installing dependencies without leiningen.

Related

There is no package named "CLACK.APP.DIRECTORY"

I am learning about Common Lisp and the Clack, following the tutorial:
http://clacklisp.org/tutorial/06-using-clack-app-directory.html
But in this chapter(Using Clack.App.Directory) I can't success, the SLIME prompts error: "There is no package named "CLACK.APP.DIRECTORY" "
But I followed all the steps in the tutorial, is there anything I missed? I am noob in lisp BTW.
The codebase changed much since version 1, and the tutorial is a little bit outdated. There is, however, a compatibility layer to that version.
(ql:quickload :clack-v1-compat)
Then, the appropriate packages are loaded and you should be able to continue the tutorial.

Installation of EclipseFP on Eclipse Luna (Mac OS X Yosemite)

I'm trying to get EclipseFP (Haskell support, but the original coder stopped maintaining it last month) working on my iMac but everything seems to fail constantly. I've been debugging this for hours now and like most other Haskell stuff there isn't much decent support out there regarding the installation of such tools. I haven't even written a single line of Haskell code yet (apart from some playing around in GHC/GHCI which surprisingly did work)!
I've tried so many things already, different libraries, different solutions, different versions etc. But it seems that everything that has to do with haskell support is just one big clutter of confusion for me and nothing seems to point me in an apparent direction which bothers me since I am an experienced programmer and dealing with command line interfaces, tools and dependencies isn't unknown to me on all sort of platforms for years now.
Even the most relevant topics on StackOverflow or other knowledgebases just won't cut it regarding this topic and I'm starting to feel like dropping the entire Haskell language and just use something which does play nice with the system without such troubles since it is already such a pain in the ass to get the most basic development tools to work, let alone the coding itself...
The things I got:
Mac OSX Yosmite
GHC
GHCI
Cabal (repository)
Eclipse Luna
I've installed EclipseFP using the install instructions which worked out all great. At this point I thought it would just all work without any problems as the plugin installs just fine...
Well, that was not the case of course. I've restarted Eclipse as it requested after installing new plugins. Here is where the trouble begun..
In the following steps I would have to open the Haskell Perspective in Eclipse. Well... guess what.. there was none! After strolling the web I found out that it might have compatibility issues with the old JDK 1.6 which was installed by default on MacOSX. No worries.. I've downloaded Java JDK 1.8, set it up in Eclipse, restarted it. And there the item "Haskell perpective" showed up in the list.
After clicking that, and thinking my troubles were over (and I could finally start coding!) nothing happend! I've searched around for a while and found the Eclipse error console which until this day gives me nothing more than:
An error occurred while automatically activating bundle net.sf.eclipsefp.haskell.ui (459).
org.eclipse.e4.core.di.InjectionException: java.lang.RuntimeException: org.eclipse.core.runtime.CoreException: Plug-in net.sf.eclipsefp.haskell.ui was unable to load class net.sf.eclipsefp.haskell.ui.HaskellPerspective.
Of course I have tried solving this issue and came across some dependencies which needed to be installed using cabal (BuildWrapper, Scion-Browser and some other essentials). After doing so I still have the same problem and I have no idea where to look for. The only information I can really find are topics which are more than 3/4 years old which share 0 relevance to my exact problem.
I could paste the Java stacktrace here as well which came with the error message, but it doesn't show much useful information anyway other than just basic crashing.
I hope someone can help me because I would really like to start coding now for a change instead of wasting hours on getting my basic development framework/IDE set up.
Long story short; I'd like to code some Haskell in Eclipse but the development tools just won't install and/or work properly without any notable errors or directions to look for.

How can I gracefully drop support for older emacsen in my elisp package?

I maintain a fairly well-used emacs package (ido-ubiquitous), and in the next version I plan to drop support for Emacs 23 and below. People who use Emacs 23 and below will be able to continue using the current version of my package.
However, I don't want to have Emacs 23 users upgrading via ELPA or git or something else and ending up with the new version that isn't compatible with their emacs. Is there a generally accepted way of handling this gracefully? Do I have any choice short of renaming the new version to "ido-ubiquitous-ng" or something?
ELPA/package.el
To prevent updates via package.el, add the special dependency (emacs "24.1") to the Package-Requires list. See Library Headers in the Emacs Lisp Manual, in the description of the Package-Requires: header:
[…] The package code automatically defines a package named ‘emacs’ with the version number of the currently running Emacs. This can be used to require a minimal version of Emacs for a package.
The package.el which is distributed independently for Emacs 23 and below does not provide this special package. Thus, any attempt to install your package on Emacs 23 will fail with a message complaining about “emacs” being unavailable for installation, leaving the old, compatible version in place.
However, when using this, be prepared to handle complaints from users of Emacs 24. Many users apparently do not delete their old package.el when upgrading to Emacs 24. Thus the old package.el overrides the new built-in one, leading to spurious errors on installation.
ELGet
I do not know Elget. Probably ask its author for help in this matter.
Git submodules, Tarballs and other legacy methods
I do not think, that you can really prevent updates, if users install your package in a legacy way (e.g. Git submodules, distribution packages, etc.). You can only complain after your package was updated, which is arguably too late, because the incompatible code is now already there.
You may choose to add an explicit version check, with a detailed error. I consider this superfluous, though. If you really go for Emacs 24, you will be using incompatible functions, so your package won't load successfully, whether you explicitly prevent it or not. So save yourself of superfluous code :)
TL;DR (+ personal experience)
First of all, please do not rename your package. Few users can follow the news on each and every installed package. Thus many users will not immediately realize that the package was renamed, and continue to use an outdated version without notice or warning. Effectively, you would sort of punish Emacs 24 users of your package.
Add the special dependency to prevent accidental updates via package.el. Add prominent documentation, that your package requires Emacs 24, like in the first section of your Github Readme. Then, let the matter rest. Anything else is likely more hassle that it is worth.
In my personal experience, Emacs users are not stupid (well, at least the majority isn't). They read documentation. They understand documentation.
Users of Emacs 23 know that their Emacs is outdated. Many of them expect incompatibilities and breakage. If the package suddenly breaks for them, they will seek advice on Github, realize that the package is not available for Emacs 23 anymore, and either go back to the last working release, or (hopefully) upgrade their Emacs.

Error "Comparison method violates its general contract!" when installing any Eclipse plugin

(I've read this question, but that answer doesn't solve my problem, so don't mark this one as duplicate)
I have a fresh installation of Eclipse (Eclipse for PHP Developers / Helios Release / Build id: 20100617-1415 on Windows 7 x86) I can't install any plugin or addition. Neither from official plugins repository, nor from user-provided URLs.
Installation, even of tiny plugins takes "years" (starting at 10-20 minutes, ending on over an hour) though I'm on quite very fast Internet connection (around 2 MB/s), which is strange itself. And it always ends up with the same error message:
An error occurred while collecting items to be installed
session context was:(profile=epp.package.php, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Comparison method violates its general contract!
Comparison method violates its general contract!
Error message is always the same, always mentioning epp.package.php, no matter, what plugin I'm trying to install. So I assume, that this is Eclipse-related, not plugin-related problem.
I did some reasearch on StackExchange (many similar topics but clearly programming question, related to errors in Java or Javascript code) and in the Internet in genereal. The only thing directly related to Eclipse, that I found was this forum topic saying about some know bug in Eclipse. Though this bug is marked as resolved fixed, I tried to adapt one of proposed quick solutions of starting Eclipse with:
eclipse.exe -Djava.util.Arrays.useLegacyMergeSort=true
(other, similar sources are unclear, whether there should be a space between -D and java.* or not)
But this has brought no effect. Again, installing even small plugin even from official repository takes very, very wrong and upon progress bar reaching around 20% (after about 20-30 minutes) entire installation process ends up with above error.
I have newest available stable versions of Eclipse for PHP and JRE.
I've read this question, but it brought me no closer to the solution. I saw no difference, when starting Eclipse with java.util.Arrays.useLegacyMergeSort=true switch and I wasn't able to update core Eclipse to newest version, because this process also failed with the same error.
And this does not explains, why installing anything takes so incredibly long on fairly fast connection?
Is downgrading to JRE 6 the only option I have?
The -Djava.util.Arrays.useLegacyMergeSort=true must come after the -vmargs switch, as that changes the command line from specifying Eclipse launch arguments to arguments to the JVM, which any -D would be.
Use this solution or upgrade to at least Indigo SR2.

What do you expect from a package manager for Emacs? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Although several thousand Emacs Lisp libraries exist, GNU Emacs, until version 24.1 did not have an (internal) package manager.
I guess that most users would agree that it is currently rather inconvenient to find, install and especially keep up-to-date Emacs Lisp libraries.
Pages that make life a bit easier
For versions of Emacs older than 24.1:
Emacs Lisp List - Problem: I see dead people (links).
Emacswiki - Problem: May contain traces of nuts (malicious code).
Emacsmirror - The package repository I am working on. Problem: No package manager supports it natively yet.
Some package managers
It's not that nobody has tried yet. (Some of these did not exist when this question was asked.)
auto-install
borg.el - Assimilate Emacs packages using Git submodules.
el-get.el - Supports many sources.
elinstall.el
epackage aka DELPS - Debian packaging concepts applied to Emacs Lisp packages.
epkg.el - This is now just a tool for browsing the Emacsmirror.
install.el
install-elisp.el
jem-pkg.el
package.el - ELPA. Seems like it will be included in Emacs 24.
UPDATE -- package.el is included in GNU Emacs, starting with version 24.1
pases.el
pelm - Command line installer; using php.
plugin.el
straight.el - Recent and experimental, has not reached 1.0 release yet.
use-package.el
XEmacs package manager
package has been included in the Emacs trunk. epkg is not ready yet and also currently not available. At least install-elisp, plugin and use-package do not seem to be actively maintained anymore.
I have created a git repository containing all these package managers as submodules.
Some utilities that might be useful
Package managers could use these utilities and/or they could be used to maintain a mirror of packages.
date-calc.el - Date calculation and parsing routines.
ell.el - Browse the Emacs Lisp List.
elm.el, elx.el, xpkg.el - Used to maintain the Emacsmirror.
genauto.el - Helps generate autoloads for your elisp packages.
inversion.el - Require specific package versions.
loadhist.el, lib-requires.el, elisp-depend.el - Commands to list Emacs Lisp library dependencies.
project-root.el - Define a project root and take actions based upon it.
strptime.el - Partial implementation of POSIX date and time parsing.
wikirel.el - Visit relevant pages on the Emacs Wiki.
Discussions about the subject at hand
emacs-devel 20080801
comp.emacs 20021121
RationalElispPackaging
The question (finally)
So - I would like to know from you what you consider important/unimportant/supplementary etc. in a package manager for Emacs.
Some ideas
Many packages (the Emacsmirror provides that largest available collection of packages, but there is no explicit support in any package manager yet).
Only packages that have been tested.
Support for more than one package archive (so people can choose between many/tested packages).
Dependency calculated based on required features only.
Dependencies take particular versions into account.
Only use versions that have been released upstream.
Use versions from version control systems if available.
Packages are categorized.
Packages can be uninstalled and updated not only installed.
Support creating fork of upstream version of packages.
Support publishing these forks.
Support choosing a fork.
After installation packages are activated.
Generate autoload files.
Integration with Emacswiki (see wikirel.el).
Users can tag, comment etc. packages and share that information.
Only FSF-assigned/GPL/FOSS software or don't care about license.
Package manager should be integrated be distributed with Emacs.
Support for easily contacting author.
Lots of metadata.
Suggest alternatives before installing a particular package.
I am hoping for these kinds of answers
Pointers to more implementations, discussions etc.
Lengthy descriptions of a set of features that make up your ideal package manager.
Descriptions of one particular desired/undesired feature. Feel free to elaborate on my ideas from above.
Surprise me.
I'm still learning Emacs, so I haven't had a chance to look into package managers, but a great feature would be to inform the user that the package is available if they try to use it but it's not on their system. For example, I wanted to edit a PHP file on a server once, and I tried
M-x php-mode
and Emacs was all like
M-x php-mode [no match]
when it should have been like
php-mode available from ftp.gnu.org. install? (y/n)
and then it would have installed and loaded up php-mode for me. That would have made my day right there.
Automatic publishing from version control
I'd love to see a standard, central, and single Emacs package manager. Right now, I'd put my money on ELPA, but there is still a long way to go.
The biggest thing that would help an Emacs package manager would be to make it super trivial to publish packages. In my opinion, I'd like to see this happen in combination with a version control system like git on a central hosted platform like GitHub -- something that would make it easy for authors to publish their packages and would make it easy for others to contribute back.
Similar to how GitHub (used to) make it easy to publish RubyGems, I'd like to see something similar in an Emacs package manager. For example, tag your repository with "vX.Y.Z" and have your elisp goodness automatically available to all.
The added benefit of using a popular backend like GitHub is that you'd immediately get a lot of exposure which should help drive its success.
What I expect most is that everything useful is on it, and works well. This requires you (or a team of maintainers) to aggressively pursue packaging everything for it, and doing whatever that involves — emailing every author of a useful package, and so on.
For instance, the reason Debian (and its derivatives: Ubuntu etc.) is so good is that you can happily use your system without ever having to install something outside the repositories, and that everything on it is thoroughly tested. The actual features of the package manager are important, but secondary to the managed packages themselves.
Easy configuration synchronization: I, like many people, use Emacs on many different computers and servers, some of them my own and some not. It would be amazing if the package manager had some sort of file which I could transfer from one computer to another; then, on the latter computer, the package manager would bring my Emacs into the state I like it in -- all the packages installed and configurations set. Combined with the ability to be able to easily install either site-wide (if one has root permissions) or as a single user, I could synchronize all of Emacsen everywhere.
I'm nearly positive that the best solution involves submitting more packages to ELPA and adding multi-source support to package.el. The Emacs maintainers have said that they would consider including package.el in version 24 as long as it pointed to an FSF repository by default.
Of course, submission also needs to be an automated process too; the current method of mailing the ELPA maintainer only works on a small scale.
No matter how this is done, the most important thing in my opinion is that it should be trivial to submit packages to the repository. At the same time, we do not want those packages to be instantly available, to guard against malicious code(and due to licensing issues). Unless there is a "trust" system in place, based on crypto signatures.
Also useful:
"metapackages", to install several packages at once.
In the same way, we should be able to install a set of elisp files, for maintainability
"Broken" packages should not be allowed to disrupt Emacs startup. This is easy and I have it implemented in my own .emacs
Ability to install files other than scripts. This is often overlooked, but very useful. You'd be able to, for instance, ship images, for icons, toolbars, etc.
Versioning:package X requires package Y > 1.0
Testing: perform basic sanity checks, testing for conflicts (keybindings, function redefinitions, functions that are expected to be present but aren't, etc).
BUG TRACKING: I can't stress the importance of this enough. Having a centralized place to report package bugs (and being able to track them) is extremely important to assure the quality of the packages.
Some sort of compressed archive seems to be best to do some of the above.
So far, a much improved ELPA seems the way to go.
I once spent some time writing a small package manager for Emacs.
http://gmarceau.qc.ca/plugin.el
I wrote:
Plugin is my attempt at creating a
package manager for Emacs. Plugin
will automatically downloads Emacs
extensions, unpacks them in a
directory, adds that directory to the
load-path, generates auto-load
annotations, and modify your dot-emacs
file. The auto-load annotations are a
little-known feature of Emacs. Once
they are generated, Emacs extensions
load quickly and incrementally, which
is really nice if you have as many
extensions installed as I do.
You will need two library files to get it to run, loop-constructs.el and record.el
I think the hackers for the iPhone got quite close to what I want, as does Ubuntu's "apt".
I like to be able to:
add
remove (package only)
remove user settings
view documentation
upgrade ( after reading the change log)
add new archive ( aka add repository )
see dependencies
see version
search for name, keyword
browse by (date added, date modified, name)
save all installed packages & settings
load set of packages & settings
I would like a main set of things that all work nicely and are the recommended way of doing whatever. Then a global set where everything working gets in. Then the ability for anyone to host their own archive.
It would be nice if this was all tied into git/svn/whatever so that you could install old versions. Make your own patches by forking off etc etc etc....
Besides the mentioned above, i expect something like debian, and other repositories - set of the stable, experemental, untested packages. Ability to add my own repositories - i use lot of the packages directly from VCS, so it could be useful to create my own packages
I think that the package manager should take a lot of inspiration from Rubygems. I also think that it should have a site like Gemcutter.
A central repository could also be nice (like Emacsmirror). This however may not be necessary if a site like Gemcutter exists that collects all packages.
I think these things are important for this to work.
Central location of some kind that collects all packages
Easy to add packages
Easy to maintain packages
Easy to contribute to other packages
Easy to install, uninstall and update packages
Possibility to add package dependencies
Common structure for all packages
So a package manager like Rubygems with a site like Gemcutter and a central repository like Emacsmirror (preferably on Github because of it's social coding) would do Emacs really good.
All in all I think that much inspiration should be taken from Rails and how Rails handles Gems.
I don't know how fresh this question is...
but the model I would like to see is CPAN. I also don't know Rubygems but it sounds similar to CPAN.
CPAN is a perl archive + library management system. When I need to write a perl program that requires... FTP or SOAP or JSON or XML or ZIP, or...etc, I can run the CPAN package manager, select the requisite package for download, view and verify the dependencies, then install everything. CPAN is mirrored .."everywhere".
CPAN works wonderfully for my purposes, and something similar for emacs would be nice to have. It also supports building C/C++ code on demand.
That's what I would like to see in emacs.
Some further comment on requirements.
explicit download of packages. No auto install. No invisible downloads. I want to ask for new libraries or new function.
I should be able to list the name/version/timestamp of installed packages.
If my friend gives me his list, I should be able to diff his emacs state against mine.
check-for-updates function. What updates are available? What do they fix?
depedency checking, verification, and download. If I install csharp-mode and it requires v5.0.28 of cc-mode, then it should confirm with me, that I must also download cc-mode.
there should be some sort of community ranking of these packages, like ranking torrents on isohunt. I want to see if a package has 3 upvotes or 3000.
"transactional" behavior. If an install goes boom, it must unwind to a last-known-good state.
failsafes. If I've put custom mods in linum.el, it should refuse to install a new version over my changes, unless I explicitly allow it. It should warn me before even starting. Do this with checksums/md5's over the existing install.
have the option of running some packages from compressed archives, like zip files. So I never have any doubt that I have not updated any of the embbedded elisp.
ability to use mirrored hosts for package distribution.
all this function should be accessible through M-x library-manageemnt or something.
Finally, it would be nice to have a way to segregate or organize libraries of functions. Hierarchical namespaces. Emacs' flat namespace is very dated. This is sort of independent but complementary to the core function of package management. I'm not a lisp guru so I don't know how hard this would be; maybe there is already a way to do it.
Package managers don't offer anything I value w.r.t. single-file elisp packages with simple dependencies: adding and deleting from site-lisp has never caused problems. It's packages that depend on external programs (e.g., ispell), multi-file packages (e.g., auctex, org-mode) that can be tricky. Can't think of any single-file elisp package with nontrivial dependencies, offhand.
For these, short of a package manager, I'd like emacs' elisp-packages to acquire test suites which can be run en masse, and which provide useful information in the event of dependency failures.