unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#25517: 25.1.91; print-format specifier mistaken as comment
@ 2017-01-24 10:36 Andreas Röhler
  2017-01-24 13:19 ` npostavs
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2017-01-24 10:36 UTC (permalink / raw)
  To: 25517

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

See also png attached

In GNU Emacs 25.1.91.1 (i686-pc-linux-gnu, GTK+ Version 3.14.5)
  of 2017-01-02 built on sprache
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:    Debian GNU/Linux 8.7 (jessie)

Configured using:
  'configure --with-modules'

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS NOTIFY ACL GNUTLS
LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11
MODULES

Important settings:
   value of $LANG: de_DE.utf8
   value of $XMODIFIERS: @im=ibus
   locale-coding-system: utf-8-unix

Major mode: Inferior Octave

Minor modes in effect:
   compilation-shell-minor-mode: t
   tooltip-mode: t
   global-eldoc-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-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:
Checking 70 files in ~/emacs-25.1.91/lisp/erc...
Checking 34 files in ~/emacs-25.1.91/lisp/emulation...
Checking 167 files in ~/emacs-25.1.91/lisp/emacs-lisp...
Checking 24 files in ~/emacs-25.1.91/lisp/cedet...
Checking 57 files in ~/emacs-25.1.91/lisp/calendar...
Checking 87 files in ~/emacs-25.1.91/lisp/calc...
Checking 120 files in ~/emacs-25.1.91/lisp/obsolete...
Checking for load-path shadows...done
Mark set [2 times]
Auto-saving...done

Load-path shadows:
None found.

Features:
(pp shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils
thingatpt compile skeleton octave smie comint ansi-color ring
vc-filewise vc-rcs cl-extra help-mode cc-mode cc-fonts easymenu cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
cl-loaddefs pcase cl-lib time-date mule-util tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core 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 charscript case-table epa-hook jka-cmpr-hook help
simple abbrev 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 dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 8 191027 19020)
  (symbols 24 41093 0)
  (miscs 20 70 337)
  (strings 16 59215 5423)
  (string-bytes 1 1095204)
  (vectors 8 16689)
  (vector-slots 4 506017 14162)
  (floats 8 177 204)
  (intervals 28 352 163)
  (buffers 520 21)
  (heap 1024 33581 776))


[-- Attachment #2: sprintf.png --]
[-- Type: image/png, Size: 145739 bytes --]

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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 10:36 bug#25517: 25.1.91; print-format specifier mistaken as comment Andreas Röhler
@ 2017-01-24 13:19 ` npostavs
  2017-01-24 15:35   ` Andreas Röhler
  2020-08-24 15:34   ` Lars Ingebrigtsen
  0 siblings, 2 replies; 9+ messages in thread
From: npostavs @ 2017-01-24 13:19 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 25517

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> See also png attached
>

It looks like the problem is that octave-mode-syntax-table sets single
quotes as punctuation even though GNU Octave's manual says single quotes
are string syntax [1].

[1]:
https://www.gnu.org/software/octave/doc/interpreter/String-Objects.html

Does this fix it?

--- i/lisp/progmodes/octave.el
+++ w/lisp/progmodes/octave.el
@@ -165,7 +165,7 @@ octave-mode-syntax-table
     (modify-syntax-entry ?| "."   table)
     (modify-syntax-entry ?! "."   table)
     (modify-syntax-entry ?\\ "."  table)
