all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: martin rudalics <rudalics@gmx.at>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: Two flaws in window.c
Date: Thu, 18 Oct 2012 13:41:47 +0400	[thread overview]
Message-ID: <507FCEDB.20605@yandex.ru> (raw)
In-Reply-To: <507FC89C.30008@gmx.at>

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

On 10/18/2012 01:15 PM, martin rudalics wrote:

> These should be fixed now.

Thanks.

> Do you have any more suggestions?

The minor style suggestion is to move window-specific checks to
window.h and use WINDOW_xxx_P macros in CHECK_xxx_WINDOW (attached).

Dmitry

[-- Attachment #2: window-macros.patch --]
[-- Type: text/plain, Size: 1723 bytes --]

=== modified file 'src/lisp.h'
--- src/lisp.h	2012-10-16 02:22:25 +0000
+++ src/lisp.h	2012-10-18 09:32:55 +0000
@@ -1742,20 +1742,6 @@
 #define CHECK_WINDOW_CONFIGURATION(x) \
   CHECK_TYPE (WINDOW_CONFIGURATIONP (x), Qwindow_configuration_p, x)
 
-/* A window of any sort, leaf or interior, is "valid" if one of its
-   buffer, vchild, or hchild members is non-nil.  */
-#define CHECK_VALID_WINDOW(x)				\
-  CHECK_TYPE (WINDOWP (x)				\
-	      && (!NILP (XWINDOW (x)->buffer)		\
-		  || !NILP (XWINDOW (x)->vchild)	\
-		  || !NILP (XWINDOW (x)->hchild)),	\
-	      Qwindow_valid_p, x)
-
-/* A window is "live" if and only if it shows a buffer.  */
-#define CHECK_LIVE_WINDOW(x)						\
-  CHECK_TYPE (WINDOWP (x) && !NILP (XWINDOW (x)->buffer),		\
-	      Qwindow_live_p, x)
-
 #define CHECK_PROCESS(x) \
   CHECK_TYPE (PROCESSP (x), Qprocessp, x)
 

=== modified file 'src/window.h'
--- src/window.h	2012-09-20 03:10:52 +0000
+++ src/window.h	2012-10-18 09:33:38 +0000
@@ -970,11 +970,19 @@
        || !NILP (XWINDOW (WINDOW)->vchild)		\
        || !NILP (XWINDOW (WINDOW)->hchild)))
 
+/* A window of any sort, leaf or interior, is "valid" if one
+   of its buffer, vchild, or hchild members is non-nil.  */
+#define CHECK_VALID_WINDOW(WINDOW)				\
+  CHECK_TYPE (WINDOW_VALID_P (WINDOW), Qwindow_valid_p, WINDOW)
 
 /* Value is non-zero if WINDOW is a live window.  */
 #define WINDOW_LIVE_P(WINDOW)					\
   (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer))
 
+/* A window is "live" if and only if it shows a buffer.  */
+#define CHECK_LIVE_WINDOW(WINDOW)				\
+  CHECK_TYPE (WINDOW_LIVE_P (WINDOW), Qwindow_live_p, WINDOW)
+
 /* These used to be in lisp.h.  */
 
 extern Lisp_Object Qwindowp, Qwindow_live_p;


  reply	other threads:[~2012-10-18  9:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-18  3:26 Two flaws in window.c Dmitry Antipov
2012-10-18  9:15 ` martin rudalics
2012-10-18  9:41   ` Dmitry Antipov [this message]
2012-10-19 10:01     ` 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

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

  git send-email \
    --in-reply-to=507FCEDB.20605@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=emacs-devel@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 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.