bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#3312: 23.0.93; Use punctuation syntax for apostrophe in Info


From: Juri Linkov
Subject: bug#3312: 23.0.93; Use punctuation syntax for apostrophe in Info
Date: Tue, 19 May 2009 03:47:34 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (x86_64-pc-linux-gnu)

>> Apostrophe, or single quote, (') currently has word-constituent syntax
>> in Info, which it inherits from text-mode.
>
>> This means that if point is inside some `...'  string, and you use
>> `C-s C-w', you will pick up also the ' at the end as part of the
>> search string, which is typically not what you want.
>
> Yes, it might be a good idea to change it in Info-mode, which is quite
> different from text-mode because of the extensive use of `...' and the
> fact that it's read-only.

This can be fixed with the following patch (don't know whether now
is the right time to install it):

Index: lisp/info.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/info.el,v
retrieving revision 1.558
diff -u -r1.558 info.el
--- lisp/info.el        14 Jan 2009 23:09:45 -0000      1.558
+++ lisp/info.el        19 May 2009 00:45:36 -0000
@@ -3441,6 +3441,14 @@
 (defvar tool-bar-map)
 (defvar bookmark-make-record-function)
 
+(defvar Info-mode-syntax-table
+  (let ((st (copy-syntax-table text-mode-syntax-table)))
+    ;; Use punctuation syntax for apostrophe because of
+    ;; extensive use of quotes in Info manuals.
+    (modify-syntax-entry ?' "." st)
+    st)
+  "Syntax table used while in `Info-mode'.")
+
 ;; Autoload cookie needed by desktop.el
 ;;;###autoload
 (defun Info-mode ()
@@ -3512,7 +3520,7 @@
   (setq tab-width 8)
   (use-local-map Info-mode-map)
   (add-hook 'activate-menubar-hook 'Info-menu-update nil t)
-  (set-syntax-table text-mode-syntax-table)
+  (set-syntax-table Info-mode-syntax-table)
   (setq local-abbrev-table text-mode-abbrev-table)
   (setq case-fold-search t)
   (setq buffer-read-only t)

-- 
Juri Linkov
http://www.jurta.org/emacs/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]