aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2008-08-14 05:03:18 +0000
committerMichael Albinus2008-08-14 05:03:18 +0000
commitc7041c350e1ea171c980cb6f73a96db563c801e6 (patch)
treedc039ecd7add16b5789ed019f15bfb1904cc2609
parent7e861e0dfc82eea39be4b42d8de82a2d02669219 (diff)
downloademacs-c7041c350e1ea171c980cb6f73a96db563c801e6.tar.gz
emacs-c7041c350e1ea171c980cb6f73a96db563c801e6.zip
* 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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/net/xesam.el79
2 files changed, 46 insertions, 39 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e12609ee448..9ef1c2cd618 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12008-08-14 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/xesam.el (xesam-refresh-entry): Use `save-excursion' in the
4 notify function of the URL.
5 (xesam-new-search): Encode special characters in the query string.
6
12008-08-13 Chong Yidong <cyd@stupidchicken.com> 72008-08-13 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * term/ns-win.el (ns-parse-geometry): Rename from x-parse-geometry. 9 * term/ns-win.el (ns-parse-geometry): Rename from x-parse-geometry.
diff --git a/lisp/net/xesam.el b/lisp/net/xesam.el
index e7d56341908..719b5abd751 100644
--- a/lisp/net/xesam.el
+++ b/lisp/net/xesam.el
@@ -571,32 +571,33 @@ SEARCH is the search identification in that engine. Both must be strings."
571 (widget-get widget :xesam:mimeType))) 571 (widget-get widget :xesam:mimeType)))
572 (widget-put 572 (widget-put
573 widget :notify 573 widget :notify
574 '(lambda (widget &rest ignore) 574 (lambda (widget &rest ignore)
575 ;; We toggle. If there are already children, we delete them. 575 (save-excursion
576 (if (widget-get widget :children) 576 ;; We toggle. If there are already children, we delete them.
577 (widget-children-value-delete widget) 577 (if (widget-get widget :children)
578 578 (widget-children-value-delete widget)
579 ;; No children. Let's display the messages. 579
580 (widget-end-of-line) 580 ;; No children. Let's display the messages.
581 ;; Get hit data. Loop over results. 581 (widget-end-of-line)
582 (dolist (data 582 ;; Get hit data. Loop over results.
583 ;; "GetHitData" returns a list. But we have 583 (dolist (data
584 ;; requested just one element only. 584 ;; "GetHitData" returns a list. But we have
585 (car 585 ;; requested just one element only.
586 (xesam-dbus-call-method 586 (car
587 :session (car xesam-engine) xesam-path-search 587 (xesam-dbus-call-method
588 xesam-interface-search "GetHitData" xesam-search 588 :session (car xesam-engine) xesam-path-search
589 (list (widget-get widget :debbugs:key)) 589 xesam-interface-search "GetHitData" xesam-search
590 '("debbugs:key")))) 590 (list (widget-get widget :debbugs:key))
591 (let ((child 591 '("debbugs:key"))))
592 (widget-create-child-and-convert 592 (let ((child
593 ;; The result is a variant. So we must apply `car'. 593 (widget-create-child-and-convert
594 widget '(link) :format "\n%h" :doc (car data)))) 594 ;; The result is a variant. So we must apply `car'.
595 ;; Add child to parent's list. Needed, in order to be 595 widget '(link) :format "\n%h" :doc (car data))))
596 ;; able to delete it next toggle. 596 ;; Add child to parent's list. Needed, in order to be
597 (widget-put 597 ;; able to delete it next toggle.
598 widget 598 (widget-put
599 :children (cons child (widget-get widget :children))))))))) 599 widget
600 :children (cons child (widget-get widget :children))))))))))
600 601
601 ;; For local files, we will open the file as default action. 602 ;; For local files, we will open the file as default action.
602 ((string-match "file" 603 ((string-match "file"
@@ -604,9 +605,9 @@ SEARCH is the search identification in that engine. Both must be strings."
604 (widget-get widget :xesam:url)))) 605 (widget-get widget :xesam:url))))
605 (widget-put 606 (widget-put
606 widget :notify 607 widget :notify
607 '(lambda (widget &rest ignore) 608 (lambda (widget &rest ignore)
608 (find-file 609 (find-file
609 (url-filename (url-generic-parse-url (widget-value widget)))))) 610 (url-filename (url-generic-parse-url (widget-value widget))))))
610 (widget-put 611 (widget-put
611 widget :value 612 widget :value
612 (url-filename (url-generic-parse-url (widget-get widget :xesam:url)))))) 613 (url-filename (url-generic-parse-url (widget-get widget :xesam:url))))))
@@ -676,10 +677,10 @@ SEARCH is the search identification in that engine. Both must be strings."
676 (widget-create 677 (widget-create
677 'link 678 'link
678 :notify 679 :notify
679 '(lambda (widget &rest ignore) 680 (lambda (widget &rest ignore)
680 (setq xesam-to (+ xesam-to xesam-hits-per-page)) 681 (setq xesam-to (+ xesam-to xesam-hits-per-page))
681 (widget-delete widget) 682 (widget-delete widget)
682 (xesam-refresh-search-buffer xesam-engine xesam-search)) 683 (xesam-refresh-search-buffer xesam-engine xesam-search))
683 "NEXT") 684 "NEXT")
684 (widget-beginning-of-line)) 685 (widget-beginning-of-line))
685 686
@@ -690,13 +691,13 @@ SEARCH is the search identification in that engine. Both must be strings."
690 engine search 691 engine search
691 (min xesam-hits-per-page 692 (min xesam-hits-per-page
692 (- (min (+ xesam-hits-per-page xesam-to) xesam-count) 693 (- (min (+ xesam-hits-per-page xesam-to) xesam-count)
693 (length xesam-objects)))))) 694 (length xesam-objects)))))
694 695
695 ;; Add "DONE" widget. 696 ;; Add "DONE" widget.
696 (when (= xesam-current xesam-count) 697 (when (= xesam-current xesam-count)
697 (goto-char (point-max)) 698 (goto-char (point-max))
698 (widget-create 'link :notify 'ignore "DONE") 699 (widget-create 'link :notify 'ignore "DONE")
699 (widget-beginning-of-line)) 700 (widget-beginning-of-line)))
700 701
701 ;; Return with save settings. 702 ;; Return with save settings.
702 (setq xesam-refreshing nil))))) 703 (setq xesam-refreshing nil)))))
@@ -746,7 +747,7 @@ search, is returned."
746 (xml-string 747 (xml-string
747 (format 748 (format
748 (if (eq type 'user-query) xesam-user-query xesam-fulltext-query) 749 (if (eq type 'user-query) xesam-user-query xesam-fulltext-query)
749 query)) 750 (url-insert-entities-in-string query)))
750 (search (xesam-dbus-call-method 751 (search (xesam-dbus-call-method
751 :session service xesam-path-search 752 :session service xesam-path-search
752 xesam-interface-search "NewSearch" session xml-string))) 753 xesam-interface-search "NewSearch" session xml-string)))
@@ -788,8 +789,8 @@ search, is returned."
788 (xesam-get-cached-property engine "vendor.id") 789 (xesam-get-cached-property engine "vendor.id")
789 'help-echo 790 'help-echo
790 (mapconcat 791 (mapconcat
791 '(lambda (x) 792 (lambda (x)
792 (format "%s: %s" x (xesam-get-cached-property engine x))) 793 (format "%s: %s" x (xesam-get-cached-property engine x)))
793 '("vendor.id" "vendor.version" "vendor.display" "vendor.xesam" 794 '("vendor.id" "vendor.version" "vendor.display" "vendor.xesam"
794 "vendor.ontology.fields" "vendor.ontology.contents" 795 "vendor.ontology.fields" "vendor.ontology.contents"
795 "vendor.ontology.sources" "vendor.extensions" 796 "vendor.ontology.sources" "vendor.extensions"
@@ -820,7 +821,7 @@ Example:
820 (xesam-search (car (xesam-search-engines)) \"emacs\")" 821 (xesam-search (car (xesam-search-engines)) \"emacs\")"
821 (interactive 822 (interactive
822 (let* ((vendors (mapcar 823 (let* ((vendors (mapcar
823 '(lambda (x) (xesam-get-cached-property x "vendor.display")) 824 (lambda (x) (xesam-get-cached-property x "vendor.display"))
824 (xesam-search-engines))) 825 (xesam-search-engines)))
825 (vendor 826 (vendor
826 (if (> (length vendors) 1) 827 (if (> (length vendors) 1)