From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: set-marker and make-marker, Wrong type argument: integer-or-marker-p, nil Date: Sun, 29 Jul 2012 20:35:17 +0200 Message-ID: <50158265.90700@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1343586927 32122 80.91.229.3 (29 Jul 2012 18:35:27 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 29 Jul 2012 18:35:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 29 20:35:28 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SvYKt-0004fJ-GP for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jul 2012 20:35:27 +0200 Original-Received: from localhost ([::1]:44765 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvYKs-0005aL-Sk for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Jul 2012 14:35:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55210) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvYKo-0005aG-KK for help-gnu-emacs@gnu.org; Sun, 29 Jul 2012 14:35:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvYKn-0001vz-MN for help-gnu-emacs@gnu.org; Sun, 29 Jul 2012 14:35:22 -0400 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:51394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvYKn-0001vj-C4 for help-gnu-emacs@gnu.org; Sun, 29 Jul 2012 14:35:21 -0400 Original-Received: from [192.168.178.27] (brln-4db9dbac.pool.mediaWays.net [77.185.219.172]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LiZ4a-1TVj6B1c8C-00ccK0; Sun, 29 Jul 2012 20:35:19 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120601 Thunderbird/13.0 In-Reply-To: X-Provags-ID: V02:K0:G/RzBRikKpzAyX7OxGw+3fBfwnykEDZrnLosjz2lbUg sB2LU94FRvrnjVh+8b+QGhXjfKrChs4MuBqbsHiY3ih2MlQq2w dJpPSy+f+JHzV6q+hY0PNVwhnGesr/hT8IfJPUVHqzYro18ri0 8ni/1QB+FH/5BBVdl/zY7AQS4vs6V58ql+MgMPuKElgxVGmb05 MTfPoy43Yrj3ErgmpSVDvxg5RAYrxwWsMHe6EXa6uE+vhIrEw4 fDeT3l+1uygDuJCdkDGTXIxXc5JwUnMtZ9KMomyBRImYPSCKvp SeS5Zf8YI70NQZjhyi4k2Tr8WMRhrlZEJi3dGqXSaeRm7ppdWK /8dCClckS/EwcP3FR8nhLzlya7kh3VAfCPR79moiX X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.126.171 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:86123 Archived-At: Am 29.07.2012 03:38, schrieb ishi soichi: > Emacs23 > > This should be simple for many of you. > I am trying to develop a function that searches a word definition stored in > a dict file. > > As you can see, when reading a text, you might need to look for additional > information about the encountered word. > The following function searches the information for the word in the region. > > > (defvar sfl-dictionary-directory "~/Dropbox/ElmLab/dict") > (defvar sfl-base-dict-file "test5.txt") > > (defun sfl-search-word-meaning () > (interactive) > (let ((word > (buffer-substring (region-beginning) (region-end))) > (result)) > (with-current-buffer > (find-file (concat sfl-dictionary-directory "/" sfl-base-dict-file)) > (goto-char (point-min)) > (search-forward word) > (set-marker (make-marker) (beginning-of-line)) > (goto-char (end-of-line)) > (setq result (buffer-substring (region-beginning) (region-end))) > (message result)))) > > > But this gives an error > > save-current-buffer: Wrong type argument: integer-or-marker-p, nil IMO this error is raised from inside `with-current-buffer'. Seems it doesn't get the return value it expects, which looks like a bug for me, as docstring doesn't mention a required return value, . The result of last form "message" will be a string, which seems not being accepted. Andreas > > It looks like (set-marker ... part is doing something wrong. > > Could anyone point out the mistake I am making? > > soichi >