sábado, 27 de enero de 2018

2 ways to anchor a regex in elisp

This one I just learnt reading a PR in the melpa repo.

Usually we use ^ and $ to match the beginning and end of the line when dealing with regular expressions.

But, the same way we have \A and \z in ruby , in elisp manual: elisp regex backslash explains there is \` and \'  (that would be written \\` and \\' inside your regex string) to anchor the regex match to the beginning and end of the string or buffer. While $ matches end of the line, so "hello$" will match "hello\ngoodbye", while "hello\\'" will not.

jueves, 25 de enero de 2018

make vlc fit fullscreen window

It's an annoying thing but I was already getting used to it: VLC scales its window strangely (using ratpoison window manager), and I always have to split and 'unsplit' the frame it's in, so it adapts its proportions to the enclosing frame.

But here is the solution: 

Try this...(note: this was written using VLC 2.0.5, but it should also apply to 2.0.7)

  1. In VLC, click ToolsPreferences
  2. In the bottom left, for "Show Settings", click Simple (it might already be selected).
  3. At the top left, make sure "Interface" is selected (it should be).
  4. On the right side, for "Look & Feel", uncheck...
    • [ ] Resize interface to video size
    ...you may also wanna check (or it might already be checked)...
    • [■] Integrate video in interface
  5. Click Save
  6. Manually re-size the VLC window to the size you want.
  7. Close VLC to commit the pref change & window resize.
  8. Run VLC, play some files & report if that's what you want.

It might be useful to my future self, and as I'm not sure where vlc saves its config, I might have to redo it in my future installs. (FYI, the config is saved in ~/.config/vlc/vlcrc, and the info is there, so just carry that file with your dotfiles and you should be fine).