Hide Or Ignore Comments ELPA Package

Here is an ELPA package for the HideOrIgnoreComments software.
The code is original from the author, I just packaged it up!
Here is one way to install it:

(url-copy-file
 "https://www.wisdomandwonder.com/wp-content/uploads/2012/09/hide-comnt-40.tar"
 "/tmp/hide-comnt-40.tar"
 t)
(require 'package)
(package-install-file "/tmp/hide-comnt-40.tar")

Update 09/29/12:
Lincoln de Souza reported a fix, remove the quote nil from the package def and Marmalade should accept it, and it did. Here it is.

Debugging an ELPA Package Install on Marmalade

To get started with ELPA packages I started small by trying to package up hide-comnt.el. Marmalade wouldn’t let me upload it though giving me a “520 Bad Gateway error”. Here is the package that I’m testing with.
Here are the steps I have since followed to try to address it:

  1. Guys in #emacs said it might be Internet access. I think it could be Internet access, package format might be wrong, OS issues, or tar might be bad.
  2. Tried first with Chrome on Windows, and then Firefox on Windows. No change.
  3. Tried first with GNU Tar on Windows, and then 7zip on Windows. No change.
  4. Installed Lubuntu 12.04 then tried GNU Tar and Chrome. No change.
  5. On Windows, blew away my manually installed copy of hide-comnt and installed the package (from above) from inside Emacs using ‘package-install-file’. This worked fine; the package installed and worked as expected. The package seems ok since Emacs installed it.
  6. Tried using a web proxy from home and did not get the 502 error, but the file was not uploaded.
  7. Noticed that there is a sample multi-file TAR package here. Think mine is OK but this is a useful reference.
  8. Found this package and tried doing a programmatic upload. It didn’t work, the result was “502 Bad Gateway”.
  9. Tried uploading using 4G on my Android and got the same result, “502 Bad Gateway”.
  10. #2, #5, and #9 make it seem like the package I made is OK and it is not my Internet connection. Only Nic can check, so I’m passing it to him now.

Tweaking the modeline characters for a minor mode

The modeline characters (call the lighter in Emacs terms) weren’t displaying correctly on my system for this excellent plugin. A cent sign should have been displayed but instead ” \242″ was displayed. ‘forcer’ in #emacs explained that those display settings are stored in ‘minor-mode-alist’ so we can modify them. I added this code at the end of my config:

(let ((ccm-cons (assoc 'centered-cursor-mode minor-mode-alist)))
  (when ccm-cons
    (setcdr ccm-cons '(" ccm"))))

Bless You Emacs

Trying to set up a dev mode in Emacs on Windows today, the code complained that $SHELL was not defined. Not sure what to use I guessed and used ‘cmd’.
At startup, that is startup, not runtime, Emacs gave me this warning:

Warning! The $SHELL environment variable uses cmd.
You probably want to change it so that it uses cmdproxy.exe instead.
Warning! shell-file-name uses cmd.
You probably want to change it so that it uses cmdproxy.exe instead.
Warning! shell-command-switch is "-c".
You should set this to "/c" when using a system shell.
Warning! w32-quote-process-args is t.
You should set this to nil when using a system shell.

Bless you Emacs! ‘cmdproxy’ worked perfectly.

An asynchronous web server written in Emacs LISP

Elnode is an asynchronous web server written in Emacs LISP.
Emacs has had asynchronous socket programming facilities for some time and a few years ago asynchronous TCP server sockets were introduced. I couldn’t quite believe that no one had written an asynchronous webserver with EmacsLISP before. So now I have.
When I started looking at actually doing this I intended to knock up just a silly demo. But the more I got into it the more it seemed to me that this could be an important addition to Emacs and that, sometimes, an Emacs LISP async web server could actually be useful.

(via nic)

Clipped fonts in Emacs

The awesome pretty-mode for Emacs displays symbols of your choosing rather than text for specified patterns. For example if you have a lot of Greek letter names in your MATLAB code you might just have the symbol show up instead.
After upgrading to Emacs version 23 on Windows (GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600) of 2011-03-10 on 3249CTO) though the symbols get clipped off. Here is what I mean:

When I place the cursor on the lambda in this case, it renders correctly:

However, when I modify the buffer, the characters again renders incorrectly.
When I type in the Unicode characters directly; they render just fine.
My current approach for figuring out what is going on has been to read the code and the Elisp API. From what I can see, it “looks right”. Right now I’m just documenting it here to try to get a pointer on where to look next.

Enabling PNG, JPG, and GIF in Emacs on Windows

Today I installed graphviz mode for Emacs. One of its features is that it will show you the rendered image in a buffer. When I tried it out, the image was opened as text. This is of course not what I wanted :).
The Emacs user guide says here that to enable support on Windows you should check “Other useful ports”.
This post was particularly helpful because it explained that the contents of the ‘image-library-alist’ variable tell us everything we need to know. When you view its contents, it tells you which DLLs that it is looking for in order to view each particular format of image file. Just get the Windows version of those DLLs and throw them in the Emacs bin directory and restart Emacs for image support to be enabled.
I got zlib1.dll, jpeg62.dll, and giflib4.dll from GetGnuWin32 and libpng14-14.dll from Gnome.