unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#22673: 24.5; global set key neg freaks out emacs
@ 2016-02-15  2:10 Thomas Lynch
  2016-02-15  8:44 ` Alexis
  2016-02-15 10:20 ` Andreas Schwab
  0 siblings, 2 replies; 10+ messages in thread
From: Thomas Lynch @ 2016-02-15  2:10 UTC (permalink / raw)
  To: 22673

[-- Attachment #1: Type: text/plain, Size: 4599 bytes --]

Evaluate the following

   (global-set-key (kbd "C-x g neg") "¬")

Now use it, and instead of getting neg, you get the error:

   After 0 kbd macro iterations: user-error: No M-x tags-search or M-x
tags-query-replace in progress








In GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.2)
 of 2015-10-24 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11703000
System Description: Debian GNU/Linux testing (stretch)

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.5/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.5/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-z,relro'

Important settings:
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Shell

Minor modes in effect:
  dirtrack-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
uncompressing utf-7.el.gz...done
Note: file is write protected
End of buffer [3 times]
Mark set
Making completion list...
Quit [2 times]
Making completion list...
Mark set
C-c M-w is undefined
Mark activated

Load-path shadows:
/usr/share/emacs/24.5/site-lisp/debian-startup hides
/usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/latex-cjk-thai/thai-word hides
/usr/share/emacs/24.5/lisp/language/thai-word

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils dired pcmpl-gnu thai-util thai-word jka-compr
iso-transl pcmpl-unix rect mule-util ispell misearch multi-isearch
help-mode vc-git dirtrack shell pcomplete info package epg-config
wheatgrass-theme slime-fancy slime-trace-dialog slime-fontifying-fu
slime-package-fu slime-references slime-compiler-notes-tree
slime-scratch slime-presentations advice bridge slime-mdot-fu
slime-enclosing-context slime-fuzzy slime-fancy-trace
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
eldoc slime-repl elp slime-parse slime byte-opt bytecomp byte-compile
cconv derived cl-extra help-fns gud apropos compile etags arc-mode
archive-mode noutline outline easy-mmode easymenu pp comint ansi-color
ring hyperspec cl-macs thingatpt browse-url cl gv slime-autoloads
edmacro kmacro cl-loaddefs cl-lib time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer 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 make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 538849 23698)
  (symbols 48 36343 0)
  (miscs 40 791 842)
  (strings 32 89094 14725)
  (string-bytes 1 2124898)
  (vectors 16 31542)
  (vector-slots 8 1464374 205774)
  (floats 8 108 762)
  (intervals 56 18016 1613)
  (buffers 960 28)
  (heap 1024 100326 1595))

