From 7c111482b974625610a81b698556a47d8dfa772b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Fri, 30 Jul 2004 12:05:32 +0000 Subject: [PATCH 01/27] (Fformat): Allocated extra (dummy) element in info. --- src/ChangeLog | 4 ++++ src/editfns.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 282d422beb1..11cc0f7ba89 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +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 --git a/src/editfns.c b/src/editfns.c index a506c5f4fc8..88a0e63118f 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3254,6 +3254,7 @@ usage: (format STRING &rest OBJECTS) */) /* 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 @@ usage: (format STRING &rest OBJECTS) */) /* 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])); From 4bcce19cc188070e06d7655e47b94f5809413da5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 03:31:28 +0000 Subject: [PATCH 02/27] (utf-translate-cjk-mode): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/international/utf-8.el | 21 ++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea1392783f6..d1ec8994edb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +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 --git a/lisp/international/utf-8.el b/lisp/international/utf-8.el index 77a51abb43f..bad79b58743 100644 --- a/lisp/international/utf-8.el +++ b/lisp/international/utf-8.el @@ -273,7 +273,7 @@ The value nil means that the tables are not yet loaded.") (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 @@ The value nil means that the tables are not yet loaded.") (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 @@ according to the language environment in effect when this option is 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 @@ eight-bit-control and eight-bit-graphic characters.") ;; 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 @@ eight-bit-control and eight-bit-graphic characters.") (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 @@ eight-bit-control and eight-bit-graphic characters.") (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 @@ eight-bit-control and eight-bit-graphic characters.") (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. From 451eaa2138828c165b29f39fe7066dbb04850cb0 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 31 Jul 2004 03:37:21 +0000 Subject: [PATCH 03/27] (Fexpand_abbrev): Undo previous change. --- src/abbrev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/abbrev.c b/src/abbrev.c index 37ab640ee43..ac132f20023 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -248,6 +248,8 @@ Returns the abbrev symbol, if expansion took place. */) 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 @@ Returns the abbrev symbol, if expansion took place. */) 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 From 53a7160c9282d9577ec3f6a6168b0b7c824c5e45 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 31 Jul 2004 03:42:27 +0000 Subject: [PATCH 04/27] (with-local-quit): Doc fix. --- lisp/ChangeLog | 4 ++++ lisp/subr.el | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1ec8994edb..05daa1d088b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +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. diff --git a/lisp/subr.el b/lisp/subr.el index 1e30a127f71..8282e3a9316 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -1894,7 +1894,10 @@ See also `with-temp-file' and `with-output-to-string'." (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)) From d9a68b6a5193dacd2e44ab7e4fe350420adc921a Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 31 Jul 2004 09:23:36 +0000 Subject: [PATCH 05/27] Update URLs in the comments. --- ChangeLog | 4 ++++ config.bat | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa2233a5480..60fbc7e8723 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 --git a/config.bat b/config.bat index 732c4021aaf..c3e36975dec 100644 --- a/config.bat +++ b/config.bat @@ -24,17 +24,15 @@ rem ---------------------------------------------------------------------- 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= From 7a4d608f415d1a48af1c86624d57a5e86e370daf Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:43:26 +0000 Subject: [PATCH 06/27] (enable-command, disable-command): Doc fixes. --- lisp/novice.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/novice.el b/lisp/novice.el index 159c9a96780..1cb89066481 100644 --- a/lisp/novice.el +++ b/lisp/novice.el @@ -104,7 +104,8 @@ SPC to try the command just this once, but leave it disabled. ;;;###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 @@ to future sessions." ;;;###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)) From 0e91dc923a0495534dba3d5b55093676d0321986 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:45:30 +0000 Subject: [PATCH 07/27] (event-modifiers, event-basic-type): Doc fixes. --- lisp/subr.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lisp/subr.el b/lisp/subr.el index 8282e3a9316..0572446aefc 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -644,7 +644,11 @@ The normal global definition of the character C-x indirects to this keymap.") "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 @@ and `down'." (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) From 5581edf5686a20f12cd42d330c45ceec9d5df821 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:50:46 +0000 Subject: [PATCH 08/27] (Fcall_interactively): Doc fix. --- src/callint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/callint.c b/src/callint.c index a3e4984fd16..8b8cb032095 100644 --- a/src/callint.c +++ b/src/callint.c @@ -256,7 +256,8 @@ Optional second arg RECORD-FLAG non-nil 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; { From 5fee9a2f19d29289357ef0b9769a766a8154bee5 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 15:57:40 +0000 Subject: [PATCH 09/27] (syms_of_keyboard) : Doc fix. --- src/keyboard.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index eb2ed608856..07b91d16040 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -11371,8 +11371,8 @@ It's called with one argument, the help string to display. */); 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. */); From a523ade4cba3263a4b628affef813c7ca69b1383 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 16:03:08 +0000 Subject: [PATCH 10/27] (Fset_keymap_parent, Fdefine_prefix_command): Doc fixes. --- src/keymap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/keymap.c b/src/keymap.c index 48108fbfa12..858d0573c70 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -342,6 +342,7 @@ keymap_memberp (map, maps) DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. +Return PARENT. PARENT should be nil or another keymap. */) (keymap, parent) Lisp_Object keymap, parent; @@ -1686,7 +1687,8 @@ If a second optional argument MAPVAR is given, the map is stored as 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; { From 1492344029072d1f7ffaf276d1ce5cdc4dfd16b9 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 16:05:54 +0000 Subject: [PATCH 11/27] (Fset_keymap_parent): Minor doc fix. --- src/keymap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/keymap.c b/src/keymap.c index 858d0573c70..6cb7b8709d3 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -342,8 +342,7 @@ keymap_memberp (map, maps) DEFUN ("set-keymap-parent", Fset_keymap_parent, Sset_keymap_parent, 2, 2, 0, doc: /* Modify KEYMAP to set its parent map to PARENT. -Return PARENT. -PARENT should be nil or another keymap. */) +Return PARENT. PARENT should be nil or another keymap. */) (keymap, parent) Lisp_Object keymap, parent; { From 83f6422686cc5bda8643b36bd1fcb699897a8115 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Sat, 31 Jul 2004 16:09:34 +0000 Subject: [PATCH 12/27] *** empty log message *** --- lisp/ChangeLog | 6 ++++++ src/ChangeLog | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 05daa1d088b..113dfe2cf4d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/src/ChangeLog b/src/ChangeLog index 11cc0f7ba89..a891a6bb68c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +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. From e7fdaf6301d8f81df48720ab25ad21e5d9fb17d1 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 1 Aug 2004 03:56:05 +0000 Subject: [PATCH 13/27] (only-global-abbrevs): Doc fix. (edit-abbrevs-map): Define within defvar. (quietly-read-abbrev-file): Doc fix. --- lisp/ChangeLog | 6 ++++++ lisp/abbrev.el | 15 +++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 113dfe2cf4d..c9f70c9f4be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-01 John Paul Wallington + + * 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. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 3be0014fd0e..3580c136948 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -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 @@ to enable or disable Abbrev mode in the current buffer." :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 @@ Optional second argument QUIETLY non-nil means don't display a message." (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." From 747aa4cfc6879ed3e8b7861082572ca104c27380 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 1 Aug 2004 05:52:30 +0000 Subject: [PATCH 14/27] (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. --- lisp/printing.el | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lisp/printing.el b/lisp/printing.el index 22a3f762ab6..08303e0595d 100644 --- a/lisp/printing.el +++ b/lisp/printing.el @@ -974,7 +974,7 @@ Please send all bug fixes and enhancements to (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 @@ are both set to t." (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 @@ non-nil." (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 @@ non-nil." (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 @@ non-nil." (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 @@ non-nil." (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 @@ non-nil." (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))) From fdeadcd1f6182517df0fcd908513b3f7207b1b55 Mon Sep 17 00:00:00 2001 From: John Paul Wallington Date: Sun, 1 Aug 2004 05:54:54 +0000 Subject: [PATCH 15/27] (help-go-back): Delete period from end of error message. --- lisp/ChangeLog | 6 ++++++ lisp/help-mode.el | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c9f70c9f4be..c2336e478a8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,11 @@ 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. diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 11656ec368c..a2dcdf91ed8 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -581,7 +581,7 @@ help buffer." (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. From 78629844c64aab60083d74c5625d34a84970a14a Mon Sep 17 00:00:00 2001 From: David Kastrup Date: Sun, 1 Aug 2004 12:59:09 +0000 Subject: [PATCH 16/27] (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. --- lisp/ChangeLog | 8 ++++++++ lisp/replace.el | 41 +++++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c2336e478a8..f78140ae1d9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +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) diff --git a/lisp/replace.el b/lisp/replace.el index f09868cc6d3..47437659923 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -94,7 +94,8 @@ wants to replace FROM with TO." 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 @@ wants to replace FROM with TO." (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 @@ wants to replace FROM with TO." (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)) From f491e1edab82eb6f7030889385f6d08fe85123fd Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 1 Aug 2004 23:09:43 +0000 Subject: [PATCH 17/27] *** empty log message *** --- src/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index a891a6bb68c..74a2281988b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +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. From 39b1da208b66d626706391d06715c39bdce7adaa Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Sun, 1 Aug 2004 23:10:06 +0000 Subject: [PATCH 18/27] (read_process_output): Use whole read buffer. Don't trigger adaptive read buffering on errors. --- src/process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/process.c b/src/process.c index aad36b904b5..5e83214f4f9 100644 --- a/src/process.c +++ b/src/process.c @@ -4195,7 +4195,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) 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 @@ read_process_output (proc, channel) 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 @@ read_process_output (proc, channel) 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 @@ read_process_output (proc, channel) { 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 From 361f14bf1184bbac4076cb123d109b034ee11fa4 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:06:06 +0000 Subject: [PATCH 19/27] (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. --- src/indent.c | 69 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/src/indent.c b/src/indent.c index 091c702ac2c..6cb82c18f04 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1131,6 +1131,9 @@ struct position val_compute_motion; 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 @@ -1245,6 +1248,17 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, 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; + } + immediate_quit = 1; QUIT; @@ -1368,7 +1382,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, { if (hscroll || (truncate_partial_width_windows - && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) + && width < FRAME_COLS (XFRAME (WINDOW_FRAME (win)))) || !NILP (current_buffer->truncate_lines)) { /* Truncating: skip to newline, unless we are already past @@ -1737,12 +1751,14 @@ assuming it is at position FROMPOS--a cons of the form (HPOS . VPOS)-- 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 @@ -1774,6 +1790,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) 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; @@ -1783,10 +1800,15 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) 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); @@ -1802,6 +1824,7 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) 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)); @@ -1810,9 +1833,20 @@ visible section of the buffer, and pass LINE and COL as TOPOS. */) 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); @@ -1837,7 +1871,6 @@ vmotion (from, vtarget, w) 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 */ @@ -1858,12 +1891,6 @@ vmotion (from, vtarget, w) 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 ())) @@ -1905,7 +1932,7 @@ vmotion (from, vtarget, w) 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. */ @@ -1964,7 +1991,7 @@ vmotion (from, vtarget, w) 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; @@ -1978,7 +2005,7 @@ vmotion (from, vtarget, w) } 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); } From ec2b66c4c23c702023938f994e87fd3b01c306be Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:06:25 +0000 Subject: [PATCH 20/27] (window_scroll_line_based): Let compute_motion calculate actual window width. --- src/window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/window.c b/src/window.c index c3603c2039f..ad22e1df107 100644 --- a/src/window.c +++ b/src/window.c @@ -4707,7 +4707,7 @@ window_scroll_line_based (window, n, whole, noerror) 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; From 5970bd01f02aee80ba8353f6f7c6e6e5512eaeb4 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:19:24 +0000 Subject: [PATCH 21/27] (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. --- lisp/avoid.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lisp/avoid.el b/lisp/avoid.el index 5a5a09622cd..536b80abdbe 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el @@ -139,15 +139,15 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." "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) From c296856cee8f420a0d69ca8ceaa5dc4c718a7dca Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:20:05 +0000 Subject: [PATCH 22/27] (windmove-coordinates-of-position): Let compute-motion calculate usable window width and height. --- lisp/windmove.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lisp/windmove.el b/lisp/windmove.el index 7008b86335e..642f04a1d8d 100644 --- a/lisp/windmove.el +++ b/lisp/windmove.el @@ -429,14 +429,12 @@ the return value from `windmove-coordinates-of-position' is (0 . 0) 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))) From 7316f52cab8b75ef9f9c1e3bee9198d4fd8c1c4b Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:20:18 +0000 Subject: [PATCH 23/27] (window-buffer-height): Call compute-motion with nil width. --- lisp/window.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/window.el b/lisp/window.el index 96bfc8b5581..5ec752f3f23 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -408,7 +408,7 @@ lines than are actually needed in the case where some error may be present." '(0 . 0) (- (point-max) (if ignore-final-newline 1 0)) (cons 0 100000000) - (window-width window) + nil nil window)))))) From 0f7a93c1c6d940cc7691834a7936b800af6c0d6f Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 15:30:37 +0000 Subject: [PATCH 24/27] *** empty log message *** --- etc/NEWS | 4 ++++ lisp/ChangeLog | 11 +++++++++++ src/ChangeLog | 12 ++++++++++++ 3 files changed, 27 insertions(+) diff --git a/etc/NEWS b/etc/NEWS index 12d8f044637..0693e063992 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -2187,6 +2187,10 @@ configuration files. * 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 --git a/lisp/ChangeLog b/lisp/ChangeLog index f78140ae1d9..b5134b2647f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +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 diff --git a/src/ChangeLog b/src/ChangeLog index 74a2281988b..84538195917 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +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. From df13361290318d0fd05c9c0ff8d187b731d73846 Mon Sep 17 00:00:00 2001 From: Luc Teirlinck Date: Mon, 2 Aug 2004 20:50:09 +0000 Subject: [PATCH 25/27] (Finteractive_form): Doc fix. --- src/ChangeLog | 4 ++++ src/data.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 84538195917..94d8983e1c9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +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, diff --git a/src/data.c b/src/data.c index 1259c5891a1..616e91c2d62 100644 --- a/src/data.c +++ b/src/data.c @@ -776,8 +776,8 @@ SUBR must be a built-in function. */) 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; { From fb8b092b99720c028ecbf48bc9a423024786af86 Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 23:41:59 +0000 Subject: [PATCH 26/27] *** empty log message *** --- src/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 94d8983e1c9..0194c4b8c6f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +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. From ed5c373cab5483317a8b6fca3d8d4d52432934fc Mon Sep 17 00:00:00 2001 From: "Kim F. Storm" Date: Mon, 2 Aug 2004 23:42:14 +0000 Subject: [PATCH 27/27] (compute_motion): Fix check for full width window in non-window case. Do not count left truncation glyph on window systems. --- src/indent.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/indent.c b/src/indent.c index 6cb82c18f04..63f1ed31930 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1231,6 +1231,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, 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); @@ -1259,6 +1260,12 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, 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; @@ -1382,7 +1389,8 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, { if (hscroll || (truncate_partial_width_windows - && width < 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 @@ -1666,7 +1674,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, hpos -= hscroll; /* Count the truncation glyph on column 0 */ if (hscroll > 0) - hpos++; + hpos += continuation_glyph_width; tab_offset = 0; } contin_hpos = 0;