Mercurial > hg > xemacs-beta
comparison lisp/packages/scroll-in-place.el @ 4:b82b59fe008d r19-15b3
Import from CVS: tag r19-15b3
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:56 +0200 |
parents | 376386a54a3c |
children | 49a24b4fd526 |
comparison
equal
deleted
inserted
replaced
3:30df88044ec6 | 4:b82b59fe008d |
---|---|
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., 675 Mass Ave., Cambridge, MA 02139, USA. | 20 ;;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 ;;;; |
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 | 463 |
464 ;; sb -- Added turn-on and turn-off hook functions to prepare for making this | |
465 ;; a standardly dumped package with XEmacs. | |
466 | |
464 ;; (provide 'scroll-in-place) at the end of this file. | 467 ;; (provide 'scroll-in-place) at the end of this file. |
465 | 468 |
466 | 469 |
467 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 470 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
468 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 471 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
493 ;; scrolling the default because one could single out certain ill-behaved | 496 ;; scrolling the default because one could single out certain ill-behaved |
494 ;; commands. But as of now I'm sure that the added complexity would really | 497 ;; commands. But as of now I'm sure that the added complexity would really |
495 ;; be worth it. | 498 ;; be worth it. |
496 ) | 499 ) |
497 | 500 |
498 (defvar scroll-allow-blank-lines-past-eob nil | 501 (defvar scroll-allow-blank-lines-past-eob t |
499 "*When this variable is `nil' the \"in place\" scrolling commands will avoid | 502 "*When this variable is `nil' the \"in place\" scrolling commands will avoid |
500 displaying empty lines past the end of the buffer text. In other words, just | 503 displaying empty lines past the end of the buffer text. In other words, just |
501 as you can't see \"dead space\" before the beginning of the buffer text, the | 504 as you can't see \"dead space\" before the beginning of the buffer text, the |
502 \"in place\" scrolling commands try to avoid displaying \"dead space\" past the | 505 \"in place\" scrolling commands try to avoid displaying \"dead space\" past the |
503 end of the buffer text. This helps make the most of window real estate. | 506 end of the buffer text. This helps make the most of window real estate. |
621 (store-match-data old-match-data))) | 624 (store-match-data old-match-data))) |
622 "A flag, set when this version of GNU Emacs has a buggy version of the | 625 "A flag, set when this version of GNU Emacs has a buggy version of the |
623 function `pos-visible-in-window-p' that returns `nil' when given `(point-max)' | 626 function `pos-visible-in-window-p' that returns `nil' when given `(point-max)' |
624 and `(point-max)' is on the last line of the window. Currently, this flag is | 627 and `(point-max)' is on the last line of the window. Currently, this flag is |
625 set for all versions of Epoch 4 and for Lucid GNU Emacs 19.8.") | 628 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)) | |
626 | 639 |
627 | 640 |
628 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 641 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
629 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 642 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
630 ;;;; | 643 ;;;; |
1545 scroll-boundary-error-point initial-point) | 1558 scroll-boundary-error-point initial-point) |
1546 (signal (if (< lines 0) 'beginning-of-buffer 'end-of-buffer) | 1559 (signal (if (< lines 0) 'beginning-of-buffer 'end-of-buffer) |
1547 nil)) | 1560 nil)) |
1548 | 1561 |
1549 | 1562 |
1563 ;;; Some convenience redefinitions for modes that don't like scroll-in-place | |
1564 (add-hook 'vm-mode-hook 'turn-off-scroll-in-place) | |
1565 (add-hook 'vm-select-message-hook 'turn-off-scroll-in-place) | |
1566 (add-hook 'vm-summary-mode-hook 'turn-off-scroll-in-place) | |
1567 | |
1568 (add-hook 'list-mode-hook 'turn-off-scroll-in-place) | |
1569 | |
1570 ;; This doesn't work with Red Gnus | |
1571 ;; (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place) | |
1572 | |
1550 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1573 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1551 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1574 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1552 ;;;; | 1575 ;;;; |
1553 ;;;; Finally, here is the `provide' statement. | 1576 ;;;; Finally, here is the `provide' statement. |
1554 ;;;; | 1577 ;;;; |
1555 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1578 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1556 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1579 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1557 | 1580 |
1558 (provide 'scroll-in-place) | 1581 (provide 'scroll-in-place) |
1559 | 1582 |
1560 ;; End of file. | 1583 ;;; scroll-in-place.el ends here |
1561 |