all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: set-marker and make-marker, Wrong type argument: integer-or-marker-p, nil
Date: Sun, 29 Jul 2012 20:35:17 +0200	[thread overview]
Message-ID: <50158265.90700@easy-emacs.de> (raw)
In-Reply-To: <CAEjRLuShrmpQq_2TZ9BYimY-7RtyRU630p1g80ZQ=UV_K3iVSg@mail.gmail.com>

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
>





  parent reply	other threads:[~2012-07-29 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29  1:38 set-marker and make-marker, Wrong type argument: integer-or-marker-p, nil ishi soichi
2012-07-29  5:38 ` Jambunathan K
2012-07-29 18:35 ` Andreas Röhler [this message]
2012-07-30  5:10 ` Thien-Thi Nguyen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50158265.90700@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.