aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c14
-rw-r--r--src/keyboard.c15
-rw-r--r--src/nsfns.m11
3 files changed, 27 insertions, 13 deletions
diff --git a/src/fileio.c b/src/fileio.c
index d8ecccd7930..ca21b0a115a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2261,7 +2261,7 @@ This is what happens in interactive use with M-x. */)
2261 (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists) 2261 (Lisp_Object file, Lisp_Object newname, Lisp_Object ok_if_already_exists)
2262{ 2262{
2263 Lisp_Object handler; 2263 Lisp_Object handler;
2264 Lisp_Object encoded_file, encoded_newname, symlink_target; 2264 Lisp_Object encoded_file, encoded_newname;
2265 2265
2266 file = Fexpand_file_name (file, Qnil); 2266 file = Fexpand_file_name (file, Qnil);
2267 2267
@@ -2335,12 +2335,22 @@ This is what happens in interactive use with M-x. */)
2335 if (rename_errno != EXDEV) 2335 if (rename_errno != EXDEV)
2336 report_file_errno ("Renaming", list2 (file, newname), rename_errno); 2336 report_file_errno ("Renaming", list2 (file, newname), rename_errno);
2337 2337
2338 struct stat file_st;
2338 bool dirp = !NILP (Fdirectory_name_p (file)); 2339 bool dirp = !NILP (Fdirectory_name_p (file));
2340 if (!dirp)
2341 {
2342 if (lstat (SSDATA (encoded_file), &file_st) != 0)
2343 report_file_error ("Renaming", list2 (file, newname));
2344 dirp = S_ISDIR (file_st.st_mode) != 0;
2345 }
2339 if (dirp) 2346 if (dirp)
2340 call4 (Qcopy_directory, file, newname, Qt, Qnil); 2347 call4 (Qcopy_directory, file, newname, Qt, Qnil);
2341 else 2348 else
2342 { 2349 {
2343 symlink_target = Ffile_symlink_p (file); 2350 Lisp_Object symlink_target
2351 = (S_ISLNK (file_st.st_mode)
2352 ? emacs_readlinkat (AT_FDCWD, SSDATA (encoded_file))
2353 : Qnil);
2344 if (!NILP (symlink_target)) 2354 if (!NILP (symlink_target))
2345 Fmake_symbolic_link (symlink_target, newname, ok_if_already_exists); 2355 Fmake_symbolic_link (symlink_target, newname, ok_if_already_exists);
2346 else 2356 else
diff --git a/src/keyboard.c b/src/keyboard.c
index ee353d2b078..7ddd6b96747 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -10055,7 +10055,12 @@ Internal use only. */)
10055 10055
10056 this_command_key_count = 0; 10056 this_command_key_count = 0;
10057 this_single_command_key_start = 0; 10057 this_single_command_key_start = 0;
10058 int key0 = SREF (keys, 0); 10058
10059 int charidx = 0, byteidx = 0;
10060 int key0;
10061 FETCH_STRING_CHAR_ADVANCE (key0, keys, charidx, byteidx);
10062 if (CHAR_BYTE8_P (key0))
10063 key0 = CHAR_TO_BYTE8 (key0);
10059 10064
10060 /* Kludge alert: this makes M-x be in the form expected by 10065 /* Kludge alert: this makes M-x be in the form expected by
10061 novice.el. (248 is \370, a.k.a. "Meta-x".) Any better ideas? */ 10066 novice.el. (248 is \370, a.k.a. "Meta-x".) Any better ideas? */
@@ -10064,7 +10069,13 @@ Internal use only. */)
10064 else 10069 else
10065 add_command_key (make_number (key0)); 10070 add_command_key (make_number (key0));
10066 for (ptrdiff_t i = 1; i < SCHARS (keys); i++) 10071 for (ptrdiff_t i = 1; i < SCHARS (keys); i++)
10067 add_command_key (make_number (SREF (keys, i))); 10072 {
10073 int key_i;
10074 FETCH_STRING_CHAR_ADVANCE (key_i, keys, charidx, byteidx);
10075 if (CHAR_BYTE8_P (key_i))
10076 key_i = CHAR_TO_BYTE8 (key_i);
10077 add_command_key (make_number (key_i));
10078 }
10068 return Qnil; 10079 return Qnil;
10069} 10080}
10070 10081
diff --git a/src/nsfns.m b/src/nsfns.m
index ba363629686..c8a41f5b4b0 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1476,13 +1476,8 @@ ns_window_is_ancestor (NSWindow *win, NSWindow *candidate)
1476DEFUN ("ns-frame-list-z-order", Fns_frame_list_z_order, 1476DEFUN ("ns-frame-list-z-order", Fns_frame_list_z_order,
1477 Sns_frame_list_z_order, 0, 1, 0, 1477 Sns_frame_list_z_order, 0, 1, 0,
1478 doc: /* Return list of Emacs' frames, in Z (stacking) order. 1478 doc: /* Return list of Emacs' frames, in Z (stacking) order.
1479The optional argument TERMINAL specifies which display to ask about. 1479If TERMINAL is non-nil and specifies a live frame, return the child
1480TERMINAL should be either a frame or a display name (a string). If 1480frames of that frame in Z (stacking) order.
1481omitted or nil, that stands for the selected frame's display. Return
1482nil if TERMINAL contains no Emacs frame.
1483
1484As a special case, if TERMINAL is non-nil and specifies a live frame,
1485return the child frames of that frame in Z (stacking) order.
1486 1481
1487Frames are listed from topmost (first) to bottommost (last). */) 1482Frames are listed from topmost (first) to bottommost (last). */)
1488 (Lisp_Object terminal) 1483 (Lisp_Object terminal)
@@ -1492,8 +1487,6 @@ Frames are listed from topmost (first) to bottommost (last). */)
1492 1487
1493 if (FRAMEP (terminal) && FRAME_LIVE_P (XFRAME (terminal))) 1488 if (FRAMEP (terminal) && FRAME_LIVE_P (XFRAME (terminal)))
1494 parent = [FRAME_NS_VIEW (XFRAME (terminal)) window]; 1489 parent = [FRAME_NS_VIEW (XFRAME (terminal)) window];
1495 else if (!NILP (terminal))
1496 return Qnil;
1497 1490
1498 for (NSWindow *win in [[NSApp orderedWindows] reverseObjectEnumerator]) 1491 for (NSWindow *win in [[NSApp orderedWindows] reverseObjectEnumerator])
1499 { 1492 {