From: Scott Bell <sctb@me.com>
To: Ken Hori <fplemma@gmail.com>
Cc: 5330@debbugs.gnu.org
Subject: bug#5330: Term mode in Cocoa does not respect NS-ALTERNATE-MODIFIER
Date: Mon, 18 Jan 2010 15:00:17 -0700 [thread overview]
Message-ID: <B8B4015C-1233-4D8D-A4E5-56A83DFD67B9@me.com> (raw)
In-Reply-To: <d0dc7c8f1001181317l797bd580jf7e070a938cd1d75@mail.gmail.com>
On 2010-01-18, at 2:17 PM, Ken Hori wrote:
> Please ignore my last post.
>
> You can instead apply the following patch for a quick fix:
>
> +++ term.el 2010-01-18 09:27:33.085376730 -0800
> @@ -1208,8 +1208,17 @@
>
> (defun term-send-raw-meta ()
> (interactive)
> - (let* ((keys (this-command-keys))
> - (char (aref keys (1- (length keys)))))
> + (let ((char last-input-event))
> + (when (symbolp last-input-event)
> + ;; Convert `return' to C-m, etc.
> + (let ((tmp (get char 'event-symbol-elements)))
> + (when tmp
> + (setq char (car tmp)))
> + (when (symbolp char)
> + (setq tmp (get char 'ascii-character))
> + (when tmp
> + (setq char tmp)))))
> + (setq char (event-basic-type char))
> (term-send-raw-string (if (and (numberp char)
> (> char 127)
> (< char 256))
>
> Or, just replace your term-send-raw-meta with:
>
> (defun term-send-raw-meta ()
> (interactive)
> (let ((char last-input-event))
> (when (symbolp last-input-event)
> ;; Convert `return' to C-m, etc.
> (let ((tmp (get char 'event-symbol-elements)))
> (when tmp
> (setq char (car tmp)))
> (when (symbolp char)
> (setq tmp (get char 'ascii-character))
> (when tmp
> (setq char tmp)))))
> (setq char (event-basic-type char))
> (term-send-raw-string (if (and (numberp char)
> (> char 127)
> (< char 256))
> (make-string 1 char)
> (format "\e%c" char)))))
>
> Let me know if it succeeds or not.
This works, at least in my common use cases (M-d, M-RET, etc.)
- Scott
next prev parent reply other threads:[~2010-01-18 22:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-06 23:35 bug#5330: Term mode in Cocoa does not respect NS-ALTERNATE-MODIFIER Scott Bell
2010-01-17 6:51 ` Ken Hori
2010-01-17 14:09 ` Ken Hori
2010-01-17 14:18 ` Ken Hori
2010-01-17 23:46 ` Scott Bell
2010-01-18 21:17 ` Ken Hori
2010-01-18 22:00 ` Scott Bell [this message]
2010-01-18 22:40 ` bug#5330: M-d broken in term.el [Was: Term mode in Cocoa does not respect NS-ALTERNATE-MODIFIER] Chong Yidong
2010-01-20 17:18 ` bug#5330: Term mode in Cocoa does not respect NS-ALTERNATE-MODIFIER Chong Yidong
2010-01-20 19:04 ` Scott Bell
2011-09-18 11:48 ` bug#5449: " Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B8B4015C-1233-4D8D-A4E5-56A83DFD67B9@me.com \
--to=sctb@me.com \
--cc=5330@debbugs.gnu.org \
--cc=fplemma@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).