unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Electric-pop-up-window [PATCH]
@ 2005-01-02  9:58 Chong Yidong
  2005-01-02 10:04 ` Chong Yidong
  0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2005-01-02  9:58 UTC (permalink / raw)


AFAICT, the fix suggested by SAITO Takuya in FOR-RELEASE is correct. It is
quite a simple patch.

** line-spacing and Electric-pop-up-window

From: SAITO Takuya <tabmore@rivo.mediatti.net>
Date: Mon, 31 May 2004 02:08:10 +0900 (JST)

Electric-pop-up-window does not work well
if truncate long lines disabled and/or
`line-spacing' is set to positive integer.

For example, start emacs -Q --line-spacing 1, and type M-` .
Then, the last line of *Completions* buffer is not visible.

fit-window-to-buffer works well for me, so I guess
Electric-pop-up-window can use it.

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

* Re: Electric-pop-up-window [PATCH]
  2005-01-02  9:58 Electric-pop-up-window [PATCH] Chong Yidong
@ 2005-01-02 10:04 ` Chong Yidong
  2005-01-03  0:59   ` Richard Stallman
  0 siblings, 1 reply; 3+ messages in thread
From: Chong Yidong @ 2005-01-02 10:04 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 622 bytes --]

Oops, patch is attached.

> AFAICT, the fix suggested by SAITO Takuya in FOR-RELEASE is correct. It is
> quite a simple patch.
>
> ** line-spacing and Electric-pop-up-window
>
> From: SAITO Takuya <tabmore@rivo.mediatti.net>
> Date: Mon, 31 May 2004 02:08:10 +0900 (JST)
>
> Electric-pop-up-window does not work well
> if truncate long lines disabled and/or
> `line-spacing' is set to positive integer.
>
> For example, start emacs -Q --line-spacing 1, and type M-` .
> Then, the last line of *Completions* buffer is not visible.
>
> fit-window-to-buffer works well for me, so I guess
> Electric-pop-up-window can use it.

[-- Attachment #2: electric.patch --]
[-- Type: application/octet-stream, Size: 1408 bytes --]

--- electric.el~	2005-01-02 01:38:22.000000000 -0800
+++ electric.el	2005-01-02 01:43:23.000000000 -0800
@@ -142,35 +142,21 @@
 (defun Electric-pop-up-window (buffer &optional max-height)
   (let* ((win (or (get-buffer-window buffer) (selected-window)))
 	 (buf (get-buffer buffer))
 	 (one-window (one-window-p t))
 	 (pop-up-windows t)
-	 (pop-up-frames nil)
-	 (target-height)
-	 (lines))
+	 (pop-up-frames nil))
     (if (not buf)
 	(error "Buffer %s does not exist" buffer)
-      (with-current-buffer buf
-	(setq lines (count-lines (point-min) (point-max)))
-	(setq target-height
-	      (min (max (if max-height (min max-height (1+ lines)) (1+ lines))
-			window-min-height)
-		   (save-window-excursion
-		     (delete-other-windows)
-		     (1- (window-height (selected-window)))))))
       (cond ((and (eq (window-buffer win) buf))
 	     (select-window win))
 	    (one-window
 	     (pop-to-buffer buffer)
-	     (setq win (selected-window))
-	     (enlarge-window (- target-height (window-height win))))
+	     (setq win (selected-window)))
 	    (t
 	     (switch-to-buffer buf)))
-      (if (and (not max-height)
-	       (> target-height (window-height (selected-window))))
-	  (progn (goto-char (window-start win))
-		 (enlarge-window (- target-height (window-height win)))))
+      (fit-window-to-buffer win max-height)
       (goto-char (point-min))
       win)))
 
 (provide 'electric)
 

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

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

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

* Re: Electric-pop-up-window [PATCH]
  2005-01-02 10:04 ` Chong Yidong
@ 2005-01-03  0:59   ` Richard Stallman
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Stallman @ 2005-01-03  0:59 UTC (permalink / raw)
  Cc: emacs-devel

Thanks.

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

end of thread, other threads:[~2005-01-03  0:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-02  9:58 Electric-pop-up-window [PATCH] Chong Yidong
2005-01-02 10:04 ` Chong Yidong
2005-01-03  0:59   ` Richard Stallman

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