comparison lisp/net/quickurl.el @ 105372:bd2966850aac

Use `called-interactively-p' instead of `interactive-p'.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 02 Oct 2009 03:48:36 +0000
parents a9dc0e7c3f2b
children 1d1d5d9bd884
comparison
equal deleted inserted replaced
105371:0769a73f1d18 105372:bd2966850aac
366 (if (zerop (length word)) 366 (if (zerop (length word))
367 (error "You must specify a WORD for lookup") 367 (error "You must specify a WORD for lookup")
368 (quickurl-load-urls) 368 (quickurl-load-urls)
369 (let* ((current-url (quickurl-find-url word)) 369 (let* ((current-url (quickurl-find-url word))
370 (add-it (if current-url 370 (add-it (if current-url
371 (if (interactive-p) 371 (if (called-interactively-p 'interactive)
372 (y-or-n-p (format "\"%s\" exists, replace URL? " word)) 372 (y-or-n-p (format "\"%s\" exists, replace URL? " word))
373 t) 373 t)
374 t))) 374 t)))
375 (when add-it 375 (when add-it
376 (if current-url 376 (if current-url
380 (push (quickurl-make-url word url comment) quickurl-urls)) 380 (push (quickurl-make-url word url comment) quickurl-urls))
381 (setq quickurl-urls (funcall quickurl-sort-function quickurl-urls)) 381 (setq quickurl-urls (funcall quickurl-sort-function quickurl-urls))
382 (quickurl-save-urls) 382 (quickurl-save-urls)
383 (when (get-buffer quickurl-list-buffer-name) 383 (when (get-buffer quickurl-list-buffer-name)
384 (quickurl-list-populate-buffer)) 384 (quickurl-list-populate-buffer))
385 (when (interactive-p) 385 (when (called-interactively-p 'interactive)
386 (message "Added %s" url)))))) 386 (message "Added %s" url))))))
387 387
388 ;;;###autoload 388 ;;;###autoload
389 (defun quickurl-browse-url (&optional lookup) 389 (defun quickurl-browse-url (&optional lookup)
390 "Browse the URL associated with LOOKUP. 390 "Browse the URL associated with LOOKUP.