diff 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
line wrap: on
line diff
--- a/lisp/packages/scroll-in-place.el	Mon Aug 13 08:46:35 2007 +0200
+++ b/lisp/packages/scroll-in-place.el	Mon Aug 13 08:46:56 2007 +0200
@@ -17,7 +17,7 @@
 ;;;;
 ;;;; You should have received a copy of the GNU General Public License along
 ;;;; with GNU Emacs.  If you did not, write to the Free Software Foundation,
-;;;; Inc., 675 Mass Ave., Cambridge, MA 02139, USA.
+;;;; Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 ;;; Synched up with: Not in FSF.
 
@@ -461,6 +461,9 @@
 ;;;;   invoke scrolling commands (although many filters move point around,
 ;;;;   which will also confuse `scroll-window-in-place').
 
+;; sb -- Added turn-on and turn-off hook functions to prepare for making this
+;;  a standardly dumped package with XEmacs.
+
 ;; (provide 'scroll-in-place) at the end of this file.
 
 
@@ -495,7 +498,7 @@
   ;; be worth it.
   )
 
-(defvar scroll-allow-blank-lines-past-eob nil
+(defvar scroll-allow-blank-lines-past-eob t
   "*When this variable is `nil' the \"in place\" scrolling commands will avoid
 displaying empty lines past the end of the buffer text.  In other words, just
 as you can't see \"dead space\" before the beginning of the buffer text, the
@@ -625,6 +628,16 @@
 set for all versions of Epoch 4 and for Lucid GNU Emacs 19.8.")
 
 
+;; Hook functions to make turning the mode on and off easier.
+(defun turn-on-scroll-in-place ()
+  "Unconditionally turn on scroll-in-place mode."
+  (set (make-local-variable 'scroll-in-place) t))
+
+(defun turn-off-scroll-in-place ()
+  "Unconditionally turn on scroll-in-place mode."
+  (set (make-local-variable 'scroll-in-place) nil))
+
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;
@@ -1547,6 +1560,16 @@
 	  nil))
 
 
+;;; Some convenience redefinitions for modes that don't like scroll-in-place
+(add-hook 'vm-mode-hook 'turn-off-scroll-in-place)
+(add-hook 'vm-select-message-hook 'turn-off-scroll-in-place)
+(add-hook 'vm-summary-mode-hook 'turn-off-scroll-in-place)
+
+(add-hook 'list-mode-hook 'turn-off-scroll-in-place)
+
+;; This doesn't work with Red Gnus
+;; (add-hook 'gnus-article-mode-hook 'turn-off-scroll-in-place)
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;;;
@@ -1557,5 +1580,4 @@
 
 (provide 'scroll-in-place)
 
-;; End of file.
-
+;;; scroll-in-place.el ends here