all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* set-marker and make-marker, Wrong type argument: integer-or-marker-p, nil
@ 2012-07-29  1:38 ishi soichi
  2012-07-29  5:38 ` Jambunathan K
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: ishi soichi @ 2012-07-29  1:38 UTC (permalink / raw)
  To: help-gnu-emacs

[-- 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 --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-07-30  5:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2012-07-30  5:10 ` Thien-Thi Nguyen

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.