Mercurial > hg > xemacs-beta
annotate src/casefiddle.c @ 5492:e82f5b7010fe
Merge some stuff in man, fix up Makefile
-------------------- ChangeLog entries follow: --------------------
man/ChangeLog addition:
2010-02-19 Ben Wing <ben@xemacs.org>
* widget.texi:
* widget.texi (Top):
* widget.texi (Introduction):
* widget.texi (User Interface):
* widget.texi (Programming Example):
* widget.texi (Setting Up the Buffer):
* widget.texi (Basic Types):
* widget.texi (link):
* widget.texi (url-link):
* widget.texi (info-link):
* widget.texi (push-button):
* widget.texi (editable-field):
* widget.texi (text):
* widget.texi (menu-choice):
* widget.texi (radio-button-choice):
* widget.texi (item):
* widget.texi (choice-item):
* widget.texi (toggle):
* widget.texi (checkbox):
* widget.texi (checklist):
* widget.texi (editable-list):
* widget.texi (group):
* widget.texi (Sexp Types):
* widget.texi (constants):
* widget.texi (generic):
* widget.texi (atoms):
* widget.texi (composite):
* widget.texi (Widget Properties):
* widget.texi (Defining New Widgets):
* widget.texi (Widget Browser):
* widget.texi (Widget Minor Mode):
* widget.texi (Utilities):
* widget.texi (Widget Wishlist):
* widget.texi (Widget Internals):
* widget.texi (GNU Free Documentation License):
* widget.texi (Index):
Sync with FSF 23.1.92.
2010-02-19 Ben Wing <ben@xemacs.org>
* texinfo/fdl.texi: New file.
* texinfo/texinfo.texi:
* texinfo/texinfo.texi (Top):
* texinfo/texinfo.texi (Copying Conditions):
* texinfo/texinfo.texi (Overview):
* texinfo/texinfo.texi (Reporting Bugs):
* texinfo/texinfo.texi (Using Texinfo):
* texinfo/texinfo.texi (Output Formats):
* texinfo/texinfo.texi (Info Files):
* texinfo/texinfo.texi (Printed Books):
* texinfo/texinfo.texi (Formatting Commands):
* texinfo/texinfo.texi (Conventions):
* texinfo/texinfo.texi (Comments):
* texinfo/texinfo.texi (Minimum):
* texinfo/texinfo.texi (Six Parts):
* texinfo/texinfo.texi (Short Sample):
* texinfo/texinfo.texi (History):
* texinfo/texinfo.texi (Texinfo Mode):
* texinfo/texinfo.texi (Texinfo Mode Overview):
* texinfo/texinfo.texi (XEmacs Editing):
* texinfo/texinfo.texi (Inserting):
* texinfo/texinfo.texi (Showing the Structure):
* texinfo/texinfo.texi (Updating Nodes and Menus):
* texinfo/texinfo.texi (Updating Commands):
* texinfo/texinfo.texi (Updating Requirements):
* texinfo/texinfo.texi (Other Updating Commands):
* texinfo/texinfo.texi (Info Formatting):
* texinfo/texinfo.texi (Printing):
* texinfo/texinfo.texi (Texinfo Mode Summary):
* texinfo/texinfo.texi (Beginning a File):
* texinfo/texinfo.texi (Sample Beginning):
* texinfo/texinfo.texi (Texinfo File Header):
* texinfo/texinfo.texi (First Line):
* texinfo/texinfo.texi (Start of Header):
* texinfo/texinfo.texi (setfilename):
* texinfo/texinfo.texi (settitle):
* texinfo/texinfo.texi (End of Header):
* texinfo/texinfo.texi (Document Permissions):
* texinfo/texinfo.texi (copying):
* texinfo/texinfo.texi (insertcopying):
* texinfo/texinfo.texi (Titlepage & Copyright Page):
* texinfo/texinfo.texi (titlepage):
* texinfo/texinfo.texi (titlefont center sp):
* texinfo/texinfo.texi (title subtitle author):
* texinfo/texinfo.texi (Copyright):
* texinfo/texinfo.texi (end titlepage):
* texinfo/texinfo.texi (headings on off):
* texinfo/texinfo.texi (Contents):
* texinfo/texinfo.texi (The Top Node):
* texinfo/texinfo.texi (Top Node Example):
* texinfo/texinfo.texi (Master Menu Parts):
* texinfo/texinfo.texi (Global Document Commands):
* texinfo/texinfo.texi (documentdescription):
* texinfo/texinfo.texi (setchapternewpage):
* texinfo/texinfo.texi (paragraphindent):
* texinfo/texinfo.texi (firstparagraphindent):
* texinfo/texinfo.texi (exampleindent):
* texinfo/texinfo.texi (Software Copying Permissions):
* texinfo/texinfo.texi (Ending a File):
* texinfo/texinfo.texi (Printing Indices & Menus):
* texinfo/texinfo.texi (File End):
* texinfo/texinfo.texi (Structuring):
* texinfo/texinfo.texi (Tree Structuring):
* texinfo/texinfo.texi (Structuring Command Types):
* texinfo/texinfo.texi (makeinfo top):
* texinfo/texinfo.texi (chapter):
* texinfo/texinfo.texi (unnumbered & appendix):
* texinfo/texinfo.texi (majorheading & chapheading):
* texinfo/texinfo.texi (section):
* texinfo/texinfo.texi (unnumberedsec appendixsec heading):
* texinfo/texinfo.texi (subsection):
* texinfo/texinfo.texi (unnumberedsubsec appendixsubsec subheading):
* texinfo/texinfo.texi (subsubsection):
* texinfo/texinfo.texi (Raise/lower sections):
* texinfo/texinfo.texi (Nodes):
* texinfo/texinfo.texi (Two Paths):
* texinfo/texinfo.texi (Node Menu Illustration):
* texinfo/texinfo.texi (node):
* texinfo/texinfo.texi (Node Names):
* texinfo/texinfo.texi (Writing a Node):
* texinfo/texinfo.texi (Node Line Tips):
* texinfo/texinfo.texi (Node Line Requirements):
* texinfo/texinfo.texi (First Node):
* texinfo/texinfo.texi (makeinfo top command):
* texinfo/texinfo.texi (makeinfo Pointer Creation):
* texinfo/texinfo.texi (anchor):
* texinfo/texinfo.texi (Menus):
* texinfo/texinfo.texi (Menu Location):
* texinfo/texinfo.texi (Writing a Menu):
* texinfo/texinfo.texi (Menu Parts):
* texinfo/texinfo.texi (Less Cluttered Menu Entry):
* texinfo/texinfo.texi (Menu Example):
* texinfo/texinfo.texi (Other Info Files):
* texinfo/texinfo.texi (Cross References):
* texinfo/texinfo.texi (References):
* texinfo/texinfo.texi (Cross Reference Commands):
* texinfo/texinfo.texi (Cross Reference Parts):
* texinfo/texinfo.texi (xref):
* texinfo/texinfo.texi (Reference Syntax):
* texinfo/texinfo.texi (One Argument):
* texinfo/texinfo.texi (Two Arguments):
* texinfo/texinfo.texi (Three Arguments):
* texinfo/texinfo.texi (Four and Five Arguments):
* texinfo/texinfo.texi (Top Node Naming):
* texinfo/texinfo.texi (ref):
* texinfo/texinfo.texi (pxref):
* texinfo/texinfo.texi (inforef):
* texinfo/texinfo.texi (uref):
* texinfo/texinfo.texi (cite):
* texinfo/texinfo.texi (Marking Text):
* texinfo/texinfo.texi (Indicating):
* texinfo/texinfo.texi (Useful Highlighting):
* texinfo/texinfo.texi (code):
* texinfo/texinfo.texi (kbd):
* texinfo/texinfo.texi (key):
* texinfo/texinfo.texi (samp):
* texinfo/texinfo.texi (verb):
* texinfo/texinfo.texi (var):
* texinfo/texinfo.texi (env):
* texinfo/texinfo.texi (file):
* texinfo/texinfo.texi (command):
* texinfo/texinfo.texi (option):
* texinfo/texinfo.texi (dfn):
* texinfo/texinfo.texi (abbr):
* texinfo/texinfo.texi (acronym):
* texinfo/texinfo.texi (indicateurl):
* texinfo/texinfo.texi (email):
* texinfo/texinfo.texi (Emphasis):
* texinfo/texinfo.texi (emph & strong):
* texinfo/texinfo.texi (Smallcaps):
* texinfo/texinfo.texi (Fonts):
* texinfo/texinfo.texi (Quotations and Examples):
* texinfo/texinfo.texi (Block Enclosing Commands):
* texinfo/texinfo.texi (quotation):
* texinfo/texinfo.texi (example):
* texinfo/texinfo.texi (verbatim):
* texinfo/texinfo.texi (verbatiminclude):
* texinfo/texinfo.texi (lisp):
* texinfo/texinfo.texi (small):
* texinfo/texinfo.texi (display):
* texinfo/texinfo.texi (format):
* texinfo/texinfo.texi (exdent):
* texinfo/texinfo.texi (flushleft & flushright):
* texinfo/texinfo.texi (noindent):
* texinfo/texinfo.texi (indent):
* texinfo/texinfo.texi (cartouche):
* texinfo/texinfo.texi (Lists and Tables):
* texinfo/texinfo.texi (Introducing Lists):
* texinfo/texinfo.texi (itemize):
* texinfo/texinfo.texi (enumerate):
* texinfo/texinfo.texi (Two-column Tables):
* texinfo/texinfo.texi (table):
* texinfo/texinfo.texi (ftable vtable):
* texinfo/texinfo.texi (itemx):
* texinfo/texinfo.texi (Multi-column Tables):
* texinfo/texinfo.texi (Multitable Column Widths):
* texinfo/texinfo.texi (Multitable Rows):
* texinfo/texinfo.texi (Special Displays):
* texinfo/texinfo.texi (Floats):
* texinfo/texinfo.texi (float):
* texinfo/texinfo.texi (caption shortcaption):
* texinfo/texinfo.texi (listoffloats):
* texinfo/texinfo.texi (Images):
* texinfo/texinfo.texi (Image Syntax):
* texinfo/texinfo.texi (Image Scaling):
* texinfo/texinfo.texi (Footnotes):
* texinfo/texinfo.texi (Footnote Commands):
* texinfo/texinfo.texi (Footnote Styles):
* texinfo/texinfo.texi (Indices):
* texinfo/texinfo.texi (Index Entries):
* texinfo/texinfo.texi (Predefined Indices):
* texinfo/texinfo.texi (Indexing Commands):
* texinfo/texinfo.texi (Combining Indices):
* texinfo/texinfo.texi (syncodeindex):
* texinfo/texinfo.texi (synindex):
* texinfo/texinfo.texi (New Indices):
* texinfo/texinfo.texi (Insertions):
* texinfo/texinfo.texi (Atsign Braces Comma):
* texinfo/texinfo.texi (Inserting an Atsign):
* texinfo/texinfo.texi (Inserting Braces):
* texinfo/texinfo.texi (Inserting a Comma):
* texinfo/texinfo.texi (Inserting Quote Characters):
* texinfo/texinfo.texi (Inserting Space):
* texinfo/texinfo.texi (Not Ending a Sentence):
* texinfo/texinfo.texi (Ending a Sentence):
* texinfo/texinfo.texi (Multiple Spaces):
* texinfo/texinfo.texi (frenchspacing):
* texinfo/texinfo.texi (dmn):
* texinfo/texinfo.texi (Inserting Accents):
* texinfo/texinfo.texi (Inserting Quotation Marks):
* texinfo/texinfo.texi (Dots Bullets):
* texinfo/texinfo.texi (dots):
* texinfo/texinfo.texi (bullet):
* texinfo/texinfo.texi (TeX and copyright):
* texinfo/texinfo.texi (tex):
* texinfo/texinfo.texi (copyright symbol):
* texinfo/texinfo.texi (registered symbol):
* texinfo/texinfo.texi (euro):
* texinfo/texinfo.texi (pounds):
* texinfo/texinfo.texi (textdegree):
* texinfo/texinfo.texi (minus):
* texinfo/texinfo.texi (geq leq):
* texinfo/texinfo.texi (math):
* texinfo/texinfo.texi (Click Sequences):
* texinfo/texinfo.texi (Glyphs):
* texinfo/texinfo.texi (Glyphs Summary):
* texinfo/texinfo.texi (result):
* texinfo/texinfo.texi (expansion):
* texinfo/texinfo.texi (Print Glyph):
* texinfo/texinfo.texi (Error Glyph):
* texinfo/texinfo.texi (Equivalence):
* texinfo/texinfo.texi (Point Glyph):
* texinfo/texinfo.texi (Breaks):
* texinfo/texinfo.texi (Break Commands):
* texinfo/texinfo.texi (Line Breaks):
* texinfo/texinfo.texi (- and hyphenation):
* texinfo/texinfo.texi (allowcodebreaks):
* texinfo/texinfo.texi (w):
* texinfo/texinfo.texi (tie):
* texinfo/texinfo.texi (sp):
* texinfo/texinfo.texi (page):
* texinfo/texinfo.texi (group):
* texinfo/texinfo.texi (need):
* texinfo/texinfo.texi (Definition Commands):
* texinfo/texinfo.texi (Def Cmd Template):
* texinfo/texinfo.texi (Def Cmd Continuation Lines):
* texinfo/texinfo.texi (Optional Arguments):
* texinfo/texinfo.texi (deffnx):
* texinfo/texinfo.texi (Def Cmds in Detail):
* texinfo/texinfo.texi (Functions Commands):
* texinfo/texinfo.texi (Variables Commands):
* texinfo/texinfo.texi (Typed Functions):
* texinfo/texinfo.texi (Typed Variables):
* texinfo/texinfo.texi (Data Types):
* texinfo/texinfo.texi (Abstract Objects):
* texinfo/texinfo.texi (Object-Oriented Variables):
* texinfo/texinfo.texi (Object-Oriented Methods):
* texinfo/texinfo.texi (Defining Macros):
* texinfo/texinfo.texi (Invoking Macros):
* texinfo/texinfo.texi (Macro Details):
* texinfo/texinfo.texi (alias):
* texinfo/texinfo.texi (definfoenclose):
* texinfo/texinfo.texi (Hardcopy):
* texinfo/texinfo.texi (Use TeX):
* texinfo/texinfo.texi (Format with tex/texindex):
* texinfo/texinfo.texi (Format with texi2dvi):
* texinfo/texinfo.texi (Print with lpr):
* texinfo/texinfo.texi (Within XEmacs):
* texinfo/texinfo.texi (Texinfo Mode Printing):
* texinfo/texinfo.texi (Compile-Command):
* texinfo/texinfo.texi (Requirements Summary):
* texinfo/texinfo.texi (Preparing for TeX):
* texinfo/texinfo.texi (Overfull hboxes):
* texinfo/texinfo.texi (smallbook):
* texinfo/texinfo.texi (A4 Paper):
* texinfo/texinfo.texi (pagesizes):
* texinfo/texinfo.texi (Cropmarks and Magnification):
* texinfo/texinfo.texi (PDF Output):
* texinfo/texinfo.texi (Obtaining TeX):
* texinfo/texinfo.texi (Creating and Installing Info Files):
* texinfo/texinfo.texi (Creating an Info File):
* texinfo/texinfo.texi (makeinfo advantages):
* texinfo/texinfo.texi (Invoking makeinfo):
* texinfo/texinfo.texi (makeinfo options):
* texinfo/texinfo.texi (Pointer Validation):
* texinfo/texinfo.texi (makeinfo in XEmacs):
* texinfo/texinfo.texi (texinfo-format commands):
* texinfo/texinfo.texi (Batch Formatting):
* texinfo/texinfo.texi (Tag and Split Files):
* texinfo/texinfo.texi (Installing an Info File):
* texinfo/texinfo.texi (Directory File):
* texinfo/texinfo.texi (New Info File):
* texinfo/texinfo.texi (Other Info Directories):
* texinfo/texinfo.texi (Installing Dir Entries):
* texinfo/texinfo.texi (Invoking install-info):
* texinfo/texinfo.texi (Generating HTML):
* texinfo/texinfo.texi (HTML Translation):
* texinfo/texinfo.texi (HTML Splitting):
* texinfo/texinfo.texi (HTML CSS):
* texinfo/texinfo.texi (HTML Xref):
* texinfo/texinfo.texi (HTML Xref Link Basics):
* texinfo/texinfo.texi (HTML Xref Node Name Expansion):
* texinfo/texinfo.texi (HTML Xref Command Expansion):
* texinfo/texinfo.texi (HTML Xref 8-bit Character Expansion):
* texinfo/texinfo.texi (HTML Xref Mismatch):
* texinfo/texinfo.texi (Command List):
* texinfo/texinfo.texi (Command Syntax):
* texinfo/texinfo.texi (Tips):
* texinfo/texinfo.texi (Sample Texinfo Files):
* texinfo/texinfo.texi (Short Sample Texinfo File):
* texinfo/texinfo.texi (GNU Sample Texts):
* texinfo/texinfo.texi (Invoking sample):
* texinfo/texinfo.texi (GNU Free Documentation License):
* texinfo/texinfo.texi (Index):
* texinfo/texinfo.texi (Verbatim Copying License):
* texinfo/texinfo.texi (All-permissive Copying License):
* texinfo/texinfo.texi (Include Files):
* texinfo/texinfo.texi (Using Include Files):
* texinfo/texinfo.texi (texinfo-multiple-files-update):
* texinfo/texinfo.texi (Include Files Requirements):
* texinfo/texinfo.texi (Sample Include File):
* texinfo/texinfo.texi (Include Files Evolution):
* texinfo/texinfo.texi (Headings):
* texinfo/texinfo.texi (Headings Introduced):
* texinfo/texinfo.texi (Heading Format):
* texinfo/texinfo.texi (Heading Choice):
* texinfo/texinfo.texi (Custom Headings):
* texinfo/texinfo.texi (Catching Mistakes):
* texinfo/texinfo.texi (makeinfo Preferred):
* texinfo/texinfo.texi (Debugging with Info):
* texinfo/texinfo.texi (Debugging with TeX):
* texinfo/texinfo.texi (Using texinfo-show-structure):
* texinfo/texinfo.texi (Using occur):
* texinfo/texinfo.texi (Running Info-Validate):
* texinfo/texinfo.texi (Using Info-validate):
* texinfo/texinfo.texi (Unsplit):
* texinfo/texinfo.texi (Tagifying):
* texinfo/texinfo.texi (Splitting):
* texinfo/texinfo.texi (Refilling Paragraphs):
* texinfo/texinfo.texi (Command and Variable Index):
* texinfo/texinfo.texi (General Index):
* texinfo/version.texi: New file.
Sync with FSF 23.1.92. Make new directory to hold the files needed
to generate texinfo.info, since there are three such files now.
2010-02-19 Ben Wing <ben@xemacs.org>
* Makefile:
* Makefile (src_files1):
* Makefile (DIR):
* Makefile (texinfo-srcs):
* Makefile ($(INFODIR)/widget.info):
* Makefile ($(INFODIR)/texinfo.info):
* Makefile (.PHONY):
* Makefile (texinfo.dvi):
* Makefile (texinfo.pdf):
* Makefile ($(HTMLDIR)/widget.html):
* Makefile ($(HTMLDIR)/texinfo.html):
Incorporate texinfo.texi moving to a subdirectory texinfo/.
Do some tricks to reduce the amount of duplication while still
maintaining compatible with non-GNU make (at least, with
Solaris make).
* doclicense.texi: New file.
* info.texi:
* info.texi (Top):
* info.texi (Getting Started):
* info.texi (Help-Small-Screen):
* info.texi (Help):
* info.texi (Help-P):
* info.texi (Help-^L):
* info.texi (Help-Inv):
* info.texi (Help-]):
* info.texi (Help-M):
* info.texi (Help-FOO):
* info.texi (Help-Xref):
* info.texi (Help-Int):
* info.texi (Help-Q):
* info.texi (Advanced):
* info.texi (Search Text):
* info.texi (Search Index):
* info.texi (Go to node):
* info.texi (Choose menu subtopic):
* info.texi (Create Info buffer):
* info.texi (XEmacs Info Variables):
* info.texi (Expert Info):
* info.texi (Add):
* info.texi (Menus):
* info.texi (Cross-refs):
* info.texi (Help-Cross):
* info.texi (Tags):
* info.texi (Checking):
* info.texi (Index):
* texinfo.tex:
* texinfo.tex (paragraphindent{%):
* texinfo.tex (sectionheading will have):
* texinfo.tex (chapterzzz{#3}%):
* texinfo.tex (subsubsection = \numberedsubsubsec):
* texinfo.tex (subsubsection = \appendixsubsubsec):
* texinfo.tex (subsubsection = \unnumberedsubsubsec):
* texinfo.tex (sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%):
* texinfo.tex (sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%):
* texinfo.tex (sectionheading{#1}{subsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynumbered}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yappendix}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Ynothing}%):
* texinfo.tex (sectionheading{#1}{subsubsec}{Yomitfromtoc}{}):
* texinfo.tex (sectionheading to do the printing.):
* texinfo.tex (sectionlevel}{#1}{#4}%):
* texinfo.tex (sectionheading, q.v.):
Sync with FSF 23.1.92.
| author | Ben Wing <ben@xemacs.org> |
|---|---|
| date | Fri, 19 Feb 2010 22:39:19 -0600 |
| parents | 6bc1f3f6cf0d |
| children | 308d34e9f07d |
| rev | line source |
|---|---|
| 428 | 1 /* XEmacs case conversion functions. |
| 2 Copyright (C) 1985, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc. | |
| 826 | 3 Copyright (C) 2002 Ben Wing. |
| 428 | 4 |
| 5 This file is part of XEmacs. | |
| 6 | |
| 7 XEmacs is free software; you can redistribute it and/or modify it | |
| 8 under the terms of the GNU General Public License as published by the | |
| 9 Free Software Foundation; either version 2, or (at your option) any | |
| 10 later version. | |
| 11 | |
| 12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
| 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 15 for more details. | |
| 16 | |
| 17 You should have received a copy of the GNU General Public License | |
| 18 along with XEmacs; see the file COPYING. If not, write to | |
| 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
| 20 Boston, MA 02111-1307, USA. */ | |
| 21 | |
| 22 /* Synched up with: FSF 19.34, but substantially rewritten by Martin. */ | |
| 23 | |
| 24 #include <config.h> | |
| 25 #include "lisp.h" | |
| 26 | |
| 27 #include "buffer.h" | |
| 28 #include "insdel.h" | |
| 29 #include "syntax.h" | |
| 30 | |
|
4910
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
31 enum case_action {CASE_UP, CASE_DOWN, CASE_CAPITALIZE, CASE_CAPITALIZE_UP, |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
32 CASE_CANONICALIZE}; |
| 428 | 33 |
| 34 static Lisp_Object | |
| 444 | 35 casify_object (enum case_action flag, Lisp_Object string_or_char, |
| 36 Lisp_Object buffer) | |
| 428 | 37 { |
| 38 struct buffer *buf = decode_buffer (buffer, 0); | |
| 39 | |
| 40 retry: | |
| 41 | |
| 444 | 42 if (CHAR_OR_CHAR_INTP (string_or_char)) |
| 428 | 43 { |
| 867 | 44 Ichar c; |
| 444 | 45 CHECK_CHAR_COERCE_INT (string_or_char); |
| 46 c = XCHAR (string_or_char); | |
|
4910
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
47 if (flag == CASE_DOWN) |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
48 { |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
49 c = DOWNCASE (buf, c); |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
50 } |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
51 else if (flag == CASE_UP) |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
52 { |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
53 c = UPCASE (buf, c); |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
54 } |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
55 else |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
56 { |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
57 c = CANONCASE (buf, c); |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
58 } |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
59 |
| 428 | 60 return make_char (c); |
| 61 } | |
| 62 | |
| 444 | 63 if (STRINGP (string_or_char)) |
| 428 | 64 { |
| 826 | 65 Lisp_Object syntax_table = buf->mirror_syntax_table; |
| 867 | 66 Ibyte *storage = |
| 2367 | 67 alloca_ibytes (XSTRING_LENGTH (string_or_char) * MAX_ICHAR_LEN); |
| 867 | 68 Ibyte *newp = storage; |
| 69 Ibyte *oldp = XSTRING_DATA (string_or_char); | |
| 70 Ibyte *endp = oldp + XSTRING_LENGTH (string_or_char); | |
| 428 | 71 int wordp = 0, wordp_prev; |
| 72 | |
| 771 | 73 while (oldp < endp) |
| 428 | 74 { |
| 867 | 75 Ichar c = itext_ichar (oldp); |
| 428 | 76 switch (flag) |
| 77 { | |
| 78 case CASE_UP: | |
| 79 c = UPCASE (buf, c); | |
| 80 break; | |
| 81 case CASE_DOWN: | |
| 82 c = DOWNCASE (buf, c); | |
| 83 break; | |
|
4910
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
84 case CASE_CANONICALIZE: |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
85 c = CANONCASE (buf, c); |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
86 break; |
| 428 | 87 case CASE_CAPITALIZE: |
| 88 case CASE_CAPITALIZE_UP: | |
| 89 wordp_prev = wordp; | |
| 90 wordp = WORD_SYNTAX_P (syntax_table, c); | |
| 91 if (!wordp) break; | |
| 92 if (wordp_prev) | |
| 93 { | |
| 94 if (flag == CASE_CAPITALIZE) | |
| 95 c = DOWNCASE (buf, c); | |
| 96 } | |
| 97 else | |
| 98 c = UPCASE (buf, c); | |
| 99 break; | |
| 100 } | |
| 101 | |
| 867 | 102 newp += set_itext_ichar (newp, c); |
| 103 INC_IBYTEPTR (oldp); | |
| 428 | 104 } |
| 105 | |
| 106 return make_string (storage, newp - storage); | |
| 107 } | |
| 108 | |
| 444 | 109 string_or_char = wrong_type_argument (Qchar_or_string_p, string_or_char); |
| 428 | 110 goto retry; |
| 111 } | |
| 112 | |
| 113 DEFUN ("upcase", Fupcase, 1, 2, 0, /* | |
| 444 | 114 Convert STRING-OR-CHAR to upper case and return that. |
| 115 STRING-OR-CHAR may be a character or string. The result has the same type. | |
| 116 STRING-OR-CHAR is not altered--the value is a copy. | |
| 428 | 117 See also `capitalize', `downcase' and `upcase-initials'. |
| 118 Optional second arg BUFFER specifies which buffer's case tables to use, | |
| 119 and defaults to the current buffer. | |
| 120 */ | |
| 444 | 121 (string_or_char, buffer)) |
| 428 | 122 { |
| 444 | 123 return casify_object (CASE_UP, string_or_char, buffer); |
| 428 | 124 } |
| 125 | |
| 126 DEFUN ("downcase", Fdowncase, 1, 2, 0, /* | |
| 444 | 127 Convert STRING-OR-CHAR to lower case and return that. |
| 128 STRING-OR-CHAR may be a character or string. The result has the same type. | |
| 129 STRING-OR-CHAR is not altered--the value is a copy. | |
| 428 | 130 Optional second arg BUFFER specifies which buffer's case tables to use, |
| 131 and defaults to the current buffer. | |
| 132 */ | |
| 444 | 133 (string_or_char, buffer)) |
| 428 | 134 { |
| 444 | 135 return casify_object (CASE_DOWN, string_or_char, buffer); |
| 428 | 136 } |
| 137 | |
|
4910
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
138 DEFUN ("canoncase", Fcanoncase, 1, 2, 0, /* |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
139 Convert STRING-OR-CHAR to its canonical lowercase form and return that. |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
140 |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
141 STRING-OR-CHAR may be a character or string. The result has the same type. |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
142 STRING-OR-CHAR is not altered--the value is a copy. |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
143 |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
144 Optional second arg BUFFER specifies which buffer's case tables to use, |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
145 and defaults to the current buffer. |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
146 |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
147 For any N characters that are equivalent in case-insensitive searching, |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
148 their canonical lowercase character will be the same. |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
149 */ |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
150 (string_or_char, buffer)) |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
151 { |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
152 return casify_object (CASE_CANONICALIZE, string_or_char, buffer); |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
153 } |
|
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
154 |
| 428 | 155 DEFUN ("capitalize", Fcapitalize, 1, 2, 0, /* |
| 444 | 156 Convert STRING-OR-CHAR to capitalized form and return that. |
| 428 | 157 This means that each word's first character is upper case |
| 158 and the rest is lower case. | |
| 444 | 159 STRING-OR-CHAR may be a character or string. The result has the same type. |
| 160 STRING-OR-CHAR is not altered--the value is a copy. | |
| 428 | 161 Optional second arg BUFFER specifies which buffer's case tables to use, |
| 162 and defaults to the current buffer. | |
| 163 */ | |
| 444 | 164 (string_or_char, buffer)) |
| 428 | 165 { |
| 444 | 166 return casify_object (CASE_CAPITALIZE, string_or_char, buffer); |
| 428 | 167 } |
| 168 | |
| 169 /* Like Fcapitalize but change only the initial characters. */ | |
| 170 | |
| 171 DEFUN ("upcase-initials", Fupcase_initials, 1, 2, 0, /* | |
| 444 | 172 Convert the initial of each word in STRING-OR-CHAR to upper case. |
| 428 | 173 Do not change the other letters of each word. |
| 444 | 174 STRING-OR-CHAR may be a character or string. The result has the same type. |
| 175 STRING-OR-CHAR is not altered--the value is a copy. | |
| 428 | 176 Optional second arg BUFFER specifies which buffer's case tables to use, |
| 177 and defaults to the current buffer. | |
| 178 */ | |
| 444 | 179 (string_or_char, buffer)) |
| 428 | 180 { |
| 444 | 181 return casify_object (CASE_CAPITALIZE_UP, string_or_char, buffer); |
| 428 | 182 } |
| 183 | |
| 184 /* flag is CASE_UP, CASE_DOWN or CASE_CAPITALIZE or CASE_CAPITALIZE_UP. | |
| 444 | 185 START and END specify range of buffer to operate on. */ |
| 428 | 186 |
| 187 static void | |
| 444 | 188 casify_region_internal (enum case_action flag, Lisp_Object start, |
| 189 Lisp_Object end, struct buffer *buf) | |
| 428 | 190 { |
| 191 /* This function can GC */ | |
| 665 | 192 Charbpos pos, s, e; |
| 826 | 193 Lisp_Object syntax_table = buf->mirror_syntax_table; |
| 428 | 194 int mccount; |
| 195 int wordp = 0, wordp_prev; | |
| 196 | |
| 444 | 197 if (EQ (start, end)) |
| 428 | 198 /* Not modifying because nothing marked */ |
| 199 return; | |
| 200 | |
| 444 | 201 get_buffer_range_char (buf, start, end, &s, &e, 0); |
| 202 | |
| 203 mccount = begin_multiple_change (buf, s, e); | |
| 204 record_change (buf, s, e - s); | |
| 428 | 205 |
| 444 | 206 for (pos = s; pos < e; pos++) |
| 428 | 207 { |
| 867 | 208 Ichar oldc = BUF_FETCH_CHAR (buf, pos); |
| 209 Ichar c = oldc; | |
| 428 | 210 |
| 211 switch (flag) | |
| 212 { | |
| 213 case CASE_UP: | |
| 214 c = UPCASE (buf, oldc); | |
| 215 break; | |
| 216 case CASE_DOWN: | |
| 217 c = DOWNCASE (buf, oldc); | |
| 218 break; | |
| 219 case CASE_CAPITALIZE: | |
| 220 case CASE_CAPITALIZE_UP: | |
| 221 /* !!#### need to revalidate the start and end pointers in case | |
| 222 the buffer was changed */ | |
| 223 wordp_prev = wordp; | |
| 224 wordp = WORD_SYNTAX_P (syntax_table, c); | |
| 225 if (!wordp) continue; | |
| 226 if (wordp_prev) | |
| 227 { | |
| 228 if (flag == CASE_CAPITALIZE) | |
| 229 c = DOWNCASE (buf, c); | |
| 230 } | |
| 231 else | |
| 232 c = UPCASE (buf, c); | |
| 233 break; | |
| 234 } | |
| 235 | |
| 236 if (oldc == c) continue; | |
| 444 | 237 buffer_replace_char (buf, pos, c, 1, (pos == s)); |
| 428 | 238 BUF_MODIFF (buf)++; |
| 239 } | |
| 240 | |
| 241 end_multiple_change (buf, mccount); | |
| 242 } | |
| 243 | |
| 244 static Lisp_Object | |
| 444 | 245 casify_region (enum case_action flag, Lisp_Object start, Lisp_Object end, |
| 428 | 246 Lisp_Object buffer) |
| 247 { | |
| 444 | 248 casify_region_internal (flag, start, end, decode_buffer (buffer, 1)); |
| 428 | 249 return Qnil; |
| 250 } | |
| 251 | |
| 252 DEFUN ("upcase-region", Fupcase_region, 2, 3, "r", /* | |
| 253 Convert the region to upper case. In programs, wants two arguments. | |
| 254 These arguments specify the starting and ending character numbers of | |
| 255 the region to operate on. When used as a command, the text between | |
| 256 point and the mark is operated on. | |
| 257 See also `capitalize-region'. | |
| 258 Optional third arg BUFFER defaults to the current buffer. | |
| 259 */ | |
| 444 | 260 (start, end, buffer)) |
| 428 | 261 { |
| 262 /* This function can GC */ | |
| 444 | 263 return casify_region (CASE_UP, start, end, buffer); |
| 428 | 264 } |
| 265 | |
| 266 DEFUN ("downcase-region", Fdowncase_region, 2, 3, "r", /* | |
| 267 Convert the region to lower case. In programs, wants two arguments. | |
| 268 These arguments specify the starting and ending character numbers of | |
| 269 the region to operate on. When used as a command, the text between | |
| 270 point and the mark is operated on. | |
| 271 Optional third arg BUFFER defaults to the current buffer. | |
| 272 */ | |
| 444 | 273 (start, end, buffer)) |
| 428 | 274 { |
| 275 /* This function can GC */ | |
| 444 | 276 return casify_region (CASE_DOWN, start, end, buffer); |
| 428 | 277 } |
| 278 | |
| 279 DEFUN ("capitalize-region", Fcapitalize_region, 2, 3, "r", /* | |
| 280 Convert the region to capitalized form. | |
| 281 Capitalized form means each word's first character is upper case | |
| 282 and the rest of it is lower case. | |
| 283 In programs, give two arguments, the starting and ending | |
| 284 character positions to operate on. | |
| 285 Optional third arg BUFFER defaults to the current buffer. | |
| 286 */ | |
| 444 | 287 (start, end, buffer)) |
| 428 | 288 { |
| 289 /* This function can GC */ | |
| 444 | 290 return casify_region (CASE_CAPITALIZE, start, end, buffer); |
| 428 | 291 } |
| 292 | |
| 293 /* Like Fcapitalize_region but change only the initials. */ | |
| 294 | |
| 295 DEFUN ("upcase-initials-region", Fupcase_initials_region, 2, 3, "r", /* | |
| 296 Upcase the initial of each word in the region. | |
| 297 Subsequent letters of each word are not changed. | |
| 298 In programs, give two arguments, the starting and ending | |
| 299 character positions to operate on. | |
| 300 Optional third arg BUFFER defaults to the current buffer. | |
| 301 */ | |
| 444 | 302 (start, end, buffer)) |
| 428 | 303 { |
| 444 | 304 return casify_region (CASE_CAPITALIZE_UP, start, end, buffer); |
| 428 | 305 } |
| 306 | |
| 307 | |
| 308 static Lisp_Object | |
| 309 casify_word (enum case_action flag, Lisp_Object arg, Lisp_Object buffer) | |
| 310 { | |
| 665 | 311 Charbpos farend; |
| 428 | 312 struct buffer *buf = decode_buffer (buffer, 1); |
| 313 | |
| 314 CHECK_INT (arg); | |
| 315 | |
| 316 farend = scan_words (buf, BUF_PT (buf), XINT (arg)); | |
| 317 if (!farend) | |
| 318 farend = XINT (arg) > 0 ? BUF_ZV (buf) : BUF_BEGV (buf); | |
| 319 | |
| 320 casify_region_internal (flag, make_int (BUF_PT (buf)), make_int (farend), buf); | |
| 321 BUF_SET_PT (buf, max (BUF_PT (buf), farend)); | |
| 322 return Qnil; | |
| 323 } | |
| 324 | |
| 325 DEFUN ("upcase-word", Fupcase_word, 1, 2, "p", /* | |
| 444 | 326 Convert following word (or COUNT words) to upper case, moving over. |
| 428 | 327 With negative argument, convert previous words but do not move. |
| 328 See also `capitalize-word'. | |
| 329 Optional second arg BUFFER defaults to the current buffer. | |
| 330 */ | |
| 444 | 331 (count, buffer)) |
| 428 | 332 { |
| 333 /* This function can GC */ | |
| 444 | 334 return casify_word (CASE_UP, count, buffer); |
| 428 | 335 } |
| 336 | |
| 337 DEFUN ("downcase-word", Fdowncase_word, 1, 2, "p", /* | |
| 444 | 338 Convert following word (or COUNT words) to lower case, moving over. |
| 428 | 339 With negative argument, convert previous words but do not move. |
| 340 Optional second arg BUFFER defaults to the current buffer. | |
| 341 */ | |
| 444 | 342 (count, buffer)) |
| 428 | 343 { |
| 344 /* This function can GC */ | |
| 444 | 345 return casify_word (CASE_DOWN, count, buffer); |
| 428 | 346 } |
| 347 | |
| 348 DEFUN ("capitalize-word", Fcapitalize_word, 1, 2, "p", /* | |
| 444 | 349 Capitalize the following word (or COUNT words), moving over. |
| 428 | 350 This gives the word(s) a first character in upper case |
| 351 and the rest lower case. | |
| 352 With negative argument, capitalize previous words but do not move. | |
| 353 Optional second arg BUFFER defaults to the current buffer. | |
| 354 */ | |
| 444 | 355 (count, buffer)) |
| 428 | 356 { |
| 357 /* This function can GC */ | |
| 444 | 358 return casify_word (CASE_CAPITALIZE, count, buffer); |
| 428 | 359 } |
| 360 | |
| 361 | |
| 362 void | |
| 363 syms_of_casefiddle (void) | |
| 364 { | |
| 365 DEFSUBR (Fupcase); | |
| 366 DEFSUBR (Fdowncase); | |
|
4910
6bc1f3f6cf0d
Make canoncase visible to Lisp; use it with chars in internal_equalp.
Aidan Kehoe <kehoea@parhasard.net>
parents:
2367
diff
changeset
|
367 DEFSUBR (Fcanoncase); |
| 428 | 368 DEFSUBR (Fcapitalize); |
| 369 DEFSUBR (Fupcase_initials); | |
| 370 DEFSUBR (Fupcase_region); | |
| 371 DEFSUBR (Fdowncase_region); | |
| 372 DEFSUBR (Fcapitalize_region); | |
| 373 DEFSUBR (Fupcase_initials_region); | |
| 374 DEFSUBR (Fupcase_word); | |
| 375 DEFSUBR (Fdowncase_word); | |
| 376 DEFSUBR (Fcapitalize_word); | |
| 377 } |
