Mercurial > hg > xemacs-beta
comparison lisp/simple.el @ 3000:5df5ea55d3fc
[xemacs-hg @ 2005-10-18 20:49:41 by malcolmp]
Sync of occur mode with GNU Emacs 22.0.50.1 (CVS)
author | malcolmp |
---|---|
date | Tue, 18 Oct 2005 20:49:43 +0000 |
parents | 0a759f4c4225 |
children | b350e85a2a5e |
comparison
equal
deleted
inserted
replaced
2999:77dd8b943765 | 3000:5df5ea55d3fc |
---|---|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
20 ;; General Public License for more details. | 20 ;; General Public License for more details. |
21 | 21 |
22 ;; You should have received a copy of the GNU General Public License | 22 ;; You should have received a copy of the GNU General Public License |
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free | 23 ;; along with XEmacs; see the file COPYING. If not, write to the Free |
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | 24 ;; Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
25 ;; 02111-1307, USA. | 25 ;; Boston, MA 02110-1301, USA. |
26 | 26 |
27 ;;; Synched up with: FSF 19.34 [But not very closely]. | 27 ;;; Synched up with: FSF 19.34 [But not very closely]. |
28 ;;; Occasional synching to FSF 21.2, as marked. Comment stuff also | 28 ;;; Occasional synching to FSF 21.2 and FSF 22.0, as marked. Comment stuff |
29 ;;; synched, and in newcomment.el. | 29 ;;; also synched, and in newcomment.el. |
30 | 30 |
31 ;;; Commentary: | 31 ;;; Commentary: |
32 | 32 |
33 ;; This file is dumped with XEmacs. | 33 ;; This file is dumped with XEmacs. |
34 | 34 |
743 (if (and pos (/= pos (point))) | 743 (if (and pos (/= pos (point))) |
744 (save-excursion | 744 (save-excursion |
745 (goto-char pos) | 745 (goto-char pos) |
746 (line-number nil respect-narrowing)) | 746 (line-number nil respect-narrowing)) |
747 (1+ (count-lines (if respect-narrowing (point-min) 1) (point-at-bol))))) | 747 (1+ (count-lines (if respect-narrowing (point-min) 1) (point-at-bol))))) |
748 | |
749 ;; FSF 22.0.50.1 (CVS) version of above. | |
750 (defun line-number-at-pos (&optional pos) | |
751 (line-number pos t)) | |
748 | 752 |
749 (defun count-lines (start end &optional ignore-invisible-lines-flag) | 753 (defun count-lines (start end &optional ignore-invisible-lines-flag) |
750 "Return number of lines between START and END. | 754 "Return number of lines between START and END. |
751 This is usually the number of newlines between them, | 755 This is usually the number of newlines between them, |
752 but can be one more if START is not equal to END | 756 but can be one more if START is not equal to END |