LISPに投稿されたコード一覧

LISP LISPのテスト

(defun get-protocol-string (URI)
  (let (from end protocol server port)
    (setq from (string-match "^[^:/]+" URI))
    (setq end (match-end 0) )
    (when (and from end)
      (setq protocol (substring URI from end ))
      (setq URI (substring URI (1+ end)))
    )

    (setq from (string-match "[^:/]+" URI))
    (setq end (match-end 0))
    (when (and from end)
      (setq server (substring URI from end ))
      (if (string-match "\\." server)
          (setq URI (substring URI end))
        (setq server nil))
    )

    (setq from (string-match "[0-9]+/" URI))
    (setq end (match-end 0))
    (when (and from end)
      (setq port (substring URI 1 (1- end)))
      (setq URI (substring URI (1- end)))
    )

    ;(insert "protocol :[" protocol "]\n")
    ;(insert "server :[" server "]\n")
    ;(insert "port :[" port "]\n")
    ;(insert "target :[" URI "]\n")
    (values protocol server port URI)
  )
)

;for test
(get-protocol-string "http://www2.ocn.ne.jp/~cheerful/script/index.html")
(get-protocol-string "//http://www2.ocn.ne.jp/~cheerful/script/")

(get-protocol-string "/~start/index.html")
(get-protocol-string "/start/jkdjkaj/jkjdfjindex.html")

(get-protocol-string "http://www2.ocn.ne.jp/~cheerful:80/~start/index.html")
(get-protocol-string "//http://www2.ocn.ne.jp/~cheerful:80/~start/index.html")
;usage
(multiple-value-setq (protocol server port file) (get-protocol-string "http://www2.ocn.ne.jp/~cheerful/~start"))

LISP LISP

;(provide "minibuffer")
;(in-package "editor")

(export '(*ime-mode-into-minibuffer*))
(defvar *ime-mode-into-minibuffer* nil)

(defun ime-state-get-and-setoff (bef-buffer file-name)
 (interactive)
 (setq *ime-mode-into-minibuffer* (get-ime-mode)
  )
 (toggle-ime nil)
  )

(defun ime-state-set (bef-buffer file-name)
 (interactive)
 (toggle-ime *ime-mode-into-minibuffer*
  )
  )

(add-hook '*enter-minibuffer-hook* 'ime-state-get-and-setoff)
(add-hook '*exit-minibuffer-hook* 'ime-state-set)

よく投稿されているコード

タグ

最近投稿されたコード