Commits

Anonymous committed bb590d3

* changed name of "select dictionary" button
* "select dictionary" and "select matching strategie" now has a better
feedback (by returning to the previous state)
* added support for non-colored display, the links are surrounded by
braces
* dictionary-init.el is needed for Debian

  • Participants
  • Parent commits 3712f19

Comments (0)

Files changed (4)

+dictionary (1.5.3-1) unstable; urgency=low
+
+  * changed name of "select dictionary" button
+  * "select dictionary" and "select matching strategie" now has a better
+    feedback (by returning to the previous state)
+  * added support for non-colored display, the links are surrounded by
+    braces
+
+ -- Torsten Hilbrich <Torsten.Hilbrich@gmx.net>  Sun, 14 Oct 2001 16:08:12 +0200
+
+dictionary (1.5.2-1) unstable; urgency=low
+
+  * popup menu now correctly records the selected window
+
+ -- Torsten Hilbrich <Torsten.Hilbrich@gmx.net>  Sun,  2 Sep 2001 10:40:59 +0200
+
 dictionary (1.5.1-1) unstable; urgency=low
 
   * corrected bug with dictionary-previous (found by Rui Zhu)

debian/files

-dictionary_1.5.1-1_i386.deb unknown optional

dictionary-init.el

+;; $Id$
+;; This file contains the autoload definitions that are used by the
+;; debian package and can also be used in a standalone installation
+;; The XEmacs package has some other means to create the autoload
+;; information.
+
+(autoload 'dictionary-search "dictionary"
+  "Ask for a word and search it in all dictionaries" t)
+(autoload 'dictionary-match-words "dictionary"
+  "Ask for a word and search all matching words in the dictionaries" t)
+(autoload 'dictionary-lookup-definition "dictionary"
+  "Unconditionally lookup the word at point." t)
+(autoload 'dictionary "dictionary"
+  "Create a new dictionary buffer" t)
+(autoload 'dictionary-mouse-popup-matching-words "dictionary"
+  "Display entries matching the word at the cursor" t)
+(autoload 'dictionary-popup-matching-words "dictionary"
+  "Display entries matching the word at the point" t)
+(autoload 'dictionary-tooltip-mode "dictionary"
+  "Display tooltips for the current word" t)
+(autoload 'global-dictionary-tooltip-mode "dictionary"
+  "Enable/disable dictionary-tooltip-mode for all buffers" t)
+
   nil
   "Stores the point position while buffer display.")
 
+(defvar dictionary-color-support 
+  (condition-case nil
+      (x-display-color-p)
+    (error nil))
+  "Stores the point position while buffer display.")
+
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Basic function providing startup actions
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
         (setq dictionary-window-configuration window-configuration)
 	(setq dictionary-selected-window selected-window)
         (dictionary-check-connection)
-        (dictionary-pre-buffer)
-        (dictionary-post-buffer)))))
+	(dictionary-new-buffer)
+	(dictionary-store-positions)
+	(dictionary-store-state 'dictionary-new-buffer nil)))))
+
+(defun dictionary-new-buffer (&rest ignore)
+  "Create a new and clean buffer"
+
+  (dictionary-pre-buffer)
+  (dictionary-post-buffer))
+
 
 (unless dictionary-mode-map
   (setq dictionary-mode-map (make-sparse-keymap))
     (goto-char (car position))
     (setq dictionary-current-data data)))
       
-
 ;; The normal search
 
 (defun dictionary-new-search (args &optional all)
 
 	(insert "\n       ")
 
-	(link-insert-link "[Select Default Dictionary]"
+	(link-insert-link "[Select Dictionary]"
 			  'dictionary-button-face
 			  'dictionary-select-dictionary nil
 			  "Mouse-2 to select dictionary for future searches")
-	(insert " ")
+	(insert "         ")
 	(link-insert-link "[Select Match Strategy]"
 			  'dictionary-button-face
 			  'dictionary-select-strategy nil
       (goto-char start)
       (while (< (point) (point-max))
 	(if (search-forward-regexp regexp nil t)
-	    (progn
-	      (replace-match "\\2")
-	      ;; Compensate for the replacement
-	      (let* ((brace-match-length (- (match-end 1)
-					    (match-beginning 1)))
-		     (match-start (- (match-beginning 2)
-				     brace-match-length))
-		     (match-end (- (match-end 2)
-				   brace-match-length)))
-		(dictionary-mark-reference match-start match-end
-					   'dictionary-new-search
-					   word dictionary)))
+	    (let ((match-start (match-beginning 1))
+		  (match-end (match-end 2)))
+	      (if dictionary-color-support
+		  (progn
+		    (replace-match "\\2")
+		    ;; Compensate for the replacement
+		    (let ((brace-match-length (- (match-end 1)
+						 (match-beginning 1))))
+		      (setq match-start (- (match-beginning 2)
+					   brace-match-length))
+		      (setq match-end (- (match-end 2)
+					 brace-match-length)))))
+	      (dictionary-mark-reference match-start match-end
+					 'dictionary-new-search
+					 word dictionary))
 	  (goto-char (point-max)))))))
 
 (defun dictionary-mark-reference (start end call displayed-word dictionary)
       (dictionary-display-more-info param)
     (let ((dictionary (car param)))
       (setq dictionary-default-dictionary dictionary)
+      (dictionary-restore-state)
       (message "Dictionary %s has been selected" dictionary))))
     
 (defun dictionary-display-more-info (param)
 (defun dictionary-set-strategy (strategy &rest ignored)
   "Select this strategy as new default"
   (setq dictionary-default-strategy strategy)
+  (dictionary-restore-state)
   (message "Strategy %s has been selected" strategy))
     
 (defun dictionary-new-matching (word)