unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* comint doesn't like read-only prompts
@ 2002-06-13  8:35 Juanma Barranquero
  2002-06-13  8:51 ` Miles Bader
  2002-06-13 21:47 ` Richard Stallman
  0 siblings, 2 replies; 9+ messages in thread
From: Juanma Barranquero @ 2002-06-13  8:35 UTC (permalink / raw)


This patch to HEAD is needed to make ielm work again. The problem is
that the new handling of text-properties/attributes in comint.el is
choking while dealing with ielm's read-only prompt.

I've not installed the patch, so people more knowledgeable than me about
comint can take a look at it or suggest a better approach.


                                                           /L/e/k/t/u



Index: comint.el
===================================================================
RCS file: /cvs/emacs/lisp/comint.el,v
retrieving revision 1.273
diff -u -2 -r1.273 comint.el
--- comint.el	12 Jun 2002 09:16:51 -0000	1.273
+++ comint.el	13 Jun 2002 08:32:17 -0000
@@ -1538,7 +1538,8 @@
 (defun comint-snapshot-last-prompt ()
   (when comint-last-prompt-overlay
-    (add-text-properties (overlay-start comint-last-prompt-overlay)
-			 (overlay-end comint-last-prompt-overlay)
-			 (overlay-properties comint-last-prompt-overlay))))
+    (let ((inhibit-read-only t))
+      (add-text-properties (overlay-start comint-last-prompt-overlay)
+                           (overlay-end comint-last-prompt-overlay)
+                           (overlay-properties comint-last-prompt-overlay)))))
 
 (defun comint-carriage-motion (string)
@@ -1664,8 +1665,9 @@
 
 	    (unless comint-use-prompt-regexp-instead-of-fields
-	      (add-text-properties comint-last-output-start (point)
-				   '(rear-nonsticky t
-				     field output
-				     inhibit-line-move-field-capture t)))
+              (let ((inhibit-read-only t))
+                (add-text-properties comint-last-output-start (point)
+                                     '(rear-nonsticky t
+                                       field output
+                                       inhibit-line-move-field-capture t))))
 
 	    ;; Highlight the prompt, where we define `prompt' to mean

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-13  8:35 comint doesn't like read-only prompts Juanma Barranquero
@ 2002-06-13  8:51 ` Miles Bader
  2002-06-13  9:04   ` Juanma Barranquero
  2002-06-13 21:47 ` Richard Stallman
  1 sibling, 1 reply; 9+ messages in thread
From: Miles Bader @ 2002-06-13  8:51 UTC (permalink / raw)
  Cc: emacs-devel

Juanma Barranquero <lektu@terra.es> writes:
> This patch to HEAD is needed to make ielm work again. The problem is
> that the new handling of text-properties/attributes in comint.el is
> choking while dealing with ielm's read-only prompt.

I guess that patch would work, but somehow ielm's calling comint's
output filter on read-only text seems vaguely dodgy to me.

Perhaps it would be better to make comint itself support read-only
prompts, controlled with a variable; then ielm could just set that
variable to t.  That would be a useful feature that people could turn
on for other comint modes as well if they want.

[An alternative might be to have comint support having only the
_current_ prompt be read-only, since it's usually only that one which is
in danger of being inadvertently modified.]

-Miles
-- 
Come now, if we were really planning to harm you, would we be waiting here, 
 beside the path, in the very darkest part of the forest?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-13  8:51 ` Miles Bader
@ 2002-06-13  9:04   ` Juanma Barranquero
  2002-06-13  9:12     ` Miles Bader
  0 siblings, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2002-06-13  9:04 UTC (permalink / raw)
  Cc: emacs-devel

On 13 Jun 2002 17:51:21 +0900, Miles Bader <miles@lsi.nec.co.jp> wrote:

> I guess that patch would work, but somehow ielm's calling comint's
> output filter on read-only text seems vaguely dodgy to me.

Yeah, I don't like it either, but having IELM prompt (and many others, I
suppose) read-only is very useful. I was always doing horrible things to
it by accident... :)

> Perhaps it would be better to make comint itself support read-only
> prompts, controlled with a variable; then ielm could just set that
> variable to t.  That would be a useful feature that people could turn
> on for other comint modes as well if they want.

I like it. But I'm no expert in comint so I have no idea how to
implement that.


                                                           /L/e/k/t/u

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-13  9:04   ` Juanma Barranquero
@ 2002-06-13  9:12     ` Miles Bader
  2002-06-13 10:04       ` Juanma Barranquero
  0 siblings, 1 reply; 9+ messages in thread
