Hi Christian,
On Tue, Nov 30, 2010 at 04:38:27PM +0100, Christian Ebert wrote:
> But don't you have the logic in place already:
>
> $SCREEN "${screen_op...@]}" -p "$screen_window_name" -X eval "select
> '$screen_window_name'" "stuff \"$jump_cmd\""
> if [ $? != 0 ] ; then
> # instead of dying:
> # 1) check $STY
> # 2) check screen -ls
> # if ok; then screen -X ...
> # else launch term or die
> fi
The problem is that the command returns 0 even if there exists no
window named "$screen_window_name". And I don't know how to get a
listing of all windows of a screen session in bash (`screen -ls` just
lists the sessions). Advice would be greatly appreciated :-)!
> >> P.S. wrt is_callable: if you do not use the full path, you don't
> >> need the -p option for type.
> >
> > I used it as a way to silence stderr. But maybe it would be cleaner to
> > just use `type $1 >/dev/null 2>&1`.
>
> Or use the full executable path:
>
> MUTT=`type -p mutt`
> if [ -z "$MUTT" ]; then
> die "$MUTT is not in PATH, set MUTT variable"
> fi
I could do that, but if `type -p` can find the full path, so can bash
itself (after all, type is a builtin unlike "which"). So nothing would
be gained :-).
> While we are at it:
>
> diff --git a/muttjump b/muttjump
> index cb7e4fb..f2b7ec7 100755
> --- a/muttjump
> +++ b/muttjump
> @@ -40,7 +40,7 @@ MUTTJUMP_MULTI_SCREEN_MODE=${MUTTJUMP_MULTI_SCREEN_MODE:-no}
> MUTTJUMP_SCREEN_SESSION=${MUTTJUMP_SCREEN_SESSION:-}
>
> # function to create the screen window name from the full path of the mailbox
> -if ! type MUTTJUMP_SCREEN_WINDOW_NAME_MANGLE >/dev/null 2>&1 ; then
> +if ! type $MUTTJUMP_SCREEN_WINDOW_NAME_MANGLE >/dev/null 2>&1 ; then
> function MUTTJUMP_SCREEN_WINDOW_NAME_MANGLE () {
> basename "$1"
> }
>
>
> ...
Applied, thanks!
> btw: Does the <enter><enter> in the Mutt macro work for you? For
> me the second one seems to have no effect.
Yes, otherwise I would manually have to press enter! What does "no
effect" mean? Do you also have to press enter, or is it working with
just one <enter>? I used it successfully with mutt 1.5.20 and 1.5.21!
Johannes
pgpamKfCZthyQ.pgp
Description: PGP signature
