git.el: Portability fixes for XEmacs and Emacs CVS.
Fixed octal constants for XEmacs. Added highlighting support in log-edit buffer for Emacs CVS. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Alexandre Julliard committed
Mar 4, 2006 at 17:37 UTC
18e3e99e3d0e838608eea7fe452366c4c57ef32e
1 file changed
+10
-4
contrib/emacs/git.el
+10
-4
@@ -388,9 +388,9 @@ If not set, fall back to `add-log-mailing-address' and then `user-mail-address'.
388
(propertize
389
(if (or (not old-perm)
390
(not new-perm)
391
- (eq 0 (logand #O111 (logxor old-perm new-perm))))
391
+ (eq 0 (logand ?\111 (logxor old-perm new-perm))))
392
" "
393
- (if (eq 0 (logand #O111 old-perm)) "+x" "-x"))
393
+ (if (eq 0 (logand ?\111 old-perm)) "+x" "-x"))
394
'face 'git-permission-face))
395
396
(defun git-fileinfo-prettyprint (info)
@@ -806,7 +806,13 @@ If not set, fall back to `add-log-mailing-address' and then `user-mail-address'.
806
"\n")
807
(when (and merge-heads (file-readable-p ".git/MERGE_MSG"))
808
(insert-file-contents ".git/MERGE_MSG"))))
809
- (log-edit #'git-do-commit nil #'git-log-edit-files buffer)))
809
+ (let ((log-edit-font-lock-keywords
810
+ `(("^\\(Author:\\|Date:\\|Parent:\\)\\(.*\\)"
811
+ (1 font-lock-keyword-face)
812
+ (2 font-lock-function-name-face))
813
+ (,(concat "^\\(" (regexp-quote git-log-msg-separator) "\\)$")
814
+ (1 font-lock-comment-face)))))
815
+ (log-edit #'git-do-commit nil #'git-log-edit-files buffer))))
816
817
(defun git-find-file ()
818
"Visit the current file in its own buffer."
@@ -891,7 +897,7 @@ If not set, fall back to `add-log-mailing-address' and then `user-mail-address'.
897
(define-key map "d" diff-map)
898
(define-key map "=" 'git-diff-file)
899
(define-key map "f" 'git-find-file)
894
- (define-key map [RET] 'git-find-file)
900
+ (define-key map "\r" 'git-find-file)
901
(define-key map "g" 'git-refresh-status)
902
(define-key map "i" 'git-ignore-file)
903
(define-key map "l" 'git-log-file)