~chambln

Nottingham/Sheffield, UK

https://cosine.blue

Gregory Chamberlain

~chambln/public-inbox

Last active 13 days ago
View more

Recent activity

Re: How to Pronounce Any English Word 13 days ago

From Gregory Chamberlain to ~chambln/public-inbox

Alex <bybor@yandex.ru> writes:

> I used this plugin https://github.com/dahu/vim-ipa for something, and
> it was pretty handy. But it has a dependency on a base library from
> the same author, so I wanted to find something lighter than that. But
> it was a pretty smooth experience and I really like the
> approach. Gonna use it again.
>
> As for piping input/output, I'm on Windows, which probably complicates
> things.

If vim-ipa is what you’re comfortable using, that’s great.

It looks like it works by converting a selected region of the buffer,

Re: How to Pronounce Any English Word 13 days ago

From Gregory Chamberlain to ~chambln/public-inbox

I had been a Vim user for quite some time before trying Emacs, but I
avoided evil-mode and the like because I wanted to learn Emacs "the
Emacs way."  I wanted to give standard Emacs key bindings a fair chance.

Modal editing has its advantages but, after the initial learning curve,
I’ve come to appreciate the Emacs way.

By the way, I had an idea about inputting IPA symbols that could be used
with editors like Vim and Kakoune.  What if we had a program that reads
from standard input and writes to standard output, doing exactly what
the ‘ipa’ input method does in Emacs.  It may even be possible with a
simple sed program.

    #!/usr/bin/sed -f

Re: How to Pronounce Any English Word 14 days ago

From Gregory Chamberlain to ~chambln/public-inbox

Alex <bybor@yandex.ru> writes:

> Could you tell how do you input IPA phonetic symbols in your posts?  I
> used a vim plugin for this some time ago, I wonder if there is
> something simpler/better?

Thanks for writing in!

At the time, I did not have an elegant way to input IPA symbols.  I was
mostly copy-pasting from Wiktionary, which was cumbersome.  Recently I
discovered Emacs has an input method for IPA -- several, in fact!  I've
now posted an article I was working on which goes into more detail on
this.[1]

Re: [PATCH] lessgmi -- A self-contained pager for GMI files 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

Hi Peter,

> * Implemented in the most-AWK-compatible script.
> 
>   Tested to work with `mawk` (default on Ubuntu) and `gawk` (GNU Awk
>   installed separately)

Works fine for me with gawk and original-awk.  However, testing with
mawk 1.3.3 I get the following error:

    mawk: line 6: illegal reference to array list_of_words

Any idea why that might be?
[message trimmed]

Re: [PATCH] Add syntax coloring for Gemini markup via `awk` 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

Peter Marinov <pmar21@sonic.net> writes:

> On Wed, May 19, 2021 at 06:11:42PM +0100, Gregory Chamberlain wrote:
>> I suppose gmi could test whether lessgmi is available
>> 
>>     if command -v lessgmi >/dev/null 2>&1; then ...
>> 
>> but I am concerned about the growing complexity of gmi.  With all the
>> initial issues ironed out, it’s already become a bit too big for its
>> breeches.  Bourne shell is not the right language for complex programs.
>> But of course anyone is free to fork gmi and take it in whatever
>> direction they like.
>
> I think the fact that it is written in shell script is the killer

Re: [PATCH] Add syntax coloring for Gemini markup via `awk` 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

Peter Marinov <pmar21@sonic.net> writes:

> I was thinking that the main problem that the formatting has to solve
> is wrapping of long lines. The coloring is nice but the wrapping is
> what makes the navigation of pages pleasant to read.
>
> Go to this page for example:
> gemini://guardian.shit.cx/uk-news/business/2021/may/19/uk-rail-overhaul-privatised-great-british-railways-/index.gmi
>
> Another good one is with combination of code sections + quote sections
> and long lines in all of them:
> gemini://drewdevault.com/2021/05/03/awk-is-the-coolest-tool-you-dont-know.gmi
>
> Try with and without the gawk script

Re: [PATCH] Add syntax coloring for Gemini markup via `awk` 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

Hi Peter,

You should know that, since my last email, I’ve made a number of changes
to gmi inspired by your contributions.  I’m quite pleased with the
results even if the program is some 13 lines longer for it.

Gemtext documents are now rendered with syntax colouring using a
portable Awk script embedded in gmi itself.  It’s enabled by default,
but can be disabled by setting the PAGER environment variable.  See the
Git log for more details about this.

As documented in the readme, gmi still lacks rendering of bold and
italic text inline.  My Awk skills are limited so, if anyone is able to
share a patch for this, that would be ace.  Until then I will be

Re: [PATCH] Add syntax coloring for Gemini markup via `awk` 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

Peter Marinov <pmar21@sonic.net> writes:

> On Tue, May 18, 2021 at 11:52:47PM +0100, Gregory Chamberlain wrote:
>> > The correct script can be used depending on what is provided/desired
>> > on the platform.
>> 
>> Sounds good.  You can add a shebang to indicate whether the script is
>> intended for GNU Awk
>> 
>>     #!/usr/bin/gawk -f
>> 
>> or standard Awk
>> 
>>     #!/usr/bin/awk -f

Re: [PATCH] Add syntax coloring for Gemini markup via `awk` 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

Hi Peter,

Peter Marinov <pmar21@sonic.net> writes:
> I understand the sentiment of wider portability, in light of this I
> can make another script that can work with `mawk` (the default one on
> Ubuntu, but probably also work on BSD). The downside of it would be
> that it can't highlight URLs with the degree of detail possible via
> `gawk`.
>
> The correct script can be used depending on what is provided/desired
> on the platform.

Sounds good.  You can add a shebang to indicate whether the script is

Re: [PATCH] Add syntax coloring for Gemini markup via `awk` 4 months ago

From Gregory Chamberlain to ~chambln/public-inbox

This is really cool.  Thanks for sharing!  In the interest of
portability and customisability, I'd like to make this feature
optional.  I have an idea for how to achieve this fairly tidily, but
I'll explain it later in this message.

Last night I rewrote gmi, almost from scratch, with the help of various
caffeinated beverages.  I hope to publish the results as soon as I get
it cleaned up.  It will be the same in spirit but more robust.

This was part of an effort to fix a number of issues, not least of
which was a bug where downloads of binary files, such as images, became
corrupt on disk.  I discovered this was due to the shell's command
substition deleting null bytes in the body.  So that's fixed in this
new, rewritten version which I'll push to the repo soon.