From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id f4bf3388 for ; Thu, 2 Jan 2020 21:06:48 +0000 (UTC) Received: (qmail 17874 invoked by alias); 2 Jan 2020 19:46:28 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45199 Received: (qmail 95 invoked by uid 1010); 2 Jan 2020 19:46:28 -0000 X-Qmail-Scanner-Diagnostics: from mail-io1-f41.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25677. spamassassin: 3.4.2. Clear:RC:0(209.85.166.41):SA:0(-2.0/5.0):. Processed in 2.565757 secs); 02 Jan 2020 19:46:28 -0000 X-Envelope-From: roman.perepelitsa@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.166.41 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=K2NMbwWjQbNTtI9Y7Iqg4JsmbZRcoxSKaxkr7xTHh8A=; b=pfu7J5ZZRV4bH55XDmCFRIkJExjkd8fPpwhh0hl/pON6cydyHF5G+fzbuLpS467v1S DpafeqIqUIfcyDx1/9IW2vNCTm5Tk+RrwispuXfCQkjlqJspbyrK14Q9OkU4VoZTRvsf vHiClFeKzHw2tLKme9DmhyB34rMSetupJuJYs2FVaOBqSNK36NesQ/Hn9vjqq9oHQ22/ VnsqZjeiXy58ivBlR+8xJnBoQsjzpd12JkPM0b5gyzoZrFe3naVbGbHRtU0vd1is0nyV k0+M0ayWP/QP6jmK0RuhX9BQXbXZ6elBVvhBE7ezcvXz4+qwW09t+z7Ijc2XIn6gEa93 r8lw== X-Gm-Message-State: APjAAAUiSWdce7lUIBVS0/Qnlf/VhnDVIRrCrTIg/69904t7qLsLFFQv n+TLXf6HuLYlup52gdm6HdK7a+TOuMMApWRR68U= X-Google-Smtp-Source: APXvYqyBKDhKpe+vNlcTkoXBoVzID3M0nlHqnYUdwc9vJKf3027u1y+EaW4yoUa2Bg9fyMrld8aY0gFP+VOPPVxc7GQ= X-Received: by 2002:a02:838b:: with SMTP id z11mr67447103jag.127.1577994352450; Thu, 02 Jan 2020 11:45:52 -0800 (PST) MIME-Version: 1.0 References: <40813-1577992732.270919@2Jfy.SNk-.4lUU> In-Reply-To: <40813-1577992732.270919@2Jfy.SNk-.4lUU> From: Roman Perepelitsa Date: Thu, 2 Jan 2020 20:45:40 +0100 Message-ID: Subject: Re: Feature request: italic style in region_highlight To: Oliver Kiddle Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" On Thu, Jan 2, 2020 at 8:18 PM Oliver Kiddle wrote: > > That sounds useful, expecially italic. Yesterday I started adding italic support throughout. Once it's there, there would be no need for custom standout_on_code/standout_off_code overrides. Plain "italic" style would surely be nicer. > The lack of free bits in zattr (TXT macros) may be something of an > impediment. It isn't really important to prompts but would matter for > zle. There may be ways to recover bits, for example we have both > TXTBOLDFACE and TXTNOBOLDFACE which allows the code to distinguish the > actions but is redundant in terms of tracking attributes. Yep, I've already discovered this. If this was C++, I would just make zattr std::bitset<84> and be done with it. Once could wish. Instead, I've made zattr a struct with 3 fields: attr for on/off attributes and fg and bg for colors. Each of these 3 fields is 4 bytes (I could make attr 2 bytes but it won't save anything due to alignment requirements). I don't want to spent much of your time on this as it's not close to being done. Will send a patch when I get through with it. > %O/%o (for "oblique") would be available. I realise that an oblique font > is not strictly the same as italic. Perfect timing. I wanted to ask which alternative letter to use as %a is taken by something (watch, perhaps?). %O/%o sounds good. > I like the idea of %A{...} but would favour symbolic names over numbers Another benefit of symbolic names is that zsh will know how to flip the attribute on and off. And the UX complexity will stay pretty much where it is now. %O and %o will work exactly like %U and %u and similar sequences. Easy to understand. With %A{...} we would have to explain how it interacts with the other sequences. E.g., does %u cancel %A{4}? Roman.