From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Benjamin Riefenstahl Newsgroups: gmane.emacs.bugs Subject: bug#36401: 26.0.90; set-auto-mode uses case-insensitive match for magic-mode-alist Date: Thu, 27 Jun 2019 11:30:47 +0200 Message-ID: <87o92jtlx4.fsf@riefenstahl-linux.mecom.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="99267"; mail-complaints-to="usenet@blaine.gmane.org" To: 36401@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 27 12:14:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hgRPv-000PZp-5V for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 12:14:11 +0200 Original-Received: from localhost ([::1]:48268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgRPt-0006u8-Q4 for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jun 2019 06:14:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46215) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgRPo-0006u2-Cf for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:14:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgRPm-0004yY-S0 for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:14:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52147) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hgRPm-0004yN-OF for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hgRPm-0005uv-Gx for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Benjamin Riefenstahl Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Jun 2019 10:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 36401 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.156163043222721 (code B ref -1); Thu, 27 Jun 2019 10:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Jun 2019 10:13:52 +0000 Original-Received: from localhost ([127.0.0.1]:37458 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgRPc-0005uO-8v for submit@debbugs.gnu.org; Thu, 27 Jun 2019 06:13:52 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hgRPa-0005uH-SF for submit@debbugs.gnu.org; Thu, 27 Jun 2019 06:13:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46171) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hgRPZ-0006fO-Cb for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:13:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hgRPX-0004gL-Ri for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:13:49 -0400 Original-Received: from smtp1.mecom.de ([193.109.231.32]:54484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hgRPX-0004bz-H0 for bug-gnu-emacs@gnu.org; Thu, 27 Jun 2019 06:13:47 -0400 Original-Received: from [192.168.226.74] (helo=riefenstahl-linux.mecom.de.mecom.de) by smtp1.mecom.de with esmtps (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.50) id 1hgQjv-0003PG-PY; Thu, 27 Jun 2019 11:30:47 +0200 X-Host-Lookup-Failed: Reverse DNS lookup failed for 192.168.226.74 (failed) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161570 Archived-At: My use case: I use "magic-mode-alist" to detect a binary file type for which I have written a mode. The magic at the beginning is "mTFf", so it is simple ASCII, but unusually capitalized. When I add this to "magic-mode-alist", files and buffers that start with "mtff" are also put in my binary file mode. It turns out that "set-auto-mode" in lisp/files.el is the function that uses magic-mode-alist, and it just calls "looking-at" to test the type. Because "case-fold-search" is "t" by default, this catches files starting with "mtff". Is this intentional? If so, the documentation for "magic-mode-alist" should call this out, so users know they might need to work around it. If not, I could propose a patch to fix it. TIA, benny -- In GNU Emacs 26.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of 2017-10-18 built on riefenstahl-linux Repository revision: b970a4a52a1c04afce4916ca2bf337e2b36d26c4 Windowing system distributor 'The X.Org Foundation', version 11.0.11604000 System Description: Debian GNU/Linux 8.11 (jessie) Recent messages: Mark set Saving file /home/riefenstahl/.emacs.cfg/local.riefenstahl-linux.el... Wrote /home/riefenstahl/.emacs.cfg/local.riefenstahl-linux.el (No changes need to be saved) Auto-saving...done Saving file /home/riefenstahl/.emacs.cfg/local.riefenstahl-linux.el... Wrote /home/riefenstahl/.emacs.cfg/local.riefenstahl-linux.el (No changes need to be saved) [6 times] Making completion list... Type "q" in help window to restore its previous buffer. Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 LCMS2 Important settings: value of $LANG: C.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: global-magit-file-mode: t magit-file-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t desktop-save-mode: t display-time-mode: t diff-auto-refine-mode: t delete-selection-mode: t shell-dirtrack-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-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: t Load-path shadows: ~/site-lisp/css-mode hides /usr/local/share/emacs/26.0.90/lisp/textmodes/css-mode Features: (shadow sort mail-extr emacsbug sendmail find-dired thingatpt eieio-opt speedbar sb-image ezimage dframe find-func ruler-mode hl-line hexl pp cl-print misearch multi-isearch help-fns arc-mode archive-mode benny-mtff-mode magit-obsolete magit-blame magit-stash magit-bisect magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-collab ghub-graphql ghub url-http tls gnutls url-gw nsm url-auth url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap let-alist json magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log magit-diff smerge-mode magit-core magit-autorevert autorevert filenotify magit-process magit-margin magit-mode git-commit magit-git magit-section magit-utils crm subr-x magit-popup log-edit message-x message rmc puny rfc822 mml mml-sec epa epg gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor cl-extra help-mode async-bytecomp async dash elec-pair dired-aux make-mode time-date map sh-script smie executable desktop frameset highline ange-ftp generic-x cl autoinsert ps-print ps-print-loaddefs ps-def lpr dired dired-loaddefs benny-x-clipboard disp-table mm-util mail-prsvr time server protbuf solar cal-dst cal-islam cal-hebrew holidays hol-loaddefs vc-git diff-mode easy-mmode diary-lib diary-loaddefs cal-menu calendar cal-loaddefs which-func imenu jka-compr grep compile delsel cus-start cus-load generic benny-calendar-cfg derived cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs filecache benny-file-cache tramp-sh docker-tramp tramp-cache tramp tramp-compat tramp-loaddefs trampver ucs-normalize shell pcomplete comint ansi-color ring parse-time format-spec advice benny-unicode benny-tools browse-url autoload radix-tree lisp-mnt finder-inf gh-common marshal eieio-compat rx info package easymenu epg-config url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 418674 115456) (symbols 48 37479 2) (miscs 40 2593 3720) (strings 32 93366 4129) (string-bytes 1 2851917) (vectors 16 66469) (vector-slots 8 1822112 223144) (floats 8 700 564) (intervals 56 6177 3982) (buffers 992 36) (heap 1024 70067 2662))