aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2019-06-12 23:26:36 +0200
committerLars Ingebrigtsen2019-06-12 23:26:56 +0200
commit2034bfdf6369f2fb8f2b8b08aa1342868b650bcb (patch)
tree54ed75e89904a2d155e817ff517b0cd3513ce206
parent6317c2563c4e5353a28135fec2cf73578f387fb7 (diff)
downloademacs-2034bfdf6369f2fb8f2b8b08aa1342868b650bcb.tar.gz
emacs-2034bfdf6369f2fb8f2b8b08aa1342868b650bcb.zip
Remove compat code for XEmacs and pre-Emacs 20 Emacs in pcomplete.el
* lisp/pcomplete.el (pcomplete-event-matches-key-specifier-p) (pcomplete-read-event, pcomplete-show-completions): Remove XEmacs support and mark now-trivial defaliases as obsolete.
-rw-r--r--lisp/pcomplete.el22
1 files changed, 7 insertions, 15 deletions
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index e0800749273..401e5aa1da5 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -1084,18 +1084,10 @@ See the documentation for `pcomplete-here'."
1084 (setq pcomplete-last-window-config nil 1084 (setq pcomplete-last-window-config nil
1085 pcomplete-window-restore-timer nil)) 1085 pcomplete-window-restore-timer nil))
1086 1086
1087;; Abstractions so that the code below will work for both Emacs 20 and 1087(define-obsolete-function-alias 'pcomplete-event-matches-key-specifier-p
1088;; XEmacs 21 1088 'eq "27.1")
1089 1089
1090(defalias 'pcomplete-event-matches-key-specifier-p 1090(define-obsolete-function-alias 'pcomplete-read-event 'read-event "27.1")
1091 (if (featurep 'xemacs)
1092 'event-matches-key-specifier-p
1093 'eq))
1094
1095(defun pcomplete-read-event (&optional prompt)
1096 (if (fboundp 'read-event)
1097 (read-event prompt)
1098 (aref (read-key-sequence prompt) 0)))
1099 1091
1100(defun pcomplete-show-completions (completions) 1092(defun pcomplete-show-completions (completions)
1101 "List in help buffer sorted COMPLETIONS. 1093 "List in help buffer sorted COMPLETIONS.
@@ -1112,15 +1104,15 @@ Typing SPC flushes the help buffer."
1112 (prog1 1104 (prog1
1113 (catch 'done 1105 (catch 'done
1114 (while (with-current-buffer (get-buffer "*Completions*") 1106 (while (with-current-buffer (get-buffer "*Completions*")
1115 (setq event (pcomplete-read-event))) 1107 (setq event (read-event)))
1116 (cond 1108 (cond
1117 ((pcomplete-event-matches-key-specifier-p event ?\s) 1109 ((eq event ?\s)
1118 (set-window-configuration pcomplete-last-window-config) 1110 (set-window-configuration pcomplete-last-window-config)
1119 (setq pcomplete-last-window-config nil) 1111 (setq pcomplete-last-window-config nil)
1120 (throw 'done nil)) 1112 (throw 'done nil))
1121 ((or (pcomplete-event-matches-key-specifier-p event 'tab) 1113 ((or (eq event 'tab)
1122 ;; Needed on a terminal 1114 ;; Needed on a terminal
1123 (pcomplete-event-matches-key-specifier-p event 9)) 1115 (eq event 9))
1124 (let ((win (or (get-buffer-window "*Completions*" 0) 1116 (let ((win (or (get-buffer-window "*Completions*" 0)
1125 (display-buffer "*Completions*" 1117 (display-buffer "*Completions*"
1126 'not-this-window)))) 1118 'not-this-window))))