diff options
| -rw-r--r-- | lisp/ChangeLog | 18 | ||||
| -rw-r--r-- | lisp/simple.el | 34 | ||||
| -rw-r--r-- | lisp/vc.el | 29 | ||||
| -rw-r--r-- | src/ChangeLog | 18 | ||||
| -rw-r--r-- | src/fns.c | 17 |
5 files changed, 77 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0073e5143ab..c64f0d17698 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,21 @@ | |||
| 1 | 2004-01-23 Benjamin Rutt <brutt@bloomington.in.us> | ||
| 2 | |||
| 3 | * vc.el (vc-annotate): Fix improper use of `make-local-variable' | ||
| 4 | at the top level of vc.el. | ||
| 5 | |||
| 6 | 2004-01-23 Andre Spiegel <spiegel@gnu.org> | ||
| 7 | |||
| 8 | * vc.el (vc-current-line): Function removed. This is now done by | ||
| 9 | the new function line-at-pos in simple.el. | ||
| 10 | (vc-annotate-warp-version): Use line-at-pos instead of | ||
| 11 | vc-current-line. | ||
| 12 | |||
| 13 | 2004-01-22 Kim F. Storm <storm@cua.dk> | ||
| 14 | |||
| 15 | * simple.el (line-at-pos): New defun. | ||
| 16 | (what-line): Use it. Optimize by only counting lines in narrowed | ||
| 17 | region once. | ||
| 18 | |||
| 1 | 2004-01-22 Kenichi Handa <handa@m17n.org> | 19 | 2004-01-22 Kenichi Handa <handa@m17n.org> |
| 2 | 20 | ||
| 3 | * language/cyrillic.el (ccl-encode-windows-1251-font): Rearrange | 21 | * 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." | |||
| 498 | (defun what-line () | 498 | (defun what-line () |
| 499 | "Print the current buffer line number and narrowed line number of point." | 499 | "Print the current buffer line number and narrowed line number of point." |
| 500 | (interactive) | 500 | (interactive) |
| 501 | (let ((opoint (point)) start) | 501 | (let ((opoint (point)) (start (point-min)) |
| 502 | (save-excursion | 502 | (n (line-at-pos))) |
| 503 | (save-restriction | 503 | (if (= start 1) |
| 504 | (goto-char (point-min)) | 504 | (message "Line %d" n) |
| 505 | (widen) | 505 | (save-excursion |
| 506 | (forward-line 0) | 506 | (save-restriction |
| 507 | (setq start (point)) | 507 | (widen) |
| 508 | (goto-char opoint) | 508 | (message "line %d (narrowed line %d)" |
| 509 | (forward-line 0) | 509 | (+ n (line-at-pos start) -1) n)))))) |
| 510 | (if (/= start (point-min)) | ||
| 511 | (message "line %d (narrowed line %d)" | ||
| 512 | (1+ (count-lines (point-min) (point))) | ||
| 513 | (1+ (count-lines start (point)))) | ||
| 514 | (message "Line %d" (1+ (count-lines (point-min) (point))))))))) | ||
| 515 | 510 | ||
| 516 | (defun count-lines (start end) | 511 | (defun count-lines (start end) |
| 517 | "Return number of lines between START and END. | 512 | "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." | |||
| 536 | done))) | 531 | done))) |
| 537 | (- (buffer-size) (forward-line (buffer-size))))))) | 532 | (- (buffer-size) (forward-line (buffer-size))))))) |
| 538 | 533 | ||
| 534 | (defun line-at-pos (&optional pos) | ||
| 535 | "Return (narrowed) buffer line number at position POS. | ||
| 536 | If POS is nil, use current buffer location." | ||
| 537 | (let ((opoint (or pos (point))) start) | ||
| 538 | (save-excursion | ||
| 539 | (goto-char (point-min)) | ||
| 540 | (setq start (point)) | ||
| 541 | (goto-char opoint) | ||
| 542 | (forward-line 0) | ||
| 543 | (1+ (count-lines start (point)))))) | ||
| 544 | |||
| 539 | (defun what-cursor-position (&optional detail) | 545 | (defun what-cursor-position (&optional detail) |
| 540 | "Print info on cursor position (on screen and within buffer). | 546 | "Print info on cursor position (on screen and within buffer). |
| 541 | Also describe the character after point, and give its character code | 547 | Also describe the character after point, and give its character code |
diff --git a/lisp/vc.el b/lisp/vc.el index 383ffa6fae8..33bb04e4aa1 100644 --- a/lisp/vc.el +++ b/lisp/vc.el | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> | 7 | ;; Maintainer: Andre Spiegel <spiegel@gnu.org> |
| 8 | ;; Keywords: tools | 8 | ;; Keywords: tools |
| 9 | 9 | ||
| 10 | ;; $Id: vc.el,v 1.363 2004/01/21 11:05:51 uid65624 Exp $ | 10 | ;; $Id: vc.el,v 1.365 2004/01/23 11:20:55 uid65624 Exp $ |
| 11 | 11 | ||
| 12 | ;; This file is part of GNU Emacs. | 12 | ;; This file is part of GNU Emacs. |
| 13 | 13 | ||
| @@ -2816,9 +2816,6 @@ Uses `rcs2log' which only works for RCS and CVS." | |||
| 2816 | (defvar vc-annotate-parent-file nil) | 2816 | (defvar vc-annotate-parent-file nil) |
| 2817 | (defvar vc-annotate-parent-rev nil) | 2817 | (defvar vc-annotate-parent-rev nil) |
| 2818 | (defvar vc-annotate-parent-display-mode nil) | 2818 | (defvar vc-annotate-parent-display-mode nil) |
| 2819 | (make-local-variable 'vc-annotate-parent-file) | ||
| 2820 | (make-local-variable 'vc-annotate-parent-rev) | ||
| 2821 | (make-local-variable 'vc-annotate-parent-display-mode) | ||
| 2822 | 2819 | ||
| 2823 | (defconst vc-annotate-font-lock-keywords | 2820 | (defconst vc-annotate-font-lock-keywords |
| 2824 | ;; The fontification is done by vc-annotate-lines instead of font-lock. | 2821 | ;; The fontification is done by vc-annotate-lines instead of font-lock. |
| @@ -3038,9 +3035,10 @@ colors. `vc-annotate-background' specifies the background color." | |||
| 3038 | vc-annotate-version)) | 3035 | vc-annotate-version)) |
| 3039 | (save-excursion | 3036 | (save-excursion |
| 3040 | (set-buffer temp-buffer-name) | 3037 | (set-buffer temp-buffer-name) |
| 3041 | (setq vc-annotate-parent-file bfn) | 3038 | (set (make-local-variable 'vc-annotate-parent-file) bfn) |
| 3042 | (setq vc-annotate-parent-rev vc-annotate-version) | 3039 | (set (make-local-variable 'vc-annotate-parent-rev) vc-annotate-version) |
| 3043 | (setq vc-annotate-parent-display-mode vc-annotate-display-mode)) | 3040 | (set (make-local-variable 'vc-annotate-parent-display-mode) |
| 3041 | vc-annotate-display-mode)) | ||
| 3044 | 3042 | ||
| 3045 | ;; Don't use the temp-buffer-name until the buffer is created | 3043 | ;; Don't use the temp-buffer-name until the buffer is created |
| 3046 | ;; (only after `with-output-to-temp-buffer'.) | 3044 | ;; (only after `with-output-to-temp-buffer'.) |
| @@ -3135,19 +3133,6 @@ versions after." | |||
| 3135 | (vc-version-diff vc-annotate-parent-file prev-rev rev-at-line)) | 3133 | (vc-version-diff vc-annotate-parent-file prev-rev rev-at-line)) |
| 3136 | (switch-to-buffer "*vc-diff*")))))) | 3134 | (switch-to-buffer "*vc-diff*")))))) |
| 3137 | 3135 | ||
| 3138 | (defun vc-current-line () | ||
| 3139 | "Return the current buffer's line number." | ||
| 3140 | (let ((oldpoint (point)) start) | ||
| 3141 | (save-excursion | ||
| 3142 | (save-restriction | ||
| 3143 | (goto-char (point-min)) | ||
| 3144 | (widen) | ||
| 3145 | (forward-line 0) | ||
| 3146 | (setq start (point)) | ||
| 3147 | (goto-char oldpoint) | ||
| 3148 | (forward-line 0) | ||
| 3149 | (1+ (count-lines (point-min) (point))))))) | ||
| 3150 | |||
| 3151 | (defun vc-annotate-warp-version (revspec) | 3136 | (defun vc-annotate-warp-version (revspec) |
| 3152 | "Annotate the version described by REVSPEC. | 3137 | "Annotate the version described by REVSPEC. |
| 3153 | 3138 | ||
| @@ -3159,7 +3144,7 @@ string, then it describes a revision number, so warp to that | |||
| 3159 | revision." | 3144 | revision." |
| 3160 | (if (not (equal major-mode 'vc-annotate-mode)) | 3145 | (if (not (equal major-mode 'vc-annotate-mode)) |
| 3161 | (message "Cannot be invoked outside of a vc annotate buffer") | 3146 | (message "Cannot be invoked outside of a vc annotate buffer") |
| 3162 | (let* ((oldline (vc-current-line)) | 3147 | (let* ((oldline (line-at-pos)) |
| 3163 | (revspeccopy revspec) | 3148 | (revspeccopy revspec) |
| 3164 | (newrev nil)) | 3149 | (newrev nil)) |
| 3165 | (cond | 3150 | (cond |
| @@ -3191,7 +3176,7 @@ revision." | |||
| 3191 | (switch-to-buffer (car (car (last vc-annotate-buffers)))) | 3176 | (switch-to-buffer (car (car (last vc-annotate-buffers)))) |
| 3192 | (goto-line (min oldline (progn (goto-char (point-max)) | 3177 | (goto-line (min oldline (progn (goto-char (point-max)) |
| 3193 | (previous-line) | 3178 | (previous-line) |
| 3194 | (vc-current-line)))))))) | 3179 | (line-at-pos)))))))) |
| 3195 | 3180 | ||
| 3196 | (defun vc-annotate-car-last-cons (a-list) | 3181 | (defun vc-annotate-car-last-cons (a-list) |
| 3197 | "Return car of last cons in association list A-LIST." | 3182 | "Return car of last cons in association list A-LIST." |
diff --git a/src/ChangeLog b/src/ChangeLog index 4fba5e166b3..a15f25fbde8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,16 @@ | |||
| 1 | 2004-01-23 Kenichi Handa <handa@m17n.org> | ||
| 2 | |||
| 3 | * fns.c (Fmd5): If OBJECT is a buffer different from the current | ||
| 4 | one, set buffer to OBJECT temporarily. | ||
| 5 | |||
| 1 | 2004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2004-01-21 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 8 | * keyboard.c (kbd_buffer_gcpro): Remove. | ||
| 9 | (kbd_buffer_store_event, clear_event, Fdiscard_input) | ||
| 10 | (stuff_buffered_input, init_keyboard, syms_of_keyboard): | ||
| 11 | Don't initialize and/or maintain the variable any more. It was made | ||
| 12 | redundant by my commit of 2003-06-15. | ||
| 13 | |||
| 3 | * lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error. | 14 | * lisp.h [USE_LSB_TAG && !DECL_ALIGN]: Signal an error. |
| 4 | 15 | ||
| 5 | 2004-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 16 | 2004-01-21 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| @@ -630,6 +641,13 @@ | |||
| 630 | 641 | ||
| 631 | 2003-11-17 Stefan Monnier <monnier@iro.umontreal.ca> | 642 | 2003-11-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 632 | 643 | ||
| 644 | * alloc.c (make_float, Fcons): Clear the markbit at init time. | ||
| 645 | (make_float, Fcons, Fmake_symbol, allocate_misc): Move the increment | ||
| 646 | of block_index outside of the macro call. | ||
| 647 | (Fgarbage_collect): Remove null code. | ||
| 648 | |||
| 649 | * m/amdx86-64.h: Don't redefine XPNTR. | ||
| 650 | |||
| 633 | * keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead | 651 | * keyboard.c (parse_modifiers, apply_modifiers): Use INTMASK instead |
| 634 | of VALMASK. | 652 | of VALMASK. |
| 635 | 653 | ||
| @@ -5454,12 +5454,18 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5454 | } | 5454 | } |
| 5455 | else | 5455 | else |
| 5456 | { | 5456 | { |
| 5457 | struct buffer *prev = current_buffer; | ||
| 5458 | |||
| 5459 | record_unwind_protect (Fset_buffer, Fcurrent_buffer ()); | ||
| 5460 | |||
| 5457 | CHECK_BUFFER (object); | 5461 | CHECK_BUFFER (object); |
| 5458 | 5462 | ||
| 5459 | bp = XBUFFER (object); | 5463 | bp = XBUFFER (object); |
| 5464 | if (bp != current_buffer) | ||
| 5465 | set_buffer_internal (bp); | ||
| 5460 | 5466 | ||
| 5461 | if (NILP (start)) | 5467 | if (NILP (start)) |
| 5462 | b = BUF_BEGV (bp); | 5468 | b = BEGV; |
| 5463 | else | 5469 | else |
| 5464 | { | 5470 | { |
| 5465 | CHECK_NUMBER_COERCE_MARKER (start); | 5471 | CHECK_NUMBER_COERCE_MARKER (start); |
| @@ -5467,7 +5473,7 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5467 | } | 5473 | } |
| 5468 | 5474 | ||
| 5469 | if (NILP (end)) | 5475 | if (NILP (end)) |
| 5470 | e = BUF_ZV (bp); | 5476 | e = ZV; |
| 5471 | else | 5477 | else |
| 5472 | { | 5478 | { |
| 5473 | CHECK_NUMBER_COERCE_MARKER (end); | 5479 | CHECK_NUMBER_COERCE_MARKER (end); |
| @@ -5477,7 +5483,7 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5477 | if (b > e) | 5483 | if (b > e) |
| 5478 | temp = b, b = e, e = temp; | 5484 | temp = b, b = e, e = temp; |
| 5479 | 5485 | ||
| 5480 | if (!(BUF_BEGV (bp) <= b && e <= BUF_ZV (bp))) | 5486 | if (!(BEGV <= b && e <= ZV)) |
| 5481 | args_out_of_range (start, end); | 5487 | args_out_of_range (start, end); |
| 5482 | 5488 | ||
| 5483 | if (NILP (coding_system)) | 5489 | if (NILP (coding_system)) |
| @@ -5544,6 +5550,11 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5544 | } | 5550 | } |
| 5545 | 5551 | ||
| 5546 | object = make_buffer_string (b, e, 0); | 5552 | object = make_buffer_string (b, e, 0); |
| 5553 | if (prev != current_buffer) | ||
| 5554 | set_buffer_internal (prev); | ||
| 5555 | /* Discard the unwind protect for recovering the current | ||
| 5556 | buffer. */ | ||
| 5557 | specpdl_ptr--; | ||
| 5547 | 5558 | ||
| 5548 | if (STRING_MULTIBYTE (object)) | 5559 | if (STRING_MULTIBYTE (object)) |
| 5549 | object = code_convert_string1 (object, coding_system, Qnil, 1); | 5560 | object = code_convert_string1 (object, coding_system, Qnil, 1); |