diff options
author | psg <> | 2009-10-10 22:15:28 +0000 |
---|---|---|
committer | psg <> | 2009-10-10 22:15:28 +0000 |
commit | a6eb73f2cd2ca87be691d2a4639b36681c34552c (patch) | |
tree | c46232ee3ae2d9d295ade2ca11d5f6044faa18c4 | |
parent | 4e76eab4801004e3875cb6cf0d2b7d3c3ad51f45 (diff) |
Bug fix: "Outputs wrongly utf-8 chars if the buffer is called
control", thanks to Marco TĂșlio Gontijo e Silva (Closes: #526374).
Edited deb-view-control-coding to (1) return 'undecided instead or nil
when there's no match, and (2) call deb-view-control-coding only on
exact match of "control" filename.
-rw-r--r-- | debian-el.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/debian-el.el b/debian-el.el index 432c2ef..165528b 100644 --- a/debian-el.el +++ b/debian-el.el @@ -87,17 +87,17 @@ tell if it's from a deb. Note: This only works in emacs22, in emacs21 or xemacs21 tar-mode does something a bit different and doesn't reach here (and there's no buffer passed to coding system functions)." - - (and (eq (car arg-list) 'insert-file-contents) ;; first arg - (consp (cadr arg-list)) ;; second arg like ("./control" . BUFFER) - (let ((buffer (cdr (cadr arg-list)))) - (and (buffer-file-name buffer) - (string-match "\\.deb-INFO!\\./control\\'" - (buffer-file-name buffer)) - 'utf-8)))) + (if (and (eq (car arg-list) 'insert-file-contents) ;; first arg + (consp (cadr arg-list)) ;; second arg like ("./control" . BUFFER) + (let ((buffer (cdr (cadr arg-list)))) + (and (buffer-file-name buffer) + (string-match "\\.deb-INFO!\\./control\\'" + (buffer-file-name buffer)) + 'utf-8))) + 'undecided)) (add-to-list 'file-coding-system-alist - '("control" . deb-view-control-coding))) + '("\\'control\\'" . deb-view-control-coding))) (provide 'debian-el) |