~protesilaos/mct

cca3aaa8c40fe25926767e26b9f1927aeae7826b — Protesilaos Stavrou 1 year, 6 months ago 4b05edf
Remove code that was meant for Emacs 27 (not supported anymore)
1 files changed, 2 insertions(+), 13 deletions(-)

M mct.el
M mct.el => mct.el +2 -13
@@ 517,11 517,7 @@ by `mct--completions-window-name'."

(defun mct--completion-at-point-p ()
  "Return non-nil if there is a completion at point."
  (let ((point (point)))
    ;; The `or' is for Emacs 27 where there are no completion--string
    ;; properties.
    (or (get-text-property point 'completion--string)
        (get-text-property point 'mouse-face))))
  (get-text-property (point) 'completion--string))

(defun mct--arg-completion-point-p (arg)
  "Return non-nil if ARGth next completion exists."


@@ 832,20 828,13 @@ Apply APP while inhibiting modification hooks."
  "Priority used on the `mct--highlight-overlay'.
This value means that it is overriden by the active region.")

;; This is for Emacs 27 which does not have a completion--string text
;; property.
(defun mct--completions-text-property-search ()
  "Search for text property of completion candidate."
  (or (text-property-search-forward 'completion--string)
      (text-property-search-forward 'mouse-face)))

;; The `if-let' is to prevent highlighting of empty space, such as by
;; clicking on it with the mouse.
(defun mct--completions-completion-beg ()
  "Return point of completion candidate at START and END."
  (if-let ((string (mct--completion-at-point-p)))
      (save-excursion
        (prop-match-beginning (mct--completions-text-property-search)))
        (prop-match-beginning (text-property-search-forward 'completion--string)))
    (point)))

;; Same as above for the `if-let'.