------------------------------------------------------------ revno: 115542 committer: Leo Liu branch nick: trunk timestamp: Mon 2013-12-16 16:07:10 +0800 message: * progmodes/compile.el (compile-goto-error): Do not push-mark. Remove NOMSG arg and all uses changed. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-16 02:24:08 +0000 +++ lisp/ChangeLog 2013-12-16 08:07:10 +0000 @@ -1,3 +1,8 @@ +2013-12-16 Leo Liu + + * progmodes/compile.el (compile-goto-error): Do not push-mark. + Remove NOMSG arg and all uses changed. + 2013-12-16 Stefan Monnier * emulation/cua-rect.el (cua-rectangle-mark-mode): New minor mode. === modified file 'lisp/progmodes/compile.el' --- lisp/progmodes/compile.el 2013-12-06 15:34:06 +0000 +++ lisp/progmodes/compile.el 2013-12-16 08:07:10 +0000 @@ -1004,7 +1004,7 @@ (let ((win (get-buffer-window buffer 0))) (if win (set-window-point win pos))) (if compilation-auto-jump-to-first-error - (compile-goto-error nil t)))) + (compile-goto-error)))) ;; This function is the central driver, called when font-locking to gather ;; all information needed to later jump to corresponding source code. @@ -2325,9 +2325,9 @@ (defalias 'compile-mouse-goto-error 'compile-goto-error) -(defun compile-goto-error (&optional event nomsg) +(defun compile-goto-error (&optional event) "Visit the source for the error message at point. -Use this command in a compilation log buffer. Sets the mark at point there." +Use this command in a compilation log buffer." (interactive (list last-input-event)) (if event (posn-set-point (event-end event))) (or (compilation-buffer-p (current-buffer)) @@ -2336,7 +2336,6 @@ (if (get-text-property (point) 'compilation-directory) (dired-other-window (car (get-text-property (point) 'compilation-directory))) - (push-mark nil nomsg) (setq compilation-current-error (point)) (next-error-internal))) ------------------------------------------------------------ revno: 115541 committer: Dmitry Antipov branch nick: trunk timestamp: Mon 2013-12-16 11:45:33 +0400 message: * font.c (valid_font_driver) [ENABLE_CHECKING]: New function intended to find bogus pointers in font objects (Bug#16140). * font.h (valid_font_driver) [ENABLE_CHECKING]: Add prototype. * alloc.c (cleanup_vector): Use valid_font_driver in eassert. (compact_font_cache_entry, compact_font_caches) [!HAVE_NTGUI]: Disable for MS-Windows due to Bug#15876; apparently this requires more or less substantial changes in fontset code. * xfont.c (xfont_close): * xftfont.c (xftfont_close): Call x_display_info_for_display to check whether 'Display *' is valid (Bug#16093 and probably Bug#16069). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 20:39:36 +0000 +++ src/ChangeLog 2013-12-16 07:45:33 +0000 @@ -1,3 +1,17 @@ +2013-12-16 Dmitry Antipov + + * font.c (valid_font_driver) [ENABLE_CHECKING]: New function + intended to find bogus pointers in font objects (Bug#16140). + * font.h (valid_font_driver) [ENABLE_CHECKING]: Add prototype. + * alloc.c (cleanup_vector): Use valid_font_driver in eassert. + (compact_font_cache_entry, compact_font_caches) [!HAVE_NTGUI]: + Disable for MS-Windows due to Bug#15876; apparently this + requires more or less substantial changes in fontset code. + * xfont.c (xfont_close): + * xftfont.c (xftfont_close): Call x_display_info_for_display + to check whether 'Display *' is valid (Bug#16093 and probably + Bug#16069). + 2013-12-15 Eli Zaretskii * fileio.c (Fexpand_file_name) [WINDOWSNT]: Fix conditionals. === modified file 'src/alloc.c' --- src/alloc.c 2013-12-14 09:57:53 +0000 +++ src/alloc.c 2013-12-16 07:45:33 +0000 @@ -2877,7 +2877,11 @@ if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) == FONT_OBJECT_MAX)) - ((struct font *) vector)->driver->close ((struct font *) vector); + { + /* Attempt to catch subtle bugs like Bug#16140. */ + eassert (valid_font_driver (((struct font *) vector)->driver)); + ((struct font *) vector)->driver->close ((struct font *) vector); + } } /* Reclaim space used by unmarked vectors. */ @@ -5299,6 +5303,10 @@ #ifdef HAVE_WINDOW_SYSTEM +/* This code has a few issues on MS-Windows, see Bug#15876 and Bug#16140. */ + +#if !defined (HAVE_NTGUI) + /* Remove unmarked font-spec and font-entity objects from ENTRY, which is (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...), and return changed entry. */ @@ -5337,6 +5345,8 @@ return entry; } +#endif /* not HAVE_NTGUI */ + /* Compact font caches on all terminals and mark everything which is still here after compaction. */ @@ -5348,7 +5358,7 @@ for (t = terminal_list; t; t = t->next_terminal) { Lisp_Object cache = TERMINAL_FONT_CACHE (t); - +#if !defined (HAVE_NTGUI) if (CONSP (cache)) { Lisp_Object entry; @@ -5356,6 +5366,7 @@ for (entry = XCDR (cache); CONSP (entry); entry = XCDR (entry)) XSETCAR (entry, compact_font_cache_entry (XCAR (entry))); } +#endif /* not HAVE_NTGUI */ mark_object (cache); } } === modified file 'src/font.c' --- src/font.c 2013-12-13 15:55:23 +0000 +++ src/font.c 2013-12-16 07:45:33 +0000 @@ -148,7 +148,27 @@ here. */ static struct font_driver_list *font_driver_list; - +#ifdef ENABLE_CHECKING + +/* Used to catch bogus pointers in font objects. */ + +bool +valid_font_driver (struct font_driver *drv) +{ + Lisp_Object tail, frame; + struct font_driver_list *fdl; + + for (fdl = font_driver_list; fdl; fdl = fdl->next) + if (fdl->driver == drv) + return true; + FOR_EACH_FRAME (tail, frame) + for (fdl = XFRAME (frame)->font_driver_list; fdl; fdl = fdl->next) + if (fdl->driver == drv) + return true; + return false; +} + +#endif /* ENABLE_CHECKING */ /* Creators of font-related Lisp object. */ === modified file 'src/font.h' --- src/font.h 2013-12-14 21:36:44 +0000 +++ src/font.h 2013-12-16 07:45:33 +0000 @@ -787,6 +787,9 @@ char *name, int bytes); extern void register_font_driver (struct font_driver *driver, struct frame *f); extern void free_font_driver_list (struct frame *f); +#ifdef ENABLE_CHECKING +extern bool valid_font_driver (struct font_driver *); +#endif extern Lisp_Object font_update_drivers (struct frame *f, Lisp_Object list); extern Lisp_Object font_range (ptrdiff_t, ptrdiff_t, ptrdiff_t *, struct window *, struct face *, === modified file 'src/xfont.c' --- src/xfont.c 2013-12-13 15:55:23 +0000 +++ src/xfont.c 2013-12-16 07:45:33 +0000 @@ -894,7 +894,10 @@ { struct xfont_info *xfi = (struct xfont_info *) font; - if (xfi->xfont) + /* This function may be called from GC when X connection is gone + (Bug#16093), and an attempt to free font resourses on invalid + display may lead to X protocol errors or segfaults. */ + if (xfi->xfont && x_display_info_for_display (xfi->display)) { block_input (); XFreeFont (xfi->display, xfi->xfont); === modified file 'src/xftfont.c' --- src/xftfont.c 2013-12-13 15:55:23 +0000 +++ src/xftfont.c 2013-12-16 07:45:33 +0000 @@ -491,7 +491,9 @@ } #endif - if (xftfont_info->xftfont) + /* See comment in xfont_close. */ + if (xftfont_info->xftfont + && x_display_info_for_display (xftfont_info->display)) { block_input (); XftUnlockFace (xftfont_info->xftfont); ------------------------------------------------------------ revno: 115540 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2013-12-15 21:24:08 -0500 message: * lisp/emulation/cua-rect.el (cua-rectangle-mark-mode): New minor mode. (cua--deactivate-rectangle): Don't deactivate the mark. (cua-set-rectangle-mark): Don't set mark-active since cua--activate-rectangle already does it for us. (cua--rectangle-highlight-for-redisplay): Unhighlight a previous non-rectangular region. * lisp/emulation/cua-base.el (cua-repeat-replace-region): Use with-current-buffer. * lisp/net/gnutls.el: Use cl-lib. (gnutls-negotiate): `mapcan' -> cl-mapcan. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-12-13 21:41:35 +0000 +++ etc/NEWS 2013-12-16 02:24:08 +0000 @@ -254,11 +254,12 @@ * Changes in Specialized Modes and Packages in Emacs 24.4 ** CUA-mode -CUA-mode was changed to make use of delete-selection-mode and +*** CUA-mode was changed to make use of delete-selection-mode and shift-select-mode. So you can now enable it independently from transient-mark-mode, delete-selection-mode, and shift-select-mode. As a result, cua-highlight-region-shift-only is obsolete (you can disable transient-mark-mode to get the same result). +*** CUA's rectangles can now be used via `cua-rectangle-mark-mode'. ** `delete-selection-mode' can be used without transient-mark-mode. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-12-14 19:55:19 +0000 +++ lisp/ChangeLog 2013-12-16 02:24:08 +0000 @@ -1,3 +1,18 @@ +2013-12-16 Stefan Monnier + + * emulation/cua-rect.el (cua-rectangle-mark-mode): New minor mode. + (cua--deactivate-rectangle): Don't deactivate the mark. + (cua-set-rectangle-mark): Don't set mark-active since + cua--activate-rectangle already does it for us. + (cua--rectangle-highlight-for-redisplay): Unhighlight a previous + non-rectangular region. + + * emulation/cua-base.el (cua-repeat-replace-region): + Use with-current-buffer. + + * net/gnutls.el: Use cl-lib. + (gnutls-negotiate): `mapcan' -> cl-mapcan. + 2013-12-14 Teodor Zlatanov * emacs-lisp/package.el (package-built-in-p): Support both === modified file 'lisp/emulation/cua-base.el' --- lisp/emulation/cua-base.el 2013-12-11 14:49:01 +0000 +++ lisp/emulation/cua-base.el 2013-12-16 02:24:08 +0000 @@ -971,9 +971,8 @@ of text." (interactive "P") (when cua--last-deleted-region-pos - (save-excursion + (with-current-buffer (car cua--last-deleted-region-pos) (save-restriction - (set-buffer (car cua--last-deleted-region-pos)) (widen) ;; Find the text that replaced the region via the undo list. (let ((ul buffer-undo-list) === modified file 'lisp/emulation/cua-rect.el' --- lisp/emulation/cua-rect.el 2013-12-11 14:49:01 +0000 +++ lisp/emulation/cua-rect.el 2013-12-16 02:24:08 +0000 @@ -78,7 +78,7 @@ (push (list 'apply 0 s e 'cua--rect-undo-handler (copy-sequence cua--rectangle) t s e) - buffer-undo-list)))) + buffer-undo-list)))) (defun cua--rect-undo-handler (rect on s e) (if (setq on (not on)) @@ -89,6 +89,21 @@ 'cua--rect-undo-handler rect on s e) buffer-undo-list)) +;;;###autoload +(define-minor-mode cua-rectangle-mark-mode + "Toggle the region as rectangular. +Activates the region if needed. Only lasts until the region is deactivated." + :keymap cua--rectangle-keymap + (cond + (cua-rectangle-mark-mode + (add-hook 'deactivate-mark-hook + (lambda () (cua-rectangle-mark-mode -1))) + (add-hook 'post-command-hook #'cua--rectangle-post-command nil t) + (cua-set-rectangle-mark)) + (t + (cua--deactivate-rectangle) + (remove-hook 'post-command-hook #'cua--rectangle-post-command t)))) + ;;; Rectangle geometry (defun cua--rectangle-top (&optional val) @@ -708,8 +723,7 @@ killed-rectangle ""))))) (defun cua--activate-rectangle () - ;; Turn on rectangular marking mode by disabling transient mark mode - ;; and manually handling highlighting from a post command hook. + ;; Set cua--rectangle to indicate we're marking a rectangle. ;; Be careful if we are already marking a rectangle. (setq cua--rectangle (if (and cua--last-rectangle @@ -725,7 +739,7 @@ (defun cua--deactivate-rectangle () ;; This is used to clean up after `cua--activate-rectangle'. - (mapc (function delete-overlay) cua--rectangle-overlays) + (mapc #'delete-overlay cua--rectangle-overlays) (setq cua--last-rectangle (cons (current-buffer) (cons (point) ;; cua-save-point cua--rectangle)) @@ -733,7 +747,10 @@ cua--rectangle-overlays nil cua--status-string nil cua--mouse-last-pos nil) - (deactivate-mark)) + ;; FIXME: This call to cua-rectangle-mark-mode is a workaround. + ;; Deactivation can happen in various different ways, and we + ;; currently don't handle them all in a coherent way. + (if cua-rectangle-mark-mode (cua-rectangle-mark-mode -1))) (defun cua--highlight-rectangle () ;; This function is used to highlight the rectangular region. @@ -879,7 +896,6 @@ (push-mark nil nil t))) (cua--activate-rectangle) (cua--rectangle-set-corners) - (setq mark-active t) (if cua-enable-rectangle-auto-help (cua-help-for-rectangle t)))) @@ -1385,7 +1401,7 @@ (if (not cua--rectangle) (apply orig args) ;; When cua--rectangle is active, just don't highlight at all, since we ;; already do it elsewhere. - )) + (funcall redisplay-unhighlight-region-function (nth 3 args)))) (defun cua--rectangle-region-extract (orig &optional delete) (cond === modified file 'lisp/net/gnutls.el' --- lisp/net/gnutls.el 2013-12-14 18:04:09 +0000 +++ lisp/net/gnutls.el 2013-12-16 02:24:08 +0000 @@ -35,7 +35,7 @@ ;;; Code: -(eval-when-compile (require 'cl-lib)) +(require 'cl-lib) (defgroup gnutls nil "Emacs interface to the GnuTLS library." @@ -210,7 +210,7 @@ t) ;; if a list, look for hostname matches ((listp gnutls-verify-error) - (mapcan + (cl-mapcan (lambda (check) (when (string-match (car check) hostname) (cdr check))) === modified file 'lisp/rect.el' --- lisp/rect.el 2013-12-08 07:32:01 +0000 +++ lisp/rect.el 2013-12-16 02:24:08 +0000 @@ -418,9 +418,6 @@ ;; - lots of commands handle the region without paying attention to its ;; rectangular shape. -(add-hook 'deactivate-mark-hook - (lambda () (rectangle-mark-mode -1))) - (add-function :around redisplay-highlight-region-function #'rectangle--highlight-for-redisplay) (add-function :around redisplay-unhighlight-region-function @@ -443,6 +440,8 @@ Activates the region if needed. Only lasts until the region is deactivated." nil nil nil (when rectangle-mark-mode + (add-hook 'deactivate-mark-hook + (lambda () (rectangle-mark-mode -1))) (unless (region-active-p) (push-mark) (activate-mark)))) ------------------------------------------------------------ revno: 115539 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-12-15 22:39:36 +0200 message: Fix bug with conditionals in expand-file-name on MS-Windows. src/fileio.c (Fexpand_file_name) [WINDOWSNT]: Fix conditionals. Reported by Juanma Barranquero . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 18:37:48 +0000 +++ src/ChangeLog 2013-12-15 20:39:36 +0000 @@ -1,5 +1,8 @@ 2013-12-15 Eli Zaretskii + * fileio.c (Fexpand_file_name) [WINDOWSNT]: Fix conditionals. + Reported by Juanma Barranquero . + * process.c (Fprocess_send_eof): Don't crash if someone tries to open a pty on MS-Windows. (Bug#16152) === modified file 'src/fileio.c' --- src/fileio.c 2013-12-14 21:36:44 +0000 +++ src/fileio.c 2013-12-15 20:39:36 +0000 @@ -1168,9 +1168,8 @@ tem = build_string (newdir_utf8); } else -#else +#endif tem = build_string (newdir); -#endif if (multibyte && !STRING_MULTIBYTE (tem)) { hdir = DECODE_FILE (tem); ------------------------------------------------------------ revno: 115538 fixes bug: http://debbugs.gnu.org/16152 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-12-15 20:37:48 +0200 message: Fix bug #16152 with crashes in process-send-eof on MS-Windows. src/process.c (Fprocess_send_eof): Don't crash if someone tries to open a pty on MS-Windows. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 17:52:14 +0000 +++ src/ChangeLog 2013-12-15 18:37:48 +0000 @@ -1,5 +1,8 @@ 2013-12-15 Eli Zaretskii + * process.c (Fprocess_send_eof): Don't crash if someone tries to + open a pty on MS-Windows. (Bug#16152) + * emacs.c (decode_env_path): Fix bogus comparison against emacs_dir. Reported by Juanma Barranquero . === modified file 'src/process.c' --- src/process.c 2013-11-23 02:58:28 +0000 +++ src/process.c 2013-12-15 18:37:48 +0000 @@ -6032,13 +6032,16 @@ (Lisp_Object process) { Lisp_Object proc; - struct coding_system *coding; + struct coding_system *coding = NULL; + int outfd; if (DATAGRAM_CONN_P (process)) return process; proc = get_process (process); - coding = proc_encode_coding_system[XPROCESS (proc)->outfd]; + outfd = XPROCESS (proc)->outfd; + if (outfd >= 0) + coding = proc_encode_coding_system[outfd]; /* Make sure the process is really alive. */ if (XPROCESS (proc)->raw_status_new) @@ -6046,7 +6049,7 @@ if (! EQ (XPROCESS (proc)->status, Qrun)) error ("Process %s not running", SDATA (XPROCESS (proc)->name)); - if (CODING_REQUIRE_FLUSHING (coding)) + if (coding && CODING_REQUIRE_FLUSHING (coding)) { coding->mode |= CODING_MODE_LAST_BLOCK; send_process (proc, "", 0, Qnil); @@ -6064,7 +6067,8 @@ } else { - int old_outfd = XPROCESS (proc)->outfd; + struct Lisp_Process *p = XPROCESS (proc); + int old_outfd = p->outfd; int new_outfd; #ifdef HAVE_SHUTDOWN @@ -6072,24 +6076,30 @@ for communication with the subprocess, call shutdown to cause EOF. (In some old system, shutdown to socketpair doesn't work. Then we just can't win.) */ - if (EQ (XPROCESS (proc)->type, Qnetwork) - || XPROCESS (proc)->infd == old_outfd) + if (EQ (p->type, Qnetwork) + || p->infd == old_outfd) shutdown (old_outfd, 1); #endif - close_process_fd (&XPROCESS (proc)->open_fd[WRITE_TO_SUBPROCESS]); + close_process_fd (&p->open_fd[WRITE_TO_SUBPROCESS]); new_outfd = emacs_open (NULL_DEVICE, O_WRONLY, 0); if (new_outfd < 0) report_file_error ("Opening null device", Qnil); - XPROCESS (proc)->open_fd[WRITE_TO_SUBPROCESS] = new_outfd; - XPROCESS (proc)->outfd = new_outfd; + p->open_fd[WRITE_TO_SUBPROCESS] = new_outfd; + p->outfd = new_outfd; if (!proc_encode_coding_system[new_outfd]) proc_encode_coding_system[new_outfd] = xmalloc (sizeof (struct coding_system)); - *proc_encode_coding_system[new_outfd] - = *proc_encode_coding_system[old_outfd]; - memset (proc_encode_coding_system[old_outfd], 0, - sizeof (struct coding_system)); + if (old_outfd >= 0) + { + *proc_encode_coding_system[new_outfd] + = *proc_encode_coding_system[old_outfd]; + memset (proc_encode_coding_system[old_outfd], 0, + sizeof (struct coding_system)); + } + else + setup_coding_system (p->encode_coding_system, + proc_encode_coding_system[new_outfd]); } return process; } ------------------------------------------------------------ revno: 115537 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-12-15 19:52:14 +0200 message: Minor fix in Windows-specific code in decode_env_path. src/emacs.c (decode_env_path): Fix bogus comparison against emacs_dir. Reported by Juanma Barranquero . diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 17:40:44 +0000 +++ src/ChangeLog 2013-12-15 17:52:14 +0000 @@ -1,3 +1,8 @@ +2013-12-15 Eli Zaretskii + + * emacs.c (decode_env_path): Fix bogus comparison against + emacs_dir. Reported by Juanma Barranquero . + 2013-12-15 Juanma Barranquero * w32fns.c (Fw32_shell_execute): Remove unused local variable. === modified file 'src/emacs.c' --- src/emacs.c 2013-12-09 17:20:34 +0000 +++ src/emacs.c 2013-12-15 17:52:14 +0000 @@ -2224,7 +2224,8 @@ /* egetenv looks in process-environment, which holds the variables in their original system-locale encoding. We need emacs_dir to be in UTF-8. */ - filename_from_ansi (edir, emacs_dir); + if (edir) + filename_from_ansi (edir, emacs_dir); #endif /* It's okay to use getenv here, because this function is only used @@ -2299,7 +2300,7 @@ #ifdef WINDOWSNT /* Relative file names in the default path are interpreted as being relative to $emacs_dir. */ - if (emacs_dir && defaulted + if (edir && defaulted && strncmp (path, emacs_dir_env, emacs_dir_len) == 0) element = Fexpand_file_name (Fsubstring (element, ------------------------------------------------------------ revno: 115536 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2013-12-15 18:40:44 +0100 message: src/w32*.c: Silence compiler warnings. * w32fns.c (Fw32_shell_execute): Remove unused local variable. (Fx_file_dialog): Add parentheses around && to silence warning. * w32term.c (construct_drag_n_drop): Remove unused local variable. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 16:51:59 +0000 +++ src/ChangeLog 2013-12-15 17:40:44 +0000 @@ -1,3 +1,10 @@ +2013-12-15 Juanma Barranquero + + * w32fns.c (Fw32_shell_execute): Remove unused local variable. + (Fx_file_dialog): Add parentheses around && to silence warning. + + * w32term.c (construct_drag_n_drop): Remove unused local variable. + 2013-12-15 Eli Zaretskii * xdisp.c (extend_face_to_end_of_line): Extend background of === modified file 'src/w32fns.c' --- src/w32fns.c 2013-12-11 17:17:49 +0000 +++ src/w32fns.c 2013-12-15 17:40:44 +0000 @@ -6667,9 +6667,9 @@ /* Strip the dummy filename off the end of the string if we added it to select a directory. */ - if (use_unicode && file_details_w->nFilterIndex == 2 + if ((use_unicode && file_details_w->nFilterIndex == 2) #ifndef NTGUI_UNICODE - || !use_unicode && file_details_a->nFilterIndex == 2 + || (!use_unicode && file_details_a->nFilterIndex == 2) #endif ) filename = Ffile_name_directory (filename); @@ -6965,8 +6965,6 @@ } if (STRINGP (parameters)) { - int len; - parameters = ENCODE_SYSTEM (parameters); params_a = SSDATA (parameters); } === modified file 'src/w32term.c' --- src/w32term.c 2013-12-14 11:06:00 +0000 +++ src/w32term.c 2013-12-15 17:40:44 +0000 @@ -3137,7 +3137,7 @@ char name_a[MAX_PATH]; char file[MAX_UTF8_PATH]; #endif - int i, len; + int i; result->kind = DRAG_N_DROP_EVENT; result->code = 0; ------------------------------------------------------------ revno: 115535 fixes bug: http://debbugs.gnu.org/16151 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-12-15 18:51:59 +0200 message: Fix bug #16151 with background of display margins. src/xdisp.c (extend_face_to_end_of_line): Extend background of non-default face in margin areas as well. (Bug#16151) (display_line): Call extend_face_to_end_of_line for continued lines as well, if the display margins have non-zero width. (set_glyph_string_background_width): When needed, set the extends_to_end_of_line_p flag on glyph strings to be drawn in margin areas, not only in the text area. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 16:27:25 +0000 +++ src/ChangeLog 2013-12-15 16:51:59 +0000 @@ -1,5 +1,13 @@ 2013-12-15 Eli Zaretskii + * xdisp.c (extend_face_to_end_of_line): Extend background of + non-default face in margin areas as well. (Bug#16151) + (display_line): Call extend_face_to_end_of_line for continued + lines as well, if the display margins have non-zero width. + (set_glyph_string_background_width): When needed, set the + extends_to_end_of_line_p flag on glyph strings to be drawn in + margin areas, not only in the text area. + * frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at startup. === modified file 'src/xdisp.c' --- src/xdisp.c 2013-12-15 04:20:53 +0000 +++ src/xdisp.c 2013-12-15 16:51:59 +0000 @@ -18808,10 +18808,14 @@ 1-``pixel'' wide, so they hit the equality too early. This grace is needed only for R2L rows that are not continued, to produce one extra blank where we could display the cursor. */ - if (it->current_x >= it->last_visible_x - + (!FRAME_WINDOW_P (f) - && it->glyph_row->reversed_p - && !it->glyph_row->continued_p)) + if ((it->current_x >= it->last_visible_x + + (!FRAME_WINDOW_P (f) + && it->glyph_row->reversed_p + && !it->glyph_row->continued_p)) + /* If the window has display margins, we will need to extend + their face even if the text area is filled. */ + && !(WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 + || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0)) return; /* The default face, possibly remapped. */ @@ -18859,6 +18863,20 @@ it->glyph_row->glyphs[TEXT_AREA][0].face_id = face->id; it->glyph_row->used[TEXT_AREA] = 1; } + if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 + && it->glyph_row->used[LEFT_MARGIN_AREA] == 0) + { + it->glyph_row->glyphs[LEFT_MARGIN_AREA][0] = space_glyph; + it->glyph_row->glyphs[LEFT_MARGIN_AREA][0].face_id = face->id; + it->glyph_row->used[LEFT_MARGIN_AREA] = 1; + } + if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 + && it->glyph_row->used[RIGHT_MARGIN_AREA] == 0) + { + it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0] = space_glyph; + it->glyph_row->glyphs[RIGHT_MARGIN_AREA][0].face_id = face->id; + it->glyph_row->used[RIGHT_MARGIN_AREA] = 1; + } #ifdef HAVE_WINDOW_SYSTEM if (it->glyph_row->reversed_p) { @@ -18932,11 +18950,61 @@ else it->face_id = face->id; + face = FACE_FROM_ID (f, it->face_id); + if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 + && (it->glyph_row->used[LEFT_MARGIN_AREA] + < WINDOW_LEFT_MARGIN_WIDTH (it->w)) + && !it->glyph_row->mode_line_p + && face && face->background != FRAME_BACKGROUND_PIXEL (f)) + { + struct glyph *g = it->glyph_row->glyphs[LEFT_MARGIN_AREA]; + struct glyph *e = g + it->glyph_row->used[LEFT_MARGIN_AREA]; + + for (it->current_x = 0; g < e; g++) + it->current_x += g->pixel_width; + + it->area = LEFT_MARGIN_AREA; + while (it->glyph_row->used[LEFT_MARGIN_AREA] + < WINDOW_LEFT_MARGIN_WIDTH (it->w)) + { + PRODUCE_GLYPHS (it); + /* term.c:produce_glyphs advances it->current_x only for + TEXT_AREA. */ + it->current_x += it->pixel_width; + } + + it->current_x = saved_x; + it->area = TEXT_AREA; + } + PRODUCE_GLYPHS (it); while (it->current_x <= it->last_visible_x) PRODUCE_GLYPHS (it); + if (WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0 + && (it->glyph_row->used[RIGHT_MARGIN_AREA] + < WINDOW_RIGHT_MARGIN_WIDTH (it->w)) + && !it->glyph_row->mode_line_p + && face && face->background != FRAME_BACKGROUND_PIXEL (f)) + { + struct glyph *g = it->glyph_row->glyphs[RIGHT_MARGIN_AREA]; + struct glyph *e = g + it->glyph_row->used[RIGHT_MARGIN_AREA]; + + for ( ; g < e; g++) + it->current_x += g->pixel_width; + + it->area = RIGHT_MARGIN_AREA; + while (it->glyph_row->used[RIGHT_MARGIN_AREA] + < WINDOW_RIGHT_MARGIN_WIDTH (it->w)) + { + PRODUCE_GLYPHS (it); + it->current_x += it->pixel_width; + } + + it->area = TEXT_AREA; + } + /* Don't count these blanks really. It would let us insert a left truncation glyph below and make us set the cursor on them, maybe. */ it->current_x = saved_x; @@ -19789,6 +19857,9 @@ } else if (it->bidi_p) RECORD_MAX_MIN_POS (it); + if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 + || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0) + extend_face_to_end_of_line (it); } else if (CHAR_GLYPH_PADDING_P (*glyph) && !FRAME_WINDOW_P (it->f)) @@ -19817,6 +19888,9 @@ it->max_descent = descent; it->max_phys_ascent = phys_ascent; it->max_phys_descent = phys_descent; + if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 + || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0) + extend_face_to_end_of_line (it); } else if (wrap_row_used > 0) { @@ -19861,6 +19935,9 @@ row->continued_p = 1; glyph->pixel_width = it->last_visible_x - x; it->starts_in_middle_of_char_p = 1; + if (WINDOW_LEFT_MARGIN_WIDTH (it->w) > 0 + || WINDOW_RIGHT_MARGIN_WIDTH (it->w) > 0) + extend_face_to_end_of_line (it); } else { @@ -23796,7 +23873,6 @@ the drawing area, set S->extends_to_end_of_line_p. */ if (start == s->row->used[s->area] - && s->area == TEXT_AREA && ((s->row->fill_line_p && (s->hl == DRAW_NORMAL_TEXT || s->hl == DRAW_IMAGE_RAISED ------------------------------------------------------------ revno: 115534 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2013-12-15 18:27:25 +0200 message: Fix session GUI startup. src/frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at startup. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 04:42:23 +0000 +++ src/ChangeLog 2013-12-15 16:27:25 +0000 @@ -1,3 +1,8 @@ +2013-12-15 Eli Zaretskii + + * frame.h (FRAME_MOUSE_UPDATE): Fix a typo that caused infloop at + startup. + 2013-12-15 Paul Eggert * gnutls.c (Fgnutls_boot): Fix typo; "!" applied to a Lisp_Object. === modified file 'src/frame.h' --- src/frame.h 2013-12-14 21:36:44 +0000 +++ src/frame.h 2013-12-15 16:27:25 +0000 @@ -948,7 +948,7 @@ hlinfo->mouse_face_mouse_y); \ unblock_input (); \ } \ - } while (true) + } while (false) /* Set visibility of frame F. We call redisplay_other_windows to make sure the frame gets redisplayed ------------------------------------------------------------ revno: 115533 committer: Paul Eggert branch nick: trunk timestamp: Sat 2013-12-14 20:42:23 -0800 message: Add ChangeLog entry for previous checkin of gnutls.c. This entry was inadvertantly omitted. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-12-15 04:20:53 +0000 +++ src/ChangeLog 2013-12-15 04:42:23 +0000 @@ -1,3 +1,8 @@ +2013-12-15 Paul Eggert + + * gnutls.c (Fgnutls_boot): Fix typo; "!" applied to a Lisp_Object. + Don't worry about verify_error being t, since it has to be a list. + 2013-12-14 Paul Eggert Use bool for boolean, focusing on headers.