[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/marginalia 5f6ba12ff5 04/15: Deprecate and remove most
From: |
ELPA Syncer |
Subject: |
[elpa] externals/marginalia 5f6ba12ff5 04/15: Deprecate and remove most of the current alignment implementation |
Date: |
Sun, 9 Jan 2022 15:57:53 -0500 (EST) |
branch: externals/marginalia
commit 5f6ba12ff58a55607e53c7c1e6827ec57aa928bf
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Deprecate and remove most of the current alignment implementation
---
marginalia.el | 50 +++++++++++---------------------------------------
1 file changed, 11 insertions(+), 39 deletions(-)
diff --git a/marginalia.el b/marginalia.el
index 33def366fd..b9c308e879 100644
--- a/marginalia.el
+++ b/marginalia.el
@@ -53,24 +53,13 @@ This value is adjusted depending on the `window-width'."
:type 'string)
(defvar marginalia-separator-threshold nil)
+(defvar marginalia-align-offset nil)
+(defvar marginalia-margin-min nil)
+(defvar marginalia-margin-threshold nil)
(make-obsolete-variable 'marginalia-separator-threshold "Deprecated in favor
of `marginalia-separator'." "0.11")
-
-;; See https://github.com/minad/marginalia/issues/42 for the discussion
-;; regarding the alignment.
-(defcustom marginalia-align-offset nil
- "Additional offset at the right margin used by `marginalia--align'.
-
-This value should be set to nil to enable auto-configuration.
-It can also be set to an integer value of 1 or larger to force an offset."
- :type '(choice (const nil) integer))
-
-(defcustom marginalia-margin-min 8
- "Minimum whitespace margin at the right side."
- :type 'integer)
-
-(defcustom marginalia-margin-threshold 200
- "Use whitespace margin for window widths larger than this value."
- :type 'integer)
+(make-obsolete-variable 'marginalia-align-offset "Deprecated in favor of
`marginalia-align'." "0.11")
+(make-obsolete-variable 'marginalia-margin-min "Deprecated in favor of
`marginalia-align'." "0.11")
+(make-obsolete-variable 'marginalia-margin-threshold "Deprecated in favor of
`marginalia-threshold'." "0.11")
(defcustom marginalia-max-relative-age (* 60 60 24 14)
"Maximum relative age in seconds displayed by the file annotator.
@@ -330,9 +319,6 @@ determine it."
Disabling the cache is useful on non-incremental UIs like default completion or
for performance profiling of the annotators.")
-(defvar marginalia--margin 0
- "Right margin.")
-
(defvar-local marginalia--command nil
"Last command symbol saved in order to allow annotations.")
@@ -350,16 +336,6 @@ for performance profiling of the annotators.")
(nreverse (truncate-string-to-width (reverse str) (- width) 0 ?\s t))
(truncate-string-to-width str width 0 ?\s t)))
-(defun marginalia--align (str)
- "Align STR at the right margin."
- (unless (string-blank-p str)
- (concat " "
- (propertize
- " "
- 'display
- `(space :align-to (- right ,marginalia--margin ,(string-width
str))))
- str)))
-
(cl-defmacro marginalia--field (field &key truncate face width)
"Format FIELD as a string according to some options.
TRUNCATE is the truncation width.
@@ -373,9 +349,10 @@ FACE is the name of the face, with which the field should
be propertized."
(defmacro marginalia--fields (&rest fields)
"Format annotation FIELDS as a string with separators in between."
- `(marginalia--align (concat ,@(cdr (mapcan (lambda (field)
- (list 'marginalia-separator
`(marginalia--field ,@field)))
- fields)))))
+ `(concat #(" " 0 1 (marginalia--align t))
+ ,@(cdr (mapcan (lambda (field)
+ (list 'marginalia-separator `(marginalia--field
,@field)))
+ fields))))
(defun marginalia--documentation (str)
"Format documentation string STR."
@@ -994,12 +971,7 @@ looking for a regexp that matches the prompt."
;; We need the `selected-window' fallback for Embark Occur.
(with-selected-window (or (minibuffer-selected-window)
(selected-window))
(let ((marginalia--cache ,c) ;; Take the cache from the minibuffer
- (marginalia-truncate-width (min (/ ,w 2)
marginalia-truncate-width))
- (marginalia--margin
- (+ (or marginalia-align-offset ,o)
- (if (>= ,w (+ marginalia-margin-min
marginalia-margin-threshold))
- (- ,w marginalia-margin-threshold)
- 0))))
+ (marginalia-truncate-width (min (/ ,w 2)
marginalia-truncate-width)))
,@body)))))
(defun marginalia--cache-reset ()
- [elpa] externals/marginalia updated (7782ebdd5c -> 1a2495203d), ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia e13d5ac71b 13/15: marginalia--field: Allow float value for :truncate, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 5a0678d88c 02/15: Deprecate marginalia-separator-threshold, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 709ed9b97e 01/15: marginalia--field: Remove support for :format, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 5f6ba12ff5 04/15: Deprecate and remove most of the current alignment implementation,
ELPA Syncer <=
- [elpa] externals/marginalia b5ea8e5ce8 09/15: Indentation, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 4391877773 12/15: Rename marginalia-truncate-width to marginalia-field-width, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 1a2495203d 15/15: Colorize truncation ellipsis, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 55c5d3f1b3 03/15: Define the annotation-function in terms of the affixation-function, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia a35476942f 11/15: Hack in better alignment support, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 87e03d7d39 06/15: Inline marginalia--context, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 0bca060531 07/15: Minor simplification, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia a21f59a077 10/15: Extract marginalia--affixate, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia 80a03d480f 08/15: Simplification, ELPA Syncer, 2022/01/09
- [elpa] externals/marginalia ebc6edc2f7 14/15: Perfect the file annotation alignment, ELPA Syncer, 2022/01/09