changeset 83022:abaf78268f22

Merged in changes from CVS HEAD Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-51 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-52 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-62
author Karoly Lorentey <lorentey@elte.hu>
date Fri, 23 Jan 2004 21:51:08 +0000
parents 32bf8e7cc0c2 (current diff) f58a3ce5a982 (diff)
children 6ce586a7243e
files lisp/ChangeLog lisp/vc.el
diffstat 5 files changed, 77 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Jan 23 21:48:58 2004 +0000
+++ b/lisp/ChangeLog	Fri Jan 23 21:51:08 2004 +0000
@@ -1,3 +1,21 @@
+2004-01-23  Benjamin Rutt  <brutt@bloomington.in.us>
+
+	* vc.el (vc-annotate): Fix improper use of `make-local-variable'
+	at the top level of vc.el.
+
+2004-01-23  Andre Spiegel  <spiegel@gnu.org>
+
+	* vc.el (vc-current-line): Function removed.  This is now done by
+	the new function line-at-pos in simple.el.
+	(vc-annotate-warp-version): Use line-at-pos instead of
+	vc-current-line.
+
+2004-01-22  Kim F. Storm  <storm@cua.dk>
+
+	* simple.el (line-at-pos): New defun.
+	(what-line): Use it.  Optimize by only counting lines in narrowed
+	region once.
+
 2004-01-22  Kenichi Handa  <handa@m17n.org>
 
 	* language/cyrillic.el (ccl-encode-windows-1251-font): Rearrange
--- a/lisp/simple.el	Fri Jan 23 21:48:58 2004 +0000
+++ b/lisp/simple.el	Fri Jan 23 21:51:08 2004 +0000
@@ -498,20 +498,15 @@
 (defun what-line ()
   "Print the current buffer line number and narrowed line number of point."
   (interactive)
-  (let ((opoint (point)) start)
-    (save-excursion
-      (save-restriction
-	(goto-char (point-min))
-	(widen)
-	(forward-line 0)
-	(setq start (point))
-	(goto-char opoint)
-	(forward-line 0)
-	(if (/= start (point-min))
-	    (message "line %d (narrowed line %d)"
-		     (1+ (count-lines (point-min) (point)))
-		     (1+ (count-lines start (point))))
-	  (message "Line %d" (1+ (count-lines (point-min) (point)))))))))
+  (let ((opoint (point)) (start (point-min))
+	(n (line-at-pos)))
+    (if (= start 1)
+	(message "Line %d" n)
+      (save-excursion
+	(save-restriction
+	  (widen)
+	  (message "line %d (narrowed line %d)" 
+		   (+ n (line-at-pos start) -1) n))))))
 
 (defun count-lines (start end)
   "Return number of lines between START and END.
@@ -536,6 +531,17 @@
 		done)))
 	(- (buffer-size) (forward-line (buffer-size)))))))
 
+(defun line-at-pos (&optional pos)
+  "Return (narrowed) buffer line number at position POS.
+If POS is nil, use current buffer location."
+  (let ((opoint (or pos (point))) start)
+    (save-excursion
+      (goto-char (point-min))
+      (setq start (point))
+      (goto-char opoint)
+      (forward-line 0)
+      (1+ (count-lines start (point))))))
+
 (defun what-cursor-position (&optional detail)
   "Print info on cursor position (on screen and within buffer).
 Also describe the character after point, and give its character code
--- a/lisp/vc.el	Fri Jan 23 21:48:58 2004 +0000
+++ b/lisp/vc.el	Fri Jan 23 21:51:08 2004 +0000
@@ -7,7 +7,7 @@
 ;; Maintainer: Andre Spiegel <spiegel@gnu.org>
 ;; Keywords: tools
 
-;; $Id: vc.el,v 1.363 2004/01/21 11:05:51 uid65624 Exp $
+;; $Id: vc.el,v 1.365 2004/01/23 11:20:55 uid65624 Exp $
 
 ;; This file is part of GNU Emacs.
 
@@ -2816,9 +2816,6 @@
 (defvar vc-annotate-parent-file nil)
 (defvar vc-annotate-parent-rev nil)
 (defvar vc-annotate-parent-display-mode nil)
-(make-local-variable 'vc-annotate-parent-file)
-(make-local-variable 'vc-annotate-parent-rev)
-(make-local-variable 'vc-annotate-parent-display-mode)
 
 (defconst vc-annotate-font-lock-keywords
   ;; The fontification is done by vc-annotate-lines instead of font-lock.
@@ -3038,9 +3035,10 @@
                        vc-annotate-version))
     (save-excursion
       (set-buffer temp-buffer-name)
-      (setq vc-annotate-parent-file bfn)
-      (setq vc-annotate-parent-rev vc-annotate-version)
-      (setq vc-annotate-parent-display-mode vc-annotate-display-mode))
+      (set (make-local-variable 'vc-annotate-parent-file) bfn)
+      (set (make-local-variable 'vc-annotate-parent-rev) vc-annotate-version)
+      (set (make-local-variable 'vc-annotate-parent-display-mode)
+	   vc-annotate-display-mode))
 	   
     ;; Don't use the temp-buffer-name until the buffer is created
     ;; (only after `with-output-to-temp-buffer'.)
