diff options
| author | Stephen Eglen | 2003-06-26 11:47:34 +0000 |
|---|---|---|
| committer | Stephen Eglen | 2003-06-26 11:47:34 +0000 |
| commit | 2d839509cdb6930d0e59c396b55ef11d71fbf4fb (patch) | |
| tree | 92549afc7c53d75dadc9934f751c0ac01ec59c59 | |
| parent | 2336fe58df3a6ac56822b592d55d95013a9c6218 (diff) | |
| download | emacs-2d839509cdb6930d0e59c396b55ef11d71fbf4fb.tar.gz emacs-2d839509cdb6930d0e59c396b55ef11d71fbf4fb.zip | |
(iswitchb-read-buffer): Remove redudant variable
iswitchb-prepost-hooks. Remove iswitchb-xemacs variable and use
(featurep 'xemacs) and fboundp instead. (From Stefan Monnier).
(iswitchb-completions): Remove two redundant arguments and local
variables. (From Stefan Monnier).
Commentary fix (from Markus Rost).
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/iswitchb.el | 33 |
2 files changed, 23 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 81165d44e94..9af777f2deb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2003-06-26 Stephen Eglen <stephen@gnu.org> | ||
| 2 | |||
| 3 | * iswitchb.el (iswitchb-read-buffer): Remove redudant variable | ||
| 4 | iswitchb-prepost-hooks. | ||
| 5 | (iswitchb-xemacs): Delete variable and use (featurep 'xemacs) | ||
| 6 | and fboundp instead. | ||
| 7 | (iswitchb-completions): Remove two redundant arguments and local | ||
| 8 | variables. (All above from Stefan Monnier). | ||
| 9 | Commentary fix (from Markus Rost). | ||
| 10 | |||
| 1 | 2003-06-20 Masatake YAMATO <jet@gyve.org> | 11 | 2003-06-20 Masatake YAMATO <jet@gyve.org> |
| 2 | 12 | ||
| 3 | * progmodes/asm-mode.el (asm-font-lock-keywords): Support | 13 | * progmodes/asm-mode.el (asm-font-lock-keywords): Support |
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index 361d7ad673d..239c8d6eb0d 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; iswitchb.el --- switch between buffers using substrings | 1 | ;;; iswitchb.el --- switch between buffers using substrings |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Stephen Eglen <stephen@gnu.org> | 5 | ;; Author: Stephen Eglen <stephen@gnu.org> |
| 6 | ;; Maintainer: Stephen Eglen <stephen@gnu.org> | 6 | ;; Maintainer: Stephen Eglen <stephen@gnu.org> |
| @@ -61,11 +61,11 @@ | |||
| 61 | ;; The list in {} are the matching buffers, most recent first (buffers | 61 | ;; The list in {} are the matching buffers, most recent first (buffers |
| 62 | ;; visible in the current frame are put at the end of the list by | 62 | ;; visible in the current frame are put at the end of the list by |
| 63 | ;; default). At any time I can select the item at the head of the | 63 | ;; default). At any time I can select the item at the head of the |
| 64 | ;; list by pressing RET. I can also bring the put the first element | 64 | ;; list by pressing RET. I can also put the first element at the end |
| 65 | ;; at the end of the list by pressing C-s, or put the last element at | 65 | ;; of the list by pressing C-s, or put the last element at the head of |
| 66 | ;; the head of the list by pressing C-r. The item in [] indicates | 66 | ;; the list by pressing C-r. The item in [] indicates what can be |
| 67 | ;; what can be added to my input by pressing TAB. In this case, I | 67 | ;; added to my input by pressing TAB. In this case, I will get "3" |
| 68 | ;; will get "3" added to my input. So, press TAB: | 68 | ;; added to my input. So, press TAB: |
| 69 | ;; iswitch 23{123456,123} | 69 | ;; iswitch 23{123456,123} |
| 70 | ;; | 70 | ;; |
| 71 | ;; At this point, I still have two matching buffers. | 71 | ;; At this point, I still have two matching buffers. |
| @@ -473,9 +473,6 @@ selected.") | |||
| 473 | (defvar iswitchb-buffer-ignore-orig nil | 473 | (defvar iswitchb-buffer-ignore-orig nil |
| 474 | "Stores original value of `iswitchb-buffer-ignore'.") | 474 | "Stores original value of `iswitchb-buffer-ignore'.") |
| 475 | 475 | ||
| 476 | (defvar iswitchb-xemacs (string-match "XEmacs" (emacs-version)) | ||
| 477 | "Non-nil if we are running XEmacs. Otherwise, assume we are running Emacs.") | ||
| 478 | |||
| 479 | (defvar iswitchb-default nil | 476 | (defvar iswitchb-default nil |
| 480 | "Default buffer for iswitchb.") | 477 | "Default buffer for iswitchb.") |
| 481 | 478 | ||
| @@ -599,7 +596,6 @@ If REQUIRE-MATCH is non-nil, an existing-buffer must be selected." | |||
| 599 | (iswitchb-set-matches) | 596 | (iswitchb-set-matches) |
| 600 | (let | 597 | (let |
| 601 | ((minibuffer-local-completion-map iswitchb-mode-map) | 598 | ((minibuffer-local-completion-map iswitchb-mode-map) |
| 602 | (iswitchb-prepost-hooks t) | ||
| 603 | ;; Record the minibuffer depth that we expect to find once | 599 | ;; Record the minibuffer depth that we expect to find once |
| 604 | ;; the minibuffer is set up and iswitchb-entryfn-p is called. | 600 | ;; the minibuffer is set up and iswitchb-entryfn-p is called. |
| 605 | (iswitchb-minibuf-depth (1+ (minibuffer-depth))) | 601 | (iswitchb-minibuf-depth (1+ (minibuffer-depth))) |
| @@ -956,7 +952,7 @@ Return the modified list with the last element prepended to it." | |||
| 956 | (set-buffer buf)) | 952 | (set-buffer buf)) |
| 957 | 953 | ||
| 958 | (with-output-to-temp-buffer temp-buf | 954 | (with-output-to-temp-buffer temp-buf |
| 959 | (if iswitchb-xemacs | 955 | (if (featurep 'xemacs) |
| 960 | 956 | ||
| 961 | ;; XEmacs extents are put on by default, doesn't seem to be | 957 | ;; XEmacs extents are put on by default, doesn't seem to be |
| 962 | ;; any way of switching them off. | 958 | ;; any way of switching them off. |
| @@ -1012,7 +1008,7 @@ Return the modified list with the last element prepended to it." | |||
| 1012 | (or (eq iswitchb-method 'always-frame) | 1008 | (or (eq iswitchb-method 'always-frame) |
| 1013 | (y-or-n-p "Jump to frame? "))) | 1009 | (y-or-n-p "Jump to frame? "))) |
| 1014 | (setq newframe (window-frame win)) | 1010 | (setq newframe (window-frame win)) |
| 1015 | (if (not iswitchb-xemacs) | 1011 | (if (fboundp 'select-frame-set-input-focus) |
| 1016 | (select-frame-set-input-focus newframe) | 1012 | (select-frame-set-input-focus newframe) |
| 1017 | (raise-frame newframe) | 1013 | (raise-frame newframe) |
| 1018 | (select-frame newframe) | 1014 | (select-frame newframe) |
| @@ -1032,7 +1028,7 @@ Return the modified list with the last element prepended to it." | |||
| 1032 | ((eq iswitchb-method 'otherframe) | 1028 | ((eq iswitchb-method 'otherframe) |
| 1033 | (progn | 1029 | (progn |
| 1034 | (switch-to-buffer-other-frame buffer) | 1030 | (switch-to-buffer-other-frame buffer) |
| 1035 | (if (not iswitchb-xemacs) | 1031 | (if (fboundp 'select-frame-set-input-focus) |
| 1036 | (select-frame-set-input-focus (selected-frame))) | 1032 | (select-frame-set-input-focus (selected-frame))) |
| 1037 | ))))) | 1033 | ))))) |
| 1038 | 1034 | ||
| @@ -1143,7 +1139,7 @@ This is a hack for XEmacs, and should really be handled by `iswitchb-exhibit'." | |||
| 1143 | (goto-char (point-min))))) | 1139 | (goto-char (point-min))))) |
| 1144 | 1140 | ||
| 1145 | ;; add this hook for XEmacs only. | 1141 | ;; add this hook for XEmacs only. |
| 1146 | (if iswitchb-xemacs | 1142 | (if (featurep 'xemacs) |
| 1147 | (add-hook 'iswitchb-minibuffer-setup-hook | 1143 | (add-hook 'iswitchb-minibuffer-setup-hook |
| 1148 | 'iswitchb-init-XEmacs-trick)) | 1144 | 'iswitchb-init-XEmacs-trick)) |
| 1149 | 1145 | ||
| @@ -1157,7 +1153,7 @@ This is a hack for XEmacs, and should really be handled by `iswitchb-exhibit'." | |||
| 1157 | (define-key iswitchb-mode-map '[backspace] 'backward-delete-char) | 1153 | (define-key iswitchb-mode-map '[backspace] 'backward-delete-char) |
| 1158 | (define-key iswitchb-mode-map '[(meta backspace)] 'backward-kill-word)) | 1154 | (define-key iswitchb-mode-map '[(meta backspace)] 'backward-kill-word)) |
| 1159 | 1155 | ||
| 1160 | (if iswitchb-xemacs | 1156 | (if (featurep 'xemacs) |
| 1161 | (add-hook 'iswitchb-define-mode-map-hook | 1157 | (add-hook 'iswitchb-define-mode-map-hook |
| 1162 | 'iswitchb-xemacs-backspacekey)) | 1158 | 'iswitchb-xemacs-backspacekey)) |
| 1163 | 1159 | ||
| @@ -1189,11 +1185,9 @@ Copied from `icomplete-exhibit' with two changes: | |||
| 1189 | ;; Insert the match-status information: | 1185 | ;; Insert the match-status information: |
| 1190 | (insert (iswitchb-completions | 1186 | (insert (iswitchb-completions |
| 1191 | contents | 1187 | contents |
| 1192 | minibuffer-completion-table | ||
| 1193 | minibuffer-completion-predicate | ||
| 1194 | (not minibuffer-completion-confirm))))))) | 1188 | (not minibuffer-completion-confirm))))))) |
| 1195 | 1189 | ||
| 1196 | (defun iswitchb-completions (name candidates predicate require-match) | 1190 | (defun iswitchb-completions (name require-match) |
| 1197 | "Return the string that is displayed after the user's text. | 1191 | "Return the string that is displayed after the user's text. |
| 1198 | Modified from `icomplete-completions'." | 1192 | Modified from `icomplete-completions'." |
| 1199 | 1193 | ||
| @@ -1237,7 +1231,6 @@ Modified from `icomplete-completions'." | |||
| 1237 | (most nil) | 1231 | (most nil) |
| 1238 | (most-len (length most)) | 1232 | (most-len (length most)) |
| 1239 | most-is-exact | 1233 | most-is-exact |
| 1240 | first | ||
| 1241 | (alternatives | 1234 | (alternatives |
| 1242 | (apply | 1235 | (apply |
| 1243 | (function concat) | 1236 | (function concat) |
| @@ -1336,7 +1329,7 @@ This is an example function which can be hooked on to | |||
| 1336 | "Return non-nil iff we should ignore case when matching. | 1329 | "Return non-nil iff we should ignore case when matching. |
| 1337 | See the variable `iswitchb-case' for details." | 1330 | See the variable `iswitchb-case' for details." |
| 1338 | (if iswitchb-case | 1331 | (if iswitchb-case |
| 1339 | (if iswitchb-xemacs | 1332 | (if (featurep 'xemacs) |
| 1340 | (isearch-no-upper-case-p iswitchb-text) | 1333 | (isearch-no-upper-case-p iswitchb-text) |
| 1341 | (isearch-no-upper-case-p iswitchb-text t)))) | 1334 | (isearch-no-upper-case-p iswitchb-text t)))) |
| 1342 | 1335 | ||