From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Samer Masterson Newsgroups: gmane.emacs.bugs Subject: bug#8531: 24.0.50; Date: Tue, 24 Feb 2015 02:51:29 -0800 Message-ID: <1424775089.11596.4@mail.samertm.com> References: <8762q8xe3i.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-gEzGzcyui/y9YOYZoGrz" X-Trace: ger.gmane.org 1424775152 1523 80.91.229.3 (24 Feb 2015 10:52:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Feb 2015 10:52:32 +0000 (UTC) To: 8531@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Feb 24 11:52:14 2015 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 1YQD65-0001q0-Kh for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Feb 2015 11:52:13 +0100 Original-Received: from localhost ([::1]:48615 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQD65-0000oh-1s for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Feb 2015 05:52:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50440) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQD5z-0000nU-SC for bug-gnu-emacs@gnu.org; Tue, 24 Feb 2015 05:52:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YQD5u-0002Kf-So for bug-gnu-emacs@gnu.org; Tue, 24 Feb 2015 05:52:07 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YQD5u-0002Kb-OF for bug-gnu-emacs@gnu.org; Tue, 24 Feb 2015 05:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YQD5u-0003AH-Gi for bug-gnu-emacs@gnu.org; Tue, 24 Feb 2015 05:52:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <8762q8xe3i.fsf@gmail.com> Resent-From: Samer Masterson Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Feb 2015 10:52: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: patch Original-Received: via spool by 8531-submit@debbugs.gnu.org id=B8531.142477511112144 (code B ref 8531); Tue, 24 Feb 2015 10:52:02 +0000 Original-Received: (at 8531) by debbugs.gnu.org; 24 Feb 2015 10:51:51 +0000 Original-Received: from localhost ([127.0.0.1]:56305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQD5f-00039k-8I for submit@debbugs.gnu.org; Tue, 24 Feb 2015 05:51:50 -0500 Original-Received: from ec2-52-0-7-12.compute-1.amazonaws.com ([52.0.7.12]:60123 helo=samertm.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YQD5Z-00039F-HX for 8531@debbugs.gnu.org; Tue, 24 Feb 2015 05:51:45 -0500 Original-Received: from [10.1.10.35] (c-98-210-154-226.hsd1.ca.comcast.net [98.210.154.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by samertm.com (Postfix) with ESMTPSA id 85B1042D27 for <8531@debbugs.gnu.org>; Tue, 24 Feb 2015 10:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samertm.com; s=mail; t=1424775088; bh=WFYF11G4K+bU/SVPu+c2Vj5Tfa4ZhmddRP8/4NHFnm4=; h=Date:From:Subject:To:From; b=qJhUH+jiLINNu7rBwpbrisoqrsV8QJIFNim4r4wrLv2pGglKM8E9W/9Z9WvTu+EEB LWZmmINpzPRiq6ko9gvan+tN8i0ZIdF6E7QLJcgC6p0h15PfmIViQ5ThFoaO2/I+ZP DOhAe0qrqxbAlp2XtApFec2b/l1si7s6AY1hqcEw= X-Mailer: geary/0.8.3 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:99759 Archived-At: --=-gEzGzcyui/y9YOYZoGrz Content-Type: text/plain; charset=utf-8; format=flowed Hi, My copyright papers have been processed. Can we apply this to master? 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 dark-horse> + + * NEWS: Mention change in backslash expand behavior for eshell. + 2014-12-08 Lars Magne Ingebrigtsen gnus.org> * 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 samertm.com> + + * 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 gnus.org> * 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!" --=-gEzGzcyui/y9YOYZoGrz Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Hi,

My copyright papers have been processed. = Can we apply this to master?

Best,
Samer=

Changes from master to working tree
4 f= iles changed, 26 insertions(+), 22 deletions(-)
 etc/ChangeL= og          |  4 ++++
 etc/NEW= S               |  6 ++++++
 lisp/ChangeLog         |  7 +++++++=
 lisp/eshell/esh-arg.el | 31 +++++++++----------------------

Modified   etc/ChangeLog
diff --git a/etc/ChangeL= og b/etc/ChangeLog
index 309c01f..3e76256 100644
--- a/= etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,7 @@
=
+2014-12-08  Samer Masterson  <samer <at> dark-hors= e>
+
+ * NEWS: Mention change in backslash expand behavior for = eshell.
+
 2014-12-08  Lars Magne Ingebrigtse= n  <larsi <at> gnus.org>

  * NEWS: Ment= ion 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 m= ode 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<= /div>
+not a special character). This behavior conforms with bash.
+
 ** eww

 +++
Modified =   lisp/ChangeLog
diff --git a/lisp/ChangeLog b/lisp/ChangeLo= g
index 2669e07..0ec9b35 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2014-12-= 08  Samer Masterson  <samer <at> samertm.com>
+
+ <= /span>* eshell/esh-arg.el (eshell-parse-backslash): Return the literal
+ cha= racter after the backslash if the character is non-special
+ (bug#8531).
+ (e= shell-looking-at-backslash-return): Unused, remove.
+
&= nbsp;2014-12-08  Lars Magne Ingebrigtsen  <larsi <at> gn= us.org>

  * 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."<= /div>
  <= /span>  (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 chara= cter literal if it is non-special
    'eshell-parse-bac= kslash

    ;; text beginning with ' is a= literally quoted
@@ -282,13 +283,6 @@ Point is left at the end o= f the arguments."
   "A stub function that generates an= error if a floating operator is 
found."
  &= nbsp;(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 (=3D (1+ pos= ) (point-max))
-   (and (eq (char-after (1+ pos)) ?\n)
- (=3D (+ pos 2= ) (point-max))))))
-
 (defun eshell-quote-backslas= h (string &optional index)
   "Intelligently backsl= ash the character occurring in STRING at INDEX.
 If the char= acter is itself a backslash, it needs no escaping."
@@ -305,9 +29= 9,11 @@ If the character is itself a backslash, it needs no 
escaping."
   (string ?\\ char)))))

&nb= sp;(defun eshell-parse-backslash ()
-  "Parse a single backs= lash (\) character, which might mean escape.
-It only means escap= e if the character immediately following is a
-special character = that is not itself a backslash."
+  "Parse a single backslas= h (\) character to escape the character 
after.
+I= f the character immediately following the backslash is a special
= +character, it returns the escaped version of that character.
+El= se, 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-look= ing-at-backslash-return (point))
  (throw 'eshell-incomplete ?\\)
=
@@ -321,18 +317,9 @@ special character that is not itself a backslash.= "
 =    (forward-char 2)
     (list 'eshell-es= cape-arg
   (char-to-string (char-before))))
- ;; allow \\<RET= > to mean a literal "\" character followed by a
- ;; normal return, rat= her than a backslash followed by a line
- ;; continuation (i.e., "\\ + \n" r= ather than "\ + \\n").  This
- ;; is necessary because backslashes in E= shell 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-fe= eling).
- (if (eshell-looking-at-backslash-return (1+ (point)))
-<= span class=3D"Apple-tab-span" style=3D"white-space:pre">   &nb= sp;(forward-char))
  (forward-char)
- "\\"))))
+ (forward-char)
+ (char-be= fore)))))

 (defun eshell-parse-literal-quote = ()
   "Parse a literally quoted string.  Nothing h= as special meaning!"
= --=-gEzGzcyui/y9YOYZoGrz--