Hoboneer

Results 26 comments of Hoboneer

Alternatively, allow the completion interface (e.g., Bash, Emacs) to handle it themselves and just provide the suggestions URLs. As for providing the URLs, maybe with a `-get-opensearch-{xml,json},-suggestions-url`. How would jquery...

After some rough testing, it appears that `tempfile` is also imported by `jinja2.bccache`--so no import-time improvements, except the removal of the `importlib.resources` import. The simpler tempfile creation is still a...

> The simpler tempfile creation is still a benefit though: safely creating a tempfile is relatively slow and we don't _need_ that. Removing the use of `tempfile.NamedTemporaryFile` results in two...

This could also be implemented using `curl`, `wget`, Perl's `GET`, or some other command-line HTTP program. Either way, tempfiles are going to be used. One problem I've had with testing...

## Pros and cons of both ways Note: *runtime* refers to when elvi execute code--not when they're generated by `mkelvis`, `opensearch2elvis`, or some other program. ### HTML form + JavaScript...

Improved code: ```sh __mkelvis_in="$(mktemp)" __mkelvis_tmp="$(mktemp)" __mkelvis_out="$(mktemp tmp.XXXXXXXXXX.html)" __mkelvis_cleanup() { rm -f -- "$__mkelvis_in" "$__mkelvis_tmp" "$__mkelvis_out" } trap '__mkelvis_cleanup' HUP TERM # in case anything fails trap '__mkelvis_cleanup' EXIT # data...

Another problem: graphical browsers' shell commands exit immediately (at least if already opened), but text browsers don't exit until the user manually quits. This causes an annoying delay of 1...

Improved code that does the timing, reduces the number of `mktemp` calls, and removes the need for intermediate files (html-xml-utils is great!). ```sh #!/bin/sh __mkelvis_out="$(mktemp "${TMPDIR:-/tmp}/surfraw-results.XXXXXXXXXX.html")" || exit 1 __mkelvis_cleanup()...

See this stackexchange answer for portable (POSIX) tempfile creation: https://unix.stackexchange.com/a/181996 > ```sh > tmpfile=$( > echo 'mkstemp(template)' | > m4 -D template="${TMPDIR:-/tmp}/baseXXXXXX" > ) || exit > ```

Turns out that the "Next page" buttons stopped working--why....