From: Kazuhiro Ito <kzhr@d1.dion.ne.jp>
To: Eli Zaretskii <eliz@gnu.org>
Cc: monnier@IRO.UMontreal.CA, Uday Reddy <usr.vm.rocks@gmail.com>,
emacs-devel@gnu.org
Subject: Re: Emacs24 coding system problems
Date: Mon, 26 Nov 2012 17:30:25 +0900 [thread overview]
Message-ID: <87zk24davy.wl%%xmue@d1.dion.ne.jp> (raw)
In-Reply-To: <83y5hpxc6y.fsf@gnu.org>
At Mon, 26 Nov 2012 05:41:57 +0200,
Eli Zaretskii wrote:
>
> > Date: Sun, 25 Nov 2012 23:37:14 +0000
> > From: Uday Reddy <usr.vm.rocks@gmail.com>
> > Cc: Uday Reddy <usr.vm.rocks@gmail.com>,
> > kzhr@d1.dion.ne.jp,
> > monnier@IRO.UMontreal.CA,
> > emacs-devel@gnu.org
> >
> > Hmm. Eli, it looks like you haven't read Kazuhiro's bug report closely.
> > find-file-noselect is setting the variable.
>
> It does? Can you show me where?
find-file-not-found-set-buffer-file-coding-system in lisp/dos-w32.el.
lisp/dos-w32.el adds find-file-not-found-set-buffer-file-coding-system
to find-file-not-found-functions.
Please try the below code on trunk or emacs-24 on Windows.
(let ((debug-on-error t))
(defadvice find-file-not-found-set-buffer-file-coding-system
(after debug activate)
(when buffer-file-type
(error "buffer-file-type is non-nil")))
(list
(setq buffer-file-type nil)
(progn
(let ((coding-system-for-read 'no-conversion))
;; Specify non-existing file.
(kill-buffer (find-file-noselect "c:/zzzzzzz")))
buffer-file-type)))
Debugger entered--Lisp error: (error "buffer-file-type is non-nil")
signal(error ("buffer-file-type is non-nil"))
error("buffer-file-type is non-nil")
find-file-not-found-set-buffer-file-coding-system()
run-hook-with-args-until-success(find-file-not-found-set-buffer-file-coding-system)
(or (run-hook-with-args-until-success (quote find-file-not-found-functions)) (setq error t))
(condition-case nil (let ((inhibit-read-only t)) (insert-file-contents filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer buf) (signal (quote file-error) (list "File is not readable" filename))) (or (run-hook-with-args-until-success (quote find-file-not-found-functions)) (setq error t))))
(if rawfile (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents-literally filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer buf) (signal (quote file-error) (list "File is not readable" filename))) (setq error t))) (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer buf) (signal (quote file-error) (list "File is not readable" filename))) (or (run-hook-with-args-until-success (quote find-file-not-found-functions)) (setq error t)))))
(save-current-buffer (set-buffer buf) (kill-local-variable (quote find-file-literally)) (kill-local-variable (quote buffer-file-coding-system)) (kill-local-variable (quote cursor-type)) (let ((inhibit-read-only t)) (erase-buffer)) (and (default-value (quote enable-multibyte-characters)) (not rawfile) (set-buffer-multibyte t)) (if rawfile (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents-literally filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer buf) (signal (quote file-error) (list "File is not readable" filename))) (setq error t))) (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer
buf) (signal (quote file-error) (list "File is not readable" filename))) (or (run-hook-with-args-until-success (quote find-file-not-found-functions)) (setq error t))))) (if (equal filename b
uffer-file-name) (setq buffer-file-truename truename) (setq buffer-file-truename (abbreviate-file-name (file-truename buffer-file-name)))) (setq buffer-file-number number) (if find-file-visit-truename (setq buffer-file-name (expand-file-name buffer-file-truename))) (setq default-directory (file-name-directory buffer-file-name)) (and backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) (progn (make-local-variable (quote backup-inhibited)) (setq backup-inhibited t))) (if rawfile (progn (set-buffer-multibyte nil) (setq buffer-file-coding-system (quote no-conversion)) (set-buffer-major-mode buf) (make-local-variable (quote find-file-literally)) (setq find-file-literally t)) (after-find-file error (not nowarn))) (current-buffer))
(with-current-buffer buf (kill-local-variable (quote find-file-literally)) (kill-local-variable (quote buffer-file-coding-system)) (kill-local-variable (quote cursor-type)) (let ((inhibit-read-only t)) (erase-buffer)) (and (default-value (quote enable-multibyte-characters)) (not rawfile) (set-buffer-multibyte t)) (if rawfile (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents-literally filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer buf) (signal (quote file-error) (list "File is not readable" filename))) (setq error t))) (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) (kill-buffer buf) (signal
(quote file-error) (list "File is not readable" filename))) (or (run-hook-with-args-until-success (quote find-file-not-found-functions)) (setq error t))))) (if (equal filename buffer-file-na
me) (setq buffer-file-truename truename) (setq buffer-file-truename (abbreviate-file-name (file-truename buffer-file-name)))) (setq buffer-file-number number) (if find-file-visit-truename (setq buffer-file-name (expand-file-name buffer-file-truename))) (setq default-directory (file-name-directory buffer-file-name)) (and backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) (progn (make-local-variable (quote backup-inhibited)) (setq backup-inhibited t))) (if rawfile (progn (set-buffer-multibyte nil) (setq buffer-file-coding-system (quote no-conversion)) (set-buffer-major-mode buf) (make-local-variable (quote find-file-literally)) (setq find-file-literally t)) (after-find-file error (not nowarn))) (current-buffer))
(let (error) (with-current-buffer buf (kill-local-variable (quote find-file-literally)) (kill-local-variable (quote buffer-file-coding-system)) (kill-local-variable (quote cursor-type)) (let ((inhibit-read-only t)) (erase-buffer)) (and (default-value (quote enable-multibyte-characters)) (not rawfile) (set-buffer-multibyte t)) (if rawfile (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents-literally filename t)) (file-error (when (and (file-exists-p filename) (not ...)) (kill-buffer buf) (signal (quote file-error) (list "File is not readable" filename))) (setq error t))) (condition-case nil (let ((inhibit-read-only t)) (insert-file-contents filename t)) (file-error (when (and (file-exists-p filename) (not ...)) (kill-buffer buf) (signal (quote file-error) (list "File is
not readable" filename))) (or (run-hook-with-args-until-success (quote find-file-not-found-functions)) (setq error t))))) (if (equal filename buffer-file-name) (setq buffer-file-truename tr
uename) (setq buffer-file-truename (abbreviate-file-name (file-truename buffer-file-name)))) (setq buffer-file-number number) (if find-file-visit-truename (setq buffer-file-name (expand-file-name buffer-file-truename))) (setq default-directory (file-name-directory buffer-file-name)) (and backup-enable-predicate (not (funcall backup-enable-predicate buffer-file-name)) (progn (make-local-variable (quote backup-inhibited)) (setq backup-inhibited t))) (if rawfile (progn (set-buffer-multibyte nil) (setq buffer-file-coding-system (quote no-conversion)) (set-buffer-major-mode buf) (make-local-variable (quote find-file-literally)) (setq find-file-literally t)) (after-find-file error (not nowarn))) (current-buffer)))
find-file-noselect-1(#<buffer zzzzzzz> "c:/zzzzzzz" nil nil "c:/zzzzzzz" nil)
find-file-noselect("c:/zzzzzzz")
(kill-buffer (find-file-noselect "c:/zzzzzzz"))
(let ((coding-system-for-read (quote no-conversion))) (kill-buffer (find-file-noselect "c:/zzzzzzz")))
(progn (let ((coding-system-for-read (quote no-conversion))) (kill-buffer (find-file-noselect "c:/zzzzzzz"))) buffer-file-type)
(list (setq buffer-file-type nil) (progn (let ((coding-system-for-read (quote no-conversion))) (kill-buffer (find-file-noselect "c:/zzzzzzz"))) buffer-file-type))
(let ((debug-on-error t)) (defadvice find-file-not-found-set-buffer-file-coding-system (after debug activate) (when buffer-file-type (error "buffer-file-type is non-nil"))) (list (setq buffer-file-type nil) (progn (let ((coding-system-for-read (quote no-conversion))) (kill-buffer (find-file-noselect "c:/zzzzzzz"))) buffer-file-type)))
eval((let ((debug-on-error t)) (defadvice find-file-not-found-set-buffer-file-coding-system (after debug activate) (when buffer-file-type (error "buffer-file-type is non-nil"))) (list (setq buffer-file-type nil) (progn (let ((coding-system-for-read (quote no-conversion))) (kill-buffer (find-file-noselect "c:/zzzzzzz"))) buffer-file-type))) nil)
eval-last-sexp-1(t)
eval-last-sexp(t)
eval-print-last-sexp()
call-interactively(eval-print-last-sexp nil nil)
--
Kazuhiro Ito
next prev parent reply other threads:[~2012-11-26 8:30 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 8:24 Emacs24 coding system problems Uday Reddy
2012-11-02 8:39 ` Andreas Schwab
2012-11-02 8:51 ` Eli Zaretskii
2012-11-02 8:56 ` Eli Zaretskii
2012-11-18 19:06 ` Uday Reddy
2012-11-18 21:07 ` Eli Zaretskii
2012-11-19 4:05 ` Stephen J. Turnbull
2012-11-19 8:43 ` Uday Reddy
2012-11-24 20:29 ` Stefan Monnier
2012-11-25 7:58 ` Uday Reddy
2012-11-25 10:44 ` Uday Reddy
2012-11-25 16:06 ` Eli Zaretskii
2012-11-25 20:36 ` Uday Reddy
2012-11-25 21:10 ` Eli Zaretskii
2012-11-25 11:48 ` Kazuhiro Ito
2012-11-25 19:58 ` Uday Reddy
2012-11-25 21:14 ` Eli Zaretskii
2012-11-25 23:37 ` Uday Reddy
2012-11-26 3:41 ` Eli Zaretskii
2012-11-26 8:30 ` Kazuhiro Ito [this message]
2012-11-26 17:16 ` Eli Zaretskii
2012-11-28 12:39 ` Kazuhiro Ito
2012-11-28 17:40 ` Eli Zaretskii
2012-11-28 21:16 ` Uday S Reddy
2012-11-29 3:46 ` Eli Zaretskii
2012-11-30 10:58 ` Uday Reddy
2012-11-30 13:40 ` Eli Zaretskii
2012-12-02 0:46 ` Emacs24 unpredictable behaviour [Was: coding system problems] Uday Reddy
2012-12-02 8:06 ` Andreas Schwab
2012-12-02 11:42 ` Uday Reddy
2012-11-09 17:01 ` Emacs24 coding system problems Stefan Monnier
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zk24davy.wl%%xmue@d1.dion.ne.jp \
--to=kzhr@d1.dion.ne.jp \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
--cc=usr.vm.rocks@gmail.com \
/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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).