zsh-users
 help / color / mirror / code / Atom feed
* Looking for a pointer on what to search for to find information on command expansion / substitution.
@ 2023-02-25 18:50 Grant Taylor
  2023-02-25 18:59 ` Roman Perepelitsa
  2023-02-27 20:27 ` Lawrence Velázquez
  0 siblings, 2 replies; 8+ messages in thread
From: Grant Taylor @ 2023-02-25 18:50 UTC (permalink / raw)
  To: Zsh Users List

[-- Attachment #1: Type: text/plain, Size: 719 bytes --]

Hi,

I need some help knowing what to search for / where to look to find 
information on something I want to rebuild after recently loosing access 
to a system with a working config.  (Please don't ask, I can't tell.)

I had a Zsh feature configured such that I could type "sclient<space>" 
and it ZLE (?) would replace that with "openssl s_client".

I'd like to rebuild this functionality on my current system, but I'm not 
sure what Zsh feature this was.  I do know that it wasn't aliase.  I 
also think that it wasn't a function.  I /think/ it was a ZLE tweak.

Will someone point me at what I need to search for in the man page to 
rebuild this functionality?



-- 
Grant. . . .
unix || die


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-02-25 18:50 Looking for a pointer on what to search for to find information on command expansion / substitution Grant Taylor
@ 2023-02-25 18:59 ` Roman Perepelitsa
  2023-02-25 19:20   ` Grant Taylor
  2023-02-27 20:27 ` Lawrence Velázquez
  1 sibling, 1 reply; 8+ messages in thread
From: Roman Perepelitsa @ 2023-02-25 18:59 UTC (permalink / raw)
  To: Grant Taylor; +Cc: Zsh Users List

On Sat, Feb 25, 2023 at 7:51 PM Grant Taylor <gtaylor@tnetconsulting.net> wrote:
>
> I had a Zsh feature configured such that I could type "sclient<space>"
> and it ZLE (?) would replace that with "openssl s_client".

My best guess is that you had the following snippet in .zshrc that
you'd copied from zshwiki.org:

    typeset -gA abbreviations=(
      'sclient' 'openssl s_client'
    )

    magic-abbrev-expand() {
        emulate -L zsh -o extended_glob
        local MATCH
        LBUFFER="${LBUFFER%%(#m)[_a-zA-Z0-9]#}"
        LBUFFER+="${abbreviations[$MATCH]:-$MATCH}"
        zle self-insert
    }

    no-magic-abbrev-expand() {
        LBUFFER+=' '
    }

    zle -N magic-abbrev-expand
    zle -N no-magic-abbrev-expand
    bindkey ' ' magic-abbrev-expand
    bindkey '^x ' no-magic-abbrev-expand

Roman.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-02-25 18:59 ` Roman Perepelitsa
@ 2023-02-25 19:20   ` Grant Taylor
  2023-03-01 21:23     ` Grant Taylor
  0 siblings, 1 reply; 8+ messages in thread
From: Grant Taylor @ 2023-02-25 19:20 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 644 bytes --]

On 2/25/23 11:59 AM, Roman Perepelitsa wrote:
> My best guess is that you had the following snippet in .zshrc that 
> you'd copied from zshwiki.org:

Thank you Roman.  That does seem to function the way that -- I think -- 
I want.

The magic-abbrev-expand() function seems to be more complex than I 
remember.  But perhaps I'm mis-remembering and / or this version is more 
robust than what I was using.

Either way, this does provide the desired functionality.

I will use this as is for now and spend more time learning about the 
components in the coming days.

Thank you again.  :-)



-- 
Grant. . . .
unix || die


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-02-25 18:50 Looking for a pointer on what to search for to find information on command expansion / substitution Grant Taylor
  2023-02-25 18:59 ` Roman Perepelitsa
@ 2023-02-27 20:27 ` Lawrence Velázquez
  2023-02-27 20:31   ` Roman Perepelitsa
  2023-03-01  4:42   ` Grant Taylor
  1 sibling, 2 replies; 8+ messages in thread
From: Lawrence Velázquez @ 2023-02-27 20:27 UTC (permalink / raw)
  To: Grant Taylor; +Cc: zsh-users

On Sat, Feb 25, 2023, at 1:50 PM, Grant Taylor wrote:
> Hi,
>
> I need some help knowing what to search for / where to look to find 
> information on something I want to rebuild after recently loosing access 
> to a system with a working config.  (Please don't ask, I can't tell.)
>
> I had a Zsh feature configured such that I could type "sclient<space>" 
> and it ZLE (?) would replace that with "openssl s_client".
>
> I'd like to rebuild this functionality on my current system, but I'm not 
> sure what Zsh feature this was.  I do know that it wasn't aliase.  I 
> also think that it wasn't a function.  I /think/ it was a ZLE tweak.
>
> Will someone point me at what I need to search for in the man page to 
> rebuild this functionality?

