From e1cb2c1314c1a58d9d83293019b5d563a3edb072 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 9 May 2010 17:30:08 -0700 Subject: [PATCH 1/6] Backport from trunk: Fix bug#5755. * desktop.el (desktop-save-buffer-p): Don't mistakenly include all dired buffers, even tramp ones. (Bug#5755) [Backport from trunk] --- lisp/ChangeLog | 5 +++++ lisp/desktop.el | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 99bbf884752..90c3d0de1a0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-10 Glenn Morris + + * desktop.el (desktop-save-buffer-p): Don't mistakenly include + all dired buffers, even tramp ones. (Bug#5755) [Backport from trunk] + 2010-05-07 Chong Yidong * Version 23.2 released. diff --git a/lisp/desktop.el b/lisp/desktop.el index 33e8cb1745f..0e6153cfe47 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1,7 +1,8 @@ ;;; desktop.el --- save partial status of Emacs when killed ;; Copyright (C) 1993, 1994, 1995, 1997, 2000, 2001, 2002, 2003, -;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +;; 2004, 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. ;; Author: Morten Welinder ;; Keywords: convenience @@ -811,19 +812,23 @@ which means to truncate VAR's value to at most MAX-SIZE elements FILENAME is the visited file name, BUFNAME is the buffer name, and MODE is the major mode. \n\(fn FILENAME BUFNAME MODE)" - (let ((case-fold-search nil)) + (let ((case-fold-search nil) + dired-skip) (and (not (and (stringp desktop-buffers-not-to-save) (not filename) (string-match desktop-buffers-not-to-save bufname))) (not (memq mode desktop-modes-not-to-save)) + ;; FIXME this is broken if desktop-files-not-to-save is nil. (or (and filename (stringp desktop-files-not-to-save) (not (string-match desktop-files-not-to-save filename))) (and (eq mode 'dired-mode) (with-current-buffer bufname - (not (string-match desktop-files-not-to-save - default-directory)))) + (not (setq dired-skip + (string-match desktop-files-not-to-save + default-directory))))) (and (null filename) + (null dired-skip) ; bug#5755 (with-current-buffer bufname desktop-save-buffer)))))) ;; ---------------------------------------------------------------------------- From 8290c6b9e657060bbbfaf77d42c1b5abf87b229a Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Sun, 9 May 2010 17:37:59 -0700 Subject: [PATCH 2/6] Backport from trunk: close bug#5857. * configure.in: Get rid of "unix" pre-defined macro when preprocessing Makefile. (Bug#5857) [Backport from trunk] --- ChangeLog | 5 +++++ configure.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6b2c016534c..b218314d2ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-05-10 Miles Bader + + * configure.in: Get rid of "unix" pre-defined macro when + preprocessing Makefile. (Bug#5857) [Backport from trunk] + 2010-05-07 Chong Yidong * Version 23.2 released. diff --git a/configure.in b/configure.in index 7b681f6e6c2..304f6ab2f91 100644 --- a/configure.in +++ b/configure.in @@ -3072,7 +3072,7 @@ test "${exec_prefix}" != NONE && # the C preprocessor to some helpful value like 1, or maybe the empty # string. Needless to say consequent macro substitutions are less # than conducive to the makefile finding the correct directory. -[cpp_undefs="`echo $srcdir $configuration $canonical | +[cpp_undefs="`echo $srcdir $configuration $canonical unix | sed -e 's/[^a-zA-Z0-9_]/ /g' -e 's/^/ /' -e 's/ *$//' \ -e 's/ */ -U/g' -e 's/-U[0-9][^ ]*//g'`"] From c90ca7b7662200bb3153f45e4d05ee8ac695dda6 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Tue, 11 May 2010 20:15:29 +0900 Subject: [PATCH 3/6] ftfont.c: Fix incorrect parentheses of #if condition for definining M17N_FLT_USE_NEW_FEATURE. --- src/ChangeLog | 5 +++++ src/ftfont.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 34d52a4442c..19b7efb71d1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-05-11 Karel Klic (tiny change) + + * ftfont.c: Fix incorrect parentheses of #if condition for + definining M17N_FLT_USE_NEW_FEATURE. + 2010-05-07 Chong Yidong * Version 23.2 released. diff --git a/src/ftfont.c b/src/ftfont.c index 6956c134a7c..9699dc58009 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1578,8 +1578,8 @@ ftfont_otf_capability (font) #ifdef HAVE_M17N_FLT -#if ((LIBOTF_MAJOR_VERSION > 1) || (LIBOTF_RELEASE_NUMBER >= 10) \ - && (M17NLIB_MAJOR_VERSION > 1) || (M17NLIB_MINOR_VERSION >= 6)) +#if (((LIBOTF_MAJOR_VERSION > 1) || (LIBOTF_RELEASE_NUMBER >= 10)) \ + && ((M17NLIB_MAJOR_VERSION > 1) || (M17NLIB_MINOR_VERSION >= 6))) /* We can use the new feature of libotf and m17n-flt to handle the character encoding scheme introduced in Unicode 5.1 and 5.2 for some Agian scripts. */ From 3ffd461547221ea713427fa3e547b422cdc77f1c Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 11 May 2010 08:48:29 -0700 Subject: [PATCH 4/6] * src/ChangeLog: Remove tiny change marker from author with assignment. --- src/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 19b7efb71d1..4e0c7e6df71 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,4 @@ -2010-05-11 Karel Klic (tiny change) +2010-05-11 Karel Klic * ftfont.c: Fix incorrect parentheses of #if condition for definining M17N_FLT_USE_NEW_FEATURE. From c8670ded9c8c4fe3801b6a378ee93f9180ce0453 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 11 May 2010 20:23:52 +0300 Subject: [PATCH 5/6] Backport from trunk: Fix bug #6126. makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h. w32fns.c: Include w32.h. (Fw32_shell_execute): Decode the error message before passing it to `error'. --- src/ChangeLog | 8 ++++++++ src/makefile.w32-in | 1 + src/w32fns.c | 14 +++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 4e0c7e6df71..8e2774f2a03 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2010-05-11 Eli Zaretskii + + * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(SRC)/w32.h. + + * w32fns.c: Include w32.h. + (Fw32_shell_execute): Decode the error message before passing it + to `error'. (Bug#6126) + 2010-05-11 Karel Klic * ftfont.c: Fix incorrect parentheses of #if condition for diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 156eddd6092..591e38fb60d 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -1564,6 +1564,7 @@ $(BLD)/w32fns.$(O) : \ $(SRC)/keyboard.h \ $(SRC)/systime.h \ $(SRC)/termhooks.h \ + $(SRC)/w32.h \ $(SRC)/w32font.h \ $(SRC)/w32gui.h \ $(SRC)/w32heap.h \ diff --git a/src/w32fns.c b/src/w32fns.c index 795e7208569..bc310da0d2f 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -47,6 +47,7 @@ along with GNU Emacs. If not, see . */ #include "systime.h" #include "termhooks.h" #include "w32heap.h" +#include "w32.h" #include "bitmaps/gray.xbm" @@ -6333,6 +6334,7 @@ an integer representing a ShowWindow flag: Lisp_Object operation, document, parameters, show_flag; { Lisp_Object current_dir; + char *errstr; CHECK_STRING (document); @@ -6353,7 +6355,17 @@ an integer representing a ShowWindow flag: XINT (show_flag) : SW_SHOWDEFAULT)) > 32) return Qt; - error ("ShellExecute failed: %s", w32_strerror (0)); + errstr = w32_strerror (0); + /* The error string might be encoded in the locale's encoding. */ + if (!NILP (Vlocale_coding_system)) + { + Lisp_Object decoded = + code_convert_string_norecord (make_unibyte_string (errstr, + strlen (errstr)), + Vlocale_coding_system, 0); + errstr = (char *)SDATA (decoded); + } + error ("ShellExecute failed: %s", errstr); } /* Lookup virtual keycode from string representing the name of a From dc9ed7949681bcb29cf151c5183efcc50260fa00 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 11 May 2010 16:07:12 -0400 Subject: [PATCH 6/6] Backport from trunk: compute shortcuts in tmm.el. * tmm.el (tmm-prompt): Don't try to precompute bindings. (tmm-get-keymap): Compute shortcuts since the cache is empty. Fixes: debbugs:6171 --- lisp/ChangeLog | 5 +++++ lisp/tmm.el | 50 ++++++++++++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 90c3d0de1a0..6ac83cdb0c2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-05-11 Stefan Monnier + + * tmm.el (tmm-prompt): Don't try to precompute bindings. + (tmm-get-keymap): Compute shortcuts (bug#6171). + 2010-05-10 Glenn Morris * desktop.el (desktop-save-buffer-p): Don't mistakenly include diff --git a/lisp/tmm.el b/lisp/tmm.el index f4ae3c110d5..0cbc72673a4 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el @@ -262,9 +262,6 @@ Its value should be an event that has a binding in MENU." (condition-case nil (require 'mouse) (error nil)) - (condition-case nil - (x-popup-menu nil choice) ; Get the shortcuts - (error nil)) (tmm-prompt choice)) ;; We just handled a menu keymap and found a command. (choice @@ -445,33 +442,30 @@ element of keymap, an `x-popup-menu' argument, or an element of `x-popup-menu' argument (when IN-X-MENU is not-nil). This function adds the element only if it is not already present. It uses the free variable `tmm-table-undef' to keep undefined keys." - (let (km str cache plist filter visible enable (event (car elt))) + (let (km str plist filter visible enable (event (car elt))) (setq elt (cdr elt)) (if (eq elt 'undefined) (setq tmm-table-undef (cons (cons event nil) tmm-table-undef)) (unless (assoc event tmm-table-undef) (cond ((if (listp elt) (or (keymapp elt) (eq (car elt) 'lambda)) - (fboundp elt)) + (and (symbolp elt) (fboundp elt))) (setq km elt)) ((if (listp (cdr-safe elt)) (or (keymapp (cdr-safe elt)) (eq (car (cdr-safe elt)) 'lambda)) - (fboundp (cdr-safe elt))) + (and (symbolp (cdr-safe elt)) (fboundp (cdr-safe elt)))) (setq km (cdr elt)) (and (stringp (car elt)) (setq str (car elt)))) ((if (listp (cdr-safe (cdr-safe elt))) (or (keymapp (cdr-safe (cdr-safe elt))) (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) - (fboundp (cdr-safe (cdr-safe elt)))) + (and (symbolp (cdr-safe (cdr-safe elt))) + (fboundp (cdr-safe (cdr-safe elt))))) (setq km (cddr elt)) - (and (stringp (car elt)) (setq str (car elt))) - (and str - (stringp (cdr-safe (cadr elt))) ; keyseq cache - (setq cache (cdr (cadr elt))) - cache (setq str (concat str cache)))) + (and (stringp (car elt)) (setq str (car elt)))) ((eq (car-safe elt) 'menu-item) ;; (menu-item TITLE COMMAND KEY ...) @@ -488,30 +482,34 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." (setq km (and (eval visible) km))) (setq enable (plist-get plist :enable)) (if enable - (setq km (if (eval enable) km 'ignore))) - (and str - (consp (nth 3 elt)) - (stringp (cdr (nth 3 elt))) ; keyseq cache - (setq cache (cdr (nth 3 elt))) - cache - (setq str (concat str cache)))) + (setq km (if (eval enable) km 'ignore)))) ((if (listp (cdr-safe (cdr-safe (cdr-safe elt)))) (or (keymapp (cdr-safe (cdr-safe (cdr-safe elt)))) (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) - (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))) + (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) + (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) ; New style of easy-menu (setq km (cdr (cddr elt))) - (and (stringp (car elt)) (setq str (car elt))) - (and str - (stringp (cdr-safe (car (cddr elt)))) ; keyseq cache - (setq cache (cdr (car (cdr (cdr elt))))) - cache (setq str (concat str cache)))) + (and (stringp (car elt)) (setq str (car elt)))) ((stringp event) ; x-popup or x-popup element (if (or in-x-menu (stringp (car-safe elt))) (setq str event event nil km elt) - (setq str event event nil km (cons 'keymap elt)))))) + (setq str event event nil km (cons 'keymap elt))))) + (unless (eq km 'ignore) + (let ((binding (where-is-internal km nil t))) + (when binding + (setq binding (key-description binding)) + ;; Try to align the keybindings. + (let ((colwidth (min 30 (- (/ (window-width) 2) 10)))) + (setq str + (concat str + (make-string (max 2 (- colwidth + (string-width str) + (string-width binding))) + ?\s) + binding))))))) (and km (stringp km) (setq str km)) ;; Verify that the command is enabled; ;; if not, don't mention it.