From: "Paweł Ostrowski" <pasza@students.mimuw.edu.pl>
To: bug-gnu-emacs@gnu.org
Subject: patch: fix read-abbrev-file cant read files produced by write-abbrev-file
Date: Thu, 15 Nov 2007 12:06:42 +0100 [thread overview]
Message-ID: <20071115110642.GA20386@localhost.localdomain> (raw)
[-- Attachment #1: Type: text/plain, Size: 2224 bytes --]
Hello,
Emacs version: latest CVS, GNU Emacs 23.0.50.2 (i686-pc-linux-gnu,
GTK+ Version 2.10.11) of 2007-11-14 on paszaibm
Configured with: --prefix=/home/pasza/tmp/emacs_cvs
Source modifications: no modifications at all
Bug description: read-abbrev-file has problems reading file written
with write-abbrev-file. I get the following message:
"define-abbrev: Wrong type argument: stringp, po"
..and the following backtrace:
Debugger entered--Lisp error: (wrong-type-argument stringp po)
intern(po [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...])
define-abbrev([ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] po "Pawe\x51062 Ostrowski" nil 1)
apply(define-abbrev [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...] (po "Pawe\x51062 Ostrowski" nil 1))
define-abbrev-table(global-abbrev-table ((po "Pawe\x51062 Ostrowski" nil 1)))
eval-buffer(#<buffer *load*> nil "/home/pasza/.abbrevs" nil t) ; Reading at buffer position 408
load-with-code-conversion("/home/pasza/.abbrevs" "/home/pasza/.abbrevs" nil nil)
load("~/.abbrevs" nil nil)
read-abbrev-file("~/.abbrevs")
call-interactively(read-abbrev-file)
execute-extended-command(nil)
call-interactively(execute-extended-command)
Indeed abbrev names in files produced by
write-abbrev-file miss surrounding quotes, e.g.:
(define-abbrev-table 'global-abbrev-table '( (po "My Expansion"..
^^
Abbrevs stored in the file are not loaded.
Bug may be easily reproduced: define an abbrev,
write-abbrev-file, read-abbrev-file.
Fix description: I added (symbol-name) around abbrev symbol in
abbrev.el (abbrev--write). Now files produced by
write-abbrev-file look like they used to in old
emacs (my is 21.4.1) and load without problems.
--
Paweł Ostrowski
pasza at zodiac mimuw edu pl
[-- Attachment #2: abbrevs.patch --]
[-- Type: text/x-diff, Size: 1433 bytes --]
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.12211
diff -u -p -c -r1.12211 ChangeLog
*** lisp/ChangeLog 15 Nov 2007 06:04:31 -0000 1.12211
--- lisp/ChangeLog 15 Nov 2007 10:35:10 -0000
***************
*** 1,3 ****
--- 1,7 ----
+ 2007-11-15 <pawel.ostrowski@gmail.com>
+
+ * abbrev.el (abbrev--write): use (symbol-name) to write abbrev name.
+
2007-11-15 Jay Belanger <jay.p.belanger@gmail.com>
* calc/calc-menu.el: New file.
Index: lisp/abbrev.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/abbrev.el,v
retrieving revision 1.62
diff -u -p -c -r1.62 abbrev.el
*** lisp/abbrev.el 9 Nov 2007 16:07:17 -0000 1.62
--- lisp/abbrev.el 15 Nov 2007 10:35:11 -0000
*************** Only writes the non-system abbrevs.
*** 825,831 ****
Presumes that `standard-output' points to `current-buffer'."
(unless (or (null (symbol-value sym)) (abbrev-get sym :system))
(insert " (")
! (prin1 sym)
(insert " ")
(prin1 (symbol-value sym))
(insert " ")
--- 825,831 ----
Presumes that `standard-output' points to `current-buffer'."
(unless (or (null (symbol-value sym)) (abbrev-get sym :system))
(insert " (")
! (prin1 (symbol-name sym))
(insert " ")
(prin1 (symbol-value sym))
(insert " ")
next reply other threads:[~2007-11-15 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 11:06 Paweł Ostrowski [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-11-15 14:46 patch: fix read-abbrev-file cant read files produced by write-abbrev-file Paweł Ostrowski
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=20071115110642.GA20386@localhost.localdomain \
--to=pasza@students.mimuw.edu.pl \
--cc=bug-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.