unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ielm working buffer on the modeline
@ 2002-02-27  9:02 Juanma Barranquero
  2002-02-28  4:07 ` Richard Stallman
  0 siblings, 1 reply; 14+ messages in thread
From: Juanma Barranquero @ 2002-02-27  9:02 UTC (permalink / raw)


Currently IELM shows "(IELM:run)" on the mode line. I'm proposing
using mode-line-process to show the current working buffer, so it'll
look like "(IELM on test.el)" instead.

Any comments?

                                                           /L/e/k/t/u




Index: ielm.el
===================================================================
RCS file: /cvs/emacs/lisp/ielm.el,v
retrieving revision 1.25
diff -u -r1.25 ielm.el
--- ielm.el	25 Feb 2002 16:07:01 -0000	1.25
+++ ielm.el	27 Feb 2002 09:02:13 -0000
@@ -449,6 +449,7 @@
   (make-local-variable 'indent-line-function)
   (make-local-variable 'ielm-working-buffer)
   (setq ielm-working-buffer (current-buffer))
+  (setq mode-line-process '(" on " (:eval (buffer-name ielm-working-buffer))))
   (setq indent-line-function 'ielm-indent-line)
   (make-local-variable 'fill-paragraph-function)
   (setq fill-paragraph-function 'lisp-fill-paragraph)


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-27  9:02 ielm working buffer on the modeline Juanma Barranquero
@ 2002-02-28  4:07 ` Richard Stallman
  2002-02-28  8:26   ` Juanma Barranquero
  0 siblings, 1 reply; 14+ messages in thread
From: Richard Stallman @ 2002-02-28  4:07 UTC (permalink / raw)
  Cc: emacs-devel

    Currently IELM shows "(IELM:run)" on the mode line. I'm proposing
    using mode-line-process to show the current working buffer, so it'll
    look like "(IELM on test.el)" instead.

    Any comments?

The new text would be somewhat longer and that might be inconvenient.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28  4:07 ` Richard Stallman
@ 2002-02-28  8:26   ` Juanma Barranquero
  2002-02-28 10:27     ` Andreas Schwab
  2002-03-01  1:00     ` Stefan Monnier
  0 siblings, 2 replies; 14+ messages in thread
From: Juanma Barranquero @ 2002-02-28  8:26 UTC (permalink / raw)



On Wed, 27 Feb 2002 21:07:55 -0700 (MST), Richard Stallman <rms@gnu.org> wrote:

> The new text would be somewhat longer and that might be inconvenient.

If pixels are so scarce, "(IELM on buffer-name)" could be
"(IELM:buffer-name)". I bet buffer names aren't usually so large as to
make any difference, and IELM buffers usually don't have minor modes
active, so there's (relatively) plenty of space.

Any more input from other IELM users?


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28  8:26   ` Juanma Barranquero
@ 2002-02-28 10:27     ` Andreas Schwab
  2002-02-28 11:37       ` Juanma Barranquero
  2002-03-01  1:00     ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Andreas Schwab @ 2002-02-28 10:27 UTC (permalink / raw)
  Cc: emacs-devel

Juanma Barranquero <lektu@terra.es> writes:

|> On Wed, 27 Feb 2002 21:07:55 -0700 (MST), Richard Stallman <rms@gnu.org> wrote:
|> 
|> > The new text would be somewhat longer and that might be inconvenient.
|> 
|> If pixels are so scarce, "(IELM on buffer-name)" could be
|> "(IELM:buffer-name)". I bet buffer names aren't usually so large as to

Buffer names can be quite large, the one I'm currently typing in is named
"*wide reply to Juanma Barranquero*".

|> make any difference, and IELM buffers usually don't have minor modes
|> active, so there's (relatively) plenty of space.