-    (modify-syntax-entry ?\' "."  table)
+    (modify-syntax-entry ?\' "\""  table)
     (modify-syntax-entry ?\` "."  table)
     (modify-syntax-entry ?. "."   table)
     (modify-syntax-entry ?\" "\"" table)






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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 13:19 ` npostavs
@ 2017-01-24 15:35   ` Andreas Röhler
  2017-01-24 15:41     ` Noam Postavsky
  2020-08-24 15:34   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2017-01-24 15:35 UTC (permalink / raw)
  To: npostavs; +Cc: 25517



On 24.01.2017 14:19, npostavs@users.sourceforge.net wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> See also png attached
>>
> It looks like the problem is that octave-mode-syntax-table sets single
> quotes as punctuation even though GNU Octave's manual says single quotes
> are string syntax [1].
>
> [1]:
> https://www.gnu.org/software/octave/doc/interpreter/String-Objects.html
>
> Does this fix it?
>
> --- i/lisp/progmodes/octave.el
> +++ w/lisp/progmodes/octave.el
> @@ -165,7 +165,7 @@ octave-mode-syntax-table
>       (modify-syntax-entry ?| "."   table)
>       (modify-syntax-entry ?! "."   table)
>       (modify-syntax-entry ?\\ "."  table)
> -    (modify-syntax-entry ?\' "."  table)
> +    (modify-syntax-entry ?\' "\""  table)
>       (modify-syntax-entry ?\` "."  table)
>       (modify-syntax-entry ?. "."   table)
>       (modify-syntax-entry ?\" "\"" table)
>

Thanks. That should be a useful cure in octave-mode.

A resp. fix seems needed in inferior-octave-mode-map.





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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 15:35   ` Andreas Röhler
@ 2017-01-24 15:41     ` Noam Postavsky
  2017-01-24 16:10       ` Andreas Röhler
  0 siblings, 1 reply; 9+ messages in thread
From: Noam Postavsky @ 2017-01-24 15:41 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 25517

On Tue, Jan 24, 2017 at 10:35 AM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
>> @@ -165,7 +165,7 @@ octave-mode-syntax-table
>> -    (modify-syntax-entry ?\' "."  table)
>> +    (modify-syntax-entry ?\' "\""  table)
>
> Thanks. That should be a useful cure in octave-mode.
>
> A resp. fix seems needed in inferior-octave-mode-map.

Huh? What do you think needs changing in inferior-octave-mode-map?
That's a keymap? If you meant inferior-octave-mode-syntax-table, then
it already inherits everything from octave-mode-syntax-table anyway.

(defvar inferior-octave-mode-syntax-table
  (let ((table (make-syntax-table octave-mode-syntax-table)))
    table)
  "Syntax table in use in `inferior-octave-mode' buffers.")





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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 15:41     ` Noam Postavsky
@ 2017-01-24 16:10       ` Andreas Röhler
  2017-01-24 22:49         ` npostavs
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2017-01-24 16:10 UTC (permalink / raw)
  To: Noam Postavsky; +Cc: 25517

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



On 24.01.2017 16:41, Noam Postavsky wrote:
> On Tue, Jan 24, 2017 at 10:35 AM, Andreas Röhler
> <andreas.roehler@easy-emacs.de> wrote:
>>> @@ -165,7 +165,7 @@ octave-mode-syntax-table
>>> -    (modify-syntax-entry ?\' "."  table)
>>> +    (modify-syntax-entry ?\' "\""  table)
>> Thanks. That should be a useful cure in octave-mode.
>>
>> A resp. fix seems needed in inferior-octave-mode-map.
> Huh? What do you think needs changing in inferior-octave-mode-map?
> That's a keymap? If you meant inferior-octave-mode-syntax-table, then
> it already inherits everything from octave-mode-syntax-table anyway.
>
> (defvar inferior-octave-mode-syntax-table
>    (let ((table (make-syntax-table octave-mode-syntax-table)))
>      table)
>    "Syntax table in use in `inferior-octave-mode' buffers.")

Okay, see. However, it's not gone - see attachment.
While correct at octave-mode.



[-- Attachment #2: inferior-octave.png --]
[-- Type: image/png, Size: 95735 bytes --]

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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 16:10       ` Andreas Röhler
@ 2017-01-24 22:49         ` npostavs
  2017-01-25  8:41           ` Andreas Röhler
  0 siblings, 1 reply; 9+ messages in thread
From: npostavs @ 2017-01-24 22:49 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 25517

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> On 24.01.2017 16:41, Noam Postavsky wrote:
>> On Tue, Jan 24, 2017 at 10:35 AM, Andreas Röhler
>> <andreas.roehler@easy-emacs.de> wrote:
>>>> @@ -165,7 +165,7 @@ octave-mode-syntax-table
>>>> -    (modify-syntax-entry ?\' "."  table)
>>>> +    (modify-syntax-entry ?\' "\""  table)
>>> Thanks. That should be a useful cure in octave-mode.
>>>
>>> A resp. fix seems needed in inferior-octave-mode-map.
>> Huh? What do you think needs changing in inferior-octave-mode-map?
>> That's a keymap? If you meant inferior-octave-mode-syntax-table, then
>> it already inherits everything from octave-mode-syntax-table anyway.
>>
>> (defvar inferior-octave-mode-syntax-table
>>    (let ((table (make-syntax-table octave-mode-syntax-table)))
>>      table)
>>    "Syntax table in use in `inferior-octave-mode' buffers.")
>
> Okay, see. However, it's not gone - see attachment.
> While correct at octave-mode.

That's without the change though, right?

I found out why octave-mode-syntax-table misses this setting:
octave-mode uses a syntax-propertize-function to set the correct syntax
for quotes, it looks like that's needed because of the way backslashes
are handled.

It's not so easy to apply octave-syntax-propertize-function to
inferior-octave-mode to due prompts and output being in the buffer too.
Kind of a similar problem as the multiple mode stuff.





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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 22:49         ` npostavs
@ 2017-01-25  8:41           ` Andreas Röhler
  2017-01-25 16:13             ` Noam Postavsky
  0 siblings, 1 reply; 9+ messages in thread
From: Andreas Röhler @ 2017-01-25  8:41 UTC (permalink / raw)
  To: npostavs; +Cc: 25517



On 24.01.2017 23:49, npostavs@users.sourceforge.net wrote:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>
>> On 24.01.2017 16:41, Noam Postavsky wrote:
>>> On Tue, Jan 24, 2017 at 10:35 AM, Andreas Röhler
>>> <andreas.roehler@easy-emacs.de> wrote:
>>>>> @@ -165,7 +165,7 @@ octave-mode-syntax-table
>>>>> -    (modify-syntax-entry ?\' "."  table)
>>>>> +    (modify-syntax-entry ?\' "\""  table)
>>>> Thanks. That should be a useful cure in octave-mode.
>>>>
>>>> A resp. fix seems needed in inferior-octave-mode-map.
>>> Huh? What do you think needs changing in inferior-octave-mode-map?
>>> That's a keymap? If you meant inferior-octave-mode-syntax-table, then
>>> it already inherits everything from octave-mode-syntax-table anyway.
>>>
>>> (defvar inferior-octave-mode-syntax-table
>>>     (let ((table (make-syntax-table octave-mode-syntax-table)))
>>>       table)
>>>     "Syntax table in use in `inferior-octave-mode' buffers.")
>> Okay, see. However, it's not gone - see attachment.
>> While correct at octave-mode.
> That's without the change though, right?

No, changed source according to your fix. Otherwise wouldn't expect it 
correct in plain octave-mode.

>
> I found out why octave-mode-syntax-table misses this setting:
> octave-mode uses a syntax-propertize-function to set the correct syntax
> for quotes, it looks like that's needed because of the way backslashes
> are handled.
>
> It's not so easy to apply octave-syntax-propertize-function to
> inferior-octave-mode to due prompts and output being in the buffer too.
> Kind of a similar problem as the multiple mode stuff.

Isn't there good old syntax-ppss at work, the universal source of bugs?

What about employing (parse-partial-sexp (line-beginning-position) 
(point)) instead?
This would reduce the number of fontify-bugs considerably.
Starting from pos of last prompt should be possible too.





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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-25  8:41           ` Andreas Röhler
@ 2017-01-25 16:13             ` Noam Postavsky
  0 siblings, 0 replies; 9+ messages in thread
From: Noam Postavsky @ 2017-01-25 16:13 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: 25517

On Wed, Jan 25, 2017 at 3:41 AM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
>
>>>
>>> Okay, see. However, it's not gone - see attachment.
>>> While correct at octave-mode.
>>
>> That's without the change though, right?
>
>
> No, changed source according to your fix. Otherwise wouldn't expect it
> correct in plain octave-mode.

It does, in fact, work without the change in plain octave-mode.
Perhaps you forgot to recompile after applying the patch?

>
> Isn't there good old syntax-ppss at work, the universal source of bugs?

I've seen that every time you get on this topic, a long and ultimately
fruitless discussion ensues. Therefore I won't respond to any
suggestions about this.





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

* bug#25517: 25.1.91; print-format specifier mistaken as comment
  2017-01-24 13:19 ` npostavs
  2017-01-24 15:35   ` Andreas Röhler
@ 2020-08-24 15:34   ` Lars Ingebrigtsen
  1 sibling, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-24 15:34 UTC (permalink / raw)
  To: npostavs; +Cc: 25517

npostavs@users.sourceforge.net writes:

> It looks like the problem is that octave-mode-syntax-table sets single
> quotes as punctuation even though GNU Octave's manual says single quotes
> are string syntax [1].

[...]

> -    (modify-syntax-entry ?\' "."  table)
> +    (modify-syntax-entry ?\' "\""  table)

I tried M-x inferior-octave with the test case without and with the
patch, and the patch seems to fix the problem for me, so I've applied it
to Emacs 28.

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





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

end of thread, other threads:[~2020-08-24 15:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-24 10:36 bug#25517: 25.1.91; print-format specifier mistaken as comment Andreas Röhler
2017-01-24 13:19 ` npostavs
2017-01-24 15:35   ` Andreas Röhler
2017-01-24 15:41     ` Noam Postavsky
2017-01-24 16:10       ` Andreas Röhler
2017-01-24 22:49         ` npostavs
2017-01-25  8:41           ` Andreas Röhler
2017-01-25 16:13             ` Noam Postavsky
2020-08-24 15:34   ` Lars Ingebrigtsen

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