From: Agustín Martín Date: Tue, 3 May 2011 11:08:15 +0000 (+0200) Subject: ispell.el (ispell-add-per-file-word-list): Protect against `nil' value of `comment... X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~137 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bf242939d9cf16868e55e9c346eeb222cc3ffc6a;p=emacs.git ispell.el (ispell-add-per-file-word-list): Protect against `nil' value of `comment-start' (Bug#8579). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aa9052adfb4..460c62ca23e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2011-05-03 Dirk Ullrich (tiny change) + + * textmodes/ispell.el (ispell-add-per-file-word-list): + Protect against `nil' value of `comment-start' (Bug#8579). + 2011-05-03 Leo Liu * isearch.el (isearch-yank-pop): New command. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 35409d64289..a65ed227124 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3915,14 +3915,18 @@ Both should not be used to define a buffer-local dictionary." (progn (open-line 1) (unless found (newline)) - (insert (if (fboundp 'comment-padright) - ;; Try and use the proper comment marker, - ;; e.g. ";;" rather than ";". - (comment-padright comment-start - (comment-add nil)) - comment-start) - " " ispell-words-keyword) - (if (> (length comment-end) 0) + (insert (if comment-start + (progn + (if (fboundp 'comment-padright) + ;; Try and use the proper comment marker, + ;; e.g. ";;" rather than ";". + (comment-padright comment-start + (comment-add nil)) + comment-start) + " ") + "") + ispell-words-keyword) + (if (and comment-end (> (length comment-end) 0)) (save-excursion (newline) (insert comment-end)))))