/[emacs]/emacs/lisp/net/eudc-hotlist.el
ViewVC logotype

Diff of /emacs/lisp/net/eudc-hotlist.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pj, Sat Jan 5 18:51:11 2002 UTC revision 1.4 by pj, Sun Jan 6 15:05:28 2002 UTC
# Line 67  These are the special commands of this m Line 67  These are the special commands of this m
67      (switch-to-buffer (get-buffer-create "*EUDC Servers*"))      (switch-to-buffer (get-buffer-create "*EUDC Servers*"))
68      (setq buffer-read-only nil)      (setq buffer-read-only nil)
69      (erase-buffer)      (erase-buffer)
70      (mapcar (function      (mapcar (function
71               (lambda (entry)               (lambda (entry)
72                 (setq proto-col (max (length (car entry)) proto-col))))                 (setq proto-col (max (length (car entry)) proto-col))))
73              eudc-server-hotlist)              eudc-server-hotlist)
# Line 113  These are the special commands of this m Line 113  These are the special commands of this m
113    (let ((buffer-read-only nil))    (let ((buffer-read-only nil))
114      (save-excursion      (save-excursion
115        (beginning-of-line)        (beginning-of-line)
116        (if (and (>= (point) eudc-hotlist-list-beginning)            (if (and (>= (point) eudc-hotlist-list-beginning)
117                 (looking-at "^\\([-.a-zA-Z:0-9]+\\)[ \t]+\\([a-zA-Z]+\\)"))                 (looking-at "^\\([-.a-zA-Z:0-9]+\\)[ \t]+\\([a-zA-Z]+\\)"))
118            (kill-line 1)            (kill-line 1)
119          (error "No server on this line")))))          (error "No server on this line")))))
# Line 131  These are the special commands of this m Line 131  These are the special commands of this m
131                            hotlist))                            hotlist))
132        (forward-line 1))        (forward-line 1))
133      (if (not (looking-at "^[ \t]*$"))      (if (not (looking-at "^[ \t]*$"))
134          (error "Malformed entry in hotlist, discarding edits"))          (error "Malformed entry in hotlist, discarding edits"))
135      (setq eudc-server-hotlist (nreverse hotlist))      (setq eudc-server-hotlist (nreverse hotlist))
136      (eudc-install-menu)      (eudc-install-menu)
137      (eudc-save-options)      (eudc-save-options)
# Line 150  These are the special commands of this m Line 150  These are the special commands of this m
150            (eudc-set-server (match-string 1) (intern (match-string 2)))            (eudc-set-server (match-string 1) (intern (match-string 2)))
151            (message "Current directory server is %s (%s)" eudc-server eudc-protocol))            (message "Current directory server is %s (%s)" eudc-server eudc-protocol))
152        (error "No server on this line"))))        (error "No server on this line"))))
153          
154  (defun eudc-hotlist-transpose-servers ()  (defun eudc-hotlist-transpose-servers ()
155    "Swap the order of the server with the previous one in the list."    "Swap the order of the server with the previous one in the list."
156    (interactive)    (interactive)
# Line 161  These are the special commands of this m Line 161  These are the special commands of this m
161        (beginning-of-line)        (beginning-of-line)
162        (if (and (>= (point) eudc-hotlist-list-beginning)        (if (and (>= (point) eudc-hotlist-list-beginning)
163                 (looking-at "^\\([-.a-zA-Z:0-9]+\\)[ \t]+\\([a-zA-Z]+\\)")                 (looking-at "^\\([-.a-zA-Z:0-9]+\\)[ \t]+\\([a-zA-Z]+\\)")
164                 (progn                 (progn
165                   (forward-line -1)                   (forward-line -1)
166                   (looking-at "^\\([-.a-zA-Z:0-9]+\\)[ \t]+\\([a-zA-Z]+\\)")))                   (looking-at "^\\([-.a-zA-Z:0-9]+\\)[ \t]+\\([a-zA-Z]+\\)")))
167            (progn            (progn
168              (forward-line 1)              (forward-line 1)
169              (transpose-lines 1))))))              (transpose-lines 1))))))
170      
171  (setq eudc-hotlist-mode-map  (setq eudc-hotlist-mode-map
172        (let ((map (make-sparse-keymap)))        (let ((map (make-sparse-keymap)))
173          (define-key map "a" 'eudc-hotlist-add-server)          (define-key map "a" 'eudc-hotlist-add-server)
# Line 189  These are the special commands of this m Line 189  These are the special commands of this m
189      ["Exit without Saving" kill-this-buffer t]))      ["Exit without Saving" kill-this-buffer t]))
190    
191  (if eudc-emacs-p  (if eudc-emacs-p
192      (easy-menu-define eudc-hotlist-emacs-menu      (easy-menu-define eudc-hotlist-emacs-menu
193                        eudc-hotlist-mode-map                        eudc-hotlist-mode-map
194                        ""                        ""
195                        eudc-hotlist-menu))                        eudc-hotlist-menu))

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26