Profile cover photo
Profile photo
Prakash Kailasa
Prakash's posts

Post has attachment

Post has attachment
Found this snake in our driveway this morning. Not sure if it's poisonous.

Is there an emacs command to list all environment variables? I could not find any, and came up with this short snippet:

(defun listenv ()
  "List all environment variables in order."
  (switch-to-buffer-other-window "*env*")
  (insert (mapconcat 'identity process-environment "\n"))
  (sort-lines nil (point-min) (point-max)))

I am experiencing something weird.

I have a prog-mode for a homegrown DSL. The mode was written using generic-x and mmm-mode. It is autoloaded for files with certain extensions.

I have recently noticed that after a source file with one of the known extensions is visited, I sometimes get the message "Symbol's function definition is void: vector" (most recently, I was executing a vc-annotate command when this happened).

I checked for the function definition of vector before and after visiting the source file. The function definition existed before visiting, but after visiting, it disappeared.

I inserted (message "...") lines at appropriate places in the code for this prog-mode, but those messages indicated that the during the execution of the prog-mode code, everything was fine.

So, something else is happening after the prog-mode is completely loaded, but I don't know what it is. So, my question to all you emacs-gurus is: how do I find out what is causing this?

Post has attachment
Perl frameworks are missing from this list. I am not sure if plans are afoot in the Catalyst, Dancer, Mojolicious and other framework communities, but it would be nice to if they submitted versions of the benchmarks to this.

Post has attachment
When I am editing code, often I copy current line, comment it and paste it below before beginning to edit the cloned code. So,  after doing a lot of times this I wrote up this little function. I have used emacs for a long time, but my elisp-fu is still next to nothing, so it took me a while to get things right. Especially since I wanted it to work for either active region or current line.

    (defun copy-comment-paste ()
      "copy active region/current line, comment, and then paste"
      (unless (use-region-p)
          (beginning-of-line 2)
          (push-mark (line-beginning-position 0))))
      (kill-ring-save (region-beginning) (region-end))
      (comment-region (region-beginning) (region-end))

Here's the gist for the same:

Please suggest any improvements.

Post has shared content
Really good visualization of perceived vs actual wealth inequality in the U.S.

Post has attachment
I have been watching  #Jeopardy for nearly 20 years. Last night's episode (second day of the Teen Tournament finals) is by far the best one I have seen in all these years.

Way to go Leonard Cooper!

Post has attachment

Post has attachment
Wait while more posts are being loaded