------------------------------------------------------------ revno: 118007 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-10-01 21:24:07 -0700 message: Rotate etc/NEWS files for version 25 diff: === added file 'etc/NEWS' --- etc/NEWS 1970-01-01 00:00:00 +0000 +++ etc/NEWS 2014-10-02 04:24:07 +0000 @@ -0,0 +1,357 @@ +GNU Emacs NEWS -- history of user-visible changes. + +Copyright (C) 2014 Free Software Foundation, Inc. +See the end of the file for license conditions. + +Please send Emacs bug reports to bug-gnu-emacs@gnu.org. +If possible, use M-x report-emacs-bug. + +This file is about changes in Emacs version 25. + +See files NEWS.24, NEWS.23, NEWS.22, NEWS.21, NEWS.20, NEWS.19, NEWS.18, +and NEWS.1-17 for changes in older Emacs versions. + +You can narrow news to a specific version by calling `view-emacs-news' +with a prefix argument or by typing C-u C-h C-n. + +Temporary note: ++++ indicates that all necessary documentation updates are complete. + (This means all relevant manuals in doc/ AND lisp doc-strings.) +--- means no change in the manuals is needed. +When you add a new item, use the appropriate mark if you are sure it applies, +otherwise leave it unmarked. + + +* Installation Changes in Emacs 25.1 + ++++ +** Building Emacs now requires C99 or later. + +** Building Emacs now requires GNU make, version 3.81 or later. + +** By default, Emacs no longer works on IRIX. We expect that Emacs +users are not affected by this, as SGI stopped supporting IRIX in +December 2013. If you are affected, please send a bug report. You +should be able to work around the problem either by porting the Emacs +undumping code to GCC under IRIX, or by configuring --with-wide-int, +or by sticking with Emacs 24.4. + +--- +** The configure option `--with-pkg-config-prog' has been removed. +Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to. + +** The configure option '--enable-silent-rules' and the command +'make V=0' now do a better job of suppressing chatter. + + +* Startup Changes in Emacs 25.1 + + +* Changes in Emacs 25.1 + +** x-select-enable-clipboard is renamed gui-select-enable-clipboard. +Additionally it now also applies to OSX and GNUstep. + +** `insert-register' now leaves point after the inserted text +when called interactively. A prefix argument toggles this behavior. + +** New var `truncate-string-ellipsis' to choose how to indicate truncation. + +--- +** The default value of `history-length' has increased to 100. + ++++ +** The new variable `term-file-aliases' replaces some files from lisp/term. +The function `tty-run-terminal-initialization' consults this variable +when deciding what terminal-specific initialization code to run. + +--- +** New variable `system-configuration-features', listing some of the +main features that Emacs was compiled with. This is mainly intended +for use in Emacs bug reports. + ++++ +** A password is now hidden also when typed in batch mode. Another +hiding character but the default `.' can be used by let-binding the +variable `read-hide-char'. + +** The new functions `string-collate-lessp' and `string-collate-equalp' +preserve the collation order as defined by the system's locale(1) +environment. For the time being this is implemented for modern POSIX +systems and for MS-Windows, for other systems they fall back to their +counterparts `string-lessp' and `string-equal'. + +*** The ls-lisp package uses `string-collate-lessp' to sort file names. +If you want the old, locale-independent sorting, customize the new +option `ls-lisp-use-string-collate' to a nil value. + +*** The MS-Windows specific variable `w32-collate-ignore-punctuation', +if set to a non-nil value, causes the above 2 functions to ignore +symbol and punctuation characters when collating strings. This +emulates the behavior of modern Posix platforms when the locale's +codeset is "UTF-8" (as in "en_US.UTF-8"). This is needed because +MS-Windows doesn't support UTF-8 as codeset in its locales. + + +* Editing Changes in Emacs 25.1 + +** Emacs now supports "bracketed paste mode" when running on a terminal +that supports it. This facility allows Emacs to understand pasted +chunks of text as strings to be inserted, instead of interpreting each +character in the pasted text as actual user input. This results in a +paste experience similar to that under a window system, and significant +performance improvements when pasting large amounts of text. + + +* Changes in Specialized Modes and Packages in Emacs 25.1 + +** ElDoc +*** New minor mode global-eldoc-mode +*** eldoc-documentation-function now defaults to nil + +** pcase +*** New UPatterns `quote' and `app'. +*** New UPatterns can be defined with `pcase-defmacro'. + +** Lisp mode +*** Strings after `:documentation' are highlighted as docstrings. + +** Rectangle editing +*** Rectangle Mark mode can have corners past EOL or in the middle of a TAB. +*** C-x C-x in rectangle-mark-mode now cycles through the four corners. +*** `string-rectangle' provides on-the-fly preview of the result. + ++++ +** Macro `pcase' now supports vector qpattern. + +** New font-lock functions font-lock-ensure and font-lock-flush, which +should be used instead of font-lock-fontify-buffer when called from Elisp. + +** Macro `minibuffer-with-setup-hook' takes (:append FUN) to mean +appending FUN to `minibuffer-setup-hook'. + +** Calendar and diary + ++++ +*** New commands to insert diary entries with Chinese dates: +`diary-chinese-insert-anniversary-entry' `diary-chinese-insert-entry' +`diary-chinese-insert-monthly-entry', `diary-chinese-insert-yearly-entry'. + ++++ +*** Calendar can list and mark diary entries with Chinese dates. +See `diary-chinese-list-entries' and `diary-chinese-mark-entries'. + +*** The mode line of the calendar buffer will not be modified if +`calendar-mode-line-format' is nil. + +** New ERT function `ert-summarize-tests-batch-and-exit'. + +--- +** The Rmail commands d, C-d and u now handle repeat counts to delete or +undelete multiple messages. + +** Rmail can now render HTML mail messages if your Emacs was built with +libxml2 or if you have the Lynx browser installed. By default, Rmail +will display the HTML version of a mail message that has both HTML and +plain text parts, if display of HTML email is possible; customize the +`rmail-mime-prefer-html' option to `nil' if you don't want that. + +** SES now supports local printer functions; see `ses-define-local-printer'. + +** In sh-mode, you can now use `sh-shell' as a file-local variable to +specify the type of shell in use (bash, csh, etc). + +** The URL package accepts now the protocols "ssh", "scp" and "rsync". +When `url-handler-mode' is enabled, file operations for these +protocols as well as for "telnet" and "ftp" are passed to Tramp. + +** Tramp + +*** New connection method "nc", which allows to access dumb busyboxes. + +** SQL mode + +*** New user variable `sql-default-directory' enables remote +connections using Tramp. + +*** New command `sql-send-line-and-next' sends the current line to the +interactive buffer and advances to the next line, skipping whitespace +and comments. + +*** Add support for Vertica SQL. + +** VC and related modes + +*** New option `vc-annotate-background-mode' controls whether +the color range from `vc-annotate-color-map' is applied to the +background or to the foreground. + +** Calculator: decimal display mode uses "," groups, so it's more +fitting for use in money calculations; factorial works with +non-integer inputs. + +** HideIfDef mode now support full C/C++ expressions, argumented macro expansions +, interactive macro evaluation and automatic scanning of #defined symbols. + +*** New custom variable `hide-ifdef-header-regexp' to define C/C++ header file +name patterns. Default case-insensitive .h, .hh, .hpp and .hxx. +*** New custom variable `hide-ifdef-expand-reinclusion-protection' to prevent +reinclusion protected header files from being fully hidden. +*** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol +name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded. + +** TeX mode + +*** New custom variable `tex-print-file-extension' to help users who +use PDF instead of DVI. + +** Obsolete packages + +--- +*** gulp.el + +--- +*** crisp.el, tpu-edt.el, ws-mode.el +These emulations of old editors are believed to be no longer relevant + - contact emacs-devel@gnu.org if you disagree. + +--- +*** vi.el, vip.el (try M-x viper instead) + + +* New Modes and Packages in Emacs 25.1 + + +* Incompatible Lisp Changes in Emacs 25.1 + +** window-configurations no longer record the buffers's marks. + +** inhibit-modification-hooks now also inhibits lock-file checks, as well as +active region handling. + +** deactivate-mark is now buffer-local. + +** `cl-the' now asserts that its argument is of the given type. + ++++ +** Mouse click events on mode line or header line no longer include +any reference to a buffer position. The 6th member of the mouse +position list returned for such events is now nil. + +** Menu items in keymaps do not support the "key shortcut cache" any more. +These slots used to hold key-shortcut data, but have been obsolete since +Emacs-21. + + +* Lisp Changes in Emacs 25.1 + +** Some "x-*" were obsoleted: +*** x-select-text is renamed gui-select-text. +*** x-get-selection is renamed gui-get-selection. +*** x-get-clipboard and x-clipboard-yank are marked obsolete. +*** x-get-selection-value is renamed to gui-get-primary-selection. +*** x-set-selection is renamed to gui-set-selection + +** call-process-shell-command and process-file-shell-command +don't take "&rest args" any more. + +** New function `alist-get', which is also a valid place (aka lvalue). + +** New function `funcall-interactively', which works like `funcall' +but makes `called-interactively-p' treat the function as (you guessed it) +called interactively. + +** New function `function-put' to use instead of `put' for function properties. + ++++ +** New properties that can be specified with `declare': +*** (interactive-only INSTEAD), says to use INSTEAD for non-interactive use. +*** (pure VAL), if VAL is non-nil, indicates the function is pure. +*** (side-effect-free VAL), if VAL is non-nil, indicates the function does not +have side effects. + ++++ +** New macro `with-file-modes', for evaluating expressions with default file +permissions set to temporary values (e.g., for creating private files). + +** You can access the slots of structures using `cl-struct-slot-value'. + +** Functions `rmail-delete-forward' and `rmail-delete-backward' take an +optional repeat-count argument. + +** Function `sort' can deal with vectors. + +--- +** New utilities in subr-x.el: +*** New macros `if-let' and `when-let' allow defining bindings and to + execute code depending whether all values are true. +*** New macros `thread-first' and `thread-last' allow threading a form + as the first or last argument of subsequent forms. + + +* 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. +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 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. +*** `set-window-scroll-bars' now accepts five parameters where the last + two specify height and type of the window's horizontal scroll bar. + +** 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 +the height of the frame's root window plus that of the echo area (if +present). This was already the behavior for frames with external tool +and menu bars (like in the Gtk builds) but has now been extended to all +builds. + +** Frames now do not necessarily preserve the number of columns or lines +they display when setting default font, menu bar, fringe width, or +scroll bars. In particular, maximized and fullscreen frames are +conceptually never resized if such settings change. For fullheight and +fullwidth frames, the behavior may depend on the toolkit used. +*** New option `frame-inhibit-implied-resize' if non-nil, means that + setting default font, menu bar, fringe width, or scroll bars of a + specific frame does not resize that frame in order to preserve the + number of columns or lines it displays. + + +* Changes in Emacs 25.1 on Non-Free Operating Systems + +--- +** Building Emacs for MS-Windows requires at least Windows XP +or Windows Server 2003. The built binaries still run on all versions +of Windows starting with Windows 9X. + + + +---------------------------------------------------------------------- +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 . + + +Local variables: +coding: utf-8 +mode: outline +paragraph-separate: "[ ]*$" +end: === renamed file 'etc/NEWS' => 'etc/NEWS.24' --- etc/NEWS 2014-10-02 03:19:32 +0000 +++ etc/NEWS.24 2014-10-02 04:24:07 +0000 @@ -14,322 +14,6 @@ You can narrow news to a specific version by calling `view-emacs-news' with a prefix argument or by typing C-u C-h C-n. -Temporary note: -+++ indicates that all necessary documentation updates are complete. - (This means all relevant manuals in doc/ AND lisp doc-strings.) ---- means no change in the manuals is needed. -When you add a new item, use the appropriate mark if you are sure it applies, -otherwise leave it unmarked. - - -* Installation Changes in Emacs 25.1 - -+++ -** Building Emacs now requires C99 or later. - -** Building Emacs now requires GNU make, version 3.81 or later. - -** By default, Emacs no longer works on IRIX. We expect that Emacs -users are not affected by this, as SGI stopped supporting IRIX in -December 2013. If you are affected, please send a bug report. You -should be able to work around the problem either by porting the Emacs -undumping code to GCC under IRIX, or by configuring --with-wide-int, -or by sticking with Emacs 24.4. - ---- -** The configure option `--with-pkg-config-prog' has been removed. -Use './configure PKG_CONFIG=/full/name/of/pkg-config' if you need to. - -** The configure option '--enable-silent-rules' and the command -'make V=0' now do a better job of suppressing chatter. - - -* Startup Changes in Emacs 25.1 - - -* Changes in Emacs 25.1 - -** x-select-enable-clipboard is renamed gui-select-enable-clipboard. -Additionally it now also applies to OSX and GNUstep. - -** `insert-register' now leaves point after the inserted text -when called interactively. A prefix argument toggles this behavior. - -** New var `truncate-string-ellipsis' to choose how to indicate truncation. - ---- -** The default value of `history-length' has increased to 100. - -+++ -** The new variable `term-file-aliases' replaces some files from lisp/term. -The function `tty-run-terminal-initialization' consults this variable -when deciding what terminal-specific initialization code to run. - ---- -** New variable `system-configuration-features', listing some of the -main features that Emacs was compiled with. This is mainly intended -for use in Emacs bug reports. - -+++ -** A password is now hidden also when typed in batch mode. Another -hiding character but the default `.' can be used by let-binding the -variable `read-hide-char'. - -** The new functions `string-collate-lessp' and `string-collate-equalp' -preserve the collation order as defined by the system's locale(1) -environment. For the time being this is implemented for modern POSIX -systems and for MS-Windows, for other systems they fall back to their -counterparts `string-lessp' and `string-equal'. - -*** The ls-lisp package uses `string-collate-lessp' to sort file names. -If you want the old, locale-independent sorting, customize the new -option `ls-lisp-use-string-collate' to a nil value. - -*** The MS-Windows specific variable `w32-collate-ignore-punctuation', -if set to a non-nil value, causes the above 2 functions to ignore -symbol and punctuation characters when collating strings. This -emulates the behavior of modern Posix platforms when the locale's -codeset is "UTF-8" (as in "en_US.UTF-8"). This is needed because -MS-Windows doesn't support UTF-8 as codeset in its locales. - - -* Editing Changes in Emacs 25.1 - -** Emacs now supports "bracketed paste mode" when running on a terminal -that supports it. This facility allows Emacs to understand pasted -chunks of text as strings to be inserted, instead of interpreting each -character in the pasted text as actual user input. This results in a -paste experience similar to that under a window system, and significant -performance improvements when pasting large amounts of text. - - -* Changes in Specialized Modes and Packages in Emacs 25.1 - -** ElDoc -*** New minor mode global-eldoc-mode -*** eldoc-documentation-function now defaults to nil - -** pcase -*** New UPatterns `quote' and `app'. -*** New UPatterns can be defined with `pcase-defmacro'. - -** Lisp mode -*** Strings after `:documentation' are highlighted as docstrings. - -** Rectangle editing -*** Rectangle Mark mode can have corners past EOL or in the middle of a TAB. -*** C-x C-x in rectangle-mark-mode now cycles through the four corners. -*** `string-rectangle' provides on-the-fly preview of the result. - -+++ -** Macro `pcase' now supports vector qpattern. - -** New font-lock functions font-lock-ensure and font-lock-flush, which -should be used instead of font-lock-fontify-buffer when called from Elisp. - -** Macro `minibuffer-with-setup-hook' takes (:append FUN) to mean -appending FUN to `minibuffer-setup-hook'. - -** Calendar and diary - -+++ -*** New commands to insert diary entries with Chinese dates: -`diary-chinese-insert-anniversary-entry' `diary-chinese-insert-entry' -`diary-chinese-insert-monthly-entry', `diary-chinese-insert-yearly-entry'. - -+++ -*** Calendar can list and mark diary entries with Chinese dates. -See `diary-chinese-list-entries' and `diary-chinese-mark-entries'. - -*** The mode line of the calendar buffer will not be modified if -`calendar-mode-line-format' is nil. - -** New ERT function `ert-summarize-tests-batch-and-exit'. - ---- -** The Rmail commands d, C-d and u now handle repeat counts to delete or -undelete multiple messages. - -** Rmail can now render HTML mail messages if your Emacs was built with -libxml2 or if you have the Lynx browser installed. By default, Rmail -will display the HTML version of a mail message that has both HTML and -plain text parts, if display of HTML email is possible; customize the -`rmail-mime-prefer-html' option to `nil' if you don't want that. - -** SES now supports local printer functions; see `ses-define-local-printer'. - -** In sh-mode, you can now use `sh-shell' as a file-local variable to -specify the type of shell in use (bash, csh, etc). - -** The URL package accepts now the protocols "ssh", "scp" and "rsync". -When `url-handler-mode' is enabled, file operations for these -protocols as well as for "telnet" and "ftp" are passed to Tramp. - -** Tramp - -*** New connection method "nc", which allows to access dumb busyboxes. - -** SQL mode - -*** New user variable `sql-default-directory' enables remote -connections using Tramp. - -*** New command `sql-send-line-and-next' sends the current line to the -interactive buffer and advances to the next line, skipping whitespace -and comments. - -*** Add support for Vertica SQL. - -** VC and related modes - -*** New option `vc-annotate-background-mode' controls whether -the color range from `vc-annotate-color-map' is applied to the -background or to the foreground. - -** Calculator: decimal display mode uses "," groups, so it's more -fitting for use in money calculations; factorial works with -non-integer inputs. - -** HideIfDef mode now support full C/C++ expressions, argumented macro expansions -, interactive macro evaluation and automatic scanning of #defined symbols. - -*** New custom variable `hide-ifdef-header-regexp' to define C/C++ header file -name patterns. Default case-insensitive .h, .hh, .hpp and .hxx. -*** New custom variable `hide-ifdef-expand-reinclusion-protection' to prevent -reinclusion protected header files from being fully hidden. -*** New custom variable `hide-ifdef-exclude-define-regexp' to define symbol -name patterns (e.x. all "FOR_DOXYGEN_ONLY_*") to be excluded. - -** TeX mode - -*** New custom variable `tex-print-file-extension' to help users who -use PDF instead of DVI. - -** Obsolete packages - ---- -*** gulp.el - ---- -*** crisp.el, tpu-edt.el, ws-mode.el -These emulations of old editors are believed to be no longer relevant - - contact emacs-devel@gnu.org if you disagree. - ---- -*** vi.el, vip.el (try M-x viper instead) - - -* New Modes and Packages in Emacs 25.1 - - -* Incompatible Lisp Changes in Emacs 25.1 - -** window-configurations no longer record the buffers's marks. - -** inhibit-modification-hooks now also inhibits lock-file checks, as well as -active region handling. - -** deactivate-mark is now buffer-local. - -** `cl-the' now asserts that its argument is of the given type. - -+++ -** Mouse click events on mode line or header line no longer include -any reference to a buffer position. The 6th member of the mouse -position list returned for such events is now nil. - -** Menu items in keymaps do not support the "key shortcut cache" any more. -These slots used to hold key-shortcut data, but have been obsolete since -Emacs-21. - - -* Lisp Changes in Emacs 25.1 - -** Some "x-*" were obsoleted: -*** x-select-text is renamed gui-select-text. -*** x-get-selection is renamed gui-get-selection. -*** x-get-clipboard and x-clipboard-yank are marked obsolete. -*** x-get-selection-value is renamed to gui-get-primary-selection. -*** x-set-selection is renamed to gui-set-selection - -** call-process-shell-command and process-file-shell-command -don't take "&rest args" any more. - -** New function `alist-get', which is also a valid place (aka lvalue). - -** New function `funcall-interactively', which works like `funcall' -but makes `called-interactively-p' treat the function as (you guessed it) -called interactively. - -** New function `function-put' to use instead of `put' for function properties. - -+++ -** New properties that can be specified with `declare': -*** (interactive-only INSTEAD), says to use INSTEAD for non-interactive use. -*** (pure VAL), if VAL is non-nil, indicates the function is pure. -*** (side-effect-free VAL), if VAL is non-nil, indicates the function does not -have side effects. - -+++ -** New macro `with-file-modes', for evaluating expressions with default file -permissions set to temporary values (e.g., for creating private files). - -** You can access the slots of structures using `cl-struct-slot-value'. - -** Functions `rmail-delete-forward' and `rmail-delete-backward' take an -optional repeat-count argument. - -** Function `sort' can deal with vectors. - ---- -** New utilities in subr-x.el: -*** New macros `if-let' and `when-let' allow defining bindings and to - execute code depending whether all values are true. -*** New macros `thread-first' and `thread-last' allow threading a form - as the first or last argument of subsequent forms. - - -* 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. -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 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. -*** `set-window-scroll-bars' now accepts five parameters where the last - two specify height and type of the window's horizontal scroll bar. - -** 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 -the height of the frame's root window plus that of the echo area (if -present). This was already the behavior for frames with external tool -and menu bars (like in the Gtk builds) but has now been extended to all -builds. - -** Frames now do not necessarily preserve the number of columns or lines -they display when setting default font, menu bar, fringe width, or -scroll bars. In particular, maximized and fullscreen frames are -conceptually never resized if such settings change. For fullheight and -fullwidth frames, the behavior may depend on the toolkit used. -*** New option `frame-inhibit-implied-resize' if non-nil, means that - setting default font, menu bar, fringe width, or scroll bars of a - specific frame does not resize that frame in order to preserve the - number of columns or lines it displays. - -* Changes in Emacs 25.1 on Non-Free Operating Systems - ---- -** Building Emacs for MS-Windows requires at least Windows XP -or Windows Server 2003. The built binaries still run on all versions -of Windows starting with Windows 9X. - * Installation Changes in Emacs 24.4 ------------------------------------------------------------ revno: 118006 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-10-01 23:19:32 -0400 message: Consolidate management/ownership of selections. * lisp/select.el (gui-get-selection-alist): New method. (gui-get-selection): Use it. Rename from x-get-selection. (x-get-selection): Define as obsolete alias. (x-get-clipboard): Mark obsolete. (gui-get-primary-selection): New function. (x-get-selection-value): Mark obsolete. (gui-own-selection-alist, gui-disown-selection-alist) (gui-selection-owner-p-alist): New methods. (gui-set-selection): Use them. Rename from x-set-selection. (x-set-selection): Define as obsolete alias. (gui--valid-simple-selection-p): Rename from x-valid-simple-selection-p. * lisp/w32-common-fns.el (gui-own-selection, gui-disown-selection) (gui-selection-owner-p, gui-get-selection): Define for w32. (w32-get-selection-value): Rename from x-get-selection-value. Use the new gui-last-selected-text. * lisp/term/x-win.el (x-get-selection-value): Remove. (x-clipboard-yank): Declare obsolete. (gui-own-selection, gui-disown-selection, gui-get-selection) (gui-selection-owner-p): Define for x. * lisp/term/w32-win.el (w32-win-suspend-error): Rename from x-win-suspend-error. * lisp/term/pc-win.el (w16-get-selection-value): Rename from x-get-selection-value. (w16-selection-owner-p): Rename from x-selection-owner-p. (gui-own-selection, gui-disown-selection, gui-get-selection) (gui-selection-owner-p): Define for pc. (w16--select-text): New function. * lisp/term/ns-win.el (gui-own-selection, gui-disown-selection) (gui-get-selection, gui-selection-owner-p): Define for ns. * lisp/term.el (term-mouse-paste): * lisp/mouse.el (mouse-yank-primary): Use gui-get-primary-selection. * src/nsselect.m (ns-own-selection-internal, ns-disown-selection-internal): Rename from the "x-" prefix. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-10-01 22:13:11 +0000 +++ etc/NEWS 2014-10-02 03:19:32 +0000 @@ -245,7 +245,12 @@ * Lisp Changes in Emacs 25.1 -** x-select-text is renamed gui-select-text. +** Some "x-*" were obsoleted: +*** x-select-text is renamed gui-select-text. +*** x-get-selection is renamed gui-get-selection. +*** x-get-clipboard and x-clipboard-yank are marked obsolete. +*** x-get-selection-value is renamed to gui-get-primary-selection. +*** x-set-selection is renamed to gui-set-selection ** call-process-shell-command and process-file-shell-command don't take "&rest args" any more. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-02 02:09:30 +0000 +++ lisp/ChangeLog 2014-10-02 03:19:32 +0000 @@ -1,3 +1,39 @@ +2014-10-02 Stefan Monnier + + Consolidate management/ownership of selections. + * select.el (gui-get-selection-alist): New method. + (gui-get-selection): Use it. Rename from x-get-selection. + (x-get-selection): Define as obsolete alias. + (x-get-clipboard): Mark obsolete. + (gui-get-primary-selection): New function. + (x-get-selection-value): Mark obsolete. + (gui-own-selection-alist, gui-disown-selection-alist) + (gui-selection-owner-p-alist): New methods. + (gui-set-selection): Use them. Rename from x-set-selection. + (x-set-selection): Define as obsolete alias. + (gui--valid-simple-selection-p): Rename from + x-valid-simple-selection-p. + * w32-common-fns.el (gui-own-selection, gui-disown-selection) + (gui-selection-owner-p, gui-get-selection): Define for w32. + (w32-get-selection-value): Rename from x-get-selection-value. + Use the new gui-last-selected-text. + * term/x-win.el (x-get-selection-value): Remove. + (x-clipboard-yank): Declare obsolete. + (gui-own-selection, gui-disown-selection, gui-get-selection) + (gui-selection-owner-p): Define for x. + * term/w32-win.el (w32-win-suspend-error): Rename from + x-win-suspend-error. + * term/pc-win.el (w16-get-selection-value): Rename from + x-get-selection-value. + (w16-selection-owner-p): Rename from x-selection-owner-p. + (gui-own-selection, gui-disown-selection, gui-get-selection) + (gui-selection-owner-p): Define for pc. + (w16--select-text): New function. + * term/ns-win.el (gui-own-selection, gui-disown-selection) + (gui-get-selection, gui-selection-owner-p): Define for ns. + * term.el (term-mouse-paste): + * mouse.el (mouse-yank-primary): Use gui-get-primary-selection. + 2014-10-02 H. Dieter Wilhelm (tiny change) * calc/calc-help.el (calc-describe-thing): Quote strings === modified file 'lisp/mouse-copy.el' --- lisp/mouse-copy.el 2014-01-01 07:43:34 +0000 +++ lisp/mouse-copy.el 2014-10-02 03:19:32 +0000 @@ -147,7 +147,7 @@ ;; Third, set the selection. ;; (setq me-beg beg me-end end me-range range) ; for debugging (set-buffer end-buffer) - (x-set-selection 'SECONDARY (buffer-substring beg end))))) + (gui-set-selection 'SECONDARY (buffer-substring beg end))))) (defun mouse-drag-secondary-pasting (start-event) @@ -203,7 +203,7 @@ (kill-region (overlay-start mouse-secondary-overlay) (overlay-end mouse-secondary-overlay))) ;; (delete-overlay mouse-secondary-overlay) - ;; (x-set-selection 'SECONDARY nil) + ;; (gui-set-selection 'SECONDARY nil) ;; (setq mouse-secondary-overlay nil) ) === modified file 'lisp/mouse.el' --- lisp/mouse.el 2014-09-15 00:20:21 +0000 +++ lisp/mouse.el 2014-10-02 03:19:32 +0000 @@ -1068,24 +1068,7 @@ (let (select-active-regions) (deactivate-mark))) (or mouse-yank-at-point (mouse-set-point click)) - (let ((primary - (if (fboundp 'x-get-selection-value) - (if (eq (framep (selected-frame)) 'w32) - ;; MS-Windows emulates PRIMARY in x-get-selection, but not - ;; in x-get-selection-value (the latter only accesses the - ;; clipboard). So try PRIMARY first, in case they selected - ;; something with the mouse in the current Emacs session. - (or (x-get-selection 'PRIMARY) - (x-get-selection-value)) - ;; Else MS-DOS or X. - ;; On X, x-get-selection-value supports more formats and - ;; encodings, so use it in preference to x-get-selection. - (or (x-get-selection-value) - (x-get-selection 'PRIMARY))) - ;; FIXME: What about xterm-mouse-mode etc.? - (x-get-selection 'PRIMARY)))) - (unless primary - (error "No selection is available")) + (let ((primary (gui-get-primary-selection))) (push-mark (point)) (insert-for-yank primary))) @@ -1272,7 +1255,7 @@ (if (numberp (posn-point posn)) (setq beg (posn-point posn))) (move-overlay mouse-secondary-overlay beg (posn-point end)) - (x-set-selection + (gui-set-selection 'SECONDARY (buffer-substring (overlay-start mouse-secondary-overlay) (overlay-end mouse-secondary-overlay)))))) @@ -1347,13 +1330,13 @@ (if (marker-position mouse-secondary-start) (save-window-excursion (delete-overlay mouse-secondary-overlay) - (x-set-selection 'SECONDARY nil) + (gui-set-selection 'SECONDARY nil) (select-window start-window) (save-excursion (goto-char mouse-secondary-start) (sit-for 1) nil)) - (x-set-selection + (gui-set-selection 'SECONDARY (buffer-substring (overlay-start mouse-secondary-overlay) (overlay-end mouse-secondary-overlay))))))))) @@ -1486,7 +1469,7 @@ (setq str (buffer-substring (overlay-start mouse-secondary-overlay) (overlay-end mouse-secondary-overlay))) (> (length str) 0) - (x-set-selection 'SECONDARY str)))) + (gui-set-selection 'SECONDARY str)))) (defcustom mouse-buffer-menu-maxlen 20 === modified file 'lisp/obsolete/mouse-sel.el' --- lisp/obsolete/mouse-sel.el 2014-08-13 14:15:54 +0000 +++ lisp/obsolete/mouse-sel.el 2014-10-02 03:19:32 +0000 @@ -97,7 +97,7 @@ ;; In this mode, mouse-insert-selection just calls mouse-yank-at-click. ;; ;; Selection/kill-ring interaction is retained -;; interprogram-cut-function = x-select-text +;; interprogram-cut-function = gui-select-text ;; interprogram-paste-function = x-selection-value ;; ;; What you lose is the ability to select some text in @@ -292,15 +292,13 @@ SELECTION-THING-SYMBOL = name of variable where the current selection type for this selection should be stored.") -(declare-function x-select-text "term/common-win" (text)) - (defvar mouse-sel-set-selection-function (if (eq mouse-sel-default-bindings 'interprogram-cut-paste) - 'x-set-selection + 'gui-set-selection (lambda (selection value) (if (eq selection 'PRIMARY) - (x-select-text value) - (x-set-selection selection value)))) + (gui-select-text value) + (gui-set-selection selection value)))) "Function to call to set selection. Called with two arguments: @@ -316,7 +314,6 @@ (lambda (selection) (if (eq selection 'PRIMARY) (or (x-selection-value) - (bound-and-true-p x-last-selected-text) (bound-and-true-p x-last-selected-text-primary)) (x-get-selection selection))) "Function to call to get the selection. === modified file 'lisp/select.el' --- lisp/select.el 2014-10-01 22:13:11 +0000 +++ lisp/select.el 2014-10-02 03:19:32 +0000 @@ -71,9 +71,6 @@ variable is set, it is used for the next communication only. After the communication, this variable is set to nil.") -(declare-function x-get-selection-internal "xselect.c" - (selection-symbol target-type &optional time-stamp terminal)) - ;; Only declared obsolete in 23.3. (define-obsolete-function-alias 'x-selection 'x-get-selection "at least 19.34") @@ -93,6 +90,13 @@ Called with one argument (the text selected). Should obey `gui-select-enable-clipboard' where applicable.") +(gui-method-declare gui-get-selection #'ignore + "Return selected text. +Called with 2 arguments: (SELECTION-SYMBOL TARGET-TYPE) +SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. +\(Those are literal upper-case symbol names, since that's what X expects.) +TARGET-TYPE is the type of data desired, typically `STRING'.") + (defvar gui-last-selected-text nil "Last text passed to `gui-select-text'.") @@ -112,7 +116,7 @@ (setq gui-last-selected-text text)) (define-obsolete-function-alias 'x-select-text 'gui-select-text "25.1") -(defun x-get-selection (&optional type data-type) +(defun gui-get-selection (&optional type data-type) "Return the value of an X Windows selection. The argument TYPE (default `PRIMARY') says which selection, and the argument DATA-TYPE (default `STRING') says @@ -126,39 +130,69 @@ DATA-TYPE is usually `STRING', but can also be one of the symbols in `selection-converter-alist', which see. This argument is ignored on MS-Windows and MS-DOS." - (let ((data (x-get-selection-internal (or type 'PRIMARY) - (or data-type 'STRING))) - coding) + (let ((data (gui-call gui-get-selection (or type 'PRIMARY) + (or data-type 'STRING)))) (when (and (stringp data) (setq data-type (get-text-property 0 'foreign-selection data))) - (setq coding (or next-selection-coding-system - selection-coding-system - (cond ((eq data-type 'UTF8_STRING) - 'utf-8) - ((eq data-type 'COMPOUND_TEXT) - 'compound-text-with-extensions) - ((eq data-type 'C_STRING) - nil) - ((eq data-type 'STRING) - 'iso-8859-1) - (t - (error "Unknown selection data type: %S" type)))) - data (if coding (decode-coding-string data coding) - (string-to-multibyte data))) + (let ((coding (or next-selection-coding-system + selection-coding-system + (pcase data-type + ('UTF8_STRING 'utf-8) + ('COMPOUND_TEXT 'compound-text-with-extensions) + ('C_STRING nil) + ('STRING 'iso-8859-1) + (_ (error "Unknown selection data type: %S" + type)))))) + (setq data (if coding (decode-coding-string data coding) + (string-to-multibyte data)))) (setq next-selection-coding-system nil) (put-text-property 0 (length data) 'foreign-selection data-type data)) data)) +(define-obsolete-function-alias 'x-get-selection 'gui-get-selection "25.1") (defun x-get-clipboard () "Return text pasted to the clipboard." - (x-get-selection-internal 'CLIPBOARD 'STRING)) - -(declare-function x-own-selection-internal "xselect.c" - (selection-name selection-value &optional frame)) -(declare-function x-disown-selection-internal "xselect.c" - (selection &optional time terminal)) - -(defun x-set-selection (type data) + (declare (obsolete gui-get-selection "25.1")) + (gui-call gui-get-selection 'CLIPBOARD 'STRING)) + +(defun gui-get-primary-selection () + "Return the PRIMARY selection, or the best emulation thereof." + (or (gui-get-selection 'PRIMARY) + (and (fboundp 'w32-get-selection-value) + (eq (framep (selected-frame)) 'w32) + ;; MS-Windows emulates PRIMARY in x-get-selection, but only + ;; within the Emacs session, so consult the clipboard if + ;; primary is not found. + (w32-get-selection-value)) + (error "No selection is available"))) +(define-obsolete-function-alias 'x-get-selection-value + 'gui-get-primary-selection "25.1") + +(gui-method-declare gui-own-selection nil + "Method to assert a selection of type SELECTION and value VALUE. +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. +(Those are literal upper-case symbol names, since that's what X expects.) +VALUE is typically a string, or a cons of two markers, but may be +anything that the functions on `selection-converter-alist' know about. + +Called with 2 args: (SELECTION VALUE).") + +(gui-method-declare gui-disown-selection nil + "If we own the selection SELECTION, disown it. +Disowning it means there is no such selection. + +Called with one argument: (SELECTION)") + +(gui-method-declare gui-selection-owner-p #'ignore + "Whether the current Emacs process owns the given X Selection. +Called with one argument: (SELECTION). +The arg should be the name of the selection in question, typically one of +the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. +(Those are literal upper-case symbol names, since that's what X expects.) +For convenience, the symbol nil is the same as `PRIMARY', +and t is the same as `SECONDARY'.") + +(defun gui-set-selection (type data) "Make an X selection of type TYPE and value DATA. The argument TYPE (nil means `PRIMARY') says which selection, and DATA specifies the contents. TYPE must be a symbol. \(It can also @@ -186,23 +220,24 @@ (list 'PRIMARY (read-string "Set text for pasting: ")) (list 'PRIMARY (buffer-substring (region-beginning) (region-end))))) (if (stringp type) (setq type (intern type))) - (or (x-valid-simple-selection-p data) + (or (gui--valid-simple-selection-p data) (and (vectorp data) (let ((valid t) (i (1- (length data)))) (while (>= i 0) - (or (x-valid-simple-selection-p (aref data i)) + (or (gui--valid-simple-selection-p (aref data i)) (setq valid nil)) (setq i (1- i))) valid)) (signal 'error (list "invalid selection" data))) (or type (setq type 'PRIMARY)) (if data - (x-own-selection-internal type data) - (x-disown-selection-internal type)) + (gui-call gui-own-selection type data) + (gui-call gui-disown-selection type)) data) +(define-obsolete-function-alias 'x-set-selection 'gui-set-selection "25.1") -(defun x-valid-simple-selection-p (data) +(defun gui--valid-simple-selection-p (data) (or (bufferp data) (and (consp data) (markerp (car data)) @@ -358,7 +393,7 @@ (apply 'vector all))) (defun xselect-convert-to-delete (selection _type _value) - (x-disown-selection-internal selection) + (gui-call gui-disown-selection selection) ;; A return value of nil means that we do not know how to do this conversion, ;; and replies with an "error". A return value of NULL means that we have ;; done the conversion (and any side-effects) but have no value to return. === modified file 'lisp/simple.el' --- lisp/simple.el 2014-10-01 22:13:11 +0000 +++ lisp/simple.el 2014-10-02 03:19:32 +0000 @@ -3629,7 +3629,7 @@ ;;;; Window system cut and paste hooks. -(defvar interprogram-cut-function #'x-select-text +(defvar interprogram-cut-function #'gui-select-text "Function to call to make a killed region available to other programs. Most window systems provide a facility for cutting and pasting text between different programs, such as the clipboard on X and @@ -4497,8 +4497,6 @@ (signal 'mark-inactive nil))) ;; Behind display-selections-p. -(declare-function x-selection-owner-p "xselect.c" - (&optional selection terminal)) (declare-function x-selection-exists-p "xselect.c" (&optional selection terminal)) @@ -4525,15 +4523,15 @@ ;; the region prior to the last command modifying the buffer. ;; Set the selection to that, or to the current region. (cond (saved-region-selection - (x-set-selection 'PRIMARY saved-region-selection) + (gui-set-selection 'PRIMARY saved-region-selection) (setq saved-region-selection nil)) ;; If another program has acquired the selection, region ;; deactivation should not clobber it (Bug#11772). ((and (/= (region-beginning) (region-end)) - (or (x-selection-owner-p 'PRIMARY) - (null (x-selection-exists-p 'PRIMARY)))) - (x-set-selection 'PRIMARY - (funcall region-extract-function nil))))) + (or (call-gui gui-selection-owner-p 'PRIMARY) + (null (gui-selection-exists-p 'PRIMARY)))) + (gui-set-selection 'PRIMARY + (funcall region-extract-function nil))))) (when mark-active (force-mode-line-update)) ;Refresh toolbar (bug#16382). (cond ((eq (car-safe transient-mark-mode) 'only) === modified file 'lisp/term.el' --- lisp/term.el 2014-07-08 19:15:28 +0000 +++ lisp/term.el 2014-10-02 03:19:32 +0000 @@ -1249,16 +1249,7 @@ (run-hooks 'mouse-leave-buffer-hook) (setq this-command 'yank) (mouse-set-point click) - (term-send-raw-string - ;; From `mouse-yank-primary': - (or (if (fboundp 'x-get-selection-value) - (if (eq system-type 'windows-nt) - (or (x-get-selection 'PRIMARY) - (x-get-selection-value)) - (or (x-get-selection-value) - (x-get-selection 'PRIMARY))) - (x-get-selection 'PRIMARY)) - (error "No selection is available"))))) + (term-send-raw-string (gui-get-primary-selection)))) (defun term-paste () "Insert the last stretch of killed text at point." === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2014-10-01 22:13:11 +0000 +++ lisp/term/ns-win.el 2014-10-02 03:19:32 +0000 @@ -971,6 +971,11 @@ (when gui-select-enable-clipboard (ns-set-pasteboard text)))) +(gui-method-define gui-own-selection x #'ns-own-selection-internal) +(gui-method-define gui-disown-selection x #'ns-disown-selection-internal) +(gui-method-define gui-selection-owner-p x #'ns-selection-owner-p) +(gui-method-define gui-get-selection x #'x-get-selection-internal) ;FIXME:name! + (provide 'ns-win) ;;; ns-win.el ends here === modified file 'lisp/term/pc-win.el' --- lisp/term/pc-win.el 2014-10-01 22:13:11 +0000 +++ lisp/term/pc-win.el 2014-10-02 03:19:32 +0000 @@ -219,7 +219,7 @@ ; ;;;; Selections ; -(defun x-get-selection-value () +(defun w16-get-selection-value () "Return the value of the current selection. Consult the selection. Treat empty strings as if they were unset." (if gui-select-enable-clipboard @@ -238,93 +238,44 @@ (t (setq gui-last-selected-text text)))))) -;; x-selection-owner-p is used in simple.el. -(defun x-selection-owner-p (&optional _selection _terminal) - "Whether the current Emacs process owns the given X Selection. -The arg should be the name of the selection in question, typically one of -the symbols `PRIMARY', `SECONDARY', or `CLIPBOARD'. -\(Those are literal upper-case symbol names, since that's what X expects.) -For convenience, the symbol nil is the same as `PRIMARY', -and t is the same as `SECONDARY'. - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, TERMINAL is unused. - -\(fn &optional SELECTION TERMINAL)" - (if gui-select-enable-clipboard - (let (text) - ;; Don't die if w16-get-clipboard-data signals an error. - (ignore-errors - (setq text (w16-get-clipboard-data))) - ;; We consider ourselves the owner of the selection if it does - ;; not exist, or exists and compares equal with the last text - ;; we've put into the Windows clipboard. - (cond - ((not text) t) - ((or (eq text gui-last-selected-text) - (string= text gui-last-selected-text)) - text) - (t nil))))) - -;; x-own-selection-internal and x-disown-selection-internal are used -;; in select.el:x-set-selection. -(defun x-own-selection-internal (_selection value &optional _frame) - "Assert an X selection of the type SELECTION with and value VALUE. -SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. -\(Those are literal upper-case symbol names, since that's what X expects.) -VALUE is typically a string, or a cons of two markers, but may be -anything that the functions on `selection-converter-alist' know about. - -FRAME should be a frame that should own the selection. If omitted or -nil, it defaults to the selected frame. - -On Nextstep, FRAME is unused. - -\(fn SELECTION VALUE &optional FRAME)" - (ignore-errors - (x-select-text value)) - value) - -(defun x-disown-selection-internal (selection &optional _time-object _terminal) - "If we own the selection SELECTION, disown it. -Disowning it means there is no such selection. - -Sets the last-change time for the selection to TIME-OBJECT (by default -the time of the last event). - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. -On MS-DOS, all this does is return non-nil if we own the selection. - -\(fn SELECTION &optional TIME-OBJECT TERMINAL)" - (if (x-selection-owner-p selection) - t)) - -;; x-get-selection-internal is used in select.el -(defun x-get-selection-internal (_selection-symbol _target-type - &optional _time-stamp _terminal) - "Return text selected from some X window. -SELECTION-SYMBOL is typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. -\(Those are literal upper-case symbol names, since that's what X expects.) -TARGET-TYPE is the type of data desired, typically `STRING'. - -TIME-STAMP is the time to use in the XConvertSelection call for foreign -selections. If omitted, defaults to the time for the last event. - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, TIME-STAMP and TERMINAL are unused. - -\(fn SELECTION-SYMBOL TARGET-TYPE &optional TIME-STAMP TERMINAL)" - (x-get-selection-value)) +;; gui-selection-owner-p is used in simple.el. +(gui-method-define gui-selection-owner-p pc #'w16-selection-owner-p) +(defun w16-selection-owner-p (_selection) + ;; FIXME: Other systems don't obey gui-select-enable-clipboard here. + (if gui-select-enable-clipboard + (let ((text + ;; Don't die if w16-get-clipboard-data signals an error. + (ignore-errors + (w16-get-clipboard-data)))) + ;; We consider ourselves the owner of the selection + ;; if it does not exist, or exists and compares + ;; equal with the last text we've put into the + ;; Windows clipboard. + (cond + ((not text) t) + ((or (eq text gui-last-selected-text) + (string= text gui-last-selected-text)) + text) + (t nil))))) + +;; gui-own-selection and gui-disown-selection are used in gui-set-selection. +(gui-method-define gui-own-selection pc + (lambda (_selection value) + ;; FIXME: Other systems don't obey + ;; gui-select-enable-clipboard here. + (ignore-errors + (w16--select-text value)) + value)) + +(gui-method-define gui-disown-selection pc + (lambda (selection &optional _time-object _terminal) + (if (w16-selection-owner-p selection) + t))) + +;; gui-get-selection is used in select.el +(gui-method-define gui-get-selection pc + (lambda (selection-symbol target-type) + (w16-get-selection-value))) ;; From src/fontset.c: (fset 'query-fontset 'ignore) @@ -429,7 +380,7 @@ (setq split-window-keep-point t) ;; Arrange for the kill and yank functions to set and check the ;; clipboard. - (setq interprogram-paste-function 'x-get-selection-value) + (setq interprogram-paste-function #'w16-get-selection-value) (menu-bar-enable-clipboard) (run-hooks 'terminal-init-msdos-hook)) @@ -446,10 +397,10 @@ (declare-function w16-set-clipboard-data "w16select.c" (string &optional ignored)) -(gui-method-define gui-select-text pc - (lambda (text) - (when gui-select-enable-clipboard - (w16-set-clipboard-data text)))) +(gui-method-define gui-select-text pc #'w16--select-text) +(defun w16--select-text (text) + (when gui-select-enable-clipboard + (w16-set-clipboard-data text))) ;; --------------------------------------------------------------------------- === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2014-10-01 22:13:11 +0000 +++ lisp/term/w32-win.el 2014-10-02 03:19:32 +0000 @@ -205,9 +205,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") -(defun x-win-suspend-error () - "Report an error when a suspend is attempted. -This returns an error if any Emacs frames are X frames, or always under W32." +(defun w32-win-suspend-error () + "Report an error when a suspend is attempted." (error "Suspending an Emacs running under W32 makes no sense")) (defvar dynamic-library-alist) @@ -353,7 +352,7 @@ (cons '(reverse . t) default-frame-alist))))) ;; Don't let Emacs suspend under Windows. - (add-hook 'suspend-hook 'x-win-suspend-error) + (add-hook 'suspend-hook #'w32-win-suspend-error) ;; Turn off window-splitting optimization; w32 is usually fast enough ;; that this is only annoying. === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2014-10-01 22:13:11 +0000 +++ lisp/term/x-win.el 2014-10-02 03:19:32 +0000 @@ -1290,16 +1290,9 @@ ;; Arrange for the kill and yank functions to set and check the clipboard. (setq interprogram-paste-function 'x-selection-value) -;; Make paste from other applications use the decoding in x-select-request-type -;; and not just STRING. -(defun x-get-selection-value () - "Get the current value of the PRIMARY selection. -Request data types in the order specified by `x-select-request-type'." - (x-selection-value-internal 'PRIMARY)) - (defun x-clipboard-yank () - ;; FIXME: How is that different from `clipboard-yank'? "Insert the clipboard contents, or the last stretch of killed text." + (declare (obsolete clipboard-yank "25.1")) (interactive "*") (let ((clipboard-text (x-selection-value-internal 'CLIPBOARD)) (x-select-enable-clipboard t)) @@ -1325,9 +1318,9 @@ (defun x-win-suspend-error () "Report an error when a suspend is attempted. -This returns an error if any Emacs frames are X frames, or always under W32." +This returns an error if any Emacs frames are X frames." ;; Don't allow suspending if any of the frames are X frames. - (if (memq 'x (mapcar 'window-system (frame-list))) + (if (memq 'x (mapcar #'window-system (frame-list))) (error "Cannot suspend Emacs while running under X"))) (defvar x-initialized nil @@ -1469,15 +1462,19 @@ (gui-method-define gui-select-text x (lambda (text) (when x-select-enable-primary - (x-set-selection 'PRIMARY text) + (gui-set-selection 'PRIMARY text) (setq x-last-selected-text-primary text)) (when x-select-enable-clipboard ;; When cutting, the selection is cleared and PRIMARY ;; set to the empty string. Prevent that, PRIMARY ;; should not be reset by cut (Bug#16382). (setq saved-region-selection text) - (x-set-selection 'CLIPBOARD text) + (gui-set-selection 'CLIPBOARD text) (setq x-last-selected-text-clipboard text)))) +(gui-method-define gui-own-selection x #'x-own-selection-internal) +(gui-method-define gui-disown-selection x #'x-disown-selection-internal) +(gui-method-define gui-selection-owner-p x #'x-selection-owner-p) +(gui-method-define gui-get-selection x #'x-get-selection-internal) ;; Initiate drag and drop (add-hook 'after-make-frame-functions 'x-dnd-init-frame) === modified file 'lisp/w32-common-fns.el' --- lisp/w32-common-fns.el 2014-10-01 22:13:11 +0000 +++ lisp/w32-common-fns.el 2014-10-02 03:19:32 +0000 @@ -41,53 +41,23 @@ (declare-function x-server-version "w32fns.c" (&optional display)) ;;; Fix interface to (X-specific) mouse.el -(defun x-set-selection (type data) - "Make an X selection of type TYPE and value DATA. -The argument TYPE (nil means `PRIMARY') says which selection, and -DATA specifies the contents. TYPE must be a symbol. \(It can also -be a string, which stands for the symbol with that name, but this -is considered obsolete.) DATA may be a string, a symbol, an -integer (or a cons of two integers or list of two integers). - -The selection may also be a cons of two markers pointing to the same buffer, -or an overlay. In these cases, the selection is considered to be the text -between the markers *at whatever time the selection is examined*. -Thus, editing done in the buffer after you specify the selection -can alter the effective value of the selection. - -The data may also be a vector of valid non-vector selection values. - -The return value is DATA. - -Interactively, this command sets the primary selection. Without -prefix argument, it reads the selection in the minibuffer. With -prefix argument, it uses the text of the region as the selection value. - -Note that on MS-Windows, primary and secondary selections set by Emacs -are not available to other programs." - (put 'x-selections (or type 'PRIMARY) data)) - -(defun x-get-selection (&optional type _data-type) - "Return the value of an X Windows selection. -The argument TYPE (default `PRIMARY') says which selection, -and the argument DATA-TYPE (default `STRING') says -how to convert the data. - -TYPE may be any symbol \(but nil stands for `PRIMARY'). However, -only a few symbols are commonly used. They conventionally have -all upper-case names. The most often used ones, in addition to -`PRIMARY', are `SECONDARY' and `CLIPBOARD'. - -DATA-TYPE is usually `STRING', but can also be one of the symbols -in `selection-converter-alist', which see. This argument is -ignored on MS-Windows and MS-DOS." - (get 'x-selections (or type 'PRIMARY))) - -;; x-selection-owner-p is used in simple.el -(defun x-selection-owner-p (&optional selection _terminal) - "" ; placeholder for doc.c - (and (memq selection '(nil PRIMARY SECONDARY)) - (get 'x-selections (or selection 'PRIMARY)))) +(gui-method-define gui-own-selection w32 + (lambda (type value) + (put 'x-selections (or type 'PRIMARY) data))) + +(gui-method-define gui-disown-selection w32 + (lambda (type &optional _time-object _frame) + (put 'x-selections (or type 'PRIMARY) nil))) + +(gui-method-define gui-get-selection w32 + (lambda (&optional type _data-type) + (get 'x-selections (or type 'PRIMARY)))) + +;; gui-selection-owner-p is used in simple.el +(gui-method-define gui-selection-owner-p w32 + (lambda (selection) + (and (memq selection '(nil PRIMARY SECONDARY)) + (get 'x-selections (or selection 'PRIMARY))))) ;; The "Windows" keys on newer keyboards bring up the Start menu ;; whether you want it or not - make Emacs ignore these keystrokes @@ -103,30 +73,29 @@ ;; We keep track of the last text selected here, so we can check the ;; current selection against it, and avoid passing back our own text ;; from x-selection-value. -(defvar x-last-selected-text nil) -(defun x-get-selection-value () +(defun w32-get-selection-value () "Return the value of the current selection. Consult the selection. Treat empty strings as if they were unset." (if gui-select-enable-clipboard - (let (text) - ;; Don't die if x-get-selection signals an error. - (with-demoted-errors "w32-get-clipboard-data:%s" - (setq text (w32-get-clipboard-data))) + (let ((text + ;; Don't die if x-get-selection signals an error. + (with-demoted-errors "w32-get-clipboard-data:%S" + (w32-get-clipboard-data)))) (if (string= text "") (setq text nil)) (cond ((not text) nil) - ((eq text x-last-selected-text) nil) - ((string= text x-last-selected-text) + ((eq text gui-last-selected-text) nil) + ((string= text gui-last-selected-text) ;; Record the newer string, so subsequent calls can use the 'eq' test. - (setq x-last-selected-text text) + (setq gui-last-selected-text text) nil) (t - (setq x-last-selected-text text)))))) + (setq gui-last-selected-text text)))))) -(defalias 'x-selection-value 'x-get-selection-value) +(defalias 'x-selection-value #'w32-get-selection-value) ;; Arrange for the kill and yank functions to set and check the clipboard. -(setq interprogram-paste-function 'x-get-selection-value) +(setq interprogram-paste-function #'w32-get-selection-value) (provide 'w32-common-fns) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 22:14:43 +0000 +++ src/ChangeLog 2014-10-02 03:19:32 +0000 @@ -1,3 +1,8 @@ +2014-10-02 Stefan Monnier + + * nsselect.m (ns-own-selection-internal, ns-disown-selection-internal): + Rename from the "x-" prefix. + 2014-10-01 Stefan Monnier * xselect.c (selection-converter-alist): Fix docstring. === modified file 'src/nsselect.m' --- src/nsselect.m 2014-05-05 17:37:43 +0000 +++ src/nsselect.m 2014-10-02 03:19:32 +0000 @@ -328,19 +328,14 @@ ========================================================================== */ -DEFUN ("x-own-selection-internal", Fx_own_selection_internal, - Sx_own_selection_internal, 2, 3, 0, +DEFUN ("ns-own-selection-internal", Fns_own_selection_internal, + Sns_own_selection_internal, 2, 2, 0, doc: /* Assert an X selection of type SELECTION and value VALUE. SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. \(Those are literal upper-case symbol names, since that's what X expects.) VALUE is typically a string, or a cons of two markers, but may be -anything that the functions on `selection-converter-alist' know about. - -FRAME should be a frame that should own the selection. If omitted or -nil, it defaults to the selected frame. - -On Nextstep, FRAME is unused. */) - (Lisp_Object selection, Lisp_Object value, Lisp_Object frame) +anything that the functions on `selection-converter-alist' know about. */) + (Lisp_Object selection, Lisp_Object value) { id pb; Lisp_Object old_value, new_value; @@ -385,21 +380,11 @@ } -DEFUN ("x-disown-selection-internal", Fx_disown_selection_internal, - Sx_disown_selection_internal, 1, 3, 0, +DEFUN ("ns-disown-selection-internal", Fns_disown_selection_internal, + Sns_disown_selection_internal, 1, 1, 0, doc: /* If we own the selection SELECTION, disown it. -Disowning it means there is no such selection. - -Sets the last-change time for the selection to TIME-OBJECT (by default -the time of the last event). - -TERMINAL should be a terminal object or a frame specifying the X -server to query. If omitted or nil, that stands for the selected -frame's display, or the first available X display. - -On Nextstep, the TIME-OBJECT and TERMINAL arguments are unused. -On MS-DOS, all this does is return non-nil if we own the selection. */) - (Lisp_Object selection, Lisp_Object time_object, Lisp_Object terminal) +Disowning it means there is no such selection. */) + (Lisp_Object selection) { id pb; check_window_system (NULL); @@ -443,7 +428,7 @@ } -DEFUN ("x-selection-owner-p", Fx_selection_owner_p, Sx_selection_owner_p, +DEFUN ("ns-selection-owner-p", Fns_selection_owner_p, Sns_selection_owner_p, 0, 2, 0, doc: /* Whether the current Emacs process owns the given X Selection. The arg should be the name of the selection in question, typically one of @@ -507,7 +492,7 @@ DEFUN ("ns-get-selection-internal", Fns_get_selection_internal, Sns_get_selection_internal, 1, 1, 0, doc: /* Returns the value of SELECTION as a string. -SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */) +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */) (Lisp_Object selection) { id pb; @@ -520,7 +505,7 @@ DEFUN ("ns-store-selection-internal", Fns_store_selection_internal, Sns_store_selection_internal, 2, 2, 0, doc: /* Sets the string value of SELECTION. -SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */) +SELECTION is a symbol, typically `PRIMARY', `SECONDARY', or `CLIPBOARD'. */) (Lisp_Object selection, Lisp_Object string) { id pb; @@ -546,11 +531,11 @@ QTEXT = intern_c_string ("TEXT"); staticpro (&QTEXT); QFILE_NAME = intern_c_string ("FILE_NAME"); staticpro (&QFILE_NAME); - defsubr (&Sx_disown_selection_internal); + defsubr (&Sns_disown_selection_internal); defsubr (&Sx_get_selection_internal); - defsubr (&Sx_own_selection_internal); + defsubr (&Sns_own_selection_internal); defsubr (&Sx_selection_exists_p); - defsubr (&Sx_selection_owner_p); + defsubr (&Sns_selection_owner_p); defsubr (&Sns_get_selection_internal); defsubr (&Sns_store_selection_internal); ------------------------------------------------------------ revno: 118005 committer: Jay Belanger branch nick: trunk timestamp: Wed 2014-10-01 21:09:30 -0500 message: Add missing name to Changelog. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-02 01:41:10 +0000 +++ lisp/ChangeLog 2014-10-02 02:09:30 +0000 @@ -1,4 +1,4 @@ -2014-10-02 +2014-10-02 H. Dieter Wilhelm (tiny change) * calc/calc-help.el (calc-describe-thing): Quote strings which could look like regexps. ------------------------------------------------------------ revno: 118004 author: H. Dieter Wilhelm committer: Jay Belanger branch nick: trunk timestamp: Wed 2014-10-01 20:41:10 -0500 message: calc/calc-help.el (calc-describe-thing): Quote strings which could look like regexps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-01 22:14:43 +0000 +++ lisp/ChangeLog 2014-10-02 01:41:10 +0000 @@ -1,3 +1,8 @@ +2014-10-02 + + * calc/calc-help.el (calc-describe-thing): Quote strings + which could look like regexps. + 2014-10-01 Stefan Monnier Consolidate x-select-text. === modified file 'lisp/calc/calc-help.el' --- lisp/calc/calc-help.el 2014-01-01 07:43:34 +0000 +++ lisp/calc/calc-help.el 2014-10-02 01:41:10 +0000 @@ -366,9 +366,9 @@ (Info-goto-node (buffer-substring (match-beginning 1) (match-end 1)))) (or (let ((case-fold-search nil)) (or (re-search-forward (format "\\[`%s'\\]\\|(`%s')\\|\\ branch nick: trunk timestamp: Wed 2014-10-01 18:14:43 -0400 message: Commit forgotten ChangeLog files diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-01 17:23:42 +0000 +++ lisp/ChangeLog 2014-10-01 22:14:43 +0000 @@ -1,5 +1,46 @@ 2014-10-01 Stefan Monnier + Consolidate x-select-text. + * frame.el (gui-method, gui-method-define, gui-method-declare) + (gui-call): New macros. + (gui-method--name): New function. + (frame-creation-function-alist): Use gui-method-declare. + (make-frame): Use gui-method. + * select.el (gui-select-enable-clipboard): Rename from + x-select-enable-clipboard and move here. + (x-select-enable-clipboard): Define as obsolete alias. + (gui-last-selected-text): New var, to replace x-last-selected-text. + (gui-select-text): New GUI method. + (gui-select-text): New function. + (x-select-text): Define as obsolete alias. + * term/common-win.el (x-select-enable-clipboard, x-select-text): + Move to select.el. + * simple.el (interprogram-cut-function): Change default to + x-select-text. + (interprogram-paste-function): Change default to `ignore'. + * w32-common-fns.el (interprogram-cut-function): Don't modify. + * term/x-win.el (interprogram-cut-function): Don't modify. + (gui-select-text): Add method for x. + * term/w32-win.el (gui-select-text): Add method for w32. + * term/pc-win.el (x-last-selected-text): Remove, use + gui-last-selected-text instead. + (msdos-initialize-window-system): Don't set interprogram-cut-function. + (gui-select-text): Add method for pc. + * term/ns-win.el (ns-last-selected-text): Remove, use + gui-last-selected-text instead. + (gui-select-text): Add method for ns. + (x-setup-function-keys): Don't change interprogram-cut-function. + * loadup.el ("startup"): Load after "frame". + * subr.el (package--builtin-versions, package--description-file): + Move from startup.el. + * startup.el (package--builtin-versions, package--description-file): + Move to subr.el. + (handle-args-function-alist, window-system-initialization-alist): + Use gui-method-declare. + (command-line): Use gui-method. + +2014-10-01 Stefan Monnier + * subr.el (alist-get): New accessor. * emacs-lisp/gv.el (alist-get): Provide expander. * winner.el (winner-remember): === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 15:18:16 +0000 +++ src/ChangeLog 2014-10-01 22:14:43 +0000 @@ -1,3 +1,7 @@ +2014-10-01 Stefan Monnier + + * xselect.c (selection-converter-alist): Fix docstring. + 2014-10-01 Eli Zaretskii * w32proc.c (sys_spawnve): Avoid modification of the CMDNAME ------------------------------------------------------------ revno: 118002 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-10-01 18:13:11 -0400 message: Consolidate x-select-text. * lisp/frame.el (gui-method, gui-method-define, gui-method-declare) (gui-call): New macros. (gui-method--name): New function. (frame-creation-function-alist): Use gui-method-declare. (make-frame): Use gui-method. * lisp/select.el (gui-select-enable-clipboard): Rename from x-select-enable-clipboard and move here. (x-select-enable-clipboard): Define as obsolete alias. (gui-last-selected-text): New var, to replace x-last-selected-text. (gui-select-text): New GUI method. (gui-select-text): New function. (x-select-text): Define as obsolete alias. * lisp/term/common-win.el (x-select-enable-clipboard, x-select-text): Move to select.el. * lisp/simple.el (interprogram-cut-function): Change default to x-select-text. (interprogram-paste-function): Change default to `ignore'. * lisp/w32-common-fns.el (interprogram-cut-function): Don't modify. * lisp/term/x-win.el (interprogram-cut-function): Don't modify. (gui-select-text): Add method for x. * lisp/term/w32-win.el (gui-select-text): Add method for w32. * lisp/term/pc-win.el (x-last-selected-text): Remove, use gui-last-selected-text instead. (msdos-initialize-window-system): Don't set interprogram-cut-function. (gui-select-text): Add method for pc. * lisp/term/ns-win.el (ns-last-selected-text): Remove, use gui-last-selected-text instead. (gui-select-text): Add method for ns. (x-setup-function-keys): Don't change interprogram-cut-function. * lisp/loadup.el ("startup"): Load after "frame". * lisp/subr.el (package--builtin-versions, package--description-file): Move from startup.el. * lisp/startup.el (package--builtin-versions, package--description-file): Move to subr.el. (handle-args-function-alist, window-system-initialization-alist): Use gui-method-declare. (command-line): Use gui-method. * src/xselect.c (selection-converter-alist): Fix docstring. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-10-01 17:23:42 +0000 +++ etc/NEWS 2014-10-01 22:13:11 +0000 @@ -49,6 +49,9 @@ * Changes in Emacs 25.1 +** x-select-enable-clipboard is renamed gui-select-enable-clipboard. +Additionally it now also applies to OSX and GNUstep. + ** `insert-register' now leaves point after the inserted text when called interactively. A prefix argument toggles this behavior. @@ -242,7 +245,9 @@ * Lisp Changes in Emacs 25.1 -*** call-process-shell-command and process-file-shell-command +** x-select-text is renamed gui-select-text. + +** call-process-shell-command and process-file-shell-command don't take "&rest args" any more. ** New function `alist-get', which is also a valid place (aka lvalue). === modified file 'lisp/emacs-lisp/cl-lib.el' --- lisp/emacs-lisp/cl-lib.el 2014-09-26 00:15:21 +0000 +++ lisp/emacs-lisp/cl-lib.el 2014-10-01 22:13:11 +0000 @@ -701,7 +701,6 @@ (gv-define-setter window-width (store) `(progn (enlarge-window (- ,store (window-width)) t) ,store)) (gv-define-simple-setter x-get-secondary-selection x-own-secondary-selection t) -(gv-define-simple-setter x-get-selection x-own-selection t) ;; More complex setf-methods. === modified file 'lisp/eshell/esh-io.el' --- lisp/eshell/esh-io.el 2014-01-01 07:43:34 +0000 +++ lisp/eshell/esh-io.el 2014-10-01 22:13:11 +0000 @@ -118,8 +118,6 @@ :type 'integer :group 'eshell-io) -(defvar x-select-enable-clipboard) ; term/common-win - (defcustom eshell-virtual-targets '(("/dev/eshell" eshell-interactive-print nil) ("/dev/kill" (lambda (mode) @@ -128,7 +126,7 @@ 'eshell-kill-append) t) ("/dev/clip" (lambda (mode) (if (eq mode 'overwrite) - (let ((x-select-enable-clipboard t)) + (let ((gui-select-enable-clipboard t)) (kill-new ""))) 'eshell-clipboard-append) t)) "Map virtual devices name to Emacs Lisp functions. @@ -328,7 +326,7 @@ (defun eshell-clipboard-append (string) "Call `kill-append' with STRING, if it is indeed a string." (if (stringp string) - (let ((x-select-enable-clipboard t)) + (let ((gui-select-enable-clipboard t)) (kill-append string nil)))) (defun eshell-get-target (target &optional mode) === modified file 'lisp/frame.el' --- lisp/frame.el 2014-09-03 15:10:29 +0000 +++ lisp/frame.el 2014-10-01 22:13:11 +0000 @@ -26,21 +26,39 @@ ;;; Code: (eval-when-compile (require 'cl-lib)) -(defvar frame-creation-function-alist - (list (cons nil - (if (fboundp 'tty-create-frame-with-faces) - 'tty-create-frame-with-faces - (lambda (_parameters) - (error "Can't create multiple frames without a window system"))))) - "Alist of window-system dependent functions to call to create a new frame. +;; Dispatch tables for GUI methods. + +(defun gui-method--name (base) + (intern (format "%s-alist" base))) + +(defmacro gui-method (name &optional type) + (macroexp-let2 nil type (or type `(framep (selected-frame))) + `(alist-get ,type ,(gui-method--name name) + (lambda (&rest _args) + (error "No method %S for %S frame" ',name ,type))))) + +(defmacro gui-method-define (name type fun) + `(setf (gui-method ,name ',type) ,fun)) + +(defmacro gui-method-declare (name &optional tty-fun doc) + (declare (doc-string 3) (indent 2)) + `(defvar ,(gui-method--name name) + ,(if tty-fun `(list (cons t ,tty-fun))) ,doc)) + +(defmacro gui-call (name &rest args) + `(funcall (gui-method ,name) ,@args)) + +(gui-method-declare frame-creation-function + #'tty-create-frame-with-faces + "Method for window-system dependent functions to create a new frame. The window system startup file should add its frame creation -function to this list, which should take an alist of parameters +function to this method, which should take an alist of parameters as its argument.") (defvar window-system-default-frame-alist nil "Window-system dependent default frame parameters. The value should be an alist of elements (WINDOW-SYSTEM . ALIST), -where WINDOW-SYSTEM is a window system symbol (see `window-system') +where WINDOW-SYSTEM is a window system symbol (as returned by `framep') and ALIST is a frame parameter alist like `default-frame-alist'. Then, for frames on WINDOW-SYSTEM, any parameters specified in ALIST supersede the corresponding parameters specified in @@ -632,9 +650,8 @@ ((assq 'terminal parameters) (let ((type (terminal-live-p (cdr (assq 'terminal parameters))))) (cond - ((eq type t) nil) - ((eq type nil) (error "Terminal %s does not exist" - (cdr (assq 'terminal parameters)))) + ((null type) (error "Terminal %s does not exist" + (cdr (assq 'terminal parameters)))) (t type)))) ((assq 'window-system parameters) (cdr (assq 'window-system parameters))) @@ -643,15 +660,12 @@ (error "Don't know how to interpret display %S" display))) (t window-system))) - (frame-creation-function (cdr (assq w frame-creation-function-alist))) (oldframe (selected-frame)) (params parameters) frame) - (unless frame-creation-function - (error "Don't know how to create a frame on window system %s" w)) (unless (get w 'window-system-initialized) - (funcall (cdr (assq w window-system-initialization-alist)) display) + (funcall (gui-method window-system-initialization w) display) (setq x-display-name display) (put w 'window-system-initialized t)) @@ -665,7 +679,8 @@ (push p params))) ;; Now make the frame. (run-hooks 'before-make-frame-hook) - (setq frame (funcall frame-creation-function params)) + (setq frame + (funcall (gui-method frame-creation-function w) params)) (normal-erase-is-backspace-setup-frame frame) ;; Inherit the original frame's parameters. (dolist (param frame-inherited-parameters) === modified file 'lisp/loadup.el' --- lisp/loadup.el 2014-09-27 03:57:41 +0000 +++ lisp/loadup.el 2014-10-01 22:13:11 +0000 @@ -126,7 +126,6 @@ (load "faces") ; after here, `defface' may be used. (load "button") -(load "startup") ;; We don't want to store loaddefs.el in the repository because it is ;; a generated file; but it is required in order to compile the lisp files. @@ -193,6 +192,7 @@ (load "indent") (load "frame") +(load "startup") (load "term/tty-colors") (load "font-core") ;; facemenu must be loaded before font-lock, because `facemenu-keymap' === modified file 'lisp/menu-bar.el' --- lisp/menu-bar.el 2014-09-05 10:29:34 +0000 +++ lisp/menu-bar.el 2014-10-01 22:13:11 +0000 @@ -545,19 +545,19 @@ (defun clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text." (interactive "*") - (let ((x-select-enable-clipboard t)) + (let ((gui-select-enable-clipboard t)) (yank))) (defun clipboard-kill-ring-save (beg end &optional region) - "Copy region to kill ring, and save in the X clipboard." + "Copy region to kill ring, and save in the GUI's clipboard." (interactive "r\np") - (let ((x-select-enable-clipboard t)) + (let ((gui-select-enable-clipboard t)) (kill-ring-save beg end region))) (defun clipboard-kill-region (beg end &optional region) - "Kill the region, and save it in the X clipboard." + "Kill the region, and save it in the GUI's clipboard." (interactive "r\np") - (let ((x-select-enable-clipboard t)) + (let ((gui-select-enable-clipboard t)) (kill-region beg end region))) (defun menu-bar-enable-clipboard () === modified file 'lisp/select.el' --- lisp/select.el 2014-02-10 17:05:52 +0000 +++ lisp/select.el 2014-10-01 22:13:11 +0000 @@ -77,6 +77,41 @@ ;; Only declared obsolete in 23.3. (define-obsolete-function-alias 'x-selection 'x-get-selection "at least 19.34") +(defcustom gui-select-enable-clipboard t + "Non-nil means cutting and pasting uses the clipboard. +This can be in addition to, but in preference to, the primary selection, +if applicable (i.e. under X11)." + :type 'boolean + :group 'killing + ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. + :version "24.1") +(define-obsolete-variable-alias 'x-select-enable-clipboard + 'gui-select-enable-clipboard "25.1") + +(gui-method-declare gui-select-text #'ignore + "Method used to pass the current selection to the system. +Called with one argument (the text selected). +Should obey `gui-select-enable-clipboard' where applicable.") + +(defvar gui-last-selected-text nil + "Last text passed to `gui-select-text'.") + +(defun gui-select-text (text) + "Select TEXT, a string, according to the window system. +if `gui-select-enable-clipboard' is non-nil, copy TEXT to the system's clipboard. + +On X, if `x-select-enable-primary' is non-nil, put TEXT in +the primary selection. + +On MS-Windows, make TEXT the current selection." + ;; FIXME: We should test gui-select-enable-clipboard here! + ;; But that would break the independence between x-select-enable-primary + ;; and x-select-enable-clipboard! + ;;(when gui-select-enable-clipboard + (gui-call gui-select-text text) ;;) + (setq gui-last-selected-text text)) +(define-obsolete-function-alias 'x-select-text 'gui-select-text "25.1") + (defun x-get-selection (&optional type data-type) "Return the value of an X Windows selection. The argument TYPE (default `PRIMARY') says which selection, === modified file 'lisp/simple.el' --- lisp/simple.el 2014-09-29 18:14:08 +0000 +++ lisp/simple.el 2014-10-01 22:13:11 +0000 @@ -3629,7 +3629,7 @@ ;;;; Window system cut and paste hooks. -(defvar interprogram-cut-function nil +(defvar interprogram-cut-function #'x-select-text "Function to call to make a killed region available to other programs. Most window systems provide a facility for cutting and pasting text between different programs, such as the clipboard on X and @@ -3640,7 +3640,7 @@ programs. The function takes one argument, TEXT, which is a string containing the text which should be made available.") -(defvar interprogram-paste-function nil +(defvar interprogram-paste-function #'ignore "Function to call to get text cut from other programs. Most window systems provide a facility for cutting and pasting text between different programs, such as the clipboard on X and === modified file 'lisp/startup.el' --- lisp/startup.el 2014-09-03 04:21:40 +0000 +++ lisp/startup.el 2014-10-01 22:13:11 +0000 @@ -421,21 +421,6 @@ :type 'directory :initialize 'custom-initialize-delay) -(defvar package--builtin-versions - ;; Mostly populated by loaddefs.el via autoload-builtin-package-versions. - (purecopy `((emacs . ,(version-to-list emacs-version)))) - "Alist giving the version of each versioned builtin package. -I.e. each element of the list is of the form (NAME . VERSION) where -NAME is the package name as a symbol, and VERSION is its version -as a list.") - -(defun package--description-file (dir) - (concat (let ((subdir (file-name-nondirectory - (directory-file-name dir)))) - (if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)" subdir) - (match-string 1 subdir) subdir)) - "-pkg.el")) - (defun normal-top-level-add-subdirs-to-load-path () "Add all subdirectories of `default-directory' to `load-path'. More precisely, this uses only the subdirectories whose names @@ -719,17 +704,17 @@ (defconst tool-bar-images-pixel-height 24 "Height in pixels of images in the tool-bar.") -(defvar handle-args-function-alist '((nil . tty-handle-args)) - "Functions for processing window-system dependent command-line arguments. +(gui-method-declare handle-args-function #'tty-handle-args + "Method for processing window-system dependent command-line arguments. Window system startup files should add their own function to this -alist, which should parse the command line arguments. Those +method, which should parse the command line arguments. Those pertaining to the window system should be processed and removed from the returned command line.") -(defvar window-system-initialization-alist '((nil . ignore)) - "Alist of window-system initialization functions. -Window-system startup files should add their own initialization -function to this list. The function should take no arguments, +(gui-method-declare window-system-initialization #'ignore + "Method for window-system initialization. +Window-system startup files should add their own implementation +to this method. The function should take no arguments, and initialize the window system environment to prepare for opening the first frame (e.g. open a connection to an X server).") @@ -965,8 +950,7 @@ ;; Process window-system specific command line parameters. (setq command-line-args (funcall - (or (cdr (assq initial-window-system handle-args-function-alist)) - (error "Unsupported window system `%s'" initial-window-system)) + (gui-method handle-args-function (or initial-window-system t)) command-line-args)) ;; Initialize the window system. (Open connection, etc.) (funcall @@ -1311,9 +1295,10 @@ (format "Your `load-path' seems to contain your `.emacs.d' directory: %s\n\ This is likely to cause problems...\n\ -Consider using a subdirectory instead, e.g.: %s" dir -(expand-file-name "lisp" user-emacs-directory)) - :warning)))) +Consider using a subdirectory instead, e.g.: %s" + dir (expand-file-name + "lisp" user-emacs-directory)) + :warning)))) ;; If -batch, terminate after processing the command options. (if noninteractive (kill-emacs t)) === modified file 'lisp/subr.el' --- lisp/subr.el 2014-10-01 17:23:42 +0000 +++ lisp/subr.el 2014-10-01 22:13:11 +0000 @@ -4800,6 +4800,21 @@ Also, \"-GIT\", \"-CVS\" and \"-NNN\" are treated as snapshot versions." (version-list-= (version-to-list v1) (version-to-list v2))) +(defvar package--builtin-versions + ;; Mostly populated by loaddefs.el via autoload-builtin-package-versions. + (purecopy `((emacs . ,(version-to-list emacs-version)))) + "Alist giving the version of each versioned builtin package. +I.e. each element of the list is of the form (NAME . VERSION) where +NAME is the package name as a symbol, and VERSION is its version +as a list.") + +(defun package--description-file (dir) + (concat (let ((subdir (file-name-nondirectory + (directory-file-name dir)))) + (if (string-match "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)" subdir) + (match-string 1 subdir) subdir)) + "-pkg.el")) + ;;; Misc. (defconst menu-bar-separator '("--") === modified file 'lisp/term/common-win.el' --- lisp/term/common-win.el 2014-02-10 01:34:22 +0000 +++ lisp/term/common-win.el 2014-10-01 22:13:11 +0000 @@ -24,67 +24,6 @@ ;;; Code: -(defcustom x-select-enable-clipboard t - "Non-nil means cutting and pasting uses the clipboard. -This is in addition to, but in preference to, the primary selection. - -Note that MS-Windows does not support selection types other than the -clipboard. (The primary selection that is set by Emacs is not -accessible to other programs on MS-Windows.) - -This variable is not used by the Nextstep port." - :type 'boolean - :group 'killing - ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. - :version "24.1") - -(defvar x-last-selected-text) ; w32-fns.el -(declare-function w32-set-clipboard-data "w32select.c" - (string &optional ignored)) -(defvar ns-last-selected-text) ; ns-win.el -(declare-function ns-set-pasteboard "ns-win" (string)) - -(defvar x-select-enable-primary) ; x-win.el -(defvar x-last-selected-text-primary) -(defvar x-last-selected-text-clipboard) -(defvar saved-region-selection) ; simple.el - -(defun x-select-text (text) - "Select TEXT, a string, according to the window system. - -On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the -clipboard. If `x-select-enable-primary' is non-nil, put TEXT in -the primary selection. - -On MS-Windows, make TEXT the current selection. If -`x-select-enable-clipboard' is non-nil, copy the text to the -clipboard as well. - -On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard' -is not used)." - (cond ((eq (framep (selected-frame)) 'w32) - (if x-select-enable-clipboard - (w32-set-clipboard-data text)) - (setq x-last-selected-text text)) - ((featurep 'ns) - ;; Don't send the pasteboard too much text. - ;; It becomes slow, and if really big it causes errors. - (ns-set-pasteboard text) - (setq ns-last-selected-text text)) - (t - ;; With multi-tty, this function may be called from a tty frame. - (when (eq (framep (selected-frame)) 'x) - (when x-select-enable-primary - (x-set-selection 'PRIMARY text) - (setq x-last-selected-text-primary text)) - (when x-select-enable-clipboard - ;; When cutting, the selection is cleared and PRIMARY set to - ;; the empty string. Prevent that, PRIMARY should not be reset - ;; by cut (Bug#16382). - (setq saved-region-selection text) - (x-set-selection 'CLIPBOARD text) - (setq x-last-selected-text-clipboard text)))))) - ;;;; Function keys (defvar x-alternatives-map @@ -117,8 +56,7 @@ (set-keymap-parent map (keymap-parent local-function-key-map)) (set-keymap-parent local-function-key-map map)) (when (featurep 'ns) - (setq interprogram-cut-function 'x-select-text - interprogram-paste-function 'x-selection-value + (setq interprogram-paste-function 'x-selection-value system-key-alist (list ;; These are special "keys" used to pass events from C to lisp. === modified file 'lisp/term/ns-win.el' --- lisp/term/ns-win.el 2014-03-15 18:12:54 +0000 +++ lisp/term/ns-win.el 2014-10-01 22:13:11 +0000 @@ -739,7 +739,6 @@ ;; We keep track of the last text selected here, so we can check the ;; current selection against it, and avoid passing back our own text ;; from x-selection-value. -(defvar ns-last-selected-text nil) ;; Return the value of the current Nextstep selection. For ;; compatibility with older Nextstep applications, this checks cut @@ -751,13 +750,13 @@ (if (string= text "") (setq text nil)) (cond ((not text) nil) - ((eq text ns-last-selected-text) nil) - ((string= text ns-last-selected-text) + ((eq text gui-last-selected-text) nil) + ((string= text gui-last-selected-text) ;; Record the newer string, so subsequent calls can use the `eq' test. - (setq ns-last-selected-text text) + (setq gui-last-selected-text text) nil) (t - (setq ns-last-selected-text text))))) + (setq gui-last-selected-text text))))) (defun ns-copy-including-secondary () (interactive) @@ -959,10 +958,18 @@ ;; Any display name is OK. (add-to-list 'display-format-alist '(".*" . ns)) -(add-to-list 'handle-args-function-alist '(ns . x-handle-args)) -(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces)) -(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system)) +(gui-method-define handle-args-function ns #'x-handle-args) +(gui-method-define frame-creation-function ns #'x-create-frame-with-faces) +(gui-method-define window-system-initialization ns + #'ns-initialize-window-system) +(declare-function ns-set-pasteboard "ns-win" (string)) +(gui-method-define gui-select-text ns + (lambda (text) + ;; Don't send the pasteboard too much text. + ;; It becomes slow, and if really big it causes errors. + (when gui-select-enable-clipboard + (ns-set-pasteboard text)))) (provide 'ns-win) === modified file 'lisp/term/pc-win.el' --- lisp/term/pc-win.el 2014-04-16 13:27:28 +0000 +++ lisp/term/pc-win.el 2014-10-01 22:13:11 +0000 @@ -219,44 +219,10 @@ ; ;;;; Selections ; -;;; We keep track of the last text selected here, so we can check the -;;; current selection against it, and avoid passing back our own text -;;; from x-selection-value. -(defvar x-last-selected-text nil) - -(defcustom x-select-enable-clipboard t - "Non-nil means cutting and pasting uses the clipboard. -This is in addition to, but in preference to, the primary selection. - -Note that MS-Windows does not support selection types other than the -clipboard. (The primary selection that is set by Emacs is not -accessible to other programs on MS-Windows.) - -This variable is not used by the Nextstep port." - :type 'boolean - :group 'killing) - -(defun x-select-text (text) - "Select TEXT, a string, according to the window system. - -On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the -clipboard. If `x-select-enable-primary' is non-nil, put TEXT in -the primary selection. - -On MS-Windows, make TEXT the current selection. If -`x-select-enable-clipboard' is non-nil, copy the text to the -clipboard as well. - -On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard' -is not used)." - (if x-select-enable-clipboard - (w16-set-clipboard-data text)) - (setq x-last-selected-text text)) - (defun x-get-selection-value () "Return the value of the current selection. Consult the selection. Treat empty strings as if they were unset." - (if x-select-enable-clipboard + (if gui-select-enable-clipboard (let (text) ;; Don't die if x-get-selection signals an error. (with-demoted-errors "w16-get-clipboard-data:%s" @@ -264,13 +230,13 @@ (if (string= text "") (setq text nil)) (cond ((not text) nil) - ((eq text x-last-selected-text) nil) - ((string= text x-last-selected-text) + ((eq text gui-last-selected-text) nil) + ((string= text gui-last-selected-text) ;; Record the newer string, so subsequent calls can use the 'eq' test. - (setq x-last-selected-text text) + (setq gui-last-selected-text text) nil) (t - (setq x-last-selected-text text)))))) + (setq gui-last-selected-text text)))))) ;; x-selection-owner-p is used in simple.el. (defun x-selection-owner-p (&optional _selection _terminal) @@ -288,7 +254,7 @@ On Nextstep, TERMINAL is unused. \(fn &optional SELECTION TERMINAL)" - (if x-select-enable-clipboard + (if gui-select-enable-clipboard (let (text) ;; Don't die if w16-get-clipboard-data signals an error. (ignore-errors @@ -298,8 +264,8 @@ ;; we've put into the Windows clipboard. (cond ((not text) t) - ((or (eq text x-last-selected-text) - (string= text x-last-selected-text)) + ((or (eq text gui-last-selected-text) + (string= text gui-last-selected-text)) text) (t nil))))) @@ -463,20 +429,27 @@ (setq split-window-keep-point t) ;; Arrange for the kill and yank functions to set and check the ;; clipboard. - (setq interprogram-cut-function 'x-select-text) (setq interprogram-paste-function 'x-get-selection-value) (menu-bar-enable-clipboard) (run-hooks 'terminal-init-msdos-hook)) ;; frame-creation-function-alist is examined by frame.el:make-frame. -(add-to-list 'frame-creation-function-alist - '(pc . msdos-create-frame-with-faces)) +(gui-method-define frame-creation-function + pc #'msdos-create-frame-with-faces) ;; window-system-initialization-alist is examined by startup.el:command-line. -(add-to-list 'window-system-initialization-alist - '(pc . msdos-initialize-window-system)) +(gui-method-define window-system-initialization + pc #'msdos-initialize-window-system) ;; We don't need anything beyond tty-handle-args for handling ;; command-line argument; see startup.el. -(add-to-list 'handle-args-function-alist '(pc . tty-handle-args)) +(gui-method-define handle-args-function pc #'tty-handle-args) + + +(declare-function w16-set-clipboard-data "w16select.c" + (string &optional ignored)) +(gui-method-define gui-select-text pc + (lambda (text) + (when gui-select-enable-clipboard + (w16-set-clipboard-data text)))) ;; --------------------------------------------------------------------------- === modified file 'lisp/term/w32-win.el' --- lisp/term/w32-win.el 2014-06-18 15:15:52 +0000 +++ lisp/term/w32-win.el 2014-10-01 22:13:11 +0000 @@ -371,9 +371,18 @@ (setq w32-initialized t)) (add-to-list 'display-format-alist '("\\`w32\\'" . w32)) -(add-to-list 'handle-args-function-alist '(w32 . x-handle-args)) -(add-to-list 'frame-creation-function-alist '(w32 . x-create-frame-with-faces)) -(add-to-list 'window-system-initialization-alist '(w32 . w32-initialize-window-system)) +(gui-method-define handle-args-function w32 #'x-handle-args) +(gui-method-define frame-creation-function w32 + #'x-create-frame-with-faces) +(gui-method-define window-system-initialization w32 + #'w32-initialize-window-system) + +(declare-function w32-set-clipboard-data "w32select.c" + (string &optional ignored)) +(gui-method-define gui-select-text w32 + (lambda (text) + (if gui-select-enable-clipboard + (w32-set-clipboard-data text)))) (provide 'w32-win) === modified file 'lisp/term/x-win.el' --- lisp/term/x-win.el 2014-04-11 07:02:28 +0000 +++ lisp/term/x-win.el 2014-10-01 22:13:11 +0000 @@ -1217,8 +1217,6 @@ (remove-text-properties 0 (length text) '(foreign-selection nil) text)) text)) -(defvar x-select-enable-clipboard) ; common-win - ;; Return the value of the current X selection. ;; Consult the selection. Treat empty strings as if they were unset. ;; If this function is called twice and finds the same text, @@ -1290,7 +1288,6 @@ 'x-selection-value "24.1") ;; Arrange for the kill and yank functions to set and check the clipboard. -(setq interprogram-cut-function 'x-select-text) (setq interprogram-paste-function 'x-selection-value) ;; Make paste from other applications use the decoding in x-select-request-type @@ -1301,6 +1298,7 @@ (x-selection-value-internal 'PRIMARY)) (defun x-clipboard-yank () + ;; FIXME: How is that different from `clipboard-yank'? "Insert the clipboard contents, or the last stretch of killed text." (interactive "*") (let ((clipboard-text (x-selection-value-internal 'CLIPBOARD)) @@ -1463,9 +1461,23 @@ (setq x-initialized t)) (add-to-list 'display-format-alist '("\\`[^:]*:[0-9]+\\(\\.[0-9]+\\)?\\'" . x)) -(add-to-list 'handle-args-function-alist '(x . x-handle-args)) -(add-to-list 'frame-creation-function-alist '(x . x-create-frame-with-faces)) -(add-to-list 'window-system-initialization-alist '(x . x-initialize-window-system)) +(gui-method-define handle-args-function x #'x-handle-args) +(gui-method-define frame-creation-function x #'x-create-frame-with-faces) +(gui-method-define window-system-initialization x #'x-initialize-window-system) + +(defvar x-select-enable-primary) ; x-win.el +(gui-method-define gui-select-text x + (lambda (text) + (when x-select-enable-primary + (x-set-selection 'PRIMARY text) + (setq x-last-selected-text-primary text)) + (when x-select-enable-clipboard + ;; When cutting, the selection is cleared and PRIMARY + ;; set to the empty string. Prevent that, PRIMARY + ;; should not be reset by cut (Bug#16382). + (setq saved-region-selection text) + (x-set-selection 'CLIPBOARD text) + (setq x-last-selected-text-clipboard text)))) ;; Initiate drag and drop (add-hook 'after-make-frame-functions 'x-dnd-init-frame) === modified file 'lisp/w32-common-fns.el' --- lisp/w32-common-fns.el 2014-03-22 00:24:00 +0000 +++ lisp/w32-common-fns.el 2014-10-01 22:13:11 +0000 @@ -104,12 +104,11 @@ ;; current selection against it, and avoid passing back our own text ;; from x-selection-value. (defvar x-last-selected-text nil) -(defvar x-select-enable-clipboard) (defun x-get-selection-value () "Return the value of the current selection. Consult the selection. Treat empty strings as if they were unset." - (if x-select-enable-clipboard + (if gui-select-enable-clipboard (let (text) ;; Don't die if x-get-selection signals an error. (with-demoted-errors "w32-get-clipboard-data:%s" @@ -128,7 +127,6 @@ (defalias 'x-selection-value 'x-get-selection-value) ;; Arrange for the kill and yank functions to set and check the clipboard. -(setq interprogram-cut-function 'x-select-text) (setq interprogram-paste-function 'x-get-selection-value) (provide 'w32-common-fns) === modified file 'src/xselect.c' --- src/xselect.c 2014-10-01 03:28:16 +0000 +++ src/xselect.c 2014-10-01 22:13:11 +0000 @@ -2638,12 +2638,14 @@ converted_selections = NULL; conversion_fail_tag = None; + /* FIXME: Duplicate definition in nsselect.c. */ DEFVAR_LISP ("selection-converter-alist", Vselection_converter_alist, doc: /* An alist associating X Windows selection-types with functions. These functions are called to convert the selection, with three args: the name of the selection (typically `PRIMARY', `SECONDARY', or `CLIPBOARD'); a desired type to which the selection should be converted; -and the local selection value (whatever was given to `x-own-selection'). +and the local selection value (whatever was given to +`x-own-selection-internal'). The function should return the value to send to the X server \(typically a string). A return value of nil ------------------------------------------------------------ revno: 118001 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-10-01 13:34:55 -0700 message: Improve doc for use of 'int', and discuss 'ssize_t'. * internals.texi (C Integer Types): Mention 'int' for other randomish values that lie in 'int' range. Mention 'ssize_t'. See: http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00019.html diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-10-01 03:28:16 +0000 +++ doc/lispref/ChangeLog 2014-10-01 20:34:55 +0000 @@ -1,5 +1,10 @@ 2014-10-01 Paul Eggert + Improve doc for use of 'int', and discuss 'ssize_t'. + * internals.texi (C Integer Types): Mention 'int' for other + randomish values that lie in 'int' range. Mention 'ssize_t'. See: + http://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00019.html + Use AUTO_CONS instead of SCOPED_CONS, etc. * internals.texi (Stack-allocated Objects): Adjust to match the revised, less error-prone macros. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-10-01 03:28:16 +0000 +++ doc/lispref/internals.texi 2014-10-01 20:34:55 +0000 @@ -1625,6 +1625,8 @@ @item Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF. +More generally, prefer @code{int} for integers known to be in +@code{int} range, e.g., screen column counts. @item Prefer @code{ptrdiff_t} for sizes, i.e., for integers bounded by the @@ -1636,6 +1638,17 @@ impose an arbitrary limit. @item +Avoid @code{ssize_t} except when communicating to low-level APIs that +have @code{ssize_t}-related limitations. Although it's equivalent to +@code{ptrdiff_t} on typical platforms, @code{ssize_t} is occasionally +narrower, so using it for size-related calculations could overflow. +Also, @code{ptrdiff_t} is more ubiquitous and better-standardized, has +standard @code{printf} formats, and is the basis for Emacs's internal +size-overflow checking. When using @code{ssize_t}, please note that +POSIX requires support only for values in the range @minus{}1 ..@: +@code{SSIZE_MAX}. + +@item Prefer @code{intptr_t} for internal representations of pointers, or for integers bounded only by the number of objects that can exist at any given time or by the total number of bytes that can be allocated. ------------------------------------------------------------ revno: 118000 committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-10-01 13:23:42 -0400 message: * lisp/subr.el (alist-get): New accessor. * lisp/emacs-lisp/gv.el (alist-get): Provide expander. * lisp/winner.el (winner-remember): * lisp/tempo.el (tempo-use-tag-list): * lisp/progmodes/gud.el (minor-mode-map-alist): * lisp/international/mule-cmds.el (define-char-code-property): * lisp/frameset.el (frameset-filter-params): * lisp/files.el (dir-locals-set-class-variables): * lisp/register.el (get-register, set-register): * lisp/calc/calc-yank.el (calc-set-register): Use it. * lisp/ps-print.el (ps-get, ps-put, ps-del): Mark as obsolete. * lisp/tooltip.el (tooltip-set-param): Mark as obsolete. (tooltip-show): Use alist-get instead. * lisp/ses.el (ses--alist-get): Remove. Use alist-get instead. * admin/unidata/unidata-gen.el (unidata-gen-table-word-list): Use alist-get and cl-incf. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-09-08 06:00:58 +0000 +++ admin/ChangeLog 2014-10-01 17:23:42 +0000 @@ -1,3 +1,8 @@ +2014-10-01 Stefan Monnier + + * unidata/unidata-gen.el (unidata-gen-table-word-list): Use alist-get + and cl-incf. + 2014-09-08 Eli Zaretskii * unidata/unidata-gen.el (unidata-check): Bring this function up === modified file 'admin/unidata/unidata-gen.el' --- admin/unidata/unidata-gen.el 2014-09-03 16:03:34 +0000 +++ admin/unidata/unidata-gen.el 2014-10-01 17:23:42 +0000 @@ -88,6 +88,8 @@ ;; CHAR-or-RANGE: a character code or a cons of character codes ;; PROPn: string representing the nth property value +(eval-when-compile (require 'cl-lib)) + (defvar unidata-list nil) ;; Name of the directory containing files of Unicode Character Database. @@ -923,11 +925,7 @@ (dotimes (i (length vec)) (dolist (elt (aref vec i)) (if (symbolp elt) - (let ((slot (assq elt word-list))) - (if slot - (setcdr slot (1+ (cdr slot))) - (setcdr word-list - (cons (cons elt 1) (cdr word-list)))))))) + (cl-incf (alist-get elt (cdr word-list) 0))))) (set-char-table-range table (cons start limit) vec)))))) (setq word-list (sort (cdr word-list) #'(lambda (x y) (> (cdr x) (cdr y))))) === modified file 'etc/NEWS' --- etc/NEWS 2014-09-30 23:19:31 +0000 +++ etc/NEWS 2014-10-01 17:23:42 +0000 @@ -245,6 +245,8 @@ *** call-process-shell-command and process-file-shell-command don't take "&rest args" any more. +** New function `alist-get', which is also a valid place (aka lvalue). + ** New function `funcall-interactively', which works like `funcall' but makes `called-interactively-p' treat the function as (you guessed it) called interactively. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-01 17:20:00 +0000 +++ lisp/ChangeLog 2014-10-01 17:23:42 +0000 @@ -1,3 +1,20 @@ +2014-10-01 Stefan Monnier + + * subr.el (alist-get): New accessor. + * emacs-lisp/gv.el (alist-get): Provide expander. + * winner.el (winner-remember): + * tempo.el (tempo-use-tag-list): + * progmodes/gud.el (minor-mode-map-alist): + * international/mule-cmds.el (define-char-code-property): + * frameset.el (frameset-filter-params): + * files.el (dir-locals-set-class-variables): + * register.el (get-register, set-register): + * calc/calc-yank.el (calc-set-register): Use it. + * ps-print.el (ps-get, ps-put, ps-del): Mark as obsolete. + * tooltip.el (tooltip-set-param): Mark as obsolete. + (tooltip-show): Use alist-get instead. + * ses.el (ses--alist-get): Remove. Use alist-get instead. + 2014-10-01 Ulf Jasper * net/newst-backend.el: Remove Time-stamp. Rename variable @@ -5,8 +22,8 @@ make it customizable. (newsticker--sentinel-work): Move xml-workarounds to function `newsticker--do-xml-workarounds', call unless libxml-parser is - used. Allow single quote in regexp for encoding. Use - libxml-parser if available, else fall back to `xml-parse-region'. + used. Allow single quote in regexp for encoding. + Use libxml-parser if available, else fall back to `xml-parse-region'. Take care of possibly missing namespace prefixes (like "RDF" instead of "rdf:RDF") when checking xml nodes and attributes (as libxml correctly removes the prefixes). Always use Atom 1.0 as === modified file 'lisp/calc/calc-prog.el' --- lisp/calc/calc-prog.el 2014-01-01 07:43:34 +0000 +++ lisp/calc/calc-prog.el 2014-10-01 17:23:42 +0000 @@ -139,6 +139,7 @@ "calc-")))) (let* ((kmap (calc-user-key-map)) (old (assq key kmap))) + ;; FIXME: Why not (define-key kmap (vector key) func)? (if old (setcdr old func) (setcdr kmap (cons (cons key func) (cdr kmap)))))))) @@ -322,6 +323,7 @@ (if key (let* ((kmap (calc-user-key-map)) (old (assq key kmap))) + ;; FIXME: Why not (define-key kmap (vector key) cmd)? (if old (setcdr old cmd) (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) @@ -467,6 +469,7 @@ (format "z%c" key))))) (let* ((kmap (calc-user-key-map)) (old (assq key kmap))) + ;; FIXME: Why not (define-key kmap (vector key) func)? (if old (setcdr old cmd) (setcdr kmap (cons (cons key cmd) (cdr kmap)))))))) === modified file 'lisp/calc/calc-yank.el' --- lisp/calc/calc-yank.el 2014-02-03 00:40:49 +0000 +++ lisp/calc/calc-yank.el 2014-10-01 17:23:42 +0000 @@ -143,10 +143,7 @@ "Set the contents of the Calc register REGISTER to (TEXT . CALCVAL), as well as set the contents of the Emacs register REGISTER to TEXT." (set-register register text) - (let ((aelt (assq register calc-register-alist))) - (if aelt - (setcdr aelt (cons text calcval)) - (push (cons register (cons text calcval)) calc-register-alist)))) + (setf (alist-get register calc-register-alist) (cons text calcval))) (defun calc-get-register (reg) "Return the CALCVAL portion of the contents of the Calc register REG, === modified file 'lisp/emacs-lisp/gv.el' --- lisp/emacs-lisp/gv.el 2014-05-31 15:43:43 +0000 +++ lisp/emacs-lisp/gv.el 2014-10-01 17:23:42 +0000 @@ -357,6 +357,34 @@ (macroexp-let2 nil v val `(with-current-buffer ,buf (set (make-local-variable ,var) ,v)))) +(gv-define-expander alist-get + (lambda (do key alist &optional default remove) + (macroexp-let2 macroexp-copyable-p k key + (gv-letplace (getter setter) alist + (macroexp-let2 nil p `(assq ,k ,getter) + (funcall do (if (null default) `(cdr ,p) + `(if ,p (cdr ,p) ,default)) + (lambda (v) + (macroexp-let2 nil v v + (let ((set-exp + `(if ,p (setcdr ,p ,v) + ,(funcall setter + `(cons (setq ,p (cons ,k ,v)) + ,getter))))) + (cond + ((null remove) set-exp) + ((or (eql v default) + (and (eq (car-safe v) 'quote) + (eq (car-safe default) 'quote) + (eql (cadr v) (cadr default)))) + `(if ,p ,(funcall setter `(delq ,p ,getter)))) + (t + `(cond + ((not (eql ,default ,v)) ,set-exp) + (,p ,(funcall setter + `(delq ,p ,getter))))))))))))))) + + ;;; Some occasionally handy extensions. ;; While several of the "places" below are not terribly useful for direct use, @@ -479,22 +507,13 @@ ;; … => (load "gv.el") => (macroexpand-all (defsubst gv-deref …)) => (macroexpand (defun …)) => (load "gv.el") (gv-define-setter gv-deref (v ref) `(funcall (cdr ,ref) ,v)) -;;; Vaguely related definitions that should be moved elsewhere. - -;; (defun alist-get (key alist) -;; "Get the value associated to KEY in ALIST." -;; (declare -;; (gv-expander -;; (lambda (do) -;; (macroexp-let2 macroexp-copyable-p k key -;; (gv-letplace (getter setter) alist -;; (macroexp-let2 nil p `(assoc ,k ,getter) -;; (funcall do `(cdr ,p) -;; (lambda (v) -;; `(if ,p (setcdr ,p ,v) -;; ,(funcall setter -;; `(cons (cons ,k ,v) ,getter))))))))))) -;; (cdr (assoc key alist))) +;; (defmacro gv-letref (vars place &rest body) +;; (declare (indent 2) (debug (sexp form &rest body))) +;; (require 'cl-lib) ;Can't require cl-lib at top-level for bootstrap reasons! +;; (gv-letplace (getter setter) place +;; `(cl-macrolet ((,(nth 0 vars) () ',getter) +;; (,(nth 1 vars) (v) (funcall ',setter v))) +;; ,@body))) (provide 'gv) ;;; gv.el ends here === modified file 'lisp/files.el' --- lisp/files.el 2014-09-29 18:14:08 +0000 +++ lisp/files.el 2014-10-01 17:23:42 +0000 @@ -3649,10 +3649,7 @@ * If the element is of the form (DIRECTORY . LIST), and DIRECTORY is an initial substring of the file's directory, then LIST is applied by recursively following these rules." - (let ((elt (assq class dir-locals-class-alist))) - (if elt - (setcdr elt variables) - (push (cons class variables) dir-locals-class-alist)))) + (setf (alist-get class dir-locals-class-alist) variables)) (defconst dir-locals-file ".dir-locals.el" "File that contains directory-local variables. === modified file 'lisp/frameset.el' --- lisp/frameset.el 2014-03-27 17:34:22 +0000 +++ lisp/frameset.el 2014-10-01 17:23:42 +0000 @@ -664,10 +664,7 @@ ;; Set the display parameter after filtering, so that filter functions ;; have access to its original value. (when frameset--target-display - (let ((display (assq 'display filtered))) - (if display - (setcdr display (cdr frameset--target-display)) - (push frameset--target-display filtered)))) + (setf (alist-get 'display filtered) (cdr frameset--target-display))) filtered)) === modified file 'lisp/international/mule-cmds.el' --- lisp/international/mule-cmds.el 2014-06-12 01:47:28 +0000 +++ lisp/international/mule-cmds.el 2014-10-01 17:23:42 +0000 @@ -2776,11 +2776,7 @@ (or (stringp table) (error "Not a char-table nor a file name: %s" table))) (if (stringp table) (setq table (purecopy table))) - (let ((slot (assq name char-code-property-alist))) - (if slot - (setcdr slot table) - (setq char-code-property-alist - (cons (cons name table) char-code-property-alist)))) + (setf (alist-get name char-code-property-alist) table) (put name 'char-code-property-documentation (purecopy docstring))) (defvar char-code-property-table === modified file 'lisp/progmodes/gud.el' --- lisp/progmodes/gud.el 2014-09-03 04:21:40 +0000 +++ lisp/progmodes/gud.el 2014-10-01 17:23:42 +0000 @@ -256,9 +256,8 @@ ([menu-bar file] . undefined)))) "Map used in visited files.") -(let ((m (assq 'gud-minor-mode minor-mode-map-alist))) - (if m (setcdr m gud-minor-mode-map) - (push (cons 'gud-minor-mode gud-minor-mode-map) minor-mode-map-alist))) +(setf (alist-get 'gud-minor-mode minor-mode-map-alist) + gud-minor-mode-map) (defvar gud-mode-map ;; Will inherit from comint-mode via define-derived-mode. === modified file 'lisp/ps-print.el' --- lisp/ps-print.el 2014-05-10 21:41:12 +0000 +++ lisp/ps-print.el 2014-10-01 17:23:42 +0000 @@ -3822,6 +3822,7 @@ (defun ps-get (alist-sym key) "Return element from association list ALIST-SYM which car is `eq' to KEY." + (declare (obsolete alist-get "25.1")) (assq key (symbol-value alist-sym))) @@ -3829,6 +3830,7 @@ "Store element (KEY . VALUE) into association list ALIST-SYM. If KEY already exists in ALIST-SYM, modify cdr to VALUE. It can be retrieved with `(ps-get ALIST-SYM KEY)'." + (declare (obsolete "use (setf (alist-get ..) ..) instead" "25.1")) (let ((elt: (assq key (symbol-value alist-sym)))) ; to avoid name conflict (if elt: (setcdr elt: value) @@ -3839,6 +3841,7 @@ (defun ps-del (alist-sym key) "Delete by side effect element KEY from association list ALIST-SYM." + (declare (obsolete "use (setf (alist-get k alist nil t) nil) instead" "25.1")) (let ((a:list: (symbol-value alist-sym)) ; to avoid name conflict old) (while a:list: === modified file 'lisp/register.el' --- lisp/register.el 2014-09-14 23:11:52 +0000 +++ lisp/register.el 2014-10-01 17:23:42 +0000 @@ -33,6 +33,8 @@ ;;; Code: +;; FIXME: Clean up namespace usage! + (cl-defstruct (registerv (:constructor nil) (:constructor registerv--make (&optional data print-func @@ -98,16 +100,12 @@ (defun get-register (register) "Return contents of Emacs register named REGISTER, or nil if none." - (cdr (assq register register-alist))) + (alist-get register register-alist)) (defun set-register (register value) "Set contents of Emacs register named REGISTER to VALUE. Returns VALUE. See the documentation of the variable `register-alist' for possible VALUEs." - (let ((aelt (assq register register-alist))) - (if aelt - (setcdr aelt value) - (push (cons register value) register-alist)) - value)) + (setf (alist-get register register-alist) value)) (defun register-describe-oneline (c) "One-line description of register C." === modified file 'lisp/ses.el' --- lisp/ses.el 2014-09-30 17:52:11 +0000 +++ lisp/ses.el 2014-10-01 17:23:42 +0000 @@ -426,33 +426,6 @@ (ses-get-cell (car rowcol) (cdr rowcol))))))) -(defun ses--alist-get (key alist &optional remove) - "Get the value associated to KEY in ALIST." - (declare - (gv-expander - (lambda (do) - (macroexp-let2 macroexp-copyable-p k key - (gv-letplace (getter setter) alist - (macroexp-let2 nil p `(assq ,k ,getter) - (funcall do `(cdr ,p) - (lambda (v) - (let ((set-exp - `(if ,p (setcdr ,p ,v) - ,(funcall setter - `(cons (setq ,p (cons ,k ,v)) - ,getter))))) - (cond - ((null remove) set-exp) - ((null v) - `(if ,p ,(funcall setter `(delq ,p ,getter)))) - (t - `(cond - (,v ,set-exp) - (,p ,(funcall setter - `(delq ,p ,getter))))))))))))))) - (ignore remove) ;;Silence byte-compiler. - (cdr (assoc key alist))) - (defmacro ses--letref (vars place &rest body) (declare (indent 2) (debug (sexp form &rest body))) (gv-letplace (getter setter) place @@ -467,18 +440,18 @@ present ROW and COL are the integer coordinates of the cell of interest." (declare (debug t)) - `(ses--alist-get ,property-name - (ses-cell--properties - ,(if col `(ses-get-cell ,row ,col) row)))) + `(alist-get ,property-name + (ses-cell--properties + ,(if col `(ses-get-cell ,row ,col) row)))) (defmacro ses-cell-property-pop (property-name row &optional col) "From a CELL or a pair (ROW,COL), get and remove the property value of the corresponding cell with name PROPERTY-NAME." `(ses--letref (pget pset) - (ses--alist-get ,property-name - (ses-cell--properties - ,(if col `(ses-get-cell ,row ,col) row)) - t) + (alist-get ,property-name + (ses-cell--properties + ,(if col `(ses-get-cell ,row ,col) row)) + nil t) (prog1 (pget) (pset nil)))) (defmacro ses-cell-value (row &optional col) === modified file 'lisp/subr.el' --- lisp/subr.el 2014-09-27 15:52:28 +0000 +++ lisp/subr.el 2014-10-01 17:23:42 +0000 @@ -555,6 +555,15 @@ (setq tail tail-cdr)))) alist) +(defun alist-get (key alist &optional default remove) + "Get the value associated to KEY in ALIST. +DEFAULT is the value to return if KEY is not found in ALIST. +REMOVE, if non-nil, means that when setting this element, we should +remove the entry if the new value is `eql' to DEFAULT." + (ignore remove) ;;Silence byte-compiler. + (let ((x (assq key alist))) + (if x (cdr x) default))) + (defun remove (elt seq) "Return a copy of SEQ with all occurrences of ELT removed. SEQ must be a list, vector, or string. The comparison is done with `equal'." === modified file 'lisp/tempo.el' --- lisp/tempo.el 2014-03-01 02:31:05 +0000 +++ lisp/tempo.el 2014-10-01 17:23:42 +0000 @@ -611,11 +611,7 @@ string to match the tag against. It has the same definition as the variable `tempo-match-finder'. In this version, supplying a COMPLETION-FUNCTION just sets `tempo-match-finder' locally." - (let ((old (assq tag-list tempo-local-tags))) - (if old - (setcdr old completion-function) - (setq tempo-local-tags (cons (cons tag-list completion-function) - tempo-local-tags)))) + (setf (alist-get tag-list tempo-local-tags) completion-function) (if completion-function (setq tempo-match-finder completion-function)) (tempo-invalidate-collection)) === modified file 'lisp/tooltip.el' --- lisp/tooltip.el 2014-04-24 15:02:56 +0000 +++ lisp/tooltip.el 2014-10-01 17:23:42 +0000 @@ -215,11 +215,9 @@ "Change the value of KEY in alist ALIST to VALUE. If there's no association for KEY in ALIST, add one, otherwise change the existing association. Value is the resulting alist." - (let ((param (assq key alist))) - (if (consp param) - (setcdr param value) - (push (cons key value) alist)) - alist)) + (declare (obsolete "use (setf (alist-get ..) ..) instead" "25.1")) + (setf (alist-get key alist) value) + alist) (declare-function x-show-tip "xfns.c" (string &optional frame parms timeout dx dy)) @@ -244,10 +242,10 @@ (fg (face-attribute 'tooltip :foreground)) (bg (face-attribute 'tooltip :background))) (when (stringp fg) - (setq params (tooltip-set-param params 'foreground-color fg)) - (setq params (tooltip-set-param params 'border-color fg))) + (setf (alist-get 'foreground-color params) fg) + (setf (alist-get 'border-color params) fg)) (when (stringp bg) - (setq params (tooltip-set-param params 'background-color bg))) + (setf (alist-get 'background-color params) bg)) (x-show-tip (propertize text 'face 'tooltip) (selected-frame) params === modified file 'lisp/winner.el' --- lisp/winner.el 2014-01-01 07:43:34 +0000 +++ lisp/winner.el 2014-10-01 17:23:42 +0000 @@ -112,10 +112,7 @@ ;; Save current configuration. ;; (Called below by `winner-save-old-configurations'). (defun winner-remember () - (let ((entry (assq (selected-frame) winner-currents))) - (if entry (setcdr entry (winner-conf)) - (push (cons (selected-frame) (winner-conf)) - winner-currents)))) + (setf (alist-get (selected-frame) winner-currents) (winner-conf))) ;; Consult `winner-currents'. (defun winner-configuration (&optional frame) ------------------------------------------------------------ revno: 117999 author: Ulf Jasper committer: Ulf Jasper branch nick: trunk timestamp: Wed 2014-10-01 19:20:00 +0200 message: Newsticker: Use libxml instead of `xml-parse-region'. Fix some glitches. Clean up. * lisp/net/newst-backend.el: Remove Time-stamp. Rename variable `newsticker--download-logos' to `newsticker-download-logos' and make it customizable. (newsticker--sentinel-work): Move xml-workarounds to function `newsticker--do-xml-workarounds', call unless libxml-parser is used. Allow single quote in regexp for encoding. Use libxml-parser if available, else fall back to `xml-parse-region'. Take care of possibly missing namespace prefixes (like "RDF" instead of "rdf:RDF") when checking xml nodes and attributes (as libxml correctly removes the prefixes). Always use Atom 1.0 as fallback feed type. Rename `newsticker--download-logos' to `newsticker-download-logos' (newsticker--unxml, newsticker--unxml-node) (newsticker--unxml-attribute): New. (newsticker--parse-atom-1.0): Call `unxml' in case that embedded HTML code has become part of the xml parse tree. (newsticker--parse-rss-1.0, newsticker--parse-rss-2.0): Take care of possibly missing namespace prefixes. (newsticker--parse-generic-items): Code formatting. Typo. (newsticker--images-dir): Add trailing slash. (newsticker--image-get): Fix error message. * lisp/net/newst-plainview.el: Remove Time-stamp. * lisp/net/newst-reader.el: Remove Time-stamp. (newsticker-download-logos): Rename variable `newsticker--download-logos' to `newsticker-download-logos' and make it customizable. (newsticker--print-extra-elements): Add optional parameter 'htmlish for using html markup. Amend list of ignored elements. (newsticker--do-print-extra-element): Add parameter 'htmlish for using html markup. * lisp/net/newst-ticker.el: Remove Time-stamp. * lisp/net/newst-treeview.el (newsticker--treeview-item-show): Use html for formatting extra elements. * lisp/net/newsticker.el: Remove Time-stamp, Version. (newsticker-version): Make obsolete. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-09-30 23:19:31 +0000 +++ lisp/ChangeLog 2014-10-01 17:20:00 +0000 @@ -1,3 +1,46 @@ +2014-10-01 Ulf Jasper + + * net/newst-backend.el: Remove Time-stamp. Rename variable + `newsticker--download-logos' to `newsticker-download-logos' and + make it customizable. + (newsticker--sentinel-work): Move xml-workarounds to function + `newsticker--do-xml-workarounds', call unless libxml-parser is + used. Allow single quote in regexp for encoding. Use + libxml-parser if available, else fall back to `xml-parse-region'. + Take care of possibly missing namespace prefixes (like "RDF" + instead of "rdf:RDF") when checking xml nodes and attributes (as + libxml correctly removes the prefixes). Always use Atom 1.0 as + fallback feed type. Rename `newsticker--download-logos' to + `newsticker-download-logos' + (newsticker--unxml, newsticker--unxml-node) + (newsticker--unxml-attribute): New. + (newsticker--parse-atom-1.0): Call `unxml' in case that embedded + HTML code has become part of the xml parse tree. + (newsticker--parse-rss-1.0, newsticker--parse-rss-2.0): Take care + of possibly missing namespace prefixes. + (newsticker--parse-generic-items): Code formatting. Typo. + (newsticker--images-dir): Add trailing slash. + (newsticker--image-get): Fix error message. + + * net/newst-plainview.el: Remove Time-stamp. + + * net/newst-reader.el: Remove Time-stamp. + (newsticker-download-logos): Rename variable + `newsticker--download-logos' to `newsticker-download-logos' and + make it customizable. + (newsticker--print-extra-elements): Add optional parameter + 'htmlish for using html markup. Amend list of ignored elements. + (newsticker--do-print-extra-element): Add parameter 'htmlish for + using html markup. + + * net/newst-ticker.el: Remove Time-stamp. + + * net/newst-treeview.el (newsticker--treeview-item-show): Use html + for formatting extra elements. + + * net/newsticker.el: Remove Time-stamp, Version. + (newsticker-version): Make obsolete. + 2014-09-30 Leonardo Nobrega (tiny change) * progmodes/python.el (python-fill-paren): Don't inf-loop at EOB === modified file 'lisp/net/newst-backend.el' --- lisp/net/newst-backend.el 2014-09-24 17:33:54 +0000 +++ lisp/net/newst-backend.el 2014-10-01 17:20:00 +0000 @@ -6,7 +6,6 @@ ;; Filename: newst-backend.el ;; URL: http://www.nongnu.org/newsticker ;; Keywords: News, RSS, Atom -;; Time-stamp: "23. September 2014, 19:51:10 (ulf)" ;; Package: newsticker ;; ====================================================================== @@ -47,9 +46,6 @@ "List of timers for news retrieval. This is an alist, each element consisting of (feed-name . timer).") -(defvar newsticker--download-logos nil - "If non-nil download feed logos if available.") - (defvar newsticker--sentinel-callback nil "Function called at end of `newsticker--sentinel'.") @@ -861,59 +857,11 @@ (node-list (save-current-buffer (set-buffer buffer) - ;; a very very dirty workaround to overcome the - ;; problems with the newest (20030621) xml.el: - ;; remove all unnecessary whitespace - (goto-char (point-min)) - (while (re-search-forward ">[ \t\r\n]+<" nil t) - (replace-match "><" nil t)) - ;; and another brutal workaround (20031105)! For some - ;; reason the xml parser does not like the colon in the - ;; doctype name "rdf:RDF" - (goto-char (point-min)) - (if (re-search-forward "" nil t) - (replace-match "" nil t)) - ;; And another one (20050618)! (Fixed in GNU Emacs 22.0.50.18) - ;; Remove comments to avoid this xml-parsing bug: - ;; "XML files can have only one toplevel tag" - (goto-char (point-min)) - (while (search-forward "" nil t) - (error "Can't find end of comment")) - (delete-region start (point)))) - ;; And another one (20050702)! If description is HTML - ;; encoded and starts with a `<', wrap the whole - ;; description in a CDATA expression. This happened for - ;; http://www.thefreedictionary.com/_/WoD/rss.aspx?type=quote - (goto-char (point-min)) - (while (re-search-forward - "\\(" nil t) - (replace-match - "")) - ;; And another one (20051123)! XML parser does not - ;; like this: - ;; try to "fix" empty attributes - ;; This happened for - ;; http://xml.weather.yahoo.com/forecastrss?p=GMXX0040&u=f - (goto-char (point-min)) - (while (re-search-forward "\\(<[^>]*\\)=\"\"" nil t) - (replace-match "\\1=\" \"")) - ;; - (set-buffer-modified-p nil) + (unless (fboundp 'libxml-parse-xml-region) + (newsticker--do-xml-workarounds)) ;; check coding system (goto-char (point-min)) - (if (re-search-forward "encoding=\"\\([^\"]+\\)\"" + (if (re-search-forward "encoding=['\"]\\([^\"]+?\\)['\"]" nil t) (setq coding-system (intern (downcase (match-string 1)))) (setq coding-system @@ -931,12 +879,13 @@ (condition-case errordata ;; The xml parser might fail ;; or the xml might be bugged - (xml-parse-region (point-min) (point-max)) + (if (fboundp 'libxml-parse-xml-region) + (list (libxml-parse-xml-region (point-min) (point-max))) + (xml-parse-region (point-min) (point-max))) (error (message "Could not parse %s: %s" (buffer-name) (cadr errordata)) (throw 'oops nil))))) (topnode (car node-list)) - (channelnode (car (xml-get-children topnode 'channel))) (imageurl nil)) ;; mark all items as obsolete (newsticker--cache-replace-age newsticker--cache @@ -963,7 +912,8 @@ (setq imageurl (newsticker--get-logo-url-rss-0.92 topnode)) (newsticker--parse-rss-0.92 name time topnode)) ;; RSS 1.0 - ((eq 'rdf:RDF (xml-node-name topnode)) + ((or (eq 'RDF (xml-node-name topnode)) + (eq 'rdf:RDF (xml-node-name topnode))) (setq imageurl (newsticker--get-logo-url-rss-1.0 topnode)) (newsticker--parse-rss-1.0 name time topnode)) ;; RSS 2.0 @@ -978,16 +928,24 @@ (setq imageurl (newsticker--get-logo-url-atom-0.3 topnode)) (newsticker--parse-atom-0.3 name time topnode)) ;; Atom 1.0 - ((and (eq 'feed (xml-node-name topnode)) - (string= "http://www.w3.org/2005/Atom" - (xml-get-attribute topnode 'xmlns))) + (t + ;; The test for Atom 1.0 does not work when using + ;; libxml, as with libxml the namespace attribute is + ;; not in the xml tree. For the time being we skip + ;; the check and assume that we are dealing with an + ;; Atom 1.0 feed. + + ;; (and (eq 'feed (xml-node-name topnode)) + ;; (string= "http://www.w3.org/2005/Atom" + ;; (xml-get-attribute topnode 'xmlns))) (setq imageurl (newsticker--get-logo-url-atom-1.0 topnode)) (newsticker--parse-atom-1.0 name time topnode)) ;; unknown feed type - (t - (newsticker--debug-msg "Feed type unknown: %s: %s" - (xml-node-name topnode) name) - nil)) + ;; (t + ;; (newsticker--debug-msg "Feed type unknown: %s: %s" + ;; (xml-node-name topnode) name) + ;; nil) + ) (setq something-was-added t)) (error (message "sentinelerror in %s: %s" name error-data))) @@ -1031,11 +989,67 @@ (unless newsticker-debug (kill-buffer buffer)) ;; launch retrieval of image - (when (and imageurl newsticker--download-logos) + (when (and imageurl (boundp 'newsticker-download-logos) + newsticker-download-logos) (newsticker--image-get name imageurl))))) (when newsticker--sentinel-callback (funcall newsticker--sentinel-callback))) +(defun newsticker--do-xml-workarounds () + "Fix all issues which `xml-parse-region' could be choking on." + + ;; a very very dirty workaround to overcome the + ;; problems with the newest (20030621) xml.el: + ;; remove all unnecessary whitespace + (goto-char (point-min)) + (while (re-search-forward ">[ \t\r\n]+<" nil t) + (replace-match "><" nil t)) + ;; and another brutal workaround (20031105)! For some + ;; reason the xml parser does not like the colon in the + ;; doctype name "rdf:RDF" + (goto-char (point-min)) + (if (re-search-forward "" nil t) + (replace-match "" nil t)) + ;; And another one (20050618)! (Fixed in GNU Emacs 22.0.50.18) + ;; Remove comments to avoid this xml-parsing bug: + ;; "XML files can have only one toplevel tag" + (goto-char (point-min)) + (while (search-forward "" nil t) + (error "Can't find end of comment")) + (delete-region start (point)))) + ;; And another one (20050702)! If description is HTML + ;; encoded and starts with a `<', wrap the whole + ;; description in a CDATA expression. This happened for + ;; http://www.thefreedictionary.com/_/WoD/rss.aspx?type=quote + (goto-char (point-min)) + (while (re-search-forward + "\\(" nil t) + (replace-match + "")) + ;; And another one (20051123)! XML parser does not + ;; like this: + ;; try to "fix" empty attributes + ;; This happened for + ;; http://xml.weather.yahoo.com/forecastrss?p=GMXX0040&u=f + (goto-char (point-min)) + (while (re-search-forward "\\(<[^>]*\\)=\"\"" nil t) + (replace-match "\\1=\" \"")) + ;; + (set-buffer-modified-p nil)) + + (defun newsticker--get-logo-url-atom-1.0 (node) "Return logo URL from atom 1.0 data in NODE." (car (xml-node-children @@ -1117,6 +1131,30 @@ (xml-node-children node)))) (or new-item new-feed))) +(defun newsticker--unxml (node) + "Reverse parsing of an xml string. +Restore an xml-string from a an xml-node that was returned by xml-parse..." + (if (or (not node) (stringp node)) + node + (newsticker--unxml-node node))) + +(defun newsticker--unxml-node (node) + "Actually restore xml-string of an xml node." + (let ((qname (symbol-name (car node))) + (att-list (cadr node)) + (children (cddr node))) + (concat "<" qname + (when att-list " ") + (mapconcat 'newsticker--unxml-attribute att-list " ") + ">" + (mapconcat 'newsticker--unxml children "") ""))) + +(defun newsticker--unxml-attribute (att) + "Actually restore xml-string of an attribute of an xml node." + (let ((name (symbol-name (car att))) + (value (cdr att))) + (concat name "=\"" value "\""))) + (defun newsticker--parse-atom-1.0 (name time topnode) "Parse Atom 1.0 data. Argument NAME gives the name of a news feed. TIME gives the @@ -1149,8 +1187,13 @@ (car (xml-get-children node 'title))))) ;; desc-fn (lambda (node) - (or (car (xml-node-children - (car (xml-get-children node 'content)))) + ;; unxml the content node. Atom allows for + ;; integrating (x)html into the atom structure + ;; but we need the raw html string. + ;; e.g. http://www.heise.de/open/news/news-atom.xml + (or (newsticker--unxml + (car (xml-node-children + (car (xml-get-children node 'content))))) (car (xml-node-children (car (xml-get-children node 'summary)))))) ;; link-fn @@ -1295,9 +1338,15 @@ (car (xml-node-children (car (xml-get-children channelnode 'title)))) ;; desc - (car (xml-node-children - (car (xml-get-children channelnode - 'description)))) + (or (car (xml-node-children + (car (xml-get-children channelnode + 'encoded)))) + (car (xml-node-children + (car (xml-get-children channelnode + 'content:encoded)))) + (car (xml-node-children + (car (xml-get-children channelnode + 'description))))) ;; link (car (xml-node-children (car (xml-get-children channelnode 'link)))) @@ -1321,8 +1370,10 @@ ;; time-fn (lambda (node) (newsticker--decode-iso8601-date - (car (xml-node-children - (car (xml-get-children node 'dc:date)))))) + (or (car (xml-node-children + (car (xml-get-children node 'dc:date)))) + (car (xml-node-children + (car (xml-get-children node 'date))))))) ;; guid-fn (lambda (node) nil) @@ -1346,9 +1397,15 @@ (car (xml-node-children (car (xml-get-children channelnode 'title)))) ;; desc - (car (xml-node-children - (car (xml-get-children channelnode - 'description)))) + (or (car (xml-node-children + (car (xml-get-children channelnode + 'encoded)))) + (car (xml-node-children + (car (xml-get-children channelnode + 'content:encoded)))) + (car (xml-node-children + (car (xml-get-children channelnode + 'description))))) ;; link (car (xml-node-children (car (xml-get-children channelnode 'link)))) @@ -1364,6 +1421,9 @@ (lambda (node) (or (car (xml-node-children (car (xml-get-children node + 'encoded)))) + (car (xml-node-children + (car (xml-get-children node 'content:encoded)))) (car (xml-node-children (car (xml-get-children node @@ -1456,7 +1516,7 @@ ;; decode numeric entities (setq title (xml-substitute-numeric-entities title)) (when desc - (setq desc (xml-substitute-numeric-entities desc))) + (setq desc (xml-substitute-numeric-entities desc))) (setq link (xml-substitute-numeric-entities link)) ;; remove whitespace from title, desc, and link (setq title (newsticker--remove-whitespace title)) @@ -1478,9 +1538,9 @@ (let ((prev-age (newsticker--age old-item))) (unless newsticker-automatically-mark-items-as-old ;; Some feeds deliver items multiply, the - ;; first time we find an 'obsolete-old one the - ;; cache, the following times we find an 'old - ;; one + ;; first time we find an 'obsolete-old one in + ;; the cache, the following times we find an + ;; 'old one (if (memq prev-age '(obsolete-old old)) (setq age2 'old) (setq age2 'new))) @@ -1704,7 +1764,7 @@ ;; ====================================================================== (defun newsticker--images-dir () "Return directory where feed images are saved." - (concat newsticker-dir "/images")) + (concat newsticker-dir "/images/")) (defun newsticker--image-get (feed-name url) "Get image of the news site FEED-NAME from URL. @@ -1725,7 +1785,7 @@ (item (or (assoc feed-name newsticker-url-list) (assoc feed-name newsticker-url-list-defaults) (error - "Cannot get news for %s: Check newsticker-url-list" + "Cannot get image for %s: Check newsticker-url-list" feed-name))) (wget-arguments (or (car (cdr (cdr (cdr (cdr item))))) newsticker-wget-arguments))) === modified file 'lisp/net/newst-plainview.el' --- lisp/net/newst-plainview.el 2014-01-01 07:43:34 +0000 +++ lisp/net/newst-plainview.el 2014-10-01 17:20:00 +0000 @@ -5,7 +5,6 @@ ;; Author: Ulf Jasper ;; Filename: newst-plainview.el ;; URL: http://www.nongnu.org/newsticker -;; Time-stamp: "Mon 11-Feb-2013 20:27:11 gm on skiddaw" ;; Package: newsticker ;; ====================================================================== === modified file 'lisp/net/newst-reader.el' --- lisp/net/newst-reader.el 2014-01-01 07:43:34 +0000 +++ lisp/net/newst-reader.el 2014-10-01 17:20:00 +0000 @@ -5,7 +5,6 @@ ;; Author: Ulf Jasper ;; Filename: newst-reader.el ;; URL: http://www.nongnu.org/newsticker -;; Time-stamp: "24. September 2011, 15:47:49 (ulf)" ;; Package: newsticker ;; ====================================================================== @@ -67,6 +66,12 @@ :group 'newsticker-reader) ;; image related things +(defcustom newsticker-download-logos + t + "If non-nil newsticker downloads logo images of subscribed feeds." + :type 'boolean + :group 'newsticker-reader) + (defcustom newsticker-enable-logo-manipulations t "If non-nil newsticker manipulates logo images. @@ -186,15 +191,17 @@ 'nt-type 'desc)) (insert "\n"))))) -(defun newsticker--print-extra-elements (item keymap) +(defun newsticker--print-extra-elements (item keymap &optional htmlish) "Insert extra-elements of ITEM in a pretty form into the current buffer. KEYMAP is applied." (let ((ignored-elements '(items link title description content - content:encoded dc:subject - dc:date entry item guid pubDate + content:encoded encoded + dc:subject subject + dc:date date entry item guid pubDate published updated enclosure)) (left-column-width 1)) + (if htmlish (insert "
    ")) (mapc (lambda (extra-element) (when (listp extra-element) ;; take care of broken xml ;; data, 2007-05-25 @@ -209,15 +216,19 @@ (unless (memq (car extra-element) ignored-elements) (newsticker--do-print-extra-element extra-element left-column-width - keymap)))) - (newsticker--extra item)))) + keymap + htmlish)))) + (newsticker--extra item)) + (if htmlish (insert "
