[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: current-word without arg may return nil?
From: |
Yoichi NAKAYAMA |
Subject: |
Re: current-word without arg may return nil? |
Date: |
Mon, 14 Mar 2005 21:13:29 +0900 |
User-agent: |
Wanderlust/2.13.3 (You Oughta Know) EMIKO/1.14.1 (Choanoflagellata) IMITATION/1.14.6 (一番搾り) APEL/10.6 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (賢木) |
I found the following problem remains, which
cause error "Wrong type argument: stringp, nil"
--
Yoichi Nakayama
At Sun, 04 Jul 2004 13:26:07 +0900,
Yoichi NAKAYAMA wrote:
> At Fri, 02 Jul 2004 00:03:18 +0900,
> Yoichi NAKAYAMA wrote:
> > Then, some files still assume the return value is string, e.g.
> > finder.el (finder-select), man.el (Man-follow-manual-reference)
> > may cause wrong-type-argument error.
>
> Fix against these follows.
> * finder.el (finder-current-item): Cause error on empty line.
> * man.el (Man-follow-manual-reference): If current-word returns
> nil, use "".
>
> Regards,
> --
> Yoichi NAKAYAMA
>
> Index: lisp/finder.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/finder.el,v
> retrieving revision 1.59
> diff -u -r1.59 finder.el
> --- lisp/finder.el 26 Mar 2004 14:54:17 -0000 1.59
> +++ lisp/finder.el 4 Jul 2004 04:24:07 -0000
> @@ -301,11 +301,13 @@
> (finder-summary)))
>
> (defun finder-current-item ()
> - (if (and finder-headmark (< (point) finder-headmark))
> - (error "No keyword or filename on this line")
> - (save-excursion
> - (beginning-of-line)
> - (current-word))))
> + (let ((key (save-excursion
> + (beginning-of-line)
> + (current-word))))
> + (if (or (and finder-headmark (< (point) finder-headmark))
> + (= (length key) 0))
> + (error "No keyword or filename on this line")
> + key)))
>
> (defun finder-select ()
> "Select item on current line in a finder buffer."
> Index: lisp/man.el
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/lisp/man.el,v
> retrieving revision 1.136
> diff -u -r1.136 man.el
> --- lisp/man.el 26 Jun 2004 09:44:56 -0000 1.136
> +++ lisp/man.el 4 Jul 2004 04:24:07 -0000
> @@ -1263,7 +1263,7 @@
> (error "There are no references in the current man page")
> (list (let* ((default (or
> (car (all-completions
> - (let ((word (Man-possibly-hyphenated-word)))
> + (let ((word (or
> (Man-possibly-hyphenated-word) "")))
> ;; strip a trailing '-':
> (if (string-match "-$" word)
> (substring word 0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: current-word without arg may return nil?,
Yoichi NAKAYAMA <=