From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Yu,Gang" Newsgroups: gmane.emacs.help Subject: Re: help on text-properties Date: Wed, 6 Jun 2007 17:00:06 +0800 Message-ID: <48378d570706060200v4ea7b9d2oe6c75e1012f9dbb3@mail.gmail.com> References: <87zm3dy2qf.fsf@ambire.localdomain> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1331869530==" X-Trace: sea.gmane.org 1181120500 2023 80.91.229.12 (6 Jun 2007 09:01:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Jun 2007 09:01:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "Thien-Thi Nguyen" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jun 06 11:01:39 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HvrOT-0008So-5f for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jun 2007 11:01:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvrOM-00081H-N6 for geh-help-gnu-emacs@m.gmane.org; Wed, 06 Jun 2007 05:01:22 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HvrNv-0007zP-7D for help-gnu-emacs@gnu.org; Wed, 06 Jun 2007 05:00:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HvrNs-0007yB-KF for help-gnu-emacs@gnu.org; Wed, 06 Jun 2007 05:00:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvrNs-0007xy-F9 for help-gnu-emacs@gnu.org; Wed, 06 Jun 2007 05:00:52 -0400 Original-Received: from nz-out-0506.google.com ([64.233.162.229]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HvrNp-00055Y-Uu for help-gnu-emacs@gnu.org; Wed, 06 Jun 2007 05:00:51 -0400 Original-Received: by nz-out-0506.google.com with SMTP id z3so68087nzf for ; Wed, 06 Jun 2007 02:00:07 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=sWDAdu7914ffcD8FHWR8drdgJ3KX8vZKuX/PyhS+jOgZz0eK2kiwXV0FI+OG62Gi51vo5+NB/XYKpzCYLXTyXhxvXX2PDqgu7hf+pQ1xiuOlW/OPZ5dC+b9zsXu1NsnN8adrdcY+AUQbmtR2x3n3AH+5fnqC2oIz4QypF0TzMbk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=tWTwOmQ00kM/7tMbMbkwi5+ESRgQ/UGuSTAbKnN/CTOz9ZQw3jTb8D4dBWVpzcD6Ic0XKZN7SSlm9u5KZ9au2tlcECzJxEs6B1inPrYG1LZCJVshL8d2BToV/2ooaOnuMQkF9H3kfSwktestdmjGWUZu0QBOMZy3jYHeDKIIvq4= Original-Received: by 10.114.109.1 with SMTP id h1mr270337wac.1181120406764; Wed, 06 Jun 2007 02:00:06 -0700 (PDT) Original-Received: by 10.114.60.1 with HTTP; Wed, 6 Jun 2007 02:00:06 -0700 (PDT) In-Reply-To: <87zm3dy2qf.fsf@ambire.localdomain> X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:44699 Archived-At: --===============1331869530== Content-Type: multipart/alternative; boundary="----=_Part_25756_29426188.1181120406640" ------=_Part_25756_29426188.1181120406640 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks, I get things run now~ (defun show-paren-minibuffer (pair-point pos) "show the paren pair in the minibuffer" (if (not (pos-visible-in-window-p pair-point)) (let ((pair-line-number (line-number-at-pos pair-point)) (pos-line-number (line-number-at-pos pos)) show-string offset) (if (not (equal pair-line-number pos-line-number)) (save-excursion (goto-line pair-line-number) (setq offset (- pair-point (line-beginning-position))) (setq show-string (buffer-substring (line-beginning-position) (line-end-position))) (if (> pos pair-point) (add-text-properties offset (+ offset 1) '(fontified t face highlight) show-string) (add-text-properties (- offset 1) offset '(fontified t face highlight) show-string)) (if (< (length show-string) 20) (setq show-string (concat (buffer-substring (- (line-beginning-position) 30) (- (line-beginning-position) 1)) "\n" show-string "\n" (buffer-substring (+ (line-end-position) 1) (+ (line-end-position) 30))))) (message "%s" show-string)))))) On 6/6/07, Thien-Thi Nguyen wrote: > > () "Yu,Gang" > () Wed, 6 Jun 2007 13:15:35 +0800 > > (set-text-properties offset offset ...) > > How can I sovle the problem? > > what is the distance between offset and offset? > (would be a fine number to count if but "not yet".) > when an expression paints pictures in thin air, > can memory alone suffice to record what's there? > if desire to build is too strong, one reflects, > it's easy to miss what is wrong, through neglect. > > thi > _______________________________________________ > help-gnu-emacs mailing list > help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs > -- YuGang ------=_Part_25756_29426188.1181120406640 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Thanks, I get things run now~

(defun show-paren-minibuffer (pair-point pos)
  "show the paren pair in the minibuffer"
  (if (not (pos-visible-in-window-p pair-point))
      (let ((pair-line-number (line-number-at-pos pair-point))
        (pos-line-number (line-number-at-pos pos))
        show-string
        offset)
    (if (not (equal pair-line-number pos-line-number))
        (save-excursion
          (goto-line pair-line-number)
          (setq offset (- pair-point (line-beginning-position)))
          (setq show-string (buffer-substring (line-beginning-position) (line-end-position)))
          (if (> pos pair-point)
          (add-text-properties offset (+ offset 1) '(fontified t face highlight) show-string)
        (add-text-properties (- offset 1) offset '(fontified t face highlight) show-string))
          (if (< (length show-string) 20)
          (setq show-string
            (concat
             (buffer-substring
              (- (line-beginning-position) 30) 
              (- (line-beginning-position) 1))
             "\n"
             show-string
             "\n"
             (buffer-substring
              (+ (line-end-position) 1)
              (+ (line-end-position) 30)))))
          (message "%s" show-string))))))

On 6/6/07, Thien-Thi Nguyen <ttn@gnuvola.org> wrote:
() "Yu,Gang" <wuhanyugang@gmail.com>
() Wed, 6 Jun 2007 13:15:35 +0800

   (set-text-properties offset offset ...)

   How can I sovle the problem?

what is the distance between offset and offset?
(would be a fine number to count if but "not yet".)
when an expression paints pictures in thin air,
can memory alone suffice to record what's there?
if desire to build is too strong, one reflects,
it's easy to miss what is wrong, through neglect.

thi
_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs



--
YuGang ------=_Part_25756_29426188.1181120406640-- --===============1331869530== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============1331869530==--