From da604136b92764f159442496a9b18cb48204787e Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Tue, 9 Sep 2014 18:00:51 +0300 Subject: Fix mouse-dragging mode lines on text-mode terminals. lisp/mouse.el (mouse-drag-line): On text-mode frames, count the mode line and header line as 1 pixel. This fixes the 1-"pixel" (row) discrepancy between window-pixel-edges and mouse events, and avoids moving mode line up when the mouse click is on the modeline and no drag is attempted. --- lisp/ChangeLog | 8 ++++++++ lisp/mouse.el | 17 +++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2bd234e12e0..9f31741a1c5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2014-09-09 Eli Zaretskii + + * mouse.el (mouse-drag-line): On text-mode frames, count the mode + line and header line as 1 pixel. This fixes the 1-"pixel" (row) + discrepancy between window-pixel-edges and mouse events, and + avoids moving mode line up when the mouse click is on the modeline + and no drag is attempted. + 2014-09-08 Glenn Morris * calendar/calendar.el (calendar-basic-setup): diff --git a/lisp/mouse.el b/lisp/mouse.el index 99407d9f9cf..d84c6c119ed 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -395,7 +395,16 @@ must be one of the symbols `header', `mode', or `vertical'." ;; Check whether header-line can be dragged at all. (if (window-at-side-p window 'top) (setq draggable nil) - (setq height (/ (window-header-line-height window) 2)) + ;; window-pixel-edges includes the header and mode lines, so + ;; we need to account for that when calculating window growth. + ;; On GUI frames, assume the mouse is approximately in the + ;; middle of the header/mode line, so we need only half the + ;; height in pixels. + (setq height + (cond + ((display-graphic-p frame) + (/ (window-header-line-height window) 2)) + (t (window-header-line-height window)))) (setq window (window-in-direction 'above window t)))) ((eq line 'mode) ;; Check whether mode-line can be dragged at all. @@ -410,7 +419,11 @@ must be one of the symbols `header', `mode', or `vertical'." (eq minibuffer-window (active-minibuffer-window)))))) (setq draggable nil) - (setq height (/ (window-mode-line-height window) 2)))) + (setq height + (cond + ((display-graphic-p frame) + (/ (window-mode-line-height window) 2)) + (t (window-mode-line-height window)))))) ((eq line 'vertical) ;; Get the window to adjust for the vertical case. If the scroll ;; bar is on the window's right or we drag a vertical divider, -- cgit v1.2.1 From d7a3bb022cdd7d63b6af679a08d4570304d8f28e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 9 Sep 2014 14:09:54 -0400 Subject: * calendar/diary-lib.el (diary-list-entries): Restore 24.3 display behavior. Fixes: debbugs:18381 --- lisp/ChangeLog | 5 +++++ lisp/calendar/diary-lib.el | 23 +++++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f31741a1c5..7018d3c8abb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-09 Glenn Morris + + * calendar/diary-lib.el (diary-list-entries): + Restore 24.3 display behavior. (Bug#18381) + 2014-09-09 Eli Zaretskii * mouse.el (mouse-drag-line): On text-mode frames, count the mode diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index c609cee7d6f..7b07f4f6814 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1,7 +1,6 @@ ;;; diary-lib.el --- diary functions -;; Copyright (C) 1989-1990, 1992-1995, 2001-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1989-1990, 1992-1995, 2001-2014 Free Software Foundation, Inc. ;; Author: Edward M. Reingold ;; Maintainer: Glenn Morris @@ -901,12 +900,20 @@ LIST-ONLY is non-nil, in which case it just returns the list." ;;; (diary-include-other-diary-files) ; recurse ;;; (run-hooks 'diary-list-entries-hook)) (unless list-only - (if (and diary-display-function - (listp diary-display-function)) - ;; Backwards compatibility. - (run-hooks 'diary-display-function) - (funcall (or diary-display-function - 'diary-simple-display)))) + ;; Avoid M-x diary; M-x calendar; M-x diary + ;; clobbering the calendar window. + ;; FIXME this is not the right solution. + (let ((display-buffer-fallback-action + (list (delq + 'display-buffer-in-previous-window + (copy-sequence + (car display-buffer-fallback-action)))))) + (if (and diary-display-function + (listp diary-display-function)) + ;; Backwards compatibility. + (run-hooks 'diary-display-function) + (funcall (or diary-display-function + 'diary-simple-display))))) (run-hooks 'diary-hook))))) (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff))) (or d-incp (message "Preparing diary...done")) -- cgit v1.2.1 From 2776a6502b211c45e6b4e65549436d2d8527b6f3 Mon Sep 17 00:00:00 2001 From: Ivan Shmakov Date: Tue, 9 Sep 2014 20:47:20 -0400 Subject: * lisp/desktop.el (desktop-create-buffer): Check that buffers are still live before burying them. Fixes: debbugs:18373 --- lisp/ChangeLog | 5 +++++ lisp/desktop.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7018d3c8abb..46cb4ba0d68 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-10 Ivan Shmakov (tiny change) + + * desktop.el (desktop-create-buffer): Check that buffers are still live + before burying them (bug#18373). + 2014-09-09 Glenn Morris * calendar/diary-lib.el (diary-list-entries): diff --git a/lisp/desktop.el b/lisp/desktop.el index 40e6b364e45..360ff48339b 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1375,7 +1375,9 @@ after that many seconds of idle time." ;; Restore buffer list order with new buffer at end. Don't change ;; the order for old desktop files (old desktop module behavior). (unless (< desktop-file-version 206) - (mapc 'bury-buffer buffer-list) + (dolist (buf buffer-list) + (and (buffer-live-p buf) + (bury-buffer buf))) (when result (bury-buffer result))) (when result (unless (or desktop-first-buffer (< desktop-file-version 206)) -- cgit v1.2.1 From c4ea7c96121ec50db8dbfcb4bfe961f23760e3f9 Mon Sep 17 00:00:00 2001 From: Kan-Ru Chen Date: Fri, 12 Sep 2014 08:26:46 +0200 Subject: Fix fit-window-to-buffer doc-string. --- lisp/ChangeLog | 4 ++++ lisp/window.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 46cb4ba0d68..822abf9c0fe 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2014-09-12 Kan-Ru Chen + + * window.el (fit-window-to-buffer): Doc fix. + 2014-09-10 Ivan Shmakov (tiny change) * desktop.el (desktop-create-buffer): Check that buffers are still live diff --git a/lisp/window.el b/lisp/window.el index c73f019870b..4dc30ff968c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -7173,7 +7173,7 @@ and header line and a bottom divider, if any. If WINDOW is part of a horizontal combination and the value of the option `fit-window-to-buffer-horizontally' is non-nil, adjust -WINDOW's height. The new width of WINDOW is calculated from the +WINDOW's width. The new width of WINDOW is calculated from the maximum length of its buffer's lines that follow the current start position of WINDOW. The optional argument MAX-WIDTH specifies a maximum width and defaults to the width of WINDOW's -- cgit v1.2.1 From d4dc0e1691a15efd1ea0a8793cf889e683a37933 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sun, 14 Sep 2014 16:59:57 -0700 Subject: * lisp/image.el (image-multi-frame-p): Fix thinko do not force a delay if none was specified. Fixes: debbugs:18334 --- lisp/ChangeLog | 5 +++++ lisp/image.el | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp') diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 822abf9c0fe..b696eb61ab9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-14 Glenn Morris + + * image.el (image-multi-frame-p): Fix thinko - do not force + a delay if none was specified. (Bug#18334) + 2014-09-12 Kan-Ru Chen * window.el (fit-window-to-buffer): Doc fix. diff --git a/lisp/image.el b/lisp/image.el index ef39fa7909f..8430d36a627 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -637,8 +637,8 @@ in which case you might want to use `image-default-frame-delay'." (images (plist-get metadata 'count)) (delay (plist-get metadata 'delay))) (when (and images (> images 1)) - (if (or (not (numberp delay)) (< delay 0)) - (setq delay image-default-frame-delay)) + (and delay (or (not (numberp delay)) (< delay 0)) + (setq delay image-default-frame-delay)) (cons images delay))))) (defun image-animated-p (image) -- cgit v1.2.1