diff --git a/ChangeLog b/ChangeLog index ab31d008d53..731d810b7c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,15 @@ -2011-05-28 Paul Eggert +2011-05-30 Paul Eggert Use 'inline', not 'INLINE'. * configure.in, autogen/config.in (INLINE): Remove. +2011-05-29 Paul Eggert + + Adjust to recent gnulib change for @GUARD_PREFIX@. + * lib/makefile.w32-in (getopt_h): Substitute @GUARD_PREFIX@, too. + All uses of _GL_ for guard prefixes in lib/*.h replaced with + _@GUARD_PREFIX@_. + 2011-05-27 Paul Eggert * doc/misc/texinfo.tex, lib/getopt.c, lib/intprops.h: Merge from gnulib. diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 87ef485518e..bd92b2a7273 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog @@ -1,3 +1,25 @@ +2011-05-29 Chong Yidong + + * help.texi (Accessing Documentation): + * display.texi (Pixel Specification): + * processes.texi (Serial Ports, Serial Ports): + * nonascii.texi (Character Properties, Default Coding Systems): + * text.texi (Changing Properties, Special Properties): + * windows.texi (Window Start and End): + * modes.texi (SMIE Indentation Example, SMIE Tricks): + * keymaps.texi (Searching Keymaps, Tool Bar): + * minibuf.texi (Basic Completion): + * compile.texi (Eval During Compile): + * strings.texi (Formatting Strings): Tweaks to avoid overflowing + 7x9 paper in printed manual. + + * lists.texi (Sets And Lists): Fix misplaced text. + +2011-05-29 Chong Yidong + + * keymaps.texi (Remapping Commands): Emphasize that the keymap + needs to be active (Bug#8350). + 2011-05-28 Chong Yidong * minibuf.texi (Reading File Names): Clarify (Bug#8480). diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi index f9f0e6662cf..fe5563370c4 100644 --- a/doc/lispref/compile.texi +++ b/doc/lispref/compile.texi @@ -445,7 +445,7 @@ used to load it for compiling, but not executing. For example, @lisp (eval-when-compile - (require 'my-macro-package)) ;; only macros needed from this + (require 'my-macro-package)) @end lisp The same sort of thing goes for macros and @code{defsubst} functions diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 338fd421994..199a20cc2cd 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -1441,9 +1441,9 @@ specify a particular attribute for certain text. @xref{Face Attributes}. @item -A cons cell, either of the form @code{(foreground-color . @var{color-name})} or -@code{(background-color . @var{color-name})}. These elements specify -just the foreground color or just the background color. +A cons cell, either of the form @code{(fg-color . @var{color-name})} +or @code{(bg-color . @var{color-name})}. These elements specify just +the foreground color or just the background color. @code{(foreground-color . @var{color-name})} has the same effect as @code{(:foreground @var{color-name})}; likewise for the background. @@ -3821,9 +3821,10 @@ pixels per inch, millimeter, and centimeter, respectively. The and height of the current face. An image specification @code{image} corresponds to the width or height of the image. - The @code{left-fringe}, @code{right-fringe}, @code{left-margin}, -@code{right-margin}, @code{scroll-bar}, and @code{text} elements -specify to the width of the corresponding area of the window. + The elements @code{left-fringe}, @code{right-fringe}, +@code{left-margin}, @code{right-margin}, @code{scroll-bar}, and +@code{text} specify to the width of the corresponding area of the +window. The @code{left}, @code{center}, and @code{right} positions can be used with @code{:align-to} to specify a position relative to the left @@ -4652,16 +4653,14 @@ If @var{no-error} is non-@code{nil} and a suitable path can't be found, don't signal an error. Instead, return a list of directories as before, except that @code{nil} appears in place of the image directory. -Here is an example that uses a common idiom to provide compatibility -with versions of Emacs that lack the variable @code{image-load-path}: +Here is an example of using @code{image-load-path-for-library}: @example (defvar image-load-path) ; shush compiler (let* ((load-path (image-load-path-for-library - "mh-e" "mh-logo.xpm")) + "mh-e" "mh-logo.xpm")) (image-load-path (cons (car load-path) - (when (boundp 'image-load-path) - image-load-path)))) + image-load-path))) (mh-tool-bar-folder-buttons-init)) @end example @end defun @@ -5399,8 +5398,10 @@ value) in various ways. (aref colorcomp-data 2))) (samp " (sample text) ")) (insert "Color\t: " - (propertize samp 'face `(foreground-color . ,cstr)) - (propertize samp 'face `(background-color . ,cstr)) + (propertize samp 'face + `(foreground-color . ,cstr)) + (propertize samp 'face + `(background-color . ,cstr)) "\n")))) (defun colorcomp (color) diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 259bb3cf86e..264d63511bc 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -14,7 +14,7 @@ @c in general, keep the following line commented out, unless doing a @c copy of this manual that will be published. The manual should go @c onto the distribution in the full, 8.5 x 11" size. -@c set smallbook +@c @smallbook @ifset smallbook @smallbook diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index e287e6fbad4..63fc06c929b 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi @@ -138,9 +138,9 @@ unless @var{verbatim} is non-@code{nil}. @end defun @defun documentation function &optional verbatim -This function returns the documentation string of @var{function}. -@code{documentation} handles macros, named keyboard macros, and -special forms, as well as ordinary functions. +This function returns the documentation string of @var{function}. It +handles macros, named keyboard macros, and special forms, as well as +ordinary functions. If @var{function} is a symbol, this function first looks for the @code{function-documentation} property of that symbol; if that has a diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 2ebce284fd3..d55cb299771 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi @@ -718,17 +718,18 @@ pseudo-Lisp description of the order and conditions for searching them: @lisp -(or (if overriding-terminal-local-map - (@var{find-in} overriding-terminal-local-map) - (if overriding-local-map - (@var{find-in} overriding-local-map) - (or (@var{find-in} (get-char-property (point) 'keymap)) - (@var{find-in-any} emulation-mode-map-alists) - (@var{find-in-any} minor-mode-overriding-map-alist) - (@var{find-in-any} minor-mode-map-alist) - (if (get-text-property (point) 'local-map) - (@var{find-in} (get-char-property (point) 'local-map)) - (@var{find-in} (current-local-map)))))) +(or (cond + (overriding-terminal-local-map + (@var{find-in} overriding-terminal-local-map)) + (overriding-local-map + (@var{find-in} overriding-local-map)) + (or (@var{find-in} (get-char-property (point) 'keymap)) + (@var{find-in-any} emulation-mode-map-alists) + (@var{find-in-any} minor-mode-overriding-map-alist) + (@var{find-in-any} minor-mode-map-alist) + (if (get-text-property (point) 'local-map) + (@var{find-in} (get-char-property (point) 'local-map)) + (@var{find-in} (current-local-map))))) (@var{find-in} (current-global-map))) @end lisp @@ -1468,33 +1469,33 @@ Dired mode is set up: @section Remapping Commands @cindex remapping commands - A special kind of key binding, using a special ``key sequence'' -which includes a command name, has the effect of @dfn{remapping} that -command into another. Here's how it works. You make a key binding -for a key sequence that starts with the dummy event @code{remap}, -followed by the command name you want to remap. Specify the remapped -definition as the definition in this binding. The remapped definition -is usually a command name, but it can be any valid definition for -a key binding. + A special kind of key binding can be used to @dfn{remap} one command +to another, without having to refer to the key sequence(s) bound to +the original command. To use this feature, make a key binding for a +key sequence that starts with the dummy event @code{remap}, followed +by the command name you want to remap; for the binding, specify the +new definition (usually a command name, but possibly any other valid +definition for a key binding). - Here's an example. Suppose that My mode uses special commands -@code{my-kill-line} and @code{my-kill-word}, which should be invoked -instead of @code{kill-line} and @code{kill-word}. It can establish -this by making these two command-remapping bindings in its keymap: + For example, suppose My mode provides a special command +@code{my-kill-line}, which should be invoked instead of +@code{kill-line}. To establish this, its mode keymap should contain +the following remapping: @smallexample (define-key my-mode-map [remap kill-line] 'my-kill-line) -(define-key my-mode-map [remap kill-word] 'my-kill-word) @end smallexample -Whenever @code{my-mode-map} is an active keymap, if the user types -@kbd{C-k}, Emacs will find the standard global binding of -@code{kill-line} (assuming nobody has changed it). But -@code{my-mode-map} remaps @code{kill-line} to @code{my-kill-line}, -so instead of running @code{kill-line}, Emacs runs -@code{my-kill-line}. +@noindent +Then, whenever @code{my-mode-map} is active, if the user types +@kbd{C-k} (the default global key sequence for @code{kill-line}) Emacs +will instead run @code{my-kill-line}. -Remapping only works through a single level. In other words, + Note that remapping only takes place through active keymaps; for +example, putting a remapping in a prefix keymap like @code{ctl-x-map} +typically has no effect, as such keymaps are not themselves active. +In addition, remapping only works through a single level; in the +following example, @smallexample (define-key my-mode-map [remap kill-line] 'my-kill-line) @@ -1502,11 +1503,10 @@ Remapping only works through a single level. In other words, @end smallexample @noindent -does not have the effect of remapping @code{kill-line} into -@code{my-other-kill-line}. If an ordinary key binding specifies -@code{kill-line}, this keymap will remap it to @code{my-kill-line}; -if an ordinary binding specifies @code{my-kill-line}, this keymap will -remap it to @code{my-other-kill-line}. +@code{kill-line} is @emph{not} remapped to @code{my-other-kill-line}. +Instead, if an ordinary key binding specifies @code{kill-line}, it is +remapped to @code{my-kill-line}; if an ordinary binding specifies +@code{my-kill-line}, it is remapped to @code{my-other-kill-line}. To undo the remapping of a command, remap it to @code{nil}; e.g. @@ -2636,8 +2636,8 @@ using an indirection through @code{tool-bar-map}. By default, the global map binds @code{[tool-bar]} as follows: @example (global-set-key [tool-bar] - '(menu-item "tool bar" ignore - :filter (lambda (ignore) tool-bar-map))) + '(menu-item "tool bar" ignore + :filter (lambda (ignore) tool-bar-map))) @end example @noindent Thus the tool bar map is derived dynamically from the value of variable diff --git a/doc/lispref/lists.texi b/doc/lispref/lists.texi index d27c609dc83..064be89632f 100644 --- a/doc/lispref/lists.texi +++ b/doc/lispref/lists.texi @@ -1355,10 +1355,10 @@ and the @code{(4)} in the @code{sample-list} are not @code{eq}: (delq '(4) sample-list) @result{} (a c (4)) @end group +@end example If you want to delete elements that are @code{equal} to a given value, use @code{delete} (see below). -@end example @defun remq object list This function returns a copy of @var{list}, with all elements removed diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 5336fef48ad..aa22e6c92ff 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -837,12 +837,13 @@ variable as ``risky'' with a non-@code{nil} @code{risky-local-variable} property. @xref{File Local Variables}. @defvar completion-ignore-case -If the value of this variable is non-@code{nil}, Emacs does not -consider case significant in completion. Note, however, that this -variable is overridden by @code{read-file-name-completion-ignore-case} -within @code{read-file-name} (@pxref{Reading File Names}), and by -@code{read-buffer-completion-ignore-case} within @code{read-buffer} -(@pxref{High-Level Completion}). +If the value of this variable is non-@code{nil}, case is not +considered significant in completion. Within @code{read-file-name}, +this variable is overridden by +@code{read-file-name-completion-ignore-case} (@pxref{Reading File +Names}); within @code{read-buffer}, it is overridden by +@code{read-buffer-completion-ignore-case} (@pxref{High-Level +Completion}). @end defvar @defvar completion-regexp-list diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 63ecf59e538..562cc76c3f0 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1046,8 +1046,8 @@ Turning on text-mode runs the hook `text-mode-hook'." @end group @group ;; @r{These four lines are absent from the current version} - ;; @r{not because this is done some other way, but rather} - ;; @r{because nowadays Text mode uses the normal definition of paragraphs.} + ;; @r{not because this is done some other way, but because} + ;; @r{nowadays Text mode uses the normal definition of paragraphs.} (set (make-local-variable 'paragraph-start) (concat "[ \t]*$\\|" page-delimiter)) (set (make-local-variable 'paragraph-separate) paragraph-start) @@ -1139,12 +1139,15 @@ modes should understand the Lisp conventions for comments. The rest of @smallexample @group - (set (make-local-variable 'paragraph-start) (concat page-delimiter "\\|$" )) - (set (make-local-variable 'paragraph-separate) paragraph-start) + (set (make-local-variable 'paragraph-start) + (concat page-delimiter "\\|$" )) + (set (make-local-variable 'paragraph-separate) + paragraph-start) @dots{} @end group @group - (set (make-local-variable 'comment-indent-function) 'lisp-comment-indent)) + (set (make-local-variable 'comment-indent-function) + 'lisp-comment-indent)) @dots{} @end group @end smallexample @@ -3619,7 +3622,9 @@ natural to have a BNF grammar that looks like this: (inst ("IF" exp "THEN" insts "ELSE" insts "END") ("CASE" exp "OF" cases "END") ...) - (cases (cases "|" cases) (caselabel ":" insts) ("ELSE" insts)) + (cases (cases "|" cases) + (caselabel ":" insts) + ("ELSE" insts)) ... @end example @@ -3894,9 +3899,10 @@ and is always at the beginning of a line, we can use a more efficient rule: @example ((equal token "if") - (and (not (smie-rule-bolp)) (smie-rule-prev-p "else") + (and (not (smie-rule-bolp)) + (smie-rule-prev-p "else") (save-excursion - (sample-smie-backward-token) ;Jump before the "else". + (sample-smie-backward-token) (cons 'column (current-column))))) @end example diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi index 0328dae9e7b..77337899923 100644 --- a/doc/lispref/nonascii.texi +++ b/doc/lispref/nonascii.texi @@ -374,18 +374,18 @@ properties that Emacs knows about: @table @code @item name -This property corresponds to the Unicode @code{Name} property. The -value is a string consisting of upper-case Latin letters A to Z, -digits, spaces, and hyphen @samp{-} characters. +Corresponds to the @code{Name} Unicode property. The value is a +string consisting of upper-case Latin letters A to Z, digits, spaces, +and hyphen @samp{-} characters. @cindex unicode general category @item general-category -This property corresponds to the Unicode @code{General_Category} -property. The value is a symbol whose name is a 2-letter abbreviation -of the character's classification. +Corresponds to the @code{General_Category} Unicode property. The +value is a symbol whose name is a 2-letter abbreviation of the +character's classification. @item canonical-combining-class -Corresponds to the Unicode @code{Canonical_Combining_Class} property. +Corresponds to the @code{Canonical_Combining_Class} Unicode property. The value is an integer number. @item bidi-class @@ -466,15 +466,18 @@ This function returns the value of @var{char}'s @var{propname} property. @result{} Nd @end group @group -(get-char-code-property ?\u2084 'digit-value) ; subscript 4 +;; subscript 4 +(get-char-code-property ?\u2084 'digit-value) @result{} 4 @end group @group -(get-char-code-property ?\u2155 'numeric-value) ; one fifth +;; one fifth +(get-char-code-property ?\u2155 'numeric-value) @result{} 0.2 @end group @group -(get-char-code-property ?\u2163 'numeric-value) ; Roman IV +;; Roman IV +(get-char-code-property ?\u2163 'numeric-value) @result{} 4 @end group @end example @@ -1449,11 +1452,11 @@ for decoding (in case @var{operation} does decoding), and @var{encoding-system} is the coding system for encoding (in case @var{operation} does encoding). -The argument @var{operation} is a symbol, one of @code{write-region}, -@code{start-process}, @code{call-process}, @code{call-process-region}, -@code{insert-file-contents}, or @code{open-network-stream}. These are -the names of the Emacs I/O primitives that can do character code and -eol conversion. +The argument @var{operation} is a symbol; it should be one of +@code{write-region}, @code{start-process}, @code{call-process}, +@code{call-process-region}, @code{insert-file-contents}, or +@code{open-network-stream}. These are the names of the Emacs I/O +primitives that can do character code and eol conversion. The remaining arguments should be the same arguments that might be given to the corresponding I/O primitive. Depending on the primitive, one diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index ba9d8accd4a..1a1b63683ce 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -1794,9 +1794,9 @@ nice values get scheduled more favorably.) The number of threads in the process. @item start -The time the process was started, in the @w{@code{(@var{high} -@var{low} @var{microsec})}} format used by @code{current-time} and -@code{file-attributes}. +The time when the process was started, in the same +@w{@code{(@var{high} @var{low} @var{microsec})}} format used by +@code{current-time} and @code{file-attributes}. @item etime The time elapsed since the process started, in the @w{@code{(@var{high} @@ -2482,25 +2482,17 @@ Install @var{plist} as the initial plist of the process. @itemx :parity @itemx :stopbits @itemx :flowcontrol -These arguments are handled by @code{serial-process-configure}, which -is called by @code{make-serial-process}. +These are handled by @code{serial-process-configure}, which is called +by @code{make-serial-process}. @end table The original argument list, possibly modified by later configuration, is available via the function @code{process-contact}. -Examples: +Here is an example: @example (make-serial-process :port "/dev/ttyS0" :speed 9600) - -(make-serial-process :port "COM1" :speed 115200 :stopbits 2) - -(make-serial-process :port "\\\\.\\COM13" :speed 1200 - :bytesize 7 :parity 'odd) - -(make-serial-process :port "/dev/tty.BlueConsole-SPP-1" - :speed nil) @end example @end defun @@ -2560,19 +2552,9 @@ flow control). If @var{flowcontrol} is not given, it defaults to no flow control. @end table -@code{serial-process-configure} is called by @code{make-serial-process} for the -initial configuration of the serial port. - -Examples: - -@example -(serial-process-configure :process "/dev/ttyS0" :speed 1200) - -(serial-process-configure :buffer "COM1" :stopbits 1 - :parity 'odd :flowcontrol 'hw) - -(serial-process-configure :port "\\\\.\\COM13" :bytesize 7) -@end example +@code{serial-process-configure} is called by +@code{make-serial-process} for the initial configuration of the serial +port. @end defun @node Byte Packing diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index d062c215952..05ac40e90c1 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi @@ -828,12 +828,12 @@ is not truncated. @example @group -(format "The word `%7s' actually has %d letters in it." +(format "The word `%7s' has %d letters in it." "foo" (length "foo")) - @result{} "The word ` foo' actually has 3 letters in it." -(format "The word `%7s' actually has %d letters in it." + @result{} "The word ` foo' has 3 letters in it." +(format "The word `%7s' has %d letters in it." "specification" (length "specification")) - @result{} "The word `specification' actually has 13 letters in it." + @result{} "The word `specification' has 13 letters in it." @end group @end example diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 8205c5fa169..6a3f53c55e2 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -2806,9 +2806,9 @@ construct each part with @code{propertize} and then combine them with @end smallexample @end defun - See also the function @code{buffer-substring-no-properties} -(@pxref{Buffer Contents}) which copies text from the buffer -but does not copy its properties. + @xref{Buffer Contents}, for the function +@code{buffer-substring-no-properties}, which copies text from the +buffer but does not copy its properties. @node Property Search @subsection Text Property Search Functions @@ -2992,13 +2992,6 @@ face attribute name and @var{value} is a meaningful value for that attribute. With this feature, you do not need to create a face each time you want to specify a particular attribute for certain text. @xref{Face Attributes}. - -@item -A cons cell with the form @code{(foreground-color . @var{color-name})} -or @code{(background-color . @var{color-name})}. These are old, -deprecated equivalents for @code{(:foreground @var{color-name})} and -@code{(:background @var{color-name})}. Please convert code that uses -them. @end itemize It works to use the latter two forms directly as the value diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index e2bbcc11e6e..be37eb2034b 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -249,7 +249,8 @@ file if you distribute copies. Use a notice like this one: ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . +;; along with this program. If not, see +;; . @end smallexample If you have signed papers to assign the copyright to the Foundation, diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 93f2035eca6..2cf4a8152c7 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi @@ -1462,10 +1462,10 @@ to the current position of point in @var{window}; @var{window}, to the selected window. If @var{position} is @code{t}, that means to check the last visible position in @var{window}. -The @code{pos-visible-in-window-p} function considers only vertical -scrolling. If @var{position} is out of view only because @var{window} -has been scrolled horizontally, @code{pos-visible-in-window-p} returns -non-@code{nil} anyway. @xref{Horizontal Scrolling}. +This function considers only vertical scrolling. If @var{position} is +out of view only because @var{window} has been scrolled horizontally, +@code{pos-visible-in-window-p} returns non-@code{nil} anyway. +@xref{Horizontal Scrolling}. If @var{position} is visible, @code{pos-visible-in-window-p} returns @code{t} if @var{partially} is @code{nil}; if @var{partially} is diff --git a/etc/NEWS b/etc/NEWS index d6fa4117c4c..dc1f25ddd3b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -177,6 +177,8 @@ with Xft. To change font, use the X resource font, for example: Emacs.pane.menubar.font: Courier-12 ** On graphical displays, the mode-line no longer ends in dashes. +Also, the first dash (which does not indicate anything) is just +displayed as a space. ** On Nextstep/OSX, the menu bar can be hidden by customizing ns-auto-hide-menu-bar. @@ -386,6 +388,8 @@ between applications. *** Support for X cut buffers has been removed. +*** Support for X clipboard managers has been added. + ** New command `rectangle-number-lines', bound to `C-x r N', numbers the lines in the current rectangle. With an prefix argument, this prompts for a number to count from and for a format string. @@ -747,6 +751,9 @@ consult. * New Modes and Packages in Emacs 24.1 +** Occur Edit mode applies edits made in *Occur* buffers to the +original buffers. It is bound to C-x C-q in Occur mode. + ** New global minor modes electric-pair-mode, electric-indent-mode, and electric-layout-mode. diff --git a/lib/getopt.in.h b/lib/getopt.in.h index 82e2937d6d2..0f3918ab771 100644 --- a/lib/getopt.in.h +++ b/lib/getopt.in.h @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef _GL_GETOPT_H +#ifndef _@GUARD_PREFIX@_GETOPT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -32,10 +32,10 @@ # undef _GL_SYSTEM_GETOPT #endif -#ifndef _GL_GETOPT_H +#ifndef _@GUARD_PREFIX@_GETOPT_H #ifndef __need_getopt -# define _GL_GETOPT_H 1 +# define _@GUARD_PREFIX@_GETOPT_H 1 #endif /* Standalone applications should #define __GETOPT_PREFIX to an @@ -249,5 +249,5 @@ extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv, /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt -#endif /* getopt.h */ -#endif /* getopt.h */ +#endif /* _@GUARD_PREFIX@_GETOPT_H */ +#endif /* _@GUARD_PREFIX@_GETOPT_H */ diff --git a/lib/gnulib.mk b/lib/gnulib.mk index 2d18a073a49..40fbe663da7 100644 --- a/lib/gnulib.mk +++ b/lib/gnulib.mk @@ -9,7 +9,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 crypto/sha1 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files careadlinkat crypto/md5 crypto/sha1 dtoastr filemode getloadavg getopt-gnu ignore-value intprops lstat mktime readlink socklen stdarg stdio strftime strtoumax symlink sys_stat MOSTLYCLEANFILES += core *.stackdump @@ -149,7 +149,8 @@ BUILT_SOURCES += $(GETOPT_H) getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_GETOPT_H''@|$(HAVE_GETOPT_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @@ -278,7 +279,8 @@ if GL_GENERATE_STDARG_H stdarg.h: stdarg.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDARG_H''@|$(NEXT_STDARG_H)|g' \ @@ -328,7 +330,8 @@ if GL_GENERATE_STDDEF_H stddef.h: stddef.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDDEF_H''@|$(NEXT_STDDEF_H)|g' \ @@ -357,7 +360,8 @@ if GL_GENERATE_STDINT_H stdint.h: stdint.in.h $(top_builddir)/config.status $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ @@ -405,7 +409,8 @@ BUILT_SOURCES += stdio.h stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \ @@ -528,7 +533,8 @@ BUILT_SOURCES += stdlib.h stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ @@ -656,7 +662,8 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU $(AM_V_at)$(MKDIR_P) sys $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \ @@ -714,7 +721,8 @@ BUILT_SOURCES += time.h time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ - sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \ @@ -764,7 +772,8 @@ BUILT_SOURCES += unistd.h unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H) $(AM_V_GEN)rm -f $@-t $@ && \ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ - sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ + sed -e 's|@''GUARD_PREFIX''@|GL|g' \ + -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ diff --git a/lib/intprops.h b/lib/intprops.h index d722648555b..1f6a539c183 100644 --- a/lib/intprops.h +++ b/lib/intprops.h @@ -22,9 +22,8 @@ #include -/* Return a integer value, converted to the same type as the integer - expression E after integer type promotion. V is the unconverted value. - E should not have side effects. */ +/* Return an integer value, converted to the same type as the integer + expression E after integer type promotion. V is the unconverted value. */ #define _GL_INT_CONVERT(e, v) (0 * (e) + (v)) /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see @@ -53,7 +52,7 @@ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* Return 1 if the integer expression E, after integer promotion, has - a signed type. E should not have side effects. */ + a signed type. */ #define _GL_INT_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0) diff --git a/lib/makefile.w32-in b/lib/makefile.w32-in index 99eda065568..1f543f1bc21 100644 --- a/lib/makefile.w32-in +++ b/lib/makefile.w32-in @@ -197,7 +197,8 @@ ARG_NONNULL_H = ../arg-nonnull.h getopt_h: - $(DEL) getopt_.h-t getopt_.h - sed -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \ + sed -e "s!@GUARD_PREFIX@!GL!g" \ + -e "s!@HAVE_GETOPT_H@!$(HAVE_GETOPT_H)!g" \ -e "s!@INCLUDE_NEXT@!$(INCLUDE_NEXT)!g" \ -e "s!@PRAGMA_SYSTEM_HEADER@!$(PRAGMA_SYSTEM_HEADER)!g" \ -e "s!@PRAGMA_COLUMNS@!$(PRAGMA_COLUMNS)!g" \ diff --git a/lib/stdarg.in.h b/lib/stdarg.in.h index 4469d54e4f4..43f96070708 100644 --- a/lib/stdarg.in.h +++ b/lib/stdarg.in.h @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef _GL_STDARG_H +#ifndef _@GUARD_PREFIX@_STDARG_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -25,12 +25,12 @@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STDARG_H@ -#ifndef _GL_STDARG_H -#define _GL_STDARG_H +#ifndef _@GUARD_PREFIX@_STDARG_H +#define _@GUARD_PREFIX@_STDARG_H #ifndef va_copy # define va_copy(a,b) ((a) = (b)) #endif -#endif /* _GL_STDARG_H */ -#endif /* _GL_STDARG_H */ +#endif /* _@GUARD_PREFIX@_STDARG_H */ +#endif /* _@GUARD_PREFIX@_STDARG_H */ diff --git a/lib/stddef.in.h b/lib/stddef.in.h index 62a91a7a6a3..c7b98e7dcc5 100644 --- a/lib/stddef.in.h +++ b/lib/stddef.in.h @@ -38,9 +38,9 @@ remember if special invocation has ever been used to obtain wint_t, in which case we need to clean up NULL yet again. */ -# if !(defined _GL_STDDEF_H && defined _GL_STDDEF_WINT_T) +# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T) # ifdef __need_wint_t -# undef _GL_STDDEF_H +# undef _@GUARD_PREFIX@_STDDEF_H # define _GL_STDDEF_WINT_T # endif # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ @@ -49,14 +49,14 @@ #else /* Normal invocation convention. */ -# ifndef _GL_STDDEF_H +# ifndef _@GUARD_PREFIX@_STDDEF_H /* The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDDEF_H@ -# ifndef _GL_STDDEF_H -# define _GL_STDDEF_H +# ifndef _@GUARD_PREFIX@_STDDEF_H +# define _@GUARD_PREFIX@_STDDEF_H /* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */ #if @REPLACE_NULL@ @@ -82,6 +82,6 @@ # define wchar_t int #endif -# endif /* _GL_STDDEF_H */ -# endif /* _GL_STDDEF_H */ +# endif /* _@GUARD_PREFIX@_STDDEF_H */ +# endif /* _@GUARD_PREFIX@_STDDEF_H */ #endif /* __need_XXX */ diff --git a/lib/stdint.in.h b/lib/stdint.in.h index 376b96a785d..09ac138b851 100644 --- a/lib/stdint.in.h +++ b/lib/stdint.in.h @@ -21,7 +21,7 @@ * */ -#ifndef _GL_STDINT_H +#ifndef _@GUARD_PREFIX@_STDINT_H #if __GNUC__ >= 3 @PRAGMA_SYSTEM_HEADER@ @@ -52,13 +52,13 @@ /* Other systems may have an incomplete or buggy . Include it before , since any "#include " in would reinclude us, skipping our contents because - _GL_STDINT_H is defined. + _@GUARD_PREFIX@_STDINT_H is defined. The include_next requires a split double-inclusion guard. */ # @INCLUDE_NEXT@ @NEXT_STDINT_H@ #endif -#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H -#define _GL_STDINT_H +#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H +#define _@GUARD_PREFIX@_STDINT_H /* defines some of the stdint.h types as well, on glibc, IRIX 6.5, and OpenBSD 3.8 (via ). @@ -588,5 +588,5 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t) #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */ -#endif /* _GL_STDINT_H */ -#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ +#endif /* _@GUARD_PREFIX@_STDINT_H */ +#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */ diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 0b85d0c28cc..81d3d71842c 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -35,7 +35,7 @@ #else /* Normal invocation convention. */ -#ifndef _GL_STDIO_H +#ifndef _@GUARD_PREFIX@_STDIO_H #define _GL_ALREADY_INCLUDING_STDIO_H @@ -44,8 +44,8 @@ #undef _GL_ALREADY_INCLUDING_STDIO_H -#ifndef _GL_STDIO_H -#define _GL_STDIO_H +#ifndef _@GUARD_PREFIX@_STDIO_H +#define _@GUARD_PREFIX@_STDIO_H /* Get va_list. Needed on many systems, including glibc 2.8. */ #include @@ -1345,6 +1345,6 @@ _GL_WARN_ON_USE (vsprintf, "vsprintf is not always POSIX compliant - " #endif -#endif /* _GL_STDIO_H */ -#endif /* _GL_STDIO_H */ +#endif /* _@GUARD_PREFIX@_STDIO_H */ +#endif /* _@GUARD_PREFIX@_STDIO_H */ #endif diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 7513553b672..62a2ce920e6 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -28,13 +28,13 @@ #else /* Normal invocation convention. */ -#ifndef _GL_STDLIB_H +#ifndef _@GUARD_PREFIX@_STDLIB_H /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_STDLIB_H@ -#ifndef _GL_STDLIB_H -#define _GL_STDLIB_H +#ifndef _@GUARD_PREFIX@_STDLIB_H +#define _@GUARD_PREFIX@_STDLIB_H /* NetBSD 5.0 mis-defines NULL. */ #include @@ -761,6 +761,6 @@ _GL_CXXALIASWARN (wctomb); #endif -#endif /* _GL_STDLIB_H */ -#endif /* _GL_STDLIB_H */ +#endif /* _@GUARD_PREFIX@_STDLIB_H */ +#endif /* _@GUARD_PREFIX@_STDLIB_H */ #endif diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 13fae7b6703..5acee705f8a 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -34,7 +34,7 @@ #else /* Normal invocation convention. */ -#ifndef _GL_SYS_STAT_H +#ifndef _@GUARD_PREFIX@_SYS_STAT_H /* Get nlink_t. */ #include @@ -45,8 +45,8 @@ /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ -#ifndef _GL_SYS_STAT_H -#define _GL_SYS_STAT_H +#ifndef _@GUARD_PREFIX@_SYS_STAT_H +#define _@GUARD_PREFIX@_SYS_STAT_H /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */ @@ -653,6 +653,6 @@ _GL_WARN_ON_USE (utimensat, "utimensat is not portable - " #endif -#endif /* _GL_SYS_STAT_H */ -#endif /* _GL_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ +#endif /* _@GUARD_PREFIX@_SYS_STAT_H */ #endif diff --git a/lib/time.in.h b/lib/time.in.h index cb533a46e10..1fbebf47beb 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -28,13 +28,13 @@ without adding our own declarations. */ #if (defined __need_time_t || defined __need_clock_t \ || defined __need_timespec \ - || defined _GL_TIME_H) + || defined _@GUARD_PREFIX@_TIME_H) # @INCLUDE_NEXT@ @NEXT_TIME_H@ #else -# define _GL_TIME_H +# define _@GUARD_PREFIX@_TIME_H # @INCLUDE_NEXT@ @NEXT_TIME_H@ diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 59dd5709877..261659bc167 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -36,7 +36,7 @@ # define _GL_WINSOCK2_H_WITNESS /* Normal invocation. */ -#elif !defined _GL_UNISTD_H +#elif !defined _@GUARD_PREFIX@_UNISTD_H /* The include_next requires a split double-inclusion guard. */ #if @HAVE_UNISTD_H@ @@ -51,8 +51,8 @@ # undef _GL_INCLUDING_WINSOCK2_H #endif -#if !defined _GL_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H -#define _GL_UNISTD_H +#if !defined _@GUARD_PREFIX@_UNISTD_H && !defined _GL_INCLUDING_WINSOCK2_H +#define _@GUARD_PREFIX@_UNISTD_H /* NetBSD 5.0 mis-defines NULL. Also get size_t. */ #include @@ -120,7 +120,7 @@ #if @GNULIB_GETHOSTNAME@ /* Get all possible declarations of gethostname(). */ # if @UNISTD_H_HAVE_WINSOCK2_H@ -# if !defined _GL_SYS_SOCKET_H +# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef socket # define socket socket_used_without_including_sys_socket_h @@ -181,7 +181,7 @@ "shutdown() used without including "); # endif # endif -# if !defined _GL_SYS_SELECT_H +# if !defined _@GUARD_PREFIX@_SYS_SELECT_H # if !(defined __cplusplus && defined GNULIB_NAMESPACE) # undef select # define select select_used_without_including_sys_select_h @@ -1416,5 +1416,5 @@ _GL_CXXALIASWARN (write); #endif -#endif /* _GL_UNISTD_H */ -#endif /* _GL_UNISTD_H */ +#endif /* _@GUARD_PREFIX@_UNISTD_H */ +#endif /* _@GUARD_PREFIX@_UNISTD_H */ diff --git a/lib/verify.h b/lib/verify.h index 3294b303505..c6d30a35af9 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -164,10 +164,13 @@ (!!sizeof (_GL_VERIFY_TYPE (R, DIAGNOSTIC))) # ifdef __cplusplus +# if !GNULIB_defined_struct__gl_verify_type template struct _gl_verify_type { unsigned int _gl_verify_error_if_negative: w; }; +# define GNULIB_defined_struct__gl_verify_type 1 +# endif # define _GL_VERIFY_TYPE(R, DIAGNOSTIC) \ _gl_verify_type<(R) ? 1 : -1> # elif defined _GL_HAVE__STATIC_ASSERT @@ -206,7 +209,7 @@ template # endif # endif -# ifdef _GL_VERIFY_H +/* @assert.h omit start@ */ /* Each of these macros verifies that its argument R is nonzero. To be portable, R should be an integer constant expression. Unlike @@ -220,13 +223,13 @@ template /* Verify requirement R at compile-time, as an integer constant expression. Return 1. */ -# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") +# define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")") /* Verify requirement R at compile-time, as a declaration without a trailing ';'. */ -# define verify(R) _GL_VERIFY (R, "verify (" #R ")") +# define verify(R) _GL_VERIFY (R, "verify (" #R ")") -# endif +/* @assert.h omit end@ */ #endif diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 507a7bdf0ac..6d4752efec0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,12 +1,64 @@ +2011-05-29 Chong Yidong + + * image.el (image-animate-max-time): Allow nil and t values. + Default to nil. + (create-animated-image): Doc fix. + (image-animate-start): Remove second arg; just use + image-animate-max-time. + (image-animate-timeout): Doc fix. Args changed. + + * image-mode.el (image-toggle-display-image): Ensure that the + image spec passed to the animate timer is the same object as in + the the buffer's display property (Bug#6981). + (image-transform-properties): Doc fix. + + * image.el (image-animate-max-time): Default to nil. + +2011-05-29 Martin Rudalics + + * menu-bar.el (kill-this-buffer-enabled-p): Avoid looping over + entire buffer list (Bug#8184). + +2011-05-29 Chong Yidong + + * image.el (imagemagick-types-inhibit) + (imagemagick-register-types): Doc fix. + +2011-05-29 Deniz Dogan + + * net/rcirc.el (rcirc): Use the user's stored encryption method by + default. + +2011-05-29 Chong Yidong + + * select.el: Don't perform clipboard-manager saving in hooks; + leave the hooks empty. + +2011-05-28 Leo Liu + + * replace.el (occur-menu-map, occur-edit-mode-map): New vars. + (occur-mode-map): Bind occur-edit-mode. Use occur-menu-map. + (occur-edit-mode): New major mode (Bug#8463). + (occur-after-change-function): New function. + (occur-engine): Give Occur tags a read-only property. + 2011-05-28 Kevin Ryde * subr.el (def-edebug-spec): Doc fix (Bug#8430). 2011-05-28 Chong Yidong + * bindings.el (help-echo): Make the initial non-indicator dash + empty on graphical terminals (Bug#7295). + * files.el (auto-mode-alist): Move config rule after the in-stripping one (Bug#8547). + * newcomment.el (comment-end-skip): Doc fix (Bug#8659). + + * startup.el (normal-splash-screen): Remove gratuitous mode-line + setting (Bug#8740). + 2011-05-28 Alp Aker (tiny change) * buff-menu.el (Buffer-menu-revert-function, Buffer-menu-sort) diff --git a/lisp/bindings.el b/lisp/bindings.el index 63c83ada9ba..ffc797966b8 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -321,7 +321,9 @@ mouse-3: Remove current window from display") (standard-mode-line-format (list "%e" - (propertize "-" 'help-echo help-echo) + `(:eval (if (display-graphic-p) + ,(propertize " " 'help-echo help-echo) + ,(propertize "-" 'help-echo help-echo))) 'mode-line-mule-info 'mode-line-client 'mode-line-modified diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 6ed5a3fdcf4..4aba3a27900 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,12 @@ +2011-05-29 Lars Magne Ingebrigtsen + + * shr.el (shr-urlify): Use shr-add-font to make underlines be less ugly + at the end of lines. + +2011-05-29 Julien Danjou + + * smiley.el (gnus-smiley-file-types): Add gif as supported file type. + 2011-05-27 Glenn Morris * gnus-group.el (gnus-bug-group-download-format-alist): diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el index d23d9c7724b..ebd854930df 100644 --- a/lisp/gnus/shr.el +++ b/lisp/gnus/shr.el @@ -601,7 +601,7 @@ START, and END. Note that START and END should be merkers." :help-echo (if title (format "%s (%s)" url title) url) :keymap shr-map url) - (put-text-property start (point) 'face 'shr-link) + (shr-add-font start (point) 'shr-link) (put-text-property start (point) 'shr-url url)) (defun shr-encode-url (url) diff --git a/lisp/gnus/smiley.el b/lisp/gnus/smiley.el index 2f5c74220ea..cf23deb174b 100644 --- a/lisp/gnus/smiley.el +++ b/lisp/gnus/smiley.el @@ -133,9 +133,11 @@ regexp to replace with IMAGE. IMAGE is the name of an image file in (let ((types (list "pbm"))) (when (gnus-image-type-available-p 'xpm) (push "xpm" types)) + (when (gnus-image-type-available-p 'gif) + (push "gif" types)) types) "*List of suffixes on smiley file names to try." - :version "22.1" + :version "24.1" :type '(repeat string) :group 'smiley) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index f4eb5eeaf45..145a15de246 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -484,18 +484,26 @@ was inserted." (buffer-substring-no-properties (point-min) (point-max))) filename)) (type (image-type file-or-data nil data-p)) - (image0 (create-animated-image file-or-data type data-p)) - (image (append image0 - (image-transform-properties image0))) - (props + ;; Don't use create-animated-image here; that would start the + ;; timer, which works by altering the spec destructively. + ;; But we still need to append the transformation properties, + ;; which would make a new list. + (image (create-image file-or-data type data-p)) + (inhibit-read-only t) + (buffer-undo-list t) + (modified (buffer-modified-p)) + props) + + (setq image (append image (image-transform-properties image))) + (setq props `(display ,image intangible ,image rear-nonsticky (display intangible) read-only t front-sticky (read-only))) - (inhibit-read-only t) - (buffer-undo-list t) - (modified (buffer-modified-p))) (image-flush image) + ;; Begin the animation, if any. + (image-animate-start image) + (let ((buffer-file-truename nil)) ; avoid changing dir mtime by lock_file (add-text-properties (point-min) (point-max) props) (restore-buffer-modified-p modified)) @@ -584,10 +592,13 @@ Its value should be one of the following: (defvar image-transform-rotation 0.0) (defun image-transform-properties (display) - "Rescale and/or rotate the current image. -The scale factor and rotation angle are given by the variables -`image-transform-resize' and `image-transform-rotation'. This -takes effect only if Emacs is compiled with ImageMagick support." + "Return rescaling/rotation properties for the Image mode buffer. +These properties are suitable for appending to an image spec; +they are determined by the variables `image-transform-resize' and +`image-transform-rotation'. + +Recaling and rotation properties only take effect if Emacs is +compiled with ImageMagick support." (let* ((size (image-size display t)) (height (cond diff --git a/lisp/image.el b/lisp/image.el index 3b90ac46bd1..b9ed10eacf2 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -590,9 +590,13 @@ Example: ;;; Animated image API -(defcustom image-animate-max-time 30 - "Time in seconds to animate images." - :type 'integer +(defcustom image-animate-max-time nil + "Time in seconds to animate images. +If the value is nil, play animations once. +If the value is t, loop forever." + :type '(choice (const :tag "Play once" nil) + (const :tag "Loop forever" t) + integer) :version "24.1" :group 'image) @@ -601,7 +605,7 @@ Example: ;;;###autoload (defun create-animated-image (file-or-data &optional type data-p &rest props) - "Create an animated image. + "Create an animated image, and begin animating it. FILE-OR-DATA is an image file name or image data. Optional TYPE is a symbol describing the image type. If TYPE is omitted or nil, try to determine the image type from its first few bytes @@ -638,22 +642,20 @@ Images should not be larger than specified by `max-image-size'." (setq timer nil))) timer)) -(defun image-animate-start (image &optional max-time) - "Start animation of image IMAGE. -Optional second arg MAX-TIME is number of seconds to animate image, -or t to animate infinitely." +(defun image-animate-start (image) + "Start animating the image IMAGE. +The variable `image-animate-max-time' determines how long to +animate for." (let ((anim (image-animated-p image)) - timer tmo) + delay ; in seconds + timer) (when anim (if (setq timer (image-animate-timer image)) - (setcar (nthcdr 3 (aref timer 6)) max-time) - (setq tmo (* (cdr anim) 0.01)) - (setq max-time (or max-time image-animate-max-time)) - (run-with-timer tmo nil #'image-animate-timeout - image 1 (car anim) - (if (numberp max-time) - (- max-time tmo) - max-time)))))) + (cancel-timer timer)) + (setq delay (max (* (cdr anim) 0.01) 0.025)) + (run-with-timer 0.2 nil #'image-animate-timeout + image 0 (car anim) + delay 0 image-animate-max-time)))) (defun image-animate-stop (image) "Stop animation of image." @@ -661,20 +663,31 @@ or t to animate infinitely." (when timer (cancel-timer timer)))) -(defun image-animate-timeout (image ino count time-left) - (if (>= ino count) - (setq ino 0)) - (plist-put (cdr image) :index ino) - (force-window-update) - (let ((anim (image-animated-p image)) tmo) - (when anim - (setq tmo (* (cdr anim) 0.01)) - (unless (and (= ino 0) (numberp time-left) (< time-left tmo)) - (run-with-timer tmo nil #'image-animate-timeout - image (1+ ino) count - (if (numberp time-left) - (- time-left tmo) - time-left)))))) +(defun image-animate-timeout (image n count delay time-elapsed max) + "Display animation frame N of IMAGE. +N=0 refers to the initial animation frame. +COUNT is the total number of frames in the animation. +DELAY is the time between animation frames, in seconds. +TIME-ELAPSED is the total time that has elapsed since +`image-animate-start' was called. +MAX determines when to stop. If t, loop forever. If nil, stop + after displaying the last animation frame. Otherwise, stop + after MAX seconds have elapsed." + (let (done) + (plist-put (cdr image) :index n) + (force-window-update) + (setq n (1+ n)) + (if (>= n count) + (if max + (setq n 0) + (setq done t))) + (setq time-elapsed (+ delay time-elapsed)) + (if (numberp max) + (setq done (>= time-elapsed max))) + (unless done + (run-with-timer delay nil 'image-animate-timeout + image n count delay + time-elapsed max)))) (defun image-animated-p (image) "Return non-nil if image is animated. @@ -698,31 +711,38 @@ shall be displayed." (defcustom imagemagick-types-inhibit '(C HTML HTM TXT PDF) - ;; FIXME what are the possible options? - ;; Are these actually file-name extensions? - ;; Why are these upper-case when eg image-types is lower-case? - "Types the ImageMagick loader should not try to handle." - :type '(choice (const :tag "Let ImageMagick handle all the types it can" nil) + "ImageMagick types that Emacs should not use ImageMagick to handle. +This should be a list of symbols, each of which has the same +names as one of the format tags used internally by ImageMagick; +see `imagemagick-types'. Entries in this list are excluded from +being registered by `imagemagick-register-types'. + +If Emacs is compiled without ImageMagick, this variable has no effect." + :type '(choice (const :tag "Let ImageMagick handle all types it can" nil) (repeat symbol)) :version "24.1" :group 'image) ;;;###autoload (defun imagemagick-register-types () - "Register the file types that ImageMagick is able to handle." - (if (fboundp 'imagemagick-types) - (let ((im-types (imagemagick-types))) - (dolist (im-inhibit imagemagick-types-inhibit) - (setq im-types (remove im-inhibit im-types))) - (dolist (im-type im-types) - (let ((extension (downcase (symbol-name im-type)))) - (push - (cons (concat "\\." extension "\\'") 'image-mode) - auto-mode-alist) - (push - (cons (concat "\\." extension "\\'") 'imagemagick) - image-type-file-name-regexps)))) - (error "Emacs was not built with ImageMagick support"))) + "Register file types that can be handled by ImageMagick. +This adds the file types returned by `imagemagick-types' +\(excluding the ones in `imagemagick-types-inhibit') to +`auto-mode-alist' and `image-type-file-name-regexps', so that +Emacs visits them in Image mode. + +If Emacs is compiled without ImageMagick support, do nothing." + (when (fboundp 'imagemagick-types) + (let ((im-types (imagemagick-types))) + (dolist (im-inhibit imagemagick-types-inhibit) + (setq im-types (delq im-inhibit im-types))) + (dolist (im-type im-types) + (let ((extension + (concat "\\." (downcase (symbol-name im-type)) + "\\'"))) + (push (cons extension 'image-mode) auto-mode-alist) + (push (cons extension 'imagemagick) + image-type-file-name-regexps)))))) (provide 'image) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 8a33381b618..343a9c6dd0c 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1823,14 +1823,17 @@ using `abort-recursive-edit'." (abort-recursive-edit))) (defun kill-this-buffer-enabled-p () - (let ((count 0) - (buffers (buffer-list))) - (while buffers - (or (string-match "^ " (buffer-name (car buffers))) - (setq count (1+ count))) - (setq buffers (cdr buffers))) - (or (not (menu-bar-non-minibuffer-window-p)) - (> count 1)))) + "Return non-nil if the `kill-this-buffer' menu item should be enabled." + (or (not (menu-bar-non-minibuffer-window-p)) + (let (found-1) + ;; Instead of looping over entire buffer list, stop once we've + ;; found two "killable" buffers (Bug#8184). + (catch 'found-2 + (dolist (buffer (buffer-list)) + (unless (string-match-p "^ " (buffer-name buffer)) + (if (not found-1) + (setq found-1 t) + (throw 'found-2 t)))))))) (put 'dired 'menu-enable '(menu-bar-non-minibuffer-window-p)) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 0d02688beed..47085af85f0 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -456,7 +456,12 @@ If ARG is non-nil, instead prompt for connection parameters." (encryption (intern (completing-read "Encryption (default plain): " '("plain" "tls") - nil t nil nil "plain")))) + nil t + (let ((choice (plist-get server-plist + :encryption))) + (when choice + (symbol-name choice))) + nil "plain")))) (rcirc-connect server port nick user-name rcirc-default-full-name channels password encryption)) diff --git a/lisp/newcomment.el b/lisp/newcomment.el index f1243f158a5..a1d77ccc6e0 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -118,7 +118,7 @@ at the place matched by the close of the first pair.") ;;;###autoload (defvar comment-end-skip nil - "Regexp to match the end of a comment plus everything up to its body.") + "Regexp to match the end of a comment plus everything back to its body.") ;;;###autoload(put 'comment-end-skip 'safe-local-variable 'string-or-null-p) ;;;###autoload diff --git a/lisp/replace.el b/lisp/replace.el index 31a48d48960..0578ed09b1c 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -761,22 +761,8 @@ a previously found match." count))) -(defvar occur-mode-map +(defvar occur-menu-map (let ((map (make-sparse-keymap))) - ;; We use this alternative name, so we can use \\[occur-mode-mouse-goto]. - (define-key map [mouse-2] 'occur-mode-mouse-goto) - (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence) - (define-key map "\C-m" 'occur-mode-goto-occurrence) - (define-key map "o" 'occur-mode-goto-occurrence-other-window) - (define-key map "\C-o" 'occur-mode-display-occurrence) - (define-key map "\M-n" 'occur-next) - (define-key map "\M-p" 'occur-prev) - (define-key map "r" 'occur-rename-buffer) - (define-key map "c" 'clone-buffer) - (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) - (define-key map [menu-bar] (make-sparse-keymap)) - (define-key map [menu-bar occur] - (cons (purecopy "Occur") map)) (define-key map [next-error-follow-minor-mode] `(menu-item ,(purecopy "Auto Occurrence Display") next-error-follow-minor-mode @@ -817,6 +803,24 @@ a previously found match." `(menu-item ,(purecopy "Move to Previous Match") occur-prev :help ,(purecopy "Move to the Nth (default 1) previous match in an Occur mode buffer"))) map) + "Menu keymap for `occur-mode'.") + +(defvar occur-mode-map + (let ((map (make-sparse-keymap))) + ;; We use this alternative name, so we can use \\[occur-mode-mouse-goto]. + (define-key map [mouse-2] 'occur-mode-mouse-goto) + (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence) + (define-key map "\C-x\C-q" 'occur-edit-mode) + (define-key map "\C-m" 'occur-mode-goto-occurrence) + (define-key map "o" 'occur-mode-goto-occurrence-other-window) + (define-key map "\C-o" 'occur-mode-display-occurrence) + (define-key map "\M-n" 'occur-next) + (define-key map "\M-p" 'occur-prev) + (define-key map "r" 'occur-rename-buffer) + (define-key map "c" 'clone-buffer) + (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) + (define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) + map) "Keymap for `occur-mode'.") (defvar occur-revert-arguments nil @@ -853,6 +857,63 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (setq next-error-function 'occur-next-error)) + +;;; Occur Edit mode + +(defvar occur-edit-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map text-mode-map) + (define-key map [mouse-2] 'occur-mode-mouse-goto) + (define-key map "\C-c\C-c" 'occur-mode-goto-occurrence) + (define-key map "\C-x\C-q" 'occur-mode) + (define-key map "\C-c\C-f" 'next-error-follow-minor-mode) + (define-key map [menu-bar occur] (cons (purecopy "Occur") occur-menu-map)) + map) + "Keymap for `occur-edit-mode'.") + +(define-derived-mode occur-edit-mode occur-mode "Occur-Edit" + "Major mode for editing *Occur* buffers. +In this mode, changes to the *Occur* buffer are also applied to +the originating buffer. + +To return to ordinary Occur mode, use \\[occur-mode]." + (setq buffer-read-only nil) + (add-hook 'after-change-functions 'occur-after-change-function nil t)) + +(defun occur-after-change-function (beg end length) + (save-excursion + (goto-char beg) + (let* ((m (get-text-property (line-beginning-position) 'occur-target)) + (buf (marker-buffer m)) + (col (current-column))) + (when (= length 0) + ;; Apply occur-target property to inserted (e.g. yanked) text. + (put-text-property beg end 'occur-target m) + ;; Did we insert a newline? Occur Edit mode can't create new + ;; Occur entries; just discard everything after the newline. + (save-excursion + (and (search-forward "\n" end t) + (delete-region (1- (point)) end)))) + (let ((line (- (line-number-at-pos) + (line-number-at-pos (window-start)))) + (readonly (with-current-buffer buf buffer-read-only)) + (win (or (get-buffer-window buf) + (display-buffer buf t))) + (text (save-excursion + (forward-line 0) + (search-forward ":" nil t) + (setq col (- col (current-column))) + (buffer-substring-no-properties (point) (line-end-position))))) + (with-selected-window win + (goto-char m) + (recenter line) + (if readonly + (message "Buffer `%s' is read only." buf) + (delete-region (line-beginning-position) (line-end-position)) + (insert text)) + (move-to-column col)))))) + + (defun occur-revert-function (_ignore1 _ignore2) "Handle `revert-buffer' for Occur mode buffers." (apply 'occur-1 (append occur-revert-arguments (list (buffer-name))))) @@ -1280,6 +1341,7 @@ See also `multi-occur'." `(font-lock-face prefix-face)) `(occur-prefix t mouse-face (highlight) occur-target ,marker follow-link t + read-only t help-echo "mouse-2: go to this occurrence")))) (match-str ;; We don't put `mouse-face' on the newline, @@ -1339,13 +1401,15 @@ See also `multi-occur'." (goto-char headerpt) (let ((beg (point)) end) - (insert (format "%d match%s%s in buffer: %s\n" - matches (if (= matches 1) "" "es") - ;; Don't display regexp for multi-buffer. - (if (> (length buffers) 1) - "" (format " for \"%s\"" - (query-replace-descr regexp))) - (buffer-name buf))) + (insert (propertize + (format "%d match%s%s in buffer: %s\n" + matches (if (= matches 1) "" "es") + ;; Don't display regexp for multi-buffer. + (if (> (length buffers) 1) + "" (format " for \"%s\"" + (query-replace-descr regexp))) + (buffer-name buf)) + 'read-only t)) (setq end (point)) (add-text-properties beg end (append diff --git a/lisp/select.el b/lisp/select.el index 5abbf8f795d..10c8f0b1efd 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -395,10 +395,6 @@ This function returns the string \"emacs\"." (SAVE_TARGETS . xselect-convert-to-save-targets) (_EMACS_INTERNAL . xselect-convert-to-identity))) -(when (fboundp 'x-clipboard-manager-save) - (add-hook 'delete-frame-functions 'x-clipboard-manager-save) - (add-hook 'kill-emacs-hook 'x-clipboard-manager-save)) - (provide 'select) ;;; select.el ends here diff --git a/lisp/startup.el b/lisp/startup.el index 6636cf944e3..26c5a469330 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1739,9 +1739,6 @@ splash screen in another window." (erase-buffer) (setq default-directory command-line-default-directory) (set (make-local-variable 'tab-width) 8) - (if (not startup) - (set (make-local-variable 'mode-line-format) - (propertize "---- %b %-" 'face 'mode-line-buffer-id))) (if pure-space-overflow (insert pure-space-overflow-message)) diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 1049d09d6db..37a9fb8ffe2 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,8 @@ +2011-05-29 Leo Liu + + * url-cookie.el (url-cookie): Add option :named so that + url-cookie-p is defined. (Bug#8747) + 2011-05-02 Lars Magne Ingebrigtsen * url-queue.el: New file. diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el index 7fdd8b174c1..78afa1633b6 100644 --- a/lisp/url/url-cookie.el +++ b/lisp/url/url-cookie.el @@ -35,17 +35,13 @@ :group 'url) ;; A cookie is stored internally as a vector of 7 slots -;; [ cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ] +;; [ url-cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ] (defstruct (url-cookie (:constructor url-cookie-create) (:copier nil) - ;; For compatibility with a previous version which did not use - ;; defstruct, and also in order to make sure that the printed - ;; representation does not depend on CL internals, we use an - ;; explicitly managed tag. - (:type vector)) - (tag 'cookie :read-only t) + (:type vector) + :named) name value expires localpart domain secure) (defvar url-cookie-storage nil "Where cookies are stored.") @@ -77,8 +73,6 @@ telling Microsoft that." ;; It's completely normal for the cookies file not to exist yet. (load (or fname url-cookie-file) t t)) -(declare-function url-cookie-p "url-cookie" t t) ; defstruct - (defun url-cookie-clean-up (&optional secure) (let ((var (if secure 'url-cookie-secure-storage 'url-cookie-storage)) new new-cookies) diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index e58d29b238f..0e44b694e40 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -7,23 +7,19 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 2 +#serial 3 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. # New applications should use gl_GETLOADAVG instead. -# gl_GETLOADAVG(LIBOBJDIR) -# ------------------------ +# gl_GETLOADAVG +# ------------- AC_DEFUN([gl_GETLOADAVG], [AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) # Persuade glibc to declare getloadavg(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) -# Make sure getloadavg.c is where it belongs, at configure-time. -test -f "$srcdir/$1/getloadavg.c" || - AC_MSG_ERROR([$srcdir/$1/getloadavg.c is missing]) - gl_save_LIBS=$LIBS # getloadvg is present in libc on glibc >= 2.2, MacOS X, FreeBSD >= 2.0, diff --git a/m4/gl-comp.m4 b/m4/gl-comp.m4 index c2f80323441..cb9f11a6284 100644 --- a/m4/gl-comp.m4 +++ b/m4/gl-comp.m4 @@ -96,7 +96,7 @@ gl_MD5 gl_SHA1 AC_REQUIRE([gl_C99_STRTOLD]) gl_FILEMODE -gl_GETLOADAVG([$gl_source_base]) +gl_GETLOADAVG gl_STDLIB_MODULE_INDICATOR([getloadavg]) gl_FUNC_GETOPT_GNU gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) diff --git a/src/ChangeLog b/src/ChangeLog index f31e68e9b7b..bada9f108f7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,4 +1,4 @@ -2011-05-28 Paul Eggert +2011-05-30 Paul Eggert Use 'inline', not 'INLINE'. * alloc.c, fontset.c (INLINE): Remove. @@ -8,6 +8,32 @@ * gmalloc.c (register_heapinfo): Use inline unconditionally. * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__. +2011-05-29 Chong Yidong + + * image.c: Various fixes to ImageMagick code comments. + (Fimagemagick_types): Doc fix. + +2011-05-29 Paul Eggert + + Minor fixes prompted by GCC 4.6.0 warnings. + + * xselect.c (converted_selections, conversion_fail_tag): Now static. + + * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h". + (x_clipboard_manager_save_all): Move extern decl to ... + * xterm.h: ... here, so that it can be checked for consistency. + +2011-05-29 Chong Yidong + + * xselect.c (x_clipboard_manager_save_frame) + (x_clipboard_manager_save_all): New functions. + (Fx_clipboard_manager_save): Lisp function deleted. + + * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all. + * frame.c (delete_frame): Call x_clipboard_manager_save_frame. + + * xterm.h: Update prototype. + 2011-05-28 William Xu * nsterm.m (ns_term_shutdown): Synchronize user defaults before diff --git a/src/coding.c b/src/coding.c index e257790bbef..6ccaf354c74 100644 --- a/src/coding.c +++ b/src/coding.c @@ -55,8 +55,8 @@ CODING SYSTEM character sequence of emacs-utf-8 to a byte sequence of a specific coding system. - In Emacs Lisp, a coding system is represented by a Lisp symbol. In - C level, a coding system is represented by a vector of attributes + In Emacs Lisp, a coding system is represented by a Lisp symbol. On + the C level, a coding system is represented by a vector of attributes stored in the hash table Vcharset_hash_table. The conversion from coding system symbol to attributes vector is done by looking up Vcharset_hash_table by the symbol. diff --git a/src/emacs.c b/src/emacs.c index 8c4490b0a52..cf74963a816 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -65,6 +65,10 @@ along with GNU Emacs. If not, see . */ #include "nsterm.h" #endif +#ifdef HAVE_X_WINDOWS +#include "xterm.h" +#endif + #ifdef HAVE_SETLOCALE #include #endif @@ -1985,6 +1989,11 @@ all of which are called before Emacs is actually killed. */) UNGCPRO; +#ifdef HAVE_X_WINDOWS + /* Transfer any clipboards we own to the clipboard manager. */ + x_clipboard_manager_save_all (); +#endif + shut_down_emacs (0, 0, STRINGP (arg) ? arg : Qnil); /* If we have an auto-save list file, diff --git a/src/font.c b/src/font.c index edbdc958539..398198324a4 100644 --- a/src/font.c +++ b/src/font.c @@ -136,7 +136,7 @@ Lisp_Object Qja, Qko; static Lisp_Object QCuser_spec; -/* Alist of font registry symbol and the corresponding charsets +/* Alist of font registry symbols and the corresponding charset information. The information is retrieved from Vfont_encoding_alist on demand. @@ -226,9 +226,9 @@ static int num_font_drivers; /* Return a Lispy value of a font property value at STR and LEN bytes. - If STR is "*", it returns nil. - If FORCE_SYMBOL is zero and all characters in STR are digits, it - returns an integer. Otherwise, it returns a symbol interned from + If STR is "*", return nil. + If FORCE_SYMBOL is zero and all characters in STR are digits, + return an integer. Otherwise, return a symbol interned from STR. */ Lisp_Object @@ -251,7 +251,7 @@ font_intern_prop (const char *str, int len, int force_symbol) } /* The following code is copied from the function intern (in - lread.c), and modified to suite our purpose. */ + lread.c), and modified to suit our purpose. */ obarray = Vobarray; if (!VECTORP (obarray) || ASIZE (obarray) == 0) obarray = check_obarray (obarray); @@ -305,7 +305,7 @@ font_pixel_size (FRAME_PTR f, Lisp_Object spec) font vector. If VAL is not valid (i.e. not registered in font_style_table), return -1 if NOERROR is zero, and return a proper index if NOERROR is nonzero. In that case, register VAL in - font_style_table if VAL is a symbol, and return a closest index if + font_style_table if VAL is a symbol, and return the closest index if VAL is an integer. */ int @@ -473,7 +473,7 @@ font_registry_charsets (Lisp_Object registry, struct charset **encoding, struct } -/* Font property value validaters. See the comment of +/* Font property value validators. See the comment of font_property_table for the meaning of the arguments. */ static Lisp_Object font_prop_validate (int, Lisp_Object, Lisp_Object); @@ -591,7 +591,7 @@ font_prop_validate_otf (Lisp_Object prop, Lisp_Object val) return val; } -/* Structure of known font property keys and validater of the +/* Structure of known font property keys and validator of the values. */ static const struct { @@ -742,7 +742,7 @@ enum xlfd_field_mask }; -/* Parse P pointing the pixel/point size field of the form +/* Parse P pointing to the pixel/point size field of the form `[A B C D]' which specifies a transformation matrix: A B 0 @@ -775,7 +775,7 @@ parse_matrix (const char *p) } /* Expand a wildcard field in FIELD (the first N fields are filled) to - multiple fields to fill in all 14 XLFD fields while restring a + multiple fields to fill in all 14 XLFD fields while restricting a field position by its contents. */ static int @@ -2054,14 +2054,14 @@ font_rescale_ratio (Lisp_Object font_entity) font-spec. The score value is 32 bit (`unsigned'), and the smaller the value is, the closer the font is to the font-spec. - The lowest 2 bits of the score is used for driver type. The font + The lowest 2 bits of the score are used for driver type. The font available by the most preferred font driver is 0. - Each 7-bit in the higher 28 bits are used for numeric properties + The 4 7-bit fields in the higher 28 bits are used for numeric properties WEIGHT, SLANT, WIDTH, and SIZE. */ /* How many bits to shift to store the difference value of each font - property in a score. Note that flots for FONT_TYPE_INDEX and + property in a score. Note that floats for FONT_TYPE_INDEX and FONT_REGISTRY_INDEX are not used. */ static int sort_shift_bits[FONT_SIZE_INDEX + 1]; @@ -2598,7 +2598,7 @@ font_clear_cache (FRAME_PTR f, Lisp_Object cache, struct font_driver *driver) static Lisp_Object scratch_font_spec, scratch_font_prefer; /* Check each font-entity in VEC, and return a list of font-entities - that satisfy this condition: + that satisfy these conditions: (1) matches with SPEC and SIZE if SPEC is not nil, and (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil). */ @@ -3018,8 +3018,8 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop) attrs[LFACE_FONT_INDEX] = font; } -/* Selecte a font from ENTITIES (list of font-entity vectors) that - supports C and matches best with ATTRS and PIXEL_SIZE. */ +/* Select a font from ENTITIES (list of font-entity vectors) that + supports C and is the best match for ATTRS and PIXEL_SIZE. */ static Lisp_Object font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, int pixel_size, int c) @@ -3062,8 +3062,8 @@ font_select_entity (Lisp_Object frame, Lisp_Object entities, Lisp_Object *attrs, return font_sort_entities (entities, prefer, frame, c); } -/* Return a font-entity satisfying SPEC and best matching with face's - font related attributes in ATTRS. C, if not negative, is a +/* Return a font-entity that satisfies SPEC and is the best match for + face's font related attributes in ATTRS. C, if not negative, is a character that the entity must support. */ Lisp_Object @@ -3254,8 +3254,8 @@ font_open_for_lface (FRAME_PTR f, Lisp_Object entity, Lisp_Object *attrs, Lisp_O } -/* Find a font satisfying SPEC and best matching with face's - attributes in ATTRS on FRAME, and return the opened +/* Find a font that satisfies SPEC and is the best match for + face's attributes in ATTRS on FRAME, and return the opened font-object. */ Lisp_Object @@ -3267,8 +3267,7 @@ font_load_for_lface (FRAME_PTR f, Lisp_Object *attrs, Lisp_Object spec) if (NILP (entity)) { /* No font is listed for SPEC, but each font-backend may have - the different criteria about "font matching". So, try - it. */ + different criteria about "font matching". So, try it. */ entity = font_matching_entity (f, attrs, spec); if (NILP (entity)) return Qnil; @@ -3307,7 +3306,7 @@ font_done_for_face (FRAME_PTR f, struct face *face) } -/* Open a font matching with font-spec SPEC on frame F. If no proper +/* Open a font that is a match for font-spec SPEC on frame F. If no proper font is found, return Qnil. */ Lisp_Object @@ -3331,7 +3330,7 @@ font_open_by_spec (FRAME_PTR f, Lisp_Object spec) } -/* Open a font matching with NAME on frame F. If no proper font is +/* Open a font that matches NAME on frame F. If no proper font is found, return Qnil. */ Lisp_Object @@ -3355,7 +3354,7 @@ font_open_by_name (FRAME_PTR f, const char *name) /* Register font-driver DRIVER. This function is used in two ways. The first is with frame F non-NULL. In this case, make DRIVER - available (but not yet activated) on F. All frame creaters + available (but not yet activated) on F. All frame creators (e.g. Fx_create_frame) must call this function at least once with an available font-driver. @@ -3682,7 +3681,7 @@ font_at (int c, EMACS_INT pos, struct face *face, struct window *w, #ifdef HAVE_WINDOW_SYSTEM /* Check how many characters after POS (at most to *LIMIT) can be - displayed by the same font on the window W. FACE, if non-NULL, is + displayed by the same font in the window W. FACE, if non-NULL, is the face selected for the character at POS. If STRING is not nil, it is the string to check instead of the current buffer. In that case, FACE must be not NULL. @@ -3826,7 +3825,7 @@ GSUB and GPOS may contain `nil' element. In such a case, the font must not have any of the remaining elements. For instance, if the VALUE is `(thai nil nil (mark))', the font must -be an OpenType font, and whose GPOS table of `thai' script's default +be an OpenType font whose GPOS table of `thai' script's default language system must contain `mark' feature. usage: (font-spec ARGS...) */) @@ -4189,7 +4188,7 @@ DEFUN ("font-xlfd-name", Ffont_xlfd_name, Sfont_xlfd_name, 1, 2, 0, FONT is a font-spec, font-entity, or font-object. If the name is too long for XLFD (maximum 255 chars), return nil. If the 2nd optional arg FOLD-WILDCARDS is non-nil, -the consecutive wildcards are folded to one. */) +the consecutive wildcards are folded into one. */) (Lisp_Object font, Lisp_Object fold_wildcards) { char name[256]; @@ -4436,7 +4435,7 @@ the value is 0. If GSTRING-OUT is too short to hold produced glyphs, no glyphs are produced in GSTRING-OUT, and the value is nil. -See the documentation of `font-make-gstring' for the format of +See the documentation of `composition-get-gstring' for the format of glyph-string. */) (Lisp_Object otf_features, Lisp_Object gstring_in, Lisp_Object from, Lisp_Object to, Lisp_Object gstring_out, Lisp_Object index) { @@ -4571,10 +4570,10 @@ The value is a vector: [ NAME FILENAME PIXEL-SIZE SIZE ASCENT DESCENT SPACE-WIDTH AVERAGE-WIDTH CAPABILITY ] -NAME is a string of the font name (or nil if the font backend doesn't +NAME is the font name, a string (or nil if the font backend doesn't provide a name). -FILENAME is a string of the font file (or nil if the font backend +FILENAME is the font file name, a string (or nil if the font backend doesn't provide a file name). PIXEL-SIZE is a pixel size by which the font is opened. diff --git a/src/font.h b/src/font.h index 4b3ceed1dd3..0ca9e8baec4 100644 --- a/src/font.h +++ b/src/font.h @@ -36,22 +36,22 @@ along with GNU Emacs. If not, see . */ FONT-ENTITY - Pseudo vector (length FONT_ENTITY_MAX) of fully instanciated + Pseudo vector (length FONT_ENTITY_MAX) of fully instantiated font properties that a font-driver returns upon a request of FONT-SPEC. Note: Only the method `list' and `match' of a font-driver can - create this object, and should never be modified by Lisp. + create this object, and it should never be modified by Lisp. FONT-OBJECT - Pseudo vector (length FONT_OBJECT_MAX) of a opend font. + Pseudo vector (length FONT_OBJECT_MAX) of an opened font. Lisp object encapsulating "struct font". This corresponds to an opened font. Note: Only the method `open' of a font-driver can create this - object, and should never be modified by Lisp. */ + object, and it should never be modified by Lisp. */ extern Lisp_Object Qfont_spec, Qfont_entity, Qfont_object; @@ -68,7 +68,7 @@ struct glyph_string; enum font_property_index { /* FONT-TYPE is a symbol indicating a font backend; currently `x', - `xft', `ftx' are available on X, `uniscribe' and `gdi' on + `xft', and `ftx' are available on X, `uniscribe' and `gdi' on Windows, and `ns' under Cocoa / GNUstep. */ FONT_TYPE_INDEX, @@ -86,26 +86,26 @@ enum font_property_index FONT_REGISTRY_INDEX, /* FONT-WEIGHT is a numeric value of weight (e.g. medium, bold) of - the font. The lowest 8-bit is an index determining the + the font. The lowest 8 bits is an index determining the symbolic name, and the higher bits is the actual numeric value defined in `font-weight-table'. */ FONT_WEIGHT_INDEX, /* FONT-SLANT is a numeric value of slant (e.g. r, i, o) of the - font. The lowest 8-bit is an index determining the symbolic + font. The lowest 8 bits is an index determining the symbolic name, and the higher bits is the actual numeric value defined in `font-slant-table'. */ FONT_SLANT_INDEX, /* FONT-WIDTH is a numeric value of setwidth (e.g. normal) of the - font. The lowest 8-bit is an index determining the symbolic + font. The lowest 8 bits is an index determining the symbolic name, and the higher bits is the actual numeric value defined `font-width-table'. */ FONT_WIDTH_INDEX, /* FONT-SIZE is a size of the font. If integer, it is a pixel - size. For a font-spec, the value can be float specifying a - point size. The value zero means that the font is + size. For a font-spec, the value can be a float specifying + the point size. The value zero means that the font is scalable. */ FONT_SIZE_INDEX, @@ -129,18 +129,18 @@ enum font_property_index /* FONT-STYLE is a 24-bit integer containing indices for style-related properties WEIGHT, SLANT, and WIDTH. The lowest - 8-bit is an indice to the weight table AREF (font_style_table, - 0), the next 8-bit is an indice to the slant table AREF - (font_style_table, 1), the highest 8-bit is an indice to the - slant table AREF (font_style_table, 2). The indice 0 indicates + 8 bits is an index to the weight table AREF (font_style_table, + 0), the next 8 bits is an index to the slant table AREF + (font_style_table, 1), the highest 8 bits is an index to the + slant table AREF (font_style_table, 2). The index 0 indicates that the corresponding style is not specified. This way, we can represent at most 255 different names for each style, which is surely sufficient. */ FONT_STYLE_INDEX, /* FONT-METRICS is a 27-bit integer containing metrics-related - properties DPI, AVGWIDTH, SPACING. The lowest 12-bit is for - DPI, the next 12-bit is for AVGWIDTH, the highest 3-bit is for + properties DPI, AVGWIDTH, SPACING. The lowest 12 bits is for + DPI, the next 12 bits is for AVGWIDTH, the highest 3 bits is for SPACING. In each bit field, the highest bit indicates that the corresponding value is set or not. This way, we can represent DPI by 11-bit (0 to 2047), AVGWIDTH by 11-bit (0 to 2047), @@ -176,7 +176,7 @@ enum font_property_index FONT_NAME_INDEX = FONT_ENTITY_MAX, /* Full name of the font (string). It is the name extracted from - the opend font, and may be different from the above. It may be + the opened font, and may be different from the above. It may be nil if the opened font doesn't give a name. */ FONT_FULLNAME_INDEX, @@ -300,7 +300,7 @@ struct font int space_width; /* Average width of glyphs in the font. If the font itself doesn't - have that information but has glyphs of ASCII character, the + have that information but has glyphs of ASCII characters, the value is the average with of those glyphs. Otherwise, the value is 0. */ int average_width; @@ -321,7 +321,7 @@ struct font int underline_position; /* 1 if `vertical-centering-font-regexp' matches this font name. - In this case, we render characters at vartical center positions + In this case, we render characters at vertical center positions of lines. */ int vertical_centering; @@ -335,27 +335,27 @@ struct font unsigned char encoding_type; /* The baseline position of a font is normally `ascent' value of the - font. However, there exists many fonts which don't set `ascent' + font. However, there exist many fonts which don't set `ascent' to an appropriate value to be used as baseline position. This is typical in such ASCII fonts which are designed to be used with Chinese, Japanese, Korean characters. When we use mixture of such fonts and normal fonts (having correct `ascent' value), a display line gets very ugly. Since we have no way to fix it - automatically, it is users responsibility to supply well designed + automatically, it is user's responsibility to supply well designed fonts or correct `ascent' value of fonts. But, the latter requires heavy work (modifying all bitmap data in BDF files). So, Emacs accepts a private font property `_MULE_BASELINE_OFFSET'. If a font has this property, we calculate the baseline position by subtracting the value from - `ascent'. In other words, the value indicates how many bits - higher we should draw a character of the font than normal ASCII - text for a better looking. + `ascent'. In other words, the value indicates how many pixels + higher than normal ASCII text we should draw a character of the + font for better appearance. We also have to consider the fact that the concept of `baseline' differs among scripts to which each character belongs. For - instance, baseline should be at the bottom most position of all + instance, baseline should be at the bottom-most position of all glyphs for Chinese, Japanese, and Korean. But, many of existing - fonts for those characters doesn't have correct `ascent' values + fonts for those characters don't have correct `ascent' values because they are designed to be used with ASCII fonts. To display characters of different language on the same line, the best way will be to arrange them in the middle of the line. So, @@ -365,20 +365,20 @@ struct font of a line. */ int baseline_offset; - /* Non zero means a character should be composed at a position + /* Non-zero means a character should be composed at a position relative to the height (or depth) of previous glyphs in the following cases: (1) The bottom of the character is higher than this value. In this case, the character is drawn above the previous glyphs. (2) The top of the character is lower than 0 (i.e. baseline - height). In this case, the character is drawn beneath the + height). In this case, the character is drawn below the previous glyphs. This value is taken from a private font property `_MULE_RELATIVE_COMPOSE' which is introduced by Emacs. */ int relative_compose; - /* Non zero means an ascent value to be used for a character + /* Non-zero means an ascent value to be used for a character registered in char-table `use-default-ascent'. */ int default_ascent; @@ -398,8 +398,8 @@ struct font determine it. */ int repertory_charset; - /* There will be more to this structure, but they are private to a - font-driver. */ + /* There are more members in this structure, but they are private + to the font-driver. */ }; enum font_spacing @@ -484,8 +484,8 @@ struct font_bitmap #define POINT_TO_PIXEL(POINT, DPI) ((POINT) * (DPI) / PT_PER_INCH + 0.5) /* Return a point size corresponding to POINT size (integer) - on resolution DPI. Note that though point size is a double, we expect - it to be rounded to an int, so we add 0.5 here. If the desired value + on resolution DPI. Note that though point size is a double, we expect + it to be rounded to an int, so we add 0.5 here. If the desired value is tenths of points (as in xfld specs), then the pixel size should be multiplied BEFORE the conversion to avoid magnifying the error. */ #define PIXEL_TO_POINT(PIXEL, DPI) ((PIXEL) * PT_PER_INCH / (DPI) + 0.5) @@ -582,7 +582,7 @@ struct font_driver If FONT doesn't have such a glyph, return FONT_INVALID_CODE. */ unsigned (*encode_char) (struct font *font, int c); - /* Computate the total metrics of the NGLYPHS glyphs specified by + /* Compute the total metrics of the NGLYPHS glyphs specified by the font FONT and the sequence of glyph codes CODE, and store the result in METRICS. */ int (*text_extents) (struct font *font, @@ -635,7 +635,7 @@ struct font_driver FEATURES specifies which OTF features to apply in this format: (SCRIPT LANGSYS GSUB-FEATURE GPOS-FEATURE) - See the documentation of `font-drive-otf' for the detail. + See the documentation of `font-drive-otf' for the details. This method applies the specified features to the codes in the elements of GSTRING-IN (between FROMth and TOth). The output @@ -710,7 +710,7 @@ struct font_driver struct font_driver_list { - /* 1 iff this driver is currently used. It is igonred in the global + /* 1 iff this driver is currently used. It is ignored in the global font driver list.*/ int on; /* Pointer to the font driver. */ diff --git a/src/frame.c b/src/frame.c index ce92a83b86c..74e222f85fc 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1347,7 +1347,14 @@ delete_frame (Lisp_Object frame, Lisp_Object force) = Fcons (list3 (Qrun_hook_with_args, Qdelete_frame_functions, frame), pending_funcalls); else - safe_call2 (Qrun_hook_with_args, Qdelete_frame_functions, frame); + { +#ifdef HAVE_X_WINDOWS + /* Also, save clipboard to the the clipboard manager. */ + x_clipboard_manager_save_frame (frame); +#endif + + safe_call2 (Qrun_hook_with_args, Qdelete_frame_functions, frame); + } /* The hook may sometimes (indirectly) cause the frame to be deleted. */ if (! FRAME_LIVE_P (f)) diff --git a/src/image.c b/src/image.c index d3702a180c6..0f269f46492 100644 --- a/src/image.c +++ b/src/image.c @@ -7352,6 +7352,10 @@ gif_load (struct frame *f, struct image *img) Lisp_Object Qimagemagick; +static int imagemagick_image_p (Lisp_Object); +static int imagemagick_load (struct frame *, struct image *); +static void imagemagick_clear_image (struct frame *, struct image *); + /* Indices of image specification fields in imagemagick_format. */ enum imagemagick_keyword_index @@ -7394,6 +7398,18 @@ static struct image_keyword imagemagick_format[IMAGEMAGICK_LAST] = {":crop", IMAGE_DONT_CHECK_VALUE_TYPE, 0} }; +/* Structure describing the image type for any image handled via + ImageMagick. */ + +static struct image_type imagemagick_type = + { + &Qimagemagick, + imagemagick_image_p, + imagemagick_load, + imagemagick_clear_image, + NULL + }; + /* Free X resources of imagemagick image IMG which is used on frame F. */ static void @@ -7425,34 +7441,27 @@ imagemagick_image_p (Lisp_Object object) #define DrawRectangle DrawRectangleGif #include -/* imagemagick_load_image is a helper function for imagemagick_load, - which does the actual loading given contents and size, apart from - frame and image structures, passed from imagemagick_load. +/* Helper function for imagemagick_load, which does the actual loading + given contents and size, apart from frame and image structures, + passed from imagemagick_load. Uses librimagemagick to do most of + the image processing. - Uses librimagemagick to do most of the image processing. + F is a pointer to the Emacs frame; IMG to the image structure to + prepare; CONTENTS is the string containing the IMAGEMAGICK data to + be parsed; SIZE is the number of bytes of data; and FILENAME is + either the file name or the image data. - Return non-zero if successful. -*/ + Return non-zero if successful. */ static int -imagemagick_load_image (/* Pointer to emacs frame structure. */ - struct frame *f, - /* Pointer to emacs image structure. */ - struct image *img, - /* String containing the IMAGEMAGICK data to - be parsed. */ - unsigned char *contents, - /* Size of data in bytes. */ - unsigned int size, - /* Filename, either pass filename or - contents/size. */ - unsigned char *filename) +imagemagick_load_image (struct frame *f, struct image *img, + unsigned char *contents, unsigned int size, + unsigned char *filename) { unsigned long width; unsigned long height; - MagickBooleanType - status; + MagickBooleanType status; XImagePtr ximg; Lisp_Object specified_bg; @@ -7514,8 +7523,8 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */ DestroyMagickWand (ping_wand); - /* Now, after pinging, we know how many images are inside the - file. If it's not a bundle, the number is one. */ + /* Now we know how many images are inside the file. If it's not a + bundle, the number is one. */ if (filename != NULL) { @@ -7628,8 +7637,8 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */ } } - /* Finaly we are done manipulating the image, figure out resulting - width, height, and then transfer ownerwship to Emacs. */ + /* Finally we are done manipulating the image. Figure out the + resulting width/height and transfer ownerwship to Emacs. */ height = MagickGetImageHeight (image_wand); width = MagickGetImageWidth (image_wand); @@ -7784,8 +7793,7 @@ imagemagick_load_image (/* Pointer to emacs frame structure. */ the prototype thus needs to be compatible with that structure. */ static int -imagemagick_load (struct frame *f, - struct image *img) +imagemagick_load (struct frame *f, struct image *img) { int success_p = 0; Lisp_Object file_name; @@ -7823,36 +7831,18 @@ imagemagick_load (struct frame *f, return success_p; } -/* Structure describing the image type `imagemagick'. Its the same - type of structure defined for all image formats, handled by Emacs - image functions. See struct image_type in dispextern.h. */ - -static struct image_type imagemagick_type = - { - /* An identifier showing that this is an image structure for the - IMAGEMAGICK format. */ - &Qimagemagick, - /* Handle to a function that can be used to identify a IMAGEMAGICK - file. */ - imagemagick_image_p, - /* Handle to function used to load a IMAGEMAGICK file. */ - imagemagick_load, - /* Handle to function to free resources for IMAGEMAGICK. */ - imagemagick_clear_image, - /* An internal field to link to the next image type in a list of - image types, will be filled in when registering the format. */ - NULL - }; - - DEFUN ("imagemagick-types", Fimagemagick_types, Simagemagick_types, 0, 0, 0, - doc: /* Return the image types supported by ImageMagick. -Note that ImageMagick recognizes many file-types that Emacs does not recognize -as images, such as .c. */) + doc: /* Return a list of image types supported by ImageMagick. +Each entry in this list is a symbol named after an ImageMagick format +tag. See the ImageMagick manual for a list of ImageMagick formats and +their descriptions (http://www.imagemagick.org/script/formats.php). + +Note that ImageMagick recognizes many file-types that Emacs does not +recognize as images, such as C. See `imagemagick-types-inhibit'. */) (void) { Lisp_Object typelist = Qnil; - unsigned long numf; + unsigned long numf = 0; ExceptionInfo ex; char **imtypes = GetMagickList ("*", &numf, &ex); int i; diff --git a/src/xselect.c b/src/xselect.c index 8741cb89967..73ef4abc0a4 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -489,10 +489,10 @@ struct selection_data /* Linked list of the above (in support of MULTIPLE targets). */ -struct selection_data *converted_selections; +static struct selection_data *converted_selections; /* "Data" to send a requestor for a failed MULTIPLE subtarget. */ -Atom conversion_fail_tag; +static Atom conversion_fail_tag; /* Used as an unwind-protect clause so that, if a selection-converter signals an error, we tell the requester that we were unable to do what they wanted @@ -2107,6 +2107,7 @@ frame's display, or the first available X display. */) return (owner ? Qt : Qnil); } + /* Send the clipboard manager a SAVE_TARGETS request with a UTF8_STRING property, as described by http://www.freedesktop.org/wiki/ClipboardManager */ @@ -2126,54 +2127,53 @@ x_clipboard_manager_save (struct x_display_info *dpyinfo, Qnil, frame); } -DEFUN ("x-clipboard-manager-save", Fx_clipboard_manager_save, - Sx_clipboard_manager_save, 0, 1, 0, - doc: /* Save the clipboard contents to the clipboard manager. -This function is intended to run from `delete-frame-functions' and -`kill-emacs-hook', to transfer clipboard data owned by Emacs to a -clipboard manager prior to deleting a frame or killing Emacs. +/* Called from delete_frame: save any clipboard owned by FRAME to the + clipboard manager. Do nothing if FRAME does not own the clipboard, + or if no clipboard manager is present. */ -FRAME specifies a frame owning a clipboard; do nothing if FRAME does -not own the clipboard, or if no clipboard manager is present. If -FRAME is nil, save all clipboard contents owned by Emacs. */) - (Lisp_Object frame) +void +x_clipboard_manager_save_frame (Lisp_Object frame) { - if (FRAMEP (frame)) + struct frame *f; + + if (FRAMEP (frame) + && (f = XFRAME (frame), FRAME_X_P (f)) + && FRAME_LIVE_P (f)) { - struct frame *f = XFRAME (frame); - if (FRAME_LIVE_P (f) && FRAME_X_P (f)) - { - struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); - Lisp_Object local_selection - = LOCAL_SELECTION (QCLIPBOARD, dpyinfo); + struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + Lisp_Object local_selection + = LOCAL_SELECTION (QCLIPBOARD, dpyinfo); - if (!NILP (local_selection) - && EQ (frame, XCAR (XCDR (XCDR (XCDR (local_selection))))) - && XGetSelectionOwner (dpyinfo->display, - dpyinfo->Xatom_CLIPBOARD_MANAGER)) - x_clipboard_manager_save (dpyinfo, frame); - } + if (!NILP (local_selection) + && EQ (frame, XCAR (XCDR (XCDR (XCDR (local_selection))))) + && XGetSelectionOwner (dpyinfo->display, + dpyinfo->Xatom_CLIPBOARD_MANAGER)) + x_clipboard_manager_save (dpyinfo, frame); } - else if (NILP (frame)) +} + +/* Called from Fkill_emacs: save any clipboard owned by FRAME to the + clipboard manager. Do nothing if FRAME does not own the clipboard, + or if no clipboard manager is present. */ + +void +x_clipboard_manager_save_all (void) +{ + /* Loop through all X displays, saving owned clipboards. */ + struct x_display_info *dpyinfo; + Lisp_Object local_selection, local_frame; + for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) { - /* Loop through all X displays, saving owned clipboards. */ - struct x_display_info *dpyinfo; - Lisp_Object local_selection, local_frame; - for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next) - { - local_selection = LOCAL_SELECTION (QCLIPBOARD, dpyinfo); - if (NILP (local_selection) - || !XGetSelectionOwner (dpyinfo->display, - dpyinfo->Xatom_CLIPBOARD_MANAGER)) - continue; + local_selection = LOCAL_SELECTION (QCLIPBOARD, dpyinfo); + if (NILP (local_selection) + || !XGetSelectionOwner (dpyinfo->display, + dpyinfo->Xatom_CLIPBOARD_MANAGER)) + continue; - local_frame = XCAR (XCDR (XCDR (XCDR (local_selection)))); - if (FRAME_LIVE_P (XFRAME (local_frame))) - x_clipboard_manager_save (dpyinfo, local_frame); - } + local_frame = XCAR (XCDR (XCDR (XCDR (local_selection)))); + if (FRAME_LIVE_P (XFRAME (local_frame))) + x_clipboard_manager_save (dpyinfo, local_frame); } - - return Qnil; } @@ -2586,7 +2586,6 @@ syms_of_xselect (void) defsubr (&Sx_disown_selection_internal); defsubr (&Sx_selection_owner_p); defsubr (&Sx_selection_exists_p); - defsubr (&Sx_clipboard_manager_save); defsubr (&Sx_get_atom_name); defsubr (&Sx_send_client_message); diff --git a/src/xterm.h b/src/xterm.h index c44978d5386..2938de9b339 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1024,6 +1024,8 @@ extern Lisp_Object x_property_data_to_lisp (struct frame *, Atom, int, unsigned long); +extern void x_clipboard_manager_save_frame (Lisp_Object); +extern void x_clipboard_manager_save_all (void); /* Defined in xfns.c */