all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ishi soichi <soichi777@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: set-marker and make-marker, Wrong type argument: integer-or-marker-p, nil
Date: Sun, 29 Jul 2012 10:38:00 +0900	[thread overview]
Message-ID: <CAEjRLuShrmpQq_2TZ9BYimY-7RtyRU630p1g80ZQ=UV_K3iVSg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1104 bytes --]

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

It looks like (set-marker ... part is doing something wrong.

Could anyone point out the mistake I am making?

soichi

[-- Attachment #2: Type: text/html, Size: 1677 bytes --]

             reply	other threads:[~2012-07-29  1:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-29  1:38 ishi soichi [this message]
2012-07-29  5:38 ` set-marker and make-marker, Wrong type argument: integer-or-marker-p, nil Jambunathan K
2012-07-29 18:35 ` Andreas Röhler
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='CAEjRLuShrmpQq_2TZ9BYimY-7RtyRU630p1g80ZQ=UV_K3iVSg@mail.gmail.com' \
    --to=soichi777@gmail.com \
    --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.