unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* don't assume ELF binaries are multicultural text
@ 2006-07-11 20:36 Dan Jacobson
  2006-07-12 16:44 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Jacobson @ 2006-07-11 20:36 UTC (permalink / raw)


$ emacs /bin/sh
Loading thai-util...
Loading mule-util...done
Loading thai-util...done
Loading lao-util...done
Loading ind-util...done
Loading composite...done
Loading tibet-util...done

Got an idea, why not say "Uh, Holmes, /bin/sh is a ELF 32-bit LSB
executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0,
dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped,
shall we w: wrongly assume it is multicultural text, thus bloating
emacs for the remainder of the session, h: invoke some hex editing
mode, q: back out of your certainly mistaken attempt to open the wrong
file, f: forever allow me to blunder ahead as multicultural text next
time..."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: don't assume ELF binaries are multicultural text
  2006-07-11 20:36 don't assume ELF binaries are multicultural text Dan Jacobson
@ 2006-07-12 16:44 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2006-07-12 16:44 UTC (permalink / raw)


Dan Jacobson wrote:
> $ emacs /bin/sh
> Loading thai-util...
> Loading mule-util...done
> Loading thai-util...done
> Loading lao-util...done
> Loading ind-util...done
> Loading composite...done
> Loading tibet-util...done
> 
> Got an idea, why not say "Uh, Holmes, /bin/sh is a ELF 32-bit LSB
> executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0,
> dynamically linked (uses shared libs), for GNU/Linux 2.2.0, stripped,
> shall we w: wrongly assume it is multicultural text, thus bloating
> emacs for the remainder of the session, h: invoke some hex editing
> mode, q: back out of your certainly mistaken attempt to open the wrong
> file, f: forever allow me to blunder ahead as multicultural text next
> time..."

(setq auto-coding-regexp-alist
       (cons '("\\`\177ELF" . no-conversion)
             auto-coding-regexp-alist))

You can find more interesting byte patterns in /etc/magic.

(setq auto-mode-alist
       (cons (cons "\\`/bin/[^/]+\\'" 'hexl-mode)
             auto-mode-alist))

You can find more directories with binary files in (getenv "PATH") or
load-path.

-- 
Kevin

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-07-12 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-11 20:36 don't assume ELF binaries are multicultural text Dan Jacobson
2006-07-12 16:44 ` Kevin Rodgers

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).