git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] Change octal literals to be XEmacs friendly
@ 2009-01-23 23:20 Vassili Karpov
  2009-01-24  1:31 ` Junio C Hamano
  2009-01-24  1:46 ` Kalle Olavi Niemitalo
  0 siblings, 2 replies; 8+ messages in thread
From: Vassili Karpov @ 2009-01-23 23:20 UTC (permalink / raw)
  To: git, Alexandre Julliard


The type-of ?\octal in XEmacs is character while in FSF Emacs it is
integer. Case expression using this syntax will not work correctly on
XEmacs. #ooctal syntax on the other hand produces integers everywhere.

Signed-off-by: Vassili Karpov <av1474@comtv.ru>
---
  contrib/emacs/git.el |   30 +++++++++++++++---------------
  1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 09e8bae..715580a 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -562,29 +562,29 @@ the process output as a string, or nil if the git 
command failed."
    (let* ((old-type (lsh (or old-perm 0) -9))
  	 (new-type (lsh (or new-perm 0) -9))
  	 (str (case new-type
-		(?\100  ;; file
+		(#o100  ;; file
  		 (case old-type
-		   (?\100 nil)
-		   (?\120 "   (type change symlink -> file)")
-		   (?\160 "   (type change subproject -> file)")))
-		 (?\120  ;; symlink
+		   (#o100 nil)
+		   (#o120 "   (type change symlink -> file)")
+		   (#o160 "   (type change subproject -> file)")))
+		 (#o120  ;; symlink
  		  (case old-type
-		    (?\100 "   (type change file -> symlink)")
-		    (?\160 "   (type change subproject -> symlink)")
+		    (#o100 "   (type change file -> symlink)")
+		    (#o160 "   (type change subproject -> symlink)")
  		    (t "   (symlink)")))
-		  (?\160  ;; subproject
+		  (#o160  ;; subproject
  		   (case old-type
-		     (?\100 "   (type change file -> subproject)")
-		     (?\120 "   (type change symlink -> subproject)")
+		     (#o100 "   (type change file -> subproject)")
+		     (#o120 "   (type change symlink -> subproject)")
  		     (t "   (subproject)")))
-                  (?\110 nil)  ;; directory (internal, not a real git 
state)
-		  (?\000  ;; deleted or unknown
+                  (#o110 nil)  ;; directory (internal, not a real git 
state)
+		  (#o000  ;; deleted or unknown
  		   (case old-type
-		     (?\120 "   (symlink)")
-		     (?\160 "   (subproject)")))
+		     (#o120 "   (symlink)")
+		     (#o160 "   (subproject)")))
  		  (t (format "   (unknown type %o)" new-type)))))
      (cond (str (propertize str 'face 'git-status-face))
-          ((eq new-type ?\110) "/")
+          ((eq new-type #o110) "/")
            (t ""))))

  (defun git-rename-as-string (info)
-- 
1.6.0.2.GIT



-- 
mailto:av1474@comtv.ru

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
  2009-01-23 23:20 [PATCH v2] Change octal literals to be XEmacs friendly Vassili Karpov
@ 2009-01-24  1:31 ` Junio C Hamano
  2009-01-24  1:46 ` Kalle Olavi Niemitalo
  1 sibling, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2009-01-24  1:31 UTC (permalink / raw)
  To: Vassili Karpov; +Cc: git, Alexandre Julliard

Vassili Karpov <av1474@comtv.ru> writes:

Please don't use "format=flowed"; your patch is whitespace damaged and
does not apply.

> The type-of ?\octal in XEmacs is character while in FSF Emacs it is
> integer. Case expression using this syntax will not work correctly on
> XEmacs. #ooctal syntax on the other hand produces integers everywhere.
>
> Signed-off-by: Vassili Karpov <av1474@comtv.ru>
> ---
>  contrib/emacs/git.el |   30 +++++++++++++++---------------
>  1 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
> index 09e8bae..715580a 100644
> --- a/contrib/emacs/git.el
> +++ b/contrib/emacs/git.el
> @@ -562,29 +562,29 @@ the process output as a string, or nil if the
> git command failed."
>    (let* ((old-type (lsh (or old-perm 0) -9))
>  	 (new-type (lsh (or new-perm 0) -9))
>  	 (str (case new-type
> -		(?\100  ;; file
> +		(#o100  ;; file
>  		 (case old-type
> -		   (?\100 nil)
> -		   (?\120 "   (type change symlink -> file)")
> -		   (?\160 "   (type change subproject -> file)")))
> -		 (?\120  ;; symlink
> +		   (#o100 nil)
> +		   (#o120 "   (type change symlink -> file)")
> +		   (#o160 "   (type change subproject -> file)")))
> +		 (#o120  ;; symlink
>  		  (case old-type
> -		    (?\100 "   (type change file -> symlink)")
> -		    (?\160 "   (type change subproject -> symlink)")
> +		    (#o100 "   (type change file -> symlink)")
> +		    (#o160 "   (type change subproject -> symlink)")
>  		    (t "   (symlink)")))
> -		  (?\160  ;; subproject
> +		  (#o160  ;; subproject
>  		   (case old-type
> -		     (?\100 "   (type change file -> subproject)")
> -		     (?\120 "   (type change symlink -> subproject)")
> +		     (#o100 "   (type change file -> subproject)")
> +		     (#o120 "   (type change symlink -> subproject)")
>  		     (t "   (subproject)")))
> -                  (?\110 nil)  ;; directory (internal, not a real git
> state)
> -		  (?\000  ;; deleted or unknown
> +                  (#o110 nil)  ;; directory (internal, not a real git
> state)
> +		  (#o000  ;; deleted or unknown
>  		   (case old-type
> -		     (?\120 "   (symlink)")
> -		     (?\160 "   (subproject)")))
> +		     (#o120 "   (symlink)")
> +		     (#o160 "   (subproject)")))
>  		  (t (format "   (unknown type %o)" new-type)))))
>      (cond (str (propertize str 'face 'git-status-face))
> -          ((eq new-type ?\110) "/")
> +          ((eq new-type #o110) "/")
>            (t ""))))
>
>  (defun git-rename-as-string (info)
> -- 
> 1.6.0.2.GIT
>
>
>
> -- 
> mailto:av1474@comtv.ru
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
  2009-01-23 23:20 [PATCH v2] Change octal literals to be XEmacs friendly Vassili Karpov
  2009-01-24  1:31 ` Junio C Hamano
@ 2009-01-24  1:46 ` Kalle Olavi Niemitalo
  2009-01-24  2:01   ` malc
  2009-01-26 22:59   ` Alexandre Julliard
  1 sibling, 2 replies; 8+ messages in thread
From: Kalle Olavi Niemitalo @ 2009-01-24  1:46 UTC (permalink / raw)
  To: git

Vassili Karpov <av1474@comtv.ru> writes:

> #ooctal syntax on the other hand produces integers everywhere.

GNU Emacs 20.7 doesn't support #o, but neither does it include
the ewoc and log-edit libraries required by the current git.el.

It would be nice to have a comment in git.el saying which
versions of Emacs and XEmacs it is supposed to support, but I
guess people wouldn't bother testing those on every commit.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] Change octal literals to be XEmacs friendly
@ 2009-01-24  1:52 malc
  0 siblings, 0 replies; 8+ messages in thread
From: malc @ 2009-01-24  1:52 UTC (permalink / raw)
  To: git


The type-of ?\octal in XEmacs is character while in FSF Emacs it is
integer. Case expression using this syntax will not work correctly on
XEmacs. #ooctal syntax on the other hand produces integers everywhere.

Signed-off-by: Vassili Karpov <av1474@comtv.ru>
---
 contrib/emacs/git.el |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 09e8bae..715580a 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -562,29 +562,29 @@ the process output as a string, or nil if the git command failed."
   (let* ((old-type (lsh (or old-perm 0) -9))
 	 (new-type (lsh (or new-perm 0) -9))
 	 (str (case new-type
-		(?\100  ;; file
+		(#o100  ;; file
 		 (case old-type
-		   (?\100 nil)
-		   (?\120 "   (type change symlink -> file)")
-		   (?\160 "   (type change subproject -> file)")))
-		 (?\120  ;; symlink
+		   (#o100 nil)
+		   (#o120 "   (type change symlink -> file)")
+		   (#o160 "   (type change subproject -> file)")))
+		 (#o120  ;; symlink
 		  (case old-type
-		    (?\100 "   (type change file -> symlink)")
-		    (?\160 "   (type change subproject -> symlink)")
+		    (#o100 "   (type change file -> symlink)")
+		    (#o160 "   (type change subproject -> symlink)")
 		    (t "   (symlink)")))
-		  (?\160  ;; subproject
+		  (#o160  ;; subproject
 		   (case old-type
-		     (?\100 "   (type change file -> subproject)")
-		     (?\120 "   (type change symlink -> subproject)")
+		     (#o100 "   (type change file -> subproject)")
+		     (#o120 "   (type change symlink -> subproject)")
 		     (t "   (subproject)")))
-                  (?\110 nil)  ;; directory (internal, not a real git state)
-		  (?\000  ;; deleted or unknown
+                  (#o110 nil)  ;; directory (internal, not a real git state)
+		  (#o000  ;; deleted or unknown
 		   (case old-type
-		     (?\120 "   (symlink)")
-		     (?\160 "   (subproject)")))
+		     (#o120 "   (symlink)")
+		     (#o160 "   (subproject)")))
 		  (t (format "   (unknown type %o)" new-type)))))
     (cond (str (propertize str 'face 'git-status-face))
-          ((eq new-type ?\110) "/")
+          ((eq new-type #o110) "/")
           (t ""))))
 
 (defun git-rename-as-string (info)
-- 
1.6.0.2.GIT


-- 
mailto:av1474@comtv.ru

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
  2009-01-24  1:46 ` Kalle Olavi Niemitalo
@ 2009-01-24  2:01   ` malc
  2009-01-24  5:16     ` Junio C Hamano
  2009-01-26 22:59   ` Alexandre Julliard
  1 sibling, 1 reply; 8+ messages in thread
From: malc @ 2009-01-24  2:01 UTC (permalink / raw)
  To: git

Kalle Olavi Niemitalo <kon@iki.fi> writes:

> Vassili Karpov <av1474@comtv.ru> writes:
>
>> #ooctal syntax on the other hand produces integers everywhere.
>
> GNU Emacs 20.7 doesn't support #o, but neither does it include

Bummer

> the ewoc and log-edit libraries required by the current git.el.

ewoc and log-edit are not part of XEmacs 21.4.20 (the version i am
using), furthermore make-temp-file is not available either, but those
problems, unlike the case/eql/literals issue, can be resolved without
touching git.el (One might argue that case can be fixed with defadvice
or other hackery, but that's a bit too much)

> It would be nice to have a comment in git.el saying which
> versions of Emacs and XEmacs it is supposed to support, but I
> guess people wouldn't bother testing those on every commit.

Well it doesn't "support" XEmacs at all.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
  2009-01-24  2:01   ` malc
@ 2009-01-24  5:16     ` Junio C Hamano
  2009-01-24 14:18       ` malc
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2009-01-24  5:16 UTC (permalink / raw)
  To: malc; +Cc: git

malc@pulsesoft.com writes:

> Kalle Olavi Niemitalo <kon@iki.fi> writes:
>
>> Vassili Karpov <av1474@comtv.ru> writes:
>>
>>> #ooctal syntax on the other hand produces integers everywhere.
>>
>> GNU Emacs 20.7 doesn't support #o, but neither does it include
>
> Bummer

To be portable you could certainly spell them in decimal integers, no?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
  2009-01-24  5:16     ` Junio C Hamano
@ 2009-01-24 14:18       ` malc
  0 siblings, 0 replies; 8+ messages in thread
From: malc @ 2009-01-24 14:18 UTC (permalink / raw)
  To: git

Junio C Hamano <gitster@pobox.com> writes:

> malc@pulsesoft.com writes:
>
>> Kalle Olavi Niemitalo <kon@iki.fi> writes:
>>
>>> Vassili Karpov <av1474@comtv.ru> writes:
>>>
>>>> #ooctal syntax on the other hand produces integers everywhere.
>>>
>>> GNU Emacs 20.7 doesn't support #o, but neither does it include
>>
>> Bummer
>
> To be portable you could certainly spell them in decimal integers, no?

Sure.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] Change octal literals to be XEmacs friendly
  2009-01-24  1:46 ` Kalle Olavi Niemitalo
  2009-01-24  2:01   ` malc
@ 2009-01-26 22:59   ` Alexandre Julliard
  1 sibling, 0 replies; 8+ messages in thread
From: Alexandre Julliard @ 2009-01-26 22:59 UTC (permalink / raw)
  To: Kalle Olavi Niemitalo; +Cc: git

Kalle Olavi Niemitalo <kon@iki.fi> writes:

> Vassili Karpov <av1474@comtv.ru> writes:
>
>> #ooctal syntax on the other hand produces integers everywhere.
>
> GNU Emacs 20.7 doesn't support #o, but neither does it include
> the ewoc and log-edit libraries required by the current git.el.
>
> It would be nice to have a comment in git.el saying which
> versions of Emacs and XEmacs it is supposed to support, but I
> guess people wouldn't bother testing those on every commit.

I try to make sure that it still works with Emacs 21, but for older
versions you're on your own. Of course if you find problems patches are
welcome...

-- 
Alexandre Julliard
julliard@winehq.org

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-01-26 23:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-23 23:20 [PATCH v2] Change octal literals to be XEmacs friendly Vassili Karpov
2009-01-24  1:31 ` Junio C Hamano
2009-01-24  1:46 ` Kalle Olavi Niemitalo
2009-01-24  2:01   ` malc
2009-01-24  5:16     ` Junio C Hamano
2009-01-24 14:18       ` malc
2009-01-26 22:59   ` Alexandre Julliard
  -- strict thread matches above, loose matches on Subject: below --
2009-01-24  1:52 malc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).