comparison lisp/subr.el @ 50136:ad28e7a35442

* files.el (recover-session): Error if there are no previous sessions to recover. * subr.el (posn-col-row): Simplify. * arc-mode.el (archive-subtype, archive-file-list-start) (archive-file-list-end, archive-proper-file-start) (archive-read-only, archive-local-name, archive-mode-map) (archive-file-name-indent, archive-remote) (archive-alternate-display, archive-superior-buffer) (archive-subfile-mode): Doc fixes.
author John Paul Wallington <jpw@pobox.com>
date Fri, 14 Mar 2003 22:36:57 +0000
parents 1b6393475a9b
children b040b4e36f5e
comparison
equal deleted inserted replaced
50135:167c56f6d789 50136:ad28e7a35442
654 (WINDOW BUFFER-POSITION (X . Y) TIMESTAMP) 654 (WINDOW BUFFER-POSITION (X . Y) TIMESTAMP)
655 as returned by the `event-start' and `event-end' functions. 655 as returned by the `event-start' and `event-end' functions.
656 For a scroll-bar event, the result column is 0, and the row 656 For a scroll-bar event, the result column is 0, and the row
657 corresponds to the vertical position of the click in the scroll bar." 657 corresponds to the vertical position of the click in the scroll bar."
658 (let* ((pair (nth 2 position)) 658 (let* ((pair (nth 2 position))
659 (window (posn-window position)) 659 (window (posn-window position)))
660 (vspacing (or (frame-parameter (window-frame window) 'line-spacing)
661 default-line-spacing)))
662 (if (eq (if (consp (nth 1 position)) 660 (if (eq (if (consp (nth 1 position))
663 (car (nth 1 position)) 661 (car (nth 1 position))
664 (nth 1 position)) 662 (nth 1 position))
665 'vertical-scroll-bar) 663 'vertical-scroll-bar)
666 (cons 0 (scroll-bar-scale pair (1- (window-height window)))) 664 (cons 0 (scroll-bar-scale pair (1- (window-height window))))
670 'horizontal-scroll-bar) 668 'horizontal-scroll-bar)
671 (cons (scroll-bar-scale pair (window-width window)) 0) 669 (cons (scroll-bar-scale pair (window-width window)) 0)
672 (let* ((frame (if (framep window) window (window-frame window))) 670 (let* ((frame (if (framep window) window (window-frame window)))
673 (x (/ (car pair) (frame-char-width frame))) 671 (x (/ (car pair) (frame-char-width frame)))
674 (y (/ (cdr pair) (+ (frame-char-height frame) 672 (y (/ (cdr pair) (+ (frame-char-height frame)
675 (or vspacing 0))))) 673 (or (frame-parameter frame 'line-spacing)
674 default-line-spacing
675 0)))))
676 (cons x y)))))) 676 (cons x y))))))
677 677
678 (defsubst posn-timestamp (position) 678 (defsubst posn-timestamp (position)
679 "Return the timestamp of POSITION. 679 "Return the timestamp of POSITION.
680 POSITION should be a list of the form 680 POSITION should be a list of the form