PATCH packages
This patch fixes the two problems with M-x shell that Mike Kupfer
reported recently, and also syncs up docstrings for the field.el
functions with the latest in Emacs CVS.
xemacs-packages/xemacs-base/ChangeLog addition:
2006-07-06 Jerry James <james(a)xemacs.org>
* comint.el (comint-output-filter): Don't move point to the bottom
unconditionally. Also, clean up old extents that no longer have a
buffer.
* field.el (find-field): When point was at the meeting place of
two fields, find-field was finding the field before point instead
of the field after point, like Emacs does.
* field.el (delete-field): Update the docstring with a warning
about args-out-of-range.
* field.el (field-string): Ditto.
* field.el (field-string-no-properties): Ditto.
* field.el (field-beginning): Ditto.
* field.el (field-end): Ditto.
packages source patch:
Diff command: cvs -q diff -uN
Files affected: xemacs-packages/xemacs-base/field.el
xemacs-packages/xemacs-base/comint.el
Index: xemacs-packages/xemacs-base/comint.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/comint.el,v
retrieving revision 1.17
diff -d -u -r1.17 comint.el
--- xemacs-packages/xemacs-base/comint.el 2006/06/15 22:45:12 1.17
+++ xemacs-packages/xemacs-base/comint.el 2006/07/06 17:10:26
@@ -1789,15 +1789,15 @@
(set-marker comint-last-output-start ostart)
(set-marker (process-mark process) (point))
(force-mode-line-update)
- (narrow-to-region obeg oend)
- (goto-char opoint)
(unless comint-inhibit-carriage-motion
;; Interpret any carriage motion characters (newline, backspace)
(comint-carriage-motion comint-last-output-start (point)))
;; Run these hooks with point where the user had it.
+ (goto-char opoint)
(run-hook-with-args 'comint-output-filter-functions string)
+ (setq opoint (point))
(goto-char (process-mark process)) ; in case a filter moved it
@@ -1820,6 +1820,15 @@
(add-text-properties
prompt-start (point)
'(read-only t end-open t start-open (read-only))))
+
+ ;; XEmacs change: if the existing prompt extent is for a
+ ;; different buffer, kill it
+ (unless (or (null comint-last-prompt-extent)
+ (eq (extent-object comint-last-prompt-extent)
+ oprocbuf))
+ (delete-extent comint-last-prompt-extent)
+ (setq comint-last-prompt-extent nil))
+
(unless (and (bolp) (null comint-last-prompt-extent))
;; Need to create or move the prompt extent (in the case
;; where there is no prompt ((bolp) == t), we still do
@@ -1833,7 +1842,11 @@
(make-extent prompt-start (point)))
(set-extent-property
comint-last-prompt-extent
- 'font-lock-face 'comint-highlight-prompt)))))))))
+ 'font-lock-face 'comint-highlight-prompt))))
+
+ ;; Put point back where the user left it
+ (narrow-to-region obeg oend)
+ (goto-char opoint))))))
;; XEmacs: Use a variable for this so that new commands can be added easily.
(defcustom comint-scroll-to-bottom-on-input-commands
Index: xemacs-packages/xemacs-base/field.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/field.el,v
retrieving revision 1.3
diff -d -u -r1.3 field.el
--- xemacs-packages/xemacs-base/field.el 2006/05/25 02:49:47 1.3
+++ xemacs-packages/xemacs-base/field.el 2006/07/06 17:10:26
@@ -22,7 +22,7 @@
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
-;;; Synched up with: FSF 21.3 + 09072004 CVS editfns.c.
+;;; Synched up with: editfns.c CVS revision 1.416
;;; Commentary:
@@ -112,9 +112,8 @@
;; MERGE-AT-BOUNDARY is non-nil (see docstring) is actually the more
;; natural one; then we avoid treating the beginning of a field specially.
(unless merge-at-boundary
- (let ((field
- (map-extents #'(lambda (ext ign) (extent-property ext 'field))
- nil pos pos nil nil 'field)))
+ (let* ((ext (extent-at pos nil 'field))
+ (field (if ext (extent-property ext 'field))))
(unless (eq field after-field)
(setq at-field-end t))
(unless (eq field before-field)
@@ -183,7 +182,10 @@
(defun delete-field (&optional pos)
"Delete the field surrounding POS.
A field is a region of text with the same `field' property.
-If POS is nil, the value of point is used for POS."
+If POS is nil, the value of point is used for POS.
+
+An `args-out-of-range' error is signaled if POS is outside the
+buffer's accessible portion."
(let* ((field (find-field pos))
(start (car field))
(end (cdr field)))
@@ -194,7 +196,10 @@
(defun field-string (&optional pos)
"Return the contents of the field surrounding POS as a string.
A field is a region of text with the same `field' property.
-If POS is nil, the value of point is used for POS."
+If POS is nil, the value of point is used for POS.
+
+An `args-out-of-range' error is signaled if POS is outside the
+buffer's accessible portion."
(let ((field (find-field pos)))
(buffer-substring (car field) (cdr field))))
@@ -202,7 +207,10 @@
(defun field-string-no-properties (&optional pos)
"Return the contents of the field around POS, without text-properties.
A field is a region of text with the same `field' property.
-If POS is nil, the value of point is used for POS."
+If POS is nil, the value of point is used for POS.
+
+An `args-out-of-range' error is signaled if POS is outside the
+buffer's accessible portion."
(let ((field (find-field pos)))
(buffer-substring-no-properties (car field) (cdr field))))
@@ -214,7 +222,10 @@
If ESCAPE-FROM-EDGE is non-nil and POS is at the beginning of its
field, then the beginning of the *previous* field is returned.
If LIMIT is non-nil, it is a buffer position; if the beginning of the field
-is before LIMIT, then LIMIT will be returned instead."
+is before LIMIT, then LIMIT will be returned instead.
+
+An `args-out-of-range' error is signaled if POS is outside the
+buffer's accessible portion."
(car (find-field pos escape-from-edge limit nil nil t)))
;;;###autoload
@@ -225,7 +236,10 @@
If ESCAPE-FROM-EDGE is non-nil and POS is at the end of its field,
then the end of the *following* field is returned.
If LIMIT is non-nil, it is a buffer position; if the end of the field
-is after LIMIT, then LIMIT will be returned instead."
+is after LIMIT, then LIMIT will be returned instead.
+
+An `args-out-of-range' error is signaled if POS is outside the
+buffer's accessible portion."
(cdr (find-field pos escape-from-edge nil limit t nil)))
;;;###autoload
--
Jerry James, Assistant Professor james(a)xemacs.org
Computer Science Department
http://www.cs.usu.edu/~jerry/
Utah State University