Search Results: "Clint Adams"

4 October 2007

Clint Adams: Having your caret and eating it too

Let's say you're a French person who has EXTENDED_GLOB on and types HEAD^ all the time, but can't be bothered to type a backslash before the caret. Personally, I have no problem typing HEAD\^, but I probably only do that twice a day. Here are a few/several/many (depending on how you count) solutions . They all have their downsides. Finding out their side effects is an exercise for the reader. Number one: setopt noextendedglob Number two: setopt nonomatch Number three: alias git='noglob git' Number four: custom ZLE widget:
accept_line_with_headcaret ()  
  if [[ $ BUFFER  = git*HEAD\^* ]]; then
    BUFFER="$ BUFFER//HEAD\^/HEAD\\^ "
  fi
    
  zle .accept-line
 
zle -N accept-line accept_line_with_headcaret
I'll just keep hitting the backslash key.

30 September 2007

Romain Francoise: Clint rocks

19h57:
Subject: Bug#444747: Acknowledgement (git-mergetool completion missing)

Thank you for the problem report you have sent regarding Debian.
This is an automatically generated reply, to let you know your message has
been received. It is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
Clint Adams <schizo@debian.org>
21h24:
Subject: Bug#444747: fixed in zsh 4.3.4-19

This is an automatic notification regarding your Bug report
which was filed against the zsh package:

#444747: git-mergetool completion missing

It has been closed by Clint Adams <schizo@debian.org>.

29 September 2007

Clint Adams: This K se-Knoblauch Suppe is delicious, but what is that floating in it?

My next installment was going to cover a different topic, but Marty made a wish and unless Rajaton intercedes before this blog entry is over, the curriculum is going to careen off the track. The relevant question is something like Why do I have to type all that junk in when there's perfectly good --help output to parse? and the relevant answer is something like Yes. No. ROFLcows. Lamar. This is somewhat easy when a program has well-behaved, sane-ish, GNU-style --help output. Let's say you want completion for GNU ptx. Now you could go through and write a function using _arguments like you learned all about here, or you could just type
compdef _gnu_generic ptx
Suddenly you'll be able to complete options after ptx. You'll notice a few things as you perform your QA due diligence. It won't understand the subtleties of -G. It won't know what STRING and REGEXP and NUMBER mean, but then, neither do I. It's possible to use _arguments to explain what WORDS IN ALL CAPITALS mean, but let's find a less BORING example.
Usage: nurmepuu [OPTION]... [FILE]
Drive Miss Nurmepuu
  -c, --compress=TYPE            apply this compression TYPE to the aircon
  -f, --force                    use force
  -s, --side=SIDE                drive on this SIDE of the road
  -u, --unbearability=LEVEL      tolerate this LEVEL of unbearability
So start out the way you have now learned instinctually.
#compdef nurmepuu
_arguments -- \
WAIT. WHAT'S THAT The double hyphen-minus, contrary to the expectations of GNU and git users alike, means (are you ready for this?) parse the --help output and try to sanely complete long options. Now lets give it some hints so it isn't too braindead.
  '*=TYPE*:compression type:(gzip bzip2 lossy gainy pancakebatfish)' \
  '*=SIDE*:side of the road:(left right east west up)' \
  '*=LEVEL*:tolerance level:((japan\:haha radiohead\:hoho))'
There you go. The patterns on the left will be matched against the help output, and the completion actions on the right. The list in double parens are matches paired with descriptions (note the backslashed colons). Once more, the whole thing:
#compdef nurmepuu
_arguments -- \
  '*=TYPE*:compression type:(gzip bzip2 lossy gainy pancakebatfish)' \
  '*=SIDE*:side of the road:(left right east west up)' \
  '*=LEVEL*:tolerance level:((japan\:haha radiohead\:hoho))'

Clint Adams: Blagscroll

Joey, I find it the creepiest when I see my words scroll across my boss's monitor.

28 September 2007

Clint Adams: A thrusting hit will never find

Once upon a time I proposed a DebConf talk about how to write zsh completion functions, but it was rejected. Accordingly, I didn't waste any time preparing materials for it, so I never have anything to throw at people when they ask for some kind of introduction. Here we have a fictitious program called arismom. Usage information from the fictitious manpage and the fictitious --help output is as follows:
Usage: arismom [OPTION]... [FILE]...
Do it Jersey style.
  -a, --all                       do all those things
  -b                              bubble
      --bounce                    bonuce
      --CoC=STYLE                 adhere to STYLE code of conduct
  -d, --debian=PACKAGE            dedicate actions to Debian PACKAGE
  -e, --ensqualm=USER             ensqualm USER first
  -t, --tempdir=DIRECTORY         spew temporary files into DIRECTORY
