Conflict between 'legend specfile' and 'plot -l'

In order to plot an own symbol via legend, I would like to combine gmt plot -l and gmt legend specfile commands in modern mode. But in a given begin–end environment legend ignores the specfile if, in a previous plot command, the -l flag was given:

gmt begin a pdf
        gmt basemap -JX5/5 -R0/5/0/4 -BEWSN
        echo "-1 -1" | gmt plot -Sx0.2 -Wthick -l'blub'
        gmt legend -DjTL+o0.25c/0c <<- END
        S - x 0.0787402i - thick,black - nominal height 
        END
gmt end show

This results in “blub” is written instead of “nominal height” into the legend. The flag -M also does not help here, as in this case both information is considered: “blub” and “nominal height” are written.
Is their a possibility to force legend to ignore the hidden auto-legend information?

I am using gmt 6.3 on linux.

btw. from the manual it should work but also with -Me both, hidden and explicit information is read. So, is it a bug?

Well, you are actually not giving any spec file - you are expecting legend to somehow know it should read stdin. If you instead save that info to a file and pass it to legend and use -M then both things show.

See -M to ignore one or the other.

Thanks for the quick answer, but the problem remains.

gmt begin a pdf
        gmt basemap -JX5/5 -R0/5/0/4 -BEWSN
        echo "-1 -1" | gmt plot -Sx0.2 -Wthick -l'blub'
        gmt legend -DjTL+o0.25c/0c
<<- END
        S - x 0.0787402i - thick,black - nominal height 
        END
gmt end show

Well, did you make the changes? What you just pasted is still the wrong way of doing it - read my email above.

sorry tiping error
The problem remains

gmt begin a pdf
        gmt basemap -JX5/5 -R0/5/0/4 -BEWSN
        echo "-1 -1" | gmt plot -Sx0.2 -Wthick -l'blub'
        cat <<- END > legend.txt
        S - x 0.0787402i - thick,black - nominal height 
        END
        gmt legend -DjTL+o0.25c/0c -Me legend.txt
gmt end show

results in the same output both entries appear in the legend.

Works for me - only nominal height shows. What GMT version are you using?

6.3.0

The golden rule of GMT is to always run the very latest. This is the output of your script (changed to PNG for showing here) when I run it on master branch (6.5). That is what you expect, no?:

This is what I expected. So I have a motivation to update. But I depend a bit on my sysadmins regarding updates of the system. So I wanted to check first, where the error came from. So thanks a lot for the quick assist.

Addendum: Careful reading of the version related man pages, showed it also, -M[eh] was implemented in 6.4.0.