unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* comint-prompt-regexp
@ 2005-04-07  1:55 Luc Teirlinck
  2005-04-07  3:24 ` comint-prompt-regexp Miles Bader
  0 siblings, 1 reply; 7+ messages in thread
From: Luc Teirlinck @ 2005-04-07  1:55 UTC (permalink / raw)


I propose the following doc change to comint.el.  The reasons are
the same as for the similar change I proposed to the
shell-prompt-pattern docstring.   I know of at least two modes, shell
and ielm, that use `comint-prompt-regexp' even if
`comint-use-prompt-regexp-instead-of-fields' is nil.

===File ~/comint-diff=======================================
*** comint.el	04 Apr 2005 19:34:31 -0500	1.310
--- comint.el	06 Apr 2005 20:34:18 -0500	
***************
*** 158,165 ****
    "Regexp to recognise prompts in the inferior process.
  Defaults to \"^\", the null string at BOL.
  
! This variable is only used if the variable
! `comint-use-prompt-regexp-instead-of-fields' is non-nil.
  
  Good choices:
    Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp)
--- 158,166 ----
    "Regexp to recognise prompts in the inferior process.
  Defaults to \"^\", the null string at BOL.
  
! If `comint-use-prompt-regexp-instead-of-fields' is nil, Comint
! completely ignores this variable.  However, some derived modes
! may still use it, for instance, to delimit paragraphs.
  
  Good choices:
    Canonical Lisp: \"^[^> \\n]*>+:? *\" (Lucid, franz, kcl, T, cscheme, oaklisp)
============================================================

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

* Re: comint-prompt-regexp
  2005-04-07  1:55 comint-prompt-regexp Luc Teirlinck
@ 2005-04-07  3:24 ` Miles Bader
  2005-04-08  1:05   ` comint-prompt-regexp Luc Teirlinck
                     ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Miles Bader @ 2005-04-07  3:24 UTC (permalink / raw)
  Cc: emacs-devel

On Apr 7, 2005 10:55 AM, Luc Teirlinck <teirllm@dms.auburn.edu> wrote:
> I propose the following doc change to comint.el.  The reasons are
> the same as for the similar change I proposed to the
> shell-prompt-pattern docstring.   I know of at least two modes, shell
> and ielm, that use `comint-prompt-regexp' even if
> `comint-use-prompt-regexp-instead-of-fields' is nil.

It might be good to mention shell-mode explicitly -- I think in most
cases where a derived mode does something like that, it also sets the
prompt regexp to something suitable for that mode.

In general, is this variable even a useful thing for users to
customize?  Shouldn't they be customizing the corresponding variable
for a derived mode instead, as comint-mode is never used "raw"?

Maybe it should simply be a defvar instead of a defcustom.

-Miles
-- 
Do not taunt Happy Fun Ball.

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

* Re: comint-prompt-regexp
  2005-04-07  3:24 ` comint-prompt-regexp Miles Bader
@ 2005-04-08  1:05   ` Luc Teirlinck
  2005-04-08  1:36     ` comint-prompt-regexp Miles Bader
  2005-04-08  1:27   ` comint-prompt-regexp Luc Teirlinck
  2005-04-08  1:34   ` comint-prompt-regexp Luc Teirlinck
  2 siblings, 1 reply; 7+ messages in thread
From: Luc Teirlinck @ 2005-04-08  1:05 UTC (permalink / raw)
  Cc: emacs-devel

Miles Bader wrote:

   In general, is this variable even a useful thing for users to
   customize?  Shouldn't they be customizing the corresponding variable
   for a derived mode instead, as comint-mode is never used "raw"?

   Maybe it should simply be a defvar instead of a defcustom.

It _is_ a defvar.  The doc string just says:

This is a good thing to set in mode hooks.

Sincerely,

Luc.

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

* Re: comint-prompt-regexp
  2005-04-07  3:24 ` comint-prompt-regexp Miles Bader
  2005-04-08  1:05   ` comint-prompt-regexp Luc Teirlinck
@ 2005-04-08  1:27   ` Luc Teirlinck
  2005-04-08  1:34   ` comint-prompt-regexp Luc Teirlinck
  2 siblings, 0 replies; 7+ messages in thread
From: Luc Teirlinck @ 2005-04-08  1:27 UTC (permalink / raw)
  Cc: emacs-devel

