GNU bug report logs - #25339
[PATCH] Remove local variables only used as front ends to others.

Previous Next

Package: emacs;

Reported by: Chris Gregory <czipperz <at> gmail.com>

Date: Mon, 2 Jan 2017 22:39:01 UTC

Severity: wishlist

Tags: notabug, patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25339 in the body.
You can then email your comments to 25339 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#25339; Package emacs. (Mon, 02 Jan 2017 22:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris Gregory <czipperz <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 02 Jan 2017 22:39:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Chris Gregory <czipperz <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Remove local variables only used as front ends to others.
Date: Mon, 02 Jan 2017 14:37:53 -0800
-- 
Chris Gregory

diff --git a/src/term.c b/src/term.c
index c067a86d18..d70e2bc9d7 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4161,12 +4161,10 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
 #ifdef WINDOWSNT
   {
     struct frame *f = XFRAME (selected_frame);
-    int height, width;
-
-    initialize_w32_display (terminal, &width, &height);
+    int height;
 
+    initialize_w32_display (terminal, &FrameCols (tty), &height);
     FrameRows (tty) = height;
-    FrameCols (tty) = width;
     tty->specified_window = height;
 
     FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_none;
@@ -4176,14 +4174,11 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
   }
 #else  /* MSDOS */
   {
-    int height, width;
     if (strcmp (terminal_type, "internal") == 0)
       terminal->type = output_msdos_raw;
     initialize_msdos_display (terminal);
 
-    get_tty_size (fileno (tty->input), &width, &height);
-    FrameCols (tty) = width;
-    FrameRows (tty) = height;
+    get_tty_size (fileno (tty->input), &FrameCols (tty), &FrameRows (tty));
     tty->char_ins_del_ok = 0;
     init_baud_rate (fileno (tty->input));
   }
@@ -4229,12 +4224,7 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
   term_get_fkeys (address, terminal->kboard);
 
   /* Get frame size from system, or else from termcap.  */
-  {
-    int height, width;
-    get_tty_size (fileno (tty->input), &width, &height);
-    FrameCols (tty) = width;
-    FrameRows (tty) = height;
-  }
+  get_tty_size (fileno (tty->input), &FrameCols (tty), &FrameRows (tty));
 
   if (FrameCols (tty) <= 0)
     FrameCols (tty) = tgetnum ("co");




Added tag(s) notabug. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 07 Jan 2017 08:22:01 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 25339 <at> debbugs.gnu.org and Chris Gregory <czipperz <at> gmail.com> Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 07 Jan 2017 08:22:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#25339; Package emacs. (Sat, 07 Jan 2017 08:23:02 GMT) Full text and rfc822 format available.

Message #12 received at 25339 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Chris Gregory <czipperz <at> gmail.com>
Cc: 25339 <at> debbugs.gnu.org
Subject: Re: bug#25339: [PATCH] Remove local variables only used as front ends
 to others.
Date: Sat, 07 Jan 2017 10:22:02 +0200
tags 25339 notabug
close 25339
thanks

> From: Chris Gregory <czipperz <at> gmail.com>
> Date: Mon, 02 Jan 2017 14:37:53 -0800
> 
> diff --git a/src/term.c b/src/term.c
> index c067a86d18..d70e2bc9d7 100644
> --- a/src/term.c
> +++ b/src/term.c
> @@ -4161,12 +4161,10 @@ use the Bourne shell command 'TERM=...; export TERM' (C-shell:\n\
>  #ifdef WINDOWSNT
>    {
>      struct frame *f = XFRAME (selected_frame);
> -    int height, width;
> -
> -    initialize_w32_display (terminal, &width, &height);
> +    int height;
>  
> +    initialize_w32_display (terminal, &FrameCols (tty), &height);

Thanks, but I consider these changes not to be for the better.  E.g.,
FrameCols could be a macro (and it actually is in the non-WINDOWSNT
case).  Also, the original code looks more natural to me.

So I don't think we should install these changes.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 04 Feb 2017 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 134 days ago.

Previous Next


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