At least it should perhaps be omitted if the buffer is the same as the
IELM buffer.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 10:27     ` Andreas Schwab
@ 2002-02-28 11:37       ` Juanma Barranquero
  2002-02-28 12:38         ` Kim F. Storm
  0 siblings, 1 reply; 14+ messages in thread
From: Juanma Barranquero @ 2002-02-28 11:37 UTC (permalink / raw)



On Thu, 28 Feb 2002 11:27:48 +0100, Andreas Schwab <schwab@suse.de> wrote:

> Buffer names can be quite large, the one I'm currently typing in is named
> "*wide reply to Juanma Barranquero*".

Well, yes, of course. But I'd like to know how many times you've used
IELM against such kind of buffer...

Perhaps my experience is more limited, but I use IELM quite a lot, and
to me its usage pattern is mainly twofold: as a quick way to test some
elisp code (where it is more responsive/practical that a lot of M-: or
M-x eval-expression), and as an aid in developing elisp modules (and
then usually the .el buffer or a few temporary test buffers are the
target).

Anyway, I just proposed that because I find it useful. If I'm the only
one, I can always do

(add-hook 'ielm-mode-hook
	  '(lambda ()
	      (setq mode-line-process
                    '(":" (:eval (buffer-name ielm-working-buffer))))))

on my .emacs :)


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 11:37       ` Juanma Barranquero
@ 2002-02-28 12:38         ` Kim F. Storm
  2002-02-28 14:38           ` Juanma Barranquero
  2002-03-01  1:11           ` Richard Stallman
  0 siblings, 2 replies; 14+ messages in thread
From: Kim F. Storm @ 2002-02-28 12:38 UTC (permalink / raw)
  Cc: Andreas Schwab, emacs-devel

Juanma Barranquero <lektu@terra.es> writes:

> On Thu, 28 Feb 2002 11:27:48 +0100, Andreas Schwab <schwab@suse.de> wrote:
> 
> > Buffer names can be quite large, the one I'm currently typing in is named
> > "*wide reply to Juanma Barranquero*".
> 
> Well, yes, of course. But I'd like to know how many times you've used
> IELM against such kind of buffer...

I don't see why that kind of buffer is more strange that against
any other type of buffer.

What I don't understad (but maybe you can enlighten me) is why running
ielm _on_ test.el is necessary when _developing_ test.el ?  What are
the advantages of doing that?

I always thought the reason for running ielm on a specific buffer was
to easily examine or experiment with the buffer-local settings of that
buffer.

And I don't see what buffer-local settings of test.el are interesting
when developing test.el  (unless you are looking into a problem with
Emacs-Lisp mode).

From that perspective, I think running ielm _on_ a "*wide reply to ...*"
buffer is just a common as on test.el.

> 
> Anyway, I just proposed that because I find it useful. If I'm the only
> one, I can always do
> 
> (add-hook 'ielm-mode-hook
> 	  '(lambda ()
> 	      (setq mode-line-process
>                     '(":" (:eval (buffer-name ielm-working-buffer))))))
> 
> on my .emacs :)

I do think this is would be useful, it's just not the right place to put it.

What about changing the buffer name rather than the mode-line-process, ie.

        *IELM on test.el*

or

        *IELM on *wide reply to Juanma Barranquero**

At least, that would display the information in the part of the mode line
where (potentially long) names are already shown.


-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 12:38         ` Kim F. Storm
@ 2002-02-28 14:38           ` Juanma Barranquero
  2002-02-28 21:06             ` Kim F. Storm
  2002-03-01  1:15             ` Stefan Monnier
  2002-03-01  1:11           ` Richard Stallman
  1 sibling, 2 replies; 14+ messages in thread
From: Juanma Barranquero @ 2002-02-28 14:38 UTC (permalink / raw)
  Cc: Andreas Schwab, emacs-devel


> I don't see why that kind of buffer is more strange that against
> any other type of buffer.

Well, its not usual for me to test elisp against a mail buffer, but
you're right, the usage pattern is obvioulsy very subjective.

> What I don't understad (but maybe you can enlighten me) is why running
> ielm _on_ test.el is necessary when _developing_ test.el ?  What are
> the advantages of doing that?

That depends, I supose, on the way you usually work. I like to minimize
buffer switching and number of windows. Yesterday I was trying (once
again) to develop a jit-lock based lazy line-numbering module, and I
tested changes against the source file in order not to have to switch
back and forth between buffers. Line-numbering is usually non-destructive
wrt the target buffer :)

> And I don't see what buffer-local settings of test.el are interesting
> when developing test.el  (unless you are looking into a problem with
> Emacs-Lisp mode).

Perhaps I do that kind of thing often. Before that I developed a
derivative of elisp-mode intended to edit my own .emacs file :)

