summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatsumi Yamaoka <yamaoka@jpl.org>2010-01-28 00:06:29 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2010-01-28 00:06:29 +0000
commitff55b1f59ed2a51b2af394d3ab319063509b4389 (patch)
tree6447efd3f33ad5deb9ca8ea99a00cddc17c25f27
parent742e5defbaab07863b771ed03da674fd34121273 (diff)
parentcc03eb8280acca939fb785b48759c6a6d6866d72 (diff)
downloademacs-ff55b1f59ed2a51b2af394d3ab319063509b4389.tar.gz
Merge from mainline.
-rw-r--r--admin/notes/bugtracker61
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/calendar/diary-lib.el4
-rw-r--r--lisp/files.el42
-rw-r--r--src/ChangeLog18
-rw-r--r--src/fileio.c28
-rw-r--r--src/regex.c3
-rw-r--r--src/w32inevt.c77
8 files changed, 207 insertions, 36 deletions
diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker
index 1a9f6f2bd4c..964cc869b8f 100644
--- a/admin/notes/bugtracker
+++ b/admin/notes/bugtracker
@@ -2,6 +2,36 @@ NOTES ON THE EMACS BUG TRACKER -*- outline -*-
The Emacs Bug Tracker can be found at http://debbugs.gnu.org/
+* Quick-start guide
+
+This is 95% of all you will ever need.
+
+** How do I report a bug?
+Use M-x report-emacs-bug, or send mail to bug-gnu-emacs@gnu.org.
+If you want to Cc someone, use an "X-Debbugs-CC" header instead.
+
+** How do I comment on a bug?
+Reply to a mail on the bug-gnu-emacs list in the normal way.
+Or send a mail to 123@debbugs.gnu.org.
+
+If the bug is old and closed, you may have to unarchive it first.
+Send a mail to control@debbugs.gnu.org with
+unarchive 123
+on the first line of the body.
+
+** How do I close a bug?
+Send a mail to 123-done@debbugs.gnu.org. In the body, explain
+why the bug is being closed.
+
+** How do I set bug meta-data?
+By mailing commands to control@debbugs.gnu.org. Place commands at the
+start of the message body, one per line.
+
+severity 123 serious|important|normal|minor|wishlist
+tags 123 moreinfo|unreproducible|wontfix|patch
+
+* More detailed information
+
For a list of all bugs, see http://debbugs.gnu.org/db/pa/lemacs.html
This is a static page, updated once a day. There is also a dynamic
list, generated on request, but since there are many bug reports this
@@ -110,11 +140,7 @@ Remember to fix FOO, as discussed on emacs-devel at http://... .
** Not interested in tracker control messages (tags being set, etc)?
Discard mails matching:
-^X-Emacs-PR-Message: transcript
-
-When you close a bug, you get a message matching:
-
-^X-Emacs-PR-Message: closed
+^X-Emacs-PR-Message: (transcript|closed)
** How to avoid multiple copies of mails.
If you reply to reports in the normal way, this should work fine.
@@ -131,6 +157,31 @@ There is no need to cc the address without the "-done" part or the
submitter; they get copies anyway so this will just result in more
duplicate mail.
+** Details of closing a bug.
+(For information only)
+Sending a mail to 123-done does the following:
+
+1) Mark the bug as closed in the database.
+
+2) Send a mail to the original submitter telling them that their bug
+has been closed. This mail has a header:
+
+X-Emacs-PR-Message: they-closed 123
+
+3) Send a mail to you and to the emacs-bug-tracker list confirming
+that the bug has been closed. This mail has a header:
+
+X-Emacs-PR-Message: closed 123
+
+4) Send a copy of your mail to the bug-gnu-emacs list in exactly the
+same way as if you had sent mail to "123" (sans -done). This mail has
+headers:
+
+X-Emacs-PR-Message: cc-closed 123
+Mail-Followup-To: 123@debbugs.gnu.org, ...
+
+(This is Emacs-specific. Normally the bug list gets the same mail as in 3).
+
** Setting bug parameters.
There are two ways to set the parameters of bugs in the database
(tags, severity level, etc). When you report a new bug, you can
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9b3fb944f94..0248453d49d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
+2010-01-27 Stephen Berman <stephen.berman@gmx.net>
+
+ * calendar/diary-lib.el (diary-unhide-everything): Handle narrowed
+ buffers. (Bug#5477)
+
+2010-01-27 David De La Harpe Golden <david@harpegolden.net>
+
+ * files.el (delete-directory): Handle moving to trash without
+ first doing recursion (Bug#5436).
+
2010-01-26 Dan Nicolaescu <dann@ics.uci.edu>
* vc-hooks.el (vc-path): Mark as obsolete.
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index e1400cc2fa6..8fb464aa7e6 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -804,7 +804,9 @@ LIST-ONLY is non-nil, in which case it just returns the list."
(defun diary-unhide-everything ()
"Show all invisible text in the diary."
(kill-local-variable 'diary-selective-display)
- (remove-overlays (point-min) (point-max) 'invisible 'diary)
+ (save-restriction ; bug#5477
+ (widen)
+ (remove-overlays (point-min) (point-max) 'invisible 'diary))
(kill-local-variable 'mode-line-format))
(defvar original-date) ; bound in diary-list-entries
diff --git a/lisp/files.el b/lisp/files.el
index 99e818643d0..d372ff3420a 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4665,21 +4665,35 @@ If RECURSIVE is non-nil, all files in DIRECTORY are deleted as well."
;; delete-directory handler.
(setq directory (directory-file-name (expand-file-name directory)))
(let ((handler (find-file-name-handler directory 'delete-directory)))
- (if handler
- (funcall handler 'delete-directory directory recursive)
+ (cond
+ (handler
+ (funcall handler 'delete-directory directory recursive))
+ (delete-by-moving-to-trash
+ ;; Only move non-empty dir to trash if recursive deletion was
+ ;; requested. This mimics the non-`delete-by-moving-to-trash'
+ ;; case, where the operation fails in delete-directory-internal.
+ ;; As `move-file-to-trash' trashes directories (empty or
+ ;; otherwise) as a unit, we do not need to recurse here.
+ (if (and (not recursive)
+ ;; Check if directory is empty apart from "." and "..".
+ (directory-files
+ directory 'full directory-files-no-dot-files-regexp))
+ (error "Directory is not empty, not moving to trash")
+ (move-file-to-trash directory)))
+ ;; Otherwise, call outselves recursively if needed.
+ (t
(if (and recursive (not (file-symlink-p directory)))
- (mapc
- (lambda (file)
- ;; This test is equivalent to
- ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
- ;; but more efficient
- (if (eq t (car (file-attributes file)))
- (delete-directory file recursive)
- (delete-file file)))
- ;; We do not want to delete "." and "..".
- (directory-files
- directory 'full directory-files-no-dot-files-regexp)))
- (delete-directory-internal directory))))
+ (mapc (lambda (file)
+ ;; This test is equivalent to
+ ;; (and (file-directory-p fn) (not (file-symlink-p fn)))
+ ;; but more efficient
+ (if (eq t (car (file-attributes file)))
+ (delete-directory file recursive)
+ (delete-file file)))
+ ;; We do not want to delete "." and "..".
+ (directory-files
+ directory 'full directory-files-no-dot-files-regexp)))
+ (delete-directory-internal directory)))))
(defun copy-directory (directory newname &optional keep-time parents)
"Copy DIRECTORY to NEWNAME. Both args must be strings.
diff --git a/src/ChangeLog b/src/ChangeLog
index 17c6a137e55..754dc935a3d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-27 Jason Rumney <jasonr@gnu.org>
+
+ * w32inevt.c (w32_kbd_patch_key): Save the unicode character.
+ (key_event): Use unicode for characters 128 and higher.
+
+2010-01-27 Kenichi Handa <handa@m17n.org>
+
+ * regex.c (analyse_first): Fix setting of fastmap for unibyte
+ pattern string (Bug#4209).
+
+2010-01-27 David De La Harpe Golden <david@harpegolden.net>
+
+ * fileio.c (Frename_file): Call copy-directory and
+ delete-directory for directories, in order to handle cross-device
+ renaming (Bug#3353).
+
2010-01-25 Jan Djärv <jan.h.d@swipnet.se>
* xfns.c (Fx_create_frame): If frame height is too big, try
@@ -9323,7 +9339,7 @@
(syms_of_xterm): Don't declare it any more.
(x_draw_glyph_string): Adjust to the new name.
-2008-06-10 David De La Harpe Golden <david@harpegolden.net> (tiny change)
+2008-06-10 David De La Harpe Golden <david@harpegolden.net>
* xterm.c (x_underline_minimum_display_offset): New var.
(x_draw_glyph_string): Use it.
diff --git a/src/fileio.c b/src/fileio.c
index d6cb814641b..36eaf7db533 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -215,6 +215,12 @@ Lisp_Object Qdelete_by_moving_to_trash;
/* Lisp function for moving files to trash. */
Lisp_Object Qmove_file_to_trash;
+/* Lisp function for recursively copying directories. */
+Lisp_Object Qcopy_directory;
+
+/* Lisp function for recursively deleting directories. */
+Lisp_Object Qdelete_directory;
+
extern Lisp_Object Vuser_login_name;
#ifdef WINDOWSNT
@@ -2241,7 +2247,11 @@ This is what happens in interactive use with M-x. */)
&& (NILP (Fstring_equal (Fdowncase (file), Fdowncase (newname))))
#endif
)
- newname = Fexpand_file_name (Ffile_name_nondirectory (file), newname);
+ {
+ Lisp_Object fname = NILP (Ffile_directory_p (file))
+ ? file : Fdirectory_file_name (file);
+ newname = Fexpand_file_name (Ffile_name_nondirectory (fname), newname);
+ }
else
newname = Fexpand_file_name (newname, Qnil);
@@ -2279,15 +2289,21 @@ This is what happens in interactive use with M-x. */)
NILP (ok_if_already_exists) ? Qnil : Qt);
else
#endif
+ if (Ffile_directory_p (file))
+ call4 (Qcopy_directory, file, newname, Qt, Qnil);
+ else
+ /* We have already prompted if it was an integer, so don't
+ have copy-file prompt again. */
Fcopy_file (file, newname,
- /* We have already prompted if it was an integer,
- so don't have copy-file prompt again. */
NILP (ok_if_already_exists) ? Qnil : Qt,
Qt, Qt);
count = SPECPDL_INDEX ();
specbind (Qdelete_by_moving_to_trash, Qnil);
- Fdelete_file (file);
+ if (Ffile_directory_p (file))
+ call2 (Qdelete_directory, file, Qt);
+ else
+ Fdelete_file (file);
unbind_to (count, Qnil);
}
else
@@ -5727,6 +5743,10 @@ When non-nil, the function `move-file-to-trash' will be used by
Qdelete_by_moving_to_trash = intern_c_string ("delete-by-moving-to-trash");
Qmove_file_to_trash = intern_c_string ("move-file-to-trash");
staticpro (&Qmove_file_to_trash);
+ Qcopy_directory = intern_c_string ("copy-directory");
+ staticpro (&Qcopy_directory);
+ Qdelete_directory = intern_c_string ("delete-directory");
+ staticpro (&Qdelete_directory);
defsubr (&Sfind_file_name_handler);
defsubr (&Sfile_name_directory);
diff --git a/src/regex.c b/src/regex.c
index 0dbfa5971b3..bb921a5b519 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -4083,8 +4083,7 @@ analyse_first (p, pend, fastmap, multibyte)
the corresponding multibyte character. */
int c = RE_CHAR_TO_MULTIBYTE (p[1]);
- if (! CHAR_BYTE8_P (c))
- fastmap[CHAR_LEADING_CODE (c)] = 1;
+ fastmap[CHAR_LEADING_CODE (c)] = 1;
}
}
break;
diff --git a/src/w32inevt.c b/src/w32inevt.c
index 5ba8430eb84..159751c8b46 100644
--- a/src/w32inevt.c
+++ b/src/w32inevt.c
@@ -81,6 +81,9 @@ extern unsigned int w32_key_to_modifier (int key);
static INPUT_RECORD event_queue[EVENT_QUEUE_SIZE];
static INPUT_RECORD *queue_ptr = event_queue, *queue_end = event_queue;
+/* Temporarily store lead byte of DBCS input sequences. */
+static char dbcs_lead = 0;
+
static int
fill_queue (BOOL block)
{
@@ -253,13 +256,15 @@ w32_kbd_patch_key (KEY_EVENT_RECORD *event)
keystate, buf, 128, 0);
if (isdead > 0)
{
- char cp[20];
- int cpId;
+ char cp[20];
+ int cpId;
- GetLocaleInfo (GetThreadLocale (),
+ event->uChar.UnicodeChar = buf[isdead - 1];
+
+ GetLocaleInfo (GetThreadLocale (),
LOCALE_IDEFAULTANSICODEPAGE, cp, 20);
- cpId = atoi (cp);
- isdead = WideCharToMultiByte (cpId, 0, buf, isdead,
+ cpId = atoi (cp);
+ isdead = WideCharToMultiByte (cpId, 0, buf, isdead,
ansi_code, 4, NULL, NULL);
}
else
@@ -425,8 +430,6 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev, int *isdead)
if (lispy_function_keys[event->wVirtualKeyCode] == 0)
{
- emacs_ev->kind = ASCII_KEYSTROKE_EVENT;
-
if (!NILP (Vw32_recognize_altgr)
&& (event->dwControlKeyState & LEFT_CTRL_PRESSED)
&& (event->dwControlKeyState & RIGHT_ALT_PRESSED))
@@ -461,9 +464,65 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev, int *isdead)
else if (event->uChar.AsciiChar == 0)
w32_kbd_patch_key (event);
}
+
if (event->uChar.AsciiChar == 0)
- return 0;
- emacs_ev->code = event->uChar.AsciiChar;
+ {
+ emacs_ev->kind = NO_EVENT;
+ return 0;
+ }
+ else if (event->uChar.AsciiChar > 0 && event->uChar.AsciiChar < 128)
+ {
+ emacs_ev->kind = ASCII_KEYSTROKE_EVENT;
+ emacs_ev->code = event->uChar.AsciiChar;
+ }
+ else if (event->uChar.UnicodeChar > 0)
+ {
+ emacs_ev->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+ emacs_ev->code = event->uChar.UnicodeChar;
+ }
+ else
+ {
+ /* Fallback for non-Unicode versions of Windows. */
+ wchar_t code;
+ char dbcs[2];
+ char cp[20];
+ int cpId;
+
+ /* Get the codepage to interpret this key with. */
+ GetLocaleInfo (GetThreadLocale (),
+ LOCALE_IDEFAULTANSICODEPAGE, cp, 20);
+ cpId = atoi (cp);
+
+ dbcs[0] = dbcs_lead;
+ dbcs[1] = event->uChar.AsciiChar;
+ if (dbcs_lead)
+ {
+ dbcs_lead = 0;
+ if (!MultiByteToWideChar (cpId, 0, dbcs, 2, &code, 1))
+ {
+ /* Garbage */
+ DebPrint (("Invalid DBCS sequence: %d %d\n",
+ dbcs[0], dbcs[1]));
+ emacs_ev->kind = NO_EVENT;
+ }
+ }
+ else if (IsDBCSLeadByteEx (cpId, dbcs[1]))
+ {
+ dbcs_lead = dbcs[1];
+ emacs_ev->kind = NO_EVENT;
+ }
+ else
+ {
+ if (!MultiByteToWideChar (cpId, 0, &dbcs[1], 1, &code, 1))
+ {
+ /* Garbage */
+ DebPrint (("Invalid character: %d\n", dbcs[1]));
+ emacs_ev->kind = NO_EVENT;
+ }
+ }
+ emacs_ev->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
+ emacs_ev->code = code;
+ }
}
else
{