diff options
| author | Nick Roberts | 2006-02-17 00:26:14 +0000 |
|---|---|---|
| committer | Nick Roberts | 2006-02-17 00:26:14 +0000 |
| commit | 160b7d8b868f1c36a819d545ca1a64ecd44e6616 (patch) | |
| tree | ce2d7bb5bece168308141e37049ec0970a13554e | |
| parent | b32d1b9b0198a6e74906eb520e8d65ec836e2fec (diff) | |
| download | emacs-160b7d8b868f1c36a819d545ca1a64ecd44e6616.tar.gz emacs-160b7d8b868f1c36a819d545ca1a64ecd44e6616.zip | |
(speedbar-frame-width): Make an inline function
instead of a macro. Use frame-width.
(speedbar-try-completion, speedbar-update-contents)
(speedbar-timer-fn): Use consp.
(speedbar-update-localized-contents): Try to preserve point.
| -rw-r--r-- | lisp/speedbar.el | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index c3f949ead37..4e639c586f2 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -1019,10 +1019,10 @@ selected. If the speedbar frame is active, then select the attached frame." | |||
| 1019 | (lambda () (let ((speedbar-update-flag t)) | 1019 | (lambda () (let ((speedbar-update-flag t)) |
| 1020 | (speedbar-timer-fn))))) | 1020 | (speedbar-timer-fn))))) |
| 1021 | 1021 | ||
| 1022 | (defmacro speedbar-frame-width () | 1022 | (defsubst speedbar-frame-width () |
| 1023 | "Return the width of the speedbar frame in characters. | 1023 | "Return the width of the speedbar frame in characters. |
| 1024 | nil if it doesn't exist." | 1024 | nil if it doesn't exist." |
| 1025 | '(window-width (get-buffer-window speedbar-buffer))) | 1025 | (frame-width speedbar-frame)) |
| 1026 | 1026 | ||
| 1027 | (defun speedbar-mode () | 1027 | (defun speedbar-mode () |
| 1028 | "Major mode for managing a display of directories and tags. | 1028 | "Major mode for managing a display of directories and tags. |
| @@ -2123,7 +2123,7 @@ Groups may optionally contain a position." | |||
| 2123 | "A wrapper for `try-completion'. | 2123 | "A wrapper for `try-completion'. |
| 2124 | Passes STRING and ALIST to `try-completion' if ALIST | 2124 | Passes STRING and ALIST to `try-completion' if ALIST |
| 2125 | passes some tests." | 2125 | passes some tests." |
| 2126 | (if (and (listp alist) (not (null alist)) | 2126 | (if (and (consp alist) |
| 2127 | (listp (car alist)) (stringp (car (car alist)))) | 2127 | (listp (car alist)) (stringp (car (car alist)))) |
| 2128 | (try-completion string alist) | 2128 | (try-completion string alist) |
| 2129 | nil)) | 2129 | nil)) |
| @@ -2423,8 +2423,7 @@ name will have the function FIND-FUN and not token." | |||
| 2423 | 2423 | ||
| 2424 | ;; Choose the correct method of doodling. | 2424 | ;; Choose the correct method of doodling. |
| 2425 | (if (and speedbar-mode-specific-contents-flag | 2425 | (if (and speedbar-mode-specific-contents-flag |
| 2426 | (listp speedbar-special-mode-expansion-list) | 2426 | (consp speedbar-special-mode-expansion-list) |
| 2427 | speedbar-special-mode-expansion-list | ||
| 2428 | (local-variable-p | 2427 | (local-variable-p |
| 2429 | 'speedbar-special-mode-expansion-list | 2428 | 'speedbar-special-mode-expansion-list |
| 2430 | (current-buffer))) | 2429 | (current-buffer))) |
| @@ -2463,12 +2462,14 @@ name will have the function FIND-FUN and not token." | |||
| 2463 | ) | 2462 | ) |
| 2464 | (set-buffer speedbar-buffer) | 2463 | (set-buffer speedbar-buffer) |
| 2465 | (speedbar-with-writable | 2464 | (speedbar-with-writable |
| 2466 | (erase-buffer) | 2465 | (let* ((window (get-buffer-window speedbar-buffer 0)) |
| 2467 | (dolist (func funclst) | 2466 | (p (window-point window))) |
| 2468 | (setq default-directory cbd) | 2467 | (erase-buffer) |
| 2469 | (funcall func cbd 0)) | 2468 | (dolist (func funclst) |
| 2470 | (speedbar-reconfigure-keymaps) | 2469 | (setq default-directory cbd) |
| 2471 | (goto-char (point-min))) | 2470 | (funcall func cbd 0)) |
| 2471 | (speedbar-reconfigure-keymaps) | ||
| 2472 | (set-window-point window p))) | ||
| 2472 | )))) | 2473 | )))) |
| 2473 | 2474 | ||
| 2474 | (defun speedbar-update-directory-contents () | 2475 | (defun speedbar-update-directory-contents () |
| @@ -2572,7 +2573,6 @@ This should only be used by modes classified as special." | |||
| 2572 | ;; We do not erase the buffer because these functions may | 2573 | ;; We do not erase the buffer because these functions may |
| 2573 | ;; decide NOT to update themselves. | 2574 | ;; decide NOT to update themselves. |
| 2574 | (funcall func specialbuff))) | 2575 | (funcall func specialbuff))) |
| 2575 | |||
| 2576 | (goto-char (point-min)))) | 2576 | (goto-char (point-min)))) |
| 2577 | (speedbar-reconfigure-keymaps)) | 2577 | (speedbar-reconfigure-keymaps)) |
| 2578 | 2578 | ||
| @@ -2614,8 +2614,7 @@ Also resets scanner functions." | |||
| 2614 | (speedbar-maybe-add-localized-support (current-buffer)) | 2614 | (speedbar-maybe-add-localized-support (current-buffer)) |
| 2615 | ;; Update for special mode all the time! | 2615 | ;; Update for special mode all the time! |
| 2616 | (if (and speedbar-mode-specific-contents-flag | 2616 | (if (and speedbar-mode-specific-contents-flag |
| 2617 | (listp speedbar-special-mode-expansion-list) | 2617 | (consp speedbar-special-mode-expansion-list) |
| 2618 | speedbar-special-mode-expansion-list | ||
| 2619 | (local-variable-p | 2618 | (local-variable-p |
| 2620 | 'speedbar-special-mode-expansion-list | 2619 | 'speedbar-special-mode-expansion-list |
| 2621 | (current-buffer))) | 2620 | (current-buffer))) |