diff options
| author | Stefan Kangas | 2019-10-22 00:38:21 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2019-10-22 00:39:25 +0200 |
| commit | b087a5f3e4a7fff586245c117f153ae50a35537c (patch) | |
| tree | f5b591f905e04ebb6839829edf0da59f91c50bbb | |
| parent | 950264ff1e92a7f437ef3b4df70bd8a22d65a488 (diff) | |
| download | emacs-b087a5f3e4a7fff586245c117f153ae50a35537c.tar.gz emacs-b087a5f3e4a7fff586245c117f153ae50a35537c.zip | |
Remove XEmacs compat code from speedbar.el
* lisp/speedbar.el (speedbar-frame-plist, speedbar-frame-mode)
(speedbar-make-overlay, speedbar-overlay-put, speedbar-delete-overlay)
(speedbar-mode-line-update, speedbar-frame-reposition-smartly)
(speedbar-set-mode-line-format, speedbar-reconfigure-keymaps)
(speedbar-add-localized-speedbar-support, speedbar-check-vc)
(speedbar-highlight-one-tag-line)
(speedbar-unhighlight-one-tag-line): Remove XEmacs compat code.
* doc/misc/speedbar.texi (Frames and Faces): Remove documentation for
XEmacs.
| -rw-r--r-- | doc/misc/speedbar.texi | 17 | ||||
| -rw-r--r-- | lisp/speedbar.el | 89 |
2 files changed, 25 insertions, 81 deletions
diff --git a/doc/misc/speedbar.texi b/doc/misc/speedbar.texi index 503f9cd6465..1e0a34ef9da 100644 --- a/doc/misc/speedbar.texi +++ b/doc/misc/speedbar.texi | |||
| @@ -695,18 +695,11 @@ file being edited. | |||
| 695 | Face used when the mouse passes over a button. | 695 | Face used when the mouse passes over a button. |
| 696 | @end table | 696 | @end table |
| 697 | 697 | ||
| 698 | You can also customize speedbar's initial frame parameters. How this is | 698 | @cindex @code{speedbar-frame-parameters} |
| 699 | accomplished is dependent on your platform being Emacs or XEmacs. | 699 | You can also customize speedbar's initial frame parameters by changing |
| 700 | 700 | the alist @code{speedbar-frame-parameters}. This variable is used to | |
| 701 | @cindex @code{speedbar-frame-parameters}, Emacs | 701 | set up initial details. Height is also automatically added when |
| 702 | In Emacs, change the alist @code{speedbar-frame-parameters}. This | 702 | speedbar is created, though you can override it. |
| 703 | variable is used to set up initial details. Height is also | ||
| 704 | automatically added when speedbar is created, though you can override | ||
| 705 | it. | ||
| 706 | |||
| 707 | @cindex @code{speedbar-frame-plist}, XEmacs | ||
| 708 | In XEmacs, change the plist @code{speedbar-frame-plist}. This is the | ||
| 709 | XEmacs way of doing the same thing. | ||
| 710 | 703 | ||
| 711 | @node Tag Hierarchy Methods | 704 | @node Tag Hierarchy Methods |
| 712 | @section Tag Hierarchy Methods | 705 | @section Tag Hierarchy Methods |
diff --git a/lisp/speedbar.el b/lisp/speedbar.el index df9e932be93..c489d18ce16 100644 --- a/lisp/speedbar.el +++ b/lisp/speedbar.el | |||
| @@ -341,23 +341,6 @@ attached to and added to this list before the new frame is initialized." | |||
| 341 | (symbol :tag "Parameter") | 341 | (symbol :tag "Parameter") |
| 342 | (sexp :tag "Value")))) | 342 | (sexp :tag "Value")))) |
| 343 | 343 | ||
| 344 | ;; These values by Hrvoje Nikšić <hrvoje.niksic@avl.com> | ||
| 345 | (defcustom speedbar-frame-plist | ||
| 346 | '(minibuffer nil width 20 border-width 0 | ||
| 347 | internal-border-width 0 unsplittable t | ||
| 348 | default-toolbar-visible-p nil has-modeline-p nil | ||
| 349 | menubar-visible-p nil | ||
| 350 | default-gutter-visible-p nil | ||
| 351 | ) | ||
| 352 | "Parameters to use when creating the speedbar frame in XEmacs. | ||
| 353 | Parameters not listed here which will be added automatically are | ||
| 354 | `height' which will be initialized to the height of the frame speedbar | ||
| 355 | is attached to." | ||
| 356 | :group 'speedbar | ||
| 357 | :type '(repeat (group :inline t | ||
| 358 | (symbol :tag "Property") | ||
| 359 | (sexp :tag "Value")))) | ||
| 360 | |||
| 361 | (defcustom speedbar-use-imenu-flag (fboundp 'imenu) | 344 | (defcustom speedbar-use-imenu-flag (fboundp 'imenu) |
| 362 | "Non-nil means use imenu for file parsing, nil to use etags. | 345 | "Non-nil means use imenu for file parsing, nil to use etags. |
| 363 | XEmacs prior to 20.4 doesn't support imenu, therefore the default is to | 346 | XEmacs prior to 20.4 doesn't support imenu, therefore the default is to |
| @@ -941,20 +924,15 @@ directories.") | |||
| 941 | (defvar speedbar-power-click nil | 924 | (defvar speedbar-power-click nil |
| 942 | "Never set this by hand. Value is t when S-mouse activity occurs.") | 925 | "Never set this by hand. Value is t when S-mouse activity occurs.") |
| 943 | 926 | ||
| 944 | 927 | (define-obsolete-function-alias 'speedbar-make-overlay | |
| 945 | ;;; Compatibility | 928 | 'make-overlay "27.1") |
| 946 | ;; | 929 | (define-obsolete-function-alias 'speedbar-overlay-put |
| 947 | (defalias 'speedbar-make-overlay | 930 | 'overlay-put "27.1") |
| 948 | (if (featurep 'xemacs) 'make-extent 'make-overlay)) | 931 | (define-obsolete-function-alias 'speedbar-delete-overlay |
| 949 | 932 | 'delete-overlay "27.1") | |
| 950 | (defalias 'speedbar-overlay-put | 933 | (define-obsolete-function-alias 'speedbar-mode-line-update |
| 951 | (if (featurep 'xemacs) 'set-extent-property 'overlay-put)) | 934 | 'force-mode-line-update "27.1") |
| 952 | 935 | ||
| 953 | (defalias 'speedbar-delete-overlay | ||
| 954 | (if (featurep 'xemacs) 'delete-extent 'delete-overlay)) | ||
| 955 | |||
| 956 | (defalias 'speedbar-mode-line-update | ||
| 957 | (if (featurep 'xemacs) 'redraw-modeline 'force-mode-line-update)) | ||
| 958 | 936 | ||
| 959 | ;;; Mode definitions/ user commands | 937 | ;;; Mode definitions/ user commands |
| 960 | ;; | 938 | ;; |
| @@ -982,12 +960,7 @@ supported at a time. | |||
| 982 | 'speedbar-buffer | 960 | 'speedbar-buffer |
| 983 | "Speedbar" | 961 | "Speedbar" |
| 984 | #'speedbar-frame-mode | 962 | #'speedbar-frame-mode |
| 985 | (if (featurep 'xemacs) | 963 | speedbar-frame-parameters |
| 986 | (append speedbar-frame-plist | ||
| 987 | ;; This is a hack to get speedbar to iconify | ||
| 988 | ;; with the selected frame. | ||
| 989 | (list 'parent (selected-frame))) | ||
| 990 | speedbar-frame-parameters) | ||
| 991 | 'speedbar-before-delete-hook | 964 | 'speedbar-before-delete-hook |
| 992 | 'speedbar-before-popup-hook | 965 | 'speedbar-before-popup-hook |
| 993 | 'speedbar-after-create-hook) | 966 | 'speedbar-after-create-hook) |
| @@ -1008,18 +981,8 @@ supported at a time. | |||
| 1008 | 981 | ||
| 1009 | (defun speedbar-frame-reposition-smartly () | 982 | (defun speedbar-frame-reposition-smartly () |
| 1010 | "Reposition the speedbar frame to be next to the attached frame." | 983 | "Reposition the speedbar frame to be next to the attached frame." |
| 1011 | (cond ((and (featurep 'xemacs) | 984 | (cond ((or (assoc 'left speedbar-frame-parameters) |
| 1012 | (or (member 'left speedbar-frame-plist) | 985 | (assoc 'top speedbar-frame-parameters)) |
| 1013 | (member 'top speedbar-frame-plist))) | ||
| 1014 | (dframe-reposition-frame | ||
| 1015 | speedbar-frame | ||
| 1016 | (dframe-attached-frame speedbar-frame) | ||
| 1017 | (cons (car (cdr (member 'left speedbar-frame-plist))) | ||
| 1018 | (car (cdr (member 'top speedbar-frame-plist))))) | ||
| 1019 | ) | ||
| 1020 | ((and (not (featurep 'xemacs)) | ||
| 1021 | (or (assoc 'left speedbar-frame-parameters) | ||
| 1022 | (assoc 'top speedbar-frame-parameters))) | ||
| 1023 | ;; if left/top were specified in the parameters, pass them | 986 | ;; if left/top were specified in the parameters, pass them |
| 1024 | ;; down to the reposition function | 987 | ;; down to the reposition function |
| 1025 | (dframe-reposition-frame | 988 | (dframe-reposition-frame |
| @@ -1147,9 +1110,6 @@ return true without a query." | |||
| 1147 | This gives visual indications of what is up. It EXPECTS the speedbar | 1110 | This gives visual indications of what is up. It EXPECTS the speedbar |
| 1148 | frame and window to be the currently active frame and window." | 1111 | frame and window to be the currently active frame and window." |
| 1149 | (if (and (frame-live-p (speedbar-current-frame)) | 1112 | (if (and (frame-live-p (speedbar-current-frame)) |
| 1150 | (or (not (featurep 'xemacs)) | ||
| 1151 | (with-no-warnings | ||
| 1152 | (specifier-instance has-modeline-p))) | ||
| 1153 | speedbar-buffer) | 1113 | speedbar-buffer) |
| 1154 | (with-current-buffer speedbar-buffer | 1114 | (with-current-buffer speedbar-buffer |
| 1155 | (let* ((w (or (speedbar-frame-width) 20)) | 1115 | (let* ((w (or (speedbar-frame-width) 20)) |
| @@ -1173,7 +1133,7 @@ frame and window to be the currently active frame and window." | |||
| 1173 | (if (not (equal mode-line-format tf)) | 1133 | (if (not (equal mode-line-format tf)) |
| 1174 | (progn | 1134 | (progn |
| 1175 | (setq mode-line-format tf) | 1135 | (setq mode-line-format tf) |
| 1176 | (speedbar-mode-line-update))))))) | 1136 | (force-mode-line-update))))))) |
| 1177 | 1137 | ||
| 1178 | (defvar speedbar-previous-menu nil | 1138 | (defvar speedbar-previous-menu nil |
| 1179 | "The menu before the last `speedbar-reconfigure-keymaps' was called.") | 1139 | "The menu before the last `speedbar-reconfigure-keymaps' was called.") |
| @@ -1233,13 +1193,8 @@ and the existence of packages." | |||
| 1233 | (if speedbar-previous-menu (easy-menu-remove speedbar-previous-menu)) | 1193 | (if speedbar-previous-menu (easy-menu-remove speedbar-previous-menu)) |
| 1234 | (setq speedbar-previous-menu md) | 1194 | (setq speedbar-previous-menu md) |
| 1235 | ;; Now add the new menu | 1195 | ;; Now add the new menu |
| 1236 | (if (not (featurep 'xemacs)) | 1196 | (easy-menu-define speedbar-menu-map (current-local-map) |
| 1237 | (easy-menu-define speedbar-menu-map (current-local-map) | 1197 | "Speedbar menu" md)) |
| 1238 | "Speedbar menu" md) | ||
| 1239 | (easy-menu-add md (current-local-map)) | ||
| 1240 | ;; XEmacs-specific: | ||
| 1241 | (if (fboundp 'set-buffer-menubar) | ||
| 1242 | (set-buffer-menubar (list md))))) | ||
| 1243 | 1198 | ||
| 1244 | (run-hooks 'speedbar-reconfigure-keymaps-hook))) | 1199 | (run-hooks 'speedbar-reconfigure-keymaps-hook))) |
| 1245 | 1200 | ||
| @@ -1848,7 +1803,6 @@ of the special mode functions." | |||
| 1848 | (setq speedbar-special-mode-expansion-list t) | 1803 | (setq speedbar-special-mode-expansion-list t) |
| 1849 | ;; If it is autoloaded, we need to load it now so that | 1804 | ;; If it is autoloaded, we need to load it now so that |
| 1850 | ;; we have access to the variable -speedbar-menu-items. | 1805 | ;; we have access to the variable -speedbar-menu-items. |
| 1851 | ;; Is this XEmacs safe? | ||
| 1852 | (autoload-do-load (symbol-function v) v) | 1806 | (autoload-do-load (symbol-function v) v) |
| 1853 | (setq speedbar-special-mode-expansion-list (list v)) | 1807 | (setq speedbar-special-mode-expansion-list (list v)) |
| 1854 | (setq v (intern-soft (concat ms "-speedbar-key-map"))) | 1808 | (setq v (intern-soft (concat ms "-speedbar-key-map"))) |
| @@ -2884,10 +2838,7 @@ to add more types of version control systems." | |||
| 2884 | (speedbar-vc-check-dir-p default-directory) | 2838 | (speedbar-vc-check-dir-p default-directory) |
| 2885 | (not (or (and (featurep 'ange-ftp) | 2839 | (not (or (and (featurep 'ange-ftp) |
| 2886 | (string-match | 2840 | (string-match |
| 2887 | (car (symbol-value | 2841 | (car (symbol-value 'ange-ftp-name-format)) |
| 2888 | (if (featurep 'xemacs) | ||
| 2889 | 'ange-ftp-directory-format | ||
| 2890 | 'ange-ftp-name-format))) | ||
| 2891 | (expand-file-name default-directory))) | 2842 | (expand-file-name default-directory))) |
| 2892 | ;; efs support: Bob Weiner | 2843 | ;; efs support: Bob Weiner |
| 2893 | (and (featurep 'efs) | 2844 | (and (featurep 'efs) |
| @@ -3966,17 +3917,17 @@ TEXT is the buffer's name, TOKEN and INDENT are unused." | |||
| 3966 | "Highlight the current line, unhighlighting a previously jumped to line." | 3917 | "Highlight the current line, unhighlighting a previously jumped to line." |
| 3967 | (speedbar-unhighlight-one-tag-line) | 3918 | (speedbar-unhighlight-one-tag-line) |
| 3968 | (setq speedbar-highlight-one-tag-line | 3919 | (setq speedbar-highlight-one-tag-line |
| 3969 | (speedbar-make-overlay (line-beginning-position) | 3920 | (make-overlay (line-beginning-position) |
| 3970 | (line-beginning-position 2))) | 3921 | (line-beginning-position 2))) |
| 3971 | (speedbar-overlay-put speedbar-highlight-one-tag-line 'face | 3922 | (overlay-put speedbar-highlight-one-tag-line 'face |
| 3972 | 'speedbar-highlight-face) | 3923 | 'speedbar-highlight-face) |
| 3973 | (add-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)) | 3924 | (add-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)) |
| 3974 | 3925 | ||
| 3975 | (defun speedbar-unhighlight-one-tag-line () | 3926 | (defun speedbar-unhighlight-one-tag-line () |
| 3976 | "Unhighlight the currently highlighted line." | 3927 | "Unhighlight the currently highlighted line." |
| 3977 | (when (and speedbar-highlight-one-tag-line | 3928 | (when (and speedbar-highlight-one-tag-line |
| 3978 | (not (eq this-command 'handle-switch-frame))) | 3929 | (not (eq this-command 'handle-switch-frame))) |
| 3979 | (speedbar-delete-overlay speedbar-highlight-one-tag-line) | 3930 | (delete-overlay speedbar-highlight-one-tag-line) |
| 3980 | (setq speedbar-highlight-one-tag-line nil) | 3931 | (setq speedbar-highlight-one-tag-line nil) |
| 3981 | (remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line))) | 3932 | (remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line))) |
| 3982 | 3933 | ||