From 455316e213b0cadbba0545a095243f90e242d16a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 22 Jan 2004 15:28:25 +0000 Subject: [PATCH 1/7] *** empty log message *** --- src/ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 4fba5e166b3..3f6f23e1395 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2004-01-21 Stefan Monnier + * 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 @@ -630,6 +636,13 @@ 2003-11-17 Stefan Monnier + * 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. From f076870ac39d43bd070cb3c8666a6837dc7ae4be Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Thu, 22 Jan 2004 20:42:52 +0000 Subject: [PATCH 2/7] (line-at-pos): New defun. (what-line): Use it. Optimize by only counting lines in narrowed region once. --- lisp/ChangeLog | 6 ++++++ lisp/simple.el | 34 ++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0073e5143ab..9373f8aa984 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-01-22 Kim F. Storm + + * 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 * language/cyrillic.el (ccl-encode-windows-1251-font): Rearrange diff --git a/lisp/simple.el b/lisp/simple.el index d23ed11c6c3..3d2be573012 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -498,20 +498,15 @@ that uses or sets the mark." (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 @@ and the greater of them is not at the start of a line." 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 From b6b50160c2a184f4ac7cce1630e047c7861b0555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Spiegel?= Date: Thu, 22 Jan 2004 23:34:33 +0000 Subject: [PATCH 3/7] (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. --- lisp/vc.el | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/lisp/vc.el b/lisp/vc.el index d8402e9c04b..faf35f57228 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -7,7 +7,7 @@ ;; Maintainer: Andre Spiegel ;; Keywords: tools -;; $Id: vc.el,v 1.362 2004/01/20 17:39:09 uid65624 Exp $ +;; $Id: vc.el,v 1.363 2004/01/21 11:05:51 uid65624 Exp $ ;; This file is part of GNU Emacs. @@ -3135,19 +3135,6 @@ versions after." (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 +3146,7 @@ string, then it describes a revision number, so warp to that 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 +3178,7 @@ revision." (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." From fe722d76d3fd8f68b5dd3baf578ec6356a00c147 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Spiegel?= Date: Thu, 22 Jan 2004 23:37:46 +0000 Subject: [PATCH 4/7] # --- lisp/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9373f8aa984..51870739aa9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2004-01-23 Andre Spiegel + + * 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 * simple.el (line-at-pos): New defun. From fe905025d02b1bea377447bd1282f7fcd32f918e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 23 Jan 2004 00:14:48 +0000 Subject: [PATCH 5/7] (Fmd5): If OBJECT is a buffer different from the current one, set buffer to OBJECT temporarily. --- src/ChangeLog | 5 +++++ src/fns.c | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 3f6f23e1395..a15f25fbde8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-01-23 Kenichi Handa + + * fns.c (Fmd5): If OBJECT is a buffer different from the current + one, set buffer to OBJECT temporarily. + 2004-01-21 Stefan Monnier * keyboard.c (kbd_buffer_gcpro): Remove. diff --git a/src/fns.c b/src/fns.c index ff40c706edd..6383e09302b 100644 --- a/src/fns.c +++ b/src/fns.c @@ -5454,12 +5454,18 @@ guesswork fails. Normally, an error is signaled in such case. */) } 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 @@ guesswork fails. Normally, an error is signaled in such case. */) } if (NILP (end)) - e = BUF_ZV (bp); + e = ZV; else { CHECK_NUMBER_COERCE_MARKER (end); @@ -5477,7 +5483,7 @@ guesswork fails. Normally, an error is signaled in such case. */) 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 @@ guesswork fails. Normally, an error is signaled in such case. */) } 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); From 64fa2c4f107cb5f4cc77199bae05d855ab45a9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Spiegel?= Date: Fri, 23 Jan 2004 11:20:55 +0000 Subject: [PATCH 6/7] (vc-annotate): Fix improper use of `make-local-variable' at the top level of vc.el. (Patch by Benjamin Rutt.) --- lisp/vc.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lisp/vc.el b/lisp/vc.el index faf35f57228..a41a4808e8d 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -7,7 +7,7 @@ ;; Maintainer: Andre Spiegel ;; Keywords: tools -;; $Id: vc.el,v 1.363 2004/01/21 11:05:51 uid65624 Exp $ +;; $Id: vc.el,v 1.364 2004/01/22 23:34:33 uid65624 Exp $ ;; This file is part of GNU Emacs. @@ -2816,9 +2816,6 @@ Uses `rcs2log' which only works for RCS and CVS." (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 @@ colors. `vc-annotate-background' specifies the background color." 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'.) From 414f7d4eb2c6aead50f48fb84b8a425d7cf356f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Spiegel?= Date: Fri, 23 Jan 2004 11:23:08 +0000 Subject: [PATCH 7/7] # --- lisp/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 51870739aa9..c64f0d17698 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2004-01-23 Benjamin Rutt + + * vc.el (vc-annotate): Fix improper use of `make-local-variable' + at the top level of vc.el. + 2004-01-23 Andre Spiegel * vc.el (vc-current-line): Function removed. This is now done by