From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Maus Subject: Re: Re[2]: programming for org-mode Date: Sat, 07 Aug 2010 15:12:32 +0200 Message-ID: <87lj8ia7nj.wl%dmaus@ictsoc.de> References: <3910304564.20100715085202@gmail.com> <87vd8gejvk.fsf@gmail.com> <226505391.20100805163301@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="===============0311222321==" Return-path: Received: from [140.186.70.92] (port=50929 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oi9b1-0001oB-Q0 for emacs-orgmode@gnu.org; Sun, 08 Aug 2010 13:23:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OhjCn-0002FX-23 for emacs-orgmode@gnu.org; Sat, 07 Aug 2010 09:12:54 -0400 Received: from mysql1.xlhost.de ([213.202.242.106]:42740) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OhjCm-0002FB-Bm for emacs-orgmode@gnu.org; Sat, 07 Aug 2010 09:12:53 -0400 In-Reply-To: <226505391.20100805163301@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Ivanov Dmitry Cc: emacs-orgmode@gnu.org --===============0311222321== Content-Type: multipart/signed; boundary="pgp-sign-Multipart_Sat_Aug__7_15:12:31_2010-1"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --pgp-sign-Multipart_Sat_Aug__7_15:12:31_2010-1 Content-Type: text/plain; charset=US-ASCII Hi Ivanov, Ivanov Dmitry wrote: >Hi, Eric. I decided to draw schemes for functions in your module org-collector.el. And started from org-read-prop. Please, check my pdf file - my questions are marked with green. If there are no attachments allowed in the mailing list, you can get it here: >http://live-wtr.ru/org/org-collector.pdf ,---- | 01. (defun org-read-prop (prop) | 02. "Convert the string property PROP to a number if appropriate. | 03. Otherwise if prop looks like a list (meaning it starts with a | 04. '(') then read it as lisp, otherwise return it unmodified as a | 05. string." | 06. (if (and (stringp prop) (not (equal prop ""))) | 07. (let ((out (string-to-number prop))) | 08. (if (equal out 0) | 09. (if (or (equal "(" (substring prop 0 1)) (equal "'" (substring prop 0 1))) | 10. (read prop) | 11. (if (string-match "^\\(+0\\|-0\\|0\\)$" prop) | 12. 0 | 13. (progn (set-text-properties 0 (length prop) nil prop) | 14. prop))) | 15. out)) | 16. prop)) `---- If `prop' is a string and not empty, bind `out' to the result of calling `string-to-number' with argument `prop'. `string-to-number' returns 0 if the string was a zero or if the string didn't contain convertable characters. Thus, if `out` ist /not/ zero, we return `out'. If it is, check if `prop' looks like a Lisp expression (Line 09). If it looks like a Lisp expresion, return this expression. C-h f read RET: ,---- | read is a built-in function in `C source code'. | | (read &optional STREAM) | | Read one Lisp expression as text from STREAM, return as Lisp object. | If STREAM is nil, use the value of `standard-input' (which see). | STREAM or the value of `standard-input' may be: | a buffer (read from point and advance it) | a marker (read from where it points and advance it) | a function (call it with no arguments for each character, | call it with a char as argument to push a char back) | a string (takes text from string, starting at the beginning) | t (read text line using minibuffer and use it, or read from | standard input in batch mode). | | [back] `---- If it didn't look like a Lisp expression, check if `out' is 0 because `prop' is the string "0", "+0", or "-0". If this is the case, return 0. We don't use `unless' because in this case the function `org-read-prop' would return nil. HTH, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber.... dmjena@jabber.org Email..... dmaus@ictsoc.de --pgp-sign-Multipart_Sat_Aug__7_15:12:31_2010-1 Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iF4EABEIAAYFAkxdW78ACgkQma24O1pEeOZMigEAsxpeyEdDuq7jzOELC5ovkGYD 0aNNVfx/G1pZeVcKQ0kA/3i9gmoucmr8RGjHiRXDmmDtxYcMswpF0OpF4v0+hdEK =Z387 -----END PGP SIGNATURE----- --pgp-sign-Multipart_Sat_Aug__7_15:12:31_2010-1-- --===============0311222321== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0311222321==--