(let (ar) (setq array '("string" "文字列")) (setq ar "results:\n") (dolist (item array) (setq chunked–string (si:make–string–chunk item)) (setq ch–len (si:chunk–size chunked–string)) (setq ar (concat ar "\n" (format nil "ch–str\t\t>>~A\t:length>>~D\nnormal–str\t>>~A\t:length>>~D" (si:unpack–string chunked–string 0 ch–len) ch–len item (length item))))) (insert ar)) =>results: ch–str >>string :length>>7 normal–str >>string :length>>6 ch–str >>文字列 :length>>7 normal–str >>文字列 :length>>3どうやらGetTextExtentPoint32の問題じゃなくて、ExtTextOutに渡すパラメータが間違っていた模様(^^;
(∗define–dll–entry BOOL ExtTextOut (HDC int int UINT (RECT ∗) LPCSTR UINT (INT ∗)) "gdi32" "ExtTextOutA")とある。
∗∗∗ edict–orig.l Tue Nov 4 03:59:11 2003 ––– edict.l Tue Nov 4 04:21:10 2003 ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗∗∗ 7,12 ∗∗∗∗ ––– 7,14 –––– (in–package "editor") + (require "popwindow") + (export '(∗edict–dictionary–path∗ lookup–e2j–dictionary–word lookup–idiom–dictionary–word lookup–j2e–dictionary–word lookup–reading–dictionary–word ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗∗∗ 16,21 ∗∗∗∗ ––– 18,24 –––– lookup–j2e–dictionary lookup–reading–dictionary toggle–edict–view–style ∗edict–display–view–style∗ edict–view–style–popup edict–view–style–box edict–view–style–buffer + edict–view–style–box edict–view–style–popwindow copy–edict–to–clipboard copy–edict–or–selection–to–clipboard ∗edict–conjugation–regexp∗ edict–mode edict–mouse–lookup)) ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗∗∗ 168,173 ∗∗∗∗ ––– 171,177 –––– (case ∗edict–display–view–style∗ (:popup (setq ∗edict–display–view–style∗ :box)) (:box (setq ∗edict–display–view–style∗ :buffer)) + (:popwindow (setq ∗edict–display–view–style :popwindow)) (t (setq ∗edict–display–view–style∗ :popup))))) (defun edict–view–style–popup () ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗∗∗ 185,190 ∗∗∗∗ ––– 189,199 –––– (toggle–edict–view–style :buffer) t) + (defun edict–view–style–popwindow () + (interactive) + (toggle–edict–view–style :popwindow) + t) + (let (edict–string) (defun edict–display (string) (setq edict–string string) ∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗ ∗∗∗ 197,202 ∗∗∗∗ ––– 206,213 –––– (setq string (string–right–trim " \n\t" string)) (when (eq :cancel (message–box string "∗dictionary∗" '(:ok–cancel) :button2 "Copy" :no–wrap nil)) (copy–to–clipboard string))) + (:popwindow + (user::pop–window–pop string)) (t (let ((w (selected–window)) (buffer (selected–buffer))) (with–output–to–temp–buffer (" ∗dictionary∗")こんな感じかな。
hoge huga_end
(defun Diary-newline-and-indent (&optional (arg 1))
(interactive "*p")
(let (current)
(setq current (point))
(goto-bol)
(if (looking-at "\\(_End\\|_en\\|_nd\\|_ed\\)")
(progn
(delete-region (match-beginning 0) (match-end 0))
(insert "_end")
(goto-eol)
(insert #\LFD arg))
(progn
(goto-char current)
(insert #\LFD arg))))
(Diary-indent-line))
(if (looking-at ".*\\(_End\\|_en\\|_nd\\|_ed\\)$")
(progn
(delete-region (match-beginning 1) (match-end 1))
;; (format (imapstream-stream stream) "~A SEARCH CHARSET ISO-2022-JP ~A {~D}~%"
(format (imapstream-stream stream) "~A SEARCH ~A {~D}~%"
(imap4-tag-increment stream) opts len)
;; (format *imap4-stream-output* "~A SEARCH CHARSET ISO-2022-JP ~A {~D}~%"
(format *imap4-stream-output* "~A SEARCH ~A {~D}~%"
(imap4-tag-current stream) opts len)
(defun Diary-newline-and-indent (&optional (arg 1))
(interactive "*p")
(let (current)
(if (eolp)
(progn
(setq current (point))
(goto-bol)
(if (looking-at ".*\(_End\|_en\|_nd\|_en\|_ed\)$")
(progn
(delete-region (match-beginning 1) (match-end 1))
(insert "_end")
(insert #\LFD))
(progn
(goto-char current)
(insert #\LFD))))
(progn
(insert #\LFD))))
(Diary-indent-line))
;;IMAP folder auto-check
;;;
;; check interval sec
(setq *kamail-imap4-folder-auto-check-interval* 600)
(defun kamail-auto-folder-check ()
(save-window-excursion
(set-window *kamail-window-folder*)
(set-buffer *kamail-buffer-folder*)
(kamail-folder-status-all))
(refresh-screen))
(defun stop-folder-check ()
(stop-timer 'kamail-auto-folder-check))
(start-timer *kamail-imap4-folder-auto-check-interval* 'kamail-auto-folder-check)
(add-hook '*kamail-exit-hook* 'stop-folder-check)
;;IMAP folder auto-check
;;;
;; check interval sec
(setq *kamail-imap4-folder-auto-check-interval* 600)
(defun kamail-auto-folder-check ()
(save-window-excursion
(set-window *kamail-window-folder*)
(set-buffer *kamail-buffer-folder*)
;; IMAPサーバ上のinboxが2行目にあると仮定(笑)
(goto-line 2)
(kamail-folder-status-this)
(goto-bol)
(if (not (looking-for "(0)"))
(progn
(kamail-select-folder-this)
(kamail-auto-refile t)
(kamail-close-folder)
(kamail-folder-status-all)))
)
(refresh-screen))
WINMMAPI BOOL WINAPI PlaySoundW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound)
(c:define-dll-entry winapi::BOOL PlaySoundW (winapi::LPCSTR winapi::HMODULE winapi::DWORD) "winmm")
(eval-when (:compile-toplevel :load-toplevel :execute)
(require "foreign") (require "wip/winapi"))
(c:define-dll-entry winapi::BOOL PlaySoundW (winapi::LPCSTR winapi::HMODULE winapi::DWORD) "winmm")
(c:define-dll-entry winapi::BOOL sndPlaySoundW (winapi::LPCSTR winapi::UINT) "winmm")
(setf soundfile (si:make-string-chunk "C:\\WINDOWS\\MEDIA\\chimes.wav"))
(PlaySoundW soundfile 0 #x00020000)
(sndPlaySoundW soundfile #x00020000)
;;IMAP folder auto-check
;;;
;; check interval sec
(require "wip/winapi")
(require "foreign")
(c:define-dll-entry winapi::BOOL PlaySound (winapi::LPCSTR winapi::HMODULE winapi::DWORD) "winmm" "PlaySoundA")
(setf soundfile (si:make-string-chunk "C:\\WINDOWS\\MEDIA\\chimes.wav"))
(setq *kamail-imap4-folder-auto-check-interval* 600)
(defun kamail-auto-folder-check ()
(interactive)
(save-window-excursion
(set-window *kamail-window-folder*)
(set-buffer *kamail-buffer-folder*)
(goto-line 2)
(kamail-folder-status-this)
(goto-bol)
(if (not (looking-for "(0)"))
(progn
(kamail-select-folder-this)
(kamail-auto-refile t)
(kamail-close-folder)
(PlaySound soundfile 0 #x00020000)
(kamail-folder-status-all)))
)
(refresh-screen))
(defun stop-folder-check ()
(stop-timer 'kamail-auto-folder-check))
(start-timer *kamail-imap4-folder-auto-check-interval* 'kamail-auto-folder-check)
(add-hook '*kamail-exit-hook* 'stop-folder-check)
;; imap4 folder check and refile
(global-set-key '(#\C-c #\s) 'kamail-auto-folder-check)
;;; open url to browser
;;;
;; use mozilla
;;(setq browser "H:\MozillaFirebird\MozillaFirebird-0.7-win32\MozillaFirebird\MozillaFirebird.exe")
;; use default browser
(setq browser (car (split-string (read-registry "http\shell\open\command" "" :classes-root) #\ nil)))
(setq *url-chars* "-a-zA-Z0-9_/~.#@%?&=;+(),'$!*:")
(defun open-browser ()
(interactive)
(let (url)
(if (pre-selection-p)
(setq url (buffer-substring (selection-mark) (selection-point))))
(if (stringp url)
(call-process (concat browser " -url \"" url "\""))
(progn
(setq url (get-url))
(call-process (concat browser " -url \"" url "\""))))))
(defun get-url ()
(apply 'buffer-substring
(save-excursion
(list (progn
(or (skip-chars-forward *url-chars*)
(skip-chars-backward *url-chars*))
(point))
(progn
(skip-chars-backward *url-chars*)
(point))))))
(global-set-key '(#\C-c #\b #\o) 'open-browser)