------------------------------------------------------------ revno: 118046 [merge] committer: K. Handa branch nick: trunk timestamp: Sun 2014-10-05 17:19:03 +0900 message: coding.c (detect_coding_iso_2022): Set coding->rejected correctly when an invalid escape sequence is found (Bug#18610). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-04 12:28:41 +0000 +++ src/ChangeLog 2014-10-05 08:17:15 +0000 @@ -1,3 +1,8 @@ +2014-10-05 K. Handa + + * coding.c (detect_coding_iso_2022): Set coding->rejected + correctly when an invalid escape sequence is found (Bug#18610). + 2014-10-04 Jan Djärv * gtkutil.c (create_menus): Only add tearoffs to empty menus. === modified file 'src/coding.c' --- src/coding.c 2014-10-03 04:35:10 +0000 +++ src/coding.c 2014-10-05 08:17:15 +0000 @@ -3073,8 +3073,13 @@ ONE_MORE_BYTE (c1); if (c1 < ' ' || c1 >= 0x80 || (id = iso_charset_table[0][c >= ','][c1]) < 0) - /* Invalid designation sequence. Just ignore. */ - break; + { + /* Invalid designation sequence. Just ignore. */ + if (c1 >= 0x80) + rejected |= (CATEGORY_MASK_ISO_7BIT + | CATEGORY_MASK_ISO_7_ELSE); + break; + } } else if (c == '$') { @@ -3088,16 +3093,29 @@ ONE_MORE_BYTE (c1); if (c1 < ' ' || c1 >= 0x80 || (id = iso_charset_table[1][c >= ','][c1]) < 0) - /* Invalid designation sequence. Just ignore. */ - break; + { + /* Invalid designation sequence. Just ignore. */ + if (c1 >= 0x80) + rejected |= (CATEGORY_MASK_ISO_7BIT + | CATEGORY_MASK_ISO_7_ELSE); + break; + } } else - /* Invalid designation sequence. Just ignore it. */ - break; + { + /* Invalid designation sequence. Just ignore it. */ + if (c >= 0x80) + rejected |= (CATEGORY_MASK_ISO_7BIT + | CATEGORY_MASK_ISO_7_ELSE); + break; + } } else { /* Invalid escape sequence. Just ignore it. */ + if (c >= 0x80) + rejected |= (CATEGORY_MASK_ISO_7BIT + | CATEGORY_MASK_ISO_7_ELSE); break; } ------------------------------------------------------------ revno: 118045 author: Alan Schmitt committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2014-10-04 23:57:35 +0000 message: lisp/gnus/nnimap.el (nnimap-process-expiry-targets): Reverse the list of expired messages only when it was built in reverse order diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-10-04 23:55:04 +0000 +++ lisp/gnus/ChangeLog 2014-10-04 23:57:35 +0000 @@ -1,3 +1,8 @@ +2014-10-04 Alan Schmitt (tiny change) + + * nnimap.el (nnimap-process-expiry-targets): Reverse the list of + expired messages only when it was built in reverse order. + 2014-10-04 Peter Münster (tiny change) * gnus-delay.el (gnus-delay-send-queue): Remove `gnus-delay-header' === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2014-03-23 23:13:36 +0000 +++ lisp/gnus/nnimap.el 2014-10-04 23:57:35 +0000 @@ -986,10 +986,10 @@ (setq target nil)) (nnheader-message 7 "Expiring article %s:%d" group article)) (when target - (push article deleted-articles)))))))) + (push article deleted-articles)))))) + (setq deleted-articles (nreverse deleted-articles)))) ;; Change back to the current group again. (nnimap-change-group group server) - (setq deleted-articles (nreverse deleted-articles)) (nnimap-delete-article (gnus-compress-sequence deleted-articles)) deleted-articles)) ------------------------------------------------------------ revno: 118044 author: Peter M?nster committer: Katsumi Yamaoka branch nick: trunk timestamp: Sat 2014-10-04 23:55:04 +0000 message: lisp/gnus/gnus-delay.el (gnus-delay-send-queue): Remove `gnus-delay-header' last so it can be used in `message-send-hook' diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-10-02 15:13:05 +0000 +++ lisp/gnus/ChangeLog 2014-10-04 23:55:04 +0000 @@ -1,3 +1,8 @@ +2014-10-04 Peter Münster (tiny change) + + * gnus-delay.el (gnus-delay-send-queue): Remove `gnus-delay-header' + last so it can be used in `message-send-hook'. + 2014-10-02 Daiki Ueno * mml.el (mml-parse-1): Error out if unknown mode is specified in === modified file 'lisp/gnus/gnus-delay.el' --- lisp/gnus/gnus-delay.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-delay.el 2014-10-04 23:55:04 +0000 @@ -153,7 +153,7 @@ (when (gnus-group-entry group) (gnus-activate-group group) (add-hook 'message-send-hook - (lambda () (message-remove-header gnus-delay-header))) + (lambda () (message-remove-header gnus-delay-header)) t) (setq articles (nndraft-articles)) (while (setq article (pop articles)) (gnus-request-head article group) ------------------------------------------------------------ revno: 118043 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-10-04 12:25:35 -0700 message: Add NEWS entry form ntlm.el change diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-10-04 08:20:24 +0000 +++ etc/NEWS 2014-10-04 19:25:35 +0000 @@ -147,6 +147,9 @@ ** New ERT function `ert-summarize-tests-batch-and-exit'. --- +** ntlm.el has support for NTLM2. + +--- ** The Rmail commands d, C-d and u now handle repeat counts to delete or undelete multiple messages. ------------------------------------------------------------ revno: 118042 fixes bug: http://debbugs.gnu.org/15603 author: Thomas Fitzsimmons committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-10-04 12:23:42 -0700 message: * lisp/net/ntlm.el (ntlm-build-auth-request): Add NTLM2 Session support. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-04 19:14:03 +0000 +++ lisp/ChangeLog 2014-10-04 19:23:42 +0000 @@ -1,3 +1,8 @@ +2014-10-04 Thomas Fitzsimmons + + * net/ntlm.el (ntlm-build-auth-request): + Add NTLM2 Session support. (Bug#15603) + 2014-10-04 Glenn Morris * apropos.el (apropos-symbols-internal): === modified file 'lisp/net/ntlm.el' --- lisp/net/ntlm.el 2014-01-01 07:43:34 +0000 +++ lisp/net/ntlm.el 2014-10-04 19:23:42 +0000 @@ -80,8 +80,8 @@ (request-msgType (concat (make-string 1 1) (make-string 3 0))) ;0x01 0x00 0x00 0x00 (request-flags (concat (make-string 1 7) (make-string 1 178) - (make-string 2 0))) - ;0x07 0xb2 0x00 0x00 + (make-string 1 8) (make-string 1 0))) + ;0x07 0xb2 0x08 0x00 lu ld off-d off-u) (when (string-match "@" user) (unless domain @@ -144,11 +144,35 @@ (setq domain (substring user (1+ (match-beginning 0)))) (setq user (substring user 0 (match-beginning 0)))) - ;; generate response data - (setq lmRespData - (ntlm-smb-owf-encrypt (car password-hashes) challengeData)) - (setq ntRespData - (ntlm-smb-owf-encrypt (cadr password-hashes) challengeData)) + ;; check if "negotiate NTLM2 key" flag is set in type 2 message + (if (not (zerop (logand (aref flags 2) 8))) + (let (randomString + sessionHash) + ;; generate NTLM2 session response data + (setq randomString (string-make-unibyte + (concat + (make-string 1 (random 256)) + (make-string 1 (random 256)) + (make-string 1 (random 256)) + (make-string 1 (random 256)) + (make-string 1 (random 256)) + (make-string 1 (random 256)) + (make-string 1 (random 256)) + (make-string 1 (random 256))))) + (setq sessionHash (secure-hash 'md5 + (concat challengeData randomString) + nil nil t)) + (setq sessionHash (substring sessionHash 0 8)) + + (setq lmRespData (concat randomString (make-string 16 0))) + (setq ntRespData (ntlm-smb-owf-encrypt + (cadr password-hashes) sessionHash))) + (progn + ;; generate response data + (setq lmRespData + (ntlm-smb-owf-encrypt (car password-hashes) challengeData)) + (setq ntRespData + (ntlm-smb-owf-encrypt (cadr password-hashes) challengeData)))) ;; get offsets to fields to pack the response struct in a string (setq lu (length user)) ------------------------------------------------------------ revno: 118041 fixes bug: http://debbugs.gnu.org/18337 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-10-04 12:14:03 -0700 message: * apropos.el (apropos-symbols-internal): Avoid error with non-symbol properties. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-04 18:58:41 +0000 +++ lisp/ChangeLog 2014-10-04 19:14:03 +0000 @@ -1,5 +1,8 @@ 2014-10-04 Glenn Morris + * apropos.el (apropos-symbols-internal): + Avoid error with non-symbol properties. (Bug#18337#16) + * startup.el (command-line): Handle altered user-emacs-directory in load-path warning. (Bug#18512) === modified file 'lisp/apropos.el' --- lisp/apropos.el 2014-02-24 02:38:54 +0000 +++ lisp/apropos.el 2014-10-04 19:14:03 +0000 @@ -718,7 +718,7 @@ (setq doc (list (car properties))) (while (setq properties (cdr (cdr properties))) (setq doc (cons (car properties) doc))) - (mapconcat #'symbol-name (nreverse doc) " ")) + (mapconcat (lambda (p) (format "%s" p)) (nreverse doc) " ")) (when (get symbol 'widget-type) (apropos-documentation-property symbol 'widget-documentation t)) ------------------------------------------------------------ revno: 118040 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-10-04 12:07:05 -0700 message: * admin/authors.el (authors-renamed-files-alist): Add package-x-test.el diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-10-01 17:23:42 +0000 +++ admin/ChangeLog 2014-10-04 19:07:05 +0000 @@ -1,3 +1,7 @@ +2014-10-04 Glenn Morris + + * authors.el (authors-renamed-files-alist): Add package-x-test.el + 2014-10-01 Stefan Monnier * unidata/unidata-gen.el (unidata-gen-table-word-list): Use alist-get === modified file 'admin/authors.el' --- admin/authors.el 2014-08-30 09:22:53 +0000 +++ admin/authors.el 2014-10-04 19:07:05 +0000 @@ -782,6 +782,7 @@ ;; The one in lisp is eshell/eshell.el. ("eshell.el" . "automated/eshell.el") ("eshell/esh-test.el" . "automated/eshell.el") + ("automated/package-x-test.el" . "automated/package-test.el") ;; INSTALL-CVS -> .CVS -> .BZR -> .REPO ("INSTALL-CVS" . "INSTALL.REPO") ("INSTALL.CVS" . "INSTALL.REPO") ------------------------------------------------------------ revno: 118039 fixes bug: http://debbugs.gnu.org/18574 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-10-04 12:04:36 -0700 message: Merge package-x-test.el into package-test.el, to avoid running tests twice * test/automated/package-x-test.el: Remove file... * test/automated/package-test.el: ... merge package-x-test.el. diff: === modified file 'test/ChangeLog' --- test/ChangeLog 2014-10-02 15:13:05 +0000 +++ test/ChangeLog 2014-10-04 19:04:36 +0000 @@ -1,3 +1,8 @@ +2014-10-04 Glenn Morris + + * automated/package-x-test.el: Remove file... + * automated/package-test.el: ... merge package-x-test.el. (Bug#18574) + 2014-10-02 Glenn Morris * automated/package-test.el (with-package-test, package-test-signed): === modified file 'test/automated/package-test.el' --- test/automated/package-test.el 2014-10-02 15:13:05 +0000 +++ test/automated/package-test.el 2014-10-04 19:04:36 +0000 @@ -396,6 +396,73 @@ (expand-file-name "signed-good-1.0" package-user-dir)) nil t)))))) + + +;;; Tests for package-x features. + +(require 'package-x) + +(defvar package-x-test--single-archive-entry-1-3 + (cons 'simple-single + (package-make-ac-desc '(1 3) nil + "A single-file package with no dependencies" + 'single + '((:url . "http://doodles.au")))) + "Expected contents of the archive entry from the \"simple-single\" package.") + +(defvar package-x-test--single-archive-entry-1-4 + (cons 'simple-single + (package-make-ac-desc '(1 4) nil + "A single-file package with no dependencies" + 'single + nil)) + "Expected contents of the archive entry from the updated \"simple-single\" package.") + +(ert-deftest package-x-test-upload-buffer () + "Test creating an \"archive-contents\" file" + (with-package-test (:basedir "data/package" + :file "simple-single-1.3.el" + :upload-base t) + (package-upload-buffer) + (should (file-exists-p (expand-file-name "archive-contents" + package-archive-upload-base))) + (should (file-exists-p (expand-file-name "simple-single-1.3.el" + package-archive-upload-base))) + (should (file-exists-p (expand-file-name "simple-single-readme.txt" + package-archive-upload-base))) + + (let (archive-contents) + (with-temp-buffer + (insert-file-contents + (expand-file-name "archive-contents" + package-archive-upload-base)) + (setq archive-contents + (package-read-from-string + (buffer-substring (point-min) (point-max))))) + (should (equal archive-contents + (list 1 package-x-test--single-archive-entry-1-3)))))) + +(ert-deftest package-x-test-upload-new-version () + "Test uploading a new version of a package" + (with-package-test (:basedir "data/package" + :file "simple-single-1.3.el" + :upload-base t) + (package-upload-buffer) + (with-temp-buffer + (insert-file-contents "newer-versions/simple-single-1.4.el") + (package-upload-buffer)) + + (let (archive-contents) + (with-temp-buffer + (insert-file-contents + (expand-file-name "archive-contents" + package-archive-upload-base)) + (setq archive-contents + (package-read-from-string + (buffer-substring (point-min) (point-max))))) + (should (equal archive-contents + (list 1 package-x-test--single-archive-entry-1-4)))))) + (provide 'package-test) ;;; package-test.el ends here === removed file 'test/automated/package-x-test.el' --- test/automated/package-x-test.el 2014-06-26 07:34:09 +0000 +++ test/automated/package-x-test.el 1970-01-01 00:00:00 +0000 @@ -1,95 +0,0 @@ -;;; package-test.el --- Tests for the Emacs package system - -;; Copyright (C) 2013-2014 Free Software Foundation, Inc. - -;; Author: Daniel Hackney -;; Version: 1.0 - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;;; Code: - -(require 'package-x) -(require 'ert) -(require 'cl-lib) -(require 'package-test) - -(defvar package-x-test--single-archive-entry-1-3 - (cons 'simple-single - (package-make-ac-desc '(1 3) nil - "A single-file package with no dependencies" - 'single - '((:url . "http://doodles.au")))) - "Expected contents of the archive entry from the \"simple-single\" package.") - -(defvar package-x-test--single-archive-entry-1-4 - (cons 'simple-single - (package-make-ac-desc '(1 4) nil - "A single-file package with no dependencies" - 'single - nil)) - "Expected contents of the archive entry from the updated \"simple-single\" package.") - -(ert-deftest package-x-test-upload-buffer () - "Test creating an \"archive-contents\" file" - (with-package-test (:basedir "data/package" - :file "simple-single-1.3.el" - :upload-base t) - (package-upload-buffer) - (should (file-exists-p (expand-file-name "archive-contents" - package-archive-upload-base))) - (should (file-exists-p (expand-file-name "simple-single-1.3.el" - package-archive-upload-base))) - (should (file-exists-p (expand-file-name "simple-single-readme.txt" - package-archive-upload-base))) - - (let (archive-contents) - (with-temp-buffer - (insert-file-contents - (expand-file-name "archive-contents" - package-archive-upload-base)) - (setq archive-contents - (package-read-from-string - (buffer-substring (point-min) (point-max))))) - (should (equal archive-contents - (list 1 package-x-test--single-archive-entry-1-3)))))) - -(ert-deftest package-x-test-upload-new-version () - "Test uploading a new version of a package" - (with-package-test (:basedir "data/package" - :file "simple-single-1.3.el" - :upload-base t) - (package-upload-buffer) - (with-temp-buffer - (insert-file-contents "newer-versions/simple-single-1.4.el") - (package-upload-buffer)) - - (let (archive-contents) - (with-temp-buffer - (insert-file-contents - (expand-file-name "archive-contents" - package-archive-upload-base)) - (setq archive-contents - (package-read-from-string - (buffer-substring (point-min) (point-max))))) - (should (equal archive-contents - (list 1 package-x-test--single-archive-entry-1-4)))))) - -(provide 'package-x-test) - -;;; package-x-test.el ends here ------------------------------------------------------------ revno: 118038 fixes bug: http://debbugs.gnu.org/18512 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-10-04 11:58:41 -0700 message: * lisp/startup.el (command-line): Handle altered user-emacs-directory in load-path warning. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-04 08:20:24 +0000 +++ lisp/ChangeLog 2014-10-04 18:58:41 +0000 @@ -1,3 +1,8 @@ +2014-10-04 Glenn Morris + + * startup.el (command-line): + Handle altered user-emacs-directory in load-path warning. (Bug#18512) + 2014-10-04 Martin Rudalics * window.el (window-full-height-p): Make it behave correctly for === modified file 'lisp/startup.el' --- lisp/startup.el 2014-10-02 13:26:23 +0000 +++ lisp/startup.el 2014-10-04 18:58:41 +0000 @@ -1286,7 +1286,11 @@ (let (warned) (dolist (dir load-path) (and (not warned) - (string-match-p "/[._]emacs\\.d/?\\'" dir) + (string-match-p + (format "/%s/?\\'" + (regexp-quote + (file-name-nondirectory + (directory-file-name user-emacs-directory)))) dir) (string-equal (file-name-as-directory (expand-file-name dir)) (expand-file-name user-emacs-directory)) (setq warned t) ------------------------------------------------------------ revno: 118037 committer: Jan D. branch nick: trunk timestamp: Sat 2014-10-04 14:28:41 +0200 message: Fix Gtk+ tearoff not present on Customize Emacs and not at menu top. * gtkutil.c (create_menus): Only add tearoffs to empty menus. (xg_update_submenu): Remove has_tearoff_p, pass 1 to create_menus for add_tearoff_p. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-04 08:20:24 +0000 +++ src/ChangeLog 2014-10-04 12:28:41 +0000 @@ -1,3 +1,9 @@ +2014-10-04 Jan Djärv + + * gtkutil.c (create_menus): Only add tearoffs to empty menus. + (xg_update_submenu): Remove has_tearoff_p, pass 1 to create_menus + for add_tearoff_p. + 2014-10-04 Martin Rudalics * buffer.c (scroll_bar_width, scroll_bar_height): Fix === modified file 'src/gtkutil.c' --- src/gtkutil.c 2014-10-01 13:21:08 +0000 +++ src/gtkutil.c 2014-10-04 12:28:41 +0000 @@ -2554,11 +2554,18 @@ #ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW if (! menu_bar_p && add_tearoff_p) { - GtkWidget *tearoff = gtk_tearoff_menu_item_new (); - gtk_menu_shell_append (GTK_MENU_SHELL (wmenu), tearoff); + // Only add tearoff if menu is empty. + GList *list = gtk_container_get_children (GTK_CONTAINER (wmenu)); + if (! list) + { + GtkWidget *tearoff = gtk_tearoff_menu_item_new (); + gtk_menu_shell_append (GTK_MENU_SHELL (wmenu), tearoff); - g_signal_connect (G_OBJECT (tearoff), "activate", - G_CALLBACK (tearoff_activate), 0); + g_signal_connect (G_OBJECT (tearoff), "activate", + G_CALLBACK (tearoff_activate), 0); + } + else + g_list_free (list); } #endif @@ -3088,7 +3095,6 @@ GList *list = 0; GList *iter; widget_value *cur; - bool has_tearoff_p = 0; GList *first_radio = 0; if (submenu) @@ -3104,7 +3110,6 @@ /* Skip tearoff items, they have no counterpart in val. */ if (GTK_IS_TEAROFF_MENU_ITEM (w)) { - has_tearoff_p = 1; iter = g_list_next (iter); if (iter) w = GTK_WIDGET (iter->data); else break; @@ -3198,7 +3203,7 @@ highlight_cb, 0, 0, - ! has_tearoff_p, + 1, submenu, cl_data, 0); ------------------------------------------------------------ revno: 118036 committer: martin rudalics branch nick: trunk timestamp: Sat 2014-10-04 10:20:24 +0200 message: Add documentation for horizontal scroll bars and fix some minor issues. * buffer.c (scroll_bar_width, scroll_bar_height): Fix doc-strings. * window.c (Fset_window_scroll_bars): Fix doc-string. (Fwindow_scroll_bars): Have it return what the doc-string says. * window.el (window-full-height-p): Make it behave correctly for minibuffer window. (window-current-scroll-bars): Fix code. (fit-frame-to-buffer): Use window-scroll-bar-height instead of window-scroll-bars. * frame.el (frame-current-scroll-bars): Fix doc-string. * scroll-bar.el (toggle-horizontal-scroll-bar): New command. * frames.texi (Scroll Bars): Describe use of horizontal scroll bars. * display.texi (Scroll Bars): Add description of horizontal scroll bars and associated functions. * frames.texi (Layout Parameters): Add horizontal scroll bar entries. Remove paragraph on "combined fringe widths". * windows.texi (Window Sizes): Describe affects of horizontal scroll bars on window layout and sizes. Fix description of window-full-height-p. (Resizing Windows): Mention horizontal scroll bar. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-10-04 07:05:21 +0000 +++ doc/emacs/ChangeLog 2014-10-04 08:20:24 +0000 @@ -1,3 +1,8 @@ +2014-10-04 Martin Rudalics + + * frames.texi (Scroll Bars): Describe use of horizontal scroll + bars. + 2014-10-04 Glenn Morris * cmdargs.texi (Misc X): === modified file 'doc/emacs/frames.texi' --- doc/emacs/frames.texi 2014-10-03 09:18:49 +0000 +++ doc/emacs/frames.texi 2014-10-04 08:20:24 +0000 @@ -904,10 +904,11 @@ @section Scroll Bars @cindex Scroll Bar mode @cindex mode, Scroll Bar +@cindex Vertical Scroll Bar - On graphical displays, there is a @dfn{scroll bar} on the side of -each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's up and -down buttons scrolls the window by one line at a time. Clicking + On graphical displays, there is a @dfn{vertical scroll bar} on the +side of each Emacs window. Clicking @kbd{Mouse-1} on the scroll bar's +up and down buttons scrolls the window by one line at a time. Clicking @kbd{Mouse-1} above or below the scroll bar's inner box scrolls the window by nearly the entire height of the window, like @kbd{M-v} and @kbd{C-v} respectively (@pxref{Moving Point}). Dragging the inner box @@ -921,23 +922,23 @@ @findex scroll-bar-mode @findex toggle-scroll-bar - To toggle the use of scroll bars, type @kbd{M-x scroll-bar-mode}. -This command applies to all frames, including frames yet to be -created. To toggle scroll bars for just the selected frame, use the -command @kbd{M-x toggle-scroll-bar}. + To toggle the use of vertical scroll bars, type @kbd{M-x +scroll-bar-mode}. This command applies to all frames, including frames +yet to be created. To toggle vertical scroll bars for just the selected +frame, use the command @kbd{M-x toggle-scroll-bar}. @vindex scroll-bar-mode - To control the use of scroll bars at startup, customize the variable -@code{scroll-bar-mode}. Its value should be either @code{right} (put -scroll bars on the right side of windows), @code{left} (put them on -the left), or @code{nil} (disable scroll bars). By default, Emacs -puts scroll bars on the right if it was compiled with GTK+ support on -the X Window System, and on MS-Windows or Mac OS; Emacs puts scroll -bars on the left if compiled on the X Window System without GTK+ -support (following the old convention for X applications). + To control the use of vertical scroll bars at startup, customize the +variable @code{scroll-bar-mode}. Its value should be either +@code{right} (put scroll bars on the right side of windows), @code{left} +(put them on the left), or @code{nil} (disable vertical scroll bars). +By default, Emacs puts scroll bars on the right if it was compiled with +GTK+ support on the X Window System, and on MS-Windows or Mac OS; Emacs +puts scroll bars on the left if compiled on the X Window System without +GTK+ support (following the old convention for X applications). @vindex scroll-bar-width -@cindex width of the scroll bar +@cindex width of the vertical scroll bar You can also use the X resource @samp{verticalScrollBars} to enable or disable the scroll bars (@pxref{Resources}). To control the scroll bar width, change the @code{scroll-bar-width} frame parameter @@ -954,6 +955,39 @@ bottom when the end of the buffer is shown. You can not over-scroll when the entire buffer is visible. +@cindex Horizontal Scroll Bar +@cindex Horizontal Scroll Bar mode + On graphical displays with toolkit support, Emacs may also supply a +@dfn{horizontal scroll bar} on the bottom of each window. Clicking +@kbd{Mouse-1} on the that scroll bar's left and right buttons scrolls +the window horizontally by one column at a time. Clicking @kbd{Mouse-1} +on the left or right of the scroll bar's inner box scrolls the window by +four columns. Dragging the inner box scrolls the window continuously. + + Note that such horizontal scrolling can make the window's position of +point disappear on the left or the right. Typing a character to insert +text or moving point with a keyboard command will usually bring it back +into view. + +@findex horizontal-scroll-bar-mode + To toggle the use of horizontal scroll bars, type @kbd{M-x +horizontal-scroll-bar-mode}. This command applies to all frames, +including frames yet to be created. To toggle horizontal scroll bars +for just the selected frame, use the command @kbd{M-x +toggle-horizontal-scroll-bar}. + +@vindex horizontal-scroll-bar-mode + To control the use of horizontal scroll bars at startup, customize the +variable @code{horizontal-scroll-bar-mode}. + +@vindex scroll-bar-height +@cindex height of the horizontal scroll bar + You can also use the X resource @samp{horizontalScrollBars} to enable +or disable horizontal scroll bars (@pxref{Resources}). To control the +scroll bar height, change the @code{scroll-bar-height} frame parameter +(@pxref{Frame Parameters,,, elisp, The Emacs Lisp Reference Manual}). + + @node Drag and Drop @section Drag and Drop @cindex drag and drop === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-10-04 07:05:21 +0000 +++ doc/lispref/ChangeLog 2014-10-04 08:20:24 +0000 @@ -1,3 +1,14 @@ +2014-10-04 Martin Rudalics + + * display.texi (Scroll Bars): Add description of horizontal scroll + bars and associated functions. + * frames.texi (Layout Parameters): Add horizontal scroll bar + entries. Remove paragraph on "combined fringe widths". + * windows.texi (Window Sizes): Describe affects of horizontal + scroll bars on window layout and sizes. Fix description of + window-full-height-p. + (Resizing Windows): Mention horizontal scroll bar. + 2014-10-04 Glenn Morris * commands.texi (Generic Commands): Copyedits. === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2014-10-04 06:45:19 +0000 +++ doc/lispref/display.texi 2014-10-04 08:20:24 +0000 @@ -23,7 +23,7 @@ * Faces:: A face defines a graphics style for text characters: font, colors, etc. * Fringes:: Controlling window fringes. -* Scroll Bars:: Controlling vertical scroll bars. +* Scroll Bars:: Controlling scroll bars. * Window Dividers:: Separating windows visually. * Display Property:: Enabling special display features. * Images:: Displaying images in Emacs buffers. @@ -3866,101 +3866,163 @@ @code{overlay-arrow-string} or @code{overlay-arrow} fringe indicator is used. + @node Scroll Bars @section Scroll Bars @cindex scroll bars Normally the frame parameter @code{vertical-scroll-bars} controls -whether the windows in the frame have vertical scroll bars, and -whether they are on the left or right. The frame parameter -@code{scroll-bar-width} specifies how wide they are (@code{nil} -meaning the default). @xref{Layout Parameters}. +whether the windows in the frame have vertical scroll bars, and whether +they are on the left or right. The frame parameter +@code{scroll-bar-width} specifies how wide they are (@code{nil} meaning +the default). + + The frame parameter @code{horizontal-scroll-bars} controls whether +the windows in the frame have horizontal scroll bars. The frame +parameter @code{scroll-bar-height} specifies how high they are +(@code{nil} meaning the default). @xref{Layout Parameters}. + +@vindex horizontal-scroll-bars-available-p + Horizontal scroll bars are not available on all platforms. The +function @code{horizontal-scroll-bars-available-p} which takes no +argument returns non-@code{nil} if they are available on your system. + + The following three functions take as argument a live frame which +defaults to the selected one. @defun frame-current-scroll-bars &optional frame -This function reports the scroll bar type settings for frame -@var{frame}. The value is a cons cell -@code{(@var{vertical-type} .@: @var{horizontal-type})}, where -@var{vertical-type} is either @code{left}, @code{right}, or @code{nil} -(which means no scroll bar.) @var{horizontal-type} is meant to -specify the horizontal scroll bar type, but since they are not -implemented, it is always @code{nil}. -@end defun - -@vindex vertical-scroll-bar - You can enable or disable scroll bars for a particular buffer, -by setting the variable @code{vertical-scroll-bar}. This variable -automatically becomes buffer-local when set. The possible values are -@code{left}, @code{right}, @code{t}, which means to use the -frame's default, and @code{nil} for no scroll bar. - - You can also control this for individual windows. Call the function -@code{set-window-scroll-bars} to specify what to do for a specific window: - -@defun set-window-scroll-bars window width &optional vertical-type horizontal-type -This function sets the width and type of scroll bars for window -@var{window}. - -@var{width} specifies the scroll bar width in pixels (@code{nil} means -use the width specified for the frame). @var{vertical-type} specifies -whether to have a vertical scroll bar and, if so, where. The possible -values are @code{left}, @code{right} and @code{nil}, just like the -values of the @code{vertical-scroll-bars} frame parameter. - -The argument @var{horizontal-type} is meant to specify whether and -where to have horizontal scroll bars, but since they are not -implemented, it has no effect. If @var{window} is @code{nil}, the -selected window is used. -@end defun +This function reports the scroll bar types for frame @var{frame}. The +value is a cons cell @code{(@var{vertical-type} .@: +@var{horizontal-type})}, where @var{vertical-type} is either +@code{left}, @code{right}, or @code{nil} (which means no vertical scroll +bar.) @var{horizontal-type} is either @code{bottom} or @code{nil} +(which means no horizontal scroll bar). +@end defun + +@defun frame-scroll-bar-width &optional Lisp_Object &optional frame +This function returns the width of vertical scroll bars of @var{frame} +in pixels. +@end defun + +@defun frame-scroll-bar-height &optional Lisp_Object &optional frame +This function returns the height of horizontal scroll bars of +@var{frame} in pixels. +@end defun + +You can override the frame specific settings for individual windows by +using the following function: + +@defun set-window-scroll-bars window &optional width vertical-type height horizontal-type +This function sets the width and/or height and the types of scroll bars +for window @var{window}. + +@var{width} specifies the width of the vertical scroll bar in pixels +(@code{nil} means use the width specified for the frame). +@var{vertical-type} specifies whether to have a vertical scroll bar and, +if so, where. The possible values are @code{left}, @code{right}, +@code{t}, which means to use the frame's default, and @code{nil} for no +vertical scroll bar. + +@var{height} specifies the height of the horizontal scroll bar in pixels +(@code{nil} means use the height specified for the frame). +@var{horizontal-type} specifies whether to have a horizontal scroll bar. +The possible values are @code{bottom}, @code{t}, which means to use the +frame's default, and @code{nil} for no horizontal scroll bar. + +If @var{window} is @code{nil}, the selected window is used. +@end defun + +The following four functions take as argument a live window which +defaults to the selected one. @defun window-scroll-bars &optional window -Report the width and type of scroll bars specified for @var{window}. -If @var{window} is omitted or @code{nil}, the selected window is used. -The value is a list of the form @code{(@var{width} -@var{cols} @var{vertical-type} @var{horizontal-type})}. The value -@var{width} is the value that was specified for the width (which may -be @code{nil}); @var{cols} is the number of columns that the scroll -bar actually occupies. - -@var{horizontal-type} is not actually meaningful. +This function returns a list of the form @code{(@var{width} +@var{columns} @var{vertical-type} @var{height} @var{lines} +@var{horizontal-type})}. + +The value @var{width} is the value that was specified for the width of +the vertical scroll bar (which may be @code{nil}); @var{columns} is the +(possibly rounded) number of columns that the vertical scroll bar +actually occupies. + +The value @var{height} is the value that was specified for the height of +the horizontal scroll bar (which may be @code{nil}); @var{lines} is the +(possibly rounded) number of lines that the horizontally scroll bar +actually occupies. +@end defun + +@defun window-current-scroll-bars &optional window +This function reports the scroll bar type for window @var{window}. The +value is a cons cell @code{(@var{vertical-type} .@: +@var{horizontal-type})}. Unlike @code{window-scroll-bars}, this reports +the scroll bar type actually used, once frame defaults and +@code{scroll-bar-mode} are taken into account. @end defun @defun window-scroll-bar-width &optional window This function returns the width in pixels of @var{window}'s vertical -scrollbar. @var{window} must be a live window, and defaults to the -selected window. +scrollbar. +@end defun + +@defun window-scroll-bar-height &optional window +This function returns the height in pixels of @var{window}'s horizontal +scrollbar. @end defun If you don't specify these values for a window with @code{set-window-scroll-bars}, the buffer-local variables -@code{scroll-bar-mode} and @code{scroll-bar-width} in the buffer being -displayed control the window's vertical scroll bars. The function +@code{vertical-scroll-bar}, @code{horizontal-scroll-bar}, +@code{scroll-bar-width} and @code{scroll-bar-height} in the buffer being +displayed control the window's scroll bars. The function @code{set-window-buffer} examines these variables. If you change them -in a buffer that is already visible in a window, you can make the -window take note of the new values by calling @code{set-window-buffer} +in a buffer that is already visible in a window, you can make the window +take note of the new values by calling @code{set-window-buffer} specifying the same buffer that is already displayed. +You can control the appearance of scroll bars for a particular buffer by +setting the following variables which automatically become buffer-local +when set. + +@defvar vertical-scroll-bar +This variable specifies the location of the vertical scroll bar. The +possible values are @code{left}, @code{right}, @code{t}, which means to +use the frame's default, and @code{nil} for no scroll bar. +@end defvar + +@defvar horizontal-scroll-bar +This variable specifies the location of the horizontal scroll bar. The +possible values are @code{bottom}, @code{t}, which means to use the +frame's default, and @code{nil} for no scroll bar. +@end defvar + +@defvar scroll-bar-width +This variable specifies the width of the buffer's vertical scroll bars, +measured in pixels. A value of @code{nil} means to use the value +specified by the frame. +@end defvar + +@defvar scroll-bar-height +This variable specifies the height of the buffer's horizontal scroll +bar, measured in pixels. A value of @code{nil} means to use the value +specified by the frame. +@end defvar + +Finally you can toggle the display of scroll bars on all frames by +customizing the variables @code{scroll-bar-mode} and +@code{horizontal-scroll-bar-mode}. + @defopt scroll-bar-mode -This variable, always local in all buffers, controls whether and where -to put scroll bars in windows displaying the buffer. The possible values -are @code{nil} for no scroll bar, @code{left} to put a scroll bar on -the left, and @code{right} to put a scroll bar on the right. -@end defopt - -@defun window-current-scroll-bars &optional window -This function reports the scroll bar type for window @var{window}. -If @var{window} is omitted or @code{nil}, the selected window is used. -The value is a cons cell -@code{(@var{vertical-type} .@: @var{horizontal-type})}. Unlike -@code{window-scroll-bars}, this reports the scroll bar type actually -used, once frame defaults and @code{scroll-bar-mode} are taken into -account. -@end defun - -@defvar scroll-bar-width -This variable, always local in all buffers, specifies the width of the -buffer's scroll bars, measured in pixels. A value of @code{nil} means -to use the value specified by the frame. -@end defvar +This variable controls whether and where to put vertical scroll bars in +all frames. The possible values are @code{nil} for no scroll bars, +@code{left} to put scroll bars on the left and @code{right} to put +scroll bars on the right. +@end defopt + +@defopt horizontal-scroll-bar-mode +This variable controls whether to display horizontal scroll bars on all +frames. +@end defopt + @node Window Dividers @section Window Dividers === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2014-06-10 02:20:31 +0000 +++ doc/lispref/elisp.texi 2014-10-04 08:20:24 +0000 @@ -1343,7 +1343,7 @@ * Faces:: A face defines a graphics style for text characters: font, colors, etc. * Fringes:: Controlling window fringes. -* Scroll Bars:: Controlling vertical scroll bars. +* Scroll Bars:: Controlling scroll bars. * Window Dividers:: Separating windows visually. * Display Property:: Enabling special display features. * Images:: Displaying images in Emacs buffers. === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2014-10-04 07:05:21 +0000 +++ doc/lispref/frames.texi 2014-10-04 08:20:24 +0000 @@ -709,19 +709,21 @@ of the frame they should be on. The possible values are @code{left}, @code{right}, and @code{nil} for no scroll bars. -@ignore @vindex horizontal-scroll-bars, a frame parameter @item horizontal-scroll-bars -Whether the frame has scroll bars for horizontal scrolling -(non-@code{nil} means yes). Horizontal scroll bars are not currently -implemented. -@end ignore +Whether the frame has scroll bars for horizontal scrolling (@code{t} and +@code{bottom} mean yes, @code{nil} means no). @vindex scroll-bar-width, a frame parameter @item scroll-bar-width The width of vertical scroll bars, in pixels, or @code{nil} meaning to use the default width. +@vindex scroll-bar-height, a frame parameter +@item scroll-bar-height +The height of horizontal scroll bars, in pixels, or @code{nil} meaning +to use the default height. + @vindex left-fringe, a frame parameter @vindex right-fringe, a frame parameter @item left-fringe @@ -735,14 +737,6 @@ When using @code{set-frame-parameter}, passing a @code{nil} value imposes an actual default value of 8 pixels. -The combined fringe widths must add up to an integral number of -columns, so the actual default fringe widths for the frame, as -reported by @code{frame-parameter}, may be larger than what you -specify. Any extra width is distributed evenly between the left and -right fringe. However, you can force one fringe or the other to a -precise width by specifying that width as a negative integer. If both -widths are negative, only the left fringe gets the specified width. - @vindex right-divider-width, a frame parameter @item right-divider-width The width (thickness) reserved for the right divider (@pxref{Window === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2014-10-04 07:05:21 +0000 +++ doc/lispref/windows.texi 2014-10-04 08:20:24 +0000 @@ -394,13 +394,14 @@ @group ____________________________________________ |______________ Header Line ______________|RD| ^ - ^ |LS|LF|LM| |RM|RF|RS| | | + ^ |LS|LM|LF| |RF|RM|RS| | | | | | | | | | | | | | Window | | | | Text Area | | | | | Window Body | | | | | (Window Body) | | | | | Total Height | | | | | | | | | Height | | | | |<- Window Body Width ->| | | | | | v |__|__|__|_______________________|__|__|__| | | + |_________ Horizontal Scroll Bar _________| | | |_______________ Mode Line _______________|__| | |_____________ Bottom Divider _______________| v <---------- Window Total Width ------------> @@ -414,15 +415,15 @@ At the center of the window is the @dfn{text area}, or @dfn{body}, where the buffer text is displayed. The text area can be surrounded by a series of optional areas. On the left and right, from innermost to -outermost, these are the left and right margins, denoted by LM and RM in -the schematic (@pxref{Display Margins}); the left and right fringes, -denoted by LF and RF (@pxref{Fringes}); the left or right scroll bar, -only one of which is present at any time, denoted by LS and RS -(@pxref{Scroll Bars}); and the right divider, denoted by RD +outermost, these are the left and right fringes, denoted by LF and RF +(@pxref{Fringes}); the left and right margins, denoted by LM and RM in +the schematic (@pxref{Display Margins}); the left or right vertical +scroll bar, only one of which is present at any time, denoted by LS and +RS (@pxref{Scroll Bars}); and the right divider, denoted by RD (@pxref{Window Dividers}). At the top of the window is the header line -(@pxref{Header Lines}); at the bottom of the window is the mode line -(@pxref{Mode Line Format}) followed by the bottom divider (@pxref{Window -Dividers}). +(@pxref{Header Lines}). At the bottom of the window are the horizontal +scroll bar (@pxref{Scroll Bars}); the mode line (@pxref{Mode Line +Format}); and the bottom divider (@pxref{Window Dividers}). Emacs provides miscellaneous functions for finding the height and width of a window. The return value of many of these functions can be @@ -439,11 +440,8 @@ @cindex height of a window @cindex total height of a window The @dfn{total height} of a window is the number of lines comprising -the window's body, the header line, the mode line and the bottom divider -(if any). Note that the height of a frame is not the same as the height -of its root window (@pxref{Windows and Frames}), since a frame may also -contain an echo area, a menu bar, and a tool bar (@pxref{Size and -Position}). +the window's body, the header line, the horizontal scroll bar, the mode +line and the bottom divider (if any). @defun window-total-height &optional window round This function returns the total height, in lines, of the window @@ -457,8 +455,8 @@ parent window, the sum of the total heights of all its child windows internally equals the total height of their parent. This means that although two windows have the same pixel height, their internal total -heights may differ by one line. This means also, that if this window is -vertically combined and has a right sibling, the topmost row of that +heights may differ by one line. This means also, that if window is +vertically combined and has a next sibling, the topmost row of that sibling can be calculated as the sum of this window's topmost row and total height (@pxref{Coordinates and Windows}) @@ -490,11 +488,10 @@ equals the total width of their parent. This means that although two windows have the same pixel width, their internal total widths may differ by one column. This means also, that if this window is -horizontally combined and has a right sibling, the leftmost column of +horizontally combined and has a next sibling, the leftmost column of that sibling can be calculated as the sum of this window's leftmost -column and total width (@pxref{Coordinates and Windows}). The -optional argument @var{round} behaves as it does for -@code{window-total-height}. +column and total width (@pxref{Coordinates and Windows}). The optional +argument @var{round} behaves as it does for @code{window-total-height}. @end defun @defun window-total-size &optional window horizontal round @@ -517,9 +514,10 @@ This function returns the total height of window @var{window} in pixels. @var{window} must be a valid window and defaults to the selected one. -The return value includes mode and header line and a bottom divider, if -any. If @var{window} is an internal window, its pixel height is the -pixel height of the screen areas spanned by its children. +The return value includes mode and header line, a horizontal scroll bar +and a bottom divider, if any. If @var{window} is an internal window, +its pixel height is the pixel height of the screen areas spanned by its +children. @end defun @cindex window pixel height @@ -542,10 +540,12 @@ window has any adjacent windows. @defun window-full-height-p &optional window -This function returns non-@code{nil} if @var{window} has no other -window above or below it in its frame, i.e., its total height equals -the total height of the root window on that frame. If @var{window} is -omitted or @code{nil}, it defaults to the selected window. +This function returns non-@code{nil} if @var{window} has no other window +above or below it in its frame. More precisely, this means that the +total height of @var{window} equals the total height of the root window +on that frame. The minibuffer window does not count in this regard. If +@var{window} is omitted or @code{nil}, it defaults to the selected +window. @end defun @defun window-full-width-p &optional window @@ -559,7 +559,8 @@ @cindex body height of a window @cindex window body width The @dfn{body height} of a window is the height of its text area, which -does not include a mode or header line or a bottom divider. +does not include a mode or header line, a horizontal scroll bar, or a +bottom divider. @defun window-body-height &optional window pixelwise This function returns the height, in lines, of the body of window @@ -646,7 +647,8 @@ @defopt window-min-height This option specifies the minimum total height, in lines, of any window. Its value has to accommodate at least one text line as well as a mode -and header line and a bottom divider, if present. +and header line, a horizontal scroll bar and a bottom divider, if +present. @end defopt @defopt window-min-width @@ -685,10 +687,11 @@ The return value makes sure that all components of @var{window} remain fully visible if @var{window}'s size were actually set to it. With -@var{horizontal} @code{nil} it includes the mode and header line and the -bottom divider. With @var{horizontal} non-@code{nil} it includes the -fringes, a scroll bar, and a right divider, if present. It does not, -however, include the space reserved for the margins. +@var{horizontal} @code{nil} it includes the mode and header line, the +horizontal scroll bar and the bottom divider. With @var{horizontal} +non-@code{nil} it includes the fringes, a scroll bar, and a right +divider, if present. It does not, however, include the space reserved +for the margins. The optional argument @var{ignore}, if non-@code{nil}, means ignore restrictions imposed by fixed size windows, @code{window-min-height} or @@ -740,11 +743,11 @@ (@pxref{Window Sizes}). However, if the optional argument @var{ignore} is non-@code{nil}, this function ignores @code{window-min-height} and @code{window-min-width}, as well as @code{window-size-fixed}. Instead, -it considers the minimum-height window to be one consisting of a header, -a mode line and a bottom divider (if any), plus a text area one line -tall; and a minimum-width window as one consisting of fringes, margins, -a scroll bar and a right divider (if any), plus a text area two columns -wide. +it considers the minimum-height window to be one consisting of a header +and a mode line, a horizontal scrollbar and a bottom divider (if any), +plus a text area one line tall; and a minimum-width window as one +consisting of fringes, margins, a scroll bar and a right divider (if +any), plus a text area two columns wide. If the optional argument @var{pixelwise} is non-@code{nil}, @var{delta} is interpreted as pixels. === modified file 'etc/NEWS' --- etc/NEWS 2014-10-03 01:39:49 +0000 +++ etc/NEWS 2014-10-04 08:20:24 +0000 @@ -292,20 +292,28 @@ * Changes in Frames and Windows Code in Emacs 25.1 ++++ ** Emacs can now draw horizontal scroll bars on some platforms that -provide toolkit scroll bars, namely Gtk, Lucid, Motif and Windows. +provide toolkit scroll bars, namely Gtk+, Lucid, Motif and Windows. Horizontal scroll bars are turned off by default. *** New function `horizontal-scroll-bars-available-p' telling whether horizontal scroll bars are available on the underlying system. *** New mode `horizontal-scroll-bar-mode' to toggle horizontal scroll bars on all existing and future frames. +*** New function `toggle-horizontal-scroll-bar' to toggle horizontal + scroll bars on the selected frame. *** New frame parameters `horizontal-scroll-bars' and `scroll-bar-height' to set horizontal scroll bars and their height for individual frames and in `default-frame-alist'. -*** New function `frame-scroll-bar-height' to return the height of - horizontal scroll bars on a specific frame. +*** New functions `frame-scroll-bar-height' and + `window-scroll-bar-height' return the height of horizontal scroll + bars on a specific frame or window. *** `set-window-scroll-bars' now accepts five parameters where the last two specify height and type of the window's horizontal scroll bar. +*** `window-scroll-bars' now returns type and sizes of horizontal scroll + bars too. +*** New buffer-local variables `horizontal-scroll-bar' and + `scroll-bar-height'. ** The height of a frame's menu and tool bar are no more counted in the frame's text height. This means that the text height stands only for === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-04 07:27:10 +0000 +++ lisp/ChangeLog 2014-10-04 08:20:24 +0000 @@ -1,3 +1,13 @@ +2014-10-04 Martin Rudalics + + * window.el (window-full-height-p): Make it behave correctly for + minibuffer window. + (window-current-scroll-bars): Fix code. + (fit-frame-to-buffer): Use window-scroll-bar-height instead of + window-scroll-bars. + * frame.el (frame-current-scroll-bars): Fix doc-string. + * scroll-bar.el (toggle-horizontal-scroll-bar): New command. + 2014-10-04 Mark Oteiza (tiny change) * files.el (auto-mode-alist): Use sh-mode for .zsh files. (Bug#18488) === modified file 'lisp/frame.el' --- lisp/frame.el 2014-10-04 07:05:21 +0000 +++ lisp/frame.el 2014-10-04 08:20:24 +0000 @@ -1263,16 +1263,18 @@ (list (cons 'name name)))) (defun frame-current-scroll-bars (&optional frame) - "Return the current scroll-bar settings in frame FRAME. -Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies the -current location of the vertical scroll-bars (left, right, or nil), -and HORIZONTAL specifies the current location of the horizontal scroll -bars (top, bottom, or nil)." - (let ((vert (frame-parameter frame 'vertical-scroll-bars)) - (hor nil)) - (unless (memq vert '(left right nil)) - (setq vert default-frame-scroll-bars)) - (cons vert hor))) + "Return the current scroll-bar types for frame FRAME. +Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies +the current location of the vertical scroll-bars (`left', `right' +or nil), and HORIZONTAL specifies the current location of the +horizontal scroll bars (`bottom' or nil). FRAME must specify a +live frame and defaults to the selected one." + (let* ((frame (window-normalize-frame frame)) + (vertical (frame-parameter frame 'vertical-scroll-bars)) + (horizontal (frame-parameter frame 'horizontal-scroll-bars))) + (unless (memq vertical '(left right nil)) + (setq vertical default-frame-scroll-bars)) + (cons vertical (and horizontal 'bottom)))) (defun frame-monitor-attributes (&optional frame) "Return the attributes of the physical monitor dominating FRAME. === modified file 'lisp/scroll-bar.el' --- lisp/scroll-bar.el 2014-09-05 10:29:34 +0000 +++ lisp/scroll-bar.el 2014-10-04 08:20:24 +0000 @@ -79,7 +79,7 @@ (htype lines) ((frame-parameter nil 'horizontal-scroll-bars) ;; nil means it's a non-toolkit scroll bar (which is currently - ;; impossible), and its width in columns is 14 pixels rounded up. + ;; impossible), and its height in lines is 14 pixels rounded up. (ceiling (or (frame-parameter nil 'scroll-bar-height) 14) (frame-char-width))) (0)))) @@ -178,7 +178,7 @@ (defun toggle-scroll-bar (arg) "Toggle whether or not the selected frame has vertical scroll bars. -With arg, turn vertical scroll bars on if and only if arg is positive. +With ARG, turn vertical scroll bars on if and only if ARG is positive. The variable `scroll-bar-mode' controls which side the scroll bars are on when they are turned on; if it is nil, they go on the left." (interactive "P") @@ -193,6 +193,21 @@ (list (cons 'vertical-scroll-bars (if (> arg 0) (or scroll-bar-mode default-frame-scroll-bars)))))) + +(defun toggle-horizontal-scroll-bar (arg) + "Toggle whether or not the selected frame has horizontal scroll bars. +With ARG, turn vertical scroll bars on if and only if ARG is positive." + (interactive "P") + (if (null arg) + (setq arg + (if (cdr (assq 'horizontal-scroll-bars + (frame-parameters (selected-frame)))) + -1 1)) + (setq arg (prefix-numeric-value arg))) + (modify-frame-parameters + (selected-frame) + (list (cons 'horizontal-scroll-bars + (when (> arg 0) 'bottom))))) ;;;; Buffer navigation using the scroll bar. === modified file 'lisp/window.el' --- lisp/window.el 2014-09-22 19:20:45 +0000 +++ lisp/window.el 2014-10-04 08:20:24 +0000 @@ -1745,9 +1745,6 @@ (defalias 'window-height 'window-total-height) (defalias 'window-width 'window-body-width) -;; Eventually the following two should work pixelwise. - -;; See discussion in bug#4543. (defun window-full-height-p (&optional window) "Return t if WINDOW is as high as its containing frame. More precisely, return t if and only if the total height of @@ -1755,8 +1752,10 @@ frame. WINDOW must be a valid window and defaults to the selected one." (setq window (window-normalize-window window)) - (= (window-pixel-height window) - (window-pixel-height (frame-root-window window)))) + (if (window-minibuffer-p window) + (eq window (frame-root-window (window-frame window))) + (= (window-pixel-height window) + (window-pixel-height (frame-root-window window))))) (defun window-full-width-p (&optional window) "Return t if WINDOW is as wide as its containing frame. @@ -1780,28 +1779,26 @@ (window-body-height window pixelwise))) (defun window-current-scroll-bars (&optional window) - "Return the current scroll bar settings for WINDOW. + "Return the current scroll bar types for WINDOW. WINDOW must be a live window and defaults to the selected one. The return value is a cons cell (VERTICAL . HORIZONTAL) where VERTICAL specifies the current location of the vertical scroll -bars (`left', `right', or nil), and HORIZONTAL specifies the -current location of the horizontal scroll bars (`top', `bottom', -or nil). +bar (`left', `right' or nil), and HORIZONTAL specifies the +current location of the horizontal scroll bar (`bottom' or nil). Unlike `window-scroll-bars', this function reports the scroll bar type actually used, once frame defaults and `scroll-bar-mode' are taken into account." (setq window (window-normalize-window window t)) - (let ((vert (nth 2 (window-scroll-bars window))) - (hor nil)) - (when (or (eq vert t) (eq hor t)) - (let ((fcsb (frame-current-scroll-bars (window-frame window)))) - (if (eq vert t) - (setq vert (car fcsb))) - (if (eq hor t) - (setq hor (cdr fcsb))))) - (cons vert hor))) + (let ((vertical (nth 2 (window-scroll-bars window))) + (horizontal (nth 5 (window-scroll-bars window))) + (inherited (frame-current-scroll-bars (window-frame window)))) + (when (eq vertical t) + (setq vertical (car inherited))) + (when (eq horizontal t) + (setq horizontal (cdr inherited))) + (cons vertical (and horizontal 'bottom)))) (defun walk-windows (fun &optional minibuf all-frames) "Cycle through all live windows, calling FUN for each one. @@ -7176,7 +7173,7 @@ (height (+ (cdr value) (window-bottom-divider-width) - (nth 3 (window-scroll-bars))))) + (window-scroll-bar-height)))) ;; Don't change height or width when the window's size is fixed ;; in either direction or ONLY forbids it. (cond @@ -7335,7 +7332,7 @@ ;; height. Its width remains fixed. (setq height (+ (cdr (window-text-pixel-size nil nil t nil (frame-pixel-height) t)) - (nth 3 (window-scroll-bars window)) + (window-scroll-bar-height window) (window-bottom-divider-width))) ;; Round height. (unless pixelwise === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-03 16:05:12 +0000 +++ src/ChangeLog 2014-10-04 08:20:24 +0000 @@ -1,3 +1,10 @@ +2014-10-04 Martin Rudalics + + * buffer.c (scroll_bar_width, scroll_bar_height): Fix + doc-strings. + * window.c (Fset_window_scroll_bars): Fix doc-string. + (Fwindow_scroll_bars): Have it return what the doc-string says. + 2014-10-03 Eli Zaretskii * xdisp.c (move_it_by_lines): Call reseat_1 after moving the === modified file 'src/buffer.c' --- src/buffer.c 2014-10-01 03:28:16 +0000 +++ src/buffer.c 2014-10-04 08:20:24 +0000 @@ -5925,12 +5925,12 @@ DEFVAR_PER_BUFFER ("scroll-bar-width", &BVAR (current_buffer, scroll_bar_width), Qintegerp, - doc: /* Width of this buffer's scroll bars in pixels. + doc: /* Width of this buffer's vertical scroll bars in pixels. A value of nil means to use the scroll bar width from the window's frame. */); DEFVAR_PER_BUFFER ("scroll-bar-height", &BVAR (current_buffer, scroll_bar_height), Qintegerp, - doc: /* Height of this buffer's scroll bars in pixels. + doc: /* Height of this buffer's horizontal scroll bars in pixels. A value of nil means to use the scroll bar height from the window's frame. */); DEFVAR_PER_BUFFER ("vertical-scroll-bar", &BVAR (current_buffer, vertical_scroll_bar_type), === modified file 'src/window.c' --- src/window.c 2014-09-30 23:19:31 +0000 +++ src/window.c 2014-10-04 08:20:24 +0000 @@ -7002,16 +7002,17 @@ doc: /* Set width and type of scroll bars of window WINDOW. WINDOW must be a live window and defaults to the selected one. -Second parameter WIDTH specifies the pixel width for the scroll bar. +Second parameter WIDTH specifies the pixel width for the vertical scroll +bar. If WIDTH is nil, use the scroll-bar width of WINDOW's frame. Third parameter VERTICAL-TYPE specifies the type of the vertical scroll -bar: left, right, or nil. If WIDTH is nil, use the frame's scroll-bar -width. If VERTICAL-TYPE is t, use the frame's scroll-bar type. +bar: left, right, or nil. If VERTICAL-TYPE is t, this means use the +frame's scroll-bar type. -Fourth parameter HEIGHT specifies the pixel height for the scroll bar. -Fifth parameter HORIZONTAL-TYPE specifies the type of the vertical -scroll bar: nil, bottom, or t. If HEIGHT is nil, use the frame's -scroll-bar height. If HORIZONTAL-TYPE is t, use the frame's scroll-bar -type. +Fourth parameter HEIGHT specifies the pixel height for the horizontal +scroll bar. If HEIGHT is nil, use the scroll-bar height of WINDOW's +frame. Fifth parameter HORIZONTAL-TYPE specifies the type of the +horizontal scroll bar: nil, bottom, or t. If HORIZONTAL-TYPE is t, this +means to use the frame's horizontal scroll-bar type. Return t if scroll bars were actually changed and nil otherwise. */) (Lisp_Object window, Lisp_Object width, Lisp_Object vertical_type, @@ -7029,17 +7030,22 @@ doc: /* Get width and type of scroll bars of window WINDOW. WINDOW must be a live window and defaults to the selected one. -Value is a list of the form (WIDTH COLS VERTICAL-TYPE HEIGHT LINES -HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or TYPE is t, the window is -using the frame's corresponding value. */) +Value is a list of the form (WIDTH COLUMNS VERTICAL-TYPE HEIGHT LINES +HORIZONTAL-TYPE). If WIDTH or HEIGHT is nil or VERTICAL-TYPE or +HORIZONTAL-TYPE is t, the window is using the frame's corresponding +value. */) (Lisp_Object window) { struct window *w = decode_live_window (window); - return Fcons (make_number (WINDOW_SCROLL_BAR_AREA_WIDTH (w)), + return Fcons (((w->scroll_bar_width >= 0) + ? make_number (w->scroll_bar_width) + : Qnil), list5 (make_number (WINDOW_SCROLL_BAR_COLS (w)), w->vertical_scroll_bar_type, - make_number (WINDOW_SCROLL_BAR_AREA_HEIGHT (w)), + ((w->scroll_bar_height >= 0) + ? make_number (w->scroll_bar_height) + : Qnil), make_number (WINDOW_SCROLL_BAR_LINES (w)), w->horizontal_scroll_bar_type)); } ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.