summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog42
-rw-r--r--lisp/files.el13
-rw-r--r--lisp/info.el4
-rw-r--r--lisp/mouse.el32
-rw-r--r--lisp/simple.el7
-rw-r--r--lisp/window.el18
6 files changed, 75 insertions, 41 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ab1fad7bc34..daf9f28d8fc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,41 @@
+2014-08-11 Glenn Morris <rgm@gnu.org>
+
+ * files.el (basic-save-buffer-2): Revert 2013-01-31 change, which
+ chose coding system for writing before backing up, since it causes
+ a more serious problem than the one it solves. (Closes Bug#18141,
+ reopens Bug#13522.)
+
+2014-08-11 Martin Rudalics <rudalics@gmx.at>
+
+ * window.el (window-total-size): Make doc-string more self-contained.
+
+ * window.el (display-buffer-below-selected): Restore original
+ behavior if buffer is already displayed in the window below the
+ selected one (Bug#18181).
+
+2014-08-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * mouse.el (mouse--down-1-maybe-follows-link): Don't convert the down
+ event (bug#18212).
+
+2014-08-11 Eli Zaretskii <eliz@gnu.org>
+
+ * info.el (info): Doc fix.
+
+2014-08-11 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * info.el (Info-mode-map): Override a global down-mouse-2 binding
+ (bug#18212).
+
+2014-08-11 Eli Zaretskii <eliz@gnu.org>
+
+ * simple.el (default-line-height): A floating-point value of
+ line-spacing means a fraction of the default frame font's height,
+ not of the font currently used by the 'default' face.
+ Truncate the pixel value, like the display engine does.
+ (window-screen-lines): Use window-inside-pixel-edges for
+ determining the window height in pixels. (Bug#18195)
+
2014-08-11 Grégoire Jadi <daimrod@gmail.com>
* leim/quail/latin-post.el: Transform " __" into " _". (Bug#18023)
@@ -462,8 +500,8 @@
(python-shell-output-filter): Fix comment typo.
Fix Python shell prompts detection for remote hosts.
- * progmodes/python.el (python-shell-prompt-detect): Replace
- call-process with process-file and make it more robust.
+ * progmodes/python.el (python-shell-prompt-detect):
+ Replace call-process with process-file and make it more robust.
Autodetect Python shell prompts. (Bug#17370)
* progmodes/python.el:
diff --git a/lisp/files.el b/lisp/files.el
index 5cff5b11ee9..a9a279b2fa4 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -4759,7 +4759,7 @@ Before and after saving the buffer, this function runs
;; This returns a value (MODES EXTENDED-ATTRIBUTES BACKUPNAME), like
;; backup-buffer.
(defun basic-save-buffer-2 ()
- (let (tempsetmodes setmodes writecoding)
+ (let (tempsetmodes setmodes)
(if (not (file-writable-p buffer-file-name))
(let ((dir (file-name-directory buffer-file-name)))
(if (not (file-directory-p dir))
@@ -4775,14 +4775,6 @@ Before and after saving the buffer, this function runs
buffer-file-name)))
(setq tempsetmodes t)
(error "Attempt to save to a file which you aren't allowed to write"))))))
- ;; This may involve prompting, so do it now before backing up the file.
- ;; Otherwise there can be a delay while the user answers the
- ;; prompt during which the original file has been renamed. (Bug#13522)
- (setq writecoding
- ;; Args here should match write-region call below around
- ;; which we use writecoding.
- (choose-write-coding-system nil nil buffer-file-name nil t
- buffer-file-truename))
(or buffer-backed-up
(setq setmodes (backup-buffer)))
(let* ((dir (file-name-directory buffer-file-name))
@@ -4864,11 +4856,10 @@ Before and after saving the buffer, this function runs
(logior (car setmodes) 128))))))
(let (success)
(unwind-protect
+ (progn
;; Pass in nil&nil rather than point-min&max to indicate
;; we're saving the buffer rather than just a region.
;; write-region-annotate-functions may make us of it.
- (let ((coding-system-for-write writecoding)
- (coding-system-require-warning nil))
(write-region nil nil
buffer-file-name nil t buffer-file-truename)
(setq success t))
diff --git a/lisp/info.el b/lisp/info.el
index 405d6a22449..59501c73534 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -774,8 +774,7 @@ with the top-level Info directory.
In interactive use, a non-numeric prefix argument directs
this command to read a file name from the minibuffer.
-A numeric prefix argument N selects an Info buffer named
-\"*info*<%s>\".
+A numeric prefix argument of N selects an Info buffer named \"*info*<N>\".
The search path for Info files is in the variable `Info-directory-list'.
The top-level Info directory is made by combining all the files named `dir'
@@ -4009,6 +4008,7 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(define-key map "," 'Info-index-next)
(define-key map "\177" 'Info-scroll-down)
(define-key map [mouse-2] 'Info-mouse-follow-nearest-node)
+ (define-key map [down-mouse-2] 'ignore) ;Override potential global binding.
(define-key map [follow-link] 'mouse-face)
(define-key map [XF86Back] 'Info-history-back)
(define-key map [XF86Forward] 'Info-history-forward)
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 2606c8b4ca4..a10f4d67593 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -94,15 +94,14 @@ point at the click position."
(defun mouse--down-1-maybe-follows-link (&optional _prompt)
"Turn `mouse-1' events into `mouse-2' events if follows-link.
Expects to be bound to `down-mouse-1' in `key-translation-map'."
- (if (or (null mouse-1-click-follows-link)
- (not (eq (if (eq mouse-1-click-follows-link 'double)
- 'double-down-mouse-1 'down-mouse-1)
- (car-safe last-input-event)))
- (not (mouse-on-link-p (event-start last-input-event)))
- (and (not mouse-1-click-in-non-selected-windows)
- (not (eq (selected-window)
- (posn-window (event-start last-input-event))))))
- nil
+ (when (and mouse-1-click-follows-link
+ (eq (if (eq mouse-1-click-follows-link 'double)
+ 'double-down-mouse-1 'down-mouse-1)
+ (car-safe last-input-event))
+ (mouse-on-link-p (event-start last-input-event))
+ (or mouse-1-click-in-non-selected-windows
+ (eq (selected-window)
+ (posn-window (event-start last-input-event)))))
(let ((this-event last-input-event)
(timedout
(sit-for (if (numberp mouse-1-click-follows-link)
@@ -118,19 +117,14 @@ Expects to be bound to `down-mouse-1' in `key-translation-map'."
'double-mouse-1 'mouse-1))
;; Turn the mouse-1 into a mouse-2 to follow links.
(let ((newup (if (eq mouse-1-click-follows-link 'double)
- 'double-mouse-2 'mouse-2))
- (newdown (if (eq mouse-1-click-follows-link 'double)
- 'double-down-mouse-2 'down-mouse-2)))
+ 'double-mouse-2 'mouse-2)))
;; If mouse-2 has never been done by the user, it doesn't have
;; the necessary property to be interpreted correctly.
- (put newup 'event-kind (get (car event) 'event-kind))
- (put newdown 'event-kind (get (car this-event) 'event-kind))
+ (unless (get newup 'event-kind)
+ (put newup 'event-kind (get (car event) 'event-kind)))
(push (cons newup (cdr event)) unread-command-events)
- ;; Modify the event in place, so read-key-sequence doesn't
- ;; generate a second fake prefix key (see fake_prefixed_keys in
- ;; src/keyboard.c).
- (setcar this-event newdown)
- (vector this-event))
+ ;; Don't change the down event, only the up-event (bug#18212).
+ nil)
(push event unread-command-events)
nil))))))
diff --git a/lisp/simple.el b/lisp/simple.el
index 5da662c2124..cdff8d7fc3a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -5140,7 +5140,7 @@ or the frame."
0)
0)))
(if (floatp lsp)
- (setq lsp (* dfh lsp)))
+ (setq lsp (truncate (* (frame-char-height) lsp))))
(+ dfh lsp)))
(defun window-screen-lines ()
@@ -5152,10 +5152,9 @@ in the window, not in units of the frame's default font, and also accounts
for `line-spacing', if any, defined for the window's buffer or frame.
The value is a floating-point number."
- (let ((canonical (window-text-height))
- (fch (frame-char-height))
+ (let ((edges (window-inside-pixel-edges))
(dlh (default-line-height)))
- (/ (* (float canonical) fch) dlh)))
+ (/ (float (- (nth 3 edges) (nth 1 edges))) dlh)))
;; Returns non-nil if partial move was done.
(defun line-move-partial (arg noerror to-end)
diff --git a/lisp/window.el b/lisp/window.el
index 03caf831111..a05dddeac9e 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1155,8 +1155,17 @@ dumping to it."
WINDOW must be a valid window and defaults to the selected one.
If HORIZONTAL is omitted or nil, return the total height of
-WINDOW, in lines, like `window-total-height'. Otherwise return
-the total width, in columns, like `window-total-width'.
+WINDOW, in lines. If WINDOW is live, its total height includes,
+in addition to the height of WINDOW's text, the heights of
+WINDOW's mode and header line and a bottom divider, if any.
+
+If HORIZONTAL is non-nil, return the total width of WINDOW, in
+columns. If WINDOW is live, its total width includes, in
+addition to the width of WINDOW's text, the widths of WINDOW's
+fringes, margins, scroll bars and its right divider, if any.
+
+If WINDOW is internal, return the respective size of the screen
+areas spanned by its children.
Optional argument ROUND is handled as for `window-total-height'
and `window-total-width'."
@@ -6440,7 +6449,10 @@ again with `display-buffer-pop-up-window'."
This either splits the selected window or reuses the window below
the selected one."
(let (window)
- (or (and (not (frame-parameter nil 'unsplittable))
+ (or (and (setq window (window-in-direction 'below))
+ (eq buffer (window-buffer window))
+ (window--display-buffer buffer window 'reuse alist))
+ (and (not (frame-parameter nil 'unsplittable))
(let ((split-height-threshold 0)
split-width-threshold)
(setq window (window--try-to-split-window (selected-window) alist)))