commit 8242c3aa36e606498afe21c22a3369ae0e82b13d (HEAD, refs/remotes/origin/master) Author: Glenn Morris Date: Wed Jul 22 19:22:49 2015 -0400 * build-aux/update-subdirs: Put "no-update-autoloads: t" in output. diff --git a/build-aux/update-subdirs b/build-aux/update-subdirs index d544b22..f0ce039 100755 --- a/build-aux/update-subdirs +++ b/build-aux/update-subdirs @@ -47,6 +47,7 @@ else ;; Local" "Variables: ;; version-control: never ;; no-byte-compile: t +;; no-update-autoloads: t ;; End:" > subdirs.el~ if cmp "subdirs.el" "subdirs.el~" >/dev/null 2>&1; then rm subdirs.el~ commit a0b8421e3b246c73ce3f9c1bfc7cce32bc1fe883 Author: Dmitry Gutov Date: Wed Jul 22 23:08:50 2015 +0300 ; xref-find-regexp: (require 'grep), for grep-read-files diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 5f681b0..9d0dd77 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -773,6 +773,7 @@ With prefix argument, prompt for the identifier." With \\[universal-argument] prefix, you can specify the directory to search in, and the file name pattern to search for." (interactive (list (xref--read-identifier "Find regexp: "))) + (require 'grep) (let* ((proj (project-current)) (files (if current-prefix-arg (grep-read-files regexp) commit e48a116780dfe955023734190d83495da9aea24b Author: Eli Zaretskii Date: Wed Jul 22 18:35:16 2015 +0300 Fix point positioning in ffap-next-guess * lisp/ffap.el (ffap-url-at-point): Set ffap-string-at-point-region, as our callers expect. This was clobbered as part of fixing bug#5673. (Bug#21107) (ffap-gopher-at-point): Set ffap-string-at-point-region. diff --git a/lisp/ffap.el b/lisp/ffap.el index d78fd4c..81cba07 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -1086,16 +1086,25 @@ Assumes the buffer has not changed." (declare-function w3-view-this-url "ext:w3" (&optional no-show)) (defun ffap-url-at-point () - "Return URL from around point if it exists, or nil." + "Return URL from around point if it exists, or nil. + +Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." (when ffap-url-regexp (or (and (eq major-mode 'w3-mode) ; In a w3 buffer button? (w3-view-this-url t)) (let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp) - (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)) - (thing-at-point-url-at-point ffap-lax-url - (if (use-region-p) - (cons (region-beginning) - (region-end)))))))) + (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix) + val) + (setq val (thing-at-point-url-at-point ffap-lax-url + (if (use-region-p) + (cons (region-beginning) + (region-end))))) + (if val + (let ((bounds (thing-at-point-bounds-of-url-at-point + ffap-lax-url))) + (setq ffap-string-at-point-region + (list (car bounds) (cdr bounds))))) + val)))) (defvar ffap-gopher-regexp "^.*\\<\\(Type\\|Name\\|Path\\|Host\\|Port\\) *= *\\(.*\\) *$" @@ -1103,7 +1112,9 @@ Assumes the buffer has not changed." The two subexpressions are the KEY and VALUE.") (defun ffap-gopher-at-point () - "If point is inside a gopher bookmark block, return its URL." + "If point is inside a gopher bookmark block, return its URL. + +Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any." ;; `gopher-parse-bookmark' from gopher.el is not so robust (save-excursion (beginning-of-line) @@ -1112,6 +1123,7 @@ The two subexpressions are the KEY and VALUE.") (while (and (looking-at ffap-gopher-regexp) (not (bobp))) (forward-line -1)) (or (looking-at ffap-gopher-regexp) (forward-line 1)) + (setq ffap-string-at-point-region (list (point) (point))) (let ((type "1") path host (port "70")) (while (looking-at ffap-gopher-regexp) (let ((var (intern @@ -1122,6 +1134,7 @@ The two subexpressions are the KEY and VALUE.") (match-end 2)))) (set var val) (forward-line 1))) + (setcdr ffap-string-at-point-region (point)) (if (and path (string-match "^ftp:.*@" path)) (concat "ftp://" (substring path 4 (1- (match-end 0))) commit fa1463896d5048e0e43a9b55db1ed82c6441e693 Author: Martin Rudalics Date: Wed Jul 22 12:34:41 2015 +0200 Fix customization type of `even-window-sizes'. * lisp/window.el (even-window-sizes): Fix customization type. diff --git a/lisp/window.el b/lisp/window.el index 1a76ece..f15dd9b 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -6096,7 +6096,12 @@ Otherwise `display-buffer' will leave the window configuration alone. Special values are `height-only' to even heights only and `width-only' to even widths only. Any other value means to even any of them." - :type 'boolean + :type '(choice + (const :tag "Never" nil) + (const :tag "Side-by-side windows only" width-only) + (const :tag "Windows above or below only" height-only) + (const :tag "Always" t)) + :version "25.1" :group 'windows) (defvaralias 'even-window-heights 'even-window-sizes) commit 59526c325e7c857776bcfe7560d533391bf045b4 Author: Martin Rudalics Date: Wed Jul 22 12:20:13 2015 +0200 2015-07-22 Martin Rudalics Optionally even widths of `display-buffer' windows. (Bug#21100) * lisp/window.el (quit-restore-window): Restore width if requested. (display-buffer-record-window): Record width when window is reused and horizontally combined. (even-window-sizes): New option to allow evening window widths. (even-window-heights): Defalias to `even-window-sizes'. (window--even-window-heights): Rename to `window--even-window-sizes'. Handle side-by-side windows. (display-buffer-use-some-window): Call `window--even-window-sizes' instead of `window--even-window-heights'. * lisp/help.el (resize-temp-buffer-window): Fix indentation. * doc/lispref/windows.texi (Choosing Window Options): Describe `even-window-sizes'. (Coordinates and Windows): Fix typo. diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index b2bc637..750397c 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -2547,6 +2547,21 @@ least that many columns. If the value is @code{nil}, that means not to split this way. @end defopt +@defopt even-window-sizes +This variable, if non-nil, causes @code{display-buffer} to even window +sizes whenever it reuses an existing window and that window is adjacent +to the selected one. + +If its value is @code{width-only}, sizes are evened only if the reused +window is on the left or right of the selected one and the selected +window is wider than the reused one. If its value is @code{height-only} +sizes are evened only if the reused window is above or beneath the +selected window and the selected window is higher than the reused one. +Any other non-@code{nil} value means to even sizes in any of these cases +provided the selected window is larger than the reused one in the sense +of their combination. +@end defopt + @defopt pop-up-frames If the value of this variable is non-@code{nil}, that means @code{display-buffer} may display buffers by making new frames. The @@ -3690,7 +3705,7 @@ The coordinates are in the header line of @var{window}. The coordinates are in the divider separating @var{window} from a window on the right. -@item right-divider +@item bottom-divider The coordinates are in the divider separating @var{window} from a window beneath. diff --git a/etc/NEWS b/etc/NEWS index 69ebb72..666cccf 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1106,6 +1106,10 @@ and `window-divider-default-right-width'. how `switch-to-buffer' proceeds interactively when the selected window is strongly dedicated to its buffer. ++++ +** The option `even-window-heights' has been renamed to +`even-window-sizes' and now handles window widths as well. + ** Tearoff menus and detachable toolbars for Gtk+ has been removed. Those features have been deprecated in Gtk+ for a long time. diff --git a/lisp/help.el b/lisp/help.el index 1826cb7..46136d9 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1163,8 +1163,8 @@ size of WINDOW." (and (window-combined-p window t) fit-window-to-buffer-horizontally))) (and (eq quit-cadr 'frame) - fit-frame-to-buffer - (eq window (frame-root-window window)))) + fit-frame-to-buffer + (eq window (frame-root-window window)))) (fit-window-to-buffer window height nil width nil t)))) ;;; Help windows. diff --git a/lisp/window.el b/lisp/window.el index a4ed9ea..1a76ece 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4358,11 +4358,18 @@ nil means to not handle the buffer in a particular way. This (eq (nth 3 quit-restore) buffer)) ;; Show another buffer stored in quit-restore parameter. (when (and (integerp (nth 3 quad)) - (/= (nth 3 quad) (window-total-height window))) + (if (window-combined-p window) + (/= (nth 3 quad) (window-total-height window)) + (/= (nth 3 quad) (window-total-width window)))) ;; Try to resize WINDOW to its old height but don't signal an ;; error. (condition-case nil - (window-resize window (- (nth 3 quad) (window-total-height window))) + (window-resize + window + (- (nth 3 quad) (if (window-combined-p window) + (window-total-height window) + (window-total-width window))) + (window-combined-p window t)) (error nil))) (set-window-dedicated-p window nil) ;; Restore WINDOW's previous buffer, start and point position. @@ -5500,7 +5507,9 @@ element is BUFFER." ;; Preserve window-point-insertion-type (Bug#12588). (copy-marker (window-point window) window-point-insertion-type) - (window-total-height window)) + (if (window-combined-p window) + (window-total-height window) + (window-total-width window))) (selected-window) buffer))))) ((eq type 'window) ;; WINDOW has been created on an existing frame. @@ -6081,33 +6090,38 @@ represents a live window, nil otherwise." )) frame)))) -(defcustom even-window-heights t - "If non-nil `display-buffer' will try to even window heights. +(defcustom even-window-sizes t + "If non-nil `display-buffer' will try to even window sizes. Otherwise `display-buffer' will leave the window configuration -alone. Heights are evened only when `display-buffer' chooses a -window that appears above or below the selected window." +alone. Special values are `height-only' to even heights only and +`width-only' to even widths only. Any other value means to even +any of them." :type 'boolean :group 'windows) - -(defun window--even-window-heights (window) - "Even heights of WINDOW and selected window. -Do this only if these windows are vertically adjacent to each -other, `even-window-heights' is non-nil, and the selected window -is higher than WINDOW." - (when (and even-window-heights - ;; Even iff WINDOW forms a vertical combination with the - ;; selected window, and WINDOW's height exceeds that of the - ;; selected window, see also bug#11880. - (window-combined-p window) - (= (window-child-count (window-parent window)) 2) - (eq (window-parent) (window-parent window)) - (> (window-total-height) (window-total-height window))) - ;; Don't throw an error if we can't even window heights for - ;; whatever reason. - (condition-case nil - (enlarge-window - (/ (- (window-total-height window) (window-total-height)) 2)) - (error nil)))) +(defvaralias 'even-window-heights 'even-window-sizes) + +(defun window--even-window-sizes (window) + "Even sizes of WINDOW and selected window. +Even only if these windows are the only children of their parent, +`even-window-sizes' has the appropriate value and the selected +window is larger than WINDOW." + (when (and (= (window-child-count (window-parent window)) 2) + (eq (window-parent) (window-parent window))) + (cond + ((and (not (memq even-window-sizes '(nil height-only))) + (window-combined-p window t) + (> (window-total-width) (window-total-width window))) + (condition-case nil + (enlarge-window + (/ (- (window-total-width window) (window-total-width)) 2) t) + (error nil))) + ((and (not (memq even-window-sizes '(nil width-only))) + (window-combined-p window) + (> (window-total-height) (window-total-height window))) + (condition-case nil + (enlarge-window + (/ (- (window-total-height window) (window-total-height)) 2)) + (error nil)))))) (defun window--display-buffer (buffer window type &optional alist dedicated) "Display BUFFER in WINDOW. @@ -6767,7 +6781,7 @@ that frame." (prog1 (window--display-buffer buffer window 'reuse alist) - (window--even-window-heights window) + (window--even-window-sizes window) (unless (cdr (assq 'inhibit-switch-frame alist)) (window--maybe-raise-frame (window-frame window))))))) commit fed091f7c2513631d8c0570f444be9486d7563d1 Author: Stephen Leake Date: Wed Jul 22 04:29:38 2015 -0500 add file name to autoload error messages. * lisp/emacs-lisp/autoload.el (autoload-save-buffers): add condition-case to add file name to error message. diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 9d1abdd..12d0a94 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -524,117 +524,130 @@ different from OUTFILE, then OUTBUF is ignored. Return non-nil if and only if FILE adds no autoloads to OUTFILE \(or OUTBUF if OUTFILE is nil). The actual return value is FILE's modification time." - (let (load-name - (print-length nil) - (print-level nil) - (print-readably t) ; This does something in Lucid Emacs. - (float-output-format nil) - (visited (get-file-buffer file)) - (otherbuf nil) - (absfile (expand-file-name file)) - ;; nil until we found a cookie. - output-start) - (when - (catch 'done - (with-current-buffer (or visited - ;; It is faster to avoid visiting the file. - (autoload-find-file file)) - ;; Obey the no-update-autoloads file local variable. - (unless no-update-autoloads - (or noninteractive (message "Generating autoloads for %s..." file)) - (setq load-name - (if (stringp generated-autoload-load-name) - generated-autoload-load-name - (autoload-file-load-name absfile))) - ;; FIXME? Comparing file-names for equality with just equal - ;; is fragile, eg if one has an automounter prefix and one - ;; does not, but both refer to the same physical file. - (when (and outfile - (not - (if (memq system-type '(ms-dos windows-nt)) - (equal (downcase outfile) - (downcase (autoload-generated-file))) - (equal outfile (autoload-generated-file))))) - (setq otherbuf t)) - (save-excursion - (save-restriction - (widen) - (when autoload-builtin-package-versions - (let ((version (lm-header "version")) - package) - (and version - (setq version (ignore-errors (version-to-list version))) - (setq package (or (lm-header "package") - (file-name-sans-extension - (file-name-nondirectory file)))) - (setq output-start (autoload--setup-output - otherbuf outbuf absfile load-name)) - (let ((standard-output (marker-buffer output-start)) - (print-quoted t)) - (princ `(push (purecopy - ',(cons (intern package) version)) - package--builtin-versions)) - (princ "\n"))))) - - (goto-char (point-min)) - (while (not (eobp)) - (skip-chars-forward " \t\n\f") - (cond - ((looking-at (regexp-quote generate-autoload-cookie)) - ;; If not done yet, figure out where to insert this text. - (unless output-start - (setq output-start (autoload--setup-output - otherbuf outbuf absfile load-name))) - (autoload--print-cookie-text output-start load-name file)) - ((looking-at ";") - ;; Don't read the comment. - (forward-line 1)) - (t - (forward-sexp 1) - (forward-line 1)))))) - - (when output-start - (let ((secondary-autoloads-file-buf - (if otherbuf (current-buffer)))) - (with-current-buffer (marker-buffer output-start) - (save-excursion - ;; Insert the section-header line which lists the file name - ;; and which functions are in it, etc. - (goto-char output-start) - (let ((relfile (file-relative-name absfile))) - (autoload-insert-section-header - (marker-buffer output-start) - () load-name relfile - (if secondary-autoloads-file-buf - ;; MD5 checksums are much better because they do not - ;; change unless the file changes (so they'll be - ;; equal on two different systems and will change - ;; less often than time-stamps, thus leading to fewer - ;; unneeded changes causing spurious conflicts), but - ;; using time-stamps is a very useful optimization, - ;; so we use time-stamps for the main autoloads file - ;; (loaddefs.el) where we have special ways to - ;; circumvent the "random change problem", and MD5 - ;; checksum in secondary autoload files where we do - ;; not need the time-stamp optimization because it is - ;; already provided by the primary autoloads file. - (md5 secondary-autoloads-file-buf - ;; We'd really want to just use - ;; `emacs-internal' instead. - nil nil 'emacs-mule-unix) - (nth 5 (file-attributes relfile)))) - (insert ";;; Generated autoloads from " relfile "\n"))) - (insert generate-autoload-section-trailer)))) - (or noninteractive - (message "Generating autoloads for %s...done" file))) - (or visited - ;; We created this buffer, so we should kill it. - (kill-buffer (current-buffer)))) - (or (not output-start) - ;; If the entries were added to some other buffer, then the file - ;; doesn't add entries to OUTFILE. - otherbuf)) - (nth 5 (file-attributes absfile))))) + ;; Include the file name in any error messages + (condition-case err + (let (load-name + (print-length nil) + (print-level nil) + (print-readably t) ; This does something in Lucid Emacs. + (float-output-format nil) + (visited (get-file-buffer file)) + (otherbuf nil) + (absfile (expand-file-name file)) + ;; nil until we found a cookie. + output-start) + (when + (catch 'done + (with-current-buffer (or visited + ;; It is faster to avoid visiting the file. + (autoload-find-file file)) + ;; Obey the no-update-autoloads file local variable. + (unless no-update-autoloads + (or noninteractive (message "Generating autoloads for %s..." file)) + (setq load-name + (if (stringp generated-autoload-load-name) + generated-autoload-load-name + (autoload-file-load-name absfile))) + ;; FIXME? Comparing file-names for equality with just equal + ;; is fragile, eg if one has an automounter prefix and one + ;; does not, but both refer to the same physical file. + (when (and outfile + (not + (if (memq system-type '(ms-dos windows-nt)) + (equal (downcase outfile) + (downcase (autoload-generated-file))) + (equal outfile (autoload-generated-file))))) + (setq otherbuf t)) + (save-excursion + (save-restriction + (widen) + (when autoload-builtin-package-versions + (let ((version (lm-header "version")) + package) + (and version + (setq version (ignore-errors (version-to-list version))) + (setq package (or (lm-header "package") + (file-name-sans-extension + (file-name-nondirectory file)))) + (setq output-start (autoload--setup-output + otherbuf outbuf absfile load-name)) + (let ((standard-output (marker-buffer output-start)) + (print-quoted t)) + (princ `(push (purecopy + ',(cons (intern package) version)) + package--builtin-versions)) + (princ "\n"))))) + + (goto-char (point-min)) + (while (not (eobp)) + (skip-chars-forward " \t\n\f") + (cond + ((looking-at (regexp-quote generate-autoload-cookie)) + ;; If not done yet, figure out where to insert this text. + (unless output-start + (setq output-start (autoload--setup-output + otherbuf outbuf absfile load-name))) + (autoload--print-cookie-text output-start load-name file)) + ((looking-at ";") + ;; Don't read the comment. + (forward-line 1)) + (t + (forward-sexp 1) + (forward-line 1)))))) + + (when output-start + (let ((secondary-autoloads-file-buf + (if otherbuf (current-buffer)))) + (with-current-buffer (marker-buffer output-start) + (save-excursion + ;; Insert the section-header line which lists the file name + ;; and which functions are in it, etc. + (goto-char output-start) + (let ((relfile (file-relative-name absfile))) + (autoload-insert-section-header + (marker-buffer output-start) + () load-name relfile + (if secondary-autoloads-file-buf + ;; MD5 checksums are much better because they do not + ;; change unless the file changes (so they'll be + ;; equal on two different systems and will change + ;; less often than time-stamps, thus leading to fewer + ;; unneeded changes causing spurious conflicts), but + ;; using time-stamps is a very useful optimization, + ;; so we use time-stamps for the main autoloads file + ;; (loaddefs.el) where we have special ways to + ;; circumvent the "random change problem", and MD5 + ;; checksum in secondary autoload files where we do + ;; not need the time-stamp optimization because it is + ;; already provided by the primary autoloads file. + (md5 secondary-autoloads-file-buf + ;; We'd really want to just use + ;; `emacs-internal' instead. + nil nil 'emacs-mule-unix) + (nth 5 (file-attributes relfile)))) + (insert ";;; Generated autoloads from " relfile "\n"))) + (insert generate-autoload-section-trailer)))) + (or noninteractive + (message "Generating autoloads for %s...done" file))) + (or visited + ;; We created this buffer, so we should kill it. + (kill-buffer (current-buffer)))) + (or (not output-start) + ;; If the entries were added to some other buffer, then the file + ;; doesn't add entries to OUTFILE. + otherbuf)) + (nth 5 (file-attributes absfile)))) + (error + ;; Probably unbalanced parens in forward-sexp. In that case, the + ;; condition is scan-error, and the signal data includes point + ;; where the error was found; we'd like to convert that to + ;; line:col, but line-number-at-pos gets the wrong line in batch + ;; mode for some reason. + ;; + ;; At least this gets the file name in the error message; the + ;; developer can use goto-char to get to the error position. + (error "%s:0:0: error: %s: %s" file (car err) (cdr err))) + )) (defun autoload-save-buffers () (while autoload-modified-buffers