unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction
@ 2013-08-02 22:15 Barry OReilly
  2013-08-03  1:23 ` Stefan Monnier
  2021-09-06 10:04 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 6+ messages in thread
From: Barry OReilly @ 2013-08-02 22:15 UTC (permalink / raw)
  To: 15014

In a file with text-mode, try forward-sexp across a double quoted
string: "foo". Unlike in programming modes, point goes before the
closing double quote instead of after.

A consequence of this is that delete-pair on

  "foo"

results in

  fo"

instead of

  foo

as expected.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
 of 2013-06-18 on psd15
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
System Description:	Red Hat Enterprise Linux Client release 5.4 (Tikanga)

Configured using:
 `configure
 --prefix=/redacted/user/boreilly/sw/emacs-install-trunk-20899d085afe62520113b5acbfe3dbba57823dc9
 --with-gif=no'

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=none
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-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 input:
M-x r e p o r t <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort nadvice gnus-util mail-extr emacsbug message format-spec
rfc822 mml easymenu 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 time-date tooltip 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 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 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 dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)





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

* bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction
  2013-08-02 22:15 bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction Barry OReilly
@ 2013-08-03  1:23 ` Stefan Monnier
  2013-08-03 17:01   ` Barry OReilly
  2021-09-06 10:04 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2013-08-03  1:23 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 15014

> In a file with text-mode, try forward-sexp across a double quoted
> string: "foo". Unlike in programming modes, point goes before the
> closing double quote instead of after.

In text-mode, double-quotes are not considered as pair-delimiters, so
the behavior is "the expected one".  E.g. point stops after the second
`o', because the sexp it skipped is the symbol `foo' and the " are
considered as irrelevant punctuation.

So, IIUC you're arguing for marking " as having paired-delimiter syntax,
as is the case in most programming modes.


        Stefan





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

* bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction
  2013-08-03  1:23 ` Stefan Monnier
@ 2013-08-03 17:01   ` Barry OReilly
  2013-08-04 21:17     ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Barry OReilly @ 2013-08-03 17:01 UTC (permalink / raw)
  Cc: 15014

> So, IIUC you're arguing for marking " as having paired-delimiter
> syntax, as is the case in most programming modes.

I'm arguing for behavior that makes sense for the user. This seems
like the way to achieve that.





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

* bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction
  2013-08-03 17:01   ` Barry OReilly
@ 2013-08-04 21:17     ` Stefan Monnier
  2013-08-05 14:15       ` Barry OReilly
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2013-08-04 21:17 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 15014

>> So, IIUC you're arguing for marking " as having paired-delimiter
>> syntax, as is the case in most programming modes.
> I'm arguing for behavior that makes sense for the user.

You mean "to this user" ;-)

> This seems like the way to achieve that.

Indeed.  I do expect that most programmers will use " in text-mode in
ways that behave well when treated as string delimiters, so that might
be a good option in general, but if some text contains a non-matched "
the behavior tends to be pretty annoying, so I'm not sure it's a safe
enough change.


        Stefan





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

* bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction
  2013-08-04 21:17     ` Stefan Monnier
@ 2013-08-05 14:15       ` Barry OReilly
  0 siblings, 0 replies; 6+ messages in thread
From: Barry OReilly @ 2013-08-05 14:15 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 15014

> You mean "to this user"

Oh, I'm the only user who thinks this is wrong behavior for
forward-sexp and delete-pair?

> I do expect that most programmers will use " in text-mode in ways
> that behave well when treated as string delimiters, so that might be
> a good option in general, but if some text contains a non-matched "
> the behavior tends to be pretty annoying, so I'm not sure it's a
> safe enough change.

I'm not arguing here that we font lock double quoted strings (though
I'm not convinced either). Without font locking, I can't think of a
concrete case that yields the "pretty annoying behavior". What do you
have in mind?

I added

  (modify-syntax-entry ?\" "$")

to my configuration and find that forward-sexp and delete-pair seem to
work without confusion, even in the presence of odd double quotes. It
seems forward-sexp just scans forward from point.





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

* bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction
  2013-08-02 22:15 bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction Barry OReilly
  2013-08-03  1:23 ` Stefan Monnier
@ 2021-09-06 10:04 ` Lars Ingebrigtsen
  1 sibling, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-06 10:04 UTC (permalink / raw)
  To: Barry OReilly; +Cc: 15014

Barry OReilly <gundaetiapo@gmail.com> writes:

> In a file with text-mode, try forward-sexp across a double quoted
> string: "foo". Unlike in programming modes, point goes before the
> closing double quote instead of after.
>
> A consequence of this is that delete-pair on
>
>   "foo"
>
> results in
>
>   fo"
>
> instead of
>
>   foo
>
> as expected.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

When I try this in Emacs 28, I get:

delete-pair: Not before matching pair

Which is the expected behaviour, since " isn't paired in text modes.  So
it seems like this has been fixed in the eight years since you reported
it (although not in the way you requested -- but we're not going to make
" a paired delimited in text modes by default, because that'd be pretty
confusing, I think), so I'm closing this bug report.  If there's more to
be worked on here, please respond to the debbugs address and we'll
reopen.

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





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

end of thread, other threads:[~2021-09-06 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-02 22:15 bug#15014: 24.3.50; In text-mode, incorrect forward-sexp causes delete-pair malfunction Barry OReilly
2013-08-03  1:23 ` Stefan Monnier
2013-08-03 17:01   ` Barry OReilly
2013-08-04 21:17     ` Stefan Monnier
2013-08-05 14:15       ` Barry OReilly
2021-09-06 10:04 ` 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).