[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/idlwave cf2850f09b 183/360: Height-frac, for in-frame s
From: |
ELPA Syncer |
Subject: |
[elpa] externals/idlwave cf2850f09b 183/360: Height-frac, for in-frame shell windows |
Date: |
Sun, 28 Apr 2024 00:59:22 -0400 (EDT) |
branch: externals/idlwave
commit cf2850f09b00ec8e79ad5c78dccc6292d03684dc
Author: JD Smith <jdtsmith@gmail.com>
Commit: JD Smith <jdtsmith@gmail.com>
Height-frac, for in-frame shell windows
---
idlw-shell.el | 82 ++++++++++++++++++++++++++++++++++++++---------------------
1 file changed, 53 insertions(+), 29 deletions(-)
diff --git a/idlw-shell.el b/idlw-shell.el
index 1938ab3d4a..166412a58a 100644
--- a/idlw-shell.el
+++ b/idlw-shell.el
@@ -159,6 +159,15 @@ The default makes the frame splittable, so that completion
works correctly."
:type '(repeat
(cons symbol sexp)))
+(defcustom idlwave-shell-buffer-height-frac nil
+ "The fraction of the current frame height to allocate to a
+non-dedicated shell buffer window. Only relevant if
+`idlwave-shell-use-dedicated-frame' is nil"
+ :group 'idlwave-shell-general-setup
+ :type '(choice
+ (const :tag "Default" nil)
+ (float :tag "Fraction")))
+
(defcustom idlwave-shell-raise-frame t
"*Non-nil means, `idlwave-shell' raises the frame showing the shell window."
:group 'idlwave-shell-general-setup
@@ -1236,7 +1245,8 @@ See also the variable `idlwave-shell-prompt-pattern'.
(set-buffer buf)
(idlwave-shell-mode)))
(let ((window (idlwave-display-buffer (idlwave-shell-buffer) nil
- (idlwave-shell-shell-frame)))
+ (idlwave-shell-shell-frame)
+ idlwave-shell-buffer-height-frac))
(current-window (selected-window)))
(select-window window)
(goto-char (point-max))
@@ -1575,7 +1585,8 @@ and then calls `idlwave-shell-send-command' for any
pending commands."
(re-search-backward idlwave-shell-prompt-pattern nil t)
(goto-char (match-end 0))
(setq idlwave-shell-command-output
- (buffer-substring-no-properties (point-min) (point)))
+ (buffer-substring-no-properties
+ (point-min) (point)))
(delete-region (point-min) (point)))
(setq idlwave-shell-command-output
(with-current-buffer (process-buffer proc)
@@ -2390,7 +2401,8 @@ matter what the settings of that variable."
;; first make sure the shell window is visible
(idlwave-display-buffer (idlwave-shell-buffer)
- nil (idlwave-shell-shell-frame))
+ nil (idlwave-shell-shell-frame)
+ idlwave-shell-buffer-height-frac)
;; now display the buffer and remember which window it is.
(setq window (idlwave-display-buffer buffer
@@ -3230,7 +3242,8 @@ size(___,/DIMENSIONS)"
;; First make sure the shell window is visible
(idlwave-display-buffer (idlwave-shell-buffer)
- nil (idlwave-shell-shell-frame))
+ nil (idlwave-shell-shell-frame)
+ idlwave-shell-buffer-height-frac)
(if (and idlwave-shell-output-overlay process-mark)
(move-overlay idlwave-shell-output-overlay
output-begin output-end buffer))))
@@ -3309,9 +3322,10 @@ If there is a prefix argument, display IDL process."
nil
(if (idlwave-shell-hide-p 'run) 'mostly)
nil t)
- (if n
- (idlwave-display-buffer (idlwave-shell-buffer)
- nil (idlwave-shell-shell-frame))))
+ (if n
+ (idlwave-display-buffer (idlwave-shell-buffer)
+ nil (idlwave-shell-shell-frame)
+ idlwave-shell-buffer-height-frac))))
(defun idlwave-shell-evaluate-region (beg end &optional n)
"Send region to the IDL process.
@@ -3322,7 +3336,8 @@ Does not work for a region with multiline blocks - use
(idlwave-shell-send-command (buffer-substring beg end))
(if n
(idlwave-display-buffer (idlwave-shell-buffer)
- nil (idlwave-shell-shell-frame))))
+ nil (idlwave-shell-shell-frame)
+ idlwave-shell-buffer-height-frac)))
(defun idlwave-shell-delete-temp-files ()
"Delete the temporary files and kill associated buffers."
@@ -3339,27 +3354,36 @@ Does not work for a region with multiline blocks - use
(delete-file idlwave-shell-temp-rinfo-save-file)
(error nil))))
-(defun idlwave-display-buffer (buf not-this-window-p &optional frame)
- (if (featurep 'xemacs)
- ;; The XEmacs version enforces the frame
- (display-buffer buf not-this-window-p frame)
- ;; For Emacs, we need to force the frame ourselves.
- (let ((this-frame (selected-frame)))
- (save-excursion ;; make sure we end up in the same buffer
- (if (frame-live-p frame)
- (select-frame frame))
- (if (eq this-frame (selected-frame))
- ;; same frame: use display buffer, to make sure the current
- ;; window stays.
- (display-buffer buf)
- ;; different frame
- (if (one-window-p)
- ;; only window: switch
- (progn
- (switch-to-buffer buf)
- (selected-window)) ; must return the window.
- ;; several windows - use display-buffer
- (display-buffer buf not-this-window-p)))))))
+(defun idlwave-display-buffer (buf not-this-window-p &optional frame
+ buffer-height-frac)
+ "Display a buffer in a requested (optional) FRAME.
+Resize to no more than BUFFER-HEIGHT-FRAC of the frame buffer if set."
+ (let ((win
+ (if (featurep 'xemacs)
+ ;; The XEmacs version enforces the frame
+ (display-buffer buf not-this-window-p frame)
+ ;; For Emacs, we need to force the frame ourselves.
+ (let ((this-frame (selected-frame)))
+ (save-excursion ;; make sure we end up in the same buffer
+ (if (frame-live-p frame)
+ (select-frame frame))
+ (if (eq this-frame (selected-frame))
+ ;; same frame: use display buffer, to make sure the current
+ ;; window stays.
+ (display-buffer buf)
+ ;; different frame
+ (if (one-window-p)
+ ;; only window: switch
+ (progn
+ (switch-to-buffer buf)
+ (selected-window)) ; must return the window.
+ ;; several windows - use display-buffer
+ (display-buffer buf not-this-window-p))))))))
+ (if buffer-height-frac
+ (set-window-text-height win (round (* (frame-height)
+ buffer-height-frac))))
+ win))
+
; (if (not (frame-live-p frame)) (setq frame nil))
; (display-buffer buf not-this-window-p frame))
- [elpa] externals/idlwave cca88fe997 155/360: - Default indents switched to my preference., (continued)
- [elpa] externals/idlwave cca88fe997 155/360: - Default indents switched to my preference., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave cfc746716d 165/360: - C-M-? is help with topic, also menu., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave 2a800c0730 158/360: - Remove obsoleted HTML help stuff., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave 0ef92e9687 164/360: - Return t from assistant-start., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave 32b1b75de5 169/360: - Update copyright., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave 20dcf5b496 228/360: Look for pro/fun only for indent in MAIN-level routine., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave efd25a4cb3 179/360: make after-save-hook local, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave e250cb0787 199/360: New Eclipse-based help system support (alongside old Assistant system)., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave e74a13eafe 191/360: Add normal bindings for comint commands, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave b95cfc6fb1 215/360: v6.2, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave cf2850f09b 183/360: Height-frac, for in-frame shell windows,
ELPA Syncer <=
- [elpa] externals/idlwave 9d5bc223aa 172/360: Copyright/date, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave cba1950d51 216/360: Add structure tag completion by default (configurable)., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave e27fc1ee3d 251/360: Doc cleanup., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave f334f5294e 247/360: Re-organize/simplify key man binding code., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave 7340631fc7 159/360: - IDLWAVE 6.0, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave ecfa158b87 211/360: Added gitignore, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave 3c7ea0dcf9 200/360: Email cleanup, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave def98bda5e 208/360: start-of-substatement: Skip blank/comment lines as well., ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave f0a5d18574 186/360: Better current module name, ELPA Syncer, 2024/04/28
- [elpa] externals/idlwave a187552ac8 282/360: Comments/documentation, ELPA Syncer, 2024/04/28