comparison lisp/subr.el @ 111944:9dc65348ace1

subr.el (posn-col-row): Evaluate header-line-format in the context of the POSITION window's buffer.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 12 Dec 2010 22:45:57 +0200
parents 0a0aa7fbe2ca
children c00190a8c8ef 376148b31b5e
comparison
equal deleted inserted replaced
111943:25ce072b5bd9 111944:9dc65348ace1
956 (frame-char-height frame))))) 956 (frame-char-height frame)))))
957 ((null spacing) 957 ((null spacing)
958 (setq spacing 0))) 958 (setq spacing 0)))
959 (cons (/ (car pair) (frame-char-width frame)) 959 (cons (/ (car pair) (frame-char-width frame))
960 (- (/ (cdr pair) (+ (frame-char-height frame) spacing)) 960 (- (/ (cdr pair) (+ (frame-char-height frame) spacing))
961 (if (null header-line-format) 0 1)))))))) 961 (if (null (with-current-buffer (window-buffer window)
962 header-line-format))
963 0 1))))))))
962 964
963 (defun posn-actual-col-row (position) 965 (defun posn-actual-col-row (position)
964 "Return the actual column and row in POSITION, measured in characters. 966 "Return the actual column and row in POSITION, measured in characters.
965 These are the actual row number in the window and character number in that row. 967 These are the actual row number in the window and character number in that row.
966 Return nil if POSITION does not contain the actual position; in that case 968 Return nil if POSITION does not contain the actual position; in that case