* Issue with format-alist (Buglet?)
@ 2008-08-06 8:31 tomas
2008-08-06 8:43 ` [PATCH] " tomas
0 siblings, 1 reply; 2+ messages in thread
From: tomas @ 2008-08-06 8:31 UTC (permalink / raw)
To: emacs-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have got a small problem with format-alist, which I call like so:
| (add-to-list 'format-alist
| (list "ZEIT-k4c"
| "ZEIT k4 cooked XML"
| "^<\\?xml[^>]*>[^<]*<article>"
| 'am-parse-region
| 'am-unparse-region-other-buffer
| t
| 'am-mode)
| nil
| (lambda (x y) (equal (car x) (car y))))
Note that the sixth parameter is t -- i.e. I do modify the list in
am-unparse-region-other-buffer.
When the original buffer contains read-only stuff (i.e. some text with
the read-only property set), the second attempt to save fails. It seems
that the buffer " *Format Temp 0*" is kept around and its contents can't
be overwritten because of the (copied). My Emacs is a fairly recent CVS
checkout (three hours ago, GNU Emacs 23.0.60.1 (i686-pc-linux-gnu,
GTK+ Version 2.12.10) of 2008-08-06 on tingklik).
Here's the output of "report Emas bug":
It seems that the pre-save format function can't be called twice when
there is text marked read-only in the original buffer
If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
`bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/local/share/emacs/23.0.60/etc/DEBUG for instructions.
In GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.12.10)
of 2008-08-06 on tingklik
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: nil
locale-coding-system: utf-8-unix
default-enable-multibyte-characters: t
Major mode: Fundamental
Minor modes in effect:
am-mode: t
tooltip-mode: t
tool-bar-mode: t
mouse-wheel-mode: t
use-hard-newlines: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
global-auto-composition-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: (only . t)
Recent input:
C-x C-f Z E <tab> <tab> a m <tab> a m - m o d e <tab>
<return> <end> <next> <next> <next> <next> <up> <up>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <up> <up> <down> <right> <right> <right> <right>
<right> <right> <right> <right> <right> <right> <right>
<right> <right> <right> <right> <down> <left> <left>
<right> <right> <right> <right> <right> <right> <right>
<down> <down> <down> <down> <down> <down-mouse-1> <mouse-movement>
<mouse-movement> <drag-mouse-1> C-x C-f S i e m <tab>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> S i
e <tab> <return> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <down> <down> <down> <down> <down>
<down> <down> <down> <up> SPC C-x C-s <backspace> C-x
C-s C-x b SPC F <tab> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<down-mouse-1> <mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<drag-mouse-1> C-g M-x r e p o <tab> r <tab> <retu
rn>
Recent messages:
Loading /home/tomas/.emacs.d/lisp/am/am-buffer.el (source)...done
Loading /home/tomas/.emacs.d/lisp/am/am-xml.el (source)...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Loading vc-git...done
call-interactively: End of buffer
am mode on
Wrote /home/tomas/Siemens
copy-to-buffer: Text is read-only
Quit
Making completion list...
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFImWFsBcgs9XrR2kYRAjj3AJ9VEnE/yL0oQF0YK9q/9B4TGutGdQCdEFQ8
evmCstNMSp3qO1wvMfzr9IU=
=2ZcS
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] Issue with format-alist (Buglet?)
2008-08-06 8:31 Issue with format-alist (Buglet?) tomas
@ 2008-08-06 8:43 ` tomas
0 siblings, 0 replies; 2+ messages in thread
From: tomas @ 2008-08-06 8:43 UTC (permalink / raw)
To: tomas; +Cc: emacs-devel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
the following patch seems to solve the issue with me (i.e. wrapping
inhibit-read-only around munging copy-buf in format.el). I don't know
whether it is The Right Thing, but it might help to pin-point the
problem:
RCS file: /sources/emacs/emacs/lisp/format.el,v
retrieving revision 1.61
diff -r1.61 format.el
219,227c219,228
< (with-current-buffer copy-buf
< (setq selective-display sel-disp)
< (set-buffer-multibyte multibyte)
< (setq buffer-file-coding-system coding-system))
< (copy-to-buffer copy-buf from to)
< (set-buffer copy-buf)
< (format-insert-annotations write-region-annotations-so-far from)
< (format-encode-run-method to-fn (point-min) (point-max) orig-buf)
< nil)
- ---
> (let ((inhibit-read-only t))
> (with-current-buffer copy-buf
> (setq selective-display sel-disp)
> (set-buffer-multibyte multibyte)
> (setq buffer-file-coding-system coding-system))
> (copy-to-buffer copy-buf from to)
> (set-buffer copy-buf)
> (format-insert-annotations write-region-annotations-so-far from)
> (format-encode-run-method to-fn (point-min) (point-max) orig-buf)
> nil))
Regards
- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFImWQfBcgs9XrR2kYRAvp3AJ9GP/kZPFqgZbl0j0kvGW/rfSWCTACfcFhF
Ce836bAJCnwN71NMPzoxPYo=
=0AYv
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-08-06 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-06 8:31 Issue with format-alist (Buglet?) tomas
2008-08-06 8:43 ` [PATCH] " tomas
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.