From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Prevost Newsgroups: gmane.emacs.bugs Subject: bug#4128: 23.1; term/ns-win.el does "too much", assumes wrong run order Date: Tue, 11 Aug 2009 14:02:53 -0400 Message-ID: Reply-To: John Prevost , 4128@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1250046833 17532 80.91.229.12 (12 Aug 2009 03:13:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 03:13:53 +0000 (UTC) To: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Aug 12 05:13:46 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mb4HX-00033O-CL for geb-bug-gnu-emacs@m.gmane.org; Wed, 12 Aug 2009 05:13:43 +0200 Original-Received: from localhost ([127.0.0.1]:52370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb4HV-0003jM-Ei for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Aug 2009 23:13:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Maw3k-0005dC-U3 for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:26:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Maw3h-0005bc-3g for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:26:56 -0400 Original-Received: from [199.232.76.173] (port=48643 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Maw3g-0005bU-Gy for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:26:52 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:39215) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Maw3f-0002ER-EV for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:26:52 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7BIQmbp009388; Tue, 11 Aug 2009 11:26:49 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n7BIA6pQ007649; Tue, 11 Aug 2009 11:10:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: John Prevost Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 11 Aug 2009 18:10:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 4128 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12500137836278 (code B ref -1); Tue, 11 Aug 2009 18:10:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 11 Aug 2009 18:03:03 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n7BI3051006272 for ; Tue, 11 Aug 2009 11:03:02 -0700 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mavga-0006Wp-BI for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:03:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MavgV-0006UD-3W for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:02:59 -0400 Original-Received: from [199.232.76.173] (port=37153 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MavgU-0006U9-V8 for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:02:54 -0400 Original-Received: from telperion.wv.cc.cmu.edu ([128.237.240.133]:53577) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MavgU-0003Xw-GC for bug-gnu-emacs@gnu.org; Tue, 11 Aug 2009 14:02:54 -0400 Original-Received: by TELPERION.WV.CC.CMU.EDU (Postfix, from userid 501) id B5A374B4865; Tue, 11 Aug 2009 14:02:53 -0400 (EDT) User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (darwin) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Tue, 11 Aug 2009 14:26:56 -0400 X-Mailman-Approved-At: Tue, 11 Aug 2009 23:13:18 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:30119 Archived-At: Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list, and to the gnu.emacs.bug news group. Please describe exactly what actions triggered the bug and the precise symptoms of the bug: The term/ns-win.el terminal init file does a lot of questionable things, and more importantly, it seems to assume the wrong run order. Specifically, a lot of the items in the file assume that they're run before the user's startup file is loaded, when in fact this file is run after the user's startup file. (First: "(emacs) Terminal Init" says that the .emacs file can prevent loading of this by setting term-file-prefix to nil. Second: When run in --daemon mode, term init files appear to be loaded once when the first terminal of that type is created.) Specifically problemmatic: 1) ns-win.el contains a number of defvaralias declarations intended to make transition from the old "mac-X" variables to the new "ns-X" variables (e.g. mac-command-modifier -> ns-command-modifier) easier. These defvaraliases run after the user's startup file, which means that they are not in effect when the user sets the old-style "mac-X" variables. 2) ns-win.el contains a number of rather questionable keyboard bindings on the global-map. Some of these are nextstep-specific events (ns-power-off, ns-open-file, etc.). More upsetting is a wholesale slaughter of the super- modifier, with some 44 keybindings set for "compatibility" bindings for that modifier. Extremely troubling is the binding for S-mouse-1 to 'mouse-save-then-kill by default, which may be a standard nextstep behavior, but is definitely not a standard mac behavior. The real problem with these keybindings is that they are set when the term/ns-win.el term init file is loaded, which as I noted above is *after* the user's startup file. That means that in order to replace any bindings in this set (for example, if the user has his own super- bindings, or if he wants to replace S-mouse-1 with something a bit less strange, or even if he wants to replace the default behavior of dropping a file inserting its contents in the current buffer with the older behavior of dropping a file visiting that file), then the user *must* use term-setup-hook to run the appropriate commands after the term is loaded. For reference: $ gzip -dc ns-win.el.gz | grep key | grep global | wc -l 83 $ gzip -dc w32-win.el.gz | grep key | grep global | wc -l 3 $ gzip -dc x-win.el.gz | grep key | grep global | wc -l 1 And specifically: $ gzip -dc w32-win.el.gz | grep key | grep global (global-set-key [drag-n-drop] 'w32-drag-n-drop) (global-set-key [C-drag-n-drop] 'w32-drag-n-drop-other-frame) (global-set-key [language-change] 'ignore) $ gzip -dc x-win.el.gz | grep key | grep global ;; (global-set-key [f10] 'ignore)) whereas the ns-win.el bindings are all rather substantive. 3) Another example of something the term/ns-win.el file really shouldn't be mucking with is: ;; Don't show the frame name; that's redundant with Nextstep. (setq-default mode-line-frame-identification '(" ")) This does nothing to the display of windowed frames, but makes tty frames *fail* to display the frame number once the ns-win.el terminal init has been loaded. A number of these features really need to be moved elsewhere, although I can't say exactly where. Some of them need to be turned off by default (for example, the 44 super-based nextstep compatibility keybindings) or at the very least configurable by use of a variable to select whether they're desired. If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. If you would like to further debug the crash, please read the file /Users/prevost1/Documents/src/emacs-23.1/nextstep/Emacs.app/Contents/Resources/etc/DEBUG for instructions. In GNU Emacs 23.1.1 (i386-apple-darwin9.7.0, NS apple-appkit-949.46) of 2009-08-07 on TELPERION.WV.CC.CMU.EDU Windowing system distributor `Apple', version 10.3.949 configured using `configure '--prefix=/opt/emacs-23.1' '--with-ns'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default-enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: diff-auto-refine-mode: t tooltip-mode: t tool-bar-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t global-auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: y C-x b C-c C-c n C-x C-g C-c C-c y s-x M-x r e p o r Recent messages: Checking new news...done Auto-saving... Sending... Already sent message via mail; resend? (y or n) message-send: No methods specified to send by Auto-saving... Sending... Already sent message via mail; resend? (y or n) Sending via mail... Sending...done kill-region: The mark is not set now, so there is no region