[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/popup c02ec73 111/184: Apply the patch of #8.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/popup c02ec73 111/184: Apply the patch of #8. |
Date: |
Wed, 6 Oct 2021 00:01:22 -0400 (EDT) |
branch: elpa/popup
commit c02ec730101184481d90df143524c88801a5b015
Author: TAKAGI Kentaro <kentaro0910+git@gmail.com>
Commit: TAKAGI Kentaro <kentaro0910+git@gmail.com>
Apply the patch of #8.
---
popup.el | 65 ++++++++++++++++++++++++++++------------------------------------
1 file changed, 28 insertions(+), 37 deletions(-)
diff --git a/popup.el b/popup.el
index c79b7ff..fc43704 100644
--- a/popup.el
+++ b/popup.el
@@ -148,34 +148,6 @@ untouched."
(progn ,@body)
(set-buffer-modified-p modified)))))
-(defun popup-window-full-width-p (&optional window)
- "A portable version of `window-full-width-p'."
- (if (fboundp 'window-full-width-p)
- (window-full-width-p window)
- (= (window-width window) (frame-width (window-frame (or window
(selected-window)))))))
-
-(defun popup-truncated-partial-width-window-p (&optional window)
- "A portable version of `truncated-partial-width-window-p'."
- (unless window
- (setq window (selected-window)))
- (unless (popup-window-full-width-p window)
- (let ((t-p-w-w (buffer-local-value 'truncate-partial-width-windows
- (window-buffer window))))
- (if (integerp t-p-w-w)
- (< (window-width window) t-p-w-w)
- t-p-w-w))))
-
-(defun popup-current-physical-column ()
- "Return the current physical column."
- (or (when (and popup-use-optimized-column-computation
- (eq (window-hscroll) 0))
- (let ((current-column (current-column)))
- (if (or (popup-truncated-partial-width-window-p)
- truncate-lines
- (< current-column (window-width)))
- current-column)))
- (car (posn-col-row (posn-at-point)))))
-
(defun popup-vertical-motion (column direction)
"A portable version of `vertical-motion'."
(if (>= emacs-major-version 23)
@@ -243,7 +215,7 @@ buffer."
face mouse-face selection-face summary-face
margin-left margin-right margin-left-cancel scroll-bar symbol
cursor offset scroll-top current-height list newlines
- pattern original-list)
+ pattern original-list invis-overlays)
(defun popup-item-propertize (item &rest properties)
"Same as `propertize' except that this avoids overriding
@@ -537,8 +509,9 @@ KEYMAP is a keymap that will be put on the popup contents."
(setq width (min width (popup-calculate-max-width max-width))))
(save-excursion
(goto-char point)
- (let* ((row (line-number-at-pos))
- (column (popup-current-physical-column))
+ (let* ((col-row (posn-col-row (posn-at-point)))
+ (row (cdr col-row))
+ (column (car col-row))
(overlays (make-vector height nil))
(popup-width (+ width
(if scroll-bar 1 0)
@@ -563,6 +536,7 @@ KEYMAP is a keymap that will be put on the popup contents."
(popup-calculate-direction height row)))
(depth (if parent (1+ (popup-depth parent)) 0))
(newlines (max 0 (+ (- height (count-lines point (point-max))) (if
around 1 0))))
+ invis-overlays
current-column)
;; Case: no newlines at the end of the buffer
(when (> newlines 0)
@@ -596,17 +570,27 @@ KEYMAP is a keymap that will be put on the popup
contents."
(let (overlay begin w (dangle t) (prefix "") (postfix ""))
(when around
(popup-vertical-motion column direction))
- (setq around t
- current-column (popup-current-physical-column))
+ (cl-loop for ov in (overlays-in (save-excursion
+ (beginning-of-visual-line)
+ (point))
+ (save-excursion
+ (end-of-visual-line)
+ (point)))
+ when (and (not (overlay-get ov 'popup))
+ (not (overlay-get ov 'popup-item))
+ (or (overlay-get ov 'invisible)
+ (overlay-get ov 'display)))
+ do (progn
+ (push (list ov (overlay-get ov 'display))
invis-overlays)
+ (overlay-put ov 'display "")))
+ (setq around t)
+ (setq current-column (car (posn-col-row (posn-at-point))))
- (when (> current-column column)
- (backward-char)
- (setq current-column (popup-current-physical-column)))
(when (< current-column column)
;; Extend short buffer lines by popup prefix (line of spaces)
(setq prefix (make-string
(+ (if (= current-column 0)
- (- window-hscroll (current-column))
+ (- window-hscroll current-column)
0)
(- column current-column))
? )))
@@ -621,6 +605,7 @@ KEYMAP is a keymap that will be put on the popup contents."
(setq postfix (make-string (- w) ? )))
(setq overlay (make-overlay begin (point)))
+ (overlay-put overlay 'popup t)
(overlay-put overlay 'window window)
(overlay-put overlay 'dangle dangle)
(overlay-put overlay 'prefix prefix)
@@ -657,6 +642,7 @@ KEYMAP is a keymap that will be put on the popup contents."
:list nil
:newlines newlines
:overlays overlays
+ :invis-overlays invis-overlays
:keymap keymap)))
(push it popup-instances)
it))))
@@ -680,6 +666,9 @@ KEYMAP is a keymap that will be put on the popup contents."
(defun popup-draw (popup)
"Draw POPUP."
+ (cl-loop for (ov olddisplay) in (popup-invis-overlays popup)
+ do (overlay-put ov 'display ""))
+
(cl-loop with height = (popup-height popup)
with min-height = (popup-min-height popup)
with popup-face = (popup-face popup)
@@ -778,6 +767,8 @@ KEYMAP is a keymap that will be put on the popup contents."
(defun popup-hide (popup)
"Hide POPUP."
+ (cl-loop for (ov olddisplay) in (popup-invis-overlays popup)
+ do (overlay-put ov 'display olddisplay))
(dotimes (i (popup-height popup))
(popup-hide-line popup i)))
- [nongnu] elpa/popup 64102c2 046/184: Add test case:popup-tip(scroll-bar, min-height), (continued)
- [nongnu] elpa/popup 64102c2 046/184: Add test case:popup-tip(scroll-bar, min-height), ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 487c0a8 109/184: add :initial-index parameter test, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 8719cd9 105/184: Merge pull request #71 from auto-complete/use-cask, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 1510820 100/184: activate isearch in cascade menu, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 58f55de 096/184: Merge pull request #62 from auto-complete/support-max-width, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup afeaed3 082/184: Merge branch 'master' into use-cl-lib, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 70c2583 093/184: Add 'nostrip' parameter explanation to docstring, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 69d5bf9 095/184: Support max-width for popup instance, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 9587ace 085/184: Merge pull request #55 from auto-complete/fix-bytecompile-warnings, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup d70cff9 101/184: Merge pull request #64 from aki2o/cascade-isearch, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup c02ec73 111/184: Apply the patch of #8.,
ELPA Syncer <=
- [nongnu] elpa/popup 895d031 123/184: Add MELPA badges, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup d8fe6b0 102/184: Use Cask instead of 'git submodule', ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 649242e 118/184: :initial-index respects real popup height(beyond first popup page), ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 2bb4bce 115/184: fix error on popup-delete when char-before return nil, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 1f817d6 097/184: fixed deficient help-delay, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup becfbdd 099/184: Merge pull request #63 from aki2o/fix-deficient-help-delay, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup c3ebfba 094/184: Merge pull request #61 from auto-complete/add-nostrip-documentation, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 2687612 132/184: Merge pull request #91 from ancane/master, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 4438b94 136/184: Merge pull request #95 from Konubinix/master, ELPA Syncer, 2021/10/06
- [nongnu] elpa/popup 4dbed57 137/184: Update cl-lib version, ELPA Syncer, 2021/10/06