So let's cut to the quick. Create a file called _arismom somewhere in your function search path. This is described by the array $fpath. You can view its contents by typing print -l $fpath, and you can add a a directory to the beginning with fpath=(~/.zsh/scratch $fpath) or to the end with fpath+=(~/.zsh/scritch). For the purposes of this blog entry, we'll pretend you have a ~/.michaelbolton/squatch directory in your $fpath and that you are now editing ~/.michaelbolton/squatch/_arismom. The first line of the file, at the very tippy top, should read
#compdef arismom
This ensures that when the completion system boots up and finds your file, it will associate your function with the command arismom and complete options and arguments for it accordingly. Speaking of arguments, skip a line for aesthetic equilibrium, and invoke the _arguments utility function.
_arguments \
_arguments is sort of the cdbs of the zsh completion fleet. By the end of this blog entry, you'll have no idea how it works, and if you want to do anything particularly complex with it, you might encounter some resistance. For those of you unfamiliar with Z-Shell syntax or shell syntax in general, the trailing backslash means I'm a-gonna feed you a ton of information about the command-line interface to arismom. So tell it about the first option already.
  '(-a --all)' -a,--all '[do all those things]' \
To oversimplify, this declares that -a and --all are options which produce the identical behavior of do all those things . Specifically, the part in parentheses says to not complete either -a or --all when either -a or --all is already on the command-line. The part in braces is merely brace expansion; for that reason it is outside of the single quotes. If you're unfamiliar with brace expansion, try print '(alice)' bob,carnie '[wilson]' to see how it expands. Finally, the phrase in brackets is an explanation of the option, which may or may not be displayed depending on your configuration. Next, do a short option that has no long option equivalent.
  '-b[bubble]' \
A long option with no short option equivalent looks similar. Don't feel limited by upstream's inadequate descriptions, misspellings, or poor grammar.
  '--bounce[amplify bounce level according to X-la algorithm]' \
Some options take arguments. Now we use colons.
  '--CoC=[adhere to CoC]:CoC style:(mjg59 buxy ubuntu)' \
The first column is the same optspec by which you've been so excited thus far, and the part between the colons is the message or description of that which will be matched. The part after the last colon is the action; in this case you are specifying a list of possibilities within single parentheses. In most cases, you'll want to be more dynamic than a pre-defined list, and there are many helper functions all ready to serve you.
  '(-d --debian)' -d,--debian= '[dedicate actions to Debian package]:package:_deb_packages avail' \
_deb_packages is a function that completes Debian packages; it can take avail, installed, or uninstalled to restrict which set of packages it offers. In this case we want it to complete any package available from your sources.
  '(-e --ensqualm)' -e,--ensqualm= '[ensqualm user first]:user to ensqualm:_users' \
Here the _users function will complete usernames.
  '(-t --tempdir)' -t,--tempdir= '[spew]:temp dir:_files -/' \
Normally the _files function will complete files, but you can tell it that you only want directories with the -/ option. Finally, we want to cover all the remaining arguments (which according to the fictitious usage information is a list of files). In this case, you happen to believe that files with the .nj extension are to be completed.
  '*:NJ files:_files -g "*.nj"'
The -g option specifies a glob pattern to match files. Now the entire file should look like this.
#compdef arismom
_arguments \
  '(-a --all)' -a,--all '[do all those things]' \
  '-b[bubble]' \
  '--bounce[amplify bounce level according to X-la algorithm]' \
  '--CoC=[adhere to CoC]:CoC style:(mjg59 buxy ubuntu)' \
  '(-d --debian)' -d,--debian= '[dedicate actions to Debian package]:package:_deb_packages avail' \
  '(-e --ensqualm)' -e,--ensqualm= '[ensqualm user first]:user to ensqualm:_users' \
  '(-t --tempdir)' -t,--tempdir= '[spew]:temp dir:_files -/' \
  '*:NJ files:_files -g "*.nj"'
There you have it. Restart zsh and try tab-completing various things after arismom. P.S. I expect bug reports containing functions for dpatch-edit-patch, pkill, and pgrep by tomorrow morning. P.P.S. Why is Scott James Remnant still on Planet?

22 September 2007

Clint Adams: And I answer quite frankly, when they stop building roads

