aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2005-12-29 04:46:59 +0000
committerKaroly Lorentey2005-12-29 04:46:59 +0000
commit01999e9d53e4e8d12314b16ce7d0e3d7785bfbe3 (patch)
tree53c6b956f0daa867484d1fb1d259dc4b37266bb7 /src
parente583523a108624f7fd0c28294010b19daae5ab97 (diff)
parentd0b9c14d9fa4f77c952300c50ab35eddf3f45980 (diff)
downloademacs-01999e9d53e4e8d12314b16ce7d0e3d7785bfbe3.tar.gz
emacs-01999e9d53e4e8d12314b16ce7d0e3d7785bfbe3.zip
Merged from miles@gnu.org--gnu-2005 (patch 681)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-681 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-469
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog66
-rw-r--r--src/Makefile.in2
-rw-r--r--src/charset.c15
-rw-r--r--src/commands.h5
-rw-r--r--src/eval.c8
-rw-r--r--src/fns.c3
-rw-r--r--src/gtkutil.c43
-rw-r--r--src/keyboard.c7
-rw-r--r--src/keyboard.h1
-rw-r--r--src/lread.c10
-rw-r--r--src/minibuf.c20
-rw-r--r--src/undo.c16
-rw-r--r--src/xfns.c10
13 files changed, 180 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f14f216f1d3..4f6cb895004 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,69 @@
12005-12-28 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (xg_get_file_with_chooser): Changed message shown
4 in file chooser.
5
62005-12-27 Richard M. Stallman <rms@gnu.org>
7
8 * lread.c (readevalloop): Set PT and ZV in the proper buffer,
9 not the current one.
10
11 * minibuf.c (Fminibuffer_message): Doc fix.
12 (read_minibuf): Set current_buffer->enable_multibyte_characters sooner.
13
14 * eval.c (do_autoload): Ignore elements of Vautoload_queue
15 where car is not symbol.
16
172005-12-27 Kenichi Handa <handa@m17n.org>
18
19 * charset.c (lisp_string_width): Check multibyteness of STRING.
20
212005-12-27 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
22
23 * xfns.c: x_show_hidden_files, new variable.
24 (syms_of_xfns): Defvar it.
25
26 * gtkutil.c (xg_toggle_visibility_cb): New function.
27 (xg_get_file_with_chooser): Add toggle hidden files and a message
28 to the new file chooser dialog. Show hidden files if
29 x_show_hidden_files is non-zero.
30
312005-12-26 Richard M. Stallman <rms@gnu.org>
32
33 * keyboard.h: Undo previous change.
34
35 * Makefile.in (undo.o): Undo previous change.
36
37 * undo.c: Undo previous change.
38
392005-12-26 Luc Teirlinck <teirllm@auburn.edu>
40
41 * keyboard.h: extern last_point_position_window.
42
43 * undo.c: include keyboard.h.
44
45 * Makefile.in (undo.o): Depend on keyboard.h.
46
472005-12-26 Richard M. Stallman <rms@gnu.org>
48
49 * commands.h (last_point_position_window): Declare.
50
51 * undo.c: Depend on window.h.
52 (record_point): Save old point from the correct window.
53
54 * keyboard.c (last_point_position_window): New variable.
55 (command_loop_1): Set last_point_position_window.
56 (syms_of_keyboard): Init it.
57
58 * Makefile.in (undo.o): Depend on window.h.
59
602005-12-25 Richard M. Stallman <rms@gnu.org>
61
62 * eval.c (un_autoload): Expect (0 . OFEATURES) in Vautoload_queue
63 to undo a `provide'.
64
65 * fns.c (Fprovide): Store (0 . OFEATURES) in Vautoload_queue.
66
12005-12-25 Giorgos Keramidas <keramida@ceid.upatras.gr> 672005-12-25 Giorgos Keramidas <keramida@ceid.upatras.gr>
2 68
3 * m/amdx86-64.h [__FreeBSD__] (START_FILES, LIB_STANDARD): 69 * m/amdx86-64.h [__FreeBSD__] (START_FILES, LIB_STANDARD):
diff --git a/src/Makefile.in b/src/Makefile.in
index 1054b76ac14..4b40e5acecb 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1175,7 +1175,7 @@ terminal.o: terminal.c frame.h termchar.h termhooks.h charset.h coding.h \
1175 keyboard.h $(config_h) 1175 keyboard.h $(config_h)
1176terminfo.o: terminfo.c $(config_h) 1176terminfo.o: terminfo.c $(config_h)
1177tparam.o: tparam.c $(config_h) 1177tparam.o: tparam.c $(config_h)
1178undo.o: undo.c buffer.h commands.h $(config_h) 1178undo.o: undo.c buffer.h commands.h window.h $(config_h)
1179/* This hack is to discard any space that cpp might put at the beginning 1179/* This hack is to discard any space that cpp might put at the beginning
1180 of UNEXEC when substituting it in. */ 1180 of UNEXEC when substituting it in. */
1181UNEXEC_ALIAS=UNEXEC 1181UNEXEC_ALIAS=UNEXEC
diff --git a/src/charset.c b/src/charset.c
index 2c985b14dbc..fb9804c0306 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1344,6 +1344,10 @@ lisp_string_width (string, precision, nchars, nbytes)
1344{ 1344{
1345 int len = SCHARS (string); 1345 int len = SCHARS (string);
1346 int len_byte = SBYTES (string); 1346 int len_byte = SBYTES (string);
1347 /* This set multibyte to 0 even if STRING is multibyte when it
1348 contains only ascii and eight-bit-graphic, but that's
1349 intentional. */
1350 int multibyte = len < len_byte;
1347 const unsigned char *str = SDATA (string); 1351 const unsigned char *str = SDATA (string);
1348 int i = 0, i_byte = 0; 1352 int i = 0, i_byte = 0;
1349 int width = 0; 1353 int width = 0;
@@ -1366,8 +1370,12 @@ lisp_string_width (string, precision, nchars, nbytes)
1366 } 1370 }
1367 else if (dp) 1371 else if (dp)
1368 { 1372 {
1369 int c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes); 1373 int c;
1370 1374
1375 if (multibyte)
1376 c = STRING_CHAR_AND_LENGTH (str + i_byte, len - i_byte, bytes);
1377 else
1378 c = str[i_byte], bytes = 1;
1371 chars = 1; 1379 chars = 1;
1372 val = DISP_CHAR_VECTOR (dp, c); 1380 val = DISP_CHAR_VECTOR (dp, c);
1373 if (VECTORP (val)) 1381 if (VECTORP (val))
@@ -1378,7 +1386,10 @@ lisp_string_width (string, precision, nchars, nbytes)
1378 else 1386 else
1379 { 1387 {
1380 chars = 1; 1388 chars = 1;
1381 PARSE_MULTIBYTE_SEQ (str + i_byte, len_byte - i_byte, bytes); 1389 if (multibyte)
1390 PARSE_MULTIBYTE_SEQ (str + i_byte, len_byte - i_byte, bytes);
1391 else
1392 bytes = 1;
1382 thiswidth = ONE_BYTE_CHAR_WIDTH (str[i_byte]); 1393 thiswidth = ONE_BYTE_CHAR_WIDTH (str[i_byte]);
1383 } 1394 }
1384 1395
diff --git a/src/commands.h b/src/commands.h
index c1330af273e..ed46141bf11 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -75,12 +75,15 @@ extern Lisp_Object Vthis_command;
75 events until a non-ASCII event is acceptable as input. */ 75 events until a non-ASCII event is acceptable as input. */
76extern Lisp_Object unread_switch_frame; 76extern Lisp_Object unread_switch_frame;
77 77
78/* The value of point when the last command was executed. */ 78/* The value of point when the last command was started. */
79extern int last_point_position; 79extern int last_point_position;
80 80
81/* The buffer that was current when the last command was started. */ 81/* The buffer that was current when the last command was started. */
82extern Lisp_Object last_point_position_buffer; 82extern Lisp_Object last_point_position_buffer;
83 83
84/* The window that was selected when the last command was started. */
85extern Lisp_Object last_point_position_window;
86
84/* Nonzero means ^G can quit instantly */ 87/* Nonzero means ^G can quit instantly */
85extern int immediate_quit; 88extern int immediate_quit;
86 89
diff --git a/src/eval.c b/src/eval.c
index 86859e4ddae..a6c58bc2425 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -103,7 +103,7 @@ Lisp_Object Vrun_hooks;
103/* Non-nil means record all fset's and provide's, to be undone 103/* Non-nil means record all fset's and provide's, to be undone
104 if the file being autoloaded is not fully loaded. 104 if the file being autoloaded is not fully loaded.
105 They are recorded by being consed onto the front of Vautoload_queue: 105 They are recorded by being consed onto the front of Vautoload_queue:
106 (FUN . ODEF) for a defun, (OFEATURES . nil) for a provide. */ 106 (FUN . ODEF) for a defun, (0 . OFEATURES) for a provide. */
107 107
108Lisp_Object Vautoload_queue; 108Lisp_Object Vautoload_queue;
109 109
@@ -2022,8 +2022,8 @@ un_autoload (oldqueue)
2022 first = XCAR (queue); 2022 first = XCAR (queue);
2023 second = Fcdr (first); 2023 second = Fcdr (first);
2024 first = Fcar (first); 2024 first = Fcar (first);
2025 if (EQ (second, Qnil)) 2025 if (EQ (first, make_number (0)))
2026 Vfeatures = first; 2026 Vfeatures = second;
2027 else 2027 else
2028 Ffset (first, second); 2028 Ffset (first, second);
2029 queue = XCDR (queue); 2029 queue = XCDR (queue);
@@ -2069,7 +2069,7 @@ do_autoload (fundef, funname)
2069 second = Fcdr (first); 2069 second = Fcdr (first);
2070 first = Fcar (first); 2070 first = Fcar (first);
2071 2071
2072 if (CONSP (second) && EQ (XCAR (second), Qautoload)) 2072 if (SYMBOLP (first) && CONSP (second) && EQ (XCAR (second), Qautoload))
2073 Fput (first, Qautoload, (XCDR (second))); 2073 Fput (first, Qautoload, (XCDR (second)));
2074 2074
2075 queue = XCDR (queue); 2075 queue = XCDR (queue);
diff --git a/src/fns.c b/src/fns.c
index d30d49a80c7..70b9cf0d30f 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3519,7 +3519,8 @@ particular subfeatures supported in this version of FEATURE. */)
3519 CHECK_SYMBOL (feature); 3519 CHECK_SYMBOL (feature);
3520 CHECK_LIST (subfeatures); 3520 CHECK_LIST (subfeatures);
3521 if (!NILP (Vautoload_queue)) 3521 if (!NILP (Vautoload_queue))
3522 Vautoload_queue = Fcons (Fcons (Vfeatures, Qnil), Vautoload_queue); 3522 Vautoload_queue = Fcons (Fcons (make_number (0), Vfeatures),
3523 Vautoload_queue);
3523 tem = Fmemq (feature, Vfeatures); 3524 tem = Fmemq (feature, Vfeatures);
3524 if (NILP (tem)) 3525 if (NILP (tem))
3525 Vfeatures = Fcons (feature, Vfeatures); 3526 Vfeatures = Fcons (feature, Vfeatures);
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 9da3c5bf457..cb8e5a21860 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -1220,6 +1220,19 @@ xg_get_file_name_from_chooser (w)
1220 return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w)); 1220 return gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (w));
1221} 1221}
1222 1222
1223static void
1224xg_toggle_visibility_cb (widget, data)
1225 GtkWidget *widget;
1226 gpointer data;
1227{
1228 GtkFileChooser *dialog = GTK_FILE_CHOOSER (data);
1229 gboolean visible;
1230 extern int x_gtk_show_hidden_files;
1231 g_object_get (G_OBJECT (dialog), "show-hidden", &visible, NULL);
1232 g_object_set (G_OBJECT (dialog), "show-hidden", !visible, NULL);
1233 x_gtk_show_hidden_files = !visible;
1234}
1235
1223/* Read a file name from the user using a file chooser dialog. 1236/* Read a file name from the user using a file chooser dialog.
1224 F is the current frame. 1237 F is the current frame.
1225 PROMPT is a prompt to show to the user. May not be NULL. 1238 PROMPT is a prompt to show to the user. May not be NULL.
@@ -1239,11 +1252,14 @@ xg_get_file_with_chooser (f, prompt, default_filename,
1239 int mustmatch_p, only_dir_p; 1252 int mustmatch_p, only_dir_p;
1240 xg_get_file_func *func; 1253 xg_get_file_func *func;
1241{ 1254{
1242 GtkWidget *filewin; 1255 char message[1024];
1256
1257 GtkWidget *filewin, *wtoggle, *wbox, *wmessage;
1243 GtkWindow *gwin = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)); 1258 GtkWindow *gwin = GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f));
1244 GtkFileChooserAction action = (mustmatch_p ? 1259 GtkFileChooserAction action = (mustmatch_p ?
1245 GTK_FILE_CHOOSER_ACTION_OPEN : 1260 GTK_FILE_CHOOSER_ACTION_OPEN :
1246 GTK_FILE_CHOOSER_ACTION_SAVE); 1261 GTK_FILE_CHOOSER_ACTION_SAVE);
1262 extern int x_gtk_show_hidden_files;
1247 1263
1248 if (only_dir_p) 1264 if (only_dir_p)
1249 action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER; 1265 action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
@@ -1256,6 +1272,31 @@ xg_get_file_with_chooser (f, prompt, default_filename,
1256 NULL); 1272 NULL);
1257 gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (filewin), TRUE); 1273 gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (filewin), TRUE);
1258 1274
1275 wbox = gtk_vbox_new (FALSE, 0);
1276 gtk_widget_show (wbox);
1277 wtoggle = gtk_check_button_new_with_label ("Show hidden files.");
1278
1279 if (x_gtk_show_hidden_files)
1280 {
1281 g_object_set (G_OBJECT (filewin), "show-hidden", TRUE, NULL);
1282 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (wtoggle), TRUE);
1283 }
1284 gtk_widget_show (wtoggle);
1285 g_signal_connect (G_OBJECT (wtoggle), "clicked",
1286 G_CALLBACK (xg_toggle_visibility_cb), G_OBJECT(filewin));
1287
1288 message[0] = '\0';
1289 if (action != GTK_FILE_CHOOSER_ACTION_SAVE)
1290 strcat (message, "\nType C-l to display a file name text entry box.\n");
1291 strcat (message, "\nIf you don't like this file selector, customize "
1292 "use-file-dialog\nto turn it off, or type C-x C-f to visit files.");
1293
1294 wmessage = gtk_label_new (message);
1295 gtk_widget_show (wmessage);
1296 gtk_box_pack_start (GTK_BOX (wbox), wtoggle, FALSE, FALSE, 0);
1297 gtk_box_pack_start (GTK_BOX (wbox), wmessage, FALSE, FALSE, 0);
1298 gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (filewin), wbox);
1299
1259 if (default_filename) 1300 if (default_filename)
1260 { 1301 {
1261 Lisp_Object file; 1302 Lisp_Object file;
diff --git a/src/keyboard.c b/src/keyboard.c
index 76ff053410e..c47fda8223c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -377,12 +377,15 @@ Lisp_Object real_this_command;
377 command is stored in this-original-command. It is nil otherwise. */ 377 command is stored in this-original-command. It is nil otherwise. */
378Lisp_Object Vthis_original_command; 378Lisp_Object Vthis_original_command;
379 379
380/* The value of point when the last command was executed. */ 380/* The value of point when the last command was started. */
381int last_point_position; 381int last_point_position;
382 382
383/* The buffer that was current when the last command was started. */ 383/* The buffer that was current when the last command was started. */
384Lisp_Object last_point_position_buffer; 384Lisp_Object last_point_position_buffer;
385 385
386/* The window that was selected when the last command was started. */
387Lisp_Object last_point_position_window;
388
386/* The frame in which the last input event occurred, or Qmacro if the 389/* The frame in which the last input event occurred, or Qmacro if the
387 last event came from a macro. We use this to determine when to 390 last event came from a macro. We use this to determine when to
388 generate switch-frame events. This may be cleared by functions 391 generate switch-frame events. This may be cleared by functions
@@ -1619,6 +1622,7 @@ command_loop_1 ()
1619 prev_buffer = current_buffer; 1622 prev_buffer = current_buffer;
1620 prev_modiff = MODIFF; 1623 prev_modiff = MODIFF;
1621 last_point_position = PT; 1624 last_point_position = PT;
1625 last_point_position_window = selected_window;
1622 XSETBUFFER (last_point_position_buffer, prev_buffer); 1626 XSETBUFFER (last_point_position_buffer, prev_buffer);
1623 1627
1624 /* By default, we adjust point to a boundary of a region that 1628 /* By default, we adjust point to a boundary of a region that
@@ -11298,6 +11302,7 @@ syms_of_keyboard ()
11298 Fset (Qinput_method_use_echo_area, Qnil); 11302 Fset (Qinput_method_use_echo_area, Qnil);
11299 11303
11300 last_point_position_buffer = Qnil; 11304 last_point_position_buffer = Qnil;
11305 last_point_position_window = Qnil;
11301 11306
11302 { 11307 {
11303 struct event_head *p; 11308 struct event_head *p;
diff --git a/src/keyboard.h b/src/keyboard.h
index 48801dff216..45dbd495d28 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -312,7 +312,6 @@ extern Lisp_Object Vfunction_key_map;
312/* Parent keymap of terminal-local key-translation-map instances. */ 312/* Parent keymap of terminal-local key-translation-map instances. */
313extern Lisp_Object Vkey_translation_map; 313extern Lisp_Object Vkey_translation_map;
314 314
315
316extern int parse_menu_item P_ ((Lisp_Object, int, int)); 315extern int parse_menu_item P_ ((Lisp_Object, int, int));
317 316
318extern void echo_now P_ ((void)); 317extern void echo_now P_ ((void));
diff --git a/src/lread.c b/src/lread.c
index e6f1987a50b..6555737fa55 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1345,10 +1345,20 @@ readevalloop (readcharfun, stream, sourcename, evalfun,
1345 if (b != 0 && NILP (b->name)) 1345 if (b != 0 && NILP (b->name))
1346 error ("Reading from killed buffer"); 1346 error ("Reading from killed buffer");
1347 1347
1348
1348 if (!NILP (start)) 1349 if (!NILP (start))
1349 { 1350 {
1351 /* Switch to the buffer we are reading from. */
1352 record_unwind_protect (save_excursion_restore, save_excursion_save ());
1353 set_buffer_internal (b);
1354
1355 /* Save point in it. */
1350 record_unwind_protect (save_excursion_restore, save_excursion_save ()); 1356 record_unwind_protect (save_excursion_restore, save_excursion_save ());
1357 /* Save ZV in it. */
1351 record_unwind_protect (save_restriction_restore, save_restriction_save ()); 1358 record_unwind_protect (save_restriction_restore, save_restriction_save ());
1359 /* Those get unbound after we read one expression. */
1360
1361 /* Set point and ZV around stuff to be read. */
1352 Fgoto_char (start); 1362 Fgoto_char (start);
1353 Fnarrow_to_region (make_number (BEGV), end); 1363 Fnarrow_to_region (make_number (BEGV), end);
1354 } 1364 }
diff --git a/src/minibuf.c b/src/minibuf.c
index af7fa60aba4..4025226574d 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -602,6 +602,10 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
602 minibuffer = get_minibuffer (minibuf_level); 602 minibuffer = get_minibuffer (minibuf_level);
603 Fset_buffer (minibuffer); 603 Fset_buffer (minibuffer);
604 604
605 /* If appropriate, copy enable-multibyte-characters into the minibuffer. */
606 if (inherit_input_method)
607 current_buffer->enable_multibyte_characters = enable_multibyte;
608
605 /* The current buffer's default directory is usually the right thing 609 /* The current buffer's default directory is usually the right thing
606 for our minibuffer here. However, if you're typing a command at 610 for our minibuffer here. However, if you're typing a command at
607 a minibuffer-only frame when minibuf_level is zero, then buf IS 611 a minibuffer-only frame when minibuf_level is zero, then buf IS
@@ -673,10 +677,6 @@ read_minibuf (map, initial, prompt, backup_n, expflag,
673 677
674 minibuf_prompt_width = (int) current_column (); /* iftc */ 678 minibuf_prompt_width = (int) current_column (); /* iftc */
675 679
676 /* If appropriate, copy enable-multibyte-characters into the minibuffer. */
677 if (inherit_input_method)
678 current_buffer->enable_multibyte_characters = enable_multibyte;
679
680 /* Put in the initial input. */ 680 /* Put in the initial input. */
681 if (!NILP (initial)) 681 if (!NILP (initial))
682 { 682 {
@@ -1244,11 +1244,11 @@ is used to further constrain the set of candidates. */)
1244 int bestmatchsize = 0; 1244 int bestmatchsize = 0;
1245 /* These are in bytes, too. */ 1245 /* These are in bytes, too. */
1246 int compare, matchsize; 1246 int compare, matchsize;
1247 int type = HASH_TABLE_P (alist) ? 3 1247 int type = (HASH_TABLE_P (alist) ? 3
1248 : VECTORP (alist) ? 2 1248 : VECTORP (alist) ? 2
1249 : NILP (alist) || (CONSP (alist) 1249 : NILP (alist) || (CONSP (alist)
1250 && (!SYMBOLP (XCAR (alist)) 1250 && (!SYMBOLP (XCAR (alist))
1251 || NILP (XCAR (alist)))); 1251 || NILP (XCAR (alist)))));
1252 int index = 0, obsize = 0; 1252 int index = 0, obsize = 0;
1253 int matchcount = 0; 1253 int matchcount = 0;
1254 int bindcount = -1; 1254 int bindcount = -1;
@@ -2692,7 +2692,7 @@ temp_echo_area_glyphs (string)
2692DEFUN ("minibuffer-message", Fminibuffer_message, Sminibuffer_message, 2692DEFUN ("minibuffer-message", Fminibuffer_message, Sminibuffer_message,
2693 1, 1, 0, 2693 1, 1, 0,
2694 doc: /* Temporarily display STRING at the end of the minibuffer. 2694 doc: /* Temporarily display STRING at the end of the minibuffer.
2695The text is displayed for two seconds, 2695The text is displayed for a period controlled by `minibuffer-message-timeout',
2696or until the next input event arrives, whichever comes first. */) 2696or until the next input event arrives, whichever comes first. */)
2697 (string) 2697 (string)
2698 Lisp_Object string; 2698 Lisp_Object string;
diff --git a/src/undo.c b/src/undo.c
index ecbb714fddd..bf774affac5 100644
--- a/src/undo.c
+++ b/src/undo.c
@@ -24,6 +24,7 @@ Boston, MA 02110-1301, USA. */
24#include "lisp.h" 24#include "lisp.h"
25#include "buffer.h" 25#include "buffer.h"
26#include "commands.h" 26#include "commands.h"
27#include "window.h"
27 28
28/* Limits controlling how much undo information to keep. */ 29/* Limits controlling how much undo information to keep. */
29 30
@@ -100,12 +101,19 @@ record_point (pt)
100 /* If we are just after an undo boundary, and 101 /* If we are just after an undo boundary, and
101 point wasn't at start of deleted range, record where it was. */ 102 point wasn't at start of deleted range, record where it was. */
102 if (at_boundary 103 if (at_boundary
103 && last_point_position != pt
104 /* If we're called from batch mode, this could be nil. */
105 && BUFFERP (last_point_position_buffer) 104 && BUFFERP (last_point_position_buffer)
105 /* If we're called from batch mode, this could be nil. */
106 && current_buffer == XBUFFER (last_point_position_buffer)) 106 && current_buffer == XBUFFER (last_point_position_buffer))
107 current_buffer->undo_list 107 {
108 = Fcons (make_number (last_point_position), current_buffer->undo_list); 108 /* If we have switched windows, use the point value
109 from the window we are in. */
110 if (! EQ (last_point_position_window, selected_window))
111 last_point_position = marker_position (XWINDOW (selected_window)->pointm);
112
113 if (last_point_position != pt)
114 current_buffer->undo_list
115 = Fcons (make_number (last_point_position), current_buffer->undo_list);
116 }
109} 117}
110 118
111/* Record an insertion that just happened or is about to happen, 119/* Record an insertion that just happened or is about to happen,
diff --git a/src/xfns.c b/src/xfns.c
index 2aa237ec549..7bf302594be 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -155,6 +155,10 @@ int display_hourglass_p;
155 155
156int x_use_old_gtk_file_dialog; 156int x_use_old_gtk_file_dialog;
157 157
158/* If non-zero, by default show hidden files in the GTK file chooser. */
159
160int x_gtk_show_hidden_files;
161
158/* The background and shape of the mouse pointer, and shape when not 162/* The background and shape of the mouse pointer, and shape when not
159 over text or in the modeline. */ 163 over text or in the modeline. */
160 164
@@ -5790,6 +5794,12 @@ chooser is used instead. To turn off all file dialogs set the
5790variable `use-file-dialog'. */); 5794variable `use-file-dialog'. */);
5791 x_use_old_gtk_file_dialog = 0; 5795 x_use_old_gtk_file_dialog = 0;
5792 5796
5797 DEFVAR_BOOL ("x-gtk-show-hidden-files", &x_gtk_show_hidden_files,
5798 doc: /* *If non-nil, the GTK file chooser will by default show hidden files.
5799Note that this is just the default, there is a toggle button on the file
5800chooser to show or not show hidden files on a case by case basis. */);
5801 x_gtk_show_hidden_files = 0;
5802
5793 Fprovide (intern ("x"), Qnil); 5803 Fprovide (intern ("x"), Qnil);
5794 5804
5795#ifdef USE_X_TOOLKIT 5805#ifdef USE_X_TOOLKIT