GNU bug report logs - #16028
24.3.50; Latest build completely breaks my thumnail frames code

Previous Next

Package: emacs;

Reported by: Drew Adams <drew.adams <at> oracle.com>

Date: Mon, 2 Dec 2013 15:53:02 UTC

Severity: normal

Found in version 24.3.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Drew Adams <drew.adams <at> oracle.com>
To: martin rudalics <rudalics <at> gmx.at>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 16028 <at> debbugs.gnu.org
Subject: bug#16028: 24.3.50; Latest build completely breaks my thumnail frames code
Date: Tue, 10 Dec 2013 06:50:19 -0800 (PST)
> (defun enlarged-font-name (fontname frame increment)
>    "FONTNAME, after enlarging font size of FRAME by INCREMENT.
> FONTNAME is the font of FRAME."
>    (when (query-fontset fontname)
>      (let ((ascii  (assq 'ascii (aref (fontset-info fontname frame) 2))))
>        (when ascii (setq fontname  (nth 2 ascii)))))
>    (let ((xlfd-fields  (x-decompose-font-name fontname)))
>      (unless xlfd-fields (error "Cannot decompose font name"))
>      (let ((new-size  (+ (string-to-number
>                           (aref xlfd-fields xlfd-regexp-pixelsize-subnum))
>                          increment)))
>        (unless (> new-size 0) (signal 'font-too-small (list new-size)))
>        (aset xlfd-fields xlfd-regexp-pixelsize-subnum
>              (number-to-string new-size)))
>      ;; Set point size & width to "*", so frame width adjusts to new font
>      (aset xlfd-fields xlfd-regexp-pointsize-subnum "*")
>      (aset xlfd-fields xlfd-regexp-avgwidth-subnum "*")
>      (x-compose-font-name xlfd-fields)))
> 
> (defun enlarge-font-by (increment)
>    (let* ((old-font (cdr (assq 'font (frame-parameters (selected-frame)))))
> 	 (new-font (enlarged-font-name old-font (selected-frame)
> increment)))
>      (modify-frame-parameters
>       (selected-frame) (list (cons 'font new-font)
> 			    (cons 'scroll-bar-width 6)))))
> 
> (enlarge-font-by -4)


And this seems to compensate for the bug, at least with the above recipe:

(defun enlarge-font-by (increment)
   (let* ((old-font (cdr (assq 'font (frame-parameters (selected-frame)))))
	 (new-font (enlarged-font-name old-font (selected-frame) increment)))
     (modify-frame-parameters
      (selected-frame) (list (cons 'scroll-bar-width 6)))
     (modify-frame-parameters
      (selected-frame) (list (cons 'font new-font)))))

Switch the order of the two calls to `modify-frame-parameters' and the
bug is manifested again.




This bug report was last modified 11 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.