")))) -(defun newsticker--do-print-extra-element (extra-element width keymap) +(defun newsticker--do-print-extra-element (extra-element width keymap htmlish) "Actually print an EXTRA-ELEMENT using the given WIDTH. KEYMAP is applied." (let ((name (symbol-name (car extra-element)))) - (insert (format "%s: " name)) - (insert (make-string (- width (length name)) ? ))) + (if htmlish + (insert (format "
  • %s: " name)) + (insert (format "%s: " name)) + (insert (make-string (- width (length name)) ? )))) (let (;;(attributes (cadr extra-element)) ;FIXME!!!! (contents (cddr extra-element))) (cond ((listp contents) @@ -238,7 +249,9 @@ contents)) (t (insert (format "%s" contents)))) - (insert "\n"))) + (if htmlish + (insert "
  • ") + (insert "\n")))) (defun newsticker--image-read (feed-name-symbol disabled) "Read the cached image for FEED-NAME-SYMBOL from disk. === modified file 'lisp/net/newst-ticker.el' --- lisp/net/newst-ticker.el 2014-09-24 17:33:54 +0000 +++ lisp/net/newst-ticker.el 2014-10-01 17:20:00 +0000 @@ -6,7 +6,6 @@ ;; Filename: newst-ticker.el ;; URL: http://www.nongnu.org/newsticker ;; Keywords: News, RSS, Atom -;; Time-stamp: "24. September 2014, 19:07:25 (ulf)" ;; Package: newsticker ;; ====================================================================== === modified file 'lisp/net/newst-treeview.el' --- lisp/net/newst-treeview.el 2014-09-29 18:14:08 +0000 +++ lisp/net/newst-treeview.el 2014-10-01 17:20:00 +0000 @@ -781,8 +781,11 @@ (put-text-property pos (point) 'face 'newsticker-enclosure-face) (setq pos (point)) (insert "\n") - (newsticker--print-extra-elements item newsticker--treeview-url-keymap) - (put-text-property pos (point) 'face 'newsticker-extra-face) + (set-marker marker1 pos) + (newsticker--print-extra-elements item newsticker--treeview-url-keymap t) + (set-marker marker2 (point)) + (newsticker--treeview-render-text marker1 marker2) + (put-text-property marker1 marker2 'face 'newsticker-extra-face) (goto-char (point-min))))) (if (and newsticker-treeview-automatically-mark-displayed-items-as-old item === modified file 'lisp/net/newsticker.el' --- lisp/net/newsticker.el 2014-01-06 06:25:30 +0000 +++ lisp/net/newsticker.el 2014-10-01 17:20:00 +0000 @@ -7,8 +7,6 @@ ;; URL: http://www.nongnu.org/newsticker ;; Created: 17. June 2003 ;; Keywords: News, RSS, Atom -;; Time-stamp: "6. Dezember 2009, 19:15:18 (ulf)" -;; Version: 1.99 ;; ====================================================================== @@ -28,6 +26,7 @@ ;; along with GNU Emacs. If not, see . (defconst newsticker-version "1.99" "Version number of newsticker.el.") +(make-obsolete-variable 'newsticker-version 'emacs-version "25.1") ;; ====================================================================== ;;; Commentary: ------------------------------------------------------------ revno: 117998 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-10-01 18:18:16 +0300 message: Don't modify the process's command name passed to start-process on MS-Windows. src/w32proc.c (sys_spawnve): Avoid modification of the CMDNAME argument passed by the caller, when we mirror all slashes into backslashes. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 14:58:54 +0000 +++ src/ChangeLog 2014-10-01 15:18:16 +0000 @@ -1,3 +1,9 @@ +2014-10-01 Eli Zaretskii + + * w32proc.c (sys_spawnve): Avoid modification of the CMDNAME + argument passed by the caller, when we mirror all slashes into + backslashes. + 2014-10-01 Dmitry Antipov * gtkutil.c (xg_set_toolkit_horizontal_scroll_bar_thumb): === modified file 'src/w32proc.c' --- src/w32proc.c 2014-09-25 09:34:53 +0000 +++ src/w32proc.c 2014-10-01 15:18:16 +0000 @@ -1605,6 +1605,15 @@ program = ENCODE_FILE (full); cmdname = SDATA (program); } + else + { + char *p = alloca (strlen (cmdname) + 1); + + /* Don't change the command name we were passed by our caller + (unixtodos_filename below will destructively mirror forward + slashes). */ + cmdname = strcpy (p, cmdname); + } /* make sure argv[0] and cmdname are both in DOS format */ unixtodos_filename (cmdname); ------------------------------------------------------------ revno: 117997 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-10-01 17:58:54 +0300 message: Revert the changes in 2014-10-01T02:25:40Z!eggert@cs.ucla.edu. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 13:21:08 +0000 +++ src/ChangeLog 2014-10-01 14:58:54 +0000 @@ -21,9 +21,6 @@ All uses changed. * lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros. - * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t - to ssize_t since we're not using ssize_t-related syscalls here. - 2014-09-30 Eli Zaretskii * w32fns.c (w32_createwindow): Accept an additional argument, an === modified file 'src/dispnew.c' --- src/dispnew.c 2014-10-01 03:28:16 +0000 +++ src/dispnew.c 2014-10-01 14:58:54 +0000 @@ -2137,7 +2137,7 @@ static void adjust_decode_mode_spec_buffer (struct frame *f) { - ptrdiff_t frame_message_buf_size = FRAME_MESSAGE_BUF_SIZE (f); + ssize_t frame_message_buf_size = FRAME_MESSAGE_BUF_SIZE (f); eassert (frame_message_buf_size >= 0); f->decode_mode_spec_buffer = xrealloc (f->decode_mode_spec_buffer, ------------------------------------------------------------ revno: 117996 committer: Dmitry Antipov branch nick: trunk timestamp: Wed 2014-10-01 17:21:08 +0400 message: * gtkutil.c (xg_set_toolkit_horizontal_scroll_bar_thumb): Resurrect old code and fix compilation with GTK < 2.13.6. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 03:28:16 +0000 +++ src/ChangeLog 2014-10-01 13:21:08 +0000 @@ -1,3 +1,8 @@ +2014-10-01 Dmitry Antipov + + * gtkutil.c (xg_set_toolkit_horizontal_scroll_bar_thumb): + Resurrect old code and fix compilation with GTK < 2.13.6. + 2014-10-01 Paul Eggert Use AUTO_CONS instead of SCOPED_CONS, etc. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2014-09-24 04:12:37 +0000 +++ src/gtkutil.c 2014-10-01 13:21:08 +0000 @@ -3993,17 +3993,18 @@ block_input (); adj = gtk_range_get_adjustment (GTK_RANGE (wscroll)); - - /* gtk_adjustment_set_lower (adj, (gdouble) lower); +#if GTK_CHECK_VERSION (2, 3, 16) + gtk_adjustment_configure (adj, (gdouble) value, (gdouble) lower, + (gdouble) upper, (gdouble) step_increment, + (gdouble) page_increment, (gdouble) pagesize); +#else + gtk_adjustment_set_lower (adj, (gdouble) lower); gtk_adjustment_set_upper (adj, (gdouble) upper); gtk_adjustment_set_page_size (adj, (gdouble) pagesize); gtk_adjustment_set_value (adj, (gdouble) value); gtk_adjustment_set_page_increment (adj, (gdouble) page_increment); - gtk_adjustment_set_step_increment (adj, (gdouble) - step_increment); */ - gtk_adjustment_configure (adj, (gdouble) value, (gdouble) lower, - (gdouble) upper, (gdouble) step_increment, - (gdouble) page_increment, (gdouble) pagesize); + gtk_adjustment_set_step_increment (adj, (gdouble) step_increment); +#endif gtk_adjustment_changed (adj); unblock_input (); } ------------------------------------------------------------ revno: 117995 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-10-01 06:20:05 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/ldefs-boot.el' --- lisp/ldefs-boot.el 2014-09-11 19:44:25 +0000 +++ lisp/ldefs-boot.el 2014-10-01 10:20:05 +0000 @@ -108,7 +108,7 @@ ;;;*** -;;;### (autoloads nil "add-log" "vc/add-log.el" (21240 46395 727291 +;;;### (autoloads nil "add-log" "vc/add-log.el" (21541 15655 55679 ;;;;;; 0)) ;;; Generated autoloads from vc/add-log.el @@ -2716,8 +2716,8 @@ ;;;*** -;;;### (autoloads nil "bytecomp" "emacs-lisp/bytecomp.el" (21334 -;;;;;; 16805 699731 0)) +;;;### (autoloads nil "bytecomp" "emacs-lisp/bytecomp.el" (21543 +;;;;;; 57381 284584 0)) ;;; Generated autoloads from emacs-lisp/bytecomp.el (put 'byte-compile-dynamic 'safe-local-variable 'booleanp) (put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) @@ -2981,8 +2981,8 @@ ;;;*** -;;;### (autoloads nil "calendar" "calendar/calendar.el" (21493 50983 -;;;;;; 112694 0)) +;;;### (autoloads nil "calendar" "calendar/calendar.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from calendar/calendar.el (autoload 'calendar "calendar" "\ @@ -3050,8 +3050,8 @@ ;;;*** -;;;### (autoloads nil "cc-engine" "progmodes/cc-engine.el" (21499 -;;;;;; 3372 630891 0)) +;;;### (autoloads nil "cc-engine" "progmodes/cc-engine.el" (21522 +;;;;;; 51241 590401 0)) ;;; Generated autoloads from progmodes/cc-engine.el (autoload 'c-guess-basic-syntax "cc-engine" "\ @@ -3640,8 +3640,8 @@ ;;;*** -;;;### (autoloads nil "cconv" "emacs-lisp/cconv.el" (21240 46395 -;;;;;; 727291 0)) +;;;### (autoloads nil "cconv" "emacs-lisp/cconv.el" (21543 57381 +;;;;;; 284584 0)) ;;; Generated autoloads from emacs-lisp/cconv.el (autoload 'cconv-closure-convert "cconv" "\ @@ -4086,8 +4086,8 @@ ;;;*** -;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (21372 32036 -;;;;;; 731951 0)) +;;;### (autoloads nil "cl-lib" "emacs-lisp/cl-lib.el" (21541 15655 +;;;;;; 55679 0)) ;;; Generated autoloads from emacs-lisp/cl-lib.el (push (purecopy '(cl-lib 1 0)) package--builtin-versions) @@ -5915,7 +5915,7 @@ ;;;*** -;;;### (autoloads nil "desktop" "desktop.el" (21446 45134 152348 +;;;### (autoloads nil "desktop" "desktop.el" (21526 48295 289762 ;;;;;; 0)) ;;; Generated autoloads from desktop.el @@ -6154,8 +6154,8 @@ ;;;*** -;;;### (autoloads nil "diary-lib" "calendar/diary-lib.el" (21350 -;;;;;; 58112 380040 0)) +;;;### (autoloads nil "diary-lib" "calendar/diary-lib.el" (21526 +;;;;;; 48295 289762 0)) ;;; Generated autoloads from calendar/diary-lib.el (autoload 'diary "diary-lib" "\ @@ -6245,8 +6245,8 @@ ;;;*** -;;;### (autoloads nil "diff-mode" "vc/diff-mode.el" (21488 33062 -;;;;;; 959598 0)) +;;;### (autoloads nil "diff-mode" "vc/diff-mode.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from vc/diff-mode.el (autoload 'diff-mode "diff-mode" "\ @@ -8009,8 +8009,8 @@ ;;;*** -;;;### (autoloads nil "eldoc" "emacs-lisp/eldoc.el" (21491 9262 4301 -;;;;;; 0)) +;;;### (autoloads nil "eldoc" "emacs-lisp/eldoc.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from emacs-lisp/eldoc.el (defvar eldoc-minor-mode-string (purecopy " ElDoc") "\ @@ -8033,9 +8033,23 @@ \(fn &optional ARG)" t nil) +(defvar global-eldoc-mode nil "\ +Non-nil if Global-Eldoc mode is enabled. +See the command `global-eldoc-mode' for a description of this minor mode. +Setting this variable directly does not take effect; +either customize it (see the info node `Easy Customization') +or call the function `global-eldoc-mode'.") + +(custom-autoload 'global-eldoc-mode "eldoc" nil) + +(autoload 'global-eldoc-mode "eldoc" "\ +Enable `eldoc-mode' in all buffers where it's applicable. + +\(fn &optional ARG)" t nil) + (define-obsolete-function-alias 'turn-on-eldoc-mode 'eldoc-mode "24.4") -(defvar eldoc-documentation-function #'eldoc-documentation-function-default "\ +(defvar eldoc-documentation-function nil "\ Function to call to return doc string. The function of no args should return a one-line string for displaying doc about a function etc. appropriate to the context around point. @@ -8048,8 +8062,7 @@ and the face `eldoc-highlight-function-argument', if they are to have any effect. -This variable is expected to be made buffer-local by modes (other than -Emacs Lisp mode) that support ElDoc.") +This variable is expected to be set buffer-locally by modes that support ElDoc.") ;;;*** @@ -8637,7 +8650,7 @@ ;;;*** -;;;### (autoloads nil "epg-config" "epg-config.el" (21187 63826 213216 +;;;### (autoloads nil "epg-config" "epg-config.el" (21543 57381 284584 ;;;;;; 0)) ;;; Generated autoloads from epg-config.el @@ -8658,9 +8671,8 @@ ;;;*** -;;;### (autoloads nil "erc" "erc/erc.el" (21484 36010 707226 0)) +;;;### (autoloads nil "erc" "erc/erc.el" (21542 36519 256429 0)) ;;; Generated autoloads from erc/erc.el -(push (purecopy '(erc 5 3)) package--builtin-versions) (autoload 'erc-select-read-args "erc" "\ Prompt the user for values of nick, server, port, and password. @@ -9100,15 +9112,15 @@ ;;;*** -;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (21481 59815 -;;;;;; 980216 0)) +;;;### (autoloads nil "erc-stamp" "erc/erc-stamp.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from erc/erc-stamp.el (autoload 'erc-timestamp-mode "erc-stamp" nil t) ;;;*** -;;;### (autoloads nil "erc-track" "erc/erc-track.el" (21240 46395 -;;;;;; 727291 0)) +;;;### (autoloads nil "erc-track" "erc/erc-track.el" (21547 54441 +;;;;;; 168831 0)) ;;; Generated autoloads from erc/erc-track.el (defvar erc-track-minor-mode nil "\ @@ -9914,7 +9926,7 @@ ;;;*** -;;;### (autoloads nil "eww" "net/eww.el" (21474 169 693017 0)) +;;;### (autoloads nil "eww" "net/eww.el" (21546 33576 601815 0)) ;;; Generated autoloads from net/eww.el (autoload 'eww "eww" "\ @@ -10311,7 +10323,7 @@ ;;;*** -;;;### (autoloads nil "ffap" "ffap.el" (21401 32300 989919 0)) +;;;### (autoloads nil "ffap" "ffap.el" (21546 33576 601815 0)) ;;; Generated autoloads from ffap.el (autoload 'ffap-next "ffap" "\ @@ -10523,7 +10535,7 @@ ;;;*** -;;;### (autoloads nil "find-cmd" "find-cmd.el" (21187 63826 213216 +;;;### (autoloads nil "find-cmd" "find-cmd.el" (21539 60334 648861 ;;;;;; 0)) ;;; Generated autoloads from find-cmd.el (push (purecopy '(find-cmd 0 6)) package--builtin-versions) @@ -11840,8 +11852,8 @@ ;;;*** -;;;### (autoloads nil "gnus-art" "gnus/gnus-art.el" (21481 59815 -;;;;;; 980216 0)) +;;;### (autoloads nil "gnus-art" "gnus/gnus-art.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from gnus/gnus-art.el (autoload 'gnus-article-prepare-display "gnus-art" "\ @@ -11991,8 +12003,8 @@ ;;;*** -;;;### (autoloads nil "gnus-fun" "gnus/gnus-fun.el" (21355 22953 -;;;;;; 61816 0)) +;;;### (autoloads nil "gnus-fun" "gnus/gnus-fun.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from gnus/gnus-fun.el (autoload 'gnus--random-face-with-type "gnus-fun" "\ @@ -12051,7 +12063,7 @@ \(fn)" t nil) (autoload 'gnus-insert-random-face-header "gnus-fun" "\ -Insert a randome Face header from `gnus-face-directory'. +Insert a random Face header from `gnus-face-directory'. \(fn)" nil nil) @@ -12592,7 +12604,7 @@ ;;;*** -;;;### (autoloads nil "grep" "progmodes/grep.el" (21356 43818 957743 +;;;### (autoloads nil "grep" "progmodes/grep.el" (21542 36519 256429 ;;;;;; 0)) ;;; Generated autoloads from progmodes/grep.el @@ -12626,7 +12638,7 @@ (custom-autoload 'grep-setup-hook "grep" t) -(defconst grep-regexp-alist '(("^\\(.+?\\)\\(:[ ]*\\)\\([1-9][0-9]*\\)\\2" 1 3 ((lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\ +(defconst grep-regexp-alist '(("^\\(.*?[^/\n]\\):[ ]*\\([1-9][0-9]*\\)[ ]*:" 1 2 ((lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face))) (when mbeg (- mbeg beg))))) lambda nil (when grep-highlight-matches (let* ((beg (match-end 0)) (end (save-excursion (goto-char beg) (line-end-position))) (mbeg (text-property-any beg end 'font-lock-face grep-match-face)) (mend (and mbeg (next-single-property-change mbeg 'font-lock-face nil end)))) (when mend (- mend beg)))))) ("^Binary file \\(.+\\) matches$" 1 nil nil 0 1)) "\ Regexp used to match grep hits. See `compilation-error-regexp-alist'.") (defvar grep-program (purecopy "grep") "\ @@ -12770,7 +12782,7 @@ ;;;*** -;;;### (autoloads nil "gud" "progmodes/gud.el" (21484 36010 707226 +;;;### (autoloads nil "gud" "progmodes/gud.el" (21510 60072 112989 ;;;;;; 0)) ;;; Generated autoloads from progmodes/gud.el @@ -13658,8 +13670,8 @@ ;;;*** -;;;### (autoloads nil "hideif" "progmodes/hideif.el" (21452 59559 -;;;;;; 901066 0)) +;;;### (autoloads nil "hideif" "progmodes/hideif.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from progmodes/hideif.el (autoload 'hide-ifdef-mode "hideif" "\ @@ -14178,7 +14190,7 @@ ;;;*** -;;;### (autoloads nil "ibuf-macs" "ibuf-macs.el" (21187 63826 213216 +;;;### (autoloads nil "ibuf-macs" "ibuf-macs.el" (21537 18599 384335 ;;;;;; 0)) ;;; Generated autoloads from ibuf-macs.el @@ -14267,7 +14279,8 @@ ;;;*** -;;;### (autoloads nil "ibuffer" "ibuffer.el" (21508 18343 5038 0)) +;;;### (autoloads nil "ibuffer" "ibuffer.el" (21537 18854 710114 +;;;;;; 217000)) ;;; Generated autoloads from ibuffer.el (autoload 'ibuffer-list-buffers "ibuffer" "\ @@ -14306,8 +14319,8 @@ ;;;*** -;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (21480 -;;;;;; 38952 540043 0)) +;;;### (autoloads nil "icalendar" "calendar/icalendar.el" (21546 +;;;;;; 33576 601815 0)) ;;; Generated autoloads from calendar/icalendar.el (push (purecopy '(icalendar 0 19)) package--builtin-versions) @@ -14855,7 +14868,7 @@ ;;;*** -;;;### (autoloads nil "ielm" "ielm.el" (21240 46395 727291 0)) +;;;### (autoloads nil "ielm" "ielm.el" (21542 36519 256429 0)) ;;; Generated autoloads from ielm.el (autoload 'ielm "ielm" "\ @@ -14883,7 +14896,7 @@ ;;;*** -;;;### (autoloads nil "image" "image.el" (21261 4487 230861 399000)) +;;;### (autoloads nil "image" "image.el" (21526 48295 289762 0)) ;;; Generated autoloads from image.el (autoload 'image-type-from-data "image" "\ @@ -15277,7 +15290,7 @@ ;;;*** -;;;### (autoloads nil "image-mode" "image-mode.el" (21483 15143 105233 +;;;### (autoloads nil "image-mode" "image-mode.el" (21532 676 459903 ;;;;;; 0)) ;;; Generated autoloads from image-mode.el @@ -16413,8 +16426,7 @@ ;;;*** -;;;### (autoloads nil "js" "progmodes/js.el" (21388 20265 495157 -;;;;;; 0)) +;;;### (autoloads nil "js" "progmodes/js.el" (21529 24490 97012 0)) ;;; Generated autoloads from progmodes/js.el (push (purecopy '(js 9)) package--builtin-versions) @@ -16424,6 +16436,8 @@ \(fn)" t nil) (defalias 'javascript-mode 'js-mode) +(dolist (name (list "node" "nodejs" "gjs" "rhino")) (add-to-list 'interpreter-mode-alist (cons (purecopy name) 'js-mode))) + ;;;*** ;;;### (autoloads nil "json" "json.el" (21187 63826 213216 0)) @@ -17087,7 +17101,7 @@ ;;;*** -;;;### (autoloads nil "ls-lisp" "ls-lisp.el" (21240 46395 727291 +;;;### (autoloads nil "ls-lisp" "ls-lisp.el" (21546 33576 601815 ;;;;;; 0)) ;;; Generated autoloads from ls-lisp.el @@ -17710,7 +17724,7 @@ ;;;*** -;;;### (autoloads nil "message" "gnus/message.el" (21326 22692 123234 +;;;### (autoloads nil "message" "gnus/message.el" (21546 33576 601815 ;;;;;; 0)) ;;; Generated autoloads from gnus/message.el @@ -17937,7 +17951,7 @@ ;;;*** -;;;### (autoloads nil "mh-comp" "mh-e/mh-comp.el" (21187 63826 213216 +;;;### (autoloads nil "mh-comp" "mh-e/mh-comp.el" (21546 33576 601815 ;;;;;; 0)) ;;; Generated autoloads from mh-e/mh-comp.el @@ -18028,9 +18042,9 @@ ;;;*** -;;;### (autoloads nil "mh-e" "mh-e/mh-e.el" (21356 43818 957743 0)) +;;;### (autoloads nil "mh-e" "mh-e/mh-e.el" (21546 33576 601815 0)) ;;; Generated autoloads from mh-e/mh-e.el -(push (purecopy '(mh-e 8 5 -4)) package--builtin-versions) +(push (purecopy '(mh-e 8 6)) package--builtin-versions) (put 'mh-progs 'risky-local-variable t) @@ -18387,7 +18401,7 @@ ;;;*** -;;;### (autoloads nil "mml" "gnus/mml.el" (21296 1575 438327 0)) +;;;### (autoloads nil "mml" "gnus/mml.el" (21546 33576 601815 0)) ;;; Generated autoloads from gnus/mml.el (autoload 'mml-to-mime "mml" "\ @@ -18428,7 +18442,7 @@ ;;;*** -;;;### (autoloads nil "mml2015" "gnus/mml2015.el" (21356 43818 957743 +;;;### (autoloads nil "mml2015" "gnus/mml2015.el" (21546 33576 601815 ;;;;;; 0)) ;;; Generated autoloads from gnus/mml2015.el @@ -18585,7 +18599,7 @@ ;;;*** -;;;### (autoloads nil "mpc" "mpc.el" (21483 15143 105233 0)) +;;;### (autoloads nil "mpc" "mpc.el" (21537 18599 384335 0)) ;;; Generated autoloads from mpc.el (autoload 'mpc "mpc" "\ @@ -18605,7 +18619,7 @@ ;;;*** -;;;### (autoloads nil "msb" "msb.el" (21240 46395 727291 0)) +;;;### (autoloads nil "msb" "msb.el" (21528 3626 241769 0)) ;;; Generated autoloads from msb.el (defvar msb-mode nil "\ @@ -19097,8 +19111,8 @@ ;;;*** -;;;### (autoloads nil "newst-backend" "net/newst-backend.el" (21260 -;;;;;; 57908 370145 500000)) +;;;### (autoloads nil "newst-backend" "net/newst-backend.el" (21539 +;;;;;; 60334 648861 0)) ;;; Generated autoloads from net/newst-backend.el (autoload 'newsticker-running-p "newst-backend" "\ @@ -19141,8 +19155,8 @@ ;;;*** -;;;### (autoloads nil "newst-ticker" "net/newst-ticker.el" (21187 -;;;;;; 63826 213216 0)) +;;;### (autoloads nil "newst-ticker" "net/newst-ticker.el" (21539 +;;;;;; 60334 648861 0)) ;;; Generated autoloads from net/newst-ticker.el (autoload 'newsticker-ticker-running-p "newst-ticker" "\ @@ -19162,8 +19176,8 @@ ;;;*** -;;;### (autoloads nil "newst-treeview" "net/newst-treeview.el" (21481 -;;;;;; 59815 980216 0)) +;;;### (autoloads nil "newst-treeview" "net/newst-treeview.el" (21546 +;;;;;; 33576 601815 0)) ;;; Generated autoloads from net/newst-treeview.el (autoload 'newsticker-treeview "newst-treeview" "\ @@ -20146,8 +20160,8 @@ ;;;*** -;;;### (autoloads nil "package" "emacs-lisp/package.el" (21419 62246 -;;;;;; 751914 0)) +;;;### (autoloads nil "package" "emacs-lisp/package.el" (21547 54441 +;;;;;; 168831 0)) ;;; Generated autoloads from emacs-lisp/package.el (push (purecopy '(package 1 0 1)) package--builtin-versions) @@ -20245,8 +20259,8 @@ ;;;*** -;;;### (autoloads nil "parse-time" "calendar/parse-time.el" (21471 -;;;;;; 23976 844614 0)) +;;;### (autoloads nil "parse-time" "calendar/parse-time.el" (21541 +;;;;;; 15655 55679 0)) ;;; Generated autoloads from calendar/parse-time.el (put 'parse-time-rules 'risky-local-variable t) @@ -20331,8 +20345,8 @@ ;;;*** -;;;### (autoloads nil "pcase" "emacs-lisp/pcase.el" (21190 39993 -;;;;;; 744837 0)) +;;;### (autoloads nil "pcase" "emacs-lisp/pcase.el" (21542 36519 +;;;;;; 256429 0)) ;;; Generated autoloads from emacs-lisp/pcase.el (autoload 'pcase "pcase" "\ @@ -20345,26 +20359,31 @@ SYMBOL matches anything and binds it to SYMBOL. (or UPAT...) matches if any of the patterns matches. (and UPAT...) matches if all the patterns match. + 'VAL matches if the object is `equal' to VAL `QPAT matches if the QPattern QPAT matches. - (pred PRED) matches if PRED applied to the object returns non-nil. + (pred FUN) matches if FUN applied to the object returns non-nil. (guard BOOLEXP) matches if BOOLEXP evaluates to non-nil. (let UPAT EXP) matches if EXP matches UPAT. + (app FUN UPAT) matches if FUN applied to the object matches UPAT. If a SYMBOL is used twice in the same pattern (i.e. the pattern is \"non-linear\"), then the second occurrence is turned into an `eq'uality test. QPatterns can take the following forms: - (QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr. - ,UPAT matches if the UPattern UPAT matches. - STRING matches if the object is `equal' to STRING. - ATOM matches if the object is `eq' to ATOM. -QPatterns for vectors are not implemented yet. + (QPAT1 . QPAT2) matches if QPAT1 matches the car and QPAT2 the cdr. + [QPAT1 QPAT2..QPATn] matches a vector of length n and QPAT1..QPATn match + its 0..(n-1)th elements, respectively. + ,UPAT matches if the UPattern UPAT matches. + STRING matches if the object is `equal' to STRING. + ATOM matches if the object is `eq' to ATOM. -PRED can take the form - FUNCTION in which case it gets called with one argument. - (FUN ARG1 .. ARGN) in which case it gets called with an N+1'th argument +FUN can take the form + SYMBOL or (lambda ARGS BODY) in which case it's called with one argument. + (F ARG1 .. ARGn) in which case F gets called with an n+1'th argument which is the value being matched. -A PRED of the form FUNCTION is equivalent to one of the form (FUNCTION). -PRED patterns can refer to variables bound earlier in the pattern. +So a FUN of the form SYMBOL is equivalent to one of the form (FUN). +FUN can refer to variables bound earlier in the pattern. +FUN is assumed to be pure, i.e. it can be dropped if its result is not used, +and two identical calls can be merged into one. E.g. you can match pairs where the cdr is larger than the car with a pattern like `(,a . ,(pred (< a))) or, with more checks: `(,(and a (pred numberp)) . ,(and (pred numberp) (pred (< a)))) @@ -20373,6 +20392,13 @@ (function-put 'pcase 'lisp-indent-function '1) +(autoload 'pcase-exhaustive "pcase" "\ +The exhaustive version of `pcase' (which see). + +\(fn EXP &rest CASES)" nil t) + +(function-put 'pcase-exhaustive 'lisp-indent-function '1) + (autoload 'pcase-let* "pcase" "\ Like `let*' but where you can use `pcase' patterns for bindings. BODY should be an expression, and BINDINGS should be a list of bindings @@ -20391,6 +20417,15 @@ (function-put 'pcase-let 'lisp-indent-function '1) +(autoload 'pcase-defmacro "pcase" "\ +Define a pcase UPattern macro. + +\(fn NAME ARGS &rest BODY)" nil t) + +(function-put 'pcase-defmacro 'lisp-indent-function '2) + +(function-put 'pcase-defmacro 'doc-string-elt '3) + ;;;*** ;;;### (autoloads nil "pcmpl-cvs" "pcmpl-cvs.el" (21187 63826 213216 @@ -20687,8 +20722,8 @@ ;;;*** -;;;### (autoloads nil "perl-mode" "progmodes/perl-mode.el" (21437 -;;;;;; 5802 125919 0)) +;;;### (autoloads nil "perl-mode" "progmodes/perl-mode.el" (21535 +;;;;;; 63274 647253 0)) ;;; Generated autoloads from progmodes/perl-mode.el (put 'perl-indent-level 'safe-local-variable 'integerp) (put 'perl-continued-statement-offset 'safe-local-variable 'integerp) @@ -20936,7 +20971,7 @@ ;;;*** -;;;### (autoloads nil "printing" "printing.el" (21364 37926 837230 +;;;### (autoloads nil "printing" "printing.el" (21546 33576 601815 ;;;;;; 0)) ;;; Generated autoloads from printing.el (push (purecopy '(printing 6 9 3)) package--builtin-versions) @@ -21869,8 +21904,8 @@ ;;;*** -;;;### (autoloads nil "python" "progmodes/python.el" (21503 425 992235 -;;;;;; 0)) +;;;### (autoloads nil "python" "progmodes/python.el" (21547 54441 +;;;;;; 168831 0)) ;;; Generated autoloads from progmodes/python.el (push (purecopy '(python 0 24 4)) package--builtin-versions) @@ -22254,7 +22289,7 @@ ;;;*** -;;;### (autoloads nil "rcirc" "net/rcirc.el" (21452 59559 901066 +;;;### (autoloads nil "rcirc" "net/rcirc.el" (21546 33576 601815 ;;;;;; 0)) ;;; Generated autoloads from net/rcirc.el @@ -22339,7 +22374,7 @@ ;;;*** -;;;### (autoloads nil "rect" "rect.el" (21471 23976 844614 0)) +;;;### (autoloads nil "rect" "rect.el" (21546 33576 601815 0)) ;;; Generated autoloads from rect.el (autoload 'delete-rectangle "rect" "\ @@ -22500,8 +22535,8 @@ ;;;*** -;;;### (autoloads nil "reftex" "textmodes/reftex.el" (21418 41409 -;;;;;; 280143 158000)) +;;;### (autoloads nil "reftex" "textmodes/reftex.el" (21534 42729 +;;;;;; 1557 881000)) ;;; Generated autoloads from textmodes/reftex.el (autoload 'reftex-citation "reftex-cite" nil t) (autoload 'reftex-all-document-files "reftex-parse") @@ -22834,204 +22869,6 @@ ;;;*** -;;;### (autoloads nil "rmail" "mail/rmail.el" (21384 23211 329821 -;;;;;; 0)) -;;; Generated autoloads from mail/rmail.el - -(defvar rmail-file-name (purecopy "~/RMAIL") "\ -Name of user's primary mail file.") - -(custom-autoload 'rmail-file-name "rmail" t) - -(put 'rmail-spool-directory 'standard-value '((cond ((file-exists-p "/var/mail") "/var/mail/") ((file-exists-p "/var/spool/mail") "/var/spool/mail/") ((memq system-type '(hpux usg-unix-v irix)) "/usr/mail/") (t "/usr/spool/mail/")))) - -(defvar rmail-spool-directory (purecopy (cond ((file-exists-p "/var/mail") "/var/mail/") ((file-exists-p "/var/spool/mail") "/var/spool/mail/") ((memq system-type '(hpux usg-unix-v irix)) "/usr/mail/") (t "/usr/spool/mail/"))) "\ -Name of directory used by system mailer for delivering new mail. -Its name should end with a slash.") - -(custom-autoload 'rmail-spool-directory "rmail" t) -(custom-initialize-delay 'rmail-spool-directory nil) - -(autoload 'rmail-movemail-variant-p "rmail" "\ -Return t if the current movemail variant is any of VARIANTS. -Currently known variants are 'emacs and 'mailutils. - -\(fn &rest VARIANTS)" nil nil) - -(defvar rmail-user-mail-address-regexp nil "\ -Regexp matching user mail addresses. -If non-nil, this variable is used to identify the correspondent -when receiving new mail. If it matches the address of the sender, -the recipient is taken as correspondent of a mail. -If nil (default value), your `user-login-name' and `user-mail-address' -are used to exclude yourself as correspondent. - -Usually you don't have to set this variable, except if you collect mails -sent by you under different user names. -Then it should be a regexp matching your mail addresses. - -Setting this variable has an effect only before reading a mail.") - -(custom-autoload 'rmail-user-mail-address-regexp "rmail" t) - -(define-obsolete-variable-alias 'rmail-dont-reply-to-names 'mail-dont-reply-to-names "24.1") - -(defvar rmail-default-dont-reply-to-names nil "\ -Regexp specifying part of the default value of `mail-dont-reply-to-names'. -This is used when the user does not set `mail-dont-reply-to-names' -explicitly.") - -(make-obsolete-variable 'rmail-default-dont-reply-to-names 'mail-dont-reply-to-names "24.1") - -(defvar rmail-ignored-headers (purecopy (concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:" "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:" "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:" "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:" "\\|^nntp-posting-host:\\|^path:\\|^x-char.*:\\|^x-face:\\|^face:" "\\|^x-mailer:\\|^delivered-to:\\|^lines:" "\\|^content-transfer-encoding:\\|^x-coding-system:" "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:" "\\|^precedence:\\|^mime-version:" "\\|^list-owner:\\|^list-help:\\|^list-post:\\|^list-subscribe:" "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:" "\\|^content-length:\\|^nntp-posting-date:\\|^user-agent" "\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:" "\\|^mbox-line:\\|^cancel-lock:" "\\|^DomainKey-Signature:\\|^dkim-signature:" "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:" "\\|^x-.*:")) "\ -Regexp to match header fields that Rmail should normally hide. -\(See also `rmail-nonignored-headers', which overrides this regexp.) -This variable is used for reformatting the message header, -which normally happens once for each message, -when you view the message for the first time in Rmail. -To make a change in this variable take effect -for a message that you have already viewed, -go to that message and type \\[rmail-toggle-header] twice.") - -(custom-autoload 'rmail-ignored-headers "rmail" t) - -(defvar rmail-displayed-headers nil "\ -Regexp to match Header fields that Rmail should display. -If nil, display all header fields except those matched by -`rmail-ignored-headers'.") - -(custom-autoload 'rmail-displayed-headers "rmail" t) - -(defvar rmail-retry-ignored-headers (purecopy "^x-authentication-warning:\\|^x-detected-operating-system:\\|^x-spam[-a-z]*:\\|content-type:\\|content-transfer-encoding:\\|mime-version:\\|message-id:") "\ -Headers that should be stripped when retrying a failed message.") - -(custom-autoload 'rmail-retry-ignored-headers "rmail" t) - -(defvar rmail-highlighted-headers (purecopy "^From:\\|^Subject:") "\ -Regexp to match Header fields that Rmail should normally highlight. -A value of nil means don't highlight. Uses the face `rmail-highlight'.") - -(custom-autoload 'rmail-highlighted-headers "rmail" t) - -(defvar rmail-primary-inbox-list nil "\ -List of files that are inboxes for your primary mail file `rmail-file-name'. -If this is nil, uses the environment variable MAIL. If that is -unset, uses a file named by the function `user-login-name' in the -directory `rmail-spool-directory' (whose value depends on the -operating system). For example, \"/var/mail/USER\".") - -(custom-autoload 'rmail-primary-inbox-list "rmail" t) - -(defvar rmail-secondary-file-directory (purecopy "~/") "\ -Directory for additional secondary Rmail files.") - -(custom-autoload 'rmail-secondary-file-directory "rmail" t) - -(defvar rmail-secondary-file-regexp (purecopy "\\.xmail$") "\ -Regexp for which files are secondary Rmail files.") - -(custom-autoload 'rmail-secondary-file-regexp "rmail" t) - -(defvar rmail-mode-hook nil "\ -List of functions to call when Rmail is invoked.") - -(defvar rmail-show-message-hook nil "\ -List of functions to call when Rmail displays a message.") - -(custom-autoload 'rmail-show-message-hook "rmail" t) - -(defvar rmail-file-coding-system nil "\ -Coding system used in RMAIL file. - -This is set to nil by default.") - -(defvar rmail-insert-mime-forwarded-message-function nil "\ -Function to insert a message in MIME format so it can be forwarded. -This function is called if `rmail-enable-mime' and -`rmail-enable-mime-composing' are non-nil. -It is called with one argument FORWARD-BUFFER, which is a -buffer containing the message to forward. The current buffer -is the outgoing mail buffer.") - -(autoload 'rmail "rmail" "\ -Read and edit incoming mail. -Moves messages into file named by `rmail-file-name' and edits that -file in RMAIL Mode. -Type \\[describe-mode] once editing that file, for a list of RMAIL commands. - -May be called with file name as argument; then performs rmail editing on -that file, but does not copy any new mail into the file. -Interactively, if you supply a prefix argument, then you -have a chance to specify a file name with the minibuffer. - -If `rmail-display-summary' is non-nil, make a summary for this RMAIL file. - -\(fn &optional FILE-NAME-ARG)" t nil) - -(autoload 'rmail-mode "rmail" "\ -Rmail Mode is used by \\\\[rmail] for editing Rmail files. -All normal editing commands are turned off. -Instead, these commands are available: - -\\[rmail-beginning-of-message] Move point to front of this message. -\\[rmail-end-of-message] Move point to bottom of this message. -\\[scroll-up] Scroll to next screen of this message. -\\[scroll-down] Scroll to previous screen of this message. -\\[rmail-next-undeleted-message] Move to Next non-deleted message. -\\[rmail-previous-undeleted-message] Move to Previous non-deleted message. -\\[rmail-next-message] Move to Next message whether deleted or not. -\\[rmail-previous-message] Move to Previous message whether deleted or not. -\\[rmail-first-message] Move to the first message in Rmail file. -\\[rmail-last-message] Move to the last message in Rmail file. -\\[rmail-show-message] Jump to message specified by numeric position in file. -\\[rmail-search] Search for string and show message it is found in. -\\[rmail-delete-forward] Delete this message, move to next nondeleted. -\\[rmail-delete-backward] Delete this message, move to previous nondeleted. -\\[rmail-undelete-previous-message] Undelete message. Tries current message, then earlier messages - till a deleted message is found. -\\[rmail-edit-current-message] Edit the current message. \\[rmail-cease-edit] to return to Rmail. -\\[rmail-expunge] Expunge deleted messages. -\\[rmail-expunge-and-save] Expunge and save the file. -\\[rmail-quit] Quit Rmail: expunge, save, then switch to another buffer. -\\[save-buffer] Save without expunging. -\\[rmail-get-new-mail] Move new mail from system spool directory into this file. -\\[rmail-mail] Mail a message (same as \\[mail-other-window]). -\\[rmail-continue] Continue composing outgoing message started before. -\\[rmail-reply] Reply to this message. Like \\[rmail-mail] but initializes some fields. -\\[rmail-retry-failure] Send this message again. Used on a mailer failure message. -\\[rmail-forward] Forward this message to another user. -\\[rmail-output] Output (append) this message to another mail file. -\\[rmail-output-as-seen] Output (append) this message to file as it's displayed. -\\[rmail-output-body-to-file] Save message body to a file. Default filename comes from Subject line. -\\[rmail-input] Input Rmail file. Run Rmail on that file. -\\[rmail-add-label] Add label to message. It will be displayed in the mode line. -\\[rmail-kill-label] Kill label. Remove a label from current message. -\\[rmail-next-labeled-message] Move to Next message with specified label - (label defaults to last one specified). - Standard labels: filed, unseen, answered, forwarded, deleted. - Any other label is present only if you add it with \\[rmail-add-label]. -\\[rmail-previous-labeled-message] Move to Previous message with specified label -\\[rmail-summary] Show headers buffer, with a one line summary of each message. -\\[rmail-summary-by-labels] Summarize only messages with particular label(s). -\\[rmail-summary-by-recipients] Summarize only messages with particular recipient(s). -\\[rmail-summary-by-regexp] Summarize only messages with particular regexp(s). -\\[rmail-summary-by-topic] Summarize only messages with subject line regexp(s). -\\[rmail-toggle-header] Toggle display of complete header. - -\(fn)" t nil) - -(autoload 'rmail-input "rmail" "\ -Run Rmail on file FILENAME. - -\(fn FILENAME)" t nil) - -(autoload 'rmail-set-remote-password "rmail" "\ -Set PASSWORD to be used for retrieving mail from a POP or IMAP server. - -\(fn PASSWORD)" t nil) - -;;;*** - ;;;### (autoloads nil "rmailout" "mail/rmailout.el" (21240 46395 ;;;;;; 727291 0)) ;;; Generated autoloads from mail/rmailout.el @@ -24205,7 +24042,7 @@ ;;;*** -;;;### (autoloads nil "ses" "ses.el" (21454 14892 338155 0)) +;;;### (autoloads nil "ses" "ses.el" (21547 54441 168831 0)) ;;; Generated autoloads from ses.el (autoload 'ses-mode "ses" "\ @@ -24315,8 +24152,8 @@ ;;;*** -;;;### (autoloads nil "sh-script" "progmodes/sh-script.el" (21452 -;;;;;; 59559 901066 0)) +;;;### (autoloads nil "sh-script" "progmodes/sh-script.el" (21510 +;;;;;; 60072 112989 0)) ;;; Generated autoloads from progmodes/sh-script.el (push (purecopy '(sh-script 2 0 6)) package--builtin-versions) (put 'sh-shell 'safe-local-variable 'symbolp) @@ -24517,7 +24354,7 @@ ;;;*** -;;;### (autoloads nil "shr" "net/shr.el" (21503 425 992235 0)) +;;;### (autoloads nil "shr" "net/shr.el" (21532 676 459903 0)) ;;; Generated autoloads from net/shr.el (autoload 'shr-render-region "shr" "\ @@ -25225,8 +25062,8 @@ ;;;*** -;;;### (autoloads nil "sql" "progmodes/sql.el" (21263 60346 30834 -;;;;;; 928000)) +;;;### (autoloads nil "sql" "progmodes/sql.el" (21546 33576 601815 +;;;;;; 0)) ;;; Generated autoloads from progmodes/sql.el (push (purecopy '(sql 3 4)) package--builtin-versions) @@ -25685,6 +25522,11 @@ \(fn &optional BUFFER)" t nil) +(autoload 'sql-vertica "sql" "\ +Run vsql as an inferior process. + +\(fn &optional BUFFER)" t nil) + ;;;*** ;;;### (autoloads nil "srecode" "cedet/srecode.el" (21187 63826 213216 @@ -25865,11 +25707,11 @@ ;;;*** -;;;### (autoloads nil "subword" "progmodes/subword.el" (21377 49959 -;;;;;; 896066 0)) +;;;### (autoloads nil "subword" "progmodes/subword.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from progmodes/subword.el -(define-obsolete-function-alias 'capitalized-words-mode 'subword-mode "24.5") +(define-obsolete-function-alias 'capitalized-words-mode 'subword-mode "25.1") (autoload 'subword-mode "subword" "\ Toggle subword movement and editing (Subword mode). @@ -26657,7 +26499,7 @@ ;;;*** -;;;### (autoloads nil "tar-mode" "tar-mode.el" (21240 46395 727291 +;;;### (autoloads nil "tar-mode" "tar-mode.el" (21510 60072 112989 ;;;;;; 0)) ;;; Generated autoloads from tar-mode.el @@ -26835,8 +26677,8 @@ ;;;*** -;;;### (autoloads nil "tex-mode" "textmodes/tex-mode.el" (21462 9001 -;;;;;; 456449 0)) +;;;### (autoloads nil "tex-mode" "textmodes/tex-mode.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from textmodes/tex-mode.el (defvar tex-shell-file-name nil "\ @@ -28086,7 +27928,7 @@ ;;;*** -;;;### (autoloads nil "tramp" "net/tramp.el" (21504 21288 950856 +;;;### (autoloads nil "tramp" "net/tramp.el" (21525 27433 340807 ;;;;;; 0)) ;;; Generated autoloads from net/tramp.el @@ -28213,7 +28055,7 @@ ;;;*** -;;;### (autoloads nil "tutorial" "tutorial.el" (21468 47783 238320 +;;;### (autoloads nil "tutorial" "tutorial.el" (21510 60072 112989 ;;;;;; 0)) ;;; Generated autoloads from tutorial.el @@ -28564,7 +28406,7 @@ ;;;*** -;;;### (autoloads nil "url" "url/url.el" (21302 6641 882267 783000)) +;;;### (autoloads nil "url" "url/url.el" (21537 18599 384335 0)) ;;; Generated autoloads from url/url.el (autoload 'url-retrieve "url" "\ @@ -28732,8 +28574,8 @@ ;;;*** -;;;### (autoloads nil "url-gw" "url/url-gw.el" (21302 6606 390237 -;;;;;; 377000)) +;;;### (autoloads nil "url-gw" "url/url-gw.el" (21545 12711 344259 +;;;;;; 0)) ;;; Generated autoloads from url/url-gw.el (autoload 'url-gateway-nslookup-host "url-gw" "\ @@ -28747,12 +28589,15 @@ Will not make a connection if `url-gateway-unplugged' is non-nil. Might do a non-blocking connection; use `process-status' to check. -\(fn NAME BUFFER HOST SERVICE)" nil nil) +Optional arg GATEWAY-METHOD specifies the gateway to be used, +overriding the value of `url-gateway-method'. + +\(fn NAME BUFFER HOST SERVICE &optional GATEWAY-METHOD)" nil nil) ;;;*** -;;;### (autoloads nil "url-handlers" "url/url-handlers.el" (21476 -;;;;;; 41895 55661 0)) +;;;### (autoloads nil "url-handlers" "url/url-handlers.el" (21546 +;;;;;; 33576 601815 0)) ;;; Generated autoloads from url/url-handlers.el (defvar url-handler-mode nil "\ @@ -28806,7 +28651,7 @@ ;;;*** -;;;### (autoloads nil "url-http" "url/url-http.el" (21419 62246 751914 +;;;### (autoloads nil "url-http" "url/url-http.el" (21545 12711 344259 ;;;;;; 0)) ;;; Generated autoloads from url/url-http.el (autoload 'url-default-expander "url-expand") @@ -29027,8 +28872,8 @@ ;;;*** -;;;### (autoloads nil "url-tramp" "url/url-tramp.el" (21307 58279 -;;;;;; 19956 0)) +;;;### (autoloads nil "url-tramp" "url/url-tramp.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from url/url-tramp.el (defvar url-tramp-protocols '("ftp" "ssh" "scp" "rsync" "telnet") "\ @@ -29592,8 +29437,8 @@ ;;;*** -;;;### (autoloads nil "vc-annotate" "vc/vc-annotate.el" (21481 59815 -;;;;;; 980216 0)) +;;;### (autoloads nil "vc-annotate" "vc/vc-annotate.el" (21546 33576 +;;;;;; 601815 0)) ;;; Generated autoloads from vc/vc-annotate.el (autoload 'vc-annotate "vc-annotate" "\ @@ -29672,7 +29517,7 @@ ;;;*** -;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (21187 63826 213216 +;;;### (autoloads nil "vc-dir" "vc/vc-dir.el" (21517 33344 974987 ;;;;;; 0)) ;;; Generated autoloads from vc/vc-dir.el @@ -29721,8 +29566,8 @@ ;;;*** -;;;### (autoloads nil "vc-git" "vc/vc-git.el" (21499 26793 739924 -;;;;;; 529000)) +;;;### (autoloads nil "vc-git" "vc/vc-git.el" (21513 36261 278490 +;;;;;; 0)) ;;; Generated autoloads from vc/vc-git.el (defun vc-git-registered (file) "Return non-nil if FILE is registered with git." @@ -29808,8 +29653,8 @@ ;;;*** -;;;### (autoloads nil "vera-mode" "progmodes/vera-mode.el" (21383 -;;;;;; 2343 498187 0)) +;;;### (autoloads nil "vera-mode" "progmodes/vera-mode.el" (21546 +;;;;;; 33576 601815 0)) ;;; Generated autoloads from progmodes/vera-mode.el (push (purecopy '(vera-mode 2 28)) package--builtin-versions) (add-to-list 'auto-mode-alist (cons (purecopy "\\.vr[hi]?\\'") 'vera-mode)) @@ -29868,7 +29713,7 @@ ;;;*** ;;;### (autoloads nil "verilog-mode" "progmodes/verilog-mode.el" -;;;;;; (21388 20265 495157 0)) +;;;;;; (21546 33576 601815 0)) ;;; Generated autoloads from progmodes/verilog-mode.el (autoload 'verilog-mode "verilog-mode" "\ @@ -31007,8 +30852,8 @@ ;;;*** -;;;### (autoloads nil "which-func" "progmodes/which-func.el" (21187 -;;;;;; 63826 213216 0)) +;;;### (autoloads nil "which-func" "progmodes/which-func.el" (21511 +;;;;;; 46035 786880 0)) ;;; Generated autoloads from progmodes/which-func.el (put 'which-func-format 'risky-local-variable t) (put 'which-func-current 'risky-local-variable t) @@ -31862,7 +31707,7 @@ ;;;;;; "leim/quail/vntelex.el" "leim/quail/vnvni.el" "leim/quail/welsh.el" ;;;;;; "loadup.el" "mail/blessmail.el" "mail/mailheader.el" "mail/mspools.el" ;;;;;; "mail/rfc2368.el" "mail/rfc822.el" "mail/rmail-spam-filter.el" -;;;;;; "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el" +;;;;;; "mail/rmail.el" "mail/rmailedit.el" "mail/rmailkwd.el" "mail/rmailmm.el" ;;;;;; "mail/rmailmsc.el" "mail/rmailsort.el" "mail/rmailsum.el" ;;;;;; "mail/undigest.el" "mh-e/mh-acros.el" "mh-e/mh-alias.el" ;;;;;; "mh-e/mh-buffers.el" "mh-e/mh-compat.el" "mh-e/mh-funcs.el" @@ -31953,8 +31798,8 @@ ;;;;;; "vc/ediff-ptch.el" "vc/ediff-vers.el" "vc/ediff-wind.el" ;;;;;; "vc/pcvs-info.el" "vc/pcvs-parse.el" "vc/pcvs-util.el" "vc/vc-dav.el" ;;;;;; "vcursor.el" "vt-control.el" "vt100-led.el" "w32-common-fns.el" -;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (21508 18595 492383 -;;;;;; 362000)) +;;;;;; "w32-fns.el" "w32-vars.el" "x-dnd.el") (21547 54610 44674 +;;;;;; 534000)) ;;;*** ------------------------------------------------------------ revno: 117994 committer: Paul Eggert branch nick: trunk timestamp: Tue 2014-09-30 20:28:16 -0700 message: Use AUTO_CONS instead of SCOPED_CONS, etc. * doc/lispref/internals.texi (Stack-allocated Objects): Adjust to match the revised, less error-prone macros. * src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. * src/lisp.h (AUTO_CONS): Rename from scoped_cons. (AUTO_LIST1): Rename from scoped_list1. (AUTO_LIST2): Rename from scoped_list2. (AUTO_LIST3): Rename from scoped_list3. (AUTO_LIST4): Rename from scoped_list4. (AUTO_STRING): Rename from SCOPED_STRING. * src/frame.h (AUTO_FRAME_ARG): * src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) (AUTO_LIST4, AUTO_STRING): Prepend a new argument 'name'. Declare a variable instead of yielding a value. All uses changed. * src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-09-30 19:10:37 +0000 +++ doc/lispref/ChangeLog 2014-10-01 03:28:16 +0000 @@ -1,3 +1,9 @@ +2014-10-01 Paul Eggert + + Use AUTO_CONS instead of SCOPED_CONS, etc. + * internals.texi (Stack-allocated Objects): + Adjust to match the revised, less error-prone macros. + 2014-09-30 Paul Eggert * internals.texi (Stack-allocated Objects): Further improvements. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-09-30 19:10:37 +0000 +++ doc/lispref/internals.texi 2014-10-01 03:28:16 +0000 @@ -548,35 +548,12 @@ never be made visible to user Lisp code. Currently, cons cells and strings can be allocated this way. This -is implemented by C macros like @code{scoped_cons} and -@code{SCOPED_STRING} that return a @code{Lisp_Object} with block +is implemented by C macros like @code{AUTO_CONS} and +@code{AUTO_STRING} that define a named @code{Lisp_Object} with block lifetime. These objects are not freed by the garbage collector; instead, they have automatic storage duration, i.e., they are allocated like local variables and are automatically freed at the end -of execution of the C block where the object was allocated. C blocks -include compound statements (i.e., inside @samp{@{} and @samp{@}}), -along with selection and iteration statements and their immediate -substatements. For example: - -@example -/* Erroneous code. */ -Lisp_Object x; -if (foo) - x = SCOPED_STRING ("prefix"); -else - x = bar; -return concat2 (x, baz); -@end example - -@noindent -This has undefined behavior because the @code{if} statement is a -block, so @code{x} is used after the corresponding object has been -freed. Better would be: - -@example -Lisp_Object x = foo ? SCOPED_STRING ("prefix") : bar; -return concat2 (x, baz); -@end example +of execution of the C block that defined the object. For performance reasons, stack-allocated strings are limited to @acronym{ASCII} characters, and many of these strings are immutable, === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-01 02:25:40 +0000 +++ src/ChangeLog 2014-10-01 03:28:16 +0000 @@ -1,5 +1,21 @@ 2014-10-01 Paul Eggert + Use AUTO_CONS instead of SCOPED_CONS, etc. + * frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER. + * lisp.h (AUTO_CONS): Rename from scoped_cons. + (AUTO_LIST1): Rename from scoped_list1. + (AUTO_LIST2): Rename from scoped_list2. + (AUTO_LIST3): Rename from scoped_list3. + (AUTO_LIST4): Rename from scoped_list4. + (AUTO_STRING): Rename from SCOPED_STRING. + * frame.h (AUTO_FRAME_ARG): + * lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3) + (AUTO_LIST4, AUTO_STRING): + Prepend a new argument 'name'. + Declare a variable instead of yielding a value. + All uses changed. + * lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros. + * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t to ssize_t since we're not using ssize_t-related syscalls here. === modified file 'src/buffer.c' --- src/buffer.c 2014-09-30 02:43:23 +0000 +++ src/buffer.c 2014-10-01 03:28:16 +0000 @@ -1552,10 +1552,11 @@ return notsogood; else { - buf = Fget_buffer (SCOPED_STRING ("*scratch*")); + AUTO_STRING (scratch, "*scratch*"); + buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); + buf = Fget_buffer_create (scratch); Fset_buffer_major_mode (buf); } return buf; @@ -1575,10 +1576,11 @@ if (candidate_buffer (buf, buffer)) return buf; - buf = Fget_buffer (SCOPED_STRING ("*scratch*")); + AUTO_STRING (scratch, "*scratch*"); + buf = Fget_buffer (scratch); if (NILP (buf)) { - buf = Fget_buffer_create (SCOPED_STRING ("*scratch*")); + buf = Fget_buffer_create (scratch); Fset_buffer_major_mode (buf); } @@ -5289,7 +5291,8 @@ (void) initialized; #endif /* USE_MMAP_FOR_BUFFERS */ - Fset_buffer (Fget_buffer_create (SCOPED_STRING ("*scratch*"))); + AUTO_STRING (scratch, "*scratch*"); + Fset_buffer (Fget_buffer_create (scratch)); if (NILP (BVAR (&buffer_defaults, enable_multibyte_characters))) Fset_buffer_multibyte (Qnil); @@ -5326,9 +5329,12 @@ However, it is not necessary to turn / into /:/. So avoid doing that. */ && strcmp ("/", SSDATA (BVAR (current_buffer, directory)))) - bset_directory - (current_buffer, - concat2 (SCOPED_STRING ("/:"), BVAR (current_buffer, directory))); + { + AUTO_STRING (slash_colon, "/:"); + bset_directory (current_buffer, + concat2 (slash_colon, + BVAR (current_buffer, directory))); + } temp = get_minibuffer (0); bset_directory (XBUFFER (temp), BVAR (current_buffer, directory)); === modified file 'src/charset.c' --- src/charset.c 2014-09-30 02:43:23 +0000 +++ src/charset.c 2014-10-01 03:28:16 +0000 @@ -485,14 +485,12 @@ unsigned max_code = CHARSET_MAX_CODE (charset); int fd; FILE *fp; - Lisp_Object suffixes; struct charset_map_entries *head, *entries; int n_entries; - ptrdiff_t count; - - suffixes = scoped_list2 (SCOPED_STRING (".map"), SCOPED_STRING (".TXT")); - - count = SPECPDL_INDEX (); + AUTO_STRING (map, ".map"); + AUTO_STRING (txt, ".txt"); + AUTO_LIST2 (suffixes, map, txt); + ptrdiff_t count = SPECPDL_INDEX (); record_unwind_protect_nothing (); specbind (Qfile_name_handler_alist, Qnil); fd = openp (Vcharset_map_path, mapfile, suffixes, NULL, Qnil, false); === modified file 'src/chartab.c' --- src/chartab.c 2014-09-30 02:43:23 +0000 +++ src/chartab.c 2014-10-01 03:28:16 +0000 @@ -1302,8 +1302,8 @@ { struct gcpro gcpro1; GCPRO1 (val); - result = Fload (concat2 (SCOPED_STRING ("international/"), table), - Qt, Qt, Qt, Qt); + AUTO_STRING (intl, "international/"); + result = Fload (concat2 (intl, table), Qt, Qt, Qt, Qt); UNGCPRO; if (NILP (result)) return Qnil; === modified file 'src/data.c' --- src/data.c 2014-09-30 02:43:23 +0000 +++ src/data.c 2014-10-01 03:28:16 +0000 @@ -979,14 +979,15 @@ { ptrdiff_t i = 0, len = XINT (Flength (choice)); Lisp_Object obj, *args; - Lisp_Object should_be_specified = SCOPED_STRING (" should be specified"); - Lisp_Object or = SCOPED_STRING (" or "); - Lisp_Object comma = SCOPED_STRING (", "); + AUTO_STRING (one_of, "One of "); + AUTO_STRING (comma, ", "); + AUTO_STRING (or, " or "); + AUTO_STRING (should_be_specified, " should be specified"); USE_SAFE_ALLOCA; SAFE_ALLOCA_LISP (args, len * 2 + 1); - args[i++] = SCOPED_STRING ("One of "); + args[i++] = one_of; for (obj = choice; !NILP (obj); obj = XCDR (obj)) { @@ -1006,11 +1007,13 @@ static void wrong_range (Lisp_Object min, Lisp_Object max, Lisp_Object wrong) { - xsignal2 (Qerror, Fconcat (4, ((Lisp_Object []) - { SCOPED_STRING ("Value should be from "), - Fnumber_to_string (min), - SCOPED_STRING (" to "), - Fnumber_to_string (max) })), wrong); + AUTO_STRING (value_should_be_from, "Value should be from "); + AUTO_STRING (to, " to "); + xsignal2 (Qerror, + Fconcat (4, ((Lisp_Object []) + {value_should_be_from, Fnumber_to_string (min), + to, Fnumber_to_string (max)})), + wrong); } /* Store NEWVAL into SYMBOL, where VALCONTENTS is found in the value cell === modified file 'src/dispnew.c' --- src/dispnew.c 2014-10-01 02:25:40 +0000 +++ src/dispnew.c 2014-10-01 03:28:16 +0000 @@ -6100,15 +6100,12 @@ (*initial_terminal->delete_terminal_hook) (initial_terminal); /* Update frame parameters to reflect the new type. */ - Fmodify_frame_parameters - (selected_frame, FRAME_PARAMETER (Qtty_type, - Ftty_type (selected_frame))); - if (t->display_info.tty->name) - Fmodify_frame_parameters - (selected_frame, - FRAME_PARAMETER (Qtty, build_string (t->display_info.tty->name))); - else - Fmodify_frame_parameters (selected_frame, FRAME_PARAMETER (Qtty, Qnil)); + AUTO_FRAME_ARG (tty_type_arg, Qtty_type, Ftty_type (selected_frame)); + Fmodify_frame_parameters (selected_frame, tty_type_arg); + AUTO_FRAME_ARG (tty_arg, Qtty, (t->display_info.tty->name + ? build_string (t->display_info.tty->name) + : Qnil)); + Fmodify_frame_parameters (selected_frame, tty_arg); } { === modified file 'src/doc.c' --- src/doc.c 2014-09-30 02:43:23 +0000 +++ src/doc.c 2014-10-01 03:28:16 +0000 @@ -146,8 +146,9 @@ if (fd < 0) { SAFE_FREE (); - return concat3 (SCOPED_STRING ("Cannot open doc string file \""), - file, SCOPED_STRING ("\"\n")); + AUTO_STRING (cannot_open, "Cannot open doc string file \""); + AUTO_STRING (quote_nl, "\"\n"); + return concat3 (cannot_open, file, quote_nl); } } count = SPECPDL_INDEX (); === modified file 'src/editfns.c' --- src/editfns.c 2014-09-30 02:43:23 +0000 +++ src/editfns.c 2014-10-01 03:28:16 +0000 @@ -4362,7 +4362,8 @@ Lisp_Object format2 (const char *string1, Lisp_Object arg0, Lisp_Object arg1) { - return Fformat (3, (Lisp_Object []) { SCOPED_STRING (string1), arg0, arg1 }); + AUTO_STRING (format, string1); + return Fformat (3, (Lisp_Object []) {format, arg0, arg1}); } DEFUN ("char-equal", Fchar_equal, Schar_equal, 2, 2, 0, === modified file 'src/emacs.c' --- src/emacs.c 2014-09-30 02:43:23 +0000 +++ src/emacs.c 2014-10-01 03:28:16 +0000 @@ -400,6 +400,7 @@ Lisp_Object name, dir, handler; ptrdiff_t count = SPECPDL_INDEX (); Lisp_Object raw_name; + AUTO_STRING (slash_colon, "/:"); initial_argv = argv; initial_argc = argc; @@ -423,7 +424,7 @@ if it would otherwise be treated as magic. */ handler = Ffind_file_name_handler (raw_name, Qt); if (! NILP (handler)) - raw_name = concat2 (SCOPED_STRING ("/:"), raw_name); + raw_name = concat2 (slash_colon, raw_name); Vinvocation_name = Ffile_name_nondirectory (raw_name); Vinvocation_directory = Ffile_name_directory (raw_name); @@ -441,7 +442,7 @@ if it would otherwise be treated as magic. */ handler = Ffind_file_name_handler (found, Qt); if (! NILP (handler)) - found = concat2 (SCOPED_STRING ("/:"), found); + found = concat2 (slash_colon, found); Vinvocation_directory = Ffile_name_directory (found); } } @@ -2323,7 +2324,10 @@ } if (! NILP (tem)) - element = concat2 (SCOPED_STRING ("/:"), element); + { + AUTO_STRING (slash_colon, "/:"); + element = concat2 (slash_colon, element); + } } /* !NILP (element) */ lpath = Fcons (element, lpath); === modified file 'src/fileio.c' --- src/fileio.c 2014-09-30 02:43:23 +0000 +++ src/fileio.c 2014-10-01 03:28:16 +0000 @@ -1111,7 +1111,8 @@ name = make_specified_string (nm, -1, p - nm, multibyte); temp[0] = DRIVE_LETTER (drive); - name = concat2 (SCOPED_STRING (temp), name); + AUTO_STRING (drive_prefix, temp); + name = concat2 (drive_prefix, name); } #ifdef WINDOWSNT if (!NILP (Vw32_downcase_file_names)) @@ -5419,10 +5420,10 @@ ring_bell (XFRAME (selected_frame)); + AUTO_STRING (format, "Auto-saving %s: %s"); msg = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING ("Auto-saving %s: %s"), - BVAR (current_buffer, name), - Ferror_message_string (error_val) })); + {format, BVAR (current_buffer, name), + Ferror_message_string (error_val)})); GCPRO1 (msg); for (i = 0; i < 3; ++i) === modified file 'src/fns.c' --- src/fns.c 2014-09-30 02:43:23 +0000 +++ src/fns.c 2014-10-01 03:28:16 +0000 @@ -2725,8 +2725,8 @@ return obj; } - prompt = Fconcat (2, ((Lisp_Object []) - { prompt, SCOPED_STRING ("(yes or no) ") })); + AUTO_STRING (yes_or_no, "(yes or no) "); + prompt = Fconcat (2, (Lisp_Object []) {prompt, yes_or_no}); GCPRO1 (prompt); while (1) === modified file 'src/font.c' --- src/font.c 2014-09-30 02:43:23 +0000 +++ src/font.c 2014-10-01 03:28:16 +0000 @@ -1187,13 +1187,22 @@ { val = prop[XLFD_ENCODING_INDEX]; if (! NILP (val)) - val = concat2 (SCOPED_STRING ("*-"), SYMBOL_NAME (val)); + { + AUTO_STRING (stardash, "*-"); + val = concat2 (stardash, SYMBOL_NAME (val)); + } } else if (NILP (prop[XLFD_ENCODING_INDEX])) - val = concat2 (SYMBOL_NAME (val), SCOPED_STRING ("-*")); + { + AUTO_STRING (dashstar, "-*"); + val = concat2 (SYMBOL_NAME (val), dashstar); + } else - val = concat3 (SYMBOL_NAME (val), SCOPED_STRING ("-"), - SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); + { + AUTO_STRING (dash, "-"); + val = concat3 (SYMBOL_NAME (val), dash, + SYMBOL_NAME (prop[XLFD_ENCODING_INDEX])); + } if (! NILP (val)) ASET (font, FONT_REGISTRY_INDEX, Fintern (val, Qnil)); @@ -1789,10 +1798,8 @@ p1 = strchr (p0, '-'); if (! p1) { - if (SDATA (registry)[len - 1] == '*') - registry = concat2 (registry, SCOPED_STRING ("-*")); - else - registry = concat2 (registry, SCOPED_STRING ("*-*")); + AUTO_STRING (extra, ("*-*" + (len && p0[len - 1] == '*'))); + registry = concat2 (registry, extra); } registry = Fdowncase (registry); ASET (font_spec, FONT_REGISTRY_INDEX, Fintern (registry, Qnil)); @@ -5019,7 +5026,7 @@ if (FONTP (arg)) { Lisp_Object tail, elt; - Lisp_Object equalstr = SCOPED_STRING ("="); + AUTO_STRING (equalstr, "="); val = Ffont_xlfd_name (arg, Qt); for (tail = AREF (arg, FONT_EXTRA_INDEX); CONSP (tail); @@ -5052,8 +5059,11 @@ { val = Ffont_xlfd_name (result, Qt); if (! FONT_SPEC_P (result)) - val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), - SCOPED_STRING (":"), val); + { + AUTO_STRING (colon, ":"); + val = concat3 (SYMBOL_NAME (AREF (result, FONT_TYPE_INDEX)), + colon, val); + } result = val; } else if (CONSP (result)) === modified file 'src/fontset.c' --- src/fontset.c 2014-09-30 02:43:23 +0000 +++ src/fontset.c 2014-10-01 03:28:16 +0000 @@ -1462,8 +1462,8 @@ registry = AREF (font_spec, FONT_REGISTRY_INDEX); if (! NILP (registry)) registry = Fdowncase (SYMBOL_NAME (registry)); - encoding = find_font_encoding (concat3 (family, SCOPED_STRING ("-"), - registry)); + AUTO_STRING (dash, "-"); + encoding = find_font_encoding (concat3 (family, dash, registry)); if (NILP (encoding)) encoding = Qascii; @@ -1575,7 +1575,7 @@ if (ascii_changed) { - Lisp_Object tail, fr, alist; + Lisp_Object tail, fr; int fontset_id = XINT (FONTSET_ID (fontset)); set_fontset_ascii (fontset, fontname); @@ -1598,8 +1598,8 @@ if (! NILP (font_object)) { update_auto_fontset_alist (font_object, fontset); - alist = FRAME_PARAMETER (Qfont, Fcons (name, font_object)); - Fmodify_frame_parameters (fr, alist); + AUTO_FRAME_ARG (arg, Qfont, Fcons (name, font_object)); + Fmodify_frame_parameters (fr, arg); } } } === modified file 'src/frame.c' --- src/frame.c 2014-09-30 15:20:03 +0000 +++ src/frame.c 2014-10-01 03:28:16 +0000 @@ -4148,9 +4148,9 @@ { if (attribute && dpyinfo) { - tem = display_x_get_resource - (dpyinfo, SCOPED_STRING (attribute), - SCOPED_STRING (class), Qnil, Qnil); + AUTO_STRING (at, attribute); + AUTO_STRING (cl, class); + tem = display_x_get_resource (dpyinfo, at, cl, Qnil, Qnil); if (NILP (tem)) return Qunbound; @@ -4260,7 +4260,8 @@ tem = x_frame_get_arg (f, alist, prop, xprop, xclass, type); if (EQ (tem, Qunbound)) tem = deflt; - x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem)); + AUTO_FRAME_ARG (arg, prop, tem); + x_set_frame_parameters (f, arg); return tem; } === modified file 'src/frame.h' --- src/frame.h 2014-09-21 22:49:24 +0000 +++ src/frame.h 2014-10-01 03:28:16 +0000 @@ -1062,8 +1062,8 @@ /* Handy macro to construct an argument to Fmodify_frame_parameters. */ -#define FRAME_PARAMETER(parameter, value) \ - scoped_list1 (scoped_cons (parameter, value)) +#define AUTO_FRAME_ARG(name, parameter, value) \ + AUTO_LIST1 (name, AUTO_CONS_EXPR (parameter, value)) /* False means there are no visible garbaged frames. */ extern bool frame_garbaged; === modified file 'src/keyboard.c' --- src/keyboard.c 2014-09-30 02:43:23 +0000 +++ src/keyboard.c 2014-10-01 03:28:16 +0000 @@ -551,6 +551,7 @@ /* Replace a dash from echo_dash with a space, otherwise add a space at the end as a separator between keys. */ + AUTO_STRING (space, " "); if (STRINGP (echo_string) && SCHARS (echo_string) > 1) { Lisp_Object last_char, prev_char, idx; @@ -566,10 +567,10 @@ if (XINT (last_char) == '-' && XINT (prev_char) != ' ') Faset (echo_string, idx, make_number (' ')); else - echo_string = concat2 (echo_string, SCOPED_STRING (" ")); + echo_string = concat2 (echo_string, space); } else if (STRINGP (echo_string) && SCHARS (echo_string) > 0) - echo_string = concat2 (echo_string, SCOPED_STRING (" ")); + echo_string = concat2 (echo_string, space); kset_echo_string (current_kboard, @@ -630,9 +631,9 @@ /* Put a dash at the end of the buffer temporarily, but make it go away when the next character is added. */ - kset_echo_string - (current_kboard, - concat2 (KVAR (current_kboard, echo_string), SCOPED_STRING ("-"))); + AUTO_STRING (dash, "-"); + kset_echo_string (current_kboard, + concat2 (KVAR (current_kboard, echo_string), dash)); echo_now (); } @@ -1890,13 +1891,11 @@ static Lisp_Object safe_run_hooks_error (Lisp_Object error, ptrdiff_t nargs, Lisp_Object *args) { - Lisp_Object hook, fun; - eassert (nargs == 2); - hook = args[0]; - fun = args[1]; - Fmessage (4, ((Lisp_Object []) - { SCOPED_STRING ("Error in %s (%S): %S"), hook, fun, error })); + AUTO_STRING (format, "Error in %s (%S): %S"); + Lisp_Object hook = args[0]; + Lisp_Object fun = args[1]; + Fmessage (4, (Lisp_Object []) {format, hook, fun, error}); if (SYMBOLP (hook)) { @@ -7885,12 +7884,12 @@ { /* This is a command. See if there is an equivalent key binding. */ Lisp_Object keyeq = AREF (item_properties, ITEM_PROPERTY_KEYEQ); + AUTO_STRING (space_space, " "); /* The previous code preferred :key-sequence to :keys, so we preserve this behavior. */ if (STRINGP (keyeq) && !CONSP (keyhint)) - keyeq = concat2 (SCOPED_STRING (" "), - Fsubstitute_command_keys (keyeq)); + keyeq = concat2 (space_space, Fsubstitute_command_keys (keyeq)); else { Lisp_Object prefix = keyeq; @@ -7933,7 +7932,7 @@ if (STRINGP (XCDR (prefix))) tem = concat2 (tem, XCDR (prefix)); } - keyeq = concat2 (SCOPED_STRING (" "), tem); + keyeq = concat2 (space_space, tem); } else keyeq = Qnil; @@ -8637,10 +8636,14 @@ /* Insert button prefix. */ Lisp_Object selected = AREF (item_properties, ITEM_PROPERTY_SELECTED); + AUTO_STRING (radio_yes, "(*) "); + AUTO_STRING (radio_no , "( ) "); + AUTO_STRING (check_yes, "[X] "); + AUTO_STRING (check_no , "[ ] "); if (EQ (tem, QCradio)) - tem = SCOPED_STRING (NILP (selected) ? "(*) " : "( ) "); + tem = NILP (selected) ? radio_yes : radio_no; else - tem = SCOPED_STRING (NILP (selected) ? "[X] " : "[ ] "); + tem = NILP (selected) ? check_yes : check_no; s = concat2 (tem, s); } === modified file 'src/keymap.c' --- src/keymap.c 2014-09-30 02:43:23 +0000 +++ src/keymap.c 2014-10-01 03:28:16 +0000 @@ -1299,7 +1299,8 @@ static Lisp_Object append_key (Lisp_Object key_sequence, Lisp_Object key) { - return Fvconcat (2, ((Lisp_Object []) { key_sequence, scoped_list1 (key) })); + AUTO_LIST1 (key_list, key); + return Fvconcat (2, ((Lisp_Object []) { key_sequence, key_list })); } /* Given a event type C which is a symbol, @@ -1338,7 +1339,8 @@ *p = 0; c = reorder_modifiers (c); - keystring = concat2 (SCOPED_STRING (new_mods), XCDR (assoc)); + AUTO_STRING (new_modstring, new_mods); + keystring = concat2 (new_modstring, XCDR (assoc)); error ("To bind the key %s, use [?%s], not [%s]", SDATA (SYMBOL_NAME (c)), SDATA (keystring), @@ -2242,9 +2244,12 @@ if (CONSP (key) && INTEGERP (XCAR (key)) && INTEGERP (XCDR (key))) /* An interval from a map-char-table. */ - return concat3 (Fsingle_key_description (XCAR (key), no_angles), - SCOPED_STRING (".."), - Fsingle_key_description (XCDR (key), no_angles)); + { + AUTO_STRING (dotdot, ".."); + return concat3 (Fsingle_key_description (XCAR (key), no_angles), + dotdot, + Fsingle_key_description (XCDR (key), no_angles)); + } key = EVENT_HEAD (key); @@ -3439,9 +3444,9 @@ /* Call Fkey_description first, to avoid GC bug for the other string. */ if (!NILP (prefix) && XFASTINT (Flength (prefix)) > 0) { - Lisp_Object tem; - tem = Fkey_description (prefix, Qnil); - elt_prefix = concat2 (tem, SCOPED_STRING (" ")); + Lisp_Object tem = Fkey_description (prefix, Qnil); + AUTO_STRING (space, " "); + elt_prefix = concat2 (tem, space); } prefix = Qnil; } === modified file 'src/lisp.h' --- src/lisp.h 2014-09-30 02:43:23 +0000 +++ src/lisp.h 2014-10-01 03:28:16 +0000 @@ -4625,24 +4625,36 @@ && alignof (union Aligned_String) % GCALIGNMENT == 0) }; -/* Build a stack-based Lisp cons or short list if possible, a GC-based - one otherwise. The resulting object should not be modified or made - visible to user code. */ - -#define scoped_cons(a, b) \ - (USE_STACK_CONS \ - ? make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) \ - : Fcons (a, b)) -#define scoped_list1(a) \ - (USE_STACK_CONS ? scoped_cons (a, Qnil) : list1 (a)) -#define scoped_list2(a, b) \ - (USE_STACK_CONS ? scoped_cons (a, scoped_list1 (b)) : list2 (a,b)) -#define scoped_list3(a, b, c) \ - (USE_STACK_CONS ? scoped_cons (a, scoped_list2 (b, c)) : list3 (a, b, c)) -#define scoped_list4(a, b, c, d) \ - (USE_STACK_CONS \ - ? scoped_cons (a, scoped_list3 (b, c, d)) : \ - list4 (a, b, c, d)) +/* Auxiliary macros used for auto allocation of Lisp objects. Please + use these only in macros like AUTO_CONS that declare a local + variable whose lifetime will be clear to the programmer. */ +#define STACK_CONS(a, b) \ + make_lisp_ptr (&(union Aligned_Cons) { { a, { b } } }.s, Lisp_Cons) +#define AUTO_CONS_EXPR(a, b) \ + (USE_STACK_CONS ? STACK_CONS (a, b) : Fcons (a, b)) + +/* Declare NAME as an auto Lisp cons or short list if possible, a + GC-based one otherwise. This is in the sense of the C keyword + 'auto'; i.e., the object has the lifetime of the containing block. + The resulting object should not be made visible to user Lisp code. */ + +#define AUTO_CONS(name, a, b) Lisp_Object name = AUTO_CONS_EXPR (a, b) +#define AUTO_LIST1(name, a) \ + Lisp_Object name = (USE_STACK_CONS ? STACK_CONS (a, Qnil) : list1 (a)) +#define AUTO_LIST2(name, a, b) \ + Lisp_Object name = (USE_STACK_CONS \ + ? STACK_CONS (a, STACK_CONS (b, Qnil)) \ + : list2 (a, b)) +#define AUTO_LIST3(name, a, b, c) \ + Lisp_Object name = (USE_STACK_CONS \ + ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, Qnil))) \ + : list3 (a, b, c)) +#define AUTO_LIST4(name, a, b, c, d) \ + Lisp_Object name \ + = (USE_STACK_CONS \ + ? STACK_CONS (a, STACK_CONS (b, STACK_CONS (c, \ + STACK_CONS (d, Qnil)))) \ + : list4 (a, b, c, d)) /* Check whether stack-allocated strings are ASCII-only. */ @@ -4652,18 +4664,19 @@ # define verify_ascii(str) (str) #endif -/* Build a stack-based Lisp string from STR if possible, a GC-based - one if not. STR is not necessarily copied and should contain only - ASCII characters. The resulting Lisp string should not be modified - or made visible to user code. */ +/* Declare NAME as an auto Lisp string if possible, a GC-based one if not. + Take its value from STR. STR is not necessarily copied and should + contain only ASCII characters. The resulting Lisp string should + not be modified or made visible to user code. */ -#define SCOPED_STRING(str) \ - (USE_STACK_STRING \ - ? (make_lisp_ptr \ - ((&(union Aligned_String) \ - { { strlen (str), -1, 0, (unsigned char *) verify_ascii (str) } }.s), \ - Lisp_String)) \ - : build_string (verify_ascii (str))) +#define AUTO_STRING(name, str) \ + Lisp_Object name = \ + (USE_STACK_STRING \ + ? (make_lisp_ptr \ + ((&(union Aligned_String) \ + {{strlen (str), -1, 0, (unsigned char *) verify_ascii (str)}}.s), \ + Lisp_String)) \ + : build_string (verify_ascii (str))) /* Loop over all tails of a list, checking for cycles. FIXME: Make tortoise and n internal declarations. === modified file 'src/lread.c' --- src/lread.c 2014-09-30 02:43:23 +0000 +++ src/lread.c 2014-10-01 03:28:16 +0000 @@ -969,9 +969,10 @@ load_warn_old_style_backquotes (Lisp_Object file) { if (!NILP (Vold_style_backquotes)) - Fmessage (2, ((Lisp_Object []) - { SCOPED_STRING ("Loading `%s': old-style backquotes detected!"), - file })); + { + AUTO_STRING (format, "Loading `%s': old-style backquotes detected!"); + Fmessage (2, (Lisp_Object []) {format, file}); + } } DEFUN ("get-load-suffixes", Fget_load_suffixes, Sget_load_suffixes, 0, 0, 0, @@ -2888,11 +2889,8 @@ if (c == '=') { /* Make a placeholder for #n# to use temporarily. */ - Lisp_Object placeholder; - Lisp_Object cell; - - placeholder = scoped_cons (Qnil, Qnil); - cell = Fcons (make_number (n), placeholder); + AUTO_CONS (placeholder, Qnil, Qnil); + Lisp_Object cell = Fcons (make_number (n), placeholder); read_objects = Fcons (cell, read_objects); /* Read the object itself. */ @@ -3371,7 +3369,7 @@ substitute_in_interval contains part of the logic. */ INTERVAL root_interval = string_intervals (subtree); - Lisp_Object arg = scoped_cons (object, placeholder); + AUTO_CONS (arg, object, placeholder); traverse_intervals_noorder (root_interval, &substitute_in_interval, arg); @@ -3678,8 +3676,10 @@ in the installed Lisp directory. We don't use Fexpand_file_name because that would make the directory absolute now. */ - elt = concat2 (SCOPED_STRING ("../lisp/"), - Ffile_name_nondirectory (elt)); + { + AUTO_STRING (dotdotlisp, "../lisp/"); + elt = concat2 (dotdotlisp, Ffile_name_nondirectory (elt)); + } } else if (EQ (elt, Vload_file_name) && ! NILP (elt) === modified file 'src/menu.c' --- src/menu.c 2014-09-30 02:43:23 +0000 +++ src/menu.c 2014-10-01 03:28:16 +0000 @@ -389,8 +389,11 @@ { if (!submenu && SREF (tem, 0) != '\0' && SREF (tem, 0) != '-') - ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, - concat2 (SCOPED_STRING (" "), tem)); + { + AUTO_STRING (spaces, " "); + ASET (menu_items, idx + MENU_ITEMS_ITEM_NAME, + concat2 (spaces, tem)); + } idx += MENU_ITEMS_ITEM_LENGTH; } } @@ -409,14 +412,20 @@ prefix = " "; if (prefix) - item_string = concat2 (SCOPED_STRING (prefix), item_string); + { + AUTO_STRING (prefix_obj, prefix); + item_string = concat2 (prefix_obj, item_string); + } } if ((FRAME_TERMCAP_P (XFRAME (Vmenu_updating_frame)) || FRAME_MSDOS_P (XFRAME (Vmenu_updating_frame))) && !NILP (map)) /* Indicate visually that this is a submenu. */ - item_string = concat2 (item_string, SCOPED_STRING (" >")); + { + AUTO_STRING (space_gt, " >"); + item_string = concat2 (item_string, space_gt); + } push_menu_item (item_string, enabled, key, AREF (item_properties, ITEM_PROPERTY_DEF), === modified file 'src/minibuf.c' --- src/minibuf.c 2014-09-30 02:43:23 +0000 +++ src/minibuf.c 2014-10-01 03:28:16 +0000 @@ -1157,9 +1157,10 @@ STRING_MULTIBYTE (prompt)); } + AUTO_STRING (format, "%s (default %s): "); prompt = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING ("%s (default %s): "), - prompt, CONSP (def) ? XCAR (def) : def })); + {format, prompt, + CONSP (def) ? XCAR (def) : def})); } result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), === modified file 'src/process.c' --- src/process.c 2014-09-30 02:43:23 +0000 +++ src/process.c 2014-10-01 03:28:16 +0000 @@ -596,7 +596,7 @@ Lisp_Object symbol; int code; bool coredump; - Lisp_Object string, string2; + Lisp_Object string; decode_status (status, &symbol, &code, &coredump); @@ -620,8 +620,8 @@ if (c1 != c2) Faset (string, make_number (0), make_number (c2)); } - string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); - return concat2 (string, string2); + AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n"); + return concat2 (string, suffix); } else if (EQ (symbol, Qexit)) { @@ -629,17 +629,17 @@ return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); if (code == 0) return build_string ("finished\n"); + AUTO_STRING (prefix, "exited abnormally with code "); string = Fnumber_to_string (make_number (code)); - string2 = SCOPED_STRING (coredump ? " (core dumped)\n" : "\n"); - return concat3 (SCOPED_STRING ("exited abnormally with code "), - string, string2); + AUTO_STRING (suffix, coredump ? " (core dumped)\n" : "\n"); + return concat3 (prefix, string, suffix); } else if (EQ (symbol, Qfailed)) { + AUTO_STRING (prefix, "failed with code "); string = Fnumber_to_string (make_number (code)); - string2 = SCOPED_STRING ("\n"); - return concat3 (SCOPED_STRING ("failed with code "), - string, string2); + AUTO_STRING (suffix, "\n"); + return concat3 (prefix, string, suffix); } else return Fcopy_sequence (Fsymbol_name (symbol)); @@ -1327,7 +1327,8 @@ else return Qnil; - args[0] = SCOPED_STRING (format); + AUTO_STRING (format_obj, format); + args[0] = format_obj; for (i = 0; i < nargs; i++) { @@ -1346,8 +1347,10 @@ } if (CONSP (address)) - return Fformat (2, ((Lisp_Object []) - { SCOPED_STRING (""), Fcar (address) })); + { + AUTO_STRING (format, ""); + return Fformat (2, (Lisp_Object []) {format, Fcar (address)}); + } return Qnil; } @@ -4062,12 +4065,13 @@ { unsigned char *ip = (unsigned char *)&saddr.in.sin_addr.s_addr; + AUTO_STRING (ipv4_format, "%d.%d.%d.%d"); host = Fformat (5, ((Lisp_Object []) - { SCOPED_STRING ("%d.%d.%d.%d"), make_number (ip[0]), + { ipv4_format, make_number (ip[0]), make_number (ip[1]), make_number (ip[2]), make_number (ip[3]) })); service = make_number (ntohs (saddr.in.sin_port)); - caller = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING (" <%s:%d>"), host, service })); + AUTO_STRING (caller_format, " <%s:%d>"); + caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); } break; @@ -4078,13 +4082,14 @@ uint16_t *ip6 = (uint16_t *)&saddr.in6.sin6_addr; int i; - args[0] = SCOPED_STRING ("%x:%x:%x:%x:%x:%x:%x:%x"); + AUTO_STRING (ipv6_format, "%x:%x:%x:%x:%x:%x:%x:%x"); + args[0] = ipv6_format; for (i = 0; i < 8; i++) args[i + 1] = make_number (ntohs (ip6[i])); host = Fformat (9, args); service = make_number (ntohs (saddr.in.sin_port)); - caller = Fformat (3, ((Lisp_Object []) - { SCOPED_STRING (" <[%s]:%d>"), host, service })); + AUTO_STRING (caller_format, " <[%s]:%d>"); + caller = Fformat (3, (Lisp_Object []) {caller_format, host, service}); } break; #endif @@ -4094,8 +4099,9 @@ #endif default: caller = Fnumber_to_string (make_number (connect_counter)); - caller = concat3 - (SCOPED_STRING (" <"), caller, SCOPED_STRING (">")); + AUTO_STRING (space_lessthan, " <"); + AUTO_STRING (greaterthan, ">"); + caller = concat3 (space_lessthan, caller, greaterthan); break; } @@ -4192,16 +4198,18 @@ p->inherit_coding_system_flag = (NILP (buffer) ? 0 : ps->inherit_coding_system_flag); + AUTO_STRING (dash, "-"); + AUTO_STRING (nl, "\n"); + Lisp_Object host_string = STRINGP (host) ? host : dash; + if (!NILP (ps->log)) - call3 (ps->log, server, proc, - concat3 (SCOPED_STRING ("accept from "), - (STRINGP (host) ? host : SCOPED_STRING ("-")), - SCOPED_STRING ("\n"))); + { + AUTO_STRING (accept_from, "accept from "); + call3 (ps->log, server, proc, concat3 (accept_from, host_string, nl)); + } - exec_sentinel (proc, - concat3 (SCOPED_STRING ("open from "), - (STRINGP (host) ? host : SCOPED_STRING ("-")), - SCOPED_STRING ("\n"))); + AUTO_STRING (open_from, "open from "); + exec_sentinel (proc, concat3 (open_from, host_string, nl)); } /* This variable is different from waiting_for_input in keyboard.c. === modified file 'src/textprop.c' --- src/textprop.c 2014-09-29 06:44:31 +0000 +++ src/textprop.c 2014-10-01 03:28:16 +0000 @@ -1320,7 +1320,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object property, Lisp_Object value, Lisp_Object object) { - Fadd_text_properties (start, end, scoped_list2 (property, value), object); + AUTO_LIST2 (properties, property, value); + Fadd_text_properties (start, end, properties, object); return Qnil; } @@ -1361,7 +1362,8 @@ (Lisp_Object start, Lisp_Object end, Lisp_Object face, Lisp_Object append, Lisp_Object object) { - add_text_properties_1 (start, end, scoped_list2 (Qface, face), object, + AUTO_LIST2 (properties, Qface, face); + add_text_properties_1 (start, end, properties, object, (NILP (append) ? TEXT_PROPERTY_PREPEND : TEXT_PROPERTY_APPEND)); === modified file 'src/xdisp.c' --- src/xdisp.c 2014-09-30 23:19:31 +0000 +++ src/xdisp.c 2014-10-01 03:28:16 +0000 @@ -12070,7 +12070,7 @@ (f, Fmake_string (make_number (size_needed), make_number (' '))); else { - Lisp_Object props = scoped_list4 (Qdisplay, Qnil, Qmenu_item, Qnil); + AUTO_LIST4 (props, Qdisplay, Qnil, Qmenu_item, Qnil); struct gcpro gcpro1; GCPRO1 (props); Fremove_text_properties (make_number (0), make_number (size), @@ -12186,9 +12186,8 @@ the start of this item's properties in the tool-bar items vector. */ image = Fcons (Qimage, plist); - Lisp_Object props - = scoped_list4 (Qdisplay, image, Qmenu_item, - make_number (i * TOOL_BAR_ITEM_NSLOTS)); + AUTO_LIST4 (props, Qdisplay, image, Qmenu_item, + make_number (i * TOOL_BAR_ITEM_NSLOTS)); struct gcpro gcpro1; GCPRO1 (props); @@ -20966,7 +20965,8 @@ the previous non-empty line. */ if (pos >= ZV && pos > BEGV) DEC_BOTH (pos, bytepos); - if (fast_looking_at (SCOPED_STRING ("[\f\t ]*\n"), + AUTO_STRING (trailing_white_space, "[\f\t ]*\n"); + if (fast_looking_at (trailing_white_space, pos, bytepos, ZV, ZV_BYTE, Qnil) > 0) { while ((c = FETCH_BYTE (bytepos)) == '\n' === modified file 'src/xfaces.c' --- src/xfaces.c 2014-09-18 11:34:24 +0000 +++ src/xfaces.c 2014-10-01 03:28:16 +0000 @@ -3398,7 +3398,8 @@ ASET (lface, LFACE_FONT_INDEX, font); } f->default_face_done_p = 0; - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, font)); + AUTO_FRAME_ARG (arg, Qfont, font); + Fmodify_frame_parameters (frame, arg); } } @@ -3787,18 +3788,23 @@ && newface->font) { Lisp_Object name = newface->font->props[FONT_NAME_INDEX]; - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qfont, name)); + AUTO_FRAME_ARG (arg, Qfont, name); + Fmodify_frame_parameters (frame, arg); } if (STRINGP (gvec[LFACE_FOREGROUND_INDEX])) - Fmodify_frame_parameters - (frame, FRAME_PARAMETER (Qforeground_color, - gvec[LFACE_FOREGROUND_INDEX])); + { + AUTO_FRAME_ARG (arg, Qforeground_color, + gvec[LFACE_FOREGROUND_INDEX]); + Fmodify_frame_parameters (frame, arg); + } if (STRINGP (gvec[LFACE_BACKGROUND_INDEX])) - Fmodify_frame_parameters - (frame, FRAME_PARAMETER (Qbackground_color, - gvec[LFACE_BACKGROUND_INDEX])); + { + AUTO_FRAME_ARG (arg, Qbackground_color, + gvec[LFACE_BACKGROUND_INDEX]); + Fmodify_frame_parameters (frame, arg); + } } } === modified file 'src/xfns.c' --- src/xfns.c 2014-09-30 02:43:23 +0000 +++ src/xfns.c 2014-10-01 03:28:16 +0000 @@ -1569,11 +1569,14 @@ /* See if an X resource for the scroll bar color has been specified. */ - tem = display_x_get_resource - (dpyinfo, SCOPED_STRING (foreground_p ? "foreground" : "background"), - empty_unibyte_string, - SCOPED_STRING ("verticalScrollBar"), - empty_unibyte_string); + AUTO_STRING (foreground, "foreground"); + AUTO_STRING (background, "foreground"); + AUTO_STRING (verticalScrollBar, "verticalScrollBar"); + tem = (display_x_get_resource + (dpyinfo, foreground_p ? foreground : background, + empty_unibyte_string, + verticalScrollBar, + empty_unibyte_string)); if (!STRINGP (tem)) { /* If nothing has been specified, scroll bars will use a @@ -1591,7 +1594,8 @@ #endif /* not USE_TOOLKIT_SCROLL_BARS */ } - x_set_frame_parameters (f, FRAME_PARAMETER (prop, tem)); + AUTO_FRAME_ARG (arg, prop, tem); + x_set_frame_parameters (f, arg); return tem; } @@ -2843,7 +2847,8 @@ { /* Remember the explicit font parameter, so we can re-apply it after we've applied the `default' face settings. */ - x_set_frame_parameters (f, FRAME_PARAMETER (Qfont_param, font_param)); + AUTO_FRAME_ARG (arg, Qfont_param, font_param); + x_set_frame_parameters (f, arg); } /* This call will make X resources override any system font setting. */ @@ -4272,9 +4277,10 @@ Screen *screen = dpyinfo->screen; /* See if a visual is specified. */ - Lisp_Object value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("visualClass"), - SCOPED_STRING ("VisualClass"), Qnil, Qnil); + AUTO_STRING (visualClass, "visualClass"); + AUTO_STRING (VisualClass, "VisualClass"); + Lisp_Object value = display_x_get_resource (dpyinfo, visualClass, + VisualClass, Qnil, Qnil); if (STRINGP (value)) { @@ -5033,7 +5039,10 @@ /* Add `tooltip' frame parameter's default value. */ if (NILP (Fframe_parameter (frame, Qtooltip))) - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qtooltip, Qt)); + { + AUTO_FRAME_ARG (arg, Qtooltip, Qt); + Fmodify_frame_parameters (frame, arg); + } /* FIXME - can this be done in a similar way to normal frames? http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg00641.html */ @@ -5051,8 +5060,10 @@ disptype = intern ("color"); if (NILP (Fframe_parameter (frame, Qdisplay_type))) - Fmodify_frame_parameters - (frame, FRAME_PARAMETER (Qdisplay_type, disptype)); + { + AUTO_FRAME_ARG (arg, Qdisplay_type, disptype); + Fmodify_frame_parameters (frame, arg); + } } /* Set up faces after all frame parameters are known. This call @@ -5071,7 +5082,10 @@ call2 (Qface_set_after_frame_default, frame, Qnil); if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) - Fmodify_frame_parameters (frame, FRAME_PARAMETER (Qbackground_color, bg)); + { + AUTO_FRAME_ARG (arg, Qbackground_color, bg); + Fmodify_frame_parameters (frame, arg); + } } f->no_split = 1; === modified file 'src/xselect.c' --- src/xselect.c 2014-09-30 02:43:23 +0000 +++ src/xselect.c 2014-10-01 03:28:16 +0000 @@ -2159,10 +2159,9 @@ static Lisp_Object x_clipboard_manager_error_1 (Lisp_Object err) { - Fmessage (2, ((Lisp_Object []) - { SCOPED_STRING ("X clipboard manager error: %s\n\ -If the problem persists, set `x-select-enable-clipboard-manager' to nil."), - CAR (CDR (err)) })); + AUTO_STRING (format, "X clipboard manager error: %s\n\ +If the problem persists, set `x-select-enable-clipboard-manager' to nil."); + Fmessage (2, (Lisp_Object []) {format, CAR (CDR (err))}); return Qnil; } @@ -2229,9 +2228,8 @@ local_frame = XCAR (XCDR (XCDR (XCDR (local_selection)))); if (FRAME_LIVE_P (XFRAME (local_frame))) { - Fmessage (1, ((Lisp_Object []) - { SCOPED_STRING - ("Saving clipboard to X clipboard manager...") })); + AUTO_STRING (saving, "Saving clipboard to X clipboard manager..."); + Fmessage (1, &saving); internal_condition_case_1 (x_clipboard_manager_save, local_frame, Qt, x_clipboard_manager_error_2); } === modified file 'src/xterm.c' --- src/xterm.c 2014-09-30 15:31:18 +0000 +++ src/xterm.c 2014-10-01 03:28:16 +0000 @@ -10935,10 +10935,11 @@ { if (dpyinfo->visual->class == PseudoColor) { - Lisp_Object value; - value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("privateColormap"), - SCOPED_STRING ("PrivateColormap"), Qnil, Qnil); + AUTO_STRING (privateColormap, "privateColormap"); + AUTO_STRING (PrivateColormap, "PrivateColormap"); + Lisp_Object value + = display_x_get_resource (dpyinfo, privateColormap, + PrivateColormap, Qnil, Qnil); if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) @@ -11142,9 +11143,10 @@ /* See if we should run in synchronous mode. This is useful for debugging X code. */ { - Lisp_Object value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("synchronous"), - SCOPED_STRING ("Synchronous"), Qnil, Qnil); + AUTO_STRING (synchronous, "synchronous"); + AUTO_STRING (Synchronous, "Synchronous"); + Lisp_Object value = display_x_get_resource (dpyinfo, synchronous, + Synchronous, Qnil, Qnil); if (STRINGP (value) && (!strcmp (SSDATA (value), "true") || !strcmp (SSDATA (value), "on"))) @@ -11152,9 +11154,10 @@ } { - Lisp_Object value = display_x_get_resource - (dpyinfo, SCOPED_STRING ("useXIM"), - SCOPED_STRING ("UseXIM"), Qnil, Qnil); + AUTO_STRING (useXIM, "useXIM"); + AUTO_STRING (UseXIM, "UseXIM"); + Lisp_Object value = display_x_get_resource (dpyinfo, useXIM, UseXIM, + Qnil, Qnil); #ifdef USE_XIM if (STRINGP (value) && (!strcmp (SSDATA (value), "false")