all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#8379: The width of linum window is not adjusted after face-remapping
@ 2011-03-30  1:43 nixie
  2011-03-30  2:18 ` bug#8379: The width of linum window is not adjusted afterface-remapping Drew Adams
  2011-03-30 10:39 ` bug#8379: The width of linum window is not adjusted after face-remapping Juanma Barranquero
  0 siblings, 2 replies; 10+ messages in thread
From: nixie @ 2011-03-30  1:43 UTC (permalink / raw)
  To: 8379

Hi,

I am green hand in emacs, and starting using GNU Emacs since 23.1.

I found that the width of linum window is not changed with
(text-scale-increase) or (text-scale-decrease) function. 
This is annoying especially when I increase the text size, because the
line number can not be fully viewed.

currently, I use some alleviating code like below to solve this problem.
But I think it does not have generality.

Does someone have any good suggestion on it? Or it can be solved in a
more elegant and general way. I wish that it would be solved in future
version of GNU Emacs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun rescale-window-margin-by-faceremapping (win)
  (let ((width (car (window-margins)))
	(scale (cadr (assoc ':height 
			    (assoc 'default 
				   face-remapping-alist)))))
    (if (numberp scale)
	(progn
	  (set-window-margins win (ceiling (* width scale)) (cdr
(window-margins win)))
	  (force-window-update))
      nil)))

(defadvice linum-update-window (after scaling-margin-width last (win)
activate)
  (rescale-window-margin-by-faceremapping win)
  ad-return-value)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Thanks for any help.


-- 
nixie <onixie@gmail.com>






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

end of thread, other threads:[~2011-03-31 14:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-30  1:43 bug#8379: The width of linum window is not adjusted after face-remapping nixie
2011-03-30  2:18 ` bug#8379: The width of linum window is not adjusted afterface-remapping Drew Adams
2011-03-30 10:39 ` bug#8379: The width of linum window is not adjusted after face-remapping Juanma Barranquero
2011-03-30 13:19   ` bug#8379: The width of linum window is not adjusted afterface-remapping Drew Adams
2011-03-30 13:53     ` Juanma Barranquero
2011-03-31  9:31       ` nixie
2011-03-31 13:22         ` Drew Adams
2011-03-31 14:40         ` Juanma Barranquero
2011-03-31 14:48           ` Drew Adams
2011-03-31 14:54             ` Juanma Barranquero

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.