This one is long and boring. You'll want to skip it entirely. A while ago, Ulrich Drepper made getaddrinfo() in GNU libc behave according to an IETF RFC. Sounds sane, right? Well, not entirely. The way RFC 3484 rules work for IPv4 is less than ideal. On the other hand, returning network address query results unsorted is also less than ideal. Imagine if getent passwd returned lines in a randomized order. It would be perfectly functional, but piss me off to no end until I conditioned myself to always sort them the way I wanted them. I digress. So, we shipped a stable release that behaved this new way. Nobody objected. I don't know if Ubuntu did or not. It would amuse me if they did, but I don't much care. Then all of a sudden, along comes bug #438179. The gist is that Kurt thinks that trying to make intelligent decisions based on network topology is a bad idea because it defeats the point of having multiple A-records in the first place. We'll come back to that in two minutes. James filed the analogous bug in Ubuntu. I keep mentioning Ubuntu for a reason. I'm not going to tell you what that reason is. The GNU libc maintainers were reluctant to change the default (which is how most other modern operating systems behave; MacOS X being a notable exception, though I heard that they were working on it), so Kurt escalated to the Technical Committee. Now nothing in our lovely and flawed Constitution says that the tech-ctte should be a technically-capable bastion of wisdom and patience; I just think it does because I don't waste my time reading Foundation Documents that don't accurately describe our governance structure. Now for a brief interlude while I vamp incoherently for some of my less technical readers who are not implementors of a DNS resolver libraries, past IETF participants, DNS administrators, someones who've followed some of the IPv6 transition work, or have invented the Internet lately: Round-robin DNS is a giant hack, a poor man's loadbalancer, as it were, something that only works due to a de facto standard that no standards bodies seem to have thought worth preserving. gethostbyname() has been marked obsolescent in POSIX and deprecate in GNU libc for what seems like forever, and the GNU libc implementation of it suffers from bugs that probably no one should ever fix, and as such, no one should ever use it. getaddrinfo() is not a drop-in replacement for gethostbyname(), and expecting it to behave the same is daft. If it were meant to behave the same, I would expect that it using it would be simply a matter of changing calls to gethostbyname() to getaddrinfo(), rather than the amount of code rewriting you need to do now to change the same effect. Furthermore, nothing guarantees the behavior of gethostbyname() except for years of observed consistent behavior and the expectation that should anyone implement a C or resolver library that sorted gethostbyname() results, there would be much loud screaming that it was the library that's broken, and not the applications or programmers for being na ve. I hope that was less than helpful. Let's move on with the plot. While the Technical Committee deliberated , and I use the quotation marks because several -ctte members don't seem to have participated at all, Ian Jackson jumped up and down like some kind of Rumpelstiltskin, screaming that he is Der Komissar and that voting is in order, and a few other things I won't mention. On the 20th of September, Ian Jackson called for a vote. On the 20th of September, Ian Jackson uploaded an Ubuntu version of glibc with the default changed. On the 20th of September, my mother had trouble sleeping, though I suspect she has no idea it was because of this debacle. This story has no ending. Let the rain come down.

18 September 2007

Clint Adams: The magic of rule 9

Wow, Ian Jackson is on crack. Tollef, little monkeys think FreeSynd is good enough.

16 September 2007

Clint Adams: Herding databases

I can never remember this BTS URL: oldbdb

Clint Adams: Minigun

Dear Sirs and/or/but Madam: Kindly write a free clone of Syndicate Wars.

8 September 2007

Clint Adams: See Siemens first

Maintenant j'ouvre la fen tre et une mouche la chambre entre
Ni la moche ni l'italienne ne peut  tre trouv e plus   son centre
This place with its wood and its shingles, this place
with birdshit splattered down the bricks
This place with drunken girls screaming Meat Loaf lyrics
and behaving like abject pricks
Maintenant je suis bien loin
But yet oh so close
Cerca de la criatura del lago
Not Iago as has been previously claimed
Humming, screeching, gurgling, squeaking
Not unlike Barbie's mom on a Thursday night
It goes through the motions of accomplishing something
When really it is advancing its own sinister agenda
An agenda so sinister that you'd name it Dexter if you could.
You can't.
Then, as the disruptive forces destabilize reality, like
they destabilize the rhyme and scansion and hyperlinklessness
of
This Poem
Then, like
Mike Stone
expressing
gratitude,
like something demanding its $3.50 (but oh, oh, it does not want its $3.50; it wants
something far more visceral and ephemeral), it makes a simple statement.
F01.
Natuurlijk.

3 September 2007

Clint Adams: But what does the position of the circle mean?