@@ -3135,19 +3133,6 @@
 	    (vc-version-diff vc-annotate-parent-file prev-rev rev-at-line))
 	  (switch-to-buffer "*vc-diff*"))))))
 
-(defun vc-current-line ()
-  "Return the current buffer's line number."
-  (let ((oldpoint (point)) start)
-    (save-excursion
-      (save-restriction
-	(goto-char (point-min))
-	(widen)
-	(forward-line 0)
-	(setq start (point))
-	(goto-char oldpoint)
-	(forward-line 0)
-	(1+ (count-lines (point-min) (point)))))))
-
 (defun vc-annotate-warp-version (revspec)
   "Annotate the version described by REVSPEC.
 
@@ -3159,7 +3144,7 @@
 revision."
   (if (not (equal major-mode 'vc-annotate-mode))
       (message "Cannot be invoked outside of a vc annotate buffer")
-    (let* ((oldline (vc-current-line))
+    (let* ((oldline (line-at-pos))
 	   (revspeccopy revspec)
 	   (newrev nil))
       (cond
@@ -3191,7 +3176,7 @@
 	(switch-to-buffer (car (car (last vc-annotate-buffers))))
 	(goto-line (min oldline (progn (goto-char (point-max))
 				       (previous-line)
-				       (vc-current-line))))))))
+				       (line-at-pos))))))))
 
 (defun vc-annotate-car-last-cons (a-list)
   "Return car of last cons in association list A-LIST."
--- a/src/ChangeLog	Fri Jan 23 21:48:58 2004 +0000
+++ b/src/ChangeLog	Fri Jan 23 21:51:08 2004 +0000
@@ -1,5 +1,16 @@
+2004-01-23  Kenichi Handa  <handa@m17n.org>
+
+	* fns.c (Fmd5): If OBJECT is a buffer different from the current
+	one, set buffer to OBJECT temporarily.
+
 2004-01-21  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* keyboard.c (kbd_buffer_gcpro): Remove.
+	(kbd_buffer_store_event, clear_event, Fdiscard_input)
+	(stuff_buffered_input, init_keyboard, syms_of_keyboard):
+	Don't initialize and/or maintain the variable any more.  It was made
+	redundant by my commit of 2003-06-15.
+
 	* lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error.
 
 2004-01-21  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
@@ -630,6 +641,13 @@
 
 2003-11-17  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+	* alloc.c (make_float, Fcons): Clear the markbit at init time.
+	(make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment
+	of block_index outside of the macro call.
+	(Fgarbage_collect): Remove null code.
+
+	* m/amdx86-64.h: Don't redefine XPNTR.
+
 	* keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead
 	of VALMASK.
 
--- a/src/fns.c	Fri Jan 23 21:48:58 2004 +0000
+++ b/src/fns.c	Fri Jan 23 21:51:08 2004 +0000
@@ -5454,12 +5454,18 @@
     }
   else
     {
+      struct buffer *prev = current_buffer;
+
+      record_unwind_protect (Fset_buffer, Fcurrent_buffer ());
+
       CHECK_BUFFER (object);
 
       bp = XBUFFER (object);
+      if (bp != current_buffer)
+	set_buffer_internal (bp);
 
       if (NILP (start))
-	b = BUF_BEGV (bp);
+	b = BEGV;
       else
 	{
 	  CHECK_NUMBER_COERCE_MARKER (start);
@@ -5467,7 +5473,7 @@
 	}
 
       if (NILP (end))
-	e = BUF_ZV (bp);
+	e = ZV;
       else
 	{
 	  CHECK_NUMBER_COERCE_MARKER (end);
@@ -5477,7 +5483,7 @@
       if (b > e)
 	temp = b, b = e, e = temp;
 
-      if (!(BUF_BEGV (bp) <= b && e <= BUF_ZV (bp)))
+      if (!(BEGV <= b && e <= ZV))
 	args_out_of_range (start, end);
 
       if (NILP (coding_system))
@@ -5544,6 +5550,11 @@
 	}
 
       object = make_buffer_string (b, e, 0);
+      if (prev != current_buffer)
+	set_buffer_internal (prev);
+      /* Discard the unwind protect for recovering the current
+	 buffer.  */
+      specpdl_ptr--;
 
       if (STRING_MULTIBYTE (object))
 	object = code_convert_string1 (object, coding_system, Qnil, 1);