]> code.delx.au - gnu-emacs/blobdiff - lisp/reposition.el
Fix subtle problems with linum-mode and invisible text
[gnu-emacs] / lisp / reposition.el
index 8dc752c2357d37b55dd9c358dfc1fe3eb93b3801..feb207b08c0cd7d1dcd8b4ede991fe7d708a1fe3 100644 (file)
@@ -1,17 +1,17 @@
 ;;; reposition.el --- center a Lisp function or comment on the screen
 
-;; Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1991, 1994, 2001-2015 Free Software Foundation, Inc.
 
 ;; Author: Michael D. Ernst <mernst@theory.lcs.mit.edu>
 ;; Created: Jan 1991
-;; Maintainer: FSF
+;; Maintainer: emacs-devel@gnu.org
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -59,11 +57,11 @@ visible (if point is in code and it could not be made so, or if only
 comments, including the first comment line, are visible), or to make the
 first comment line visible (if point is in a comment)."
   (interactive "P")
-  (let* (;; (here (save-excursion (beginning-of-line) (point)))
+  (let* (;; (here (line-beginning-position))
         (here (point))
         ;; change this name once I've gotten rid of references to ht.
         ;; this is actually the number of the last screen line
-        (ht (- (window-height (selected-window)) 2))
+        (ht (- (window-height) 2))
         (line (repos-count-screen-lines (window-start) (point)))
         (comment-height
          ;; The call to max deals with the case of cursor between defuns.
@@ -170,8 +168,6 @@ first comment line visible (if point is in a comment)."
           ;;(repos-debug-macro "4")
           ))))
 
-;;;###autoload (define-key esc-map "\C-l" 'reposition-window)
-
 ;;; Auxiliary functions
 
 ;; Return number of screen lines between START and END.
@@ -196,5 +192,4 @@ first comment line visible (if point is in a comment)."
 
 (provide 'reposition)
 
-;;; arch-tag: 79487039-3bd7-4ab5-a3e8-ecf3b4919010
 ;;; reposition.el ends here