From: ishi soichi <soichi777@gmail.com>
To: emacs-orgmode@gnu.org
Subject: elisp code takes CPU too much
Date: Mon, 27 Dec 2010 14:47:30 +0900 [thread overview]
Message-ID: <AANLkTi=O=DUtoerLo-=8isHHQ42XBEV0xBFTVrRQKibS@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1042 bytes --]
hi. I have wrote an elisp code for org-mode, which puts entries in a table.
It is a simple code in my opinion and it does the job I intended. But when
executed, the activation of CPU shoots up and it will take a while to
complete it. I do not believe that this little code requires such a
work-load for the computer. There must be my wrong-doing.
Could anyone help me for fixing it?
soichi
P.S. the code follows, and there is "word" in the table so that "search"
command looks for it.
;;---------------------------------------------
(require 'org-table)
(setq alist (list "apple" "orange" "lemon" "baseball" "football"))
(defun test-table (word-list)
"test to see if org-table-put works well"
(find-file-noselect (concat "~/Dropbox/language/word.org"))
(set-buffer "word.org")
(save-excursion
(goto-char (point-min))
(search-forward "word")
(goto-char (match-beginning 0))
(let ((i 1))
(while word-list
(org-table-put i 3 (nth (- i 1) word-list) t)
(setq i (1+ i))))))
(test-table alist) ;;execute it here
[-- Attachment #1.2: Type: text/html, Size: 1636 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
next reply other threads:[~2010-12-27 5:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-27 5:47 ishi soichi [this message]
2010-12-27 11:10 ` elisp code takes CPU too much Jambunathan K
2010-12-29 8:51 ` Štěpán Němec
2010-12-27 14:17 ` Eric Schulte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=O=DUtoerLo-=8isHHQ42XBEV0xBFTVrRQKibS@mail.gmail.com' \
--to=soichi777@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).