From: Paul Eggert <eggert@cs.ucla.edu>
To: german@xelalug.org
Cc: emacs-devel@gnu.org
Subject: Re: Emacs with Cocoa/GNUstep
Date: Tue, 26 Apr 2011 23:13:52 -0700 [thread overview]
Message-ID: <4DB7B420.2080602@cs.ucla.edu> (raw)
In-Reply-To: <1303879114.12552.14.camel@german-desktop>
On 04/26/11 21:38, Germán Arias wrote:
> nsmenu.m:229: error: ‘struct Lisp_Vector’ has no member named ‘size’
That problem was due to my change to lisp.h in revno 104021.
Sorry about that. I committed the following fix in revno 104024.
This patch can be applied independently of the earlier
lisp.h change, and it isolates nsmenu.m from that implementation
detail of lisp.h so it should be a win independently of the
lisp.h change.
2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
* nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
This makes this file independent of the recent pseudovector change.
--- src/nsmenu.m 2011-03-27 09:23:52 +0000
+++ src/nsmenu.m 2011-04-27 06:01:43 +0000
@@ -218,7 +218,7 @@
/* Save the frame's previous menu bar contents data */
if (previous_menu_items_used)
- memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
+ memcpy (previous_items, &AREF (f->menu_bar_vector, 0),
previous_menu_items_used * sizeof (Lisp_Object));
/* parse stage 1: extract from lisp */
@@ -226,19 +226,19 @@
menu_items = f->menu_bar_vector;
menu_items_allocated = VECTORP (menu_items) ? ASIZE (menu_items) : 0;
- submenu_start = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
- submenu_end = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
- submenu_n_panes = (int *) alloca (XVECTOR (items)->size * sizeof (int));
+ submenu_start = (int *) alloca (ASIZE (items) * sizeof (int *));
+ submenu_end = (int *) alloca (ASIZE (items) * sizeof (int *));
+ submenu_n_panes = (int *) alloca (ASIZE (items) * sizeof (int));
submenu_top_level_items
- = (int *) alloca (XVECTOR (items)->size * sizeof (int *));
+ = (int *) alloca (ASIZE (items) * sizeof (int *));
init_menu_items ();
- for (i = 0; i < XVECTOR (items)->size; i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object key, string, maps;
- key = XVECTOR (items)->contents[i];
- string = XVECTOR (items)->contents[i + 1];
- maps = XVECTOR (items)->contents[i + 2];
+ key = AREF (items, i);
+ string = AREF (items, i + 1);
+ maps = AREF (items, i + 2);
if (NILP (string))
break;
@@ -311,11 +311,11 @@
/* FIXME: this ALWAYS fails on Buffers menu items.. something
about their strings causes them to change every time, so we
double-check failures */
- if (!EQ (previous_items[i], XVECTOR (menu_items)->contents[i]))
+ if (!EQ (previous_items[i], AREF (menu_items, i)))
if (!(STRINGP (previous_items[i])
- && STRINGP (XVECTOR (menu_items)->contents[i])
+ && STRINGP (AREF (menu_items, i))
&& !strcmp (SDATA (previous_items[i]),
- SDATA (XVECTOR (menu_items)->contents[i]))))
+ SDATA (AREF (menu_items, i)))))
break;
if (i == previous_menu_items_used)
{
@@ -346,10 +346,10 @@
/* Parse stage 2a: now GC cannot happen during the lifetime of the
widget_value, so it's safe to store data from a Lisp_String */
wv = first_wv->contents;
- for (i = 0; i < XVECTOR (items)->size; i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
Lisp_Object string;
- string = XVECTOR (items)->contents[i + 1];
+ string = AREF (items, i + 1);
if (NILP (string))
break;
/* if (submenu && strcmp (submenuTitle, SDATA (string)))
@@ -407,7 +407,7 @@
/* check if no change.. this mechanism is a bit rough, but ready */
- n = XVECTOR (items)->size / 4;
+ n = ASIZE (items) / 4;
if (f == last_f && n_previous_strings == n)
{
for (i = 0; i<n; i++)
@@ -434,9 +434,9 @@
}
[menu clear];
- for (i = 0; i < XVECTOR (items)->size; i += 4)
+ for (i = 0; i < ASIZE (items); i += 4)
{
- string = XVECTOR (items)->contents[i + 1];
+ string = AREF (items, i + 1);
if (NILP (string))
break;
@@ -794,7 +794,7 @@
i = 0;
while (i < menu_items_used)
{
- if (EQ (XVECTOR (menu_items)->contents[i], Qnil))
+ if (EQ (AREF (menu_items, i), Qnil))
{
submenu_stack[submenu_depth++] = save_wv;
save_wv = prev_wv;
@@ -802,21 +802,21 @@
first_pane = 1;
i++;
}
- else if (EQ (XVECTOR (menu_items)->contents[i], Qlambda))
+ else if (EQ (AREF (menu_items, i), Qlambda))
{
prev_wv = save_wv;
save_wv = submenu_stack[--submenu_depth];
first_pane = 0;
i++;
}
- else if (EQ (XVECTOR (menu_items)->contents[i], Qt)
+ else if (EQ (AREF (menu_items, i), Qt)
&& submenu_depth != 0)
i += MENU_ITEMS_PANE_LENGTH;
/* Ignore a nil in the item list.
It's meaningful only for dialog boxes. */
- else if (EQ (XVECTOR (menu_items)->contents[i], Qquote))
+ else if (EQ (AREF (menu_items, i), Qquote))
i += 1;
- else if (EQ (XVECTOR (menu_items)->contents[i], Qt))
+ else if (EQ (AREF (menu_items, i), Qt))
{
/* Create a new pane. */
Lisp_Object pane_name, prefix;
@@ -906,7 +906,7 @@
make the call_data null so that it won't display a box
when the mouse is on it. */
wv->call_data
- = !NILP (def) ? (void *) &XVECTOR (menu_items)->contents[i] : 0;
+ = !NILP (def) ? (void *) &AREF (menu_items, i) : 0;
wv->enabled = !NILP (enable);
if (NILP (type))
next prev parent reply other threads:[~2011-04-27 6:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-27 0:39 Emacs with Cocoa/GNUstep Germán Arias
2011-04-27 1:19 ` David Reitter
2011-04-27 3:56 ` CHENG Gao
2011-04-27 4:38 ` Germán Arias
2011-04-27 4:56 ` CHENG Gao
2011-04-27 6:13 ` Paul Eggert [this message]
2011-04-27 23:54 ` Germán Arias
2011-04-27 4:15 ` Pascal J. Bourguignon
2011-04-27 19:13 ` David De La Harpe Golden
2011-04-28 0:24 ` Germán Arias
2011-04-28 15:30 ` Stefan Monnier
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=4DB7B420.2080602@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=german@xelalug.org \
/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.