Mercurial > hg > xemacs-beta
comparison lisp/packages/scroll-in-place.el @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 4103f0995bd7 |
children | c0c698873ce1 |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
15 ;;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | 15 ;;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
16 ;;;; for more details. | 16 ;;;; for more details. |
17 ;;;; | 17 ;;;; |
18 ;;;; You should have received a copy of the GNU General Public License along | 18 ;;;; You should have received a copy of the GNU General Public License along |
19 ;;;; with GNU Emacs. If you did not, write to the Free Software Foundation, | 19 ;;;; with GNU Emacs. If you did not, write to the Free Software Foundation, |
20 ;;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 20 ;;;; Inc., 675 Mass Ave., Cambridge, MA 02139, USA. |
21 | 21 |
22 ;;; Synched up with: Not in FSF. | 22 ;;; Synched up with: Not in FSF. |
23 | 23 |
24 ;;;; AUTHORS | 24 ;;;; AUTHORS |
25 ;;;; | 25 ;;;; |
458 ;;;; may break running chains of "in place" scrolling commands and they may | 458 ;;;; may break running chains of "in place" scrolling commands and they may |
459 ;;;; set up inappropriate defaults for future scrolling commands. Maybe this | 459 ;;;; set up inappropriate defaults for future scrolling commands. Maybe this |
460 ;;;; is a moot problem, as I am currently unaware of any process filters that | 460 ;;;; is a moot problem, as I am currently unaware of any process filters that |
461 ;;;; invoke scrolling commands (although many filters move point around, | 461 ;;;; invoke scrolling commands (although many filters move point around, |
462 ;;;; which will also confuse `scroll-window-in-place'). | 462 ;;;; which will also confuse `scroll-window-in-place'). |
463 | |
464 ;; sb -- Added turn-on and turn-off hook functions to prepare for making this | |
465 ;; a standardly dumped package with XEmacs. | |
466 | 463 |
467 ;; (provide 'scroll-in-place) at the end of this file. | 464 ;; (provide 'scroll-in-place) at the end of this file. |
468 | 465 |
469 | 466 |
470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 467 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
624 (store-match-data old-match-data))) | 621 (store-match-data old-match-data))) |
625 "A flag, set when this version of GNU Emacs has a buggy version of the | 622 "A flag, set when this version of GNU Emacs has a buggy version of the |
626 function `pos-visible-in-window-p' that returns `nil' when given `(point-max)' | 623 function `pos-visible-in-window-p' that returns `nil' when given `(point-max)' |
627 and `(point-max)' is on the last line of the window. Currently, this flag is | 624 and `(point-max)' is on the last line of the window. Currently, this flag is |
628 set for all versions of Epoch 4 and for Lucid GNU Emacs 19.8.") | 625 set for all versions of Epoch 4 and for Lucid GNU Emacs 19.8.") |
629 | |
630 | |
631 ;; Hook functions to make turning the mode on and off easier. | |
632 (defun turn-on-scroll-in-place () | |
633 "Unconditionally turn on scroll-in-place mode." | |
634 (set (make-local-variable 'scroll-in-place) t)) | |
635 | |
636 (defun turn-off-scroll-in-place () | |
637 "Unconditionally turn on scroll-in-place mode." | |
638 (set (make-local-variable 'scroll-in-place) nil)) | |
639 | 626 |
640 | 627 |
641 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 628 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
642 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 629 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
643 ;;;; | 630 ;;;; |
1554 ;; Remember what we were doing and where point was when we signalled the | 1541 ;; Remember what we were doing and where point was when we signalled the |
1555 ;; error so that subsequent "in place" scrolling commands can decide how to | 1542 ;; error so that subsequent "in place" scrolling commands can decide how to |
1556 ;; recover. | 1543 ;; recover. |
1557 (setq scroll-boundary-error-command this-command | 1544 (setq scroll-boundary-error-command this-command |
1558 scroll-boundary-error-point initial-point) | 1545 scroll-boundary-error-point initial-point) |
1559 (when signal-error-on-buffer-boundary | 1546 (signal (if (< lines 0) 'beginning-of-buffer 'end-of-buffer) |
1560 (signal (if (< lines 0) 'beginning-of-buffer 'end-of-buffer) | 1547 nil)) |
1561 nil))) | |
1562 | 1548 |
1563 | 1549 |
1564 ;;; Some convenience redefinitions for modes that don't like scroll-in-place | |
1565 (add-hook 'vm-mode-hook 'turn-off-scroll-in-place) | |
1566 (add-hook 'vm-select-message-hook 'turn-off-scroll-in-place) | |
1567 (add-hook 'vm-summary-mode-hook 'turn-off-scroll-in-place) | |
1568 | |
1569 (add-hook 'list-mode-hook 'turn-off-scroll-in-place) | |
1570 | |
1571 ;; This doesn't work with Red Gnus | |
1572 ;; (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place) | |
1573 | |
1574 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1550 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1575 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1551 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1576 ;;;; | 1552 ;;;; |
1577 ;;;; Finally, here is the `provide' statement. | 1553 ;;;; Finally, here is the `provide' statement. |
1578 ;;;; | 1554 ;;;; |
1579 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1555 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1580 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1556 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1581 | 1557 |
1582 (provide 'scroll-in-place) | 1558 (provide 'scroll-in-place) |
1583 | 1559 |
1584 ;;; scroll-in-place.el ends here | 1560 ;; End of file. |
1561 |