zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: PATCH v2 (complete): Implement zle -P
Date: Mon, 31 Aug 2015 23:53:45 -0700	[thread overview]
Message-ID: <150831235345.ZM1001@torch.brasslantern.com> (raw)
In-Reply-To: <1441087664-9081-1-git-send-email-mikachu@gmail.com>

I'd forgotten that I originally suggested "zle -P" ...

On Sep 1,  8:07am, Mikael Magnusson wrote:
}
} I can now do this (which is why I originally found this old thread, if
} anyone was curious):
} 
} function _start_paste() {
}   local content
}   local a b
}   local oldcutbuf="$CUTBUFFER"
}   # I haven't quite decided how I want to control quoting yet.
}   [[ $_SPACE_AFTER_PASTE_QUOTE = 1 ]]; a=$?
}   (( $+NUMERIC )) || [[ $KEYS = $'\e\e'* ]]; b=$?
}   zle .$WIDGET -N content
}   if [[ $a -ne $b ]]; then
}     CUTBUFFER=${(q-)content}' '
}   else
}     CUTBUFFER=$content
}   fi
}   zle .yank
}   CUTBUFFER="$oldcutbuf"
} }
} zle -P bracketed-paste bracketed-paste _start_paste

So I think this is:

autoload -Uz bracketed-paste-magic
zle -N bracketed-paste bracketed-paste-magic
zstyle :bracketed-paste-magic paste-finish quote-paste
zstyle -e :bracketed-paste-magic:finish quote-style \
    '() { local a b;
          [[ $_SPACE_AFTER_PASTE_QUOTE = 1 ]]; a=$?;
          (( $+NUMERIC )) || [[ $KEYS = $'\''\e\e'\''* ]]; b=$? ;
          [[ $a -ne $b ]] } && reply=(q-) || reply=(none)'

BTW what's the point of doing "zle .$WIDGET ..." when the only widget
this can possibly work with is .bracketed-paste ?


  reply	other threads:[~2015-09-01  6:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01  6:07 Mikael Magnusson
2015-09-01  6:53 ` Bart Schaefer [this message]
2015-09-01  9:50 ` Oliver Kiddle
2015-09-01 10:03   ` Peter Stephenson
2015-09-06  9:50     ` Daniel Shahaf
2015-09-06 11:51       ` Mikael Magnusson
2015-09-01 23:32   ` Bart Schaefer
2015-09-03 10:38     ` PATCH: zle -f from inside widget to set flags Mikael Magnusson
2015-09-03 10:40       ` Mikael Magnusson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150831235345.ZM1001@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).