From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: samer Newsgroups: gmane.emacs.bugs Subject: bug#8531: 24.0.50; Date: Mon, 08 Dec 2014 16:15:17 -0800 Message-ID: <92a38c617b988742e23fc909e497975a@samertm.com> References: <8762q8xe3i.fsf@gmail.com> <803b223f5dd871db67cab3b46e8b6d3a@samertm.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1418084183 1607 80.91.229.3 (9 Dec 2014 00:16:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 9 Dec 2014 00:16:23 +0000 (UTC) To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 09 01:16:16 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Xy8TP-0007NI-T2 for geb-bug-gnu-emacs@m.gmane.org; Tue, 09 Dec 2014 01:16:16 +0100 Original-Received: from localhost ([::1]:36852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xy8TP-0006yu-AJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 08 Dec 2014 19:16:15 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xy8TH-0006yc-Os for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 19:16:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xy8TC-00048c-Ub for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 19:16:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:32845) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xy8TC-00048W-QP for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 19:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xy8TC-0007Xg-7u for bug-gnu-emacs@gnu.org; Mon, 08 Dec 2014 19:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: samer Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Dec 2014 00:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8531 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8531-submit@debbugs.gnu.org id=B8531.141808415328974 (code B ref 8531); Tue, 09 Dec 2014 00:16:02 +0000 Original-Received: (at 8531) by debbugs.gnu.org; 9 Dec 2014 00:15:53 +0000 Original-Received: from localhost ([127.0.0.1]:58291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy8Sz-0007XC-Sh for submit@debbugs.gnu.org; Mon, 08 Dec 2014 19:15:53 -0500 Original-Received: from samertm.com ([162.243.37.26]:32880 helo=mail.samertm.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xy8St-0007X0-Vc for 8531@debbugs.gnu.org; Mon, 08 Dec 2014 19:15:48 -0500 Original-Received: from samertm.com (localhost [127.0.0.1]) by mail.samertm.com (Postfix) with ESMTP id C95CF81E4D; Tue, 9 Dec 2014 00:15:17 +0000 (UTC) In-Reply-To: X-Sender: samer@samertm.com User-Agent: Roundcube Webmail/0.9.5 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:97047 Archived-At: Forgot to CC debbugs in my previous email: This is the full patch, generated with magit because I couldn't commit this to a private branch (I get "Empty change log entry" even though I've changed both ChangeLog files. I don't know awk, do you have any idea why I would get that error?) Best, Samer Changes from master to working tree 4 files changed, 26 insertions(+), 22 deletions(-) etc/ChangeLog | 4 ++++ etc/NEWS | 6 ++++++ lisp/ChangeLog | 7 +++++++ lisp/eshell/esh-arg.el | 31 +++++++++---------------------- Modified etc/ChangeLog diff --git a/etc/ChangeLog b/etc/ChangeLog index 309c01f..3e76256 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,7 @@ +2014-12-08 Samer Masterson + + * NEWS: Mention change in backslash expand behavior for eshell. + 2014-12-08 Lars Magne Ingebrigtsen * NEWS: Mention the new eww `S' command. Modified etc/NEWS diff --git a/etc/NEWS b/etc/NEWS index 56036f8..e6d9aab 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -192,6 +192,12 @@ result of the calculation into the current buffer. *** New minor mode global-eldoc-mode *** eldoc-documentation-function now defaults to nil +** eshell + +*** Backslash (\) expands to the character literal after it if that +character is non-special (e.g. 'b\in' expands to 'bin', because 'i' is +not a special character). This behavior conforms with bash. + ** eww +++ Modified lisp/ChangeLog diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2669e07..0ec9b35 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2014-12-08 Samer Masterson + + * eshell/esh-arg.el (eshell-parse-backslash): Return the literal + character after the backslash if the character is non-special + (bug#8531). + (eshell-looking-at-backslash-return): Unused, remove. + 2014-12-08 Lars Magne Ingebrigtsen * net/nsm.el (nsm-check-protocol): Test for RC4 on `high'. Modified lisp/eshell/esh-arg.el diff --git a/lisp/eshell/esh-arg.el b/lisp/eshell/esh-arg.el index 704de57..33ff384 100644 --- a/lisp/eshell/esh-arg.el +++ b/lisp/eshell/esh-arg.el @@ -89,7 +89,8 @@ yield the values intended." (goto-char (match-end 0)) (eshell-finish-arg))))) - ;; backslash before a special character means escape it + ;; backslash before a character escapes it if the character is + ;; special, and returns the character literal if it is non-special 'eshell-parse-backslash ;; text beginning with ' is a literally quoted @@ -282,13 +283,6 @@ Point is left at the end of the arguments." "A stub function that generates an error if a floating operator is found." (error "Unhandled operator in input text")) -(defsubst eshell-looking-at-backslash-return (pos) - "Test whether a backslash-return sequence occurs at POS." - (and (eq (char-after pos) ?\\) - (or (= (1+ pos) (point-max)) - (and (eq (char-after (1+ pos)) ?\n) - (= (+ pos 2) (point-max)))))) - (defun eshell-quote-backslash (string &optional index) "Intelligently backslash the character occurring in STRING at INDEX. If the character is itself a backslash, it needs no escaping." @@ -305,9 +299,11 @@ If the character is itself a backslash, it needs no escaping." (string ?\\ char))))) (defun eshell-parse-backslash () - "Parse a single backslash (\) character, which might mean escape. -It only means escape if the character immediately following is a -special character that is not itself a backslash." + "Parse a single backslash (\) character to escape the character after. +If the character immediately following the backslash is a special +character, it returns the escaped version of that character. +Else, the character has no meaning and is returned as the literal +character. This conforms with the behavior of bash." (when (eq (char-after) ?\\) (if (eshell-looking-at-backslash-return (point)) (throw 'eshell-incomplete ?\\) @@ -321,18 +317,9 @@ special character that is not itself a backslash." (forward-char 2) (list 'eshell-escape-arg (char-to-string (char-before)))) - ;; allow \\ to mean a literal "\" character followed by a - ;; normal return, rather than a backslash followed by a line - ;; continuation (i.e., "\\ + \n" rather than "\ + \\n"). This - ;; is necessary because backslashes in Eshell are not special - ;; unless they either precede something special, or precede a - ;; backslash that precedes something special. (Mainly this is - ;; done to make using backslash on Windows systems more - ;; natural-feeling). - (if (eshell-looking-at-backslash-return (1+ (point))) - (forward-char)) (forward-char) - "\\")))) + (forward-char) + (char-before))))) (defun eshell-parse-literal-quote () "Parse a literally quoted string. Nothing has special meaning!"