unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Aaron Jensen <aaronjensen@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: 30141@debbugs.gnu.org
Subject: bug#30141: (26.0.91; text-pixel dimensions not properly saved by desktop-save-mode sometimes)
Date: Wed, 14 Mar 2018 07:59:15 -0700	[thread overview]
Message-ID: <CAHyO48zPJJ2ZcnqGTxZFamPCd8utkCE++5W+tGHBoUkWoM9U9Q@mail.gmail.com> (raw)
In-Reply-To: <5AA8D9CB.4010509@gmx.at>

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

On Wed, Mar 14, 2018 at 1:14 AM, martin rudalics <rudalics@gmx.at> wrote:
> When creating a frame we could make the parameter inherit from the
> current value of `frame-resize-pixelwise' unless the parameter has
> been specified explicitly for the new frame.  But unless we can find a
> sufficiently strong reason for implementing such a parameter, it might
> be better to pursue your proposal first.  This would avoid that we
> have to introduce a function like `frame-resize-pixelwise' which tells
> for a specific frame whether it should be resized pixelwise or not.

Awesome, I've always felt like that was the most expected behavior.
Patch attached.

[-- Attachment #2: 0001-Save-frame-pixel-width-height-if-frame-resize-pixelw.patch --]
[-- Type: application/octet-stream, Size: 1988 bytes --]

From 436442959739f3b62acf37da5996b356821a64e6 Mon Sep 17 00:00:00 2001
From: Aaron Jensen <aaronjensen@gmail.com>
Date: Wed, 14 Mar 2018 07:51:25 -0700
Subject: [PATCH] Save frame pixel/width height if frame-resize-pixelwise is
 non-nil

* lisp/frameset.el (frameset--record-relationships): Replace check for
  text width/height and replace with check for frame-resize-pixelwise.
---
 lisp/frameset.el | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

diff --git a/lisp/frameset.el b/lisp/frameset.el
index 0e3363d7ae..8bccc8b1d2 100644
--- a/lisp/frameset.el
+++ b/lisp/frameset.el
@@ -800,22 +800,17 @@ frameset--record-relationships
              (cons nil
                    (and mb-frame
                         (frameset-frame-id mb-frame)))))))))
-  ;; Now store text-pixel width and height if it differs from the calculated
-  ;; width and height and the frame is not fullscreen.
+  ;; Now store text-pixel width and height if `frame-resize-pixelwise'
+  ;; is set.
   (dolist (frame frame-list)
-    (unless (frame-parameter frame 'fullscreen)
-      (unless (eq (* (frame-parameter frame 'width)
-                     (frame-char-width frame))
-                  (frame-text-width frame))
-        (set-frame-parameter
-         frame 'frameset--text-pixel-width
-         (frame-text-width frame)))
-      (unless (eq (* (frame-parameter frame 'height)
-                     (frame-char-height frame))
-                  (frame-text-height frame))
-        (set-frame-parameter
-         frame 'frameset--text-pixel-height
-         (frame-text-height frame))))))
+    (when (and frame-resize-pixelwise
+               (not (frame-parameter frame 'fullscreen)))
+      (set-frame-parameter
+       frame 'frameset--text-pixel-width
+       (frame-text-width frame))
+      (set-frame-parameter
+       frame 'frameset--text-pixel-height
+       (frame-text-height frame)))))
 
 ;;;###autoload
 (cl-defun frameset-save (frame-list
-- 
2.15.1


  reply	other threads:[~2018-03-14 14:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  1:24 bug#30141: 26.0.91; text-pixel dimensions not properly saved by desktop-save-mode sometimes Aaron Jensen
2018-01-17  5:43 ` bug#30141: (26.0.91; text-pixel dimensions not properly saved by desktop-save-mode sometimes) Aaron Jensen
2018-01-17  8:49   ` Robert Pluim
2018-01-17 11:45     ` Aaron Jensen
2018-01-17  9:12   ` martin rudalics
2018-01-17 11:50     ` Aaron Jensen
2018-01-17 11:59       ` Aaron Jensen
2018-01-19 18:55       ` martin rudalics
2018-01-19 19:00         ` Aaron Jensen
2018-01-20 10:35           ` martin rudalics
2018-01-20 10:50             ` Eli Zaretskii
2018-01-20 14:07               ` martin rudalics
2018-01-20 14:33                 ` Eli Zaretskii
2018-01-22  9:54                   ` martin rudalics
2018-02-13 10:23                     ` martin rudalics
2018-03-12 22:18           ` Aaron Jensen
2018-03-13  7:26             ` martin rudalics
2018-03-13 15:32               ` Aaron Jensen
2018-03-14  8:14                 ` martin rudalics
2018-03-14 14:59                   ` Aaron Jensen [this message]
2018-03-14 15:15                     ` Aaron Jensen
2018-03-14 20:05                       ` martin rudalics
2018-03-14 20:12                         ` Aaron Jensen
2018-03-15  8:20                           ` martin rudalics
2018-03-15 15:24                             ` Aaron Jensen
2018-03-17 10:05                               ` martin rudalics
2018-03-17 10:11                                 ` Noam Postavsky
2018-03-17 11:08                                   ` martin rudalics
2018-03-17 11:16                                     ` Eli Zaretskii
2018-03-17 11:28                                       ` martin rudalics
2018-03-17 16:32                                 ` Aaron Jensen
2018-01-17  9:12 ` bug#30141: 26.0.91; text-pixel dimensions not properly saved by desktop-save-mode sometimes martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHyO48zPJJ2ZcnqGTxZFamPCd8utkCE++5W+tGHBoUkWoM9U9Q@mail.gmail.com \
    --to=aaronjensen@gmail.com \
    --cc=30141@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).