Permalink
Browse files

fixed a problem with get-lru-window and get-largest-window and compat…

…ibility

with Emacs 21
  • Loading branch information...
1 parent b15a2d8 commit 19b6758013a286e3403072bd0be6dd623385c85f berndl committed Jun 26, 2009
Showing with 50 additions and 7 deletions.
  1. +3 −3 ecb-layout.el
  2. +25 −0 ecb-symboldef.el
  3. +18 −4 ecb-util.el
  4. +4 −0 ecb.el
View
6 ecb-layout.el
@@ -2955,9 +2955,9 @@ Only set by the adviced `display-buffer' and only evaluated by
`ecb-canonical-edit-windows-list' and `ecb-canonical-ecb-windows-list'. This
variable is strictly only for internal usage!")
-;; The XEmacs-versions never choose dedicated windows (so the function don't
-;; have a DEDICATED argument and so we don't need advice....
-(when-ecb-running-emacs
+;; The XEmacs- and Emacs 21 versions never choose dedicated windows (so the
+;; function don't have a DEDICATED argument and so we don't need advice....
+(when-ecb-running-emacs-22
(defecb-advice get-largest-window before ecb-layout-basic-adviced-functions
"When called from within the `ecb-frame' then DEDICATED is always set to nil.
So never a dedicated window is returned during activated ECB."
View
25 ecb-symboldef.el
@@ -296,6 +296,31 @@ EDIT-BUFFER is that buffer VSYMBOL is used."
(silentcomp-defun function-at-point)
(silentcomp-defun function-called-at-point)
+(defun ecb-function-at-point ()
+ "Return the function whose name is around point.
+If that gives no function, return the function which is called by the
+list containing point. If that doesn't give a function, return nil."
+ (or (ignore-errors
+ (with-syntax-table emacs-lisp-mode-syntax-table
+ (save-excursion
+ (or (not (zerop (skip-syntax-backward "_w")))
+ (eq (char-syntax (char-after (point))) ?w)
+ (eq (char-syntax (char-after (point))) ?_)
+ (forward-sexp -1))
+ (skip-chars-forward "`'")
+ (let ((obj (read (current-buffer))))
+ (and (symbolp obj) (fboundp obj) obj)))))
+ (ignore-errors
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (max (point-min) (- (point) 1000))
+ (point-max))
+ (backward-up-list 1)
+ (forward-char 1)
+ (let (obj)
+ (setq obj (read (current-buffer)))
+ (and (symbolp obj) (fboundp obj) obj)))))))
+
(defun ecb-symboldef-function-at-point ()
"Returns the function around point or nil if there is no function around."
(if ecb-running-xemacs
View
22 ecb-util.el
@@ -174,10 +174,24 @@ want the BODY being parsed by semantic!. If not use the variable
,@body))
(defmacro when-ecb-running-emacs (&rest body)
- "Evaluates BODY when `ecb-running-xemacs' is false. Use this macro when you
-want the BODY being parsed by semantic!. If not use the form
-\(unless ecb-running-xemacs)."
- `(unless ecb-running-xemacs
+ "Evaluates BODY when `ecb-running-gnu-emacs' is false. Use this
+macro when you want the BODY being parsed by semantic!. If not
+use the form \(unless ecb-running-xemacs)."
+ `(when ecb-running-gnu-emacs
+ ,@body))
+
+(defmacro when-ecb-running-emacs-22 (&rest body)
+ "Evaluates BODY when `ecb-running-gnu-emacs-version-22' is
+true. Use this macro when you want the BODY being parsed by
+semantic!. If not use the form \(when ecb-running-gnu-emacs-version-22)."
+ `(when ecb-running-gnu-emacs-version-22
+ ,@body))
+
+(defmacro when-ecb-running-emacs-23 (&rest body)
+ "Evaluates BODY when `ecb-running-gnu-emacs-version-23' is
+true. Use this macro when you want the BODY being parsed by
+semantic!. If not use the form \(when ecb-running-gnu-emacs-version-23)."
+ `(when ecb-running-gnu-emacs-version-23
,@body))
;; I do not want all this compatibitly stuff being parsed by semantic,
View
4 ecb.el
@@ -1928,6 +1928,8 @@ exist."
;; when-ecb-running-... macros
(semantic-elisp-reuse-form-parser eval-and-compile
when-ecb-running-xemacs
+ when-ecb-running-emacs-22
+ when-ecb-running-emacs-23
when-ecb-running-emacs)
)
(error
@@ -1968,6 +1970,8 @@ exist."
"ecb-layout-define"
"when-ecb-running-xemacs"
"when-ecb-running-emacs"
+ "when-ecb-running-emacs-22"
+ "when-ecb-running-emacs-23"
"ecb-exit-on-input"
))
(v-regexp (regexp-opt variable-defs t))

0 comments on commit 19b6758

Please sign in to comment.