Permalink
Browse files

Fixed some bugs

  • Loading branch information...
1 parent 7dbc0e8 commit 1517f1aa50119401f7f37a913ecc7442bbe8f1ad berndl committed Jun 20, 2009
Showing with 60 additions and 30 deletions.
  1. +4 −1 NEWS
  2. +19 −3 ecb-layout.el
  3. +4 −10 ecb-symboldef.el
  4. +22 −10 ecb-util.el
  5. +11 −6 tree-buffer.el
View
5 NEWS
@@ -1,6 +1,6 @@
* Changes for ECB version 2.40.1
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: add this to the texi
+TODO: Klaus Berndl <klaus.berndl@sdm.de>: add this to the texi
** ECB now uses the partial reparse feature of semantic
@@ -72,6 +72,9 @@
buffer is maximized and the history buffer thus hidden). This is fixed
now.
+*** All compile-modes (e.g. compile, grep etc.) failed in XEmacs
+ This came from a bug introduced in 2.40 but it is fixed now.
+
* Changes for ECB version 2.40
** ECB now requires full CEDET-suite being installed (at least version 1.0pre6)
View
@@ -2986,6 +2986,21 @@ So never a dedicated window is returned during activated ECB."
)
+(defun ecb-compile-bug-test ()
+ (interactive)
+ (let ((buffer-save (current-buffer))
+ (tempbuf (get-buffer-create "klausimausi"))
+ (win-list nil))
+ (unwind-protect
+ (progn
+ (set-buffer tempbuf)
+ (message "Klausi-1: curr-buf:%s" (current-buffer))
+ (setq win-list (ecb-canonical-windows-list))
+ ;; (setq win-list (ecb-window-list))
+ (message "Klausi-1: curr-buf:%s" (current-buffer))
+ )
+ (set-buffer buffer-save))))
+
;; This advice is the heart of the mechanism which displays all buffer in the
;; compile-window if they are are "compilation-buffers" in the sense of
;; `ecb-compilation-buffer-p'!
@@ -3165,8 +3180,8 @@ If called for other frames it works like the original version."
ad-do-it)))
((not (ecb-buffer-is-dedicated-special-buffer-p (ad-get-arg 0)))
- (ecb-layout-debug-error "display-buffer for normal buffer: %s"
- (ad-get-arg 0))
+ (ecb-layout-debug-error "display-buffer for normal buffer:%s,current buffer:%s"
+ (ad-get-arg 0) (current-buffer))
(let ((edit-win-list (ecb-canonical-edit-windows-list))
(pop-up-frames (if (ecb-ignore-pop-up-frames)
nil
@@ -3206,7 +3221,8 @@ If called for other frames it works like the original version."
;; making the compile-window not dedicated
(set-window-dedicated-p ecb-compile-window nil)
(setq ecb-layout-temporary-dedicated-windows nil))
- ad-do-it)))
+ ad-do-it)
+ ))
(t ;; buffer is a special ecb-buffer
(ecb-layout-debug-error "display-buffer for special ecb-buffer: %s" (ad-get-arg 0))
View
@@ -268,9 +268,7 @@ Only prints mode and info but does not find any symbol-definition."
(re-search-forward (regexp-quote symbol-name) nil t))
(setq beg (match-beginning 0))
(setq end (match-end 0))
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: make
- ;; ecb-merge-face-into-text as tree-buffer-merge-face-into-text
- (tree-buffer-merge-face-into-text
+ (ecb-merge-face
(if (eq ecb-symboldef-symbol-face 'use-font-lock-face)
'font-lock-function-name-face
ecb-symboldef-symbol-face)
@@ -283,12 +281,10 @@ Only prints mode and info but does not find any symbol-definition."
(goto-char beg)
(forward-sexp)
(setq end (point))
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: make
- ;; ecb-merge-face-into-text as tree-buffer-merge-face-into-text
- (tree-buffer-merge-face-into-text
+ (ecb-merge-face
ecb-symboldef-prototype-face
beg end)
- (tree-buffer-merge-face-into-text
+ (ecb-merge-face
(if (eq ecb-symboldef-symbol-face 'use-font-lock-face)
'font-lock-function-name-face
ecb-symboldef-symbol-face)
@@ -313,9 +309,7 @@ Only prints mode and info but does not find any symbol-definition."
(re-search-forward (regexp-quote symbol-name) nil t))
(setq beg (match-beginning 0))
(setq end (match-end 0))
- ;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: make
- ;; ecb-merge-face-into-text as tree-buffer-merge-face-into-text
- (tree-buffer-merge-face-into-text
+ (ecb-merge-face
(if (eq ecb-symboldef-symbol-face 'use-font-lock-face)
'font-lock-variable-name-face
ecb-symboldef-symbol-face)
View
@@ -1327,17 +1327,18 @@ should stopped but no debugging is senseful."
;;; ----- Text and string-stuff ----------------------------
-;; TODO: Klaus Berndl <klaus.berndl@sdm.de>: adapt to
-;; tree-buffer-merge-face-into-text
-(defun ecb-merge-face-into-text (text face)
- "Merge FACE to the already precolored TEXT so the values of all
-face-attributes of FACE take effect and but the values of all face-attributes
-of TEXT which are not set by FACE are preserved.
-If FACE or TEXT is nil then simply TEXT is returned."
- (if (or (null face) (null text))
+(defun ecb-merge-face (face start end &optional text)
+ "Merge FACE either to a buffer-part or to TEXT.
+In both cases START and END define the region which should be
+faced. The FACE is merged, i.e. the values of all face-attributes
+of FACE take effect and the values of all face-attributes of the
+buffer-part or TEXT which are not set by FACE are preserved.
+
+If always returns TEXT \(if not nil then modified with FACE)."
+ (if (null face)
text
(if ecb-running-xemacs
- (put-text-property 0 (length text) 'face
+ (put-text-property start end 'face
(let* ((current-face (get-text-property 0
'face
text))
@@ -1359,7 +1360,7 @@ If FACE or TEXT is nil then simply TEXT is returned."
)
)
text)
- (alter-text-property 0 (length text) 'face
+ (alter-text-property start end 'face
(lambda (current-face)
(let ((cf
(typecase current-face
@@ -1379,6 +1380,15 @@ If FACE or TEXT is nil then simply TEXT is returned."
text))
text))
+(defun ecb-merge-face-into-text (text face)
+ "Merge FACE to the already precolored TEXT so the values of all
+face-attributes of FACE take effect and but the values of all face-attributes
+of TEXT which are not set by FACE are preserved.
+If FACE or TEXT is nil then simply original TEXT is returned."
+ (if (or (null face) (null text))
+ text
+ (ecb-merge-face face 0 (length text) text)))
+
(if (fboundp 'compare-strings)
(defalias 'ecb-compare-strings 'compare-strings)
(defun ecb-compare-strings (str1 start1 end1 str2 start2 end2 &optional ignore-case)
@@ -1810,6 +1820,7 @@ means not to count the minibuffer even if it is active."
(error "Window must be on frame."))
(let ((current-frame (selected-frame))
(current-window (selected-window))
+ (current-buf (current-buffer))
(current-point (point))
list)
(unwind-protect
@@ -1829,6 +1840,7 @@ means not to count the minibuffer even if it is active."
(setq list (cons window list)))
(select-frame current-frame)
(select-window current-window)
+ (set-buffer current-buf)
;; we must reset the point of the buffer which was current at call-time
;; of this function
(goto-char current-point))))))
View
@@ -1641,10 +1641,14 @@ tree-node. This is only used with GNU Emacs 21!"
(funcall (tree-buffer-spec->node-mouse-over-fn tree-buffer-spec)
node window 'no-print)))))
-(defun tree-buffer-merge-face-into-text (face start end &optional text)
- "Merge FACE to the already precolored TEXT so the values of all
-face-attributes of FACE take effect and the values of all face-attributes
-of TEXT which are not set by FACE are preserved."
+(defun tree-buffer-merge-face (face start end &optional text)
+ "Merge FACE either to a buffer-part or to TEXT.
+In both cases START and END define the region which should be
+faced. The FACE is merged, i.e. the values of all face-attributes
+of FACE take effect and the values of all face-attributes of the
+buffer-part or TEXT which are not set by FACE are preserved.
+
+If always returns TEXT \(if not nil then modified with FACE)."
(if (null face)
text
(if tree-buffer-running-xemacs
@@ -1687,7 +1691,8 @@ of TEXT which are not set by FACE are preserved."
(if (member face cf)
cf
(append nf cf))))
- text))))
+ text))
+ text))
(defun tree-buffer-insert-text (text &optional facer help-echo mouse-highlight)
"Insert TEXT at point and faces it with FACER. FACER can be a face then the
@@ -1705,7 +1710,7 @@ inserted and the TEXT itself"
(if facer
(if (functionp facer)
(funcall facer p text)
- (tree-buffer-merge-face-into-text facer p (point))))
+ (tree-buffer-merge-face facer p (point))))
)))
(defun tree-buffer-node-display-name (node)

0 comments on commit 1517f1a

Please sign in to comment.