This is exactly the same message you posted two days ago.  Did you
resend it erroneously?  Did you see Roman's reply to the original?

https://www.zsh.org/mla/users/2023/msg00349.html

-- 
vq


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-02-27 20:27 ` Lawrence Velázquez
@ 2023-02-27 20:31   ` Roman Perepelitsa
  2023-03-01  4:42   ` Grant Taylor
  1 sibling, 0 replies; 8+ messages in thread
From: Roman Perepelitsa @ 2023-02-27 20:31 UTC (permalink / raw)
  To: Lawrence Velázquez; +Cc: Grant Taylor, zsh-users

On Mon, Feb 27, 2023 at 9:28 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>
> On Sat, Feb 25, 2023, at 1:50 PM, Grant Taylor wrote:
> >
> > I need some help [...]
>
> This is exactly the same message you posted two days ago.  Did you
> resend it erroneously?  Did you see Roman's reply to the original?

Looks like some kind of email delivery mishap. See below:

On Mon, Feb 27, 2023 at 1:41 AM Grant Taylor <gtaylor@tnetconsulting.net> wrote:
>
> Hi Roman,
>
> I wanted to send you a quick note directly because I realized that my
> message to the Zsh Users List thanking you seems to be stuck somewhere.
>
> Thank you, you quickly got me on the proper path.
>
> Sorry for the delay in responding / acknowledging / thanking you.

Roman.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-02-27 20:27 ` Lawrence Velázquez
  2023-02-27 20:31   ` Roman Perepelitsa
@ 2023-03-01  4:42   ` Grant Taylor
  2023-03-01  4:51     ` Lawrence Velázquez
  1 sibling, 1 reply; 8+ messages in thread
From: Grant Taylor @ 2023-03-01  4:42 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 846 bytes --]

On 2/27/23 1:27 PM, Lawrence Velázquez wrote:
> This is exactly the same message you posted two days ago.  Did you
> resend it erroneously?

I didn't /personally/ re-send it.  But -- as Roman indicated -- it seems 
as if there was some sort of yet unexplained email communications error 
that caused the message to be duplicated - now triplicated.

I've never seen this type of failure before.

There seems to have been a transient routing problem that was causing havoc.

My mail server doesn't think that the message was successfully delivered 
until just a little bit ago.  It's been trying to communicate with 
mail.zsh.org for days but couldn't because of routing problems.

> Did you see Roman's reply to the original?

Yes I did.

As evident by my reply to Roman thanking him.



-- 
Grant. . . .
unix || die


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-03-01  4:42   ` Grant Taylor
@ 2023-03-01  4:51     ` Lawrence Velázquez
  0 siblings, 0 replies; 8+ messages in thread
From: Lawrence Velázquez @ 2023-03-01  4:51 UTC (permalink / raw)
  To: Grant Taylor; +Cc: zsh-users

On Tue, Feb 28, 2023, at 11:42 PM, Grant Taylor wrote:
> On 2/27/23 1:27 PM, Lawrence Velázquez wrote:
>> Did you see Roman's reply to the original?
>
> Yes I did.
>
> As evident by my reply to Roman thanking him.

Which wasn't delivered to the list until two hours ago.

-- 
vq


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Looking for a pointer on what to search for to find information on command expansion / substitution.
  2023-02-25 19:20   ` Grant Taylor
@ 2023-03-01 21:23     ` Grant Taylor
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Taylor @ 2023-03-01 21:23 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

On 2/25/23 12:20 PM, Grant Taylor wrote:
> The magic-abbrev-expand() function seems to be more complex than I 
> remember.  But perhaps I'm mis-remembering and / or this version is more 
> robust than what I was using.

I wanted to provide some follow up on some minor tweaks that I've made 
to be compatible with an older version of Zsh; 4.3.10.

I have changed the following:

     typeset -gA abbreviations=(
       'sclient' 'openssl s_client'
     )

To be:

     typeset -gA abbreviations
     typeset abbreviations=(
       'sclient' 'openssl s_client'
     )

I have also remarked the following:

     emulate -L zsh -o extended_glob

I am indeed getting the desired functionality, even on older versions of 
Zsh.

Thank you again Roman for pointing to the documentation and for the 
solution.



-- 
Grant. . . .
unix || die


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4017 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-01 21:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-25 18:50 Looking for a pointer on what to search for to find information on command expansion / substitution Grant Taylor
2023-02-25 18:59 ` Roman Perepelitsa
2023-02-25 19:20   ` Grant Taylor
2023-03-01 21:23     ` Grant Taylor
2023-02-27 20:27 ` Lawrence Velázquez
2023-02-27 20:31   ` Roman Perepelitsa
2023-03-01  4:42   ` Grant Taylor
2023-03-01  4:51     ` Lawrence Velázquez

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).