GNU bug report logs - #5330
Term mode in Cocoa does not respect NS-ALTERNATE-MODIFIER

Previous Next

Package: emacs;

Reported by: Scott Bell <sctb <at> me.com>

Date: Wed, 6 Jan 2010 23:57:02 UTC

Severity: normal

Tags: fixed

Merged with 5449

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #31 received at 5330 <at> debbugs.gnu.org (full text, mbox):

From: Scott Bell <sctb <at> me.com>
To: Ken Hori <fplemma <at> gmail.com>
Cc: 5330 <at> debbugs.gnu.org
Subject: Re: bug#5330: Term mode in Cocoa does not
	respect	NS-ALTERNATE-MODIFIER
Date: Mon, 18 Jan 2010 15:00:17 -0700
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




This bug report was last modified 13 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.