emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/valign ed8dd50 118/198: Remove obsolete functions


From: Stefan Monnier
Subject: [elpa] externals/valign ed8dd50 118/198: Remove obsolete functions
Date: Tue, 1 Dec 2020 18:19:29 -0500 (EST)

branch: externals/valign
commit ed8dd505d1487aef6438e6f0e2c17b2cb22db022
Author: Yuan Fu <casouri@gmail.com>
Commit: Yuan Fu <casouri@gmail.com>

    Remove obsolete functions
    
    * valign.el (valign--tab-width, valign--glyph-width-at-point): Remove
    functions.
---
 valign.el | 35 -----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/valign.el b/valign.el
index 2eded06..34aa93a 100644
--- a/valign.el
+++ b/valign.el
@@ -101,41 +101,6 @@ Return nil if not in a cell."
           (skip-chars-backward " ")
           (valign--pixel-width-from-to start (point)))))))
 
-;; (defun valign--font-at (p)
-;;   (find-font
-;;    (font-spec
-;;     :name (face-font (get-text-property (point) 'face)
-;;                      nil
-;;                      (char-after)))))
-
-;; Obsolete.
-(defun valign--tab-width (font)
-  "Return the pixel width of a tab in FONT."
-  ;; FIXME We have to over-estimate the pixel width of a tab.  Since
-  ;; it is very hard to compute the exact width of it (basically Emacs
-  ;; redisplay calculates tab width based one the iterators position
-  ;; on-the-fly, to calculate the exact width of a tab, you need to
-  ;; know it’s _position_, that means calculating from the left edge).
-  (* (or tab-width 8)
-     ;; FIXME For some unknown reason, tab-width is
-     ;; sometimes nil, someone should investigate.
-     (aref (aref (font-get-glyphs font 0 1 " ") 0) 4)))
-
-;; Obsolete.
-(defun valign--glyph-width-at-point (&optional point)
-  "Return the pixel width of the glyph at POINT.
-The buffer has to be visible.  If point is at an image, this
-function doens’t return the image’s width, but the underlining
-character’s glyph width."
-  (let* ((p (or point (point))))
-    ;; car + mapcar to translate the vector to a list.
-    (if (eq (char-after point) ?\t)
-        (valign--tab-width (font-at p))
-      ;; (font-at 0 nil (buffer-substring p (1+ p))) doesn’t work, the
-      ;; font is sometimes wrong.  (font-at p) doesn’t work, because
-      ;; it requires the buffer to be visible.
-      (aref (aref (font-get-glyphs (font-at p) p (1+ p)) 0) 4))))
-
 ;; We used to use a custom functions that calculates the pixel text
 ;; width that doesn’t require a live window.  However that function
 ;; has some limitations, including not working right with face remapping.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]