emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IELM prompt


From: Juanma Barranquero
Subject: Re: IELM prompt
Date: Fri, 23 Apr 2004 13:22:25 +0200

On Thu, 22 Apr 2004 21:09:28 -0500 (CDT)
Luc Teirlinck <address@hidden> wrote:

> There are (at least) three problems with the ielm prompt:

I originally put the read-onliness on the IELM prompt, but your patch is
a real improvement over what I did.

Another thing I'd like to do in IELM is showing the buffer on the
modeline, like:

  "(IELM:.emacs.el)"

instead of

  "(IELM:run)"

I think some people may prefer the ":run" thing because it is an
inferior process after all, but I really don't think it provides any
kind of useful information and it's just wasting "modeline real state" ;)

In the following patch I implement that by installing an :eval on
mode-line-process (so it works with C-c C-b and also when doing a
set-buffer on the prompt).  Of course, ielm-print-working-buffer becomes
irrelevant and I've deleted it.

What do you think?

                                                                Juanma



--- ielm.el.luc 2004-04-23 11:05:01.000000000 +0200
+++ ielm.el     2004-04-23 13:08:05.000000000 +0200
@@ -162,6 +162,5 @@
   ;; Some convenience bindings for setting the working buffer
   (define-key ielm-map "\C-c\C-b" 'ielm-change-working-buffer)
-  (define-key ielm-map "\C-c\C-f" 'ielm-display-working-buffer)
-  (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer))
+  (define-key ielm-map "\C-c\C-f" 'ielm-display-working-buffer))
 
 (defvar ielm-font-lock-keywords
@@ -213,9 +212,4 @@
 ;;; Working buffer manipulation
 
-(defun ielm-print-working-buffer nil
-  "Print the current IELM working buffer's name in the echo area."
-  (interactive)
-  (message "The current working buffer is: %s" (buffer-name 
ielm-working-buffer)))
-
 (defun ielm-display-working-buffer nil
   "Display the current IELM working buffer.
@@ -223,6 +217,5 @@
 to its value of `window-point'!"
   (interactive)
-  (display-buffer ielm-working-buffer)
-  (ielm-print-working-buffer))
+  (display-buffer ielm-working-buffer))
 
 (defun ielm-change-working-buffer (buf)
@@ -232,6 +225,5 @@
 `set-buffer' at the IELM prompt."
   (interactive "bSet working buffer to: ")
-  (setq ielm-working-buffer (or (get-buffer buf) (error "No such buffer")))
-  (ielm-print-working-buffer))
+  (setq ielm-working-buffer (or (get-buffer buf) (error "No such buffer"))))
 
 ;;; Other bindings
@@ -435,6 +427,6 @@
 is preserved between successive evaluations.  In this way, expressions
 may be evaluated in a different buffer than the *ielm* buffer.
-Display the name of the working buffer with \\[ielm-print-working-buffer],
-or the buffer itself with \\[ielm-display-working-buffer].
+The name of the working buffer is always shown on the modeline;
+you can display the buffer itself with \\[ielm-display-working-buffer].
 
 During evaluations, the values of the variables `*', `**', and `***'
@@ -482,4 +474,5 @@
   (setq major-mode 'inferior-emacs-lisp-mode)
   (setq mode-name "IELM")
+  (setq mode-line-process '(":" (:eval (buffer-name ielm-working-buffer))))
   (use-local-map ielm-map)
   (set-syntax-table emacs-lisp-mode-syntax-table)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]