How to execute a command within the emacs shell which was passed as command line argument

This topic is in fact not so closely related to astronomy. However, from a technical perspective I think it still fits onto this blog. Recently I was in a situation where I wanted to start a console command within the emacs shell – but directly via the command line. The xterm shell has the -e option for this purpose. Also the bash command provides the -c option. However, in emacs I was not able to find such an option. I also didn’t want to dive too deep into the LISP stuff. If you are in a similar situation the following solution might be what you need. A very small emacs LISP script will do the job:

(toggle-truncate-lines 1)
(insert (elt argv 0))
(comint-send-input)

This script first opens a new shell in emacs and then inserts the first argument passed to the script into the shell. The last line then executes the command. In the end emacs can be called the following way:

emacs --load exec_cmd.el "<my command>"

The following example calls xeyes with red eyes – this shows that passing parameters to the executable is also not a problem:

emacs --load exec_cmd.el "xeyes -center red"

This little trick helped me a lot since navigating and especially searching inside emacs is much more convenient than in xterm (at least in my eyes).

Last updated: June 16, 2022 at 13:33 pm

Mercury sun transit – May 2016

Today was a very special day for star-gazers and astronomers. For about 7 hours the Mercury sun transit could be observed what is a quite seldom event. At 11:12 UTC Mercury started to show up in front of the sun and left again at 18:42 UTC. The little planet will not transit again until 2019 and then again 2032. More information can of course be found on wikipedia.

One of the images made it into “My Top Astro-Pics Gallery” and is also available in full resolution.

For me it was great to see the Mercury sun transit with my own eyes and again getting an idea of how huge the sun is compared to all the planets. Untrained eyes have to look twice to recognize little Mercury on the photo. Simply fantastic!

Clear skies!

Last updated: June 16, 2022 at 13:41 pm

The ParaTi magazine on La Palma published a lost-infinity.com article

Recently I had the chance to contribute an article about astronomy to the La Palma Para TI magazine. In this article I write about my impressions and emotions when I was visiting Roque de Los Muchachos at night. “El Roque” is the highest point on La Plama (2426m).Up there the Roque de Los Muchachos Osbervatory is situated. The title picture of the article is the Great Orion nebula (M42) which is one of my favorite pictures. I imaged it back in February 2014. If you are on La Palma, I recommend you to visit “El Roque” in a clear and moonless night (see also my previous article) – you will be surprised 🙂

Last updated: June 16, 2022 at 19:11 pm