------------------------------------------------------------ revno: 118162 committer: Jan D. branch nick: trunk timestamp: Sun 2014-10-19 22:35:32 +0200 message: Fix spelling error. * NEWS: Teroffs and detachable tool bar for Gtk+ is gone. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-10-19 17:07:32 +0000 +++ etc/NEWS 2014-10-19 20:35:32 +0000 @@ -384,7 +384,7 @@ specific frame does not resize that frame in order to preserve the number of columns or lines it displays. -** Teroff menus and detachable toolbars for Gtk+ has been removed. +** Tearoff menus and detachable toolbars for Gtk+ has been removed. Those features have been deprecated in Gtk+ for a long time. ------------------------------------------------------------ revno: 118161 committer: Eli Zaretskii branch nick: trunk timestamp: Sun 2014-10-19 22:13:29 +0300 message: src/ChangeLog: Remove stray duplicate entry. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-19 17:27:53 +0000 +++ src/ChangeLog 2014-10-19 19:13:29 +0000 @@ -933,10 +933,6 @@ 2014-09-22 Eli Zaretskii - * w32.c (fcntl): Support O_NONBLOCK fcntl on the write side of pipes. - -2014-09-22 Eli Zaretskii - * fileio.c (Fexpand_file_name) [DOS_NT]: Make sure newdirlim is always set to a valid value. Make sure the size passed to alloca is always positive. (Bug#18516) ------------------------------------------------------------ revno: 118160 fixes bug: http://debbugs.gnu.org/18674 committer: Jan D. branch nick: trunk timestamp: Sun 2014-10-19 19:27:53 +0200 message: * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on Gt+ >= 3.12, or gtk_misc_set_alignment on Gtk+ >= 3.14. (make_widget_for_menu_item): Don't use gtk_misc_set_alignment on Gtk+ >= 3.14 (Bug#18674). (update_frame_tool_bar): Don't use gtk_misc_set_padding on Gtk+ >= 3.14 (Bug#18674). * gtkutil.c (xg_update_menubar, xg_update_menu_item): Only call g_object_notify for label if Gtk+ >= 2.16 (Bug#16522). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-19 17:07:54 +0000 +++ src/ChangeLog 2014-10-19 17:27:53 +0000 @@ -1,5 +1,8 @@ 2014-10-19 Jan Djärv + * gtkutil.c (xg_update_menubar, xg_update_menu_item): Only call + g_object_notify for label if Gtk+ >= 2.16 (Bug#16522). + * xterm.h (x_output): Remove net_wm_state_hidden_seen. * xterm.c (handle_one_xevent): Check return value from === modified file 'src/gtkutil.c' --- src/gtkutil.c 2014-10-19 16:28:49 +0000 +++ src/gtkutil.c 2014-10-19 17:27:53 +0000 @@ -2816,8 +2816,9 @@ bridge that might be loaded) that the item's label has changed. */ gtk_label_set_text (wlabel, utf8_label); +#if GTK_CHECK_VERSION (2, 16, 0) g_object_notify (G_OBJECT (witem), "label"); - +#endif if (utf8_label) g_free (utf8_label); iter = g_list_next (iter); val = val->next; @@ -2996,8 +2997,10 @@ } } +#if GTK_CHECK_VERSION (2, 16, 0) if (label_changed) /* See comment in xg_update_menubar. */ g_object_notify (G_OBJECT (w), "label"); +#endif } /* Update the toggle menu item W so it corresponds to VAL. */ ------------------------------------------------------------ revno: 118159 fixes bug: http://debbugs.gnu.org/18722 committer: Jan D. branch nick: trunk timestamp: Sun 2014-10-19 19:07:54 +0200 message: * src/xterm.c (handle_one_xevent): Check return value from x_handle_net_wm_state, remove net_wm_state_hidden_seen. (get_current_wm_state): Remove net_wm_state_hidden_seen setting. * src/xterm.h (x_output): Remove net_wm_state_hidden_seen. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-19 16:28:49 +0000 +++ src/ChangeLog 2014-10-19 17:07:54 +0000 @@ -1,5 +1,11 @@ 2014-10-19 Jan Djärv + * xterm.h (x_output): Remove net_wm_state_hidden_seen. + + * xterm.c (handle_one_xevent): Check return value from + x_handle_net_wm_state, remove net_wm_state_hidden_seen (Bug#18722). + (get_current_wm_state): Remove net_wm_state_hidden_seen setting. + * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on Gt+ >= 3.12, or gtk_misc_set_alignment on Gtk+ >= 3.14 (Bug#18674). (make_widget_for_menu_item): Don't use gtk_misc_set_alignment on === modified file 'src/xterm.c' --- src/xterm.c 2014-10-18 13:09:18 +0000 +++ src/xterm.c 2014-10-19 17:07:54 +0000 @@ -6850,9 +6850,8 @@ f = x_top_window_to_frame (dpyinfo, event->xproperty.window); if (f && event->xproperty.atom == dpyinfo->Xatom_net_wm_state) { - if (x_handle_net_wm_state (f, &event->xproperty) - && FRAME_ICONIFIED_P (f) - && f->output_data.x->net_wm_state_hidden_seen) + int not_hidden = x_handle_net_wm_state (f, &event->xproperty); + if (not_hidden && FRAME_ICONIFIED_P (f)) { /* Gnome shell does not iconify us when C-z is pressed. It hides the frame. So if our state says we aren't @@ -6860,12 +6859,10 @@ SET_FRAME_VISIBLE (f, 1); SET_FRAME_ICONIFIED (f, 0); f->output_data.x->has_been_visible = 1; - f->output_data.x->net_wm_state_hidden_seen = 0; inev.ie.kind = DEICONIFY_EVENT; XSETFRAME (inev.ie.frame_or_window, f); } - else if (! FRAME_ICONIFIED_P (f) - && f->output_data.x->net_wm_state_hidden_seen) + else if (! not_hidden && ! FRAME_ICONIFIED_P (f)) { SET_FRAME_VISIBLE (f, 0); SET_FRAME_ICONIFIED (f, 1); @@ -9165,7 +9162,6 @@ if (a == dpyinfo->Xatom_net_wm_state_hidden) { is_hidden = 1; - f->output_data.x->net_wm_state_hidden_seen = 1; } else if (a == dpyinfo->Xatom_net_wm_state_maximized_horz) { === modified file 'src/xterm.h' --- src/xterm.h 2014-10-18 16:19:53 +0000 +++ src/xterm.h 2014-10-19 17:07:54 +0000 @@ -609,9 +609,6 @@ false, tell Xt not to wait. */ bool_bf wait_for_wm : 1; - /* True if _NET_WM_STATE_HIDDEN is set for this frame. */ - bool_bf net_wm_state_hidden_seen : 1; - #ifdef HAVE_X_I18N /* Input context (currently, this means Compose key handler setup). */ XIC xic; ------------------------------------------------------------ revno: 118158 committer: Jan D. branch nick: trunk timestamp: Sun 2014-10-19 19:07:32 +0200 message: * NEWS: Teroffs and detachable tool bar for Gtk+ is gone. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-10-19 16:50:15 +0000 +++ etc/ChangeLog 2014-10-19 17:07:32 +0000 @@ -1,3 +1,7 @@ +2014-10-19 Jan Djärv + + * NEWS: Teroffs and detachable tool bar for Gtk+ is gone. + 2014-10-19 Ulf Jasper * images/newsticker/rss-feed.png: New. === modified file 'etc/NEWS' --- etc/NEWS 2014-10-18 00:22:13 +0000 +++ etc/NEWS 2014-10-19 17:07:32 +0000 @@ -384,6 +384,9 @@ specific frame does not resize that frame in order to preserve the number of columns or lines it displays. +** Teroff menus and detachable toolbars for Gtk+ has been removed. +Those features have been deprecated in Gtk+ for a long time. + * Changes in Emacs 25.1 on Non-Free Operating Systems ------------------------------------------------------------ revno: 118157 committer: Ulf Jasper branch nick: trunk timestamp: Sun 2014-10-19 18:50:15 +0200 message: Newsticker: Show feedicons in treeview. Small fix in opml export. * etc/images/newsticker/README: Add rss-feed.png, rss-feed.svg. * etc/images/newsticker/rss-feed.png: New. * etc/images/newsticker/rss-feed.svg: New. * lisp/net/newst-backend.el: Require url-parse. (newsticker--get-news-by-wget): Store feed name as process property. (newsticker--sentinel): Read feed name from process property. (newsticker--sentinel-work): Rename argument name to feed-name. Rename variable imageurl to image-url. Pick icon url from Atom 1.0 data. Launch download of feed icon. (newsticker--get-icon-url-atom-1.0): New. (newsticker--unxml) (newsticker--unxml-node) (newsticker--unxml-attribute): Documentation. (newsticker--icons-dir): New. (newsticker--image-get): New arguments FILENAME and DIRECTORY. Use `url-retrieve' if `newsticker-retrieval-method' is 'intern. (newsticker--image-download-by-wget): New. Use process properties for storing informations. (newsticker--image-sentinel): Read informations from process properties. (newsticker--image-save) (newsticker--image-remove) (newsticker--image-download-by-url) (newsticker--image-download-by-url-callback): New. (newsticker-opml-export): Handle url list entries containing a function instead of an url string. * lisp/net/newst-reader.el (newsticker-html-renderer): Whitespace. (newsticker--print-extra-elements) (newsticker--do-print-extra-element): Documentation (newsticker--image-read): Optionally limit image height. Use imagemagick if possible. (newsticker--icon-read): New. * lisp/net/newst-treeview.el (newsticker--treeview-item-show): Limit height of feed logo. (newsticker--treeview-tree-expand): Use feed icons in treeview. (newsticker--tree-widget-icon-create): New. Set the tree widget icon. (newsticker--tree-widget-leaf-icon): Use feed icon. diff: === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-10-18 00:22:13 +0000 +++ etc/ChangeLog 2014-10-19 16:50:15 +0000 @@ -1,3 +1,11 @@ +2014-10-19 Ulf Jasper + + * images/newsticker/rss-feed.png: New. + + * images/newsticker/rss-feed.svg: New. + + * images/newsticker/README: Add rss-feed.png, rss-feed.svg. + 2014-10-18 Michal Nazarewicz * NEWS: Mention new whitespace-mode option: big-indent. === modified file 'etc/images/newsticker/README' --- etc/images/newsticker/README 2014-01-01 07:43:34 +0000 +++ etc/images/newsticker/README 2014-10-19 16:50:15 +0000 @@ -2,7 +2,7 @@ Files: browse-url.xpm get-all.xpm mark-immortal.xpm mark-read.xpm narrow.xpm next-feed.xpm next-item.xpm prev-feed.xpm - prev-item.xpm update.xpm + prev-item.xpm rss-feed.png rss-feed.svg update.xpm Author: Ulf Jasper Copyright (C) 2011-2014 Free Software Foundation, Inc. License: GNU General Public License version 3 or later (see COPYING) === added file 'etc/images/newsticker/rss-feed.png' Binary files etc/images/newsticker/rss-feed.png 1970-01-01 00:00:00 +0000 and etc/images/newsticker/rss-feed.png 2014-10-19 16:50:15 +0000 differ === added file 'etc/images/newsticker/rss-feed.svg' --- etc/images/newsticker/rss-feed.svg 1970-01-01 00:00:00 +0000 +++ etc/images/newsticker/rss-feed.svg 2014-10-19 16:50:15 +0000 @@ -0,0 +1,121 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-10-19 02:14:58 +0000 +++ lisp/ChangeLog 2014-10-19 16:50:15 +0000 @@ -1,3 +1,40 @@ +2014-10-19 Ulf Jasper + + * net/newst-backend.el: Require url-parse. + (newsticker--get-news-by-wget): Store feed name as process property. + (newsticker--sentinel): Read feed name from process property. + (newsticker--sentinel-work): Rename argument name to feed-name. + Rename variable imageurl to image-url. Pick icon url from Atom + 1.0 data. Launch download of feed icon. + (newsticker--get-icon-url-atom-1.0): New. + (newsticker--unxml) + (newsticker--unxml-node) + (newsticker--unxml-attribute): Documentation. + (newsticker--icons-dir): New. + (newsticker--image-get): New arguments FILENAME and DIRECTORY. + Use `url-retrieve' if `newsticker-retrieval-method' is 'intern. + (newsticker--image-download-by-wget): New. Use process properties + for storing informations. + (newsticker--image-sentinel): Read informations from process properties. + (newsticker--image-save) + (newsticker--image-remove) + (newsticker--image-download-by-url) + (newsticker--image-download-by-url-callback): New. + (newsticker-opml-export): Handle url list entries containing a + function instead of an url string. + + * net/newst-reader.el (newsticker-html-renderer): Whitespace. + (newsticker--print-extra-elements) + (newsticker--do-print-extra-element): Documentation + (newsticker--image-read): Optionally limit image height. Use + imagemagick if possible. + (newsticker--icon-read): New. + + * net/newst-treeview.el (newsticker--treeview-item-show): Limit height of feed logo. + (newsticker--treeview-tree-expand): Use feed icons in treeview. + (newsticker--tree-widget-icon-create): New. Set the tree widget icon. + (newsticker--tree-widget-leaf-icon): Use feed icon. + 2014-10-19 Stefan Monnier * emacs-lisp/eieio-opt.el (eieio-lambda-arglist): Remove. === modified file 'lisp/net/newst-backend.el' --- lisp/net/newst-backend.el 2014-10-01 17:20:00 +0000 +++ lisp/net/newst-backend.el 2014-10-19 16:50:15 +0000 @@ -36,6 +36,7 @@ (require 'derived) (require 'xml) +(require 'url-parse) ;; Silence warnings (defvar w3-mode-map) @@ -776,6 +777,7 @@ newsticker-wget-name args))) (set-process-coding-system proc 'no-conversion 'no-conversion) (set-process-sentinel proc 'newsticker--sentinel) + (process-put proc 'nt-feed-name feed-name) (setq newsticker--process-ids (cons (process-id proc) newsticker--process-ids)) (force-mode-line-update))))) @@ -811,24 +813,24 @@ Argument EVENT tells what has happened to the process." (let ((p-status (process-status process)) (exit-status (process-exit-status process)) - (name (process-name process)) + (feed-name (process-get process 'nt-feed-name)) (command (process-command process)) (buffer (process-buffer process))) (newsticker--sentinel-work event (and (eq p-status 'exit) (= exit-status 0)) - name command buffer))) + feed-name command buffer))) -(defun newsticker--sentinel-work (event status-ok name command buffer) +(defun newsticker--sentinel-work (event status-ok feed-name command buffer) "Actually do the sentinel work. Argument EVENT tells what has happened to the retrieval process. Argument STATUS-OK is the final status of the retrieval process, non-nil meaning retrieval was successful. -Argument NAME is the name of the retrieval process. +Argument FEED-NAME is the name of the retrieved feed. Argument COMMAND is the command of the retrieval process. Argument BUFFER is the buffer of the retrieval process." (let ((time (current-time)) - (name-symbol (intern name)) + (name-symbol (intern feed-name)) (something-was-added nil)) ;; catch known errors (zombie processes, rubbish-xml etc. ;; if an error occurs the news feed is not updated! @@ -844,14 +846,14 @@ "Return status: `%s'\n" "Command was `%s'") (format-time-string "%A, %H:%M" (current-time)) - name event command) + feed-name event command) "" (current-time) 'new 0 nil)) (message "%s: Error while retrieving news from %s" (format-time-string "%A, %H:%M" (current-time)) - name) + feed-name) (throw 'oops nil)) (let* ((coding-system 'utf-8) (node-list @@ -870,7 +872,7 @@ (coding-system-error (message "newsticker.el: ignoring coding system %s for %s" - coding-system name) + coding-system feed-name) nil)))) ;; Decode if possible (when coding-system @@ -886,7 +888,8 @@ (buffer-name) (cadr errordata)) (throw 'oops nil))))) (topnode (car node-list)) - (imageurl nil)) + (image-url nil) + (icon-url nil)) ;; mark all items as obsolete (newsticker--cache-replace-age newsticker--cache name-symbol @@ -904,29 +907,29 @@ ;; RSS 0.91 ((and (eq 'rss (xml-node-name topnode)) (string= "0.91" (xml-get-attribute topnode 'version))) - (setq imageurl (newsticker--get-logo-url-rss-0.91 topnode)) - (newsticker--parse-rss-0.91 name time topnode)) + (setq image-url (newsticker--get-logo-url-rss-0.91 topnode)) + (newsticker--parse-rss-0.91 feed-name time topnode)) ;; RSS 0.92 ((and (eq 'rss (xml-node-name topnode)) (string= "0.92" (xml-get-attribute topnode 'version))) - (setq imageurl (newsticker--get-logo-url-rss-0.92 topnode)) - (newsticker--parse-rss-0.92 name time topnode)) + (setq image-url (newsticker--get-logo-url-rss-0.92 topnode)) + (newsticker--parse-rss-0.92 feed-name time topnode)) ;; RSS 1.0 ((or (eq 'RDF (xml-node-name topnode)) (eq 'rdf:RDF (xml-node-name topnode))) - (setq imageurl (newsticker--get-logo-url-rss-1.0 topnode)) - (newsticker--parse-rss-1.0 name time topnode)) + (setq image-url (newsticker--get-logo-url-rss-1.0 topnode)) + (newsticker--parse-rss-1.0 feed-name time topnode)) ;; RSS 2.0 ((and (eq 'rss (xml-node-name topnode)) (string= "2.0" (xml-get-attribute topnode 'version))) - (setq imageurl (newsticker--get-logo-url-rss-2.0 topnode)) - (newsticker--parse-rss-2.0 name time topnode)) + (setq image-url (newsticker--get-logo-url-rss-2.0 topnode)) + (newsticker--parse-rss-2.0 feed-name time topnode)) ;; Atom 0.3 ((and (eq 'feed (xml-node-name topnode)) (string= "http://purl.org/atom/ns#" (xml-get-attribute topnode 'xmlns))) - (setq imageurl (newsticker--get-logo-url-atom-0.3 topnode)) - (newsticker--parse-atom-0.3 name time topnode)) + (setq image-url (newsticker--get-logo-url-atom-0.3 topnode)) + (newsticker--parse-atom-0.3 feed-name time topnode)) ;; Atom 1.0 (t ;; The test for Atom 1.0 does not work when using @@ -938,16 +941,17 @@ ;; (and (eq 'feed (xml-node-name topnode)) ;; (string= "http://www.w3.org/2005/Atom" ;; (xml-get-attribute topnode 'xmlns))) - (setq imageurl (newsticker--get-logo-url-atom-1.0 topnode)) - (newsticker--parse-atom-1.0 name time topnode)) + (setq image-url (newsticker--get-logo-url-atom-1.0 topnode)) + (setq icon-url (newsticker--get-icon-url-atom-1.0 topnode)) + (newsticker--parse-atom-1.0 feed-name time topnode)) ;; unknown feed type ;; (t ;; (newsticker--debug-msg "Feed type unknown: %s: %s" - ;; (xml-node-name topnode) name) + ;; (xml-node-name topnode) feed-name) ;; nil) ) (setq something-was-added t)) - (error (message "sentinelerror in %s: %s" name error-data))) + (error (message "sentinelerror in %s: %s" feed-name error-data))) ;; Remove those old items from cache which have been removed from ;; the feed @@ -988,10 +992,29 @@ ;; kill the process buffer if wanted (unless newsticker-debug (kill-buffer buffer)) - ;; launch retrieval of image - (when (and imageurl (boundp 'newsticker-download-logos) + ;; launch retrieval of images + (when (and (boundp 'newsticker-download-logos) newsticker-download-logos) - (newsticker--image-get name imageurl))))) + ;; feed logo + (when image-url + (newsticker--image-get feed-name feed-name (newsticker--images-dir) + image-url)) + ;; icon / favicon + (setq icon-url + (or icon-url + (let* ((feed-url (newsticker--link (cadr (newsticker--cache-get-feed + (intern feed-name))))) + (uri (url-generic-parse-url feed-url))) + (when (and feed-url uri) + (setf (url-filename uri) nil) + (setf (url-target uri) nil) + (concat (url-recreate-url uri) "favicon.ico"))))) + (when icon-url + (newsticker--image-get feed-name + (concat feed-name "." + (file-name-extension icon-url)) + (newsticker--icons-dir) + icon-url)))))) (when newsticker--sentinel-callback (funcall newsticker--sentinel-callback))) @@ -1055,6 +1078,11 @@ (car (xml-node-children (car (xml-get-children node 'logo))))) +(defun newsticker--get-icon-url-atom-1.0 (node) + "Return icon URL from atom 1.0 data in NODE." + (car (xml-node-children + (car (xml-get-children node 'icon))))) + (defun newsticker--get-logo-url-atom-0.3 (node) "Return logo URL from atom 0.3 data in NODE." (car (xml-node-children @@ -1133,13 +1161,13 @@ (defun newsticker--unxml (node) "Reverse parsing of an xml string. -Restore an xml-string from a an xml-node that was returned by xml-parse..." +Restore an xml-string from a an xml NODE that was returned by xml-parse..." (if (or (not node) (stringp node)) node (newsticker--unxml-node node))) (defun newsticker--unxml-node (node) - "Actually restore xml-string of an xml node." + "Actually restore xml-string of an xml NODE." (let ((qname (symbol-name (car node))) (att-list (cadr node)) (children (cddr node))) @@ -1149,10 +1177,10 @@ ">" (mapconcat 'newsticker--unxml children "") ""))) -(defun newsticker--unxml-attribute (att) - "Actually restore xml-string of an attribute of an xml node." - (let ((name (symbol-name (car att))) - (value (cdr att))) +(defun newsticker--unxml-attribute (attribute) + "Actually restore xml-string of an ATTRIBUTE of an xml node." + (let ((name (symbol-name (car attribute))) + (value (cdr attribute))) (concat name "=\"" value "\""))) (defun newsticker--parse-atom-1.0 (name time topnode) @@ -1766,14 +1794,19 @@ "Return directory where feed images are saved." (concat newsticker-dir "/images/")) -(defun newsticker--image-get (feed-name url) - "Get image of the news site FEED-NAME from URL. -If the image has been downloaded in the last 24h do nothing." - (let ((image-name (concat (newsticker--images-dir) feed-name))) +(defun newsticker--icons-dir () + "Return directory where feed icons are saved." + (concat newsticker-dir "/icons/")) + +(defun newsticker--image-get (feed-name filename directory url) + "Get image for FEED-NAME by returning FILENAME from DIRECTORY. +If the file does no exist or if it is older than 24 hours +download it from URL first." + (let ((image-name (concat directory feed-name))) (if (and (file-exists-p image-name) (time-less-p (current-time) (time-add (nth 5 (file-attributes image-name)) - (seconds-to-time 86400)))) + (seconds-to-time 86400)))) (newsticker--debug-msg "%s: Getting image for %s skipped" (format-time-string "%A, %H:%M" (current-time)) feed-name) @@ -1781,14 +1814,22 @@ (newsticker--debug-msg "%s: Getting image for %s" (format-time-string "%A, %H:%M" (current-time)) feed-name) - (let* ((buffername (concat " *newsticker-wget-image-" feed-name "*")) - (item (or (assoc feed-name newsticker-url-list) + (if (eq newsticker-retrieval-method 'intern) + (newsticker--image-download-by-url feed-name filename directory url) + (newsticker--image-download-by-wget feed-name filename directory url))))) + +(defun newsticker--image-download-by-wget (feed-name filename directory url) + "Download image for FEED-NAME using external program. +Save image as FILENAME in DIRECTORY, download it from URL." + (let* ((proc-name (concat feed-name "-" filename)) + (buffername (concat " *newsticker-wget-image-" proc-name "*")) + (item (or (assoc feed-name newsticker-url-list) (assoc feed-name newsticker-url-list-defaults) (error "Cannot get image for %s: Check newsticker-url-list" feed-name))) - (wget-arguments (or (car (cdr (cdr (cdr (cdr item))))) - newsticker-wget-arguments))) + (wget-arguments (or (car (cdr (cdr (cdr (cdr item))))) + newsticker-wget-arguments))) (with-current-buffer (get-buffer-create buffername) (erase-buffer) ;; throw an error if there is an old wget-process around @@ -1797,16 +1838,21 @@ feed-name)) ;; start wget (let* ((args (append wget-arguments (list url))) - (proc (apply 'start-process feed-name buffername + (proc (apply 'start-process proc-name buffername newsticker-wget-name args))) (set-process-coding-system proc 'no-conversion 'no-conversion) - (set-process-sentinel proc 'newsticker--image-sentinel))))))) + (set-process-sentinel proc 'newsticker--image-sentinel) + (process-put proc 'nt-directory directory) + (process-put proc 'nt-feed-name feed-name) + (process-put proc 'nt-filename filename))))) (defun newsticker--image-sentinel (process event) "Sentinel for image-retrieving PROCESS caused by EVENT." (let* ((p-status (process-status process)) (exit-status (process-exit-status process)) - (feed-name (process-name process))) + (feed-name (process-get process 'nt-feed-name)) + (directory (process-get process 'nt-directory)) + (filename (process-get process 'nt-filename))) ;; catch known errors (zombie processes, rubbish-xml, etc.) ;; if an error occurs the news feed is not updated! (catch 'oops @@ -1815,21 +1861,67 @@ (message "%s: Error while retrieving image from %s" (format-time-string "%A, %H:%M" (current-time)) feed-name) + (newsticker--image-remove directory feed-name) (throw 'oops nil)) - (let (image-name) - (with-current-buffer (process-buffer process) - (setq image-name (concat (newsticker--images-dir) feed-name)) - (set-buffer-file-coding-system 'no-conversion) - ;; make sure the cache dir exists - (unless (file-directory-p (newsticker--images-dir)) - (make-directory (newsticker--images-dir))) - ;; write and close buffer - (let ((require-final-newline nil) - (backup-inhibited t) - (coding-system-for-write 'no-conversion)) - (write-region nil nil image-name nil 'quiet)) - (set-buffer-modified-p nil) - (kill-buffer (current-buffer))))))) + (newsticker--image-save (process-buffer process) directory filename)))) + +(defun newsticker--image-save (buffer directory file-name) + "Save contents of BUFFER in DIRECTORY as FILE-NAME. +Finally kill buffer." + (with-current-buffer buffer + (let ((image-name (concat directory file-name))) + (set-buffer-file-coding-system 'no-conversion) + ;; make sure the cache dir exists + (unless (file-directory-p directory) + (make-directory directory)) + ;; write and close buffer + (let ((require-final-newline nil) + (backup-inhibited t) + (coding-system-for-write 'no-conversion)) + (write-region nil nil image-name nil 'quiet)) + (set-buffer-modified-p nil) + (kill-buffer buffer)))) + +(defun newsticker--image-remove (directory file-name) + "In DIRECTORY remove FILE-NAME." + (let ((image-name (concat directory file-name))) + (when (file-exists-p file-name) + (delete-file image-name)))) + +(defun newsticker--image-download-by-url (feed-name filename directory url) + "Download image for FEED-NAME using `url-retrieve'. +Save image as FILENAME in DIRECTORY, download it from URL." + (let ((coding-system-for-read 'no-conversion)) + (condition-case error-data + (url-retrieve url 'newsticker--image-download-by-url-callback + (list feed-name directory filename)) + (error (message "Error retrieving image from %s: %s" feed-name + error-data)))) + (force-mode-line-update)) + +(defun newsticker--image-download-by-url-callback (status feed-name directory filename) + "Callback function for `newsticker--image-download-by-url'. +STATUS is the return status as delivered by `url-retrieve'. +FEED-NAME is the name of the feed that the news were retrieved +from. +The image is saved in DIRECTORY as FILENAME." + (when status + (let ((status-type (car status)) + (status-details (cdr status))) + (cond ((eq status-type :error) + (newsticker--image-remove directory feed-name)) + (t + (let ((buf (get-buffer-create (concat " *newsticker-url-image-" feed-name "-" directory "*"))) + (result (string-to-multibyte (buffer-string)))) + (set-buffer buf) + (erase-buffer) + (insert result) + ;; remove MIME header + (goto-char (point-min)) + (search-forward "\n\n") + (delete-region (point-min) (point)) + ;; save + (newsticker--image-save buf directory filename))))))) (defun newsticker--insert-image (img string) "Insert IMG with STRING at point." @@ -2244,6 +2336,7 @@ (defun newsticker-opml-export () "OPML subscription export. Export subscriptions to a buffer in OPML Format." + ;; FIXME: use newsticker-groups (interactive) (with-current-buffer (get-buffer-create "*OPML Export*") (set-buffer-file-coding-system 'utf-8) @@ -2263,7 +2356,8 @@ (insert " \n")) (append newsticker-url-list newsticker-url-list-defaults)) (insert " \n\n")) === modified file 'lisp/net/newst-reader.el' --- lisp/net/newst-reader.el 2014-10-01 17:20:00 +0000 +++ lisp/net/newst-reader.el 2014-10-19 16:50:15 +0000 @@ -110,7 +110,7 @@ #'shr-render-region) "Function for rendering HTML contents. If non-nil, newsticker.el will call this function whenever it -finds HTML-like tags in item descriptions. +finds HTML-like tags in item descriptions. Possible functions include `shr-render-region', `w3m-region', `w3-region', and `newsticker-htmlr-render'. Newsticker automatically loads the respective package w3m, w3, or @@ -193,7 +193,8 @@ (defun newsticker--print-extra-elements (item keymap &optional htmlish) "Insert extra-elements of ITEM in a pretty form into the current buffer. -KEYMAP is applied." +KEYMAP is applied. If HTMLISH is non-nil then HTML-markup is used +for formatting." (let ((ignored-elements '(items link title description content content:encoded encoded dc:subject subject @@ -223,7 +224,8 @@ (defun newsticker--do-print-extra-element (extra-element width keymap htmlish) "Actually print an EXTRA-ELEMENT using the given WIDTH. -KEYMAP is applied." +KEYMAP is applied. If HTMLISH is non-nil then HTML-markup is used +for formatting." (let ((name (symbol-name (car extra-element)))) (if htmlish (insert (format "
  • %s: " name)) @@ -253,10 +255,11 @@ (insert "
  • ") (insert "\n")))) -(defun newsticker--image-read (feed-name-symbol disabled) +(defun newsticker--image-read (feed-name-symbol disabled &optional max-height) "Read the cached image for FEED-NAME-SYMBOL from disk. If DISABLED is non-nil the image will be converted to a disabled look \(unless `newsticker-enable-logo-manipulations' is not t\). +Optional argument MAX-HEIGHT specifies the maximal image height. Return the image." (let ((image-name (concat (newsticker--images-dir) (symbol-name feed-name-symbol))) @@ -264,18 +267,47 @@ (when (file-exists-p image-name) (condition-case error-data (setq img (create-image - image-name nil nil + image-name + (and (fboundp 'imagemagick-types) + (imagemagick-types) + 'imagemagick) + nil :conversion (and newsticker-enable-logo-manipulations disabled 'disabled) :mask (and newsticker-enable-logo-manipulations 'heuristic) - :ascent 70)) + :ascent 100 + :max-height max-height)) (error (message "Error: cannot create image for %s: %s" feed-name-symbol error-data)))) img)) +(defun newsticker--icon-read (feed-name-symbol) + "Read the cached icon for FEED-NAME-SYMBOL from disk. +Return the image." + (catch 'icon + (when (file-exists-p (newsticker--icons-dir)) + (mapc (lambda (file) + (condition-case error-data + (progn (setq img (create-image + file (and (fboundp 'imagemagick-types) + (imagemagick-types) + 'imagemagick) + nil + :ascent 'center + :max-width 16 + :max-height 16)) + (throw 'icon img)) + (error + (message "Error: cannot create icon for %s: %s" + feed-name-symbol error-data)))) + (directory-files (newsticker--icons-dir) t + (concat (symbol-name feed-name-symbol) "\\..*")))) + ;; fallback: default icon + (find-image '((:type png :file "newsticker/rss-feed.png" :ascent center))))) + ;; the functions we need for retrieval and display ;;;###autoload (defun newsticker-show-news () === modified file 'lisp/net/newst-treeview.el' --- lisp/net/newst-treeview.el 2014-10-01 17:20:00 +0000 +++ lisp/net/newst-treeview.el 2014-10-19 16:50:15 +0000 @@ -735,7 +735,7 @@ (goto-char (point-min)) ;; insert logo at top (let* ((newsticker-enable-logo-manipulations nil) - (img (newsticker--image-read feed-name-symbol nil))) + (img (newsticker--image-read feed-name-symbol nil 40))) (if (and (display-images-p) img) (newsticker--insert-image img (car item)) (insert (newsticker--real-feed-name feed-name-symbol)))) @@ -829,6 +829,7 @@ :nt-group ,(cdr g) :nt-feed ,g-name :nt-id ,nt-id + :leaf-icon newsticker--tree-widget-leaf-icon :keep (:nt-feed :num-new :nt-id :open);; :nt-group :open nil)) (let ((tag (newsticker--treeview-tree-get-tag g nil nt-id))) @@ -841,6 +842,23 @@ :open t)))) group))) +(defun newsticker--tree-widget-icon-create (icon) + "Create the ICON widget." + (let* ((g (widget-get (widget-get icon :node) :nt-feed)) + (ico (and g (newsticker--icon-read (intern g))))) + (if ico + (progn + (widget-put icon :tag-glyph ico) + (widget-default-create icon) + ;; Insert space between the icon and the node widget. + (insert-char ? 1) + (put-text-property + (1- (point)) (point) + 'display (list 'space :width tree-widget-space-width))) + ;; fallback: default icon + (widget-put icon :leaf-icon 'tree-widget-leaf-icon) + (tree-widget-icon-create icon)))) + (defun newsticker--treeview-tree-expand-status (tree &optional changed-widget event) "Expand the vfeed TREE. @@ -875,6 +893,7 @@ "Icon for a tree-widget leaf node." :tag "O" :glyph-name "leaf" + :create 'newsticker--tree-widget-icon-create :button-face 'default) (defun newsticker--treeview-tree-update () ------------------------------------------------------------ revno: 118156 fixes bug: http://debbugs.gnu.org/18674 committer: Jan D. branch nick: trunk timestamp: Sun 2014-10-19 18:28:49 +0200 message: * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on Gt+ >= 3.12, or gtk_misc_set_alignment on Gtk+ >= 3.14. (make_widget_for_menu_item): Don't use gtk_misc_set_alignment on Gtk+ >= 3.14 (Bug#18674). (update_frame_tool_bar): Don't use gtk_misc_set_padding on Gtk+ >= 3.14 (Bug#18674). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-10-18 19:07:17 +0000 +++ src/ChangeLog 2014-10-19 16:28:49 +0000 @@ -1,3 +1,12 @@ +2014-10-19 Jan Djärv + + * gtkutil.c (create_dialog): Don't use gtk_dialog_get_action_area on + Gt+ >= 3.12, or gtk_misc_set_alignment on Gtk+ >= 3.14 (Bug#18674). + (make_widget_for_menu_item): Don't use gtk_misc_set_alignment on + Gtk+ >= 3.14 (Bug#18674). + (update_frame_tool_bar): Don't use gtk_misc_set_padding on + Gtk+ >= 3.14 (Bug#18674). + 2014-10-18 Paul Eggert * gtkutil.c: Remove no-longer-used code. === modified file 'src/gtkutil.c' --- src/gtkutil.c 2014-10-18 19:07:17 +0000 +++ src/gtkutil.c 2014-10-19 16:28:49 +0000 @@ -1489,7 +1489,6 @@ int button_spacing = 10; GtkWidget *wdialog = gtk_dialog_new (); GtkDialog *wd = GTK_DIALOG (wdialog); - GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd)); widget_value *item; GtkWidget *whbox_down; @@ -1497,6 +1496,17 @@ instead. This looks better. */ bool make_two_rows = total_buttons > 4; +#if GTK_CHECK_VERSION (3, 12, 0) + GtkBuilder *gbld = gtk_builder_new (); + GObject *go = gtk_buildable_get_internal_child (GTK_BUILDABLE (wd), + gbld, + "action_area"); + GtkBox *cur_box = GTK_BOX (go); + g_object_unref (G_OBJECT (gbld)); +#else + GtkBox *cur_box = GTK_BOX (gtk_dialog_get_action_area (wd)); +#endif + if (right_buttons == 0) right_buttons = total_buttons/2; left_buttons = total_buttons - right_buttons; @@ -1542,8 +1552,12 @@ w = gtk_label_new (utf8_label); gtk_box_pack_start (wvbox, gtk_label_new (""), FALSE, FALSE, 0); gtk_box_pack_start (wvbox, w, TRUE, TRUE, 0); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (w, GTK_ALIGN_START); + gtk_widget_set_valign (w, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (w), 0.1, 0.5); - +#endif /* Try to make dialog look better. Must realize first so the widget can calculate the size it needs. */ gtk_widget_realize (w); @@ -2293,9 +2307,15 @@ wlbl = gtk_label_new (utf8_label); wkey = gtk_label_new (utf8_key); +#if GTK_CHECK_VERSION (3, 14, 0) + gtk_widget_set_halign (wlbl, GTK_ALIGN_START); + gtk_widget_set_valign (wlbl, GTK_ALIGN_CENTER); + gtk_widget_set_halign (wkey, GTK_ALIGN_START); + gtk_widget_set_valign (wkey, GTK_ALIGN_CENTER); +#else gtk_misc_set_alignment (GTK_MISC (wlbl), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (wkey), 0.0, 0.5); - +#endif gtk_box_pack_start (GTK_BOX (wbox), wlbl, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (wbox), wkey, FALSE, FALSE, 0); @@ -4761,7 +4781,17 @@ (gpointer)img->pixmap); } +#if GTK_CHECK_VERSION (3, 14, 0) + if (w) + { + gtk_widget_set_margin_start (w, hmargin); + gtk_widget_set_margin_end (w, hmargin); + gtk_widget_set_margin_top (w, vmargin); + gtk_widget_set_margin_bottom (w, vmargin); + } +#else if (w) gtk_misc_set_padding (GTK_MISC (w), hmargin, vmargin); +#endif ti = xg_make_tool_item (f, w, &wbutton, label, i, horiz, text_image); gtk_toolbar_insert (GTK_TOOLBAR (wtoolbar), ti, j); } ------------------------------------------------------------ revno: 118155 committer: Paul Eggert branch nick: trunk timestamp: Sat 2014-10-18 23:33:40 -0700 message: Merge from gnulib. This incorporates: 2014-10-18 readlinkat: port to AIX 7.1 2014-10-07 fcntl: fix error reporting by dupfd * lib/fcntl.c, lib/readlinkat.c, lib/unistd.in.h, m4/readlinkat.m4: * m4/unistd_h.m4: Update from gnulib. * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. diff: === modified file 'ChangeLog' --- ChangeLog 2014-10-17 18:05:48 +0000 +++ ChangeLog 2014-10-19 06:33:40 +0000 @@ -1,3 +1,12 @@ +2014-10-19 Paul Eggert + + Merge from gnulib, incorporating: + 2014-10-18 readlinkat: port to AIX 7.1 + 2014-10-07 fcntl: fix error reporting by dupfd + * lib/fcntl.c, lib/readlinkat.c, lib/unistd.in.h, m4/readlinkat.m4: + * m4/unistd_h.m4: Update from gnulib. + * lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate. + 2014-10-17 Glenn Morris * configure.ac: Simplify OS X $canonical tests. === modified file 'lib/fcntl.c' --- lib/fcntl.c 2014-01-01 07:43:34 +0000 +++ lib/fcntl.c 2014-10-19 06:33:40 +0000 @@ -89,8 +89,25 @@ inherit, /* InheritHandle */ DUPLICATE_SAME_ACCESS)) /* Options */ { - /* TODO: Translate GetLastError () into errno. */ - errno = EMFILE; + switch (GetLastError ()) + { + case ERROR_TOO_MANY_OPEN_FILES: + errno = EMFILE; + break; + case ERROR_INVALID_HANDLE: + case ERROR_INVALID_TARGET_HANDLE: + case ERROR_DIRECT_ACCESS_HANDLE: + errno = EBADF; + break; + case ERROR_INVALID_PARAMETER: + case ERROR_INVALID_FUNCTION: + case ERROR_INVALID_ACCESS: + errno = EINVAL; + break; + default: + errno = EACCES; + break; + } result = -1; break; } @@ -98,7 +115,6 @@ if (duplicated_fd < 0) { CloseHandle (new_handle); - errno = EMFILE; result = -1; break; } === modified file 'lib/gnulib.mk' --- lib/gnulib.mk 2014-08-30 22:59:39 +0000 +++ lib/gnulib.mk 2014-10-19 06:33:40 +0000 @@ -21,7 +21,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=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax strtoumax symlink sys_stat sys_time time timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=open --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=stdarg --avoid=stdbool --avoid=threadlib --makefile-name=gnulib.mk --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 dtoastr dtotimespec dup2 environ execinfo faccessat fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync getloadavg getopt-gnu gettime gettimeofday intprops largefile lstat manywarnings memrchr mkostemp mktime pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat sig2str socklen stat-time stdalign stdio strftime strtoimax strtoumax symlink sys_stat sys_time time time_r timer-time timespec-add timespec-sub unsetenv update-copyright utimens vla warnings MOSTLYCLEANFILES += core *.stackdump @@ -1748,9 +1748,11 @@ -e 's|@''REPLACE_PWRITE''@|$(REPLACE_PWRITE)|g' \ -e 's|@''REPLACE_READ''@|$(REPLACE_READ)|g' \ -e 's|@''REPLACE_READLINK''@|$(REPLACE_READLINK)|g' \ + -e 's|@''REPLACE_READLINKAT''@|$(REPLACE_READLINKAT)|g' \ -e 's|@''REPLACE_RMDIR''@|$(REPLACE_RMDIR)|g' \ -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \ -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \ + -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \ -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \ -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \ -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \ === modified file 'lib/readlinkat.c' --- lib/readlinkat.c 2014-01-01 07:43:34 +0000 +++ lib/readlinkat.c 2014-10-19 06:33:40 +0000 @@ -20,6 +20,18 @@ #include +#if HAVE_READLINKAT + +# undef readlinkat + +ssize_t +rpl_readlinkat (int fd, char const *file, char *buf, size_t len) +{ + return readlinkat (fd, file, buf, len); +} + +#else + /* Gnulib provides a readlink stub for mingw; use it for distinction between EINVAL and ENOENT, rather than always failing with ENOSYS. */ @@ -34,14 +46,16 @@ then readlink/restore_cwd. If either the save_cwd or the restore_cwd fails, then give a diagnostic and exit nonzero. */ -#define AT_FUNC_NAME readlinkat -#define AT_FUNC_F1 readlink -#define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len -#define AT_FUNC_POST_FILE_ARGS , buf, len -#define AT_FUNC_RESULT ssize_t -#include "at-func.c" -#undef AT_FUNC_NAME -#undef AT_FUNC_F1 -#undef AT_FUNC_POST_FILE_PARAM_DECLS -#undef AT_FUNC_POST_FILE_ARGS -#undef AT_FUNC_RESULT +# define AT_FUNC_NAME readlinkat +# define AT_FUNC_F1 readlink +# define AT_FUNC_POST_FILE_PARAM_DECLS , char *buf, size_t len +# define AT_FUNC_POST_FILE_ARGS , buf, len +# define AT_FUNC_RESULT ssize_t +# include "at-func.c" +# undef AT_FUNC_NAME +# undef AT_FUNC_F1 +# undef AT_FUNC_POST_FILE_PARAM_DECLS +# undef AT_FUNC_POST_FILE_ARGS +# undef AT_FUNC_RESULT + +#endif === modified file 'lib/unistd.in.h' --- lib/unistd.in.h 2014-02-25 19:21:05 +0000 +++ lib/unistd.in.h 2014-10-19 06:33:40 +0000 @@ -1287,13 +1287,24 @@ #if @GNULIB_READLINKAT@ -# if !@HAVE_READLINKAT@ +# if @REPLACE_READLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# define readlinkat rpl_readlinkat +# endif +_GL_FUNCDECL_RPL (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len) + _GL_ARG_NONNULL ((2, 3))); +_GL_CXXALIAS_RPL (readlinkat, ssize_t, + (int fd, char const *file, char *buf, size_t len)); +# else +# if !@HAVE_READLINKAT@ _GL_FUNCDECL_SYS (readlinkat, ssize_t, (int fd, char const *file, char *buf, size_t len) _GL_ARG_NONNULL ((2, 3))); -# endif +# endif _GL_CXXALIAS_SYS (readlinkat, ssize_t, (int fd, char const *file, char *buf, size_t len)); +# endif _GL_CXXALIASWARN (readlinkat); #elif defined GNULIB_POSIXCHECK # undef readlinkat @@ -1407,13 +1418,25 @@ #if @GNULIB_SYMLINKAT@ -# if !@HAVE_SYMLINKAT@ +# if @REPLACE_SYMLINKAT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef symlinkat +# define symlinkat rpl_symlinkat +# endif +_GL_FUNCDECL_RPL (symlinkat, int, + (char const *contents, int fd, char const *file) + _GL_ARG_NONNULL ((1, 3))); +_GL_CXXALIAS_RPL (symlinkat, int, + (char const *contents, int fd, char const *file)); +# else +# if !@HAVE_SYMLINKAT@ _GL_FUNCDECL_SYS (symlinkat, int, (char const *contents, int fd, char const *file) _GL_ARG_NONNULL ((1, 3))); -# endif +# endif _GL_CXXALIAS_SYS (symlinkat, int, (char const *contents, int fd, char const *file)); +# endif _GL_CXXALIASWARN (symlinkat); #elif defined GNULIB_POSIXCHECK # undef symlinkat === modified file 'm4/gnulib-comp.m4' --- m4/gnulib-comp.m4 2014-08-30 22:59:39 +0000 +++ m4/gnulib-comp.m4 2014-10-19 06:33:40 +0000 @@ -322,7 +322,7 @@ fi gl_UNISTD_MODULE_INDICATOR([readlink]) gl_FUNC_READLINKAT - if test $HAVE_READLINKAT = 0; then + if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then AC_LIBOBJ([readlinkat]) fi gl_UNISTD_MODULE_INDICATOR([readlinkat]) === modified file 'm4/readlinkat.m4' --- m4/readlinkat.m4 2014-01-01 07:43:34 +0000 +++ m4/readlinkat.m4 2014-10-19 06:33:40 +0000 @@ -1,4 +1,4 @@ -# serial 3 +# serial 4 # See if we need to provide readlinkat replacement. dnl Copyright (C) 2009-2014 Free Software Foundation, Inc. @@ -15,5 +15,18 @@ AC_CHECK_FUNCS_ONCE([readlinkat]) if test $ac_cv_func_readlinkat = no; then HAVE_READLINKAT=0 + else + AC_CACHE_CHECK([whether readlinkat signature is correct], + [gl_cv_decl_readlinkat_works], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + /* Check whether original declaration has correct type. */ + ssize_t readlinkat (int, char const *, char *, size_t);]])], + [gl_cv_decl_readlinkat_works=yes], + [gl_cv_decl_readlinkat_works=no])]) + if test "$gl_cv_decl_readlink_works" != yes; then + REPLACE_READLINKAT=1 + fi fi ]) === modified file 'm4/unistd_h.m4' --- m4/unistd_h.m4 2014-01-01 07:43:34 +0000 +++ m4/unistd_h.m4 2014-10-19 06:33:40 +0000 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 67 +# unistd_h.m4 serial 68 dnl Copyright (C) 2006-2014 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -173,9 +173,11 @@ REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) REPLACE_READ=0; AC_SUBST([REPLACE_READ]) REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) + REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) + REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) REPLACE_TTYNAME_R=0; AC_SUBST([REPLACE_TTYNAME_R]) REPLACE_UNLINK=0; AC_SUBST([REPLACE_UNLINK]) REPLACE_UNLINKAT=0; AC_SUBST([REPLACE_UNLINKAT])