Next: , Previous: Near Point, Up: Text   [Contents][Index]


31.2 ¥Ð¥Ã¥Õ¥¡¤ÎÆâÍÆ¤òÄ´¤Ù¤ë

ËÜÀá¤Ç¤Ï¡¢Lisp¥×¥í¥°¥é¥à¤Ç¥Ð¥Ã¥Õ¥¡Æâ¤ÎǤ°Õ¤ÎÉôʬ¤Î¥Æ¥­¥¹¥È¤òʸ»úÎó¤ËÊÑ´¹¤¹¤ë ¤¿¤á¤Î2¤Ä¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤Þ¤¹¡£

Function: buffer-substring start end

¤³¤Î´Ø¿ô¤Ï¡¢¥«¥ì¥ó¥È¥Ð¥Ã¥Õ¥¡¤Îstart¤Èend¤Î°ÌÃÖ¤ÇÄêµÁ¤µ¤ì¤ë Îΰè¤Î¥Æ¥­¥¹¥È¤Î¥³¥Ô¡¼¤ò´Þ¤ó¤Àʸ»úÎó¤òÊÖ¤¹¡£ °ú¿ô¤¬¥Ð¥Ã¥Õ¥¡¤Î»²¾È²ÄǽÉôʬ¤ÎÆâ¦¤Î°ÌÃ֤Ǥʤ¤¤È¡¢ buffer-substring¤Ï¥¨¥é¡¼args-out-of-range¤òÄÌÃΤ¹¤ë¡£

start¤¬end¤è¤ê¾®¤µ¤¤É¬ÍפϤʤ¯¡¢°ú¿ô¤Î½çÈ֤ϤɤÁ¤é¤Ç¤â¤è¤¤¡£ ¤·¤«¤·¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¾®¤µ¤¤°ú¿ô¤òÀè¤Ë½ñ¤¯¡£

¥³¥Ô¡¼¤µ¤ì¤ë¥Æ¥­¥¹¥È¤Ë¥Æ¥­¥¹¥È°À­¤¬¤¢¤ë¾ì¹ç¡¢ ¥Æ¥­¥¹¥È°À­¤â¤½¤ì¤¬Â°¤¹¤ëʸ»ú¤È¤È¤â¤Ëʸ»úÎ󤨥³¥Ô¡¼¤µ¤ì¤ë¡£ see Text Properties¡£ ¤·¤«¤·¡¢¥Ð¥Ã¥Õ¥¡¤Î¥ª¡¼¥Ð¥ì¥¤¡Êsee Overlays¡Ë¤È¤½¤ì¤é¤Î°À­¤Ï ̵»ë¤µ¤ì¥³¥Ô¡¼¤µ¤ì¤Ê¤¤¡£

---------- Buffer: foo ----------
This is the contents of buffer foo

---------- Buffer: foo ----------
(buffer-substring 1 10)
⇒ "This is t"
(buffer-substring (point-max) 10)
⇒ "he contents of buffer foo
"
Function: buffer-substring-no-properties start end

¤³¤Î´Ø¿ô¤Ïbuffer-substring¤ÈƱÍͤǤ¢¤ë¤¬¡¢ ¥Æ¥­¥¹¥È°À­¤ò¥³¥Ô¡¼¤»¤º¤Ëʸ»ú¤À¤±¤ò¥³¥Ô¡¼¤¹¤ëÅÀ¤¬°Û¤Ê¤ë¡£ see Text Properties¡£

Function: buffer-string

¤³¤Î´Ø¿ô¤Ï¡¢¥«¥ì¥ó¥È¥Ð¥Ã¥Õ¥¡¤Î»²¾È²ÄǽÉôʬÁ´ÂÎ¤ÎÆâÍÆ¤òʸ»úÎó¤È¤·¤ÆÊÖ¤¹¡£ ¤³¤ì¤Ï¡¢¤Ä¤®¤ÈÅù²Á¤Ç¤¢¤ë¡£

(buffer-substring (point-min) (point-max))
---------- Buffer: foo ----------
This is the contents of buffer foo

---------- Buffer: foo ----------

(buffer-string)
     ⇒ "This is the contents of buffer foo
"
Function: thing-at-point thing

¥Ý¥¤¥ó¥È¤Î¼þ¤ê¤ä¤½¤Î¤¦¤·¤í¤Ë¤¢¤ëthing¤òʸ»úÎó¤È¤·¤ÆÊÖ¤¹¡£

°ú¿ôthing¤Ï¡¢¹½Ê¸¾å¤ÎÍ×ÁǤμïÎà¤ò»ØÄꤹ¤ë¥·¥ó¥Ü¥ë¤Ç¤¢¤ë¡£ ²Äǽ¤ÊÃͤϡ¢symbol¡¢list¡¢sexp¡¢ defun¡¢filename¡¢url¡¢word¡¢sentence¡¢ whitespace¡¢line¡¢page¤Ê¤É¤Ç¤¢¤ë¡£

---------- Buffer: foo ----------
Gentlemen may cry ``Pea∗ce! Peace!,''
but there is no peace.
---------- Buffer: foo ----------

(thing-at-point 'word)
     ⇒ "Peace"
(thing-at-point 'line)
     ⇒ "Gentlemen may cry ``Peace! Peace!,''\n"
(thing-at-point 'whitespace)
     ⇒ nil