From: Thien-Thi Nguyen <ttn@surf.glug.org>
Subject: emacs -nw segfaults toggling menu bar mode
Date: Thu, 07 Apr 2005 01:28:37 +0200 [thread overview]
Message-ID: <E1DJJwr-0002gd-00@surf.glug.org> (raw)
with a 2005-04-06 cvs update, and configured w/ no options,
i built and then started emacs like so:
emacs -nw -q --no-site-file
then i did:
M-x menu-bar-mode
this turned off the menu bar as expected. then i did:
M-x menu-bar-mode
this segfaulted. poking around w/ gdb, i eventually came up w/ the
following patch, which prevents the segfault. could someone review it
(i'm not very familiar w/ this area of emacs) and let me know how to
improve it?
thi
________________________________________________________________
diff -c -r1.343 dispnew.c
*** dispnew.c 17 Mar 2005 23:39:12 -0000 1.343
--- dispnew.c 6 Apr 2005 23:14:17 -0000
***************
*** 3165,3178 ****
int m2_from;
w2 = frame_row_to_window (root, frame_from);
! m2 = w2->current_matrix;
! m2_from = frame_from - m2->matrix_y;
! copy_row_except_pointers (m->rows + window_to,
! m2->rows + m2_from);
!
! /* If frame line is empty, window line is empty, too. */
! if (!retained_p[copy_from[i]])
! m->rows[window_to].enabled_p = 0;
sync_p = 1;
}
else if (from_inside_window_p)
--- 3165,3184 ----
int m2_from;
w2 = frame_row_to_window (root, frame_from);
! /* Apparently, when turning on the menu bar using "emacs
! -nw", `from_frame' does not yield an associated window.
! This check avoids a segfault. */
! if (w2)
! {
! m2 = w2->current_matrix;
! m2_from = frame_from - m2->matrix_y;
! copy_row_except_pointers (m->rows + window_to,
! m2->rows + m2_from);
!
! /* If frame line is empty, window line is empty, too. */
! if (!retained_p[copy_from[i]])
! m->rows[window_to].enabled_p = 0;
! }
sync_p = 1;
}
else if (from_inside_window_p)
next reply other threads:[~2005-04-06 23:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-06 23:28 Thien-Thi Nguyen [this message]
2005-04-08 6:31 ` emacs -nw segfaults toggling menu bar mode Marcelo Toledo
2005-04-10 1:55 ` Richard Stallman
2005-04-10 10:20 ` Thien-Thi Nguyen
2005-04-10 22:14 ` Lute Kamstra
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=E1DJJwr-0002gd-00@surf.glug.org \
--to=ttn@surf.glug.org \
--cc=ttn@glug.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.