[-- Attachment #2: Type: text/html, Size: 5877 bytes --]

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

* bug#22673: 24.5; global set key neg freaks out emacs
  2016-02-15  2:10 bug#22673: 24.5; global set key neg freaks out emacs Thomas Lynch
@ 2016-02-15  8:44 ` Alexis
  2016-02-15 10:20 ` Andreas Schwab
  1 sibling, 0 replies; 10+ messages in thread
From: Alexis @ 2016-02-15  8:44 UTC (permalink / raw)
  To: Thomas Lynch; +Cc: 22673


Thomas Lynch <thomas.lynch@reasoningtechnology.com> writes:

> Evaluate the following
>
>    (global-set-key (kbd "C-x g neg") "¬")
>
> Now use it, and instead of getting neg, you get the error:
>
>    After 0 kbd macro iterations: user-error: No M-x tags-search 
>    or M-x 
> tags-query-replace in progress

Are you wanting to use 'C-x g neg' to insert the symbol "¬" into 
the buffer? If so, you'll need to create a command for 
`global-set-key` to call, which does the insertion, e.g.

    (global-set-key (kbd "C-x g neg")
                    (lambda () 
                      (interactive) (insert "¬")))

If this is not what you're after, could you please explain further 
what you're trying to do?


Alexis.





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

* bug#22673: 24.5; global set key neg freaks out emacs
  2016-02-15  2:10 bug#22673: 24.5; global set key neg freaks out emacs Thomas Lynch
  2016-02-15  8:44 ` Alexis
@ 2016-02-15 10:20 ` Andreas Schwab
  2016-02-15 12:42   ` Alexis
  2018-06-06  0:02   ` Noam Postavsky
  1 sibling, 2 replies; 10+ messages in thread
From: Andreas Schwab @ 2016-02-15 10:20 UTC (permalink / raw)
  To: Thomas Lynch; +Cc: 22673

Thomas Lynch <thomas.lynch@reasoningtechnology.com> writes:

> Evaluate the following
>
>    (global-set-key (kbd "C-x g neg") "¬")

This is the same as binding [?\C-x ?g ?n ?e ?g] to [?\M-,].  You should
use the vector notation instead:

(global-set-key (kbd "C-x g neg") [?¬])

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





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

* bug#22673: 24.5; global set key neg freaks out emacs
  2016-02-15 10:20 ` Andreas Schwab
@ 2016-02-15 12:42   ` Alexis
  2016-02-15 13:03     ` Andreas Schwab
  2018-06-06  0:02   ` Noam Postavsky
  1 sibling, 1 reply; 10+ messages in thread
From: Alexis @ 2016-02-15 12:42 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Thomas Lynch, 22673


Andreas Schwab <schwab@suse.de> writes:

> Thomas Lynch <thomas.lynch@reasoningtechnology.com> writes:
>
>> Evaluate the following
>>
>>    (global-set-key (kbd "C-x g neg") "¬")
>
> This is the same as binding [?\C-x ?g ?n ?e ?g] to [?\M-,].  You 
> should use the vector notation instead:
>
> (global-set-key (kbd "C-x g neg") [?¬])

Neat!

The documentation for the `global-set-key` function, at least in 
24.5.3 and in the emacs-25 branch as at d9ea7950, doesn't mention 
this possibility:

    (global-set-key KEY COMMAND) 
 
    Give KEY a global binding as COMMAND.  COMMAND is the command 
    definition to use; usually it is a symbol naming an 
    interactively-callable function.

Perhaps it should be modified to refer to COMMAND-OR-VECTOR?


Alexis.





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

* bug#22673: 24.5; global set key neg freaks out emacs
  2016-02-15 12:42   ` Alexis
@ 2016-02-15 13:03     ` Andreas Schwab
  2016-02-15 13:24       ` Thomas Lynch
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2016-02-15 13:03 UTC (permalink / raw)
  To: Alexis; +Cc: Thomas Lynch, 22673

Alexis <flexibeast@gmail.com> writes:

> The documentation for the `global-set-key` function, at least in 24.5.3
> and in the emacs-25 branch as at d9ea7950, doesn't mention this
> possibility:
>
>    (global-set-key KEY COMMAND) 
>
>    Give KEY a global binding as COMMAND.  COMMAND is the command
> definition to use; usually it is a symbol naming an
> interactively-callable function.
>
> Perhaps it should be modified to refer to COMMAND-OR-VECTOR?

A vector is a kind of command.  It's a keyboard macro.

ELISP> (commandp [?¬])
t

For non-interactive use, define-key is preferred, which has all details.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





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

* bug#22673: 24.5; global set key neg freaks out emacs
  2016-02-15 13:03     ` Andreas Schwab
@ 2016-02-15 13:24       ` Thomas Lynch
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Lynch @ 2016-02-15 13:24 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Alexis, 22673

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

Note that every other character appears to work with this same syntax that
neg doesn't,  take for example:

(global-set-key (kbd "C-x g > =") "≥")

That and every other character in quotes that I have tried, works fine.
Only neg is different.

On Mon, Feb 15, 2016 at 1:03 PM, Andreas Schwab <schwab@suse.de> wrote:

> Alexis <flexibeast@gmail.com> writes:
>
> > The documentation for the `global-set-key` function, at least in 24.5.3
> > and in the emacs-25 branch as at d9ea7950, doesn't mention this
> > possibility:
> >
> >    (global-set-key KEY COMMAND)
> >
> >    Give KEY a global binding as COMMAND.  COMMAND is the command
> > definition to use; usually it is a symbol naming an
> > interactively-callable function.
> >
> > Perhaps it should be modified to refer to COMMAND-OR-VECTOR?
>
> A vector is a kind of command.  It's a keyboard macro.
>
> ELISP> (commandp [?¬])
> t
>
> For non-interactive use, define-key is preferred, which has all details.
>
> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>

[-- Attachment #2: Type: text/html, Size: 1860 bytes --]

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

* bug#22673: 24.5; global set key neg freaks out emacs
  2016-02-15 10:20 ` Andreas Schwab
  2016-02-15 12:42   ` Alexis
@ 2018-06-06  0:02   ` Noam Postavsky
  2018-06-06  7:39     ` Andreas Schwab
  1 sibling, 1 reply; 10+ messages in thread
From: Noam Postavsky @ 2018-06-06  0:02 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Thomas Lynch, 22673

retitle 22673 execute-kbd-macro doesn't handle strings with characters in range (0x80..0xFF) correctly
quit

Andreas Schwab <schwab@suse.de> writes:

> Thomas Lynch <thomas.lynch@reasoningtechnology.com> writes:
>
>> Evaluate the following
>>
>>    (global-set-key (kbd "C-x g neg") "¬")

A more straightforward way is (execute-kbd-macro "¬").  Use

(setq debug-ignored-errors (remq 'user-error debug-ignored-errors)
      debug-on-error t)

to get a backtrace.

> This is the same as binding [?\C-x ?g ?n ?e ?g] to [?\M-,].  You should
> use the vector notation instead:
>
> (global-set-key (kbd "C-x g neg") [?¬])

(execute-kbd-macro [?¬]) works, but shouldn't the string version work
too?  I see that it fails because of this statement in keyboard.c:

      c = Faref (Vexecuting_kbd_macro, make_number (executing_kbd_macro_index));
      if (STRINGP (Vexecuting_kbd_macro)
          && (XFASTINT (c) & 0x80) && (XFASTINT (c) <= 0xff))
        XSETFASTINT (c, CHAR_META | (XFASTINT (c) & ~0x80));

Which transforms ?¬ (aka #xac) into #x800002c == (event-convert-list '(meta ?,))






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

* bug#22673: 24.5; global set key neg freaks out emacs
  2018-06-06  0:02   ` Noam Postavsky
@ 2018-06-06  7:39     ` Andreas Schwab
  2022-01-29 16:59       ` bug#22673: execute-kbd-macro doesn't handle strings with characters in range (0x80..0xFF) correctly Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2018-06-06  7:39 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: Thomas Lynch, 22673

On Jun 05 2018, Noam Postavsky <npostavs@gmail.com> wrote:

> (execute-kbd-macro [?¬]) works, but shouldn't the string version work
> too?  I see that it fails because of this statement in keyboard.c:

Strings as key sequence are legacy and can only contain ASCII and
Meta-ASCII characters.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."





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

* bug#22673: execute-kbd-macro doesn't handle strings with characters in range (0x80..0xFF) correctly
  2018-06-06  7:39     ` Andreas Schwab
@ 2022-01-29 16:59       ` Lars Ingebrigtsen
  2022-01-29 18:01         ` Thomas Walker Lynch via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-29 16:59 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Thomas Lynch, Noam Postavsky, 22673

Andreas Schwab <schwab@suse.de> writes:

>> (execute-kbd-macro [?¬]) works, but shouldn't the string version work
>> too?  I see that it fails because of this statement in keyboard.c:
>
> Strings as key sequence are legacy and can only contain ASCII and
> Meta-ASCII characters.

So I guess there's nothing to fix here, and I'm closing this bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#22673: execute-kbd-macro doesn't handle strings with characters in range (0x80..0xFF) correctly
  2022-01-29 16:59       ` bug#22673: execute-kbd-macro doesn't handle strings with characters in range (0x80..0xFF) correctly Lars Ingebrigtsen
@ 2022-01-29 18:01         ` Thomas Walker Lynch via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Walker Lynch via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-01-29 18:01 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Andreas Schwab, Noam Postavsky, 22673

[-- Attachment #1: Type: text/plain, Size: 697 bytes --]

It has been so long that I only vaguely remember it in the first place.
That is one way to make a bug report moot.  LOL

On Sat, Jan 29, 2022 at 5:59 PM Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Andreas Schwab <schwab@suse.de> writes:
>
> >> (execute-kbd-macro [?¬]) works, but shouldn't the string version work
> >> too?  I see that it fails because of this statement in keyboard.c:
> >
> > Strings as key sequence are legacy and can only contain ASCII and
> > Meta-ASCII characters.
>
> So I guess there's nothing to fix here, and I'm closing this bug report.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>

[-- Attachment #2: Type: text/html, Size: 1266 bytes --]

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

end of thread, other threads:[~2022-01-29 18:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15  2:10 bug#22673: 24.5; global set key neg freaks out emacs Thomas Lynch
2016-02-15  8:44 ` Alexis
2016-02-15 10:20 ` Andreas Schwab
2016-02-15 12:42   ` Alexis
2016-02-15 13:03     ` Andreas Schwab
2016-02-15 13:24       ` Thomas Lynch
2018-06-06  0:02   ` Noam Postavsky
2018-06-06  7:39     ` Andreas Schwab
2022-01-29 16:59       ` bug#22673: execute-kbd-macro doesn't handle strings with characters in range (0x80..0xFF) correctly Lars Ingebrigtsen
2022-01-29 18:01         ` Thomas Walker Lynch via Bug reports for GNU Emacs, the Swiss army knife of text editors

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