From aa7aaf8f0bf845b57961dff1b702098e50cb16ee Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 9 Jul 2012 09:54:50 -0400 Subject: [PATCH 1/4] * lisp/progmodes/sh-script.el (sh-syntax-propertize-function): Fix last change. Fixes: debbugs:11826 --- lisp/ChangeLog | 9 +++++++-- lisp/progmodes/sh-script.el | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e5f4bb8f770..1faebf5b083 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-07-09 Stefan Monnier + + * progmodes/sh-script.el (sh-syntax-propertize-function): Fix last + change (bug#11826). + 2012-07-02 Glenn Morris * simple.el (kill-whole-line): Doc tweak. @@ -11,8 +16,8 @@ 2012-06-28 Andreas Schwab - * calendar/cal-dst.el (calendar-current-time-zone): Return - calendar-current-time-zone-cache if non-nil. + * calendar/cal-dst.el (calendar-current-time-zone): + Return calendar-current-time-zone-cache if non-nil. 2012-06-25 Masatake YAMATO diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 48b19524b8c..7d38df6aff6 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1105,12 +1105,12 @@ subshells can nest." (")" (0 (sh-font-lock-paren (match-beginning 0)))) ;; Highlight (possibly nested) subshells inside "" quoted ;; regions correctly. - ("\"\\(?:\\(?:[^\\\"]\\|\\)*?[^\\]\\(?:\\\\\\\\\\)*\\)??\\(\\$(\\|`\\)" + ("\"\\(?:\\(?:[^\\\"]\\|\\\\.\\)*?\\)??\\(\\$(\\|`\\)" (1 (ignore - ;; Save excursion because we want to also apply other - ;; syntax-propertize rules within the affected region. - (if (nth 8 (syntax-ppss)) + (if (nth 8 (save-excursion (syntax-ppss (match-beginning 0)))) (goto-char (1+ (match-beginning 0))) + ;; Save excursion because we want to also apply other + ;; syntax-propertize rules within the affected region. (save-excursion (sh-font-lock-quoted-subshell end))))))) (point) end)) From 9598ddae26dfdd5bbdb2aa901ef889ce1723a0e3 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Tue, 10 Jul 2012 11:42:48 +0200 Subject: [PATCH 2/4] * shr.el (shr-expand-url): Handle URL starting with `//'. --- lisp/gnus/ChangeLog | 4 ++++ lisp/gnus/shr.el | 3 +++ 2 files changed, 7 insertions(+) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 9c406f75bf3..4ddf8b04e91 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2012-07-10 Andreas Schwab + + * shr.el (shr-expand-url): Handle URL starting with `//'. + 2012-06-10 Toke Høiland-Jørgensen (tiny change) * nnmaildir.el (nnmaildir-request-expire-articles): Ensure that `time' diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index 42118298734..0d9b052f425 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -445,6 +445,9 @@ the URL of the image to the kill buffer instead." (string-match "\\`[a-z]*:" url) (not shr-base)) url) + ((and (string-match "\\`//" url) + (string-match "\\`[a-z]*:" shr-base)) + (concat (match-string 0 shr-base) url)) ((and (not (string-match "/\\'" shr-base)) (not (string-match "\\`/" url))) (concat shr-base "/" url)) From 8a05d57a7d691085200b64f5e56a6232e78c6ac4 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 12 Jul 2012 09:12:24 +0200 Subject: [PATCH 3/4] Fixes: debbugs:11917 Fix crash when creating indirect buffer * buffer.c (buffer_lisp_local_variables): Add argument CLONE. Don't handle unbound variables specially if non-zero. (Fbuffer_local_variables): Pass zero. (clone_per_buffer_values): Pass non-zero. --- src/ChangeLog | 8 ++++++++ src/buffer.c | 14 ++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index ea44367e2bd..7274fc4e4d8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-07-12 Andreas Schwab + + Fix crash when creating indirect buffer (Bug#11917) + * buffer.c (buffer_lisp_local_variables): Add argument CLONE. + Don't handle unbound variables specially if non-zero. + (Fbuffer_local_variables): Pass zero. + (clone_per_buffer_values): Pass non-zero. + 2012-06-28 Andreas Schwab * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT diff --git a/src/buffer.c b/src/buffer.c index ac14ec9c37c..88ef34070ea 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -156,7 +156,7 @@ static void alloc_buffer_text (struct buffer *, ptrdiff_t); static void free_buffer_text (struct buffer *b); static struct Lisp_Overlay * copy_overlays (struct buffer *, struct Lisp_Overlay *); static void modify_overlay (struct buffer *, EMACS_INT, EMACS_INT); -static Lisp_Object buffer_lisp_local_variables (struct buffer *); +static Lisp_Object buffer_lisp_local_variables (struct buffer *, int); /* For debugging; temporary. See set_buffer_internal. */ /* Lisp_Object Qlisp_mode, Vcheck_symbol; */ @@ -505,7 +505,7 @@ clone_per_buffer_values (struct buffer *from, struct buffer *to) /* Get (a copy of) the alist of Lisp-level local variables of FROM and install that in TO. */ - BVAR (to, local_var_alist) = buffer_lisp_local_variables (from); + BVAR (to, local_var_alist) = buffer_lisp_local_variables (from, 1); } @@ -1003,10 +1003,12 @@ is the default binding of the variable. */) /* Return an alist of the Lisp-level buffer-local bindings of buffer BUF. That is, don't include the variables maintained - in special slots in the buffer object. */ + in special slots in the buffer object. + If CLONE is zero elements of the form (VAR . unbound) are replaced + by VAR. */ static Lisp_Object -buffer_lisp_local_variables (struct buffer *buf) +buffer_lisp_local_variables (struct buffer *buf, int clone) { Lisp_Object result = Qnil; register Lisp_Object tail; @@ -1026,7 +1028,7 @@ buffer_lisp_local_variables (struct buffer *buf) if (buf != current_buffer) val = XCDR (elt); - result = Fcons (EQ (val, Qunbound) + result = Fcons (!clone && EQ (val, Qunbound) ? XCAR (elt) : Fcons (XCAR (elt), val), result); @@ -1055,7 +1057,7 @@ No argument or nil as argument means use current buffer as BUFFER. */) buf = XBUFFER (buffer); } - result = buffer_lisp_local_variables (buf); + result = buffer_lisp_local_variables (buf, 0); /* Add on all the variables stored in special slots. */ { From fbf31a9c2c08c86a7ab490cb7b920245b829a61d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 14 Jul 2012 13:46:56 +0300 Subject: [PATCH 4/4] Don't use FILE_SYSTEM_CASE in MS-DOS, or anywhere else. src/s/msdos.h (FILE_SYSTEM_CASE): Don't define. src/fileio.c (FILE_SYSTEM_CASE): Don't define. (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE. Fixes problems on MS-DOS with Vtemp_file_name_pattern when call-process-region passes it through expand-file-name. src/dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE. admin/CPP-DEFINES: Remove FILE_SYSTEM_CASE. --- admin/CPP-DEFINES | 1 - admin/ChangeLog | 4 ++++ src/ChangeLog | 12 ++++++++++++ src/dired.c | 3 --- src/fileio.c | 6 ------ src/s/msdos.h | 4 ---- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES index c5f8c7ab31f..c084a94188d 100644 --- a/admin/CPP-DEFINES +++ b/admin/CPP-DEFINES @@ -101,7 +101,6 @@ EMACS_CONFIGURATION EMACS_CONFIG_OPTIONS EMACS_INT EMACS_UINT -FILE_SYSTEM_CASE FLOAT_CHECK_DOMAIN GC_LISP_OBJECT_ALIGNMENT GC_MARK_SECONDARY_STACK diff --git a/admin/ChangeLog b/admin/ChangeLog index ca4d85e4e29..75079a335c9 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2012-07-14 Eli Zaretskii + + * CPP-DEFINES: Remove FILE_SYSTEM_CASE. + 2012-06-01 Chong Yidong * Version 24.1 released. diff --git a/src/ChangeLog b/src/ChangeLog index 7274fc4e4d8..716ebbadab6 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2012-07-14 Eli Zaretskii + + Remove FILE_SYSTEM_CASE. + * s/msdos.h (FILE_SYSTEM_CASE): Don't define. + + * fileio.c (FILE_SYSTEM_CASE): Don't define. + (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE. + Fixes problems on MS-DOS with Vtemp_file_name_pattern when + call-process-region passes it through expand-file-name. + + * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE. + 2012-07-12 Andreas Schwab Fix crash when creating indirect buffer (Bug#11917) diff --git a/src/dired.c b/src/dired.c index 9b0f94a0760..8665fd0dc6d 100644 --- a/src/dired.c +++ b/src/dired.c @@ -470,9 +470,6 @@ file_name_completion (Lisp_Object file, Lisp_Object dirname, int all_flag, int v CHECK_STRING (file); -#ifdef FILE_SYSTEM_CASE - file = FILE_SYSTEM_CASE (file); -#endif bestmatch = Qnil; encoded_file = encoded_dir = Qnil; GCPRO5 (file, dirname, bestmatch, encoded_file, encoded_dir); diff --git a/src/fileio.c b/src/fileio.c index 0d1a87b65b7..3b8ed143005 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -83,10 +83,6 @@ along with GNU Emacs. If not, see . */ #include "commands.h" -#ifndef FILE_SYSTEM_CASE -#define FILE_SYSTEM_CASE(filename) (filename) -#endif - /* Nonzero during writing of auto-save files */ static int auto_saving; @@ -334,7 +330,6 @@ Given a Unix syntax file name, returns a string ending in slash. */) return STRINGP (handled_name) ? handled_name : Qnil; } - filename = FILE_SYSTEM_CASE (filename); #ifdef DOS_NT beg = (char *) alloca (SBYTES (filename) + 1); memcpy (beg, SSDATA (filename), SBYTES (filename) + 1); @@ -864,7 +859,6 @@ filesystem tree, not (expand-file-name ".." dirname). */) UNGCPRO; } } - name = FILE_SYSTEM_CASE (name); multibyte = STRING_MULTIBYTE (name); if (multibyte != STRING_MULTIBYTE (default_directory)) { diff --git a/src/s/msdos.h b/src/s/msdos.h index cde24147c57..d2058f2e425 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h @@ -94,10 +94,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ :se=:so=:us=
    :ue=
:md=:mh=:mb=:mr=:me=:\ :AB=:AF=:op=:" -/* Define this to a function (Fdowncase, Fupcase) if your file system - likes that. */ -#define FILE_SYSTEM_CASE Fmsdos_downcase_filename - /* Define this to be the separator between devices and paths. */ #define DEVICE_SEP ':'