emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Using the windows registry for external programs


From: George M. Georgiou
Subject: [emacs-wiki-discuss] Using the windows registry for external programs
Date: Mon, 12 Jul 2004 15:40:38 -0700

I have modified emacs-wiki-follow-name-at-point to use the registry
associations on Windows if warranted. Code follows.

Thanks.

--George
-------------------------------------------------------------------
(defun my-emacs-wiki-follow-name-at-point (&optional other-window)
  "Visit the link at point, potentially using the Windows registry, 
           or insert a newline if none." 
  (interactive "P")
  ;; if we're visiting a bad link, pass the current buffer to the visiting
  ;; function so that it can be refreshed on saving the new page
  (let ((buf) (my-match))
    (when (eq (get-text-property (point) 'face)
              'emacs-wiki-bad-link-face)
      (setq buf (current-buffer)))
    (if (emacs-wiki-link-at-point) (setq my-match (match-string 0)))
    (setq my-match (replace-in-string my-match "\\[\\|\\]" ""))
    (cond ((and (memq window-system '(win32 w32)) 
                (string-match "[^:].*\\." my-match)) ;;if there is a ".", no 
":" 
           (w32-shell-execute 1 my-match))
          (my-match
           (emacs-wiki-visit-link my-match buf other-window))
          (t (error "There is no valid link at point")))
))

(defalias 'emacs-wiki-follow-name-at-point 'my-emacs-wiki-follow-name-at-point)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]