Subject: bug#12137: closed (Re: bug#12137: 23.4; latex-mode tex-insert-quote not aware of ties in context)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 15 Aug 2012 03:57:02 +0000

Your bug report

#12137: 23.4; latex-mode tex-insert-quote not aware of ties in context

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12137: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12137
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12137: 23.4; latex-mode tex-insert-quote not aware of ties in context
From: Stefan Monnier <[email-masked]>
To: Norman Ramsey <[email-masked]>
Cc: [email-masked]
Date: Tue, 14 Aug 2012 23:48:03 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

>     hello ``my'' dearest~''darling.''

Thanks, I fixed it in Emacs's trunk with the patch below,

        Stefan

=== modified file 'lisp/textmodes/tex-mode.el'
--- lisp/textmodes/tex-mode.el	2012-08-03 02:29:59 +0000
+++ lisp/textmodes/tex-mode.el	2012-08-15 03:45:12 +0000
@@ -1286,7 +1286,8 @@
 	      (delete-char (length tex-open-quote))
 	      t)))
       (self-insert-command (prefix-numeric-value arg))
-    (insert (if (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
+    (insert (if (or (memq (char-syntax (preceding-char)) '(?\( ?> ?\s))
+                    (memq (preceding-char) '(?~)))
 		tex-open-quote tex-close-quote))))
 
 (defun tex-validate-buffer ()

Subject: 23.4; latex-mode tex-insert-quote not aware of ties in context
From: Norman Ramsey <[email-masked]>
To: [email-masked]
Date: Sat, 04 Aug 2012 12:53:49 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

    C-x C-f / t m p / x . t e x <return> h e l l o SPC " m y " SPC d e a
    r e s t ~ " d a r l i n g . " <return> 

The resulting text is

    hello ``my'' dearest~''darling.''

But in TeX, the ~ character is a "tie", and for purposes of electric
quote marks, it should be treated as a space, not as an end-of-word
character, producing the correct text

    hello ``my'' dearest~``darling.''

(Note difference in quotes preceding 'darling'.)

In GNU Emacs 23.4.1 (i486-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2012-04-07 on biber, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10707000
configured using `configure  '--build' 'i486-linux-gnu' '--build' 'i486-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/emacs23:/etc/emacs:/usr/local/share/emacs/23.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.4/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'CFLAGS=-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -DDEBIAN -O2' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: LaTeX

Minor modes in effect:
  shell-dirtrack-mode: t
  flyspell-mode: t
  noweb-minor-mode: t
  tooltip-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-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
<backspace> u t h SPC a n d SPC p l a <backspace> <backspace> 
<backspace> P l a s s SPC g e t SPC a SPC b e t t e 
r SPC r e s u l t SPC t h a n C-o C-a I n SPC t h i 
s SPC e x t e r m <backspace> <backspace> <backspace> 
r e m e SPC c a s e , M-d M-d M-d M-d M-d C-e M-b M-b 
M-b M-b C-e SPC t h e SPC g r e e d y SPC a l g o r 
i t h m : SPC c h o o s i n g SPC n o t SPC t o SPC 
b r e a k SPC b e t w e e n SPC <prior> C-n M-f M-f 
M-f C-k C-y <next> C-p C-e C-y C-b C-b <backspace> 
C-e <return> a l s o SPC i h n <backspace> <backspace> 
<backspace> n <backspace> i n h i b i t s SPC t h e 
SPC b r e a k SPC b e t w e e n SPC " o h ~ a n d <backspace> 
<backspace> <backspace> <backspace> " ~ a n d ` <backspace> 
~ " y e s . " C-b C-b C-b C-b C-b C-b <backspace> <backspace> 
` ` C-e <return> C-p C-p C-e M-b C-d C-d ` ` C-a C-x 
C-s C-n C-n C-o H e r e SPC i t SPC i s SPC C-a C-x 
C-s C-h k " C-n ~ " C-a C-k C-k C-x C-s M-x e m a c 
s - r e <tab> <M-backspace> <M-backspace> r e b o <backspace> 
<backspace> p o <tab> r <backspace> r t - e m <tab> 
<return>

Recent messages:
Error during redisplay: (args-out-of-range 126888 127378)
Mark set
Saving file /home/nr/cs/152/git-repo/textbook/haskell.nw...
Wrote /home/nr/cs/152/git-repo/textbook/haskell.nw
Saving file /home/nr/cs/152/git-repo/textbook/haskell.nw...
Wrote /home/nr/cs/152/git-repo/textbook/haskell.nw
Type C-x 4 C-o RET to restore the other window.
Saving file /home/nr/cs/152/git-repo/textbook/haskell.nw...
Wrote /home/nr/cs/152/git-repo/textbook/haskell.nw
Making completion list...

Load-path shadows:
~nr/emacs/sml-mode hides /usr/share/emacs23/site-lisp/sml-mode/sml-mode
~nr/emacs/sml-proc hides /usr/share/emacs23/site-lisp/sml-mode/sml-proc
/usr/share/emacs/site-lisp/haskell-mode/haskell-indent hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-indentation hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-indentation
/usr/share/emacs/site-lisp/haskell-mode/haskell-c hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-c
/usr/share/emacs/site-lisp/haskell-mode/haskell-hugs hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-hugs
/usr/share/emacs/site-lisp/haskell-mode/haskell-font-lock hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-font-lock
/usr/share/emacs/site-lisp/haskell-mode/haskell-mode hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-mode
/usr/share/emacs/site-lisp/haskell-mode/haskell-doc hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-doc
/usr/share/emacs/site-lisp/haskell-mode/haskell-decl-scan hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-decl-scan
/usr/share/emacs/site-lisp/haskell-mode/haskell-site-file hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-site-file
/usr/share/emacs/site-lisp/haskell-mode/haskell-simple-indent hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-simple-indent
/usr/share/emacs/site-lisp/haskell-mode/haskell-ghci hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-ghci
/usr/share/emacs/site-lisp/haskell-mode/inf-haskell hides /usr/share/emacs/23.4/site-lisp/haskell-mode/inf-haskell
/usr/share/emacs/site-lisp/haskell-mode/haskell-cabal hides /usr/share/emacs/23.4/site-lisp/haskell-mode/haskell-cabal
~nr/emacs/noweb-mode hides /usr/share/emacs/site-lisp/noweb-mode
/usr/share/emacs/23.4/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
~nr/emacs/mwheel hides /usr/share/emacs/23.4/lisp/mwheel
~nr/emacs/longlines hides /usr/share/emacs/23.4/lisp/longlines
/usr/share/emacs23/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/23.4/lisp/textmodes/ispell
/usr/share/emacs23/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/23.4/lisp/textmodes/flyspell

Features:
(shadow sort mail-extr message sendmail ecomplete rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231
rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc
time-date mm-util mail-prsvr gmm-utils mailheader canlock sha1 hex-util
hashcash mail-utils emacsbug help-mode view apache-mode multi-isearch
vc-rcs caml warnings skeleton scheme mule-util sml-menus sml-mode
haskell-cabal conf-mode newcomment python-21 python parse-time cc-mode
cc-fonts cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
icon make-mode sh-script executable vc-cvs cus-edit cus-start cus-load
wid-edit dired tex-mode shell vc-git haskell-font-lock haskell-decl-scan
haskell-doc haskell-indentation haskell-indent haskell-mode byte-opt
bytecomp byte-compile pp vc-hg flyspell ispell darcsum easymenu add-log
rect assoc lua-mode filladapt scroll-in-place noweb derived multi-mode
advice help-fns advice-preload imenu compile comint ring desktop edmacro
kmacro mmm-auto mmm-vars mmm-compat regexp-opt cl cl-19 emacs-goodies-el
emacs-goodies-custom emacs-goodies-loaddefs easy-mmode tooltip
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd font-setting
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mldrag 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 loaddefs button
minibuffer faces cus-face files text-properties overlay md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind system-font-setting
font-render-setting gtk x-toolkit x multi-tty emacs)