Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

replaced some temporaly needed advices with flet-bindings

  • Loading branch information...
commit 3b47647090e473227252c1da5293c976f929afbe 1 parent 3190c29
berndl authored
Showing with 17 additions and 45 deletions.
  1. +7 −18 ecb-compatibility.el
  2. +10 −27 ecb-symboldef.el
View
25 ecb-compatibility.el
@@ -75,7 +75,7 @@ edit-window. Does nothing if called in another frame as the `ecb-frame'."
(defecb-advice one-window-p around ecb-always-disabled-advices
- "If called for the `ecb-frame' is only returns not nil if there is exactly
+ "If called for the `ecb-frame' it only returns not nil if there is exactly
one edit-window. Neither the ecb-windows nor the compile-window nor the
minibuffer-window are considered. This adviced version of `one-window-p' is
not for direct usage therefore it's added to `ecb-always-disabled-advices' and
@@ -166,22 +166,6 @@ BUFFER is displayed in an edit-window!"
;; package scroll-all.el --------------------------------------------------
-
-(defecb-advice count-windows around ecb-always-disabled-advices
- "If the selected frame is the ecb-frame and `scroll-all-mode' is not nil
-then return the current number of edit-windows if point is in an edit-window
-and always return 1 if point is not in an edit-window. In any other frame or
-if `scroll-all-mode' is nil return the number of visible windows."
- (if (and (equal (selected-frame) ecb-frame)
- ecb-minor-mode
- (boundp 'scroll-all-mode)
- scroll-all-mode)
- (setq ad-return-value (if (ecb-point-in-edit-window-number)
- (length (ecb-canonical-edit-windows-list))
- 1))
- (ecb-with-original-basic-functions
- ad-do-it)))
-
(defecb-advice scroll-all-function-all around ecb-compatibility-advices
"Make it compatible with ECB."
(if (or (not ecb-minor-mode)
@@ -189,7 +173,12 @@ if `scroll-all-mode' is nil return the number of visible windows."
(ecb-with-original-basic-functions ad-do-it)
(let (;; This runs the `other-window'-calls in the body in the right mode
(ecb-other-window-behavior 'only-edit))
- (ecb-with-ecb-advice 'count-windows 'around
+ ;; return the current number of edit-windows if point is in an edit-window
+ ;; and always return 1 if point is not in an edit-window.
+ (flet ((count-windows (&optional minibuf)
+ (if (ecb-point-in-edit-window-number)
+ (length (ecb-canonical-edit-windows-list))
+ 1)))
ad-do-it))))
View
37 ecb-symboldef.el
@@ -258,48 +258,31 @@ Only prints mode and info but does not find any symbol-definition."
;; doc in a help-window, so we have to redirect the output. Possible but
;; there is something to do:
;; 0. making edit-buffer (s. arg) current
-;; 1. For Emacs: advicing help-buffer as always disabled advice so it
-;; returns a buffer which is suitable for us.
-;; For XEmacs advicing help-buffer-name analogous
+;; 1. For Emacs: redefining help-buffer so it returns a buffer which is
+;; suitable for us. For XEmacs help-buffer-name analogous
;; 2. For (X)Emacs: Setting temp-buffer-show-function temporally to
;; something special which does simply nothing
;; 3. setting temp-buffer-setup-hook to nil
;; 3. Binding standart-output to a temporally buffer-object
;; 4. running describe-function
-(when-ecb-running-emacs
- (defecb-advice help-buffer around ecb-always-disabled-advices
- "When adviced it always returns `ecb-symboldef-temp-buffer-name'."
- (setq ad-return-value ecb-symboldef-temp-buffer-name))
-
- (defecb-advice print-help-return-message around ecb-always-disabled-advices
- "When adviced it simply does nothing."
- nil)
-)
-
-(when-ecb-running-xemacs
- (defecb-advice help-buffer-name around ecb-always-disabled-advices
- "When adviced it always returns `ecb-symboldef-temp-buffer-name'."
- (setq ad-return-value ecb-symboldef-temp-buffer-name))
- )
-
(defun ecb-symboldef-get-doc-for-vsymbol (vsymbol edit-buffer)
"Returns the full output of `describe-variable' as string."
(save-excursion
(set-buffer edit-buffer)
(let ((standard-output (get-buffer-create ecb-symboldef-temp-buffer-name))
(temp-buffer-setup-hook nil)
+ ;; this does not call temp-buffer-show-hook!!!
(temp-buffer-show-function (function (lambda (b) nil))))
- (if ecb-running-xemacs
- (ecb-with-ecb-advice 'help-buffer-name 'around
- (describe-variable vsymbol))
- (ecb-with-ecb-advice 'help-buffer 'around
- (ecb-with-ecb-advice 'print-help-return-message 'around
- (describe-variable vsymbol))))))
+ (flet ((help-buffer () ecb-symboldef-temp-buffer-name)
+ (print-help-return-message (&optional function) nil)
+ ;; for XEmacs
+ (help-buffer-name () ecb-symboldef-temp-buffer-name))
+ (describe-variable vsymbol))
+ ))
(save-excursion
(set-buffer ecb-symboldef-temp-buffer-name)
- (when (member 'eieio-help-mode-augmentation-maybee
- temp-buffer-show-hook)
+ (when (member 'eieio-help-mode-augmentation-maybee temp-buffer-show-hook)
(let ((major-mode 'help-mode))
(eieio-help-mode-augmentation-maybee)))
(buffer-string))
Please sign in to comment.
Something went wrong with that request. Please try again.