> What about changing the buffer name rather than the mode-line-process, ie.

<snip>

> At least, that would display the information in the part of the mode line
> where (potentially long) names are already shown.

Ok, I think that's a good idea, but it requires more code, because

ELISP> (setq mode-name '("IELM on " (:eval (buffer-name ielm-working-buffer))))
*** Eval error ***  error: "Only strings should be stored in the buffer-local variable mode-name"


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 14:38           ` Juanma Barranquero
@ 2002-02-28 21:06             ` Kim F. Storm
  2002-03-01  8:03               ` Juanma Barranquero
  2002-03-01  1:15             ` Stefan Monnier
  1 sibling, 1 reply; 14+ messages in thread
From: Kim F. Storm @ 2002-02-28 21:06 UTC (permalink / raw)
  Cc: emacs-devel

Juanma Barranquero <lektu@terra.es> writes:

> > What about changing the buffer name rather than the mode-line-process, ie.
> 
> <snip>
> 
> > At least, that would display the information in the part of the mode line
> > where (potentially long) names are already shown.
> 
> Ok, I think that's a good idea, but it requires more code, because
> 
> ELISP> (setq mode-name '("IELM on " (:eval (buffer-name ielm-working-buffer))))
> *** Eval error ***  error: "Only strings should be stored in the buffer-local variable mode-name"

I wasn't talking about mode-name.

I was suggesting to use something like

   (rename-buffer (concat "*IELM on " 
                    (buffer-name ielm-working-buffer) "*"))

whenever C-c C-b is called.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28  8:26   ` Juanma Barranquero
  2002-02-28 10:27     ` Andreas Schwab
@ 2002-03-01  1:00     ` Stefan Monnier
  1 sibling, 0 replies; 14+ messages in thread
From: Stefan Monnier @ 2002-03-01  1:00 UTC (permalink / raw)
  Cc: emacs-devel

> 
> On Wed, 27 Feb 2002 21:07:55 -0700 (MST), Richard Stallman <rms@gnu.org> wrote:
> 
> > The new text would be somewhat longer and that might be inconvenient.
> 
> If pixels are so scarce, "(IELM on buffer-name)" could be
> "(IELM:buffer-name)". I bet buffer names aren't usually so large as to
> make any difference, and IELM buffers usually don't have minor modes
> active, so there's (relatively) plenty of space.

Agreed.


	Stefan "a IELM user"

PS: I actually don't care about saving three chars so " on " is just
    as good as ":" AFAIC.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 12:38         ` Kim F. Storm
  2002-02-28 14:38           ` Juanma Barranquero
@ 2002-03-01  1:11           ` Richard Stallman
  2002-03-01 17:54             ` Kim F. Storm
  1 sibling, 1 reply; 14+ messages in thread
From: Richard Stallman @ 2002-03-01  1:11 UTC (permalink / raw)
  Cc: lektu, schwab, emacs-devel

    What about changing the buffer name rather than the mode-line-process, ie.

	    *IELM on test.el*

    or

	    *IELM on *wide reply to Juanma Barranquero**

In case there is more than one IELM buffer pointing at the same
long-named buffer, it would be important to uniquify the names in
a somewhat special way.  The difference between
*IELM on *wide reply to Juanma Barranquero**  and
*IELM on *wide reply to Juanma Barranquero**<2>
would not be visible in the mode line.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 14:38           ` Juanma Barranquero
  2002-02-28 21:06             ` Kim F. Storm
@ 2002-03-01  1:15             ` Stefan Monnier
  2002-03-01  8:06               ` Juanma Barranquero
  1 sibling, 1 reply; 14+ messages in thread
From: Stefan Monnier @ 2002-03-01  1:15 UTC (permalink / raw)
  Cc: Kim F. Storm, Andreas Schwab, emacs-devel

> ELISP> (setq mode-name '("IELM on " (:eval (buffer-name ielm-working-buffer))))
> *** Eval error ***  error: "Only strings should be stored in the buffer-local variable mode-name"

This restriction should be removed, I think.
I bumped into it recently when I wanted to use

	(setq mode-name '(sgml-xml "XML" "SGML"))
and
	(setq mode-name '(sgml-xml "XHTML" "HTML"))

in sgml-mode.el.  The patch is trivial.  Any objection ?


	Stefan

PS: by the way I don't understand your problem: the suggestion was to
    put the ielm-working-buffer name into the buffer-name, not into the
    mode-name.


Index: buffer.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/buffer.c,v
retrieving revision 1.378
diff -u -r1.378 buffer.c
--- buffer.c	26 Jan 2002 23:04:27 -0000	1.378
+++ buffer.c	1 Mar 2002 01:11:19 -0000
@@ -5226,7 +5231,7 @@
 		     doc: /* Symbol for current buffer's major mode.  */);
 
   DEFVAR_PER_BUFFER ("mode-name", &current_buffer->mode_name,
-                     make_number (Lisp_String),
+                     Qnil,
 		     doc: /* Pretty name of current buffer's major mode (a string).  */);
 
   DEFVAR_PER_BUFFER ("abbrev-mode", &current_buffer->abbrev_mode, Qnil,


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-02-28 21:06             ` Kim F. Storm
@ 2002-03-01  8:03               ` Juanma Barranquero
  0 siblings, 0 replies; 14+ messages in thread
From: Juanma Barranquero @ 2002-03-01  8:03 UTC (permalink / raw)
  Cc: emacs-devel


On 28 Feb 2002 22:06:34 +0100, storm@cua.dk (Kim F. Storm) wrote:

> I wasn't talking about mode-name.

Yes, I read too fast (or too little) ;)


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-03-01  1:15             ` Stefan Monnier
@ 2002-03-01  8:06               ` Juanma Barranquero
  0 siblings, 0 replies; 14+ messages in thread
From: Juanma Barranquero @ 2002-03-01  8:06 UTC (permalink / raw)
  Cc: Kim F. Storm, Andreas Schwab, emacs-devel


On Thu, 28 Feb 2002 20:15:36 -0500, "Stefan Monnier" <monnier+gnu/emacs@RUM.cs.yale.edu> wrote:

> This restriction should be removed, I think.

Me too, but there's been some changes recently to the mode-line lisp
code and I'm not entirely sure about the intention.

> Any objection ?

Personally I'd welcome ot, because I do want to make mode-name more
"responsive" (more easily modifiable, I mean).

> PS: by the way I don't understand your problem: the suggestion was to
>     put the ielm-working-buffer name into the buffer-name, not into the
>     mode-name.

Braino. Too little coffee in my blood.


                                                           /L/e/k/t/u


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

* Re: ielm working buffer on the modeline
  2002-03-01  1:11           ` Richard Stallman
@ 2002-03-01 17:54             ` Kim F. Storm
  0 siblings, 0 replies; 14+ messages in thread
From: Kim F. Storm @ 2002-03-01 17:54 UTC (permalink / raw)


Richard Stallman <rms@gnu.org> writes:

>     What about changing the buffer name rather than the mode-line-process, ie.
> 
> 	    *IELM on test.el*
> 
>     or
> 
> 	    *IELM on *wide reply to Juanma Barranquero**
> 
> In case there is more than one IELM buffer pointing at the same
> long-named buffer, it would be important to uniquify the names in
> a somewhat special way.  The difference between
> *IELM on *wide reply to Juanma Barranquero**  and
> *IELM on *wide reply to Juanma Barranquero**<2>
> would not be visible in the mode line.
> 

*IELM on *wide reply to Juanma Barranquero**  and
*IELM<2> on *wide reply to Juanma Barranquero**

would be better.  

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


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

end of thread, other threads:[~2002-03-01 17:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-27  9:02 ielm working buffer on the modeline Juanma Barranquero
2002-02-28  4:07 ` Richard Stallman
2002-02-28  8:26   ` Juanma Barranquero
2002-02-28 10:27     ` Andreas Schwab
2002-02-28 11:37       ` Juanma Barranquero
2002-02-28 12:38         ` Kim F. Storm
2002-02-28 14:38           ` Juanma Barranquero
2002-02-28 21:06             ` Kim F. Storm
2002-03-01  8:03               ` Juanma Barranquero
2002-03-01  1:15             ` Stefan Monnier
2002-03-01  8:06               ` Juanma Barranquero
2002-03-01  1:11           ` Richard Stallman
2002-03-01 17:54             ` Kim F. Storm
2002-03-01  1:00     ` Stefan Monnier

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