Things seem to be a little bit more complex still.  From the
documentation in the Emacs manual, it would appear that the intent is
that a paragraph in a Shell buffer should always consist of a complete
"prompt-input-output" group.  But, even when
`comint-use-prompt-regexp-instead-of-fields' is non-nil, blank lines
count as paragraph separators, even though not as paragraph starters.
The docstring of paragraph-start says that this is something that
should never happen:

  paragraph-start's value is "\f\\|[	]*$"

  *Regexp for beginning of a line that starts OR separates paragraphs.
  This regexp should match lines that separate paragraphs
  and should also match lines that start a paragraph
  (and are part of that paragraph).

To correct this, we could either set paragraph-separate to
comint-prompt-regexp too, or we could set paragraph-start to:
(concat paragraph-separate "\\|" comint-prompt-regexp)

The latter would yield the exact described behavior.

The problem for Ielm is exactly the same as for Shell Mode.
Paragraphs commands in Inferior Lisp mode currently do not do anything
useful, but for consistency (and convenience) they should behave the
same as in Shell mode and Ielm.  Maybe the paragraph commands should
behave consistently in _all_ Comint buffers, and hence have a default
implementation in comint.el.

Sincerely,

Luc.

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

* Re: comint-prompt-regexp
  2005-04-07  3:24 ` comint-prompt-regexp Miles Bader
  2005-04-08  1:05   ` comint-prompt-regexp Luc Teirlinck
  2005-04-08  1:27   ` comint-prompt-regexp Luc Teirlinck
@ 2005-04-08  1:34   ` Luc Teirlinck
  2 siblings, 0 replies; 7+ messages in thread
From: Luc Teirlinck @ 2005-04-08  1:34 UTC (permalink / raw)
  Cc: emacs-devel

>From my previous message:

  To correct this, we could either set paragraph-separate to
  comint-prompt-regexp too, or we could set paragraph-start to:
  (concat paragraph-separate "\\|" comint-prompt-regexp)

  The latter would yield the exact described behavior.

The opposite.  The _former_ would yield the exact described behavior.

Sincerely,

Luc.

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

* Re: comint-prompt-regexp
  2005-04-08  1:05   ` comint-prompt-regexp Luc Teirlinck
@ 2005-04-08  1:36     ` Miles Bader
  2005-04-08  1:46       ` comint-prompt-regexp Luc Teirlinck
  0 siblings, 1 reply; 7+ messages in thread
From: Miles Bader @ 2005-04-08  1:36 UTC (permalink / raw)
  Cc: emacs-devel, miles

On Apr 8, 2005 10:05 AM, Luc Teirlinck <teirllm@dms.auburn.edu> wrote:
>    Maybe it should simply be a defvar instead of a defcustom.
> 
> It _is_ a defvar.  The doc string just says:
> 
> This is a good thing to set in mode hooks.

I see; my mistake.

If `foo-mode' is derived from comint, and sets the
comint-prompt-regexp to `foo-prompt-regexp' (defaulting to "foo>"),
and also uses `foo-prompt-regexp' to modify the paragraph regexp, then
presumably the real dependence is on `foo-prompt-regexp', right?

If so, any use of comint-prompt-regex in that process is a merely an
internal implementation detail of `foo-mode', not really something
that should be documented in comint (as doing so doesn't really help
anybody).

-Miles
-- 
Do not taunt Happy Fun Ball.

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

* Re: comint-prompt-regexp
  2005-04-08  1:36     ` comint-prompt-regexp Miles Bader
@ 2005-04-08  1:46       ` Luc Teirlinck
  0 siblings, 0 replies; 7+ messages in thread
From: Luc Teirlinck @ 2005-04-08  1:46 UTC (permalink / raw)
  Cc: miles, emacs-devel

Miles Bader wrote:

   If so, any use of comint-prompt-regex in that process is a merely an
   internal implementation detail of `foo-mode', not really something
   that should be documented in comint (as doing so doesn't really help
   anybody).

OK, I drop my proposed change to `comint-prompt-regexp'.

Sincerely,

Luc.

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

end of thread, other threads:[~2005-04-08  1:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-07  1:55 comint-prompt-regexp Luc Teirlinck
2005-04-07  3:24 ` comint-prompt-regexp Miles Bader
2005-04-08  1:05   ` comint-prompt-regexp Luc Teirlinck
2005-04-08  1:36     ` comint-prompt-regexp Miles Bader
2005-04-08  1:46       ` comint-prompt-regexp Luc Teirlinck
2005-04-08  1:27   ` comint-prompt-regexp Luc Teirlinck
2005-04-08  1:34   ` comint-prompt-regexp Luc Teirlinck

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).