From: Miles Bader @ 2002-06-13  9:12 UTC (permalink / raw)
  Cc: emacs-devel

Juanma Barranquero <lektu@terra.es> writes:
> > Perhaps it would be better to make comint itself support read-only
> > prompts, controlled with a variable; then ielm could just set that
> > variable to t.
> 
> I like it. But I'm no expert in comint so I have no idea how to
> implement that.

I'll do it.

-Miles
-- 
`Life is a boundless sea of bitterness'

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-13  9:12     ` Miles Bader
@ 2002-06-13 10:04       ` Juanma Barranquero
  0 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2002-06-13 10:04 UTC (permalink / raw)
  Cc: emacs-devel

On 13 Jun 2002 18:12:37 +0900, Miles Bader <miles@lsi.nec.co.jp> wrote:

> I'll do it.

Thanks.


                                                           /L/e/k/t/u

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-13  8:35 comint doesn't like read-only prompts Juanma Barranquero
  2002-06-13  8:51 ` Miles Bader
@ 2002-06-13 21:47 ` Richard Stallman
  2002-06-14  8:43   ` Juanma Barranquero
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Stallman @ 2002-06-13 21:47 UTC (permalink / raw)
  Cc: emacs-devel

It is possible that some other change is the right patch--I don't know.
But it is clear that this patch is reasonable.  Would you please
install it?

If the problem really ought to be fixed in some other way, your patch
won't make that any more difficult.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-13 21:47 ` Richard Stallman
@ 2002-06-14  8:43   ` Juanma Barranquero
  2002-06-14  9:13     ` Miles Bader
  0 siblings, 1 reply; 9+ messages in thread
From: Juanma Barranquero @ 2002-06-14  8:43 UTC (permalink / raw)
  Cc: emacs-devel

On Thu, 13 Jun 2002 15:47:08 -0600 (MDT), Richard Stallman <rms@gnu.org> wrote:

> It is possible that some other change is the right patch--I don't know.
> But it is clear that this patch is reasonable.

Miles has already proposed a better fix.

                                                           /L/e/k/t/u

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-14  8:43   ` Juanma Barranquero
@ 2002-06-14  9:13     ` Miles Bader
  2002-06-14  9:32       ` Juanma Barranquero
  0 siblings, 1 reply; 9+ messages in thread
From: Miles Bader @ 2002-06-14  9:13 UTC (permalink / raw)
  Cc: rms, emacs-devel

Juanma Barranquero <lektu@terra.es> writes:
> > It is possible that some other change is the right patch--I don't know.
> > But it is clear that this patch is reasonable.
> 
> Miles has already proposed a better fix.

I think you might as well go ahead and check it in, since it won't hurt
anything.  We can remove it later if it becomes unnecessary.

-Miles
-- 
[|nurgle|]  ddt- demonic? so quake will have an evil kinda setting? one that 
            will  make every christian in the world foamm at the mouth? 
[iddt]      nurg, that's the goal 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: comint doesn't like read-only prompts
  2002-06-14  9:13     ` Miles Bader
@ 2002-06-14  9:32       ` Juanma Barranquero
  0 siblings, 0 replies; 9+ messages in thread
From: Juanma Barranquero @ 2002-06-14  9:32 UTC (permalink / raw)
  Cc: rms, emacs-devel

On 14 Jun 2002 18:13:41 +0900, Miles Bader <miles@lsi.nec.co.jp> wrote:

> I think you might as well go ahead and check it in, since it won't hurt
> anything.  We can remove it later if it becomes unnecessary.

Ok.


                                                           /L/e/k/t/u

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-06-14  9:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-13  8:35 comint doesn't like read-only prompts Juanma Barranquero
2002-06-13  8:51 ` Miles Bader
2002-06-13  9:04   ` Juanma Barranquero
2002-06-13  9:12     ` Miles Bader
2002-06-13 10:04       ` Juanma Barranquero
2002-06-13 21:47 ` Richard Stallman
2002-06-14  8:43   ` Juanma Barranquero
2002-06-14  9:13     ` Miles Bader
2002-06-14  9:32       ` Juanma Barranquero

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).