# 2013-10-29 The show2e package

I can’t (unfortunately) remember where, but somewhere on TeX.StackExchange someone mentioned the `show2e` package. A simple, but great idea! Now, instead of

```\show\some@strange@command
```

aaaarghhh!

```\expandafter\show\csname some@strange@command \endcsname
```

you can just say

```\usepackage{show2e}
\showcs{strange@command@name}
```

What a relief! Big kudos to Manuel Pégourié-Gonnard for this package.

Komentarze na tej stronie

# 2013-10-27 Easy starting Calc on a netbook

This is fairly trivial, but useful nonetheless. Typing `C-x *` (which executes the `calc-dispatch` function) on a netbook without the numerical keypad is a pain in the neck, since you have to use Control first and Shift next. Using `C-8` instead of `*` would be much simpler. (And `C-x C-8 C-8` as an equivalent of `C-x * *` would be even better.) So, I’ve put this in my `init.el`:

```(global-set-key (kbd "C-x C-8") 'calc-dispatch)
(define-key calc-dispatch-map (kbd "C-8") 'calc-same-interface)
```

Now I only have to memorize some 1000+ keybindings to use Calc effectively.

PS. And do look up in the source how `calc-dispatch-map` is defined. I can’t really fathom the distinction between character and string usage here, but the trick to map `key`, `C-key` and `M-key` to the same command for most keys is interesting.

Komentarze na tej stronie

# 2013-10-13 Changing the default prompting method for YASnippet

I was quite angry at YASnippet‘s default `yas-x-prompt` method (prompt method is the way of choosing from a few options when expanding snippets). Finally, I got to change it. It is trivial to do it using `customize`, but I hate when someone meddles with my `init.el`. You know, `init.el` is such an intimate thing that neiter my wife, nor even Emacs itself are not allowed to modify it. Therefore, I dived into YASnippet’s source to see how it is done. After a minute, I added this smart piece of code to my `init.el`:

```(setq yas-prompt-functions
(cons 'yas-ido-prompt
(remove 'yas-ido-prompt
yas-prompt-functions)))
```

Notice how clever (in the good sense of the word) it is: it essentially moves `yas-ido-prompt` to the front of the `yas-prompt-functions` list (yes, I do use Ido, and I quite like it!). Of course, you may choose another function for your default, `C-h v`‘ing `yas-prompt-functions` will reveal a few possible choices.

And finally, I disposed of this ugly, non-Emacsy, X-like menu. Long live the minibuffer!

Komentarze na tej stronie

Więcej...

(Więcej means More in Polish; click it to see older entries.)