From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13290 invoked by alias); 16 Sep 2016 17:21:27 -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: X-Seq: 39363 Received: (qmail 12975 invoked from network); 16 Sep 2016 17:21:27 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.177):SA:0(0.0/5.0):. Processed in 0.11958 secs); 16 Sep 2016 17:21:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:to:subject:mime-version; bh=DGQv2kaemndFFA1cJlWyiUJdNdK1QdEctiJ8ms+RYTg=; b=h2579f1BnaXAQ2M5Ic42bqQYIUEy6rkuILW/qPJC0dm6ERtWvJ/k8ADjKTTsED3nNW 1W1Ha2ZR58j0JqFuUzdCi2vBxMzT/z1Lszoh6SrMyCsZIoJHeEo1qAlI4dgPnG7iONCA Tyk9UiNtcDI3AdbRKlbqzUN47ynB0zc5EKL5e+ALG/z8QrrPmLIjvI2K1SjDCYRfvmys 0DsDv6XbYKCXiZktkEJZ+9QEqXhC58BR4/C2Sl+FVnH4OV61oEkqlkyg2nvSKvLF53OW Nq7eGkeenm+eT2yDrDxLFay7NmbMixaAgyQAT5BGgMBxOMAs3XUyZ5NXF9X6lnR555cM DOqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:to:subject:mime-version; bh=DGQv2kaemndFFA1cJlWyiUJdNdK1QdEctiJ8ms+RYTg=; b=ErL5hN+cuuwWGz1jcrCGHHXbxJ2pDOubjkcWElyYh7rZcTeN14WhxXeQABkKb4JFNx 1fkuKghXqzWTuLclATr65vCii8AqLsuGSO7eWVjkr1v87ywnyKAKPq6Ly1RWgphItZMI KeNUHG0jtWGrxJvgVKYRJ6jkMGO0csia1V+H/4GOSNW0x4vKNNnB6CWIdNbr3W1cjSeg 9c2L2emfJzqZnTCqCEorqqvi12AhcNBGtXOpE6n6qSdPvxymId595P2JrNtYgwja9A6A qATWiwd6XMPKJzm47BL4Ll5+0alYMB8MbRaOA0W0GDsgIRKqWCbu6DruorToJrWAufb9 aIWg== X-Gm-Message-State: AE9vXwObhXUM1FjO9g5CwlxS/EfqrLfooJNVux44KVAGN0qwImovZImCmC6oR7UYFmmLUQ== X-Received: by 10.98.66.212 with SMTP id h81mr24817554pfd.51.1474046481864; Fri, 16 Sep 2016 10:21:21 -0700 (PDT) From: Bart Schaefer Message-Id: <160916102137.ZM11290@torch.brasslantern.com> Date: Fri, 16 Sep 2016 10:21:37 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Off-by-one with select-*-shell-word text object? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Noticed during recent zsh-users thread: torch% quote-this-word() { zle select-in-shell-word; zle quote-region } torch% zle -N quote-this-word torch% bindkey "''" quote-this-word torch% echo foo'' torch% echo' foo' Note the left-quote has now included the space preceding the word. I at first suspected another vi-mode vs. emacs-mode difference, but: torch% bindkey -v "''" quote-this-word torch% bindkey -v torch% echo foo'' torch% echo' foo' Same effect for select-a-shell-word. The right thing happens if I avoid the *-shell-word variant: torch% quote-this-word() { zle select-in-word; zle quote-region } torch% echo foo'' torch% echo 'foo' If including the preceding space is intentional, it should be mentioned in the documentation.