You make one little Durex pun and all of a sudden-like, somebody's making a PNG file for you.

28 August 2007

Clint Adams: I cans driving down the intarwebs. Lol

(clara) Oh really? My brother used to spray my butt with lysol when we used to go camping. (carol) did it burn? (clara) Yes, it was cold and then burned. Lol (clara) My brother used to sneak up behind me when I was in the woods pooping over a fallen tree. Lol. I know it sounds funny but he would do that. He also used to threaten me by putting my blanket out the window when driving down the interstate. Disclaimer: This is not the carol of the hallucinatory libtool reacharound.

24 August 2007

Clint Adams: Volta, ick

There's this Brit named Steve. Steve loves strip clubs. Now, being a Londoner, he has the requisite interest in talk of sex, boozing, and sport, three topics that bore me numb, but I have only ever seen Steve get truly excited about two things in life. The first is the culture of strip clubs, best exemplified by a sex act Steve calls (complete with pantomime) feeding the pony . The other has to do with Ali G. Steve (remember Steve?) is tickled pink that people wanted to sue Sacha Baron Cohen for racism but could not, for since he is a Jew, he is incapable of bigotry. This made no sense to me, but after witnessing the insanity of the UK legal system, I see no reason to doubt it. I am standing up to my nipples in salt water. I saw someone who looked remarkably like Steve yelling with a mildly impressive accent but poor grammar. I knew it wasn't Steve because he wasn't being tailed by an Eastender shouting blimey . I am standing up to my neck in salt water. J rg points out the reasoning for why normal peon developers don't have access to NEW. This makes perfect sense once you realize that each member of the ftp team is both a citizen and resident of the United States of America. The sea is rough. It is difficult to keep the laptop dry, and, well, the Piers Anthony book in my other hand is going to smell like ocean for weeks. That's precisely why I brought it, though; it would take extreme effort to keep it from getting wet. As it stands, or as I stand, there are three options available to me. I can retreat to the beach, where I will be mostly safe from the water. You could call this turning tail and running, or you could call it mastering my environment. It's all in the marketing. I'm going to succumb to this option anyway, and now is not the time for it. So I could also keep doing what I'm doing, keeping my head and laptop and book above water by expending near-constant effort. It's a little easier than in Puerto Rico at the place some random passerby kindly informed me that i was going to die a horrible death just like the 12 other people who had died in that spot that year. In essence though, it's like the futility of continuing living when you're surrounded by INTPs. Then there's the most appealing option: to be as the reed in some Taoist metaphor. I can just let go, and let the tides have their way with me, coolly caressing my face, washing over me, drenching my book, short-circuiting my keyboard, and filling my lungs with plant matter and some kind of 0.479M NaCl solution. My lungs see a problem with this otherwise-logically-sound philosophy. There's an old Middle Eastern proverb that goes something like Be as the date palm, above the spites. When she is hit with a rock, she strikes back with her sweetest fruits. Disthrust! Dilute! Disthrust! There may have been some corruption in the intermediate language.

12 August 2007

Clint Adams: ZOMG goes cutting-edge

ZOMG has now been updated for Audioscrobbler 1.2, and is now in a Mercurial repo. Users should be aware that the caching of credentials and the caching of unsubmitted tracks have both changed in incompatible ways, so be sure to flush or remove your old data before upgrading. Probably the only exciting user-visible change is that currently-playing tracks will now show up on last.fm as now listening .

4 August 2007

Clint Adams: Maximum Deadlock reached

run Diagnostic or restart application

27 July 2007

Clint Adams: Gozando hasta que salga el sol

This makes me smile. The DM GR and the discussion surround it do not make me smile.

21 July 2007

Clint Adams:

Dear , I went to , , and , but not your birthplace. I thought you should know. Write back soon, kthx.

20 July 2007

Clint Adams: Nor is it Don Cheadle

Not quite right, but ominous nonetheless. [Not Don Cheadle at all]

10 July 2007

Clint Adams: She take my money and run Venezuela

Look, tall, short, that's not what matters, understand? If you.. If you love a girl, well, then you stand up for her, no matter what, with all you've got. If you can do that, then you're a man, no matter how tall you are.

1 July 2007

Clint Adams: El justiciero, cha, cha, cha

On February 14, 2004, Gage & Tollner, ostensibly New York's oldest restaurant, closed down and, if that weren't traumatic enough, became a TGI Friday's. Finally, Friday's is gone, and the fa ade sports a banner advertising a fully-equipped restaurant for rent. What will it become next?

Next.

Previous.