From ea08011c7eaee19a1defe5c9880a40842ab6d28a Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 26 Jan 2011 11:28:49 -0500 Subject: [PATCH 01/24] * src/font.c (font_parse_fcname): Fix typo in string length. --- src/ChangeLog | 4 ++++ src/font.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 0539b849efc..bbfd9592cf1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-01-26 Chong Yidong + + * font.c (font_parse_fcname): Fix typo in string length. + 2011-01-24 Stefan Monnier * xdisp.c (handle_fontified_prop): Be careful with font-lock changing diff --git a/src/font.c b/src/font.c index c08477821ed..96c043626f2 100644 --- a/src/font.c +++ b/src/font.c @@ -1603,7 +1603,7 @@ font_parse_fcname (name, font) else if (PROP_MATCH ("Italic", 6)) { prop_found = 1; - prop = font_intern_prop ("italic", 4, 1); + prop = font_intern_prop ("italic", 6, 1); FONT_SET_STYLE (font, FONT_SLANT_INDEX, prop); } else if (PROP_MATCH ("Oblique", 7)) From ca9c274ae72514a3b06b805456e656ff5ea7d58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 26 Jan 2011 19:05:13 +0100 Subject: [PATCH 02/24] * term/ns-win.el (ns-find-file): Expand ns-input-file with command-line-default-directory (Bug#7872). NOTE: The trunk version is a bit different, I think there will be merge conflicts. --- lisp/ChangeLog | 5 +++++ lisp/term/ns-win.el | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 70ebcca9c91..39fe96a5848 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-26 Roy Liu (tiny change) + + * term/ns-win.el (ns-find-file): Expand ns-input-file with + command-line-default-directory (Bug#7872). + 2011-01-25 Glenn Morris * comint.el (comint-mode): Doc fix. (Bug#7897) diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el index 0a4b4b15bfe..6880fdb8807 100644 --- a/lisp/term/ns-win.el +++ b/lisp/term/ns-win.el @@ -787,7 +787,8 @@ unless the current buffer is a scratch buffer." "Do a `find-file' with the `ns-input-file' as argument." (interactive) (let ((f) (file) (bufwin1) (bufwin2)) - (setq f (file-truename (car ns-input-file))) + (setq f (file-truename (expand-file-name (car ns-input-file) + command-line-default-directory))) (setq ns-input-file (cdr ns-input-file)) (setq file (find-file-noselect f)) (setq bufwin1 (get-buffer-window file 'visible)) From 37d1c45d60c946768ff107bc68141e063dbe80be Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 26 Jan 2011 19:45:30 -0500 Subject: [PATCH 03/24] Fix GTK font name parsing to allow numbers in names (Bug#7853). A better fix is already in the trunk. * src/font.c (font_parse_fcname): Require GTK-style font sizes to occur at the end of the font string (Bug#7853). --- src/ChangeLog | 5 +++++ src/font.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index bbfd9592cf1..c74732b4210 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-01-27 Chong Yidong + + * font.c (font_parse_fcname): Require GTK-style font sizes to + occur at the end of the font string (Bug#7853). + 2011-01-26 Chong Yidong * font.c (font_parse_fcname): Fix typo in string length. diff --git a/src/font.c b/src/font.c index 96c043626f2..ebf0b547b9f 100644 --- a/src/font.c +++ b/src/font.c @@ -1549,7 +1549,8 @@ font_parse_fcname (name, font) size_found = 0; break; } - if (size_found) + /* GTK font sizes must occur at the end. */ + if (size_found && *q == '\0') { double point_size = strtod (p, &q); ASET (font, FONT_SIZE_INDEX, make_float (point_size)); From af7c5700cad96fd6f11d1d79c59ed65793813f50 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Wed, 26 Jan 2011 19:51:41 -0500 Subject: [PATCH 04/24] Limit recursion depth of c-forward-<>-arglist-recur (Bug#7722). * progmodes/cc-engine.el (c-forward-<>-arglist-recur): Set a limit to the recursion depth. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/cc-engine.el | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39fe96a5848..41db2b5ea79 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-27 Chong Yidong + + * progmodes/cc-engine.el (c-forward-<>-arglist-recur): Set a limit + to the recursion depth (Bug#7722). + 2011-01-26 Roy Liu (tiny change) * term/ns-win.el (ns-find-file): Expand ns-input-file with diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el index 5fd418d1def..f96cd1b5c93 100644 --- a/lisp/progmodes/cc-engine.el +++ b/lisp/progmodes/cc-engine.el @@ -4393,6 +4393,8 @@ comment at the start of cc-engine.el for more info." (goto-char safe-pos) t))) +(defvar c-forward-<>-arglist-recur-depth) + (defun c-forward-<>-arglist (all-types) ;; The point is assumed to be at a "<". Try to treat it as the open ;; paren of an angle bracket arglist and move forward to the @@ -4418,7 +4420,8 @@ comment at the start of cc-engine.el for more info." ;; If `c-record-type-identifiers' is set then activate ;; recording of any found types that constitute an argument in ;; the arglist. - (c-record-found-types (if c-record-type-identifiers t))) + (c-record-found-types (if c-record-type-identifiers t)) + (c-forward-<>-arglist-recur--depth 0)) (if (catch 'angle-bracket-arglist-escape (setq c-record-found-types (c-forward-<>-arglist-recur all-types))) @@ -4434,6 +4437,14 @@ comment at the start of cc-engine.el for more info." nil))) (defun c-forward-<>-arglist-recur (all-types) + + ;; Temporary workaround for Bug#7722. + (when (boundp 'c-forward-<>-arglist-recur--depth) + (if (> c-forward-<>-arglist-recur--depth 200) + (error "Max recursion depth reached in <> arglist") + (setq c-forward-<>-arglist-recur--depth + (1+ c-forward-<>-arglist-recur--depth)))) + ;; Recursive part of `c-forward-<>-arglist'. ;; ;; This function might do hidden buffer changes. From 220c2a148456b2e7f7a900f76530a3ef742e426e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 26 Jan 2011 23:48:23 -0800 Subject: [PATCH 05/24] msb.el fix for bug #7902. * lisp/msb.el (msb-menu-bar-update-buffers): Update for changed argument handling of menu-bar-select-frame. --- lisp/ChangeLog | 7 ++++++- lisp/msb.el | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41db2b5ea79..aa5158fbda5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,9 +1,14 @@ +2011-01-27 Glenn Morris + + * msb.el (msb-menu-bar-update-buffers): Update for changed + argument handling of menu-bar-select-frame. (Bug#7902) + 2011-01-27 Chong Yidong * progmodes/cc-engine.el (c-forward-<>-arglist-recur): Set a limit to the recursion depth (Bug#7722). -2011-01-26 Roy Liu (tiny change) +2011-01-26 Roy Liu (tiny change) * term/ns-win.el (ns-find-file): Expand ns-input-file with command-line-default-directory (Bug#7872). diff --git a/lisp/msb.el b/lisp/msb.el index 0e7a20fd33a..0517d8a5478 100644 --- a/lisp/msb.el +++ b/lisp/msb.el @@ -1112,7 +1112,8 @@ variable `msb-menu-cond'." (list (frame-parameter frame 'name) (frame-parameter frame 'name) (cons nil nil)) - 'menu-bar-select-frame)) + `(lambda () + (interactive) (menu-bar-select-frame ,frame)))) frames))))) (setcdr global-buffers-menu-map (if (and buffers-menu frames-menu) From 37f7b7843a02ea9f930bc163d61aca2fec413d08 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Thu, 27 Jan 2011 15:49:48 -0500 Subject: [PATCH 06/24] * configure.in: Test existence of xaw3d library, not just the header (Bug#7642). * configure: Regenerate. --- ChangeLog | 5 +++++ configure | 41 +++++++++++++++++++++++++++++++++++++++++ configure.in | 3 ++- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71ac292bbde..6a57a517820 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-01-27 Chong Yidong + + * configure.in: Test existence of xaw3d library, not just the + header (Bug#7642). + 2011-01-23 Peter O'Gorman (tiny change) * configure.in: Add HP-UX on IA64 (Bug#6811). diff --git a/configure b/configure index 66c9737a43a..dd69fde936f 100755 --- a/configure +++ b/configure @@ -8626,10 +8626,51 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XawScrollbarSetThumb in -lXaw3d" >&5 +$as_echo_n "checking for XawScrollbarSetThumb in -lXaw3d... " >&6; } +if test "${ac_cv_lib_Xaw3d_XawScrollbarSetThumb+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXaw3d $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char XawScrollbarSetThumb (); +int +main () +{ +return XawScrollbarSetThumb (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_Xaw3d_XawScrollbarSetThumb=yes +else + ac_cv_lib_Xaw3d_XawScrollbarSetThumb=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&5 +$as_echo "$ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&6; } +if test "x$ac_cv_lib_Xaw3d_XawScrollbarSetThumb" = x""yes; then : emacs_cv_xaw3d=yes else emacs_cv_xaw3d=no fi + +else + emacs_cv_xaw3d=no +fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi diff --git a/configure.in b/configure.in index fd1c62ccb7d..dce2a6271c4 100644 --- a/configure.in +++ b/configure.in @@ -1796,7 +1796,8 @@ if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then #include #include ], [], - emacs_cv_xaw3d=yes, + [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, + emacs_cv_xaw3d=yes, emacs_cv_xaw3d=no)], emacs_cv_xaw3d=no)]) else emacs_cv_xaw3d=no From 6744273893b280b21a279227516aebf269b20a4e Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Fri, 28 Jan 2011 13:41:20 +0900 Subject: [PATCH 07/24] (quail-keyboard-layout-alist): Remove superfluous SPC for "pc105-uk" (bug#7927). --- lisp/ChangeLog | 5 +++++ lisp/international/quail.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa5158fbda5..c4450a4eea6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-28 Kenichi Handa + + * international/quail.el (quail-keyboard-layout-alist): Remove + superfluous SPC for "pc105-uk" (bug#7927). + 2011-01-27 Glenn Morris * msb.el (msb-menu-bar-update-buffers): Update for changed diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 0d6ed0028ae..c1cd8fd6e45 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -663,7 +663,7 @@ This layout is almost the same as that of VT100, ") '("pc105-uk" . "\ \ -`\2541!2\"3\2434$5%6^7&8*9(0)-_=+ \ +`\2541!2\"3\2434$5%6^7&8*9(0)-_=+ \ qQwWeErRtTyYuUiIoOpP[{]} \ aAsSdDfFgGhHjJkKlL;:'@#~ \ \\|zZxXcCvVbBnNmM,<.>/? \ From 2ff1f755a23644453a14bb3847a3cde800da61f1 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 12:03:19 -0500 Subject: [PATCH 08/24] * lib-src/ntlib.c (setregid): New stub, renamed from setegid. * lib-src/ntlib.h: Update prototype. --- lib-src/ChangeLog | 6 ++++++ lib-src/ntlib.c | 2 +- lib-src/ntlib.h | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index aa5ae5ba7e6..e03ac55bfea 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,9 @@ +2011-01-28 Chong Yidong + + * ntlib.c (setregid): New stub, renamed from setegid. + + * ntlib.h: Update prototype. + 2011-01-23 Chong Yidong * movemail.c (main): Use setregid instead of setegid, which is diff --git a/lib-src/ntlib.c b/lib-src/ntlib.c index b87475f1c63..4e3b4bad893 100644 --- a/lib-src/ntlib.c +++ b/lib-src/ntlib.c @@ -144,7 +144,7 @@ setuid (unsigned uid) } int -setegid (unsigned gid) +setregid (unsigned rgid, unsigned gid) { return 0; } diff --git a/lib-src/ntlib.h b/lib-src/ntlib.h index adc04e9935b..aee4033ec29 100644 --- a/lib-src/ntlib.h +++ b/lib-src/ntlib.h @@ -39,7 +39,7 @@ unsigned getuid (); unsigned getegid (); unsigned getgid (); int setuid (unsigned uid); -int setegid (unsigned gid); +int setregid (unsigned rgid, unsigned gid); char * getpass (const char * prompt); int fchown (int fd, unsigned uid, unsigned gid); From 46b3f2bedc620f3cec2dd3e5fab9df3e30d70c2e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 12:07:12 -0500 Subject: [PATCH 09/24] * m/intel386.h: Define NO_ARG_ARRAY. Suggested by Dan Nicolaescu. --- src/ChangeLog | 4 ++++ src/m/intel386.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index c74732b4210..a6e8d04d7c0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-01-28 Chong Yidong + + * m/intel386.h: Define NO_ARG_ARRAY. Suggested by Dan Nicolaescu. + 2011-01-27 Chong Yidong * font.c (font_parse_fcname): Require GTK-style font sizes to diff --git a/src/m/intel386.h b/src/m/intel386.h index cf8d90d33eb..2909a7663bd 100644 --- a/src/m/intel386.h +++ b/src/m/intel386.h @@ -42,7 +42,7 @@ NOTE-END */ /* Define NO_ARG_ARRAY if you cannot take the address of the first of a * group of arguments and treat it as an array of the arguments. */ -/* #define NO_ARG_ARRAY */ +#define NO_ARG_ARRAY /* crt0.c, if it is used, should use the i386-bsd style of entry. with no extra dummy args. On USG and XENIX, From d1f14baa30f7e2898bbfc7ea68fe93020b69a901 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 12:18:54 -0500 Subject: [PATCH 10/24] * mouse.el (mouse-menu-non-singleton): Doc fix (Bug#7801). --- lisp/ChangeLog | 4 ++++ lisp/mouse.el | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c4450a4eea6..c35e3db23e6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-01-28 Chong Yidong + + * mouse.el (mouse-menu-non-singleton): Doc fix (Bug#7801). + 2011-01-28 Kenichi Handa * international/quail.el (quail-keyboard-layout-alist): Remove diff --git a/lisp/mouse.el b/lisp/mouse.el index 2e02448e0fb..bed4776c135 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -198,9 +198,9 @@ items `Turn Off' and `Help'." newmap)) (defun mouse-menu-non-singleton (menubar) - "Given menu keymap, -if it defines exactly one submenu, return just that submenu. -Otherwise return the whole menu." + "Return menu keybar MENUBAR, or a lone submenu inside it. +If MENUBAR defines exactly one submenu, return just that submenu. +Otherwise, return MENUBAR." (if menubar (let (submap) (map-keymap From 19f81ecfdea5447a02ebb58d6fe28c4b1367ddae Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 12:29:30 -0500 Subject: [PATCH 11/24] Remove text on directory-abbrev-alist omitted in 2011-01-08 commit. * files.texi (File Aliases): Restore explanatory text from Eli Zaretskii, accidentally removed in 2011-01-08 commit. --- doc/emacs/ChangeLog | 5 +++++ doc/emacs/files.texi | 33 +++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 70cc9399a3f..4d4d38c2c5c 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,3 +1,8 @@ +2011-01-28 Chong Yidong + + * files.texi (File Aliases): Restore explanatory text from Eli + Zaretskii, accidentally removed in 2011-01-08 commit. + 2011-01-15 Chong Yidong * building.texi (Compilation): Improve instructions for running two diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index b16549450e4..b5e3bff6791 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi @@ -1182,26 +1182,23 @@ implies the effect of @code{find-file-existing-other-name}. @cindex directory name abbreviation @vindex directory-abbrev-alist Sometimes, a directory is ordinarily accessed through a symbolic -link, and you may want Emacs to preferentially display its ``linked'' -name instead of its truename. To do this, customize the variable -@code{directory-abbrev-alist}. Each element in this list should have -the form @code{(@var{from} . @var{to})}, which says to replace -@var{from} with @var{to} when it appears in a directory name. For -this feature to work properly, @var{from} and @var{to} should point to -the same file. The @var{from} string is actually a regular expression -(@pxref{Regexps}); it should always start with @samp{\`}, to avoid -matching to an incorrect part of the original directory name. The -@var{to} string should be an ordinary absolute directory name. Do not -use @samp{~} to stand for a home directory in the @var{to} string; -Emacs performs these substitutions separately. - - Here's an example, from a system on which file system -@file{/home/fsf} and so on are normally accessed through symbolic -links named @file{/fsf} and so on. +link, and you may want Emacs to preferentially show its ``linked'' +name. To do this, customize @code{directory-abbrev-alist}. Each +element in this list should have the form @code{(@var{from} +. @var{to})}, which means to replace @var{from} with @var{to} whenever +@var{from} appears in a directory name. The @var{from} string is a +regular expression (@pxref{Regexps}). It is matched against directory +names anchored at the first character, and should start with @samp{\`} +(to support directory names with embedded newlines, which would defeat +@samp{^}). The @var{to} string should be an ordinary absolute +directory name pointing to the same directory. Do not use @samp{~} to +stand for a home directory in the @var{to} string; Emacs performs +these substitutions separately. Here's an example, from a system on +which @file{/home/fsf} is normally accessed through a symbolic link +named @file{/fsf}: @example -(("\\`/home/fsf" . "/fsf") - ("\\`/home/gd" . "/gd")) +(("\\`/home/fsf" . "/fsf")) @end example @node Directories From 7427eb9754e8d22568b99621b5e8117dc2bde802 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 12:37:07 -0500 Subject: [PATCH 12/24] Add two cindex entries to Lisp manual (Bug#7805). * keymaps.texi (Defining Menus): Add "menu item" and "extended menu item" concept index entries. --- doc/lispref/ChangeLog | 5 +++++ doc/lispref/keymaps.texi | 2 ++ 2 files changed, 7 insertions(+) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 7e6e7b41813..e4cc70f79bd 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,8 @@ +2011-01-28 Chong Yidong + + * keymaps.texi (Defining Menus): Add "menu item" and "extended + menu item" concept index entries (Bug#7805). + 2011-01-23 Chong Yidong Richard Kim diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index b267320840a..1763f3936c9 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -1974,6 +1974,7 @@ feature. @cindex defining menus @cindex menu prompt string @cindex prompt string (of menu) +@cindex menu item A keymap acts as a menu if it has an @dfn{overall prompt string}, which is a string that appears as an element of the keymap. @@ -2090,6 +2091,7 @@ the item strings themselves, since that is redundant. @node Extended Menu Items @subsubsection Extended Menu Items @kindex menu-item +@cindex extended menu item An extended-format menu item is a more flexible and also cleaner alternative to the simple format. You define an event type with a From 65401ee3fefe38cb3a8a350a17f8b0a3a4ccb579 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 13:03:30 -0500 Subject: [PATCH 13/24] * search.texi (Regexps): Copyedits. Mention character classes (Bug#7809). --- doc/emacs/ChangeLog | 3 ++ doc/emacs/search.texi | 113 +++++++++++++++++++++--------------------- 2 files changed, 60 insertions(+), 56 deletions(-) diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 4d4d38c2c5c..f3c6afc3fa5 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,5 +1,8 @@ 2011-01-28 Chong Yidong + * search.texi (Regexps): Copyedits. Mention character classes + (Bug#7809). + * files.texi (File Aliases): Restore explanatory text from Eli Zaretskii, accidentally removed in 2011-01-08 commit. diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index cd63a562d66..e2ecb4a2385 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi @@ -546,21 +546,20 @@ Search}. @cindex syntax of regexps This manual describes regular expression features that users -typically want to use. There are additional features that are -mainly used in Lisp programs; see @ref{Regular Expressions,,, -elisp, The Emacs Lisp Reference Manual}. +typically use. @xref{Regular Expressions,,, elisp, The Emacs Lisp +Reference Manual}, for additional features used mainly in Lisp +programs. Regular expressions have a syntax in which a few characters are special constructs and the rest are @dfn{ordinary}. An ordinary -character is a simple regular expression which matches that same -character and nothing else. The special characters are @samp{$}, -@samp{^}, @samp{.}, @samp{*}, @samp{+}, @samp{?}, @samp{[}, and -@samp{\}. The character @samp{]} is special if it ends a character -alternative (see later). The character @samp{-} is special inside a -character alternative. Any other character appearing in a regular -expression is ordinary, unless a @samp{\} precedes it. (When you use -regular expressions in a Lisp program, each @samp{\} must be doubled, -see the example near the end of this section.) +character matches that same character and nothing else. The special +characters are @samp{$^.*+?[\}. The character @samp{]} is special if +it ends a character alternative (see later). The character @samp{-} +is special inside a character alternative. Any other character +appearing in a regular expression is ordinary, unless a @samp{\} +precedes it. (When you use regular expressions in a Lisp program, +each @samp{\} must be doubled, see the example near the end of this +section.) For example, @samp{f} is not a special character, so it is ordinary, and therefore @samp{f} is a regular expression that matches the string @@ -570,28 +569,27 @@ only @samp{o}. (When case distinctions are being ignored, these regexps also match @samp{F} and @samp{O}, but we consider this a generalization of ``the same string,'' rather than an exception.) - Any two regular expressions @var{a} and @var{b} can be concatenated. The -result is a regular expression which matches a string if @var{a} matches -some amount of the beginning of that string and @var{b} matches the rest of -the string.@refill - - As a simple example, we can concatenate the regular expressions @samp{f} -and @samp{o} to get the regular expression @samp{fo}, which matches only -the string @samp{fo}. Still trivial. To do something nontrivial, you -need to use one of the special characters. Here is a list of them. + Any two regular expressions @var{a} and @var{b} can be concatenated. +The result is a regular expression which matches a string if @var{a} +matches some amount of the beginning of that string and @var{b} +matches the rest of the string. For example, concatenating the +regular expressions @samp{f} and @samp{o} gives the regular expression +@samp{fo}, which matches only the string @samp{fo}. Still trivial. +To do something nontrivial, you need to use one of the special +characters. Here is a list of them. @table @asis @item @kbd{.}@: @r{(Period)} -is a special character that matches any single character except a newline. -Using concatenation, we can make regular expressions like @samp{a.b}, which -matches any three-character string that begins with @samp{a} and ends with -@samp{b}.@refill +is a special character that matches any single character except a +newline. For example, the regular expressions @samp{a.b} matches any +three-character string that begins with @samp{a} and ends with +@samp{b}. @item @kbd{*} is not a construct by itself; it is a postfix operator that means to -match the preceding regular expression repetitively as many times as -possible. Thus, @samp{o*} matches any number of @samp{o}s (including no -@samp{o}s). +match the preceding regular expression repetitively any number of +times, as many times as possible. Thus, @samp{o*} matches any number +of @samp{o}s, including no @samp{o}s. @samp{*} always applies to the @emph{smallest} possible preceding expression. Thus, @samp{fo*} has a repeating @samp{o}, not a repeating @@ -610,22 +608,21 @@ With this choice, the rest of the regexp matches successfully.@refill @item @kbd{+} is a postfix operator, similar to @samp{*} except that it must match -the preceding expression at least once. So, for example, @samp{ca+r} -matches the strings @samp{car} and @samp{caaaar} but not the string -@samp{cr}, whereas @samp{ca*r} matches all three strings. +the preceding expression at least once. Thus, @samp{ca+r} matches the +strings @samp{car} and @samp{caaaar} but not the string @samp{cr}, +whereas @samp{ca*r} matches all three strings. @item @kbd{?} -is a postfix operator, similar to @samp{*} except that it can match the -preceding expression either once or not at all. For example, -@samp{ca?r} matches @samp{car} or @samp{cr}; nothing else. +is a postfix operator, similar to @samp{*} except that it can match +the preceding expression either once or not at all. Thus, @samp{ca?r} +matches @samp{car} or @samp{cr}, and nothing else. @item @kbd{*?}, @kbd{+?}, @kbd{??} @cindex non-greedy regexp matching -are non-greedy variants of the operators above. The normal operators -@samp{*}, @samp{+}, @samp{?} are @dfn{greedy} in that they match as -much as they can, as long as the overall regexp can still match. With -a following @samp{?}, they are non-greedy: they will match as little -as possible. +are non-@dfn{greedy} variants of the operators above. The normal +operators @samp{*}, @samp{+}, @samp{?} match as much as they can, as +long as the overall regexp can still match. With a following +@samp{?}, they will match as little as possible. Thus, both @samp{ab*} and @samp{ab*?} can match the string @samp{a} and the string @samp{abbbb}; but if you try to match them both against @@ -641,29 +638,30 @@ a newline, it matches the whole string. Since it @emph{can} match starting at the first @samp{a}, it does. @item @kbd{\@{@var{n}\@}} -is a postfix operator that specifies repetition @var{n} times---that -is, the preceding regular expression must match exactly @var{n} times -in a row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} -and nothing else. +is a postfix operator specifying @var{n} repetitions---that is, the +preceding regular expression must match exactly @var{n} times in a +row. For example, @samp{x\@{4\@}} matches the string @samp{xxxx} and +nothing else. @item @kbd{\@{@var{n},@var{m}\@}} -is a postfix operator that specifies repetition between @var{n} and -@var{m} times---that is, the preceding regular expression must match -at least @var{n} times, but no more than @var{m} times. If @var{m} is +is a postfix operator specifying between @var{n} and @var{m} +repetitions---that is, the preceding regular expression must match at +least @var{n} times, but no more than @var{m} times. If @var{m} is omitted, then there is no upper limit, but the preceding regular expression must match at least @var{n} times.@* @samp{\@{0,1\@}} is equivalent to @samp{?}. @* @samp{\@{0,\@}} is equivalent to @samp{*}. @* @samp{\@{1,\@}} is equivalent to @samp{+}. @item @kbd{[ @dots{} ]} -is a @dfn{character set}, which begins with @samp{[} and is terminated -by @samp{]}. In the simplest case, the characters between the two -brackets are what this set can match. +is a @dfn{character set}, beginning with @samp{[} and terminated by +@samp{]}. -Thus, @samp{[ad]} matches either one @samp{a} or one @samp{d}, and -@samp{[ad]*} matches any string composed of just @samp{a}s and @samp{d}s -(including the empty string), from which it follows that @samp{c[ad]*r} -matches @samp{cr}, @samp{car}, @samp{cdr}, @samp{caddaar}, etc. +In the simplest case, the characters between the two brackets are what +this set can match. Thus, @samp{[ad]} matches either one @samp{a} or +one @samp{d}, and @samp{[ad]*} matches any string composed of just +@samp{a}s and @samp{d}s (including the empty string). It follows that +@samp{c[ad]*r} matches @samp{cr}, @samp{car}, @samp{cdr}, +@samp{caddaar}, etc. You can also include character ranges in a character set, by writing the starting and ending characters with a @samp{-} between them. Thus, @@ -672,9 +670,12 @@ intermixed freely with individual characters, as in @samp{[a-z$%.]}, which matches any lower-case @acronym{ASCII} letter or @samp{$}, @samp{%} or period. -Note that the usual regexp special characters are not special inside a -character set. A completely different set of special characters exists -inside character sets: @samp{]}, @samp{-} and @samp{^}. +You can also include certain special @dfn{character classes} in a +character set. A @samp{[:} and balancing @samp{:]} enclose a +character class inside a character alternative. For instance, +@samp{[[:alnum:]]} matches any letter or digit. @xref{Char Classes,,, +elisp, The Emacs Lisp Reference Manual}, for a list of character +classes. To include a @samp{]} in a character set, you must make it the first character. For example, @samp{[]a]} matches @samp{]} or @samp{a}. To From 6fc0aac3632372ac488ccdd269fdf86c53701f28 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 13:09:59 -0500 Subject: [PATCH 14/24] Fix gratuitous argument passing error in image-dired (Bug#7817). * lisp/image-dired.el (image-dired-mouse-display-image): No-op if no file is found. --- lisp/ChangeLog | 3 +++ lisp/image-dired.el | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c35e3db23e6..d71c51f5bde 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-01-28 Chong Yidong + * image-dired.el (image-dired-mouse-display-image): No-op if no + file is found (Bug#7817). + * mouse.el (mouse-menu-non-singleton): Doc fix (Bug#7801). 2011-01-28 Kenichi Handa diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 41fee0b0df2..489195837fc 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -2187,15 +2187,15 @@ matching tag will be marked in the dired buffer." Track this in associated dired buffer if `image-dired-track-movement' is non-nil." (interactive "e") - (let (file) - (mouse-set-point event) - (goto-char (posn-point (event-end event))) - (setq file (image-dired-original-file-name)) - (if image-dired-track-movement - (image-dired-track-original-file)) - (image-dired-create-display-image-buffer) - (display-buffer image-dired-display-image-buffer) - (image-dired-display-image file))) + (mouse-set-point event) + (goto-char (posn-point (event-end event))) + (let ((file (image-dired-original-file-name))) + (when file + (if image-dired-track-movement + (image-dired-track-original-file)) + (image-dired-create-display-image-buffer) + (display-buffer image-dired-display-image-buffer) + (image-dired-display-image file)))) (defun image-dired-mouse-select-thumbnail (event) "Use mouse EVENT to select thumbnail image. From 61db307fee9a511cb38cfaffbedbfbf163aa6256 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 28 Jan 2011 14:19:36 -0500 Subject: [PATCH 15/24] Shorten menu description of "Other Display Specs" lispref node (Bug#7816). * vol1.texi (Top): * vol2.texi (Top): * elisp.texi (Top): * display.texi (Display Property): Shorten the menu description of the "Other Display Specs" node. --- doc/lispref/ChangeLog | 6 ++++++ doc/lispref/display.texi | 5 ++--- doc/lispref/elisp.texi | 5 ++--- doc/lispref/vol1.texi | 5 ++--- doc/lispref/vol2.texi | 5 ++--- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index e4cc70f79bd..c651c5cab89 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,5 +1,11 @@ 2011-01-28 Chong Yidong + * vol1.texi (Top): + * vol2.texi (Top): + * elisp.texi (Top): + * display.texi (Display Property): Shorten the menu description of + the "Other Display Specs" node (Bug#7816). + * keymaps.texi (Defining Menus): Add "menu item" and "extended menu item" concept index entries (Bug#7805). diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 0a9fa30c599..8a884401546 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -3657,9 +3657,8 @@ display specifications and what they mean. * Replacing Specs:: Display specs that replace the text. * Specified Space:: Displaying one space with a specified width. * Pixel Specification:: Specifying space width or height in pixels. -* Other Display Specs:: Displaying an image; magnifying text; moving it - up or down on the page; adjusting the width - of spaces within text. +* Other Display Specs:: Displaying an image; adjusting the height, + spacing, and other properties of text. * Display Margins:: Displaying text or images to the side of the main text. @end menu diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 02cb2aeefc8..44161924188 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -1329,9 +1329,8 @@ The @code{display} Property * Replacing Specs:: Display specs that replace the text. * Specified Space:: Displaying one space with a specified width. * Pixel Specification:: Specifying space width or height in pixels. -* Other Display Specs:: Displaying an image; magnifying text; moving it - up or down on the page; adjusting the width - of spaces within text. +* Other Display Specs:: Displaying an image; adjusting the height, + spacing, and other properties of text. * Display Margins:: Displaying text or images to the side of the main text. diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi index 52c59d1e921..425e09fdc21 100644 --- a/doc/lispref/vol1.texi +++ b/doc/lispref/vol1.texi @@ -1350,9 +1350,8 @@ The @code{display} Property * Replacing Specs:: Display specs that replace the text. * Specified Space:: Displaying one space with a specified width. * Pixel Specification:: Specifying space width or height in pixels. -* Other Display Specs:: Displaying an image; magnifying text; moving it - up or down on the page; adjusting the width - of spaces within text. +* Other Display Specs:: Displaying an image; adjusting the height, + spacing, and other properties of text. * Display Margins:: Displaying text or images to the side of the main text. diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi index 6a52860fc84..7d2f260c772 100644 --- a/doc/lispref/vol2.texi +++ b/doc/lispref/vol2.texi @@ -1349,9 +1349,8 @@ The @code{display} Property * Replacing Specs:: Display specs that replace the text. * Specified Space:: Displaying one space with a specified width. * Pixel Specification:: Specifying space width or height in pixels. -* Other Display Specs:: Displaying an image; magnifying text; moving it - up or down on the page; adjusting the width - of spaces within text. +* Other Display Specs:: Displaying an image; adjusting the height, + spacing, and other properties of text. * Display Margins:: Displaying text or images to the side of the main text. From e935c6a287abf3dc87e2bc79d9019460a689d4aa Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sat, 29 Jan 2011 10:44:40 +0100 Subject: [PATCH 16/24] Don't complain about duplicate leim-list files * lisp/emacs-lisp/shadow.el (load-path-shadows-find): Ignore leim-list files. --- lisp/ChangeLog | 5 +++++ lisp/emacs-lisp/shadow.el | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d71c51f5bde..ee4eae0e41b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-29 Andreas Schwab + + * emacs-lisp/shadow.el (load-path-shadows-find): Ignore leim-list + files. + 2011-01-28 Chong Yidong * image-dired.el (image-dired-mouse-display-image): No-op if no diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el index f5fe68e8e4d..61daa21fcfa 100644 --- a/lisp/emacs-lisp/shadow.el +++ b/lisp/emacs-lisp/shadow.el @@ -116,7 +116,7 @@ See the documentation for `list-load-path-shadows' for further information." ;; FILE now contains the current file name, with no suffix. (unless (or (member file files-seen-this-dir) ;; Ignore these files. - (member file '("subdirs"))) + (member file '("subdirs" "leim-list"))) ;; File has not been seen yet in this directory. ;; This test prevents us declaring that XXX.el shadows ;; XXX.elc (or vice-versa) when they are in the same directory. From 7f9c5df9660fc124e5d1399eaf4b3f5da94c71aa Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 29 Jan 2011 16:28:26 -0500 Subject: [PATCH 17/24] Fix png support to allow compiling with libpng-1.5 (Bug#7908). * image.c (fn_png_longjmp, fn_png_set_longjmp_fn): New png function definitions for compiling with libpng-1.5. (PNG_LONGJMP, PNG_JMPBUF): New macros for libpng-1.5. (my_png_error, png_load): Use them. Suggested by Thomas Klausner. --- src/ChangeLog | 8 ++++++++ src/image.c | 34 ++++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a6e8d04d7c0..1d14be1ab70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2011-01-29 Chong Yidong + + * image.c (fn_png_longjmp, fn_png_set_longjmp_fn): New png + function definitions for compiling with libpng-1.5. + (PNG_LONGJMP, PNG_JMPBUF): New macros for libpng-1.5. + (my_png_error, png_load): Use them. Suggested by Thomas Klausner + (Bug#7908). + 2011-01-28 Chong Yidong * m/intel386.h: Define NO_ARG_ARRAY. Suggested by Dan Nicolaescu. diff --git a/src/image.c b/src/image.c index 631c73a6008..cc8589f924a 100644 --- a/src/image.c +++ b/src/image.c @@ -5590,6 +5590,11 @@ DEF_IMGLIB_FN (png_read_image); DEF_IMGLIB_FN (png_read_end); DEF_IMGLIB_FN (png_error); +#if (PNG_LIBPNG_VER >= 10500) +DEF_IMGLIB_FN (png_longjmp); +DEF_IMGLIB_FN (png_set_longjmp_fn); +#endif /* libpng version >= 1.5 */ + static int init_png_functions (Lisp_Object libraries) { @@ -5620,6 +5625,12 @@ init_png_functions (Lisp_Object libraries) LOAD_IMGLIB_FN (library, png_read_image); LOAD_IMGLIB_FN (library, png_read_end); LOAD_IMGLIB_FN (library, png_error); + +#if (PNG_LIBPNG_VER >= 10500) + LOAD_IMGLIB_FN (library, png_longjmp); + LOAD_IMGLIB_FN (library, png_set_longjmp_fn); +#endif /* libpng version >= 1.5 */ + return 1; } #else @@ -5646,8 +5657,27 @@ init_png_functions (Lisp_Object libraries) #define fn_png_read_end png_read_end #define fn_png_error png_error +#if (PNG_LIBPNG_VER >= 10500) +#define fn_png_longjmp png_longjmp +#define fn_png_set_longjmp_fn png_set_longjmp_fn +#endif /* libpng version >= 1.5 */ + #endif /* HAVE_NTGUI */ + +#if (PNG_LIBPNG_VER < 10500) +#define PNG_LONGJMP(ptr) (longjmp (ptr->jmpbuf, 1)) +#define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) +#else +/* In libpng version 1.5, the jmpbuf member is hidden. + We need the extra cast for PNG_JMPBUF because, for Windows, + DEF_IMGLIB_FN defines the return value of fn_png_set_longjmp_fn to + be int (Bug#7908). */ +#define PNG_LONGJMP(ptr) (fn_png_longjmp (png_ptr, 1)) +#define PNG_JMPBUF(ptr) \ + (*(jmp_buf *)(fn_png_set_longjmp_fn((ptr), longjmp, sizeof (jmp_buf)))) +#endif + /* Error and warning handlers installed when the PNG library is initialized. */ @@ -5660,7 +5690,7 @@ my_png_error (png_ptr, msg) /* Avoid compiler warning about deprecated direct access to png_ptr's fields in libpng versions 1.4.x. */ image_error ("PNG error: %s", build_string (msg), Qnil); - longjmp (png_ptr->jmpbuf, 1); + PNG_LONGJMP (png_ptr); } @@ -5836,7 +5866,7 @@ png_load (f, img) /* Set error jump-back. We come back here when the PNG library detects an error. */ - if (setjmp (png_ptr->jmpbuf)) + if (setjmp (PNG_JMPBUF (png_ptr))) { error: if (png_ptr) From 82d84d3fc97ed20079b42bb2b2c319437a299ad9 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 29 Jan 2011 17:10:51 -0500 Subject: [PATCH 18/24] Fix bug in copy-directory copying into an existing directory. http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg01007.html * files.el (copy-directory): If destination is an existing directory, copy into a subdirectory there. --- lisp/ChangeLog | 5 +++++ lisp/files.el | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ee4eae0e41b..286f1eeae65 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-01-29 Chong Yidong + + * files.el (copy-directory): If destination is an existing + directory, copy into a subdirectory there. + 2011-01-29 Andreas Schwab * emacs-lisp/shadow.el (load-path-shadows-find): Ignore leim-list diff --git a/lisp/files.el b/lisp/files.el index ee77975e38b..46597426191 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4756,7 +4756,22 @@ this happens by default." ;; Compute target name. (setq directory (directory-file-name (expand-file-name directory)) newname (directory-file-name (expand-file-name newname))) - (if (not (file-directory-p newname)) (make-directory newname parents)) + + (if (not (file-directory-p newname)) + ;; If NEWNAME is not an existing directory, create it; that + ;; is where we will copy the files of DIRECTORY. + (make-directory newname parents) + ;; If NEWNAME is an existing directory, we will copy into + ;; NEWNAME/[DIRECTORY-BASENAME]. + (setq newname (expand-file-name + (file-name-nondirectory + (directory-file-name directory)) + newname)) + (if (and (file-exists-p newname) + (not (file-directory-p newname))) + (error "Cannot overwrite non-directory %s with a directory" + newname)) + (make-directory newname t)) ;; Copy recursively. (mapc From c2e79cb408e118b45ca4566f806d7fb81bb28a4e Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 29 Jan 2011 17:33:02 -0500 Subject: [PATCH 19/24] Fix macro definitions in last change to image.c --- src/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/image.c b/src/image.c index cc8589f924a..91b33c45507 100644 --- a/src/image.c +++ b/src/image.c @@ -5666,14 +5666,14 @@ init_png_functions (Lisp_Object libraries) #if (PNG_LIBPNG_VER < 10500) -#define PNG_LONGJMP(ptr) (longjmp (ptr->jmpbuf, 1)) +#define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) #define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) #else /* In libpng version 1.5, the jmpbuf member is hidden. We need the extra cast for PNG_JMPBUF because, for Windows, DEF_IMGLIB_FN defines the return value of fn_png_set_longjmp_fn to be int (Bug#7908). */ -#define PNG_LONGJMP(ptr) (fn_png_longjmp (png_ptr, 1)) +#define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1)) #define PNG_JMPBUF(ptr) \ (*(jmp_buf *)(fn_png_set_longjmp_fn((ptr), longjmp, sizeof (jmp_buf)))) #endif From df61c79005470fad666b3c3ae257eef1e06bd079 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Sun, 30 Jan 2011 00:56:33 +0100 Subject: [PATCH 20/24] Fix use of pointers to image library functions * src/image.c (DEF_IMGLIB_FN): Add parameter rettype, use it instead of int. All uses adjusted. (PNG_JMPBUF, png_load, jpeg_load, tiff_load, gif_load) (svg_load_image): Remove casts. --- src/ChangeLog | 7 ++ src/image.c | 193 ++++++++++++++++++++++++-------------------------- 2 files changed, 98 insertions(+), 102 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1d14be1ab70..af76f670e6c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-01-29 Andreas Schwab + + * image.c (DEF_IMGLIB_FN): Add parameter rettype, use it instead + of int. All uses adjusted. + (PNG_JMPBUF, png_load, jpeg_load, tiff_load, gif_load) + (svg_load_image): Remove casts. + 2011-01-29 Chong Yidong * image.c (fn_png_longjmp, fn_png_set_longjmp_fn): New png diff --git a/src/image.c b/src/image.c index 91b33c45507..b814b795fab 100644 --- a/src/image.c +++ b/src/image.c @@ -1977,7 +1977,7 @@ mark_image_cache (struct image_cache *c) #ifdef HAVE_NTGUI /* Macro for defining functions that will be loaded from image DLLs. */ -#define DEF_IMGLIB_FN(func) int (FAR CDECL *fn_##func)() +#define DEF_IMGLIB_FN(rettype, func) rettype (FAR CDECL *fn_##func)() /* Macro for loading those image functions from the library. */ #define LOAD_IMGLIB_FN(lib,func) { \ @@ -3387,10 +3387,10 @@ xpm_free_colors (dpy, cmap, pixels, npixels, closure) /* XPM library details. */ -DEF_IMGLIB_FN (XpmFreeAttributes); -DEF_IMGLIB_FN (XpmCreateImageFromBuffer); -DEF_IMGLIB_FN (XpmReadFileToImage); -DEF_IMGLIB_FN (XImageFree); +DEF_IMGLIB_FN (void, XpmFreeAttributes); +DEF_IMGLIB_FN (int, XpmCreateImageFromBuffer); +DEF_IMGLIB_FN (int, XpmReadFileToImage); +DEF_IMGLIB_FN (void, XImageFree); static int init_xpm_functions (Lisp_Object libraries) @@ -5568,31 +5568,31 @@ png_image_p (object) #ifdef HAVE_NTGUI /* PNG library details. */ -DEF_IMGLIB_FN (png_get_io_ptr); -DEF_IMGLIB_FN (png_sig_cmp); -DEF_IMGLIB_FN (png_create_read_struct); -DEF_IMGLIB_FN (png_create_info_struct); -DEF_IMGLIB_FN (png_destroy_read_struct); -DEF_IMGLIB_FN (png_set_read_fn); -DEF_IMGLIB_FN (png_set_sig_bytes); -DEF_IMGLIB_FN (png_read_info); -DEF_IMGLIB_FN (png_get_IHDR); -DEF_IMGLIB_FN (png_get_valid); -DEF_IMGLIB_FN (png_set_strip_16); -DEF_IMGLIB_FN (png_set_expand); -DEF_IMGLIB_FN (png_set_gray_to_rgb); -DEF_IMGLIB_FN (png_set_background); -DEF_IMGLIB_FN (png_get_bKGD); -DEF_IMGLIB_FN (png_read_update_info); -DEF_IMGLIB_FN (png_get_channels); -DEF_IMGLIB_FN (png_get_rowbytes); -DEF_IMGLIB_FN (png_read_image); -DEF_IMGLIB_FN (png_read_end); -DEF_IMGLIB_FN (png_error); +DEF_IMGLIB_FN (png_voidp, png_get_io_ptr); +DEF_IMGLIB_FN (int, png_sig_cmp); +DEF_IMGLIB_FN (png_structp, png_create_read_struct); +DEF_IMGLIB_FN (png_infop, png_create_info_struct); +DEF_IMGLIB_FN (void, png_destroy_read_struct); +DEF_IMGLIB_FN (void, png_set_read_fn); +DEF_IMGLIB_FN (void, png_set_sig_bytes); +DEF_IMGLIB_FN (void, png_read_info); +DEF_IMGLIB_FN (png_uint_32, png_get_IHDR); +DEF_IMGLIB_FN (png_uint_32, png_get_valid); +DEF_IMGLIB_FN (void, png_set_strip_16); +DEF_IMGLIB_FN (void, png_set_expand); +DEF_IMGLIB_FN (void, png_set_gray_to_rgb); +DEF_IMGLIB_FN (void, png_set_background); +DEF_IMGLIB_FN (png_uint_32, png_get_bKGD); +DEF_IMGLIB_FN (void, png_read_update_info); +DEF_IMGLIB_FN (png_byte, png_get_channels); +DEF_IMGLIB_FN (png_size_t, png_get_rowbytes); +DEF_IMGLIB_FN (void, png_read_image); +DEF_IMGLIB_FN (void, png_read_end); +DEF_IMGLIB_FN (void, png_error); #if (PNG_LIBPNG_VER >= 10500) -DEF_IMGLIB_FN (png_longjmp); -DEF_IMGLIB_FN (png_set_longjmp_fn); +DEF_IMGLIB_FN (void, png_longjmp); +DEF_IMGLIB_FN (jmp_buf *, png_set_longjmp_fn); #endif /* libpng version >= 1.5 */ static int @@ -5669,13 +5669,10 @@ init_png_functions (Lisp_Object libraries) #define PNG_LONGJMP(ptr) (longjmp ((ptr)->jmpbuf, 1)) #define PNG_JMPBUF(ptr) ((ptr)->jmpbuf) #else -/* In libpng version 1.5, the jmpbuf member is hidden. - We need the extra cast for PNG_JMPBUF because, for Windows, - DEF_IMGLIB_FN defines the return value of fn_png_set_longjmp_fn to - be int (Bug#7908). */ +/* In libpng version 1.5, the jmpbuf member is hidden. (Bug#7908) */ #define PNG_LONGJMP(ptr) (fn_png_longjmp ((ptr), 1)) #define PNG_JMPBUF(ptr) \ - (*(jmp_buf *)(fn_png_set_longjmp_fn((ptr), longjmp, sizeof (jmp_buf)))) + (*fn_png_set_longjmp_fn((ptr), longjmp, sizeof (jmp_buf))) #endif /* Error and warning handlers installed when the PNG library @@ -5832,11 +5829,10 @@ png_load (f, img) tbr.bytes += sizeof (sig); } - /* Initialize read and info structs for PNG lib. Casting return - value avoids a GCC warning on W32. */ - png_ptr = (png_structp)fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, - NULL, my_png_error, - my_png_warning); + /* Initialize read and info structs for PNG lib. */ + png_ptr = fn_png_create_read_struct (PNG_LIBPNG_VER_STRING, + NULL, my_png_error, + my_png_warning); if (!png_ptr) { if (fp) fclose (fp); @@ -5844,8 +5840,7 @@ png_load (f, img) return 0; } - /* Casting return value avoids a GCC warning on W32. */ - info_ptr = (png_infop)fn_png_create_info_struct (png_ptr); + info_ptr = fn_png_create_info_struct (png_ptr); if (!info_ptr) { fn_png_destroy_read_struct (&png_ptr, NULL, NULL); @@ -5854,8 +5849,7 @@ png_load (f, img) return 0; } - /* Casting return value avoids a GCC warning on W32. */ - end_info = (png_infop)fn_png_create_info_struct (png_ptr); + end_info = fn_png_create_info_struct (png_ptr); if (!end_info) { fn_png_destroy_read_struct (&png_ptr, &info_ptr, NULL); @@ -6222,14 +6216,14 @@ jpeg_image_p (object) #ifdef HAVE_NTGUI /* JPEG library details. */ -DEF_IMGLIB_FN (jpeg_CreateDecompress); -DEF_IMGLIB_FN (jpeg_start_decompress); -DEF_IMGLIB_FN (jpeg_finish_decompress); -DEF_IMGLIB_FN (jpeg_destroy_decompress); -DEF_IMGLIB_FN (jpeg_read_header); -DEF_IMGLIB_FN (jpeg_read_scanlines); -DEF_IMGLIB_FN (jpeg_std_error); -DEF_IMGLIB_FN (jpeg_resync_to_restart); +DEF_IMGLIB_FN (void, jpeg_CreateDecompress); +DEF_IMGLIB_FN (boolean, jpeg_start_decompress); +DEF_IMGLIB_FN (boolean, jpeg_finish_decompress); +DEF_IMGLIB_FN (void, jpeg_destroy_decompress); +DEF_IMGLIB_FN (int, jpeg_read_header); +DEF_IMGLIB_FN (JDIMENSION, jpeg_read_scanlines); +DEF_IMGLIB_FN (struct jpeg_error_mgr *, jpeg_std_error); +DEF_IMGLIB_FN (boolean, jpeg_resync_to_restart); static int init_jpeg_functions (Lisp_Object libraries) @@ -6547,9 +6541,8 @@ jpeg_load (f, img) } /* Customize libjpeg's error handling to call my_error_exit when an - error is detected. This function will perform a longjmp. - Casting return value avoids a GCC warning on W32. */ - cinfo.err = (struct jpeg_error_mgr *)fn_jpeg_std_error (&mgr.pub); + error is detected. This function will perform a longjmp. */ + cinfo.err = fn_jpeg_std_error (&mgr.pub); mgr.pub.error_exit = my_error_exit; if ((rc = setjmp (mgr.setjmp_buffer)) != 0) @@ -6777,14 +6770,14 @@ tiff_image_p (object) #ifdef HAVE_NTGUI /* TIFF library details. */ -DEF_IMGLIB_FN (TIFFSetErrorHandler); -DEF_IMGLIB_FN (TIFFSetWarningHandler); -DEF_IMGLIB_FN (TIFFOpen); -DEF_IMGLIB_FN (TIFFClientOpen); -DEF_IMGLIB_FN (TIFFGetField); -DEF_IMGLIB_FN (TIFFReadRGBAImage); -DEF_IMGLIB_FN (TIFFClose); -DEF_IMGLIB_FN (TIFFSetDirectory); +DEF_IMGLIB_FN (TIFFErrorHandler, TIFFSetErrorHandler); +DEF_IMGLIB_FN (TIFFErrorHandler, TIFFSetWarningHandler); +DEF_IMGLIB_FN (TIFF *, TIFFOpen); +DEF_IMGLIB_FN (TIFF *, TIFFClientOpen); +DEF_IMGLIB_FN (int, TIFFGetField); +DEF_IMGLIB_FN (int, TIFFReadRGBAImage); +DEF_IMGLIB_FN (void, TIFFClose); +DEF_IMGLIB_FN (int, TIFFSetDirectory); static int init_tiff_functions (Lisp_Object libraries) @@ -6994,9 +6987,8 @@ tiff_load (f, img) return 0; } - /* Try to open the image file. Casting return value avoids a - GCC warning on W32. */ - tiff = (TIFF *)fn_TIFFOpen (SDATA (file), "r"); + /* Try to open the image file. */ + tiff = fn_TIFFOpen (SDATA (file), "r"); if (tiff == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -7011,15 +7003,14 @@ tiff_load (f, img) memsrc.len = SBYTES (specified_data); memsrc.index = 0; - /* Casting return value avoids a GCC warning on W32. */ - tiff = (TIFF *)fn_TIFFClientOpen ("memory_source", "r", &memsrc, - (TIFFReadWriteProc) tiff_read_from_memory, - (TIFFReadWriteProc) tiff_write_from_memory, - tiff_seek_in_memory, - tiff_close_memory, - tiff_size_of_memory, - tiff_mmap_memory, - tiff_unmap_memory); + tiff = fn_TIFFClientOpen ("memory_source", "r", &memsrc, + (TIFFReadWriteProc) tiff_read_from_memory, + (TIFFReadWriteProc) tiff_write_from_memory, + tiff_seek_in_memory, + tiff_close_memory, + tiff_size_of_memory, + tiff_mmap_memory, + tiff_unmap_memory); if (!tiff) { @@ -7257,10 +7248,10 @@ gif_image_p (object) #ifdef HAVE_NTGUI /* GIF library details. */ -DEF_IMGLIB_FN (DGifCloseFile); -DEF_IMGLIB_FN (DGifSlurp); -DEF_IMGLIB_FN (DGifOpen); -DEF_IMGLIB_FN (DGifOpenFileName); +DEF_IMGLIB_FN (int, DGifCloseFile); +DEF_IMGLIB_FN (int, DGifSlurp); +DEF_IMGLIB_FN (GifFileType *, DGifOpen); +DEF_IMGLIB_FN (GifFileType *, DGifOpenFileName); static int init_gif_functions (Lisp_Object libraries) @@ -7358,9 +7349,8 @@ gif_load (f, img) return 0; } - /* Open the GIF file. Casting return value avoids a GCC warning - on W32. */ - gif = (GifFileType *)fn_DGifOpenFileName (SDATA (file)); + /* Open the GIF file. */ + gif = fn_DGifOpenFileName (SDATA (file)); if (gif == NULL) { image_error ("Cannot open `%s'", file, Qnil); @@ -7376,8 +7366,7 @@ gif_load (f, img) memsrc.len = SBYTES (specified_data); memsrc.index = 0; - /* Casting return value avoids a GCC warning on W32. */ - gif = (GifFileType *) fn_DGifOpen (&memsrc, gif_read_from_memory); + gif = fn_DGifOpen (&memsrc, gif_read_from_memory); if (!gif) { image_error ("Cannot open memory source `%s'", img->spec, Qnil); @@ -7674,25 +7663,25 @@ svg_image_p (object) #ifdef HAVE_NTGUI /* SVG library functions. */ -DEF_IMGLIB_FN (rsvg_handle_new); -DEF_IMGLIB_FN (rsvg_handle_get_dimensions); -DEF_IMGLIB_FN (rsvg_handle_write); -DEF_IMGLIB_FN (rsvg_handle_close); -DEF_IMGLIB_FN (rsvg_handle_get_pixbuf); -DEF_IMGLIB_FN (rsvg_handle_free); +DEF_IMGLIB_FN (RsvgHandle *, rsvg_handle_new); +DEF_IMGLIB_FN (void, rsvg_handle_get_dimensions); +DEF_IMGLIB_FN (gboolean, rsvg_handle_write); +DEF_IMGLIB_FN (gboolean, rsvg_handle_close); +DEF_IMGLIB_FN (GdkPixbuf *, rsvg_handle_get_pixbuf); +DEF_IMGLIB_FN (void, rsvg_handle_free); -DEF_IMGLIB_FN (gdk_pixbuf_get_width); -DEF_IMGLIB_FN (gdk_pixbuf_get_height); -DEF_IMGLIB_FN (gdk_pixbuf_get_pixels); -DEF_IMGLIB_FN (gdk_pixbuf_get_rowstride); -DEF_IMGLIB_FN (gdk_pixbuf_get_colorspace); -DEF_IMGLIB_FN (gdk_pixbuf_get_n_channels); -DEF_IMGLIB_FN (gdk_pixbuf_get_has_alpha); -DEF_IMGLIB_FN (gdk_pixbuf_get_bits_per_sample); +DEF_IMGLIB_FN (int, gdk_pixbuf_get_width); +DEF_IMGLIB_FN (int, gdk_pixbuf_get_height); +DEF_IMGLIB_FN (guchar *, gdk_pixbuf_get_pixels); +DEF_IMGLIB_FN (int, gdk_pixbuf_get_rowstride); +DEF_IMGLIB_FN (GdkColorspace, gdk_pixbuf_get_colorspace); +DEF_IMGLIB_FN (int, gdk_pixbuf_get_n_channels); +DEF_IMGLIB_FN (gboolean, gdk_pixbuf_get_has_alpha); +DEF_IMGLIB_FN (int, gdk_pixbuf_get_bits_per_sample); -DEF_IMGLIB_FN (g_type_init); -DEF_IMGLIB_FN (g_object_unref); -DEF_IMGLIB_FN (g_error_free); +DEF_IMGLIB_FN (void, g_type_init); +DEF_IMGLIB_FN (void, g_object_unref); +DEF_IMGLIB_FN (void, g_error_free); Lisp_Object Qgdk_pixbuf, Qglib, Qgobject; @@ -7846,7 +7835,7 @@ svg_load_image (f, img, contents, size) gnome type library functions. */ fn_g_type_init (); /* Make a handle to a new rsvg object. */ - rsvg_handle = (RsvgHandle *) fn_rsvg_handle_new (); + rsvg_handle = fn_rsvg_handle_new (); /* Parse the contents argument and fill in the rsvg_handle. */ fn_rsvg_handle_write (rsvg_handle, contents, size, &error); @@ -7866,14 +7855,14 @@ svg_load_image (f, img, contents, size) /* We can now get a valid pixel buffer from the svg file, if all went ok. */ - pixbuf = (GdkPixbuf *) fn_rsvg_handle_get_pixbuf (rsvg_handle); + pixbuf = fn_rsvg_handle_get_pixbuf (rsvg_handle); if (!pixbuf) goto rsvg_error; fn_g_object_unref (rsvg_handle); /* Extract some meta data from the svg handle. */ width = fn_gdk_pixbuf_get_width (pixbuf); height = fn_gdk_pixbuf_get_height (pixbuf); - pixels = (const guint8 *) fn_gdk_pixbuf_get_pixels (pixbuf); + pixels = fn_gdk_pixbuf_get_pixels (pixbuf); rowstride = fn_gdk_pixbuf_get_rowstride (pixbuf); /* Validate the svg meta data. */ From 6fa1f65165a76364fc4b808857f7bb06b014b0d6 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Mon, 31 Jan 2011 12:03:37 -0500 Subject: [PATCH 21/24] * lisp/files.el (copy-directory): Fix arguments to the recursive call. --- lisp/ChangeLog | 4 ++++ lisp/files.el | 32 +++++++++++++++----------------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 286f1eeae65..9cb406d431d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-01-31 Chong Yidong + + * files.el (copy-directory): Fix arguments to recursive call. + 2011-01-29 Chong Yidong * files.el (copy-directory): If destination is an existing diff --git a/lisp/files.el b/lisp/files.el index 46597426191..d896020b27b 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -4767,26 +4767,24 @@ this happens by default." (file-name-nondirectory (directory-file-name directory)) newname)) - (if (and (file-exists-p newname) - (not (file-directory-p newname))) - (error "Cannot overwrite non-directory %s with a directory" - newname)) + (and (file-exists-p newname) + (not (file-directory-p newname)) + (error "Cannot overwrite non-directory %s with a directory" + newname)) (make-directory newname t)) ;; Copy recursively. - (mapc - (lambda (file) - (let ((target (expand-file-name - (file-name-nondirectory file) newname)) - (attrs (file-attributes file))) - (cond ((file-directory-p file) - (copy-directory file target keep-time parents)) - ((stringp (car attrs)) ; Symbolic link - (make-symbolic-link (car attrs) target t)) - (t - (copy-file file target t keep-time))))) - ;; We do not want to copy "." and "..". - (directory-files directory 'full directory-files-no-dot-files-regexp)) + (dolist (file + ;; We do not want to copy "." and "..". + (directory-files directory 'full + directory-files-no-dot-files-regexp)) + (if (file-directory-p file) + (copy-directory file newname keep-time parents) + (let ((target (expand-file-name (file-name-nondirectory file) newname)) + (attrs (file-attributes file))) + (if (stringp (car attrs)) ; Symbolic link + (make-symbolic-link (car attrs) target t) + (copy-file file target t keep-time))))) ;; Set directory attributes. (set-file-modes newname (file-modes directory)) From 3e46acf717ce32ff667781e5226242f113dcdbef Mon Sep 17 00:00:00 2001 From: Antoine Levitt Date: Mon, 31 Jan 2011 14:16:19 -0500 Subject: [PATCH 22/24] Fix erasure of modeline by erc-track. http://lists.gnu.org/archive/html/emacs-devel/2010-08/msg00562.html * erc-track.el (track): Don't reset erc-modified-channels-object each time erc-track-mode is activated. --- lisp/erc/ChangeLog | 5 +++++ lisp/erc/erc-track.el | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 3326bf065a4..fb05e6f9d1f 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,8 @@ +2011-01-31 Antoine Levitt (tiny change) + + * erc-track.el (track): Don't reset erc-modified-channels-object + each time erc-track-mode is activated. + 2010-10-23 Julien Danjou * erc-backend.el (erc-server-JOIN): Set the correct target list on join. diff --git a/lisp/erc/erc-track.el b/lisp/erc/erc-track.el index f07d963cfd8..b78880e86b4 100644 --- a/lisp/erc/erc-track.el +++ b/lisp/erc/erc-track.el @@ -649,7 +649,6 @@ module, otherwise the keybindings will not do anything useful." (add-hook 'erc-send-completed-hook 'erc-user-is-active) (add-hook 'erc-server-001-functions 'erc-user-is-active)) (erc-track-add-to-mode-line erc-track-position-in-mode-line) - (setq erc-modified-channels-object (erc-modified-channels-object nil)) (erc-update-mode-line) (if (featurep 'xemacs) (defadvice switch-to-buffer (after erc-update (&rest args) activate) From 3b95603fb59f2445110e93b77b7470c3abf90913 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 31 Jan 2011 18:07:43 -0500 Subject: [PATCH 23/24] Fix an infloop in CC-mode (Bug#7595). * progmodes/cc-cmds.el (c-forward-over-illiterals): Continue parsing if we encounter a naked # (Bug#7595). (c-beginning-of-statement): Avoid loop in locating the beginning of a macro. --- lisp/ChangeLog | 7 +++++++ lisp/progmodes/cc-cmds.el | 33 +++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9cb406d431d..c8e7a3f27bf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2011-01-31 Alan Mackenzie + + * progmodes/cc-cmds.el (c-forward-over-illiterals): Continue + parsing if we encounter a naked # (Bug#7595). + (c-beginning-of-statement): Avoid loop in locating the beginning + of a macro. + 2011-01-31 Chong Yidong * files.el (copy-directory): Fix arguments to recursive call. diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index 241fb0cf04f..3f719aedb62 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -2458,13 +2458,15 @@ function does not require the declaration to contain a brace block." (goto-char last) (throw 'done '(nil . nil))) - ;; Stop if we encounter a preprocessor line. - ((and (not macro-end) + ;; Stop if we encounter a preprocessor line. Continue if we + ;; hit a naked # + ((and c-opt-cpp-prefix + (not macro-end) (eq (char-after) ?#) (= (point) (c-point 'boi))) - (goto-char last) - ;(throw 'done (cons (eq (point) here) 'macro-boundary))) ; Changed 2003/3/26 - (throw 'done '(t . macro-boundary))) + (if (= (point) here) ; Not a macro, therefore naked #. + (forward-char) + (throw 'done '(t . macro-boundary)))) ;; Stop after a ';', '}', or "};" ((looking-at ";\\|};?") @@ -2578,14 +2580,21 @@ be more \"DWIM:ey\"." (c-backward-syntactic-ws)) (or (bobp) (c-after-statement-terminator-p))))))) ;; Are we about to move backwards into or out of a - ;; preprocessor command? If so, locate it's beginning. + ;; preprocessor command? If so, locate its beginning. (when (eq (cdr res) 'macro-boundary) - (save-excursion - (beginning-of-line) - (setq macro-fence - (and (not (bobp)) - (progn (c-skip-ws-backward) (c-beginning-of-macro)) - (point))))) + (setq macro-fence + (save-excursion + (if macro-fence + (progn + (end-of-line) + (and (not (eobp)) + (progn (c-skip-ws-forward) + (c-beginning-of-macro)) + (progn (c-end-of-macro) + (point)))) + (and (not (eobp)) + (c-beginning-of-macro) + (progn (c-end-of-macro) (point))))))) ;; Are we about to move backwards into a literal? (when (memq (cdr res) '(macro-boundary literal)) (setq range (c-ascertain-preceding-literal))) From 113ef437f21c6ea1b65abe668feb86f1622a9f2e Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Mon, 31 Jan 2011 18:11:29 -0500 Subject: [PATCH 24/24] Backport Bug#7933 fix from trunk. * lisp/net/rcirc.el: Clean log filenames (Bug#7933). (rcirc-log-write): Use convert-standard-filename. (rcirc-log-filename-function): Documentation updates. --- lisp/ChangeLog | 6 ++++++ lisp/net/rcirc.el | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c8e7a3f27bf..ead0456a7b1 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2011-01-31 Deniz Dogan + + * net/rcirc.el: Clean log filenames (Bug#7933). + (rcirc-log-write): Use convert-standard-filename. + (rcirc-log-filename-function): Documentation updates. + 2011-01-31 Alan Mackenzie * progmodes/cc-cmds.el (c-forward-over-illiterals): Continue diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index b4f97466baa..818128142f8 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -1520,8 +1520,11 @@ return the filename, or nil if no logging is desired for this session. If the returned filename is absolute (`file-name-absolute-p' -returns true), then it is used as-is, otherwise the resulting -file is put into `rcirc-log-directory'." +returns t), then it is used as-is, otherwise the resulting file +is put into `rcirc-log-directory'. + +The filename is then cleaned using `convert-standard-filename' to +guarantee valid filenames for the current OS." :group 'rcirc :type 'function) @@ -1546,7 +1549,9 @@ file is put into `rcirc-log-directory'." Log data is written to `rcirc-log-directory', except for log-files with absolute names (see `rcirc-log-filename-function')." (dolist (cell rcirc-log-alist) - (let ((filename (expand-file-name (car cell) rcirc-log-directory)) + (let ((filename (convert-standard-filename + (expand-file-name (car cell) + rcirc-log-directory))) (coding-system-for-write 'utf-8)) (make-directory (file-name-directory filename) t) (with-temp-buffer