[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r106605: * nsfns.m (get_geometry_from
From: |
Jan D. |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r106605: * nsfns.m (get_geometry_from_preferences): New function. |
Date: |
Sun, 04 Dec 2011 14:25:16 +0100 |
User-agent: |
Bazaar (2.3.1) |
------------------------------------------------------------
revno: 106605
fixes bug(s): http://debbugs.gnu.org/10103
committer: Jan D. <address@hidden>
branch nick: trunk
timestamp: Sun 2011-12-04 14:25:16 +0100
message:
* nsfns.m (get_geometry_from_preferences): New function.
(Fx_create_frame): Call get_geometry_from_preferences.
modified:
src/ChangeLog
src/nsfns.m
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2011-12-04 09:26:30 +0000
+++ b/src/ChangeLog 2011-12-04 13:25:16 +0000
@@ -1,3 +1,8 @@
+2011-12-04 Jan Djärv <address@hidden>
+
+ * nsfns.m (get_geometry_from_preferences): New function.
+ (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
+
2011-12-04 Andreas Schwab <address@hidden>
* emacs.c (Qkill_emacs): Define.
=== modified file 'src/nsfns.m'
--- a/src/nsfns.m 2011-11-16 17:47:25 +0000
+++ b/src/nsfns.m 2011-12-04 13:25:16 +0000
@@ -1076,7 +1076,41 @@
return Qnil;
}
-
+/*
+ * Read geometry related parameters from preferences if not in PARMS.
+ * Returns the union of parms and any preferences read.
+ */
+
+static Lisp_Object
+get_geometry_from_preferences (struct ns_display_info *dpyinfo,
+ Lisp_Object parms)
+{
+ struct {
+ const char *val;
+ const char *cls;
+ Lisp_Object tem;
+ } r[] = {
+ { "width", "Width", Qwidth },
+ { "height", "Height", Qheight },
+ { "left", "Left", Qleft },
+ { "top", "Top", Qtop },
+ };
+
+ int i;
+ for (i = 0; i < sizeof (r)/sizeof (r[0]); ++i)
+ {
+ if (NILP (Fassq (r[i].tem, parms)))
+ {
+ Lisp_Object value
+ = x_get_arg (dpyinfo, parms, r[i].tem, r[i].val, r[i].cls,
+ RES_TYPE_NUMBER);
+ if (! EQ (value, Qunbound))
+ parms = Fcons (Fcons (r[i].tem, value), parms);
+ }
+ }
+
+ return parms;
+}
/* ==========================================================================
@@ -1285,6 +1319,7 @@
x_default_parameter (f, parms, Qtitle, Qnil, "title", "Title",
RES_TYPE_STRING);
+ parms = get_geometry_from_preferences (dpyinfo, parms);
window_prompting = x_figure_window_size (f, parms, 1);
tem = x_get_arg (dpyinfo, parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r106605: * nsfns.m (get_geometry_from_preferences): New function.,
Jan D. <=