------------------------------------------------------------ revno: 116766 committer: Dmitry Gutov branch nick: trunk timestamp: Sat 2014-03-15 05:07:06 +0200 message: Update `blink-matching-paren' in the manual * doc/emacs/programs.texi (Matching): Update WRT to the new `blink-matchin-paren' behavior. * doc/lispref/display.texi (Blinking): Update WRT to the new `blink-matchin-paren' behavior. diff: === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-03-13 05:27:28 +0000 +++ doc/emacs/ChangeLog 2014-03-15 03:07:06 +0000 @@ -1,3 +1,8 @@ +2014-03-15 Dmitry Gutov + + * programs.texi (Matching): Update WRT to the new + `blink-matchin-paren' behavior. + 2014-03-13 Paul Eggert * mule.texi (International, Language Environments): Update === modified file 'doc/emacs/programs.texi' --- doc/emacs/programs.texi 2014-02-28 03:02:50 +0000 +++ doc/emacs/programs.texi 2014-03-15 03:07:06 +0000 @@ -813,13 +813,13 @@ @itemize @bullet @item @code{blink-matching-paren} turns the feature on or off: @code{nil} -disables it, but the default is @code{t} to enable it. +disables it, but the default is @code{t} to enable it. Set it to +@code{jump} to make indication work through cursor movement. @item -@code{blink-matching-delay} says how many seconds to leave the cursor -on the matching opening delimiter, before bringing it back to the real -location of point. This may be an integer or floating-point number; -the default is 1. +@code{blink-matching-delay} says how many seconds to keep indicating +the matching opening delimiter. This may be an integer or +floating-point number; the default is 1. @item @code{blink-matching-paren-distance} specifies how many characters === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-14 10:38:46 +0000 +++ doc/lispref/ChangeLog 2014-03-15 03:07:06 +0000 @@ -1,3 +1,8 @@ +2014-03-15 Dmitry Gutov + + * display.texi (Blinking): Update WRT to the new + `blink-matchin-paren' behavior. + 2014-03-14 Martin Rudalics * display.texi (Temporary Displays): Say that === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2014-03-14 10:38:46 +0000 +++ doc/lispref/display.texi 2014-03-15 03:07:06 +0000 @@ -5957,18 +5957,19 @@ @end defopt @defopt blink-matching-delay -This variable specifies the number of seconds for the cursor to remain -at the matching parenthesis. A fraction of a second often gives -good results, but the default is 1, which works on all systems. +This variable specifies the number of seconds to keep indicating the +matching parenthesis. A fraction of a second often gives good +results, but the default is 1, which works on all systems. @end defopt @deffn Command blink-matching-open This function is the default value of @code{blink-paren-function}. It -assumes that point follows a character with close parenthesis syntax and -moves the cursor momentarily to the matching opening character. If that -character is not already on the screen, it displays the character's -context in the echo area. To avoid long delays, this function does not -search farther than @code{blink-matching-paren-distance} characters. +assumes that point follows a character with close parenthesis syntax +and applies the appropriate effect momentarily to the matching opening +character. If that character is not already on the screen, it +displays the character's context in the echo area. To avoid long +delays, this function does not search farther than +@code{blink-matching-paren-distance} characters. Here is an example of calling this function explicitly. === modified file 'etc/NEWS' --- etc/NEWS 2014-03-14 18:29:43 +0000 +++ etc/NEWS 2014-03-15 03:07:06 +0000 @@ -423,6 +423,7 @@ This searches the region for identical lines, and removes all but one copy of each repeated line. The lines need not be sorted. ++++ ** `blink-matching-paren' now only highlights the matching open-paren by default, instead of moving cursor. Set this variable to `jump' to enable the old behavior. ------------------------------------------------------------ revno: 116765 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-14 16:55:40 -0400 message: * package.el (package-menu-mode-map): Replace use of obsolete function alias. Tweak menu item text. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 20:51:22 +0000 +++ lisp/ChangeLog 2014-03-14 20:55:40 +0000 @@ -1,5 +1,8 @@ 2014-03-14 Glenn Morris + * emacs-lisp/package.el (package-menu-mode-map): + Replace use of obsolete function alias. Tweak menu item text. + * info.el (Info-finder-find-node): Ignore the `emacs' metapackage. (Bug#10813) === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-03-13 13:34:01 +0000 +++ lisp/emacs-lisp/package.el 2014-03-14 20:55:40 +0000 @@ -1626,7 +1626,7 @@ '(menu-item "Help" package-menu-quick-help :help "Show short key binding help for package-menu-mode")) (define-key menu-map [mc] - '(menu-item "View Commentary" package-menu-view-commentary + '(menu-item "Describe Package" package-menu-describe-package :help "Display information about this package")) map) "Local keymap for `package-menu-mode' buffers.") ------------------------------------------------------------ revno: 116764 fixes bug: http://debbugs.gnu.org/10813 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-14 16:51:22 -0400 message: * lisp/info.el (Info-finder-find-node): Ignore the `emacs' metapackage. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 20:41:01 +0000 +++ lisp/ChangeLog 2014-03-14 20:51:22 +0000 @@ -1,5 +1,8 @@ 2014-03-14 Glenn Morris + * info.el (Info-finder-find-node): + Ignore the `emacs' metapackage. (Bug#10813) + * finder.el (finder-list-matches): Include unversioned packages in the result of a keyword search. === modified file 'lisp/info.el' --- lisp/info.el 2014-02-28 02:16:02 +0000 +++ lisp/info.el 2014-03-14 20:51:22 +0000 @@ -3698,7 +3698,9 @@ hits desc) (dolist (keyword keywords) (push (copy-tree (gethash keyword finder-keywords-hash)) hits)) - (setq hits (delete-dups (apply 'append hits))) + (setq hits (delete-dups (apply 'append hits)) + ;; Not a meaningful package. + hits (delete 'emacs hits)) (dolist (package hits) (setq desc (cdr-safe (assq package package--builtins))) (when (vectorp desc) @@ -3713,6 +3715,9 @@ (insert "*****************\n\n") (insert "Commentary section of the package `" nodename "':\n\n") + ;; FIXME this assumes that a file named package.el exists, + ;; which is not always true. E.g. for the nxml package, + ;; there is no "nxml.el" (it's nxml-mode.el). (let ((str (lm-commentary (find-library-name nodename)))) (if (null str) (insert "Can't find any Commentary section\n\n") ------------------------------------------------------------ revno: 116763 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-14 16:41:01 -0400 message: * lisp/finder.el (finder-list-matches): Include unversioned packages in the result of a keyword search. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 19:24:04 +0000 +++ lisp/ChangeLog 2014-03-14 20:41:01 +0000 @@ -1,5 +1,8 @@ 2014-03-14 Glenn Morris + * finder.el (finder-list-matches): Include unversioned packages + in the result of a keyword search. + * finder.el (finder--builtins-descriptions): New constant. (finder-compile-keywords): Use finder--builtins-descriptions. === modified file 'lisp/finder.el' --- lisp/finder.el 2014-03-14 19:24:04 +0000 +++ lisp/finder.el 2014-03-14 20:41:01 +0000 @@ -353,7 +353,8 @@ (packages (gethash id finder-keywords-hash))) (unless packages (error "No packages matching key `%s'" key)) - (package-show-package-list packages))) + (let ((package-list-unversioned t)) + (package-show-package-list packages)))) (define-button-type 'finder-xref 'action #'finder-goto-xref) ------------------------------------------------------------ revno: 116762 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-14 15:24:04 -0400 message: * lisp/finder.el (finder--builtins-descriptions): New constant. (finder-compile-keywords): Use finder--builtins-descriptions. This avoids us getting silly descriptions in finder-inf.el like (emacs . [nil nil "abbrev mode commands for Emacs"]) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 18:01:39 +0000 +++ lisp/ChangeLog 2014-03-14 19:24:04 +0000 @@ -1,3 +1,8 @@ +2014-03-14 Glenn Morris + + * finder.el (finder--builtins-descriptions): New constant. + (finder-compile-keywords): Use finder--builtins-descriptions. + 2014-03-14 Dmitry Gutov * simple.el (blink-matching-paren): Describe the new value, === modified file 'lisp/finder.el' --- lisp/finder.el 2014-03-14 18:00:08 +0000 +++ lisp/finder.el 2014-03-14 19:24:04 +0000 @@ -140,6 +140,17 @@ (autoload 'autoload-rubric "autoload") +(defconst finder--builtins-descriptions + ;; I have no idea whether these are supposed to be capitalized + ;; and/or end in a full-stop. Existing file headers are inconsistent, + ;; but mainly seem to not do so. + '((emacs . "the extensible text editor") + (nxml . "a new XML mode")) + "Alist of built-in package descriptions. +Entries have the form (PACKAGE-SYMBOL . DESCRIPTION). +When generating `package--builtins', this overrides what the description +would otherwise be.") + (defvar finder--builtins-alist '(("calc" . calc) ("ede" . ede) @@ -155,6 +166,10 @@ ("decorate" . semantic) ("symref" . semantic) ("wisent" . semantic) + ;; This should really be ("nxml" . nxml-mode), because nxml-mode.el + ;; is the main file for the package. Then we would not need an + ;; entry in finder--builtins-descriptions. But I do not know if + ;; it is safe to change this, in case it is already in use. ("nxml" . nxml) ("org" . org) ("srecode" . srecode) @@ -202,16 +217,19 @@ ;; but it does not, because the duplicates are (at time of writing) ;; all due to files in cedet, which end up with package-override set. ;; FIXME this is obviously fragile. -;; Make the (eq base-name package) case below issue a warning? +;; Make the (eq base-name package) case below issue a warning if +;; package-override is nil? ;; (push base-name processed) (with-temp-buffer (insert-file-contents (expand-file-name f d)) - (setq summary (lm-synopsis) - keywords (mapcar 'intern (lm-keywords-list)) + (setq keywords (mapcar 'intern (lm-keywords-list)) package (or package-override (let ((str (lm-header "package"))) (if str (intern str))) base-name) + summary (or (cdr + (assq package finder--builtins-descriptions)) + (lm-synopsis)) version (lm-header "version"))) (when summary (setq version (ignore-errors (version-to-list version))) @@ -220,6 +238,9 @@ (push (cons package (package-make-builtin version summary)) package--builtins)) + ;; The idea here is that eg calc.el gets to define + ;; the description of the calc package. + ;; This does not work for eg nxml-mode.el. ((eq base-name package) (setq desc (cdr entry)) (aset desc 0 version) ------------------------------------------------------------ revno: 116761 committer: Dmitry Gutov branch nick: trunk timestamp: Fri 2014-03-14 20:29:43 +0200 message: * NEWS: Fix the last change. Author: diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-14 18:01:39 +0000 +++ etc/NEWS 2014-03-14 18:29:43 +0000 @@ -423,7 +423,6 @@ This searches the region for identical lines, and removes all but one copy of each repeated line. The lines need not be sorted. ---- ** `blink-matching-paren' now only highlights the matching open-paren by default, instead of moving cursor. Set this variable to `jump' to enable the old behavior. ------------------------------------------------------------ revno: 116760 fixes bug: http://debbugs.gnu.org/17008 committer: Dmitry Gutov branch nick: trunk timestamp: Fri 2014-03-14 20:01:39 +0200 message: Support the old `blink-matching-paren' behavior * lisp/simple.el (blink-matching-paren): Describe the new value, `jump', enabling the old behavior. (blink-matching-open): Use that value. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-12 07:14:30 +0000 +++ etc/NEWS 2014-03-14 18:01:39 +0000 @@ -423,6 +423,11 @@ This searches the region for identical lines, and removes all but one copy of each repeated line. The lines need not be sorted. +--- +** `blink-matching-paren' now only highlights the matching open-paren +by default, instead of moving cursor. Set this variable to `jump' to +enable the old behavior. + * Changes in Specialized Modes and Packages in Emacs 24.4 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 17:54:12 +0000 +++ lisp/ChangeLog 2014-03-14 18:01:39 +0000 @@ -1,3 +1,9 @@ +2014-03-14 Dmitry Gutov + + * simple.el (blink-matching-paren): Describe the new value, + `jump', enabling the old behavior. + (blink-matching-open): Use that value. (Bug#17008) + 2014-03-14 Glenn Morris * finder.el (finder-no-scan-regexp): Add leim-list. === modified file 'lisp/simple.el' --- lisp/simple.el 2014-03-11 17:10:07 +0000 +++ lisp/simple.el 2014-03-14 18:01:39 +0000 @@ -6341,8 +6341,12 @@ :group 'paren-matching) (defcustom blink-matching-paren t - "Non-nil means show matching open-paren when close-paren is inserted." - :type 'boolean + "Non-nil means show matching open-paren when close-paren is inserted. +If t, highlight the paren. If `jump', move cursor to its position." + :type '(choice + (const :tag "Disable" nil) + (const :tag "Highlight" t) + (const :tag "Move cursor" jump)) :group 'paren-blinking) (defcustom blink-matching-paren-on-screen t @@ -6452,17 +6456,21 @@ (message "No matching parenthesis found")))) ((not blinkpos) nil) ((pos-visible-in-window-p blinkpos) - ;; Matching open within window, temporarily highlight char - ;; after blinkpos but only if `blink-matching-paren-on-screen' + ;; Matching open within window, temporarily move to or highlight + ;; char after blinkpos but only if `blink-matching-paren-on-screen' ;; is non-nil. (and blink-matching-paren-on-screen (not show-paren-mode) - (unwind-protect - (progn - (move-overlay blink-matching--overlay blinkpos (1+ blinkpos) - (current-buffer)) + (if (eq blink-matching-paren 'jump) + (save-excursion + (goto-char blinkpos) (sit-for blink-matching-delay)) - (delete-overlay blink-matching--overlay)))) + (unwind-protect + (progn + (move-overlay blink-matching--overlay blinkpos (1+ blinkpos) + (current-buffer)) + (sit-for blink-matching-delay)) + (delete-overlay blink-matching--overlay))))) (t (save-excursion (goto-char blinkpos) ------------------------------------------------------------ revno: 116759 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-14 14:00:08 -0400 message: * lisp/finder.el: Tweak previous change. diff: === modified file 'lisp/finder.el' --- lisp/finder.el 2014-03-14 17:54:12 +0000 +++ lisp/finder.el 2014-03-14 18:00:08 +0000 @@ -177,7 +177,7 @@ (setq package--builtins nil) (setq finder-keywords-hash (make-hash-table :test 'eq)) (let ((el-file-regexp "^\\([^=].*\\)\\.el\\(\\.\\(gz\\|Z\\)\\)?$") - package-override files base-name processed + package-override files base-name ; processed summary keywords package version entry desc) (dolist (d (or dirs load-path)) (when (file-exists-p (directory-file-name d)) @@ -192,8 +192,8 @@ (unless (or (string-match finder-no-scan-regexp f) (null (setq base-name (and (string-match el-file-regexp f) - (intern (match-string 1 f))))) - (memq base-name processed)) + (intern (match-string 1 f)))))) +;; (memq base-name processed)) ;; There are multiple files in the tree with the same basename. ;; So skipping files based on basename means you randomly (depending ;; on which order the files are traversed in) miss some packages. ------------------------------------------------------------ revno: 116758 fixes bug: http://debbugs.gnu.org/14010 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-14 13:54:12 -0400 message: Stop files with same basename messing up finder's package--builtins * lisp/Makefile.in (setwins_finder): New, excluding leim. (finder-data): Use setwins_finder. * lisp/finder.el (finder-no-scan-regexp): Add leim-list. (finder-compile-keywords): Don't skip files with same basename. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 00:32:41 +0000 +++ lisp/ChangeLog 2014-03-14 17:54:12 +0000 @@ -1,5 +1,11 @@ 2014-03-14 Glenn Morris + * finder.el (finder-no-scan-regexp): Add leim-list. + (finder-compile-keywords): + Don't skip files with same basename. (Bug#14010) + * Makefile.in (setwins_finder): New, excluding leim. + (finder-data): Use setwins_finder. + * help-fns.el (help-split-fundoc, help-add-fundoc-usage) (help-function-arglist, help-make-usage): Move from here... * help.el (help-split-fundoc, help-add-fundoc-usage) === modified file 'lisp/Makefile.in' --- lisp/Makefile.in 2014-01-20 07:56:28 +0000 +++ lisp/Makefile.in 2014-03-14 17:54:12 +0000 @@ -124,6 +124,15 @@ esac; \ done +# Find all subdirectories except `obsolete', `term', and `leim' (and subdirs). +# We don't want the leim files listed as packages, especially +# since many share basenames with files in language/. +setwins_finder=for file in `find ${srcdir} -type d -print`; do \ + case $$file in ${srcdir}*/obsolete | ${srcdir}*/term | ${srcdir}*/leim* ) ;; \ + *) wins="$$wins$${wins:+ }$$file" ;; \ + esac; \ + done + # Find all subdirectories in which we might want to create subdirs.el. setwins_for_subdirs=for file in `find ${srcdir} -type d -print`; do \ case $$file in \ @@ -166,7 +175,7 @@ $(lisp)/finder-inf.el: $(MAKE) $(MFLAGS) finder-data finder-data: doit - $(setwins_almost); \ + $(setwins_finder); \ echo Directories: $$wins; \ $(emacs) -l finder \ --eval '(setq generated-finder-keywords-file (unmsys--file-name "$(srcdir)/finder-inf.el"))' \ === modified file 'lisp/finder.el' --- lisp/finder.el 2014-03-05 13:09:17 +0000 +++ lisp/finder.el 2014-03-14 17:54:12 +0000 @@ -135,7 +135,7 @@ ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00469.html ;; ldefs-boot is not auto-generated, but has nothing useful. (defvar finder-no-scan-regexp "\\(^\\.#\\|\\(loaddefs\\|ldefs-boot\\|\ -cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" +cus-load\\|finder-inf\\|esh-groups\\|subdirs\\|leim-list\\)\\.el$\\)" "Regexp matching file names not to scan for keywords.") (autoload 'autoload-rubric "autoload") @@ -194,7 +194,16 @@ (and (string-match el-file-regexp f) (intern (match-string 1 f))))) (memq base-name processed)) - (push base-name processed) +;; There are multiple files in the tree with the same basename. +;; So skipping files based on basename means you randomly (depending +;; on which order the files are traversed in) miss some packages. +;; http://debbugs.gnu.org/14010 +;; You might think this could lead to two files providing the same package, +;; but it does not, because the duplicates are (at time of writing) +;; all due to files in cedet, which end up with package-override set. +;; FIXME this is obviously fragile. +;; Make the (eq base-name package) case below issue a warning? +;; (push base-name processed) (with-temp-buffer (insert-file-contents (expand-file-name f d)) (setq summary (lm-synopsis) ------------------------------------------------------------ revno: 116757 committer: Rüdiger Sonderfeld branch nick: trunk timestamp: Fri 2014-03-14 18:03:30 +0100 message: * etc/tutorials/TUTORIAL.de: Adapt to recent changes in TUTORIAL. Thanks to Jorgen Schäfer for help with the translation. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-03-10 18:12:25 +0000 +++ etc/ChangeLog 2014-03-14 17:03:30 +0000 @@ -1,3 +1,8 @@ +2014-03-14 Rüdiger Sonderfeld + + * tutorials/TUTORIAL.de: Adapt to recent changes in TUTORIAL. + Thanks to Jorgen Schäfer for help with the translation. + 2014-03-10 Paul Eggert Fix "\" problem in tutorials by using natural-language quotes. === modified file 'etc/tutorials/TUTORIAL.de' --- etc/tutorials/TUTORIAL.de 2014-01-01 07:43:34 +0000 +++ etc/tutorials/TUTORIAL.de 2014-03-14 17:03:30 +0000 @@ -411,6 +411,19 @@ >> Geben Sie ein, um wieder ein Zeilenvorschubzeichen einzufügen. +Die -Taste ist insofern besonders, als dass sie mehr bewirken +kann, als einfach ein Zeilenvorschubszeichen einzufügen. Abhängig vom +umgebenden Text können zusätzliche Leerzeichen eingefügt werden, damit +der neue Zeilenanfang bündig zur vorherigen Zeile ist. Wir nennen +dieses Verhalten (wenn das Drücken einer Taste mehr bewirkt, als nur +das entsprechende Zeichen einzufügen) »electric«. + +>> Ein Beispiel für dieses Verhalten von . + Drücken Sie am Ende dieser Zeile. + +Sie sollten sehen, dass sich nach dem Einfügen des +Zeilenvorschubzeichen der Cursor unter dem »D« von »Drücken« befindet. + Denken Sie daran, dass die meisten Emacs-Befehle mit einem Wiederholungszähler aufgerufen werden können. Tun Sie das mit einem Textzeichen, dann wird es entsprechend dem numerischen Parameter ------------------------------------------------------------ revno: 116756 committer: martin rudalics branch nick: trunk timestamp: Fri 2014-03-14 11:38:46 +0100 message: Document pixelwise frame resizing and fix related bug on Windows. * w32term.c (x_set_window_size): When frame-resize-pixelwise is nil, always resize character wise to avoid potential loss of the mode line (Bug#16923 related). * display.texi (Temporary Displays): Say that with-temp-buffer-window makes its buffer current. * frames.texi (Size and Position): Describe new option `frame-resize-pixelwise'. Rewrite descriptions of `set-frame-size', `set-frame-height' and `set-frame-width'. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-10 17:33:52 +0000 +++ doc/lispref/ChangeLog 2014-03-14 10:38:46 +0000 @@ -1,3 +1,11 @@ +2014-03-14 Martin Rudalics + + * display.texi (Temporary Displays): Say that + with-temp-buffer-window makes its buffer current. + * frames.texi (Size and Position): Describe new option + `frame-resize-pixelwise'. Rewrite descriptions of + `set-frame-size', `set-frame-height' and `set-frame-width'. + 2014-03-09 Martin Rudalics * elisp.texi (Top): Rename section "Width" to "Size of Displayed === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2014-03-09 11:36:51 +0000 +++ doc/lispref/display.texi 2014-03-14 10:38:46 +0000 @@ -1175,12 +1175,11 @@ @end defvar @defmac with-temp-buffer-window buffer-or-name action quit-function forms@dots{} -This macro is similar to @code{with-output-to-temp-buffer}. -Like that construct, it executes @var{forms} while arranging to insert -any output they print into the buffer named @var{buffer-or-name}. -Finally, the buffer is displayed in some window, but not selected. -Unlike @code{with-output-to-temp-buffer}, this does not switch to Help -mode. +This macro is similar to @code{with-output-to-temp-buffer}. Like that +construct, it executes @var{forms} while arranging to insert any output +they print into the buffer named @var{buffer-or-name} and displays the +buffer in some window. Unlike @code{with-output-to-temp-buffer}, +however, this makes the buffer current and does not switch to Help mode. The argument @var{buffer-or-name} specifies the temporary buffer. It can be either a buffer, which must already exist, or a string, === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2014-03-09 11:36:51 +0000 +++ doc/lispref/frames.texi 2014-03-14 10:38:46 +0000 @@ -1147,21 +1147,46 @@ frame. @end defun -@defun set-frame-size frame cols rows +@defopt frame-resize-pixelwise +If this option is @code{nil}, a frame's size is usually rounded to a +multiple of the current values of that frame's @code{frame-char-height} +and @code{frame-char-width}. If this is non-@code{nil}, no rounding +occurs, hence frame sizes can increase/decrease by one pixel. + +Setting this causes the next resize operation to pass the corresponding +size hints to the window manager. This means that this variable should +be set only in a user's initial file; applications should never bind it +temporarily. + +The precise semantics of a value of @code{nil} for this option depends +on the toolkit used: Dragging the frame border with the mouse is usually +always done character-wise. Calling @code{set-frame-size} (see below) +with arguments that do not specify the frame size as an integer multiple +of its character size may be, however, either ignored or cause a +rounding (GTK+, Windows) or get accepted (Lucid, Motif). This also +means that with some toolkits and a display whose size is not an +integral multiple of your default font, you may have to set this to +non-@code{nil} in order to fully maximize a frame. +@end defopt + +@defun set-frame-size frame width height pixelwise This function sets the size of @var{frame}, measured in characters; -@var{cols} and @var{rows} specify the new width and height. +@var{width} and @var{height} specify the new width in columns and the +new height in lines. -To set the size based on values measured in pixels, use -@code{frame-char-height} and @code{frame-char-width} to convert -them to units of characters. +The optional argument @var{pixelwise} non-@code{nil} means to measure +the new width and height in units of pixels instead. Note that if +@code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to +fully honor the request if it does not increase/decrease the frame size +to a multiple of its character size. @end defun -@defun set-frame-height frame lines &optional pretend -This function resizes @var{frame} to a height of @var{lines} lines. The +@defun set-frame-height frame height &optional pretend pixelwise +This function resizes @var{frame} to a height of @var{height} lines. The sizes of existing windows in @var{frame} are altered proportionally to fit. -If @var{pretend} is non-@code{nil}, then Emacs displays @var{lines} +If @var{pretend} is non-@code{nil}, then Emacs displays @var{height} lines of output in @var{frame}, but does not change its value for the actual height of the frame. This is only useful on text terminals. Using a smaller height than the terminal actually implements may be @@ -1170,12 +1195,24 @@ height ``for real'' does not always work, because knowing the correct actual size may be necessary for correct cursor positioning on text terminals. + +The optional fourth argument @var{pixelwise} non-@code{nil} means that +@var{frame} should be @var{height} pixels high. Note that if +@code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to +fully honor the request if it does not increase/decrease the frame +height to a multiple of its character height. @end defun -@defun set-frame-width frame width &optional pretend +@defun set-frame-width frame width &optional pretend pixelwise This function sets the width of @var{frame}, measured in characters. The argument @var{pretend} has the same meaning as in @code{set-frame-height}. + +The optional fourth argument @var{pixelwise} non-@code{nil} means that +@var{frame} should be @var{width} pixels wide. Note that if +@code{frame-resize-pixelwise} is @code{nil}, some toolkits may refuse to +fully honor the request if it does not increase/decrease the frame width +to a multiple of its character width. @end defun @c FIXME? Belongs more in Emacs manual than here? === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-12 07:28:23 +0000 +++ src/ChangeLog 2014-03-14 10:38:46 +0000 @@ -1,3 +1,9 @@ +2014-03-14 Martin Rudalics + + * w32term.c (x_set_window_size): When frame-resize-pixelwise is + nil, always resize character wise to avoid potential loss of the + mode line (Bug#16923 related). + 2014-03-12 Martin Rudalics * frame.c (x_set_frame_parameters): Always calculate new sizes === modified file 'src/w32term.c' --- src/w32term.c 2014-03-11 07:20:49 +0000 +++ src/w32term.c 2014-03-14 10:38:46 +0000 @@ -5648,6 +5648,31 @@ pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, height); } + if (!frame_resize_pixelwise) + { + /* If we don't resize frames pixelwise, round sizes to multiples + of character sizes. Otherwise, Windows may clip our frame + rectangle at a character size boundary and we risk losing our + mode line. Bug#16923 might be a consequence of this. + + So far, this is a Windows specific problem; other toolkits may + prefer to not resize the frame if the delta is not large enough + (GTK) or resize the frame pixelwise as requested (Lucid, + Motif). Windows just doesn't call us back (probably because of + the size hint settings which it apparently interprets strictly) + neither when the user tries to mouse-drag a frame border by, + nor when calling `set-frame-size' with a delta of less than the + canonical character size. If w32_enable_frame_resize_hack is + enabled (which it now is by default) we'd then below resize the + frame's root window in preparation of a WM_SIZE message to come + which, however, is not going to happen. */ + int unit_width = FRAME_COLUMN_WIDTH (f); + int unit_height = FRAME_LINE_HEIGHT (f); + + pixelwidth = (pixelwidth / unit_width) * unit_width; + pixelheight = (pixelheight / unit_height) * unit_height; + } + f->win_gravity = NorthWestGravity; x_wm_set_size_hint (f, (long) 0, 0); @@ -5670,39 +5695,40 @@ } /* If w32_enable_frame_resize_hack is non-nil, immediately apply the - new pixel sizes to the frame and its subwindows. See discussion - of Bug#16028 for why we need this. */ - - if (w32_enable_frame_resize_hack) - /* The following mirrors what is done in xterm.c. It appears to be - for informing lisp of the new size immediately, while the actual - resize will happen asynchronously. But on Windows, the menu bar - automatically wraps when the frame is too narrow to contain it, - and that causes any calculations made here to come out wrong. The - end is some nasty buggy behavior, including the potential loss - of the minibuffer. + new pixel sizes to the frame and its subwindows. This approach is + fragile because Windows might not honor the resize request issued + by my_set_window_pos with a WM_SIZE message (see previous comment). + + Jason Rumney earlier refused to call change_frame_size right here + with the following argument: + + The following mirrors what is done in xterm.c. It appears to be for + informing lisp of the new size immediately, while the actual resize + will happen asynchronously. But on Windows, the menu bar + automatically wraps when the frame is too narrow to contain it, and + that causes any calculations made here to come out wrong. The end + is some nasty buggy behavior, including the potential loss of the + minibuffer. Disabling this code is either not sufficient to fix the problems completely, or it causes fresh problems, but at least it removes the most problematic symptom of the minibuffer becoming unusable. - ----------------------------------------------------------------- - - Now, strictly speaking, we can't be sure that this is accurate, - but the window manager will get around to dealing with the size - change request eventually, and we'll hear how it went when the - ConfigureNotify event gets here. - - We could just not bother storing any of this information here, - and let the ConfigureNotify event set everything up, but that - might be kind of confusing to the Lisp code, since size changes - wouldn't be reported in the frame parameters until some random - point in the future when the ConfigureNotify event arrives. - - We pass 1 for DELAY since we can't run Lisp code inside of - a BLOCK_INPUT. */ + However, as the discussion about how to handle frame size + parameters on Windows (Bug#1348, Bug#16028) shows, that cure seems + worse than the disease. In particular, menu bar wrapping looks + like a non-issue - maybe so because Windows eventually gets back to + us with the correct client rectangle anyway. But we have to avoid + calling change_frame_size with a delta of less than one canoncial + character size when frame_resize_pixelwise is nil, as explained in + the comment above. */ + + if (w32_enable_frame_resize_hack) + { - change_frame_size (f, width, height, 0, 1, 0, pixelwise); + change_frame_size (f, FRAME_PIXEL_TO_TEXT_WIDTH (f, pixelwidth), + FRAME_PIXEL_TO_TEXT_HEIGHT (f, pixelheight), + 0, 1, 0, 1); SET_FRAME_GARBAGED (f); /* If cursor was outside the new size, mark it as off. */ @@ -5711,7 +5737,8 @@ /* Clear out any recollection of where the mouse highlighting was, since it might be in a place that's outside the new frame size. Actually checking whether it is outside is a pain in the neck, - so don't try--just let the highlighting be done afresh with new size. */ + so don't try--just let the highlighting be done afresh with new + size. */ cancel_mouse_face (f); } ------------------------------------------------------------ revno: 116755 fixes bug: http://debbugs.gnu.org/17001 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-03-13 20:32:41 -0400 message: Move some help functions from help-fns.el to help.el, which is preloaded. They are now needed by eg the function `documentation' in some circumstances. * lisp/help-fns.el (help-split-fundoc, help-add-fundoc-usage) (help-function-arglist, help-make-usage): Move from here... * lisp/help.el (help-split-fundoc, help-add-fundoc-usage) (help-function-arglist, help-make-usage): ... to here. * lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Do not load help-fns. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-14 00:22:33 +0000 +++ lisp/ChangeLog 2014-03-14 00:32:41 +0000 @@ -1,3 +1,11 @@ +2014-03-14 Glenn Morris + + * help-fns.el (help-split-fundoc, help-add-fundoc-usage) + (help-function-arglist, help-make-usage): Move from here... + * help.el (help-split-fundoc, help-add-fundoc-usage) + (help-function-arglist, help-make-usage): ... to here. (Bug#17001) + * emacs-lisp/bytecomp.el (byte-compile-lambda): Do not load help-fns. + 2014-03-14 Juanma Barranquero * net/socks.el (socks, socks-override-functions) === modified file 'lisp/emacs-lisp/bytecomp.el' --- lisp/emacs-lisp/bytecomp.el 2014-02-10 01:34:22 +0000 +++ lisp/emacs-lisp/bytecomp.el 2014-03-14 00:32:41 +0000 @@ -2706,7 +2706,6 @@ (cdr compiled) ;; optionally, the doc string. (cond (lexical-binding - (require 'help-fns) (list (help-add-fundoc-usage doc arglist))) ((or doc int) (list doc))) === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2014-02-10 01:34:22 +0000 +++ lisp/help-fns.el 2014-03-14 00:32:41 +0000 @@ -69,109 +69,6 @@ ;; Return the text we displayed. (buffer-string)))))) -(defun help-split-fundoc (docstring def) - "Split a function DOCSTRING into the actual doc and the usage info. -Return (USAGE . DOC) or nil if there's no usage info, where USAGE info -is a string describing the argument list of DEF, such as -\"(apply FUNCTION &rest ARGUMENTS)\". -DEF is the function whose usage we're looking for in DOCSTRING." - ;; Functions can get the calling sequence at the end of the doc string. - ;; In cases where `function' has been fset to a subr we can't search for - ;; function's name in the doc string so we use `fn' as the anonymous - ;; function name instead. - (when (and docstring (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring)) - (cons (format "(%s%s" - ;; Replace `fn' with the actual function name. - (if (symbolp def) def "anonymous") - (match-string 1 docstring)) - (unless (zerop (match-beginning 0)) - (substring docstring 0 (match-beginning 0)))))) - -;; FIXME: Move to subr.el? -(defun help-add-fundoc-usage (docstring arglist) - "Add the usage info to DOCSTRING. -If DOCSTRING already has a usage info, then just return it unchanged. -The usage info is built from ARGLIST. DOCSTRING can be nil. -ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." - (unless (stringp docstring) (setq docstring "")) - (if (or (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring) - (eq arglist t)) - docstring - (concat docstring - (if (string-match "\n?\n\\'" docstring) - (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") - "\n\n") - (if (and (stringp arglist) - (string-match "\\`([^ ]+\\(.*\\))\\'" arglist)) - (concat "(fn" (match-string 1 arglist) ")") - (format "%S" (help-make-usage 'fn arglist)))))) - -;; FIXME: Move to subr.el? -(defun help-function-arglist (def &optional preserve-names) - "Return a formal argument list for the function DEF. -IF PRESERVE-NAMES is non-nil, return a formal arglist that uses -the same names as used in the original source code, when possible." - ;; Handle symbols aliased to other symbols. - (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) - ;; If definition is a macro, find the function inside it. - (if (eq (car-safe def) 'macro) (setq def (cdr def))) - (cond - ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0)) - ((eq (car-safe def) 'lambda) (nth 1 def)) - ((eq (car-safe def) 'closure) (nth 2 def)) - ((or (and (byte-code-function-p def) (integerp (aref def 0))) - (subrp def)) - (or (when preserve-names - (let* ((doc (condition-case nil (documentation def) (error nil))) - (docargs (if doc (car (help-split-fundoc doc nil)))) - (arglist (if docargs - (cdar (read-from-string (downcase docargs))))) - (valid t)) - ;; Check validity. - (dolist (arg arglist) - (unless (and (symbolp arg) - (let ((name (symbol-name arg))) - (if (eq (aref name 0) ?&) - (memq arg '(&rest &optional)) - (not (string-match "\\." name))))) - (setq valid nil))) - (when valid arglist))) - (let* ((args-desc (if (not (subrp def)) - (aref def 0) - (let ((a (subr-arity def))) - (logior (car a) - (if (numberp (cdr a)) - (lsh (cdr a) 8) - (lsh 1 7)))))) - (max (lsh args-desc -8)) - (min (logand args-desc 127)) - (rest (logand args-desc 128)) - (arglist ())) - (dotimes (i min) - (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) - (when (> max min) - (push '&optional arglist) - (dotimes (i (- max min)) - (push (intern (concat "arg" (number-to-string (+ 1 i min)))) - arglist))) - (unless (zerop rest) (push '&rest arglist) (push 'rest arglist)) - (nreverse arglist)))) - ((and (autoloadp def) (not (eq (nth 4 def) 'keymap))) - "[Arg list not available until function definition is loaded.]") - (t t))) - -;; FIXME: Move to subr.el? -(defun help-make-usage (function arglist) - (cons (if (symbolp function) function 'anonymous) - (mapcar (lambda (arg) - (if (not (symbolp arg)) arg - (let ((name (symbol-name arg))) - (cond - ((string-match "\\`&" name) arg) - ((string-match "\\`_" name) - (intern (upcase (substring name 1)))) - (t (intern (upcase name))))))) - arglist))) ;; Could be this, if we make symbol-file do the work below. ;; (defun help-C-file-name (subr-or-var kind) === modified file 'lisp/help.el' --- lisp/help.el 2014-02-28 09:10:55 +0000 +++ lisp/help.el 2014-03-14 00:32:41 +0000 @@ -1222,6 +1222,113 @@ (if (stringp msg) (with-output-to-temp-buffer " *Char Help*" (princ msg))))) + + +;; The following functions used to be in help-fns.el, which is not preloaded. +;; But for various reasons, they are more widely needed, so they were +;; moved to this file, which is preloaded. http://debbugs.gnu.org/17001 + +(defun help-split-fundoc (docstring def) + "Split a function DOCSTRING into the actual doc and the usage info. +Return (USAGE . DOC) or nil if there's no usage info, where USAGE info +is a string describing the argument list of DEF, such as +\"(apply FUNCTION &rest ARGUMENTS)\". +DEF is the function whose usage we're looking for in DOCSTRING." + ;; Functions can get the calling sequence at the end of the doc string. + ;; In cases where `function' has been fset to a subr we can't search for + ;; function's name in the doc string so we use `fn' as the anonymous + ;; function name instead. + (when (and docstring (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring)) + (cons (format "(%s%s" + ;; Replace `fn' with the actual function name. + (if (symbolp def) def "anonymous") + (match-string 1 docstring)) + (unless (zerop (match-beginning 0)) + (substring docstring 0 (match-beginning 0)))))) + +(defun help-add-fundoc-usage (docstring arglist) + "Add the usage info to DOCSTRING. +If DOCSTRING already has a usage info, then just return it unchanged. +The usage info is built from ARGLIST. DOCSTRING can be nil. +ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." + (unless (stringp docstring) (setq docstring "")) + (if (or (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring) + (eq arglist t)) + docstring + (concat docstring + (if (string-match "\n?\n\\'" docstring) + (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") + "\n\n") + (if (and (stringp arglist) + (string-match "\\`([^ ]+\\(.*\\))\\'" arglist)) + (concat "(fn" (match-string 1 arglist) ")") + (format "%S" (help-make-usage 'fn arglist)))))) + +(defun help-function-arglist (def &optional preserve-names) + "Return a formal argument list for the function DEF. +IF PRESERVE-NAMES is non-nil, return a formal arglist that uses +the same names as used in the original source code, when possible." + ;; Handle symbols aliased to other symbols. + (if (and (symbolp def) (fboundp def)) (setq def (indirect-function def))) + ;; If definition is a macro, find the function inside it. + (if (eq (car-safe def) 'macro) (setq def (cdr def))) + (cond + ((and (byte-code-function-p def) (listp (aref def 0))) (aref def 0)) + ((eq (car-safe def) 'lambda) (nth 1 def)) + ((eq (car-safe def) 'closure) (nth 2 def)) + ((or (and (byte-code-function-p def) (integerp (aref def 0))) + (subrp def)) + (or (when preserve-names + (let* ((doc (condition-case nil (documentation def) (error nil))) + (docargs (if doc (car (help-split-fundoc doc nil)))) + (arglist (if docargs + (cdar (read-from-string (downcase docargs))))) + (valid t)) + ;; Check validity. + (dolist (arg arglist) + (unless (and (symbolp arg) + (let ((name (symbol-name arg))) + (if (eq (aref name 0) ?&) + (memq arg '(&rest &optional)) + (not (string-match "\\." name))))) + (setq valid nil))) + (when valid arglist))) + (let* ((args-desc (if (not (subrp def)) + (aref def 0) + (let ((a (subr-arity def))) + (logior (car a) + (if (numberp (cdr a)) + (lsh (cdr a) 8) + (lsh 1 7)))))) + (max (lsh args-desc -8)) + (min (logand args-desc 127)) + (rest (logand args-desc 128)) + (arglist ())) + (dotimes (i min) + (push (intern (concat "arg" (number-to-string (1+ i)))) arglist)) + (when (> max min) + (push '&optional arglist) + (dotimes (i (- max min)) + (push (intern (concat "arg" (number-to-string (+ 1 i min)))) + arglist))) + (unless (zerop rest) (push '&rest arglist) (push 'rest arglist)) + (nreverse arglist)))) + ((and (autoloadp def) (not (eq (nth 4 def) 'keymap))) + "[Arg list not available until function definition is loaded.]") + (t t))) + +(defun help-make-usage (function arglist) + (cons (if (symbolp function) function 'anonymous) + (mapcar (lambda (arg) + (if (not (symbolp arg)) arg + (let ((name (symbol-name arg))) + (cond + ((string-match "\\`&" name) arg) + ((string-match "\\`_" name) + (intern (upcase (substring name 1)))) + (t (intern (upcase name))))))) + arglist))) + (provide 'help)