diff options
| author | Luc Teirlinck | 2004-04-24 22:58:40 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2004-04-24 22:58:40 +0000 |
| commit | 759f960aeafb2650b94cf9e1cbcfb6f03b8b4f36 (patch) | |
| tree | 8c0b1fa32fcdfa2caaf41e0d795ecd550cbe9622 | |
| parent | 14116f3caf946bf5a2ac7fe92c9fe81d9f626cf5 (diff) | |
| download | emacs-759f960aeafb2650b94cf9e1cbcfb6f03b8b4f36.tar.gz emacs-759f960aeafb2650b94cf9e1cbcfb6f03b8b4f36.zip | |
(ielm-prompt-read-only): New user option.
(ielm-prompt): Expand docstring to describe new behavior.
(inferior-emacs-lisp-mode): Implement ielm-prompt-read-only and
mention it in the docstring.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/ielm.el | 32 |
2 files changed, 35 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58f27e766f1..c72e0a642e4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2004-04-24 Luc Teirlinck <teirllm@auburn.edu> | ||
| 2 | |||
| 3 | * ielm.el (ielm-prompt-read-only): New user option. | ||
| 4 | (ielm-prompt): Expand docstring to describe new behavior. | ||
| 5 | (inferior-emacs-lisp-mode): Implement ielm-prompt-read-only and | ||
| 6 | mention it in the docstring. | ||
| 7 | |||
| 1 | 2004-04-24 Andreas Schwab <schwab@suse.de> | 8 | 2004-04-24 Andreas Schwab <schwab@suse.de> |
| 2 | 9 | ||
| 3 | * progmodes/sh-script.el (sh-leading-keywords) <sh>: Add "!". | 10 | * progmodes/sh-script.el (sh-leading-keywords) <sh>: Add "!". |
diff --git a/lisp/ielm.el b/lisp/ielm.el index d5bf56a1722..725f7933149 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el | |||
| @@ -49,12 +49,27 @@ | |||
| 49 | :type 'boolean | 49 | :type 'boolean |
| 50 | :group 'ielm) | 50 | :group 'ielm) |
| 51 | 51 | ||
| 52 | (defcustom ielm-prompt-read-only t | ||
| 53 | "If non-nil, the IELM prompt is read only. | ||
| 54 | Setting this variable does not affect existing IELM runs. | ||
| 55 | |||
| 56 | You can give the IELM prompt more highly customized read-only | ||
| 57 | type properties, by setting this option to nil, and then setting | ||
| 58 | `ielm-prompt', outside of Custom, to a string with the desired | ||
| 59 | text properties." | ||
| 60 | :type 'boolean | ||
| 61 | :group 'ielm | ||
| 62 | :version "21.4") | ||
| 63 | |||
| 52 | (defcustom ielm-prompt "ELISP> " | 64 | (defcustom ielm-prompt "ELISP> " |
| 53 | "Prompt used in IELM." | 65 | "Prompt used in IELM. |
| 66 | Setting the default value does not affect existing IELM runs. | ||
| 67 | The command `inferior-emacs-lisp-mode' converts this into a | ||
| 68 | buffer-local variable in IELM buffers. Do not try to set the | ||
| 69 | buffer-local value yourself in any way, unless you really know | ||
| 70 | what you are doing." | ||
| 54 | :type 'string | 71 | :type 'string |
| 55 | :group 'ielm | 72 | :group 'ielm) |
| 56 | :get #'(lambda (symbol) (substring-no-properties (symbol-value symbol))) | ||
| 57 | :set #'(lambda (symbol value) (set symbol (propertize value 'read-only t 'rear-nonsticky t)))) | ||
| 58 | 73 | ||
| 59 | (defcustom ielm-dynamic-return t | 74 | (defcustom ielm-dynamic-return t |
| 60 | "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM. | 75 | "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM. |
| @@ -429,6 +444,8 @@ Expressions evaluated by IELM are not subject to `debug-on-quit' or | |||
| 429 | The behaviour of IELM may be customized with the following variables: | 444 | The behaviour of IELM may be customized with the following variables: |
| 430 | * To stop beeping on error, set `ielm-noisy' to nil. | 445 | * To stop beeping on error, set `ielm-noisy' to nil. |
| 431 | * If you don't like the prompt, you can change it by setting `ielm-prompt'. | 446 | * If you don't like the prompt, you can change it by setting `ielm-prompt'. |
| 447 | * If you do not like that the prompt is (by default) read-only, set | ||
| 448 | `ielm-prompt-read-only' to nil. | ||
| 432 | * Set `ielm-dynamic-return' to nil for bindings like `lisp-interaction-mode'. | 449 | * Set `ielm-dynamic-return' to nil for bindings like `lisp-interaction-mode'. |
| 433 | * Entry to this mode runs `comint-mode-hook' and `ielm-mode-hook' | 450 | * Entry to this mode runs `comint-mode-hook' and `ielm-mode-hook' |
| 434 | (in that order). | 451 | (in that order). |
| @@ -443,6 +460,13 @@ Customized bindings may be defined in `ielm-map', which currently contains: | |||
| 443 | (setq comint-input-sender 'ielm-input-sender) | 460 | (setq comint-input-sender 'ielm-input-sender) |
| 444 | (setq comint-process-echoes nil) | 461 | (setq comint-process-echoes nil) |
| 445 | (make-local-variable 'comint-dynamic-complete-functions) | 462 | (make-local-variable 'comint-dynamic-complete-functions) |
| 463 | (set (make-local-variable 'ielm-prompt) | ||
| 464 | (if ielm-prompt-read-only | ||
| 465 | (propertize ielm-prompt | ||
| 466 | 'read-only t | ||
| 467 | 'rear-nonsticky t | ||
| 468 | 'front-sticky '(read-only)) | ||
| 469 | ielm-prompt)) | ||
| 446 | (setq comint-dynamic-complete-functions | 470 | (setq comint-dynamic-complete-functions |
| 447 | '(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol)) | 471 | '(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol)) |
| 448 | (setq comint-get-old-input 'ielm-get-old-input) | 472 | (setq comint-get-old-input 'ielm-get-old-input) |