diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 613108fc015..fc83e157d18 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,20 @@ +2014-03-27 Dmitry Gutov + + * progmodes/ruby-mode.el (ruby-font-lock-keywords): Highlight + special globals with font-lock-builtin-face. (Bug#17057) + + * progmodes/ruby-mode.el (ruby-syntax-propertize-function): + Don't propertize `?' or `!' as symbol constituent when after + colon. (Bug#17097) + +2014-03-27 Juanma Barranquero + + * frameset.el (frameset--restore-frame): Remove workaround for bug#14795 + which is no longer needed and causes trouble in GTK builds (bug#17046). + + * emacs-lisp/package-x.el (package--archive-contents-from-url): + Use url-insert-file-contents; package-handle-response no longer exists. + 2014-03-26 Daniel Colascione * simple.el (process-menu-mode-map): New variable. diff --git a/lisp/emacs-lisp/package-x.el b/lisp/emacs-lisp/package-x.el index 6a6a62dc916..1d9d1a04668 100644 --- a/lisp/emacs-lisp/package-x.el +++ b/lisp/emacs-lisp/package-x.el @@ -114,18 +114,12 @@ inserted after its first occurrence in the file." (defun package--archive-contents-from-url (archive-url) "Parse archive-contents file at ARCHIVE-URL. Return the file contents, as a string, or nil if unsuccessful." - (ignore-errors - (when archive-url - (let* ((buffer (url-retrieve-synchronously - (concat archive-url "archive-contents")))) - (set-buffer buffer) - (package-handle-response) - (re-search-forward "^$" nil 'move) - (forward-char) - (delete-region (point-min) (point)) - (prog1 (package-read-from-string - (buffer-substring-no-properties (point-min) (point-max))) - (kill-buffer buffer)))))) + (when archive-url + (with-temp-buffer + (ignore-errors + (url-insert-file-contents (concat archive-url "archive-contents")) + (package-read-from-string + (buffer-substring-no-properties (point-min) (point-max))))))) (defun package--archive-contents-from-file () "Parse the archive-contents at `package-archive-upload-base'" diff --git a/lisp/frameset.el b/lisp/frameset.el index 2f1453f2a19..b943d47e7bf 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el @@ -950,15 +950,10 @@ PARAMETERS is the frame's parameter alist; WINDOW-STATE is its window state. For the meaning of FILTERS and FORCE-ONSCREEN, see `frameset-restore'. Internal use only." (let* ((fullscreen (cdr (assq 'fullscreen parameters))) - (lines (assq 'tool-bar-lines parameters)) (filtered-cfg (frameset-filter-params parameters filters nil)) (display (cdr (assq 'display filtered-cfg))) ;; post-filtering alt-cfg frame) - ;; This works around bug#14795 (or feature#14795, if not a bug :-) - (setq filtered-cfg (assq-delete-all 'tool-bar-lines filtered-cfg)) - (push '(tool-bar-lines . 0) filtered-cfg) - (when fullscreen ;; Currently Emacs has the limitation that it does not record the size ;; and position of a frame before maximizing it, so we cannot save & @@ -1009,8 +1004,7 @@ Internal use only." (not (eq (frame-parameter frame 'visibility) 'icon))) (frameset-move-onscreen frame force-onscreen)) - ;; Let's give the finishing touches (visibility, tool-bar, maximization). - (when lines (push lines alt-cfg)) + ;; Let's give the finishing touches (visibility, maximization). (when alt-cfg (modify-frame-parameters frame alt-cfg)) ;; Now restore window state. (window-state-put window-state (frame-root-window frame) 'safe) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 2b8f2fa6868..6c6cdd3427d 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1812,6 +1812,7 @@ It will be properly highlighted even when the call omits parens.") ("[!?]" (0 (unless (save-excursion (or (nth 8 (syntax-ppss (match-beginning 0))) + (eq (char-before) ?:) (let (parse-sexp-lookup-properties) (zerop (skip-syntax-backward "w_"))) (memq (preceding-char) '(?@ ?$)))) @@ -2108,13 +2109,28 @@ See `font-lock-syntax-table'.") 1 font-lock-variable-name-face) ;; Keywords that evaluate to certain values. ("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>" - (0 font-lock-variable-name-face)) + (0 font-lock-builtin-face)) ;; Symbols. ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" 2 font-lock-constant-face) - ;; Variables. - ("\\$[^a-zA-Z \n]" - 0 font-lock-variable-name-face) + ;; Special globals. + (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|" + (regexp-opt '("LOAD_PATH" "LOADED_FEATURES" "PROGRAM_NAME" + "ERROR_INFO" "ERROR_POSITION" + "FS" "FIELD_SEPARATOR" + "OFS" "OUTPUT_FIELD_SEPARATOR" + "RS" "INPUT_RECORD_SEPARATOR" + "ORS" "OUTPUT_RECORD_SEPARATOR" + "NR" "INPUT_LINE_NUMBER" + "LAST_READ_LINE" "DEFAULT_OUTPUT" "DEFAULT_INPUT" + "PID" "PROCESS_ID" "CHILD_STATUS" + "LAST_MATCH_INFO" "IGNORECASE" + "ARGV" "MATCH" "PREMATCH" "POSTMATCH" + "LAST_PAREN_MATCH" "stdin" "stdout" "stderr" + "DEBUG" "FILENAME" "VERBOSE" "SAFE" "CLASSPATH" + "JRUBY_VERSION" "JRUBY_REVISION" "ENV_JAVA")) + "\\_>\\)") + 0 font-lock-builtin-face) ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" 0 font-lock-variable-name-face) ;; Constants. diff --git a/src/ChangeLog b/src/ChangeLog index 10cc66aceed..eb5db45534f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,15 @@ +2014-03-27 YAMAMOTO Mitsuharu + + * w32term.c (x_draw_image_glyph_string): Fix computation of height + and width of image background when it is displayed with a 'box' + face. (Bug#17115) + +2014-03-27 Paul Eggert + + More backward-compatible fix to char-equal core dump (Bug#17011). + * editfns.c (Fchar_equal): In unibyte buffers, assume values in + range 128-255 are raw bytes. Suggested by Eli Zaretskii. + 2014-03-27 Juanma Barranquero * image.c (init_svg_functions): When loading SVG-related libraries, diff --git a/src/editfns.c b/src/editfns.c index 1986ee53d23..9c1fcb0b790 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4377,13 +4377,23 @@ Case is ignored if `case-fold-search' is non-nil in the current buffer. */) if (NILP (BVAR (current_buffer, case_fold_search))) return Qnil; - /* FIXME: When enable-multibyte-characters is nil, it's still possible - to manipulate multibyte chars, which means there is a bug for chars - in the range 128-255 as we can't tell whether they are eight-bit - bytes or Latin-1 chars. For now, assume the latter. See Bug#17011. - Also see casefiddle.c's casify_object, which has a similar problem. */ i1 = XFASTINT (c1); i2 = XFASTINT (c2); + + /* FIXME: It is possible to compare multibyte characters even when + the current buffer is unibyte. Unfortunately this is ambiguous + for characters between 128 and 255, as they could be either + eight-bit raw bytes or Latin-1 characters. Assume the former for + now. See Bug#17011, and also see casefiddle.c's casify_object, + which has a similar problem. */ + if (NILP (BVAR (current_buffer, enable_multibyte_characters))) + { + if (SINGLE_BYTE_CHAR_P (i1)) + i1 = UNIBYTE_TO_CHAR (i1); + if (SINGLE_BYTE_CHAR_P (i2)) + i2 = UNIBYTE_TO_CHAR (i2); + } + return (downcase (i1) == downcase (i2) ? Qt : Qnil); } diff --git a/src/w32term.c b/src/w32term.c index e8ec99e762d..256d7506a3a 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2085,10 +2085,14 @@ x_draw_image_glyph_string (struct glyph_string *s) int x, y; int box_line_hwidth = eabs (s->face->box_line_width); int box_line_vwidth = max (s->face->box_line_width, 0); - int height; + int height, width; HBITMAP pixmap = 0; - height = s->height - 2 * box_line_vwidth; + height = s->height; + if (s->slice.y == 0) + height -= box_line_vwidth; + if (s->slice.y + s->slice.height >= s->img->height) + height -= box_line_vwidth; /* Fill background with face under the image. Do it only if row is taller than image or if image has a clip mask to reduce @@ -2101,10 +2105,14 @@ x_draw_image_glyph_string (struct glyph_string *s) || s->img->pixmap == 0 || s->width != s->background_width) { + width = s->background_width; x = s->x; if (s->first_glyph->left_box_line_p && s->slice.x == 0) - x += box_line_hwidth; + { + x += box_line_hwidth; + width -= box_line_hwidth; + } y = s->y; if (s->slice.y == 0) @@ -2150,7 +2158,7 @@ x_draw_image_glyph_string (struct glyph_string *s) } else #endif - x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); + x_draw_glyph_string_bg_rect (s, x, y, width, height); s->background_filled_p = 1; } diff --git a/test/indent/ruby.rb b/test/indent/ruby.rb index 99482433145..fb341ee7ba6 100644 --- a/test/indent/ruby.rb +++ b/test/indent/ruby.rb @@ -148,6 +148,11 @@ if something == :== ) end +# Bug#17097 +if x == :!= + something +end + # Example from http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html d = 4 + 5 + # no '\' needed 6 + 7