From 22c6f502d1bd0ef4d38e8722d63900a09bc4b19b Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Sun, 26 Nov 2023 16:22:25 +0100 Subject: [PATCH] updae popup Signed-off-by: Andreas Gerler --- bba.org | 2 +- elpa/popup-20160709.1429/popup-pkg.el | 2 - .../popup-autoloads.el | 8 ++- elpa/popup-20221231.1634/popup-pkg.el | 14 +++++ .../popup.el | 51 ++++++++++++++----- 5 files changed, 60 insertions(+), 17 deletions(-) delete mode 100644 elpa/popup-20160709.1429/popup-pkg.el rename elpa/{popup-20160709.1429 => popup-20221231.1634}/popup-autoloads.el (65%) create mode 100644 elpa/popup-20221231.1634/popup-pkg.el rename elpa/{popup-20160709.1429 => popup-20221231.1634}/popup.el (97%) diff --git a/bba.org b/bba.org index ba90e57b..a624a6e5 100644 --- a/bba.org +++ b/bba.org @@ -246,7 +246,7 @@ Keep track of your important stuff! (if (>= emacs-major-version 24) (progn (add-to-list 'load-path "~/.emacs.d/elpa") - (add-to-list 'load-path "~/.emacs.d/elpa/popup-20160709.1429") + (add-to-list 'load-path "~/.emacs.d/elpa/popup-20200719.1015") (require 'package) ;; (package-initialize) (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) diff --git a/elpa/popup-20160709.1429/popup-pkg.el b/elpa/popup-20160709.1429/popup-pkg.el deleted file mode 100644 index f2c937f4..00000000 --- a/elpa/popup-20160709.1429/popup-pkg.el +++ /dev/null @@ -1,2 +0,0 @@ -;;; -*- no-byte-compile: t -*- -(define-package "popup" "20160709.1429" "Visual Popup User Interface" '((cl-lib "0.5")) :commit "80829dd46381754639fb764da11c67235fe63282" :keywords '("lisp") :authors '(("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) :maintainer '("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) diff --git a/elpa/popup-20160709.1429/popup-autoloads.el b/elpa/popup-20221231.1634/popup-autoloads.el similarity index 65% rename from elpa/popup-20160709.1429/popup-autoloads.el rename to elpa/popup-20221231.1634/popup-autoloads.el index 8389b0a1..84a28331 100644 --- a/elpa/popup-20160709.1429/popup-autoloads.el +++ b/elpa/popup-20221231.1634/popup-autoloads.el @@ -1,4 +1,4 @@ -;;; popup-autoloads.el --- automatically extracted autoloads +;;; popup-autoloads.el --- automatically extracted autoloads -*- lexical-binding: t -*- ;; ;;; Code: @@ -9,7 +9,11 @@ ;;;### (autoloads nil "popup" "popup.el" (0 0 0 0)) ;;; Generated autoloads from popup.el -(if (fboundp 'register-definition-prefixes) (register-definition-prefixes "popup" '("popup-"))) +(register-definition-prefixes "popup" '("popup-")) + +;;;*** + +;;;### (autoloads nil nil ("popup-pkg.el") (0 0 0 0)) ;;;*** diff --git a/elpa/popup-20221231.1634/popup-pkg.el b/elpa/popup-20221231.1634/popup-pkg.el new file mode 100644 index 00000000..6d60a50f --- /dev/null +++ b/elpa/popup-20221231.1634/popup-pkg.el @@ -0,0 +1,14 @@ +(define-package "popup" "20221231.1634" "Visual Popup User Interface" + '((emacs "24.3")) + :commit "71cede0588c10526f88dd0375bce776ec2eed05e" :authors + '(("Tomohiro Matsuyama" . "m2ym.pub@gmail.com")) + :maintainers + '(("Shen, Jen-Chieh" . "jcs090218@gmail.com")) + :maintainer + '("Shen, Jen-Chieh" . "jcs090218@gmail.com") + :keywords + '("lisp") + :url "https://github.com/auto-complete/popup-el") +;; Local Variables: +;; no-byte-compile: t +;; End: diff --git a/elpa/popup-20160709.1429/popup.el b/elpa/popup-20221231.1634/popup.el similarity index 97% rename from elpa/popup-20160709.1429/popup.el rename to elpa/popup-20221231.1634/popup.el index f112cbac..963d7e86 100644 --- a/elpa/popup-20160709.1429/popup.el +++ b/elpa/popup-20221231.1634/popup.el @@ -1,12 +1,14 @@ ;;; popup.el --- Visual Popup User Interface ;; Copyright (C) 2009-2015 Tomohiro Matsuyama +;; Copyright (c) 2020-2023 Jen-Chieh Shen ;; Author: Tomohiro Matsuyama +;; Maintainer: Shen, Jen-Chieh +;; URL: https://github.com/auto-complete/popup-el ;; Keywords: lisp -;; Package-Version: 20160709.1429 -;; Version: 0.5.3 -;; Package-Requires: ((cl-lib "0.5")) +;; Version: 0.5.9 +;; Package-Requires: ((emacs "24.3")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -23,7 +25,7 @@ ;;; Commentary: -;; popup.el is a visual popup user interface library for Emacs. This +;; popup.el is a visual popup user interface library for Emacs. This ;; provides a basic API and common UI widgets such as popup tooltips ;; and popup menus. ;; See README.markdown for more information. @@ -31,16 +33,17 @@ ;;; Code: (require 'cl-lib) +(require 'mule) -(defconst popup-version "0.5.3") +(defconst popup-version "0.5.9") ;;; Utilities (defun popup-calculate-max-width (max-width) - "Determines whether the width desired is -character or window proportion based, And returns the result." + "Determines whether the width with MAX-WIDTH desired is character or window +proportion based, And return the result." (cl-typecase max-width (integer max-width) (float (* (ceiling (/ (round (* max-width (window-width))) 10.0)) 10)))) @@ -62,7 +65,7 @@ If there is a problem, please set it nil.") (when it ,@body))) (defun popup-x-to-string (x) - "Convert any object to string effeciently. + "Convert any object to string efficiently. This is faster than `prin1-to-string' in many cases." (cl-typecase x (string x) @@ -151,6 +154,8 @@ untouched." (defun popup-vertical-motion (column direction) "A portable version of `vertical-motion'." + (when (bound-and-true-p display-line-numbers-mode) + (setq column (- column (line-number-display-width 'columns)))) (if (>= emacs-major-version 23) (vertical-motion (cons column direction)) (vertical-motion direction) @@ -234,6 +239,21 @@ ITEM is not string." (if (stringp item) (get-text-property 0 property item))) +(defun popup-replace-displayable (str &optional rep) + "Replace non-displayable character from STR. + +Optional argument REP is the replacement string of +non-displayable character." + (let ((rep (or rep "")) + (results (list))) + (dolist (string (split-string str "")) + (let* ((char (string-to-char string)) + (string (if (char-displayable-p char) + string + rep))) + (push string results))) + (string-join (reverse results)))) + (cl-defun popup-make-item (name &key value @@ -437,7 +457,7 @@ usual." "Return a proper direction when displaying a popup on this window. HEIGHT is the a height of the popup, and ROW is a line number at the point." - (let* ((remaining-rows (- (max 1 (- (window-height) + (let* ((remaining-rows (- (max 1 (- (window-text-height) (if mode-line-format 1 0) (if header-line-format 1 0))) (count-lines (window-start) (point)))) @@ -877,7 +897,7 @@ Pages up through POPUP." (defvar popup-isearch-keymap (let ((map (make-sparse-keymap))) - ;(define-key map "\r" 'popup-isearch-done) + ;;(define-key map "\r" 'popup-isearch-done) (define-key map "\C-g" 'popup-isearch-cancel) (define-key map "\C-b" 'popup-isearch-close) (define-key map [left] 'popup-isearch-close) @@ -1032,6 +1052,8 @@ HELP-DELAY is a delay of displaying helps." nowait nostrip prompt + face + &allow-other-keys &aux tip lines) "Show a tooltip of STRING at POINT. This function is synchronized unless NOWAIT specified. Almost all arguments are @@ -1045,7 +1067,9 @@ tooltip instance without entering event loop. If `NOSTRIP` is non-nil, `STRING` properties are not stripped. -PROMPT is a prompt string when reading events during event loop." +PROMPT is a prompt string when reading events during event loop. + +If FACE is non-nil, it will be used instead of face `popup-tip-face'." (if (bufferp string) (setq string (with-current-buffer string (buffer-string)))) @@ -1053,6 +1077,8 @@ PROMPT is a prompt string when reading events during event loop." ;; TODO strip text (mainly face) properties (setq string (substring-no-properties string))) + (setq string (popup-replace-displayable string)) + (and (eq margin t) (setq margin 1)) (or margin-left (setq margin-left margin)) (or margin-right (setq margin-right margin)) @@ -1068,7 +1094,7 @@ PROMPT is a prompt string when reading events during event loop." :margin-left margin-left :margin-right margin-right :scroll-bar scroll-bar - :face 'popup-tip-face + :face (or face 'popup-tip-face) :parent parent :parent-offset parent-offset)) @@ -1329,6 +1355,7 @@ PROMPT is a prompt string when reading events during event loop." (isearch-keymap popup-isearch-keymap) isearch-callback initial-index + &allow-other-keys &aux menu event) "Show a popup menu of LIST at POINT. This function returns a value of the selected item. Almost all arguments are the same as in -- 2.47.3