emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs24 coding system problems


From: Kazuhiro Ito
Subject: Re: Emacs24 coding system problems
Date: Mon, 26 Nov 2012 17:30:25 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/24.3.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO)

At Mon, 26 Nov 2012 05:41:57 +0200,
Eli Zaretskii wrote:
> 
> > Date: Sun, 25 Nov 2012 23:37:14 +0000
> > From: Uday Reddy <address@hidden>
> > Cc: Uday Reddy <address@hidden>,
> >     address@hidden,
> >     address@hidden,
> >     address@hidden
> > 
> > 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]