# HG changeset patch # User Karoly Lorentey # Date 1091537159 0 # Node ID 09f3fd9f680df56f9a01b2447aa3c2b76413df8a # Parent 7aa4bb74fe302d89d67adaa60dd9cf055a52156e# Parent 47fd67a3710128c34a7b640c008754208912c532 Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-473 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-474 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-475 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-476 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-477 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-478 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-225 diff -r 7aa4bb74fe30 -r 09f3fd9f680d ChangeLog --- a/ChangeLog Tue Aug 03 12:43:11 2004 +0000 +++ b/ChangeLog Tue Aug 03 12:45:59 2004 +0000 @@ -1,3 +1,7 @@ +2004-07-31 Eli Zaretskii + + * config.bat: Update URLs in the comments. + 2004-07-05 Andreas Schwab * Makefile.in (install-arch-indep): Remove .arch-inventory files. diff -r 7aa4bb74fe30 -r 09f3fd9f680d config.bat --- a/config.bat Tue Aug 03 12:43:11 2004 +0000 +++ b/config.bat Tue Aug 03 12:45:59 2004 +0000 @@ -24,17 +24,15 @@ rem YOU'LL NEED THE FOLLOWING UTILITIES TO MAKE EMACS: rem rem + msdos version 3 or better. -rem + djgpp version 1.12maint1 or later (version 2.0 or later recommended). +rem + DJGPP version 1.12maint1 or later (version 2.03 or later recommended). rem + make utility that allows breaking of the 128 chars limit on rem command lines. ndmake (as of version 4.5) won't work due to a -rem line length limit. The make that comes with djgpp does work. +rem line length limit. The make that comes with DJGPP does work. rem + rm and mv (from GNU file utilities). rem + sed (you can use the port that comes with DJGPP). rem -rem You should be able to get all the above utilities from any SimTel -rem repository, e.g. ftp.simtel.net, in the directory -rem "pub/simtelnet/gnu/djgpp/v2gnu". As usual, please use your local -rem mirroring site to reduce trans-Atlantic traffic. +rem You should be able to get all the above utilities from the DJGPP FTP +rem site, ftp.delorie.com, in the directory "pub/djgpp/current/v2gnu". rem ---------------------------------------------------------------------- set X11= set nodebug= diff -r 7aa4bb74fe30 -r 09f3fd9f680d etc/NEWS --- a/etc/NEWS Tue Aug 03 12:43:11 2004 +0000 +++ b/etc/NEWS Tue Aug 03 12:45:59 2004 +0000 @@ -2187,6 +2187,10 @@ * Lisp Changes in Emacs 21.4 +** Function `compute-motion' now calculates the usable window +width if the WIDTH argument is nil. If the TOPOS argument is nil, +the usable window height and width is used. + +++ ** `visited-file-modtime' and `calendar-time-from-absolute' now return a list of two integers, instead of a cons. diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/ChangeLog --- a/lisp/ChangeLog Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/ChangeLog Tue Aug 03 12:45:59 2004 +0000 @@ -1,3 +1,48 @@ +2004-08-02 Kim F. Storm + + * avoid.el (mouse-avoidance-point-position): Use window-inside-edges + and call compute-motion with nil for topos and width to get proper + usable width and height for both window and non-window systems. + + * windmove.el (windmove-coordinates-of-position): Let compute-motion + calculate usable window width and height. + + * window.el (window-buffer-height): Call compute-motion with nil width. + +2004-08-01 David Kastrup + + * replace.el (query-replace-read-from): Use + `query-replace-compile-replacement'. + (query-replace-compile-replacement): New function. + (query-replace-read-to): Use `query-replace-compile-replacement' + for repeating the last command. + +2004-08-01 John Paul Wallington + + * printing.el (toplevel, pr-ps-fast-fire, pr-ps-set-utility) + (pr-ps-set-printer, pr-txt-set-printer, pr-eval-setting-alist) + (pr-switches): Remove period from end of error messages. + + * help-mode.el (help-go-back): Likewise. + + * abbrev.el (only-global-abbrevs): Doc fix. + (edit-abbrevs-map): Define within defvar. + (quietly-read-abbrev-file): Doc fix. + +2004-07-31 Luc Teirlinck + + * novice.el (enable-command, disable-command): Doc fixes. + + * subr.el (event-modifiers, event-basic-type): Doc fixes. + +2004-07-30 Richard M. Stallman + + * subr.el (with-local-quit): Doc fix. + +2004-07-30 Luc Teirlinck + + * international/utf-8.el (utf-translate-cjk-mode): Doc fix. + 2004-07-28 Luc Teirlinck * custom.el (defcustom): Doc fix. diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/abbrev.el --- a/lisp/abbrev.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/abbrev.el Tue Aug 03 12:45:59 2004 +0000 @@ -29,7 +29,7 @@ ;;; Code: (defcustom only-global-abbrevs nil - "*t means user plans to use global abbrevs only. + "Non-nil means user plans to use global abbrevs only. This makes the commands that normally define mode-specific abbrevs define global abbrevs instead." :type 'boolean @@ -59,13 +59,12 @@ :group 'abbrev-mode) -(defvar edit-abbrevs-map nil +(defvar edit-abbrevs-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-x\C-s" 'edit-abbrevs-redefine) + (define-key map "\C-c\C-c" 'edit-abbrevs-redefine) + map) "Keymap used in `edit-abbrevs'.") -(if edit-abbrevs-map - nil - (setq edit-abbrevs-map (make-sparse-keymap)) - (define-key edit-abbrevs-map "\C-x\C-s" 'edit-abbrevs-redefine) - (define-key edit-abbrevs-map "\C-c\C-c" 'edit-abbrevs-redefine)) (defun kill-all-abbrevs () "Undefine all defined abbrevs." @@ -195,7 +194,7 @@ (setq abbrevs-changed nil)) (defun quietly-read-abbrev-file (&optional file) - "Read abbrev definitions from file written with write-abbrev-file. + "Read abbrev definitions from file written with `write-abbrev-file'. Optional argument FILE is the name of the file to read; it defaults to the value of `abbrev-file-name'. Does not display any message." diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/avoid.el --- a/lisp/avoid.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/avoid.el Tue Aug 03 12:45:59 2004 +0000 @@ -139,15 +139,15 @@ "Return the position of point as (FRAME X . Y). Analogous to mouse-position." (let* ((w (selected-window)) - (edges (window-edges w)) + (edges (window-inside-edges w)) (list (compute-motion (max (window-start w) (point-min)) ; start pos ;; window-start can be < point-min if the ;; latter has changed since the last redisplay '(0 . 0) ; start XY (point) ; stop pos - (cons (window-width) (window-height)); stop XY: none - (1- (window-width)) ; width + nil ; stop XY: none + nil ; width (cons (window-hscroll w) 0) ; 0 may not be right? (selected-window)))) ;; compute-motion returns (pos HPOS VPOS prevhpos contin) diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/help-mode.el --- a/lisp/help-mode.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/help-mode.el Tue Aug 03 12:45:59 2004 +0000 @@ -581,7 +581,7 @@ (interactive) (if help-xref-stack (help-xref-go-back (current-buffer)) - (error "No previous help buffer."))) + (error "No previous help buffer"))) (defun help-do-xref (pos function args) "Call the help cross-reference function FUNCTION with args ARGS. diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/international/utf-8.el --- a/lisp/international/utf-8.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/international/utf-8.el Tue Aug 03 12:45:59 2004 +0000 @@ -273,7 +273,7 @@ (utf-translate-cjk-load-tables)) (gethash code-point (get 'utf-subst-table-for-decode 'translation-hash-table))) - + (defun utf-lookup-subst-table-for-encode (char) (if (and utf-translate-cjk-mode @@ -282,9 +282,11 @@ (utf-translate-cjk-load-tables)) (gethash char (get 'utf-subst-table-for-encode 'translation-hash-table))) - + (define-minor-mode utf-translate-cjk-mode - "Whether the UTF based coding systems should decode/encode CJK characters. + "Toggle whether UTF based coding systems de/encode CJK characters. +If ARG is an integer, enable if ARG is positive and disable if +zero or negative. This is a minor mode. Enabling this allows the coding systems mule-utf-8, mule-utf-16le and mule-utf-16be to encode characters in the charsets `korean-ksc5601', `chinese-gb2312', `chinese-big5-1', @@ -296,9 +298,10 @@ turned on: ksc5601 for Korean, gb2312 for Chinese-GB, big5 for Chinese-Big5 and jisx for other environments. -This option is on by default. If you are not interested in CJK +This mode is on by default. If you are not interested in CJK characters and want to avoid some overhead on encoding/decoding -by the above coding systems, you can customize this option to nil." +by the above coding systems, you can customize the user option +`utf-translate-cjk-mode' to nil." :init-value t :version "21.4" :type 'boolean @@ -605,7 +608,7 @@ ;; UTF-8 decoder generates an UTF-8 sequence represented by a ;; sequence eight-bit-control/graphic chars for an untranslatable ;; character and an invalid byte. - ;; + ;; ;; This CCL parses that sequence (the first byte is already in r1), ;; writes out the original bytes of that sequence, and sets r5 to ;; -1. @@ -624,7 +627,7 @@ (read-multibyte-character r5 r6) (r0 = (r5 != ,(charset-id 'eight-bit-control))) (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0) - ((write r1) ; invalid UTF-8 + ((write r1) ; invalid UTF-8 (r1 = -1) (end))) @@ -641,7 +644,7 @@ (r1 = -1) ;; Read the 3rd byte. (read-multibyte-character r5 r6) - (r0 = (r5 != ,(charset-id 'eight-bit-control))) + (r0 = (r5 != ,(charset-id 'eight-bit-control))) (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0) (end)) ; invalid UTF-8 (write r6) @@ -651,7 +654,7 @@ (end))) ;; Read the 4th byte. (read-multibyte-character r5 r6) - (r0 = (r5 != ,(charset-id 'eight-bit-control))) + (r0 = (r5 != ,(charset-id 'eight-bit-control))) (if ((r5 != ,(charset-id 'eight-bit-graphic)) & r0) (end)) ; invalid UTF-8 ;; 4-byte sequence for an untranslated character. diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/novice.el --- a/lisp/novice.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/novice.el Tue Aug 03 12:45:59 2004 +0000 @@ -104,7 +104,8 @@ ;;;###autoload (defun enable-command (command) "Allow COMMAND to be executed without special confirmation from now on. -The user's .emacs file is altered so that this will apply +COMMAND must be a symbol. +This command alters the user's .emacs file so that this will apply to future sessions." (interactive "CEnable command: ") (put command 'disabled nil) @@ -141,7 +142,8 @@ ;;;###autoload (defun disable-command (command) "Require special confirmation to execute COMMAND from now on. -The user's .emacs file is altered so that this will apply +COMMAND must be a symbol. +This command alters the user's .emacs file so that this will apply to future sessions." (interactive "CDisable command: ") (if (not (commandp command)) diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/printing.el --- a/lisp/printing.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/printing.el Tue Aug 03 12:45:59 2004 +0000 @@ -974,7 +974,7 @@ (and (string< ps-print-version "6.6.4") - (error "`printing' requires `ps-print' package version 6.6.4 or later.")) + (error "`printing' requires `ps-print' package version 6.6.4 or later")) (eval-and-compile @@ -4254,7 +4254,7 @@ (pr-ps-buffer-ps-print (if (integerp n-up) (min (max n-up 1) 100) - (error "n-up must be an integer greater than zero.")) + (error "n-up must be an integer greater than zero")) filename))) @@ -5031,7 +5031,7 @@ (let ((item (cdr (assq value pr-ps-utility-alist)))) (or item (error - "Invalid PostScript utility name `%s' for variable `pr-ps-utility'." + "Invalid PostScript utility name `%s' for variable `pr-ps-utility'" value)) (setq pr-ps-utility value) (pr-eval-alist (nthcdr 9 item))) @@ -5042,7 +5042,7 @@ (let ((ps (cdr (assq value pr-ps-printer-alist)))) (or ps (error - "Invalid PostScript printer name `%s' for variable `pr-ps-name'." + "Invalid PostScript printer name `%s' for variable `pr-ps-name'" value)) (setq pr-ps-name value pr-ps-command (pr-dosify-file-name (nth 0 ps)) @@ -5068,7 +5068,7 @@ (defun pr-txt-set-printer (value) (let ((txt (cdr (assq value pr-txt-printer-alist)))) (or txt - (error "Invalid text printer name `%s' for variable `pr-txt-name'." + (error "Invalid text printer name `%s' for variable `pr-txt-name'" value)) (setq pr-txt-name value pr-txt-command (pr-dosify-file-name (nth 0 txt)) @@ -5121,7 +5121,7 @@ (setq global nil))) (and inherits (if (memq inherits old) - (error "Circular inheritance for `%S'." inherits) + (error "Circular inheritance for `%S'" inherits) (setq local-list (pr-eval-setting-alist inherits global (cons inherits old))))) @@ -5349,7 +5349,7 @@ (defun pr-switches (switches mess) (or (listp switches) - (error "%S should have a list of strings." mess)) + (error "%S should have a list of strings" mess)) (ps-flatten-list ; dynamic evaluation (mapcar 'ps-eval-switch switches))) diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/replace.el --- a/lisp/replace.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/replace.el Tue Aug 03 12:45:59 2004 +0000 @@ -94,7 +94,8 @@ query-replace-from-history-variable nil t)))) (if (and (zerop (length from)) lastto lastfrom) - (cons lastfrom lastto) + (cons lastfrom + (query-replace-compile-replacement lastto regexp-flag)) ;; Warn if user types \n or \t, but don't reject the input. (and regexp-flag (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) @@ -107,15 +108,12 @@ (sit-for 2))) from)))) -(defun query-replace-read-to (from string regexp-flag) - "Query and return the `from' argument of a query-replace operation." - (let ((to (save-excursion - (read-from-minibuffer - (format "%s %s with: " string (query-replace-descr from)) - nil nil nil - query-replace-to-history-variable from t)))) - (when (and regexp-flag - (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) +(defun query-replace-compile-replacement (to regexp-flag) + "Maybe convert a regexp replacement TO to Lisp. +Returns a list suitable for `perform-replace' if necessary, +the original string if not." + (if (and regexp-flag + (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to)) (let (pos list char) (while (progn @@ -142,14 +140,25 @@ (cdr pos)))) (setq to (substring to end))))) (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" to))) - (setq to (nreverse (delete "" (cons to list))))) - (replace-match-string-symbols to) - (setq to (cons 'replace-eval-replacement - (if (> (length to) 1) - (cons 'concat to) - (car to))))) + (setq to (nreverse (delete "" (cons to list)))) + (replace-match-string-symbols to) + (cons 'replace-eval-replacement + (if (cdr to) + (cons 'concat to) + (car to)))) to)) + +(defun query-replace-read-to (from string regexp-flag) + "Query and return the `to' argument of a query-replace operation." + (query-replace-compile-replacement + (save-excursion + (read-from-minibuffer + (format "%s %s with: " string (query-replace-descr from)) + nil nil nil + query-replace-to-history-variable from t)) + regexp-flag)) + (defun query-replace-read-args (string regexp-flag &optional noerror) (unless noerror (barf-if-buffer-read-only)) diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/subr.el --- a/lisp/subr.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/subr.el Tue Aug 03 12:45:59 2004 +0000 @@ -644,7 +644,11 @@ "Return a list of symbols representing the modifier keys in event EVENT. The elements of the list may include `meta', `control', `shift', `hyper', `super', `alt', `click', `double', `triple', `drag', -and `down'." +and `down'. +EVENT may be an event or an event type. If EVENT is a symbol +that has never been used in an event that has been read as input +in the current Emacs session, then this function can return nil, +even when EVENT actually has modifiers." (let ((type event)) (if (listp type) (setq type (car type))) @@ -671,7 +675,10 @@ (defun event-basic-type (event) "Return the basic type of the given event (all modifiers removed). -The value is a printing character (not upper case) or a symbol." +The value is a printing character (not upper case) or a symbol. +EVENT may be an event or an event type. If EVENT is a symbol +that has never been used in an event that has been read as input +in the current Emacs session, then this function may return nil." (if (consp event) (setq event (car event))) (if (symbolp event) @@ -1906,7 +1913,10 @@ (kill-buffer nil))))) (defmacro with-local-quit (&rest body) - "Execute BODY with `inhibit-quit' temporarily bound to nil." + "Execute BODY, allowing quits to terminate BODY but not escape further. +When a quit terminates BODY, `with-local-quit' requests another quit when +it finishes. That quit will be processed in turn, the next time quitting +is again allowed." (declare (debug t) (indent 0)) `(condition-case nil (let ((inhibit-quit nil)) diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/windmove.el --- a/lisp/windmove.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/windmove.el Tue Aug 03 12:45:59 2004 +0000 @@ -429,14 +429,12 @@ regardless of the where point is in the buffer and where the window is placed in the frame." (let* ((wind (if (null window) (selected-window) window)) - (usable-width (1- (window-width wind))) ; 1- for cont. column - (usable-height (1- (window-height wind))) ; 1- for mode line (big-hairy-result (compute-motion (window-start) '(0 . 0) pos - (cons usable-width usable-height) - usable-width + nil ; (window-width window-height) + nil ; window-width (cons (window-hscroll) 0) ; why zero? wind))) diff -r 7aa4bb74fe30 -r 09f3fd9f680d lisp/window.el --- a/lisp/window.el Tue Aug 03 12:43:11 2004 +0000 +++ b/lisp/window.el Tue Aug 03 12:45:59 2004 +0000 @@ -408,7 +408,7 @@ '(0 . 0) (- (point-max) (if ignore-final-newline 1 0)) (cons 0 100000000) - (window-width window) + nil nil window)))))) diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/ChangeLog --- a/src/ChangeLog Tue Aug 03 12:43:11 2004 +0000 +++ b/src/ChangeLog Tue Aug 03 12:45:59 2004 +0000 @@ -1,3 +1,42 @@ +2004-08-03 Kim F. Storm + + * indent.c (compute_motion): Fix check for full width window + in non-window case. Do not count left truncation glyph on + window systems. + +2004-08-02 Luc Teirlinck + + * data.c (Finteractive_form): Doc fix. + +2004-08-02 Kim F. Storm + + * indent.c (compute_motion): Use actual window width if WIDTH is -1, + properly accounting for continuation glyph on non-window systems. + (Fcompute_motion): Use actual window width if WIDTH is nil, and + actual window width/height if TOPOS is nil, properly accounting for + continuation glyphs on non-window systems, and optional header lines. + (vmotion): Let compute_motion calculate actual window width. + + * window.c (window_scroll_line_based): Let compute_motion + calculate actual window width. + +2004-08-02 Kim F. Storm + + * process.c (read_process_output): Use whole read buffer. + Don't trigger adaptive read buffering on errors. + +2004-07-31 Luc Teirlinck + + * keymap.c (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. + + * keyboard.c (syms_of_keyboard) : Doc fix. + + * callint.c (Fcall_interactively): Doc fix. + +2004-07-30 Kim F. Storm + + * editfns.c (Fformat): Allocate extra (dummy) element in info. + 2004-07-28 Luc Teirlinck * eval.c (Fdefvar, Fdefconst): Doc fixes. diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/abbrev.c --- a/src/abbrev.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/abbrev.c Tue Aug 03 12:45:59 2004 +0000 @@ -248,6 +248,8 @@ value = Qnil; + Frun_hooks (1, &Qpre_abbrev_expand_hook); + wordstart = 0; if (!(BUFFERP (Vabbrev_start_location_buffer) && XBUFFER (Vabbrev_start_location_buffer) == current_buffer)) @@ -324,8 +326,6 @@ if (INTEGERP (sym) || NILP (SYMBOL_VALUE (sym))) return value; - Frun_hooks (1, &Qpre_abbrev_expand_hook); - if (INTERACTIVE && !EQ (minibuf_window, selected_window)) { /* Add an undo boundary, in case we are doing this for diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/callint.c --- a/src/callint.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/callint.c Tue Aug 03 12:45:59 2004 +0000 @@ -256,7 +256,8 @@ means unconditionally put this command in the command-history. Otherwise, this is done only if an arg is read using the minibuffer. Optional third arg KEYS, if given, specifies the sequence of events to -supply if the command inquires which events were used to invoke it. */) +supply if the command inquires which events were used to invoke it. +If KEYS is omitted or nil, the return value of `this-command-keys' is used. */) (function, record_flag, keys) Lisp_Object function, record_flag, keys; { diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/data.c --- a/src/data.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/data.c Tue Aug 03 12:45:59 2004 +0000 @@ -776,8 +776,8 @@ DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0, doc: /* Return the interactive form of CMD or nil if none. -CMD must be a command. Value, if non-nil, is a list -\(interactive SPEC). */) +If CMD is not a command, the return value is nil. +Value, if non-nil, is a list \(interactive SPEC). */) (cmd) Lisp_Object cmd; { diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/editfns.c --- a/src/editfns.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/editfns.c Tue Aug 03 12:45:59 2004 +0000 @@ -3254,6 +3254,7 @@ /* Piggyback on this loop to initialize precision[N]. */ precision[n] = -1; } + precision[nargs] = -1; CHECK_STRING (args[0]); /* We may have to change "%S" to "%s". */ @@ -3277,11 +3278,11 @@ /* Allocate the info and discarded tables. */ { - int nbytes = nargs * sizeof *info; + int nbytes = (nargs+1) * sizeof *info; int i; info = (struct info *) alloca (nbytes); bzero (info, nbytes); - for (i = 0; i < nargs; i++) + for (i = 0; i <= nargs; i++) info[i].start = -1; discarded = (char *) alloca (SBYTES (args[0])); bzero (discarded, SBYTES (args[0])); diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/indent.c --- a/src/indent.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/indent.c Tue Aug 03 12:45:59 2004 +0000 @@ -1133,6 +1133,9 @@ WIDTH is the number of columns available to display text; compute_motion uses this to handle continuation lines and such. + If WIDTH is -1, use width of window's text area adjusted for + continuation glyph when needed. + HSCROLL is the number of columns not being displayed at the left margin; this is usually taken from a window's hscroll member. TAB_OFFSET is the number of columns of the first tab that aren't @@ -1230,6 +1233,7 @@ int prev_vpos = 0; int contin_hpos; /* HPOS of last column of continued line. */ int prev_tab_offset; /* Previous tab offset. */ + int continuation_glyph_width; XSETBUFFER (buffer, current_buffer); XSETWINDOW (window, win); @@ -1247,6 +1251,23 @@ if (tab_width <= 0 || tab_width > 1000) tab_width = 8; + /* Negative width means use all available text columns. */ + if (width < 0) + { + width = window_box_text_cols (win); + /* We must make room for continuation marks if we don't have fringes. */ +#ifdef HAVE_WINDOW_SYSTEM + if (!FRAME_WINDOW_P (XFRAME (win->frame))) +#endif + width -= 1; + } + + continuation_glyph_width = 0; +#ifdef HAVE_WINDOW_SYSTEM + if (!FRAME_WINDOW_P (XFRAME (win->frame))) + continuation_glyph_width = 1; +#endif + immediate_quit = 1; QUIT; @@ -1370,7 +1391,8 @@ { if (hscroll || (truncate_partial_width_windows - && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) + && ((width + continuation_glyph_width) + < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))) || !NILP (current_buffer->truncate_lines)) { /* Truncating: skip to newline, unless we are already past @@ -1654,7 +1676,7 @@ hpos -= hscroll; /* Count the truncation glyph on column 0 */ if (hscroll > 0) - hpos++; + hpos += continuation_glyph_width; tab_offset = 0; } contin_hpos = 0; @@ -1739,12 +1761,14 @@ to position TO or position TOPOS--another cons of the form (HPOS . VPOS)-- and return the ending buffer position and screen location. +If TOPOS is nil, the actual width and height of the window's +text area are used. + There are three additional arguments: WIDTH is the number of columns available to display text; -this affects handling of continuation lines. -This is usually the value returned by `window-width', less one (to allow -for the continuation glyph). +this affects handling of continuation lines. A value of nil +corresponds to the actual number of available text columns. OFFSETS is either nil or a cons cell (HSCROLL . TAB-OFFSET). HSCROLL is the number of columns not being displayed at the left @@ -1776,6 +1800,7 @@ Lisp_Object from, frompos, to, topos; Lisp_Object width, offsets, window; { + struct window *w; Lisp_Object bufpos, hpos, vpos, prevhpos; struct position *pos; int hscroll, tab_offset; @@ -1785,10 +1810,15 @@ CHECK_NUMBER_CAR (frompos); CHECK_NUMBER_CDR (frompos); CHECK_NUMBER_COERCE_MARKER (to); - CHECK_CONS (topos); - CHECK_NUMBER_CAR (topos); - CHECK_NUMBER_CDR (topos); - CHECK_NUMBER (width); + if (!NILP (topos)) + { + CHECK_CONS (topos); + CHECK_NUMBER_CAR (topos); + CHECK_NUMBER_CDR (topos); + } + if (!NILP (width)) + CHECK_NUMBER (width); + if (!NILP (offsets)) { CHECK_CONS (offsets); @@ -1804,6 +1834,7 @@ window = Fselected_window (); else CHECK_LIVE_WINDOW (window); + w = XWINDOW (window); if (XINT (from) < BEGV || XINT (from) > ZV) args_out_of_range_3 (from, make_number (BEGV), make_number (ZV)); @@ -1812,9 +1843,20 @@ pos = compute_motion (XINT (from), XINT (XCDR (frompos)), XINT (XCAR (frompos)), 0, - XINT (to), XINT (XCDR (topos)), - XINT (XCAR (topos)), - XINT (width), hscroll, tab_offset, + XINT (to), + (NILP (topos) + ? window_internal_height (w) + : XINT (XCDR (topos))), + (NILP (topos) + ? (window_box_text_cols (w) + - ( +#ifdef HAVE_WINDOW_SYSTEM + FRAME_WINDOW_P (XFRAME (w->frame)) ? 0 : +#endif + 1)) + : XINT (XCAR (topos))), + (NILP (width) ? -1 : XINT (width)), + hscroll, tab_offset, XWINDOW (window)); XSETFASTINT (bufpos, pos->bufpos); @@ -1839,7 +1881,6 @@ register int from, vtarget; struct window *w; { - int width = window_box_text_cols (w); int hscroll = XINT (w->hscroll); struct position pos; /* vpos is cumulative vertical position, changed as from is changed */ @@ -1860,12 +1901,6 @@ XSETWINDOW (window, w); - /* We must make room for continuation marks if we don't have fringes. */ -#ifdef HAVE_WINDOW_SYSTEM - if (!FRAME_WINDOW_P (XFRAME (w->frame))) -#endif - width -= 1; - /* If the window contains this buffer, use it for getting text properties. Otherwise use the current buffer as arg for doing that. */ if (EQ (w->buffer, Fcurrent_buffer ())) @@ -1907,7 +1942,7 @@ 1 << (BITS_PER_SHORT - 1), /* ... nor HPOS. */ 1 << (BITS_PER_SHORT - 1), - width, hscroll, + -1, hscroll, /* This compensates for start_hpos so that a tab as first character still occupies 8 columns. */ @@ -1966,7 +2001,7 @@ 1 << (BITS_PER_SHORT - 1), /* ... nor HPOS. */ 1 << (BITS_PER_SHORT - 1), - width, hscroll, + -1, hscroll, (XFASTINT (prevline) == BEG ? -start_hpos : 0), w); did_motion = 1; @@ -1980,7 +2015,7 @@ } return compute_motion (from, vpos, pos.hpos, did_motion, ZV, vtarget, - (1 << (BITS_PER_SHORT - 1)), - width, hscroll, + -1, hscroll, pos.tab_offset - (from == BEG ? start_hpos : 0), w); } diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/keyboard.c --- a/src/keyboard.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/keyboard.c Tue Aug 03 12:45:59 2004 +0000 @@ -11505,8 +11505,8 @@ After a command is executed, if point is moved into a region that has special properties (e.g. composition, display), we adjust point to -the boundary of the region. But, several special commands sets this -variable to non-nil, then we suppress the point adjustment. +the boundary of the region. But, when a command sets this variable to +non-nil, we suppress the point adjustment. This variable is set to nil before reading a command, and is checked just after executing the command. */); diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/keymap.c --- a/src/keymap.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/keymap.c Tue Aug 03 12:45:59 2004 +0000 @@ -343,7 +343,7 @@ DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. -PARENT should be nil or another keymap. */) +Return PARENT. PARENT should be nil or another keymap. */) (keymap, parent) Lisp_Object keymap, parent; { @@ -1687,7 +1687,8 @@ its value instead of as COMMAND's value; but COMMAND is still defined as a function. The third optional argument NAME, if given, supplies a menu name -string for the map. This is required to use the keymap as a menu. */) +string for the map. This is required to use the keymap as a menu. +This function returns COMMAND. */) (command, mapvar, name) Lisp_Object command, mapvar, name; { diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/process.c --- a/src/process.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/process.c Tue Aug 03 12:45:59 2004 +0000 @@ -4195,7 +4195,7 @@ present (for reading) at stdin, even when none is. This causes the call to SELECT below to return 1 and status_notify not to be called. As a result output of - subprocesses are incorrectly discarded. + subprocesses are incorrectly discarded. */ FD_CLR (0, &Atemp); #endif @@ -4762,16 +4762,16 @@ if (DATAGRAM_CHAN_P (channel)) { int len = datagram_address[channel].len; - nbytes = recvfrom (channel, chars + carryover, readmax - carryover, + nbytes = recvfrom (channel, chars + carryover, readmax, 0, datagram_address[channel].sa, &len); } else #endif if (proc_buffered_char[channel] < 0) { - nbytes = emacs_read (channel, chars + carryover, readmax - carryover); + nbytes = emacs_read (channel, chars + carryover, readmax); #ifdef ADAPTIVE_READ_BUFFERING - if (!NILP (p->adaptive_read_buffering)) + if (nbytes > 0 && !NILP (p->adaptive_read_buffering)) { int delay = XINT (p->read_output_delay); if (nbytes < 256) @@ -4783,7 +4783,7 @@ delay += READ_OUTPUT_DELAY_INCREMENT * 2; } } - else if (delay > 0 && (nbytes == readmax - carryover)) + else if (delay > 0 && (nbytes == readmax)) { delay -= READ_OUTPUT_DELAY_INCREMENT; if (delay == 0) @@ -4802,7 +4802,7 @@ { chars[carryover] = proc_buffered_char[channel]; proc_buffered_char[channel] = -1; - nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1 - carryover); + nbytes = emacs_read (channel, chars + carryover + 1, readmax - 1); if (nbytes < 0) nbytes = 1; else diff -r 7aa4bb74fe30 -r 09f3fd9f680d src/window.c --- a/src/window.c Tue Aug 03 12:43:11 2004 +0000 +++ b/src/window.c Tue Aug 03 12:45:59 2004 +0000 @@ -4709,7 +4709,7 @@ posit = *compute_motion (startpos, 0, 0, 0, PT, ht, 0, - window_box_text_cols (w), XINT (w->hscroll), + -1, XINT (w->hscroll), 0, w); original_vpos = posit.vpos;