Mercurial > emacs
changeset 97455:a5d0ee62856d
* net/xesam.el (xesam-refresh-entry): Use `save-excursion' in the
notify function of the URL.
(xesam-new-search): Encode special characters in the query string.
author | Michael Albinus <michael.albinus@gmx.de> |
---|---|
date | Thu, 14 Aug 2008 05:02:45 +0000 |
parents | 68a4bf203661 |
children | 2b9b1ccf0550 |
files | lisp/net/xesam.el |
diffstat | 1 files changed, 39 insertions(+), 38 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/net/xesam.el Thu Aug 14 01:14:37 2008 +0000 +++ b/lisp/net/xesam.el Thu Aug 14 05:02:45 2008 +0000 @@ -571,32 +571,33 @@ (widget-get widget :xesam:mimeType))) (widget-put widget :notify - '(lambda (widget &rest ignore) - ;; We toggle. If there are already children, we delete them. - (if (widget-get widget :children) - (widget-children-value-delete widget) + (lambda (widget &rest ignore) + (save-excursion + ;; We toggle. If there are already children, we delete them. + (if (widget-get widget :children) + (widget-children-value-delete widget) - ;; No children. Let's display the messages. - (widget-end-of-line) - ;; Get hit data. Loop over results. - (dolist (data - ;; "GetHitData" returns a list. But we have - ;; requested just one element only. - (car - (xesam-dbus-call-method - :session (car xesam-engine) xesam-path-search - xesam-interface-search "GetHitData" xesam-search - (list (widget-get widget :debbugs:key)) - '("debbugs:key")))) - (let ((child - (widget-create-child-and-convert - ;; The result is a variant. So we must apply `car'. - widget '(link) :format "\n%h" :doc (car data)))) - ;; Add child to parent's list. Needed, in order to be - ;; able to delete it next toggle. - (widget-put - widget - :children (cons child (widget-get widget :children))))))))) + ;; No children. Let's display the messages. + (widget-end-of-line) + ;; Get hit data. Loop over results. + (dolist (data + ;; "GetHitData" returns a list. But we have + ;; requested just one element only. + (car + (xesam-dbus-call-method + :session (car xesam-engine) xesam-path-search + xesam-interface-search "GetHitData" xesam-search + (list (widget-get widget :debbugs:key)) + '("debbugs:key")))) + (let ((child + (widget-create-child-and-convert + ;; The result is a variant. So we must apply `car'. + widget '(link) :format "\n%h" :doc (car data)))) + ;; Add child to parent's list. Needed, in order to be + ;; able to delete it next toggle. + (widget-put + widget + :children (cons child (widget-get widget :children)))))))))) ;; For local files, we will open the file as default action. ((string-match "file" @@ -604,9 +605,9 @@ (widget-get widget :xesam:url)))) (widget-put widget :notify - '(lambda (widget &rest ignore) - (find-file - (url-filename (url-generic-parse-url (widget-value widget)))))) + (lambda (widget &rest ignore) + (find-file + (url-filename (url-generic-parse-url (widget-value widget)))))) (widget-put widget :value (url-filename (url-generic-parse-url (widget-get widget :xesam:url)))))) @@ -676,10 +677,10 @@ (widget-create 'link :notify - '(lambda (widget &rest ignore) - (setq xesam-to (+ xesam-to xesam-hits-per-page)) - (widget-delete widget) - (xesam-refresh-search-buffer xesam-engine xesam-search)) + (lambda (widget &rest ignore) + (setq xesam-to (+ xesam-to xesam-hits-per-page)) + (widget-delete widget) + (xesam-refresh-search-buffer xesam-engine xesam-search)) "NEXT") (widget-beginning-of-line)) @@ -690,13 +691,13 @@ engine search (min xesam-hits-per-page (- (min (+ xesam-hits-per-page xesam-to) xesam-count) - (length xesam-objects)))))) + (length xesam-objects))))) ;; Add "DONE" widget. (when (= xesam-current xesam-count) (goto-char (point-max)) (widget-create 'link :notify 'ignore "DONE") - (widget-beginning-of-line)) + (widget-beginning-of-line))) ;; Return with save settings. (setq xesam-refreshing nil))))) @@ -746,7 +747,7 @@ (xml-string (format (if (eq type 'user-query) xesam-user-query xesam-fulltext-query) - query)) + (url-insert-entities-in-string query))) (search (xesam-dbus-call-method :session service xesam-path-search xesam-interface-search "NewSearch" session xml-string))) @@ -788,8 +789,8 @@ (xesam-get-cached-property engine "vendor.id") 'help-echo (mapconcat - '(lambda (x) - (format "%s: %s" x (xesam-get-cached-property engine x))) + (lambda (x) + (format "%s: %s" x (xesam-get-cached-property engine x))) '("vendor.id" "vendor.version" "vendor.display" "vendor.xesam" "vendor.ontology.fields" "vendor.ontology.contents" "vendor.ontology.sources" "vendor.extensions" @@ -820,7 +821,7 @@ (xesam-search (car (xesam-search-engines)) \"emacs\")" (interactive (let* ((vendors (mapcar - '(lambda (x) (xesam-get-cached-property x "vendor.display")) + (lambda (x) (xesam-get-cached-property x "vendor.display")) (xesam-search-engines))) (vendor (if (> (length vendors) 1)