@@ -643,7 +643,7 @@ In a word, this function is a fixed version of `posn-at-point'."
643643 " Return the y coordinate in POSITION.
644644
645645This function returns y offset from the top of the buffer area including
646- the header line. This definition could be changed in future.
646+ the header line and tab line . This definition could be changed in future.
647647
648648Note: On Emacs 22 and 23, y offset, returned by `posn-at-point' and taken
649649by `posn-at-x-y' , is relative to the top of the buffer area including
@@ -652,15 +652,21 @@ However, on Emacs 24, y offset returned by `posn-at-point' is relative to
652652the text area excluding the header line, while y offset taken by
653653`posn-at-x-y' is relative to the buffer area including the header line.
654654This asymmetry is by design according to GNU Emacs team.
655+ On Emacs 27, the tab line was added. The tab line behaves like the header
656+ line on Emacs 24.
655657
656658This function fixes the asymmetry between them on Emacs 24 and later versions.
657659This hack could be moved to mozc-posn-at-x-y in a future version."
658660 (let ((y (cdr (posn-x-y position))))
659- (if (or (null header-line-format) (<= emacs-major-version 23 ))
660- y
661- (+ y (or mozc-cached-header-line-height
662- (setq mozc-cached-header-line-height (mozc-header-line-height))
663- 0 )))))
661+ (cond ((fboundp #'window-tab-line-height )
662+ (+ y (window-tab-line-height) (window-header-line-height )))
663+ ((or (null header-line-format) (<= emacs-major-version 23 ))
664+ y)
665+ (t
666+ (+ y (or mozc-cached-header-line-height
667+ (setq mozc-cached-header-line-height
668+ (mozc-header-line-height))
669+ 0 ))))))
664670
665671(defsubst mozc-window-width (&optional window )
666672 " Return the width of WINDOW in pixel.
0 commit comments