yuuji@70: \def\lang{eng} % -*- texinfo -*- for Texinfo V.3.1 yuuji@70: \input texinfo yuuji@70: @setfilename yahtmle yuuji@70: @settitle Yet Another html-mode for Emacs yuuji@272: @direntry yuuji@272: * yahtml-e: (yahtmle). Yet Another html-mode for Emacs (English). yuuji@272: @end direntry yuuji@70: yuuji@70: @iftex yuuji@70: @c @syncodeindex fn cp yuuji@272: @c Last modified Fri May 11 15:42:22 2012 on firestorm yuuji@70: @syncodeindex vr cp yuuji@70: @end iftex yuuji@70: yuuji@70: @titlepage yuuji@70: @sp 10 yuuji@70: @center yuuji@70: @subtitle Yet Another html-mode for emacs yuuji@70: @title // yahtml // yuuji@70: %@subtitle // yahtml // yuuji@271: @author @copyright{} 1994-2012 by HIROSE, Yuuji [yuuji@@yatex.org] yuuji@70: @end titlepage yuuji@70: yuuji@70: @node Top, Intro, (dir), (dir) yuuji@70: @comment node-name, next, previous, up yuuji@70: yuuji@70: @menu yuuji@70: * Intro:: Introduction yuuji@70: * Installation:: Installing yahtml yuuji@70: * Command Invocation:: Using External Commands yuuji@70: * Completion:: Input with Completion yuuji@70: * Jump:: Moving the Cursor yuuji@70: * Changing and Deleting:: Changing and Deleting yuuji@70: * CSS Support:: Style Sheet Support yuuji@70: * Customizations:: List of Customize Variables yuuji@70: * Copying:: Copyright yuuji@70: * Concept Index:: Index yuuji@70: @end menu yuuji@70: yuuji@70: @node Intro, Installation, Top, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Introduction yuuji@70: @cindex Demacs yuuji@70: @cindex Mule yuuji@70: @cindex LaTeX yuuji@70: @cindex yahtml yuuji@70: yuuji@70: yahtml is a package to support creating HTML documents on Emacsens. Easy yuuji@70: input of elements (tags) by completion, syntax checking with programs like yuuji@70: weblint, and invoking the appropriate browser or image viewer depending on yuuji@70: the cursor position is its main features. yuuji@70: yuuji@70: (This Info is still incomplete) yuuji@70: yuuji@70: @node Installation, Command Invocation, Intro, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Installing yahtml yuuji@70: @menu yuuji@70: * Setting up yahtml:: yuuji@70: * Setting environments for weblint browsers and image viewers:: yuuji@70: * Setting environment variables for WWW pages:: yuuji@70: @end menu yuuji@70: yuuji@70: @node Setting up yahtml, Setting environments for weblint browsers and image viewers, Installation, Installation yuuji@70: @comment node-name, next, previous, up yuuji@70: @section Setting up yahtml yuuji@70: yuuji@70: yuuji@70: Add the following to @file{~/.emacs} yuuji@70: yuuji@70: @lisp yuuji@70: (setq auto-mode-alist yuuji@70: (cons (cons "\\.html$" 'yahtml-mode) auto-mode-alist)) yuuji@70: (autoload 'yahtml-mode "yahtml" "Yet Another HTML mode" t) yuuji@70: @end lisp yuuji@70: yuuji@70: Next, add to load-path the directory with the yahtml files yuuji@70: (@file{yahtml.el}, @file{yatexlib.el}, @file{yatexprc.el}). For example, yuuji@70: if you put them in @file{~/src/emacs/yahtml}, yuuji@70: yuuji@70: @lisp yuuji@70: (setq load-path (cons (expand-file-name "~/src/emacs/yahtml") load-path)) yuuji@70: @end lisp yuuji@70: yuuji@265: @noindent yuuji@70: is what you add. yuuji@70: yuuji@70: By this, yahtml will be automatically loaded when editing files with .html yuuji@70: extensions. "yahtml" will be displayed on the mode line if no errors yuuji@265: occurred. yuuji@70: yuuji@70: @node Setting environments for weblint browsers and image viewers, Setting environment variables for WWW pages, Setting up yahtml, Installation yuuji@70: @comment node-name, next, previous, up yuuji@70: @section Setting environments for weblint, browsers, and image viewers yuuji@70: yuuji@70: Check the variables for invoking external commands and modify as needed. yuuji@70: Defaults are in parenthesis. yuuji@70: yuuji@70: @table @code yuuji@70: @item yahtml-www-browser yuuji@70: @dots{} browser command name (netscape) yuuji@70: @item yahtml-image-viewer yuuji@70: @dots{} image viewer command name (xv) yuuji@70: @item yahtml-lint-program yuuji@70: @dots{} syntax check programs command name (jweblint) yuuji@70: @item yahtml-kanji-code yuuji@70: @dots{} kanji code for HTML files yuuji@70: @end table yuuji@70: yuuji@70: @node Setting environment variables for WWW pages, , Setting environments for weblint browsers and image viewers, Installation yuuji@70: @comment node-name, next, previous, up yuuji@70: @section Setting environment variables for WWW pages yuuji@70: yuuji@70: Variables regarding path names for files that will be your home page. yuuji@70: @table @code yuuji@70: @item yahtml-path-url-alist yuuji@70: @dots{} list of matching path name on file system and URLs yuuji@70: @item yahtml-directory-index yuuji@70: @dots{} index file displayed when none is given in URL. Usually yuuji@70: @file{index.html} on NCSA type httpd and @file{Welcome.html} on yuuji@265: CERN types. yuuji@70: @end table yuuji@70: yuuji@70: Examples for @code{yahtml-path-url-alist}. If @file{/home/yuuji/http/} yuuji@70: is @code{http://localhost/~yuuji} at home and @file{/usr/home/yuuji/www/} yuuji@70: is @code{http://www.keio.ac.jp/~yuuji/} at work, then yuuji@70: yuuji@70: @lisp yuuji@70: (setq yahtml-path-url-alist yuuji@70: '(("/home/yuuji/http" . "http://localhost/~yuuji") yuuji@70: ("/usr/home/yuuji/www" . "http://www.keio.ac.jp/~yuuji"))) yuuji@70: @end lisp yuuji@70: yuuji@70: Any number of additions can be made to this list. yuuji@70: yuuji@70: @node Command Invocation, Completion, Installation, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Invoking external commands yuuji@70: yuuji@70: For easy use of commands that are handy when editing HTML files. yuuji@70: @table @kbd yuuji@70: @item [prefix] t j yuuji@70: @dots{} Invoke HTML syntax checker (jweblint) yuuji@70: @item [prefix] t p yuuji@70: @dots{} Display current page in browser yuuji@70: @item [prefix] t r yuuji@70: @dots{} Reload current page if browser is already running yuuji@70: @end table yuuji@70: yuuji@70: @node Completion, Jump, Command Invocation, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Completion Input yuuji@70: yuuji@70: Completion input of HTML elements is done through the same key strokes as yuuji@70: YaTeX's begin-type completion, section-type completion, large-type yuuji@70: completion, maketitle-type completion, and accent completion. yuuji@70: Corresponding elements in this order is; elements that span multiple yuuji@70: lines, empty elements such as img, tags that start and end in a yuuji@70: single line, elements with no attributes or contents, and special or yuuji@70: symbol entities. yuuji@70: yuuji@70: @table @kbd yuuji@70: @item [prefix] b (YaTeX begin-type completion) yuuji@70: @dots{} yuuji@70: @example yuuji@70: yuuji@70: @end example yuuji@70: yuuji@70: @noindent yuuji@70: Completion for elements that the start tag and the end tag span multiple yuuji@70: lines. Mostly block-level elements. yuuji@70: yuuji@70: @item [prefix] s (YateX section-type completion) yuuji@70: @dots{} yuuji@70: @example yuuji@70: photo yuuji@70: @end example yuuji@70: yuuji@70: @noindent yuuji@70: Completion for elements that do not have end tags and require only yuuji@70: attributes. Possible completions are, , . yuuji@70: yuuji@70: @item [prefix] l (YaTeX large-type completion) yuuji@265: @dots{} yuuji@70: yuuji@70: @example yuuji@72: yuuji@70: @end example yuuji@70: yuuji@70: @noindent yuuji@70: Similar to begin-type completion but used for elements that start and end yuuji@70: on a single line. yuuji@70: yuuji@70: yuuji@70: @item [prefix] m (YaTeX maketitle-type completion) yuuji@70: @dots{} Completion for elements without attributes or contents. Possible yuuji@70: completion is
yuuji@70: yuuji@70: @item [prefix] a (YaTeX accent completion) yuuji@70: @dots{} Used to enter special or symbol entities. By default completion yuuji@70: for < (<), > (>), & (&), " ("), ' ('), blank ( ) yuuji@70: is possible. yuuji@70: @end table yuuji@70: yuuji@70: @node Jump, Changing and Deleting, Completion, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Cursor Movement yuuji@265: By using yuuji@70: yuuji@70: @table @kbd yuuji@70: @item [prefix] g yuuji@70: @dots{} move to corresponding object yuuji@70: @end table yuuji@70: yuuji@265: @noindent yuuji@70: the cursor will go to the corresponding object according to the context. yuuji@70: Recognized contexts are yuuji@70: yuuji@70: @itemize @bullet yuuji@70: @item @code{} <--> @code{} yuuji@70: @item @code{} -> invoke viewer yuuji@70: @item @code{} -> move cursor to linked target yuuji@70: @item @code{} -> open Java source yuuji@72: @c @item @code{\include(\input)} → 対応するファイル yuuji@70: @end itemize yuuji@70: yuuji@70: @node Changing and Deleting, CSS Support, Jump, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Changing and Deleting yuuji@70: yuuji@70: @menu yuuji@70: * Changing tags in pairs:: yuuji@70: * Changing entities:: yuuji@70: * URLencoding of strings within region:: yuuji@269: * td-enclosure/tr-enclosure:: yuuji@70: @end menu yuuji@70: yuuji@70: @node Changing tags in pairs, Changing entities, Changing and Deleting, Changing and Deleting yuuji@70: @comment node-name, next, previous, up yuuji@70: @section Changing tags in pairs yuuji@70: By using yuuji@70: yuuji@70: @table @kbd yuuji@70: @item [prefix] c yuuji@70: @dots{} change tags in matching pairs yuuji@70: @end table yuuji@70: yuuji@265: @noindent yuuji@70: the content can be changed according to the context of the HTML document yuuji@70: where the cursor is located. yuuji@70: yuuji@70: @itemize @bullet yuuji@72: @item @code{}〜@code{} yuuji@70: @dots{} change @code{TAG} element name yuuji@70: @item attributes such as @code{photo} yuuji@70: @dots{} change attributes yuuji@70: @end itemize yuuji@70: yuuji@70: @node Changing entities, URLencoding of strings within region, Changing tags in pairs, Changing and Deleting yuuji@70: @comment node-name, next, previous, up yuuji@70: @section Changing entities yuuji@70: Special characters such as < or > must be written as < and >. Easy yuuji@70: conversion of these characters can be done when importing text from non yuuji@70: HTML files. yuuji@70: yuuji@70: yuuji@70: @table @kbd yuuji@70: @item [prefix] ; yuuji@70: @dots{} convert char to special entity in marked region yuuji@70: @item [prefix] : yuuji@70: @dots{} convert special entity to original char in marked region yuuji@70: (reverse of [prefix] ;) yuuji@70: @end table yuuji@70: yuuji@70: yuuji@158: @node URLencoding of strings within region, td-enclosure/tr-enclosure, Changing entities, Changing and Deleting yuuji@70: @comment node-name, next, previous, up yuuji@70: @section URLencoding of strings within region yuuji@70: yuuji@70: @table @kbd yuuji@70: @item [prefix] # yuuji@70: @dots{} encode chars that needs to be URLencoded within region yuuji@70: @end table yuuji@70: yuuji@158: @node td-enclosure/tr-enclosure, , URLencoding of strings within region, Changing and Deleting yuuji@158: @comment node-name, next, previous, up yuuji@158: @section td-enclosure/tr-enclosure yuuji@158: If you wan to convert series of field into ... repetitions for yuuji@158: table element, td-enclosure or tr-enclosure is convenient. yuuji@158: yuuji@158: @table @kbd yuuji@223: @item [prefix] @} yuuji@158: @dots{} Enclose each field in a region into ...'s. yuuji@158: @item [prefix] ] yuuji@158: @dots{} Enclose each line in a region into ...'s, with yuuji@158: every line converted to ... repetition. yuuji@158: @end table yuuji@158: They presume white space as field separator by default. yuuji@158: To change this, enter other delimiting character for a query. yuuji@158: You can convert CSV, for example, into table by specifying yuuji@158: comma(,) as a delimiter. yuuji@158: yuuji@158: If you want to enclose fields with th, call with yuuji@158: universal-argument (@kbd{C-u}). Enter `th' to enclose fields yuuji@158: with .... The special answer `thd' means that yuuji@158: enclose the only first column with th, and the rest with td. yuuji@158: yuuji@70: @node CSS Support, Customizations, Changing and Deleting, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter CSS(Style Sheets) Support yuuji@70: yuuji@70: @menu yuuji@70: * CSS-class completion:: yuuji@70: * Reread CSS definition:: yuuji@70: @end menu yuuji@70: yuuji@70: @node CSS-class completion, Reread CSS definition, CSS Support, CSS Support yuuji@70: @comment node-name, next, previous, up yuuji@70: @section CSS class-name completion yuuji@70: You can input a class name in your CSS definition with completion. yuuji@70: If you have CSS defined as below; yuuji@70: yuuji@70: @display yuuji@70: h1.foo, h2.foo @{ background-color: 0xffffff; @} yuuji@70: h1.bar, h2.bar @{ font-size: 120%; @} yuuji@70: @end display yuuji@70: yuuji@70: when you input h1(or h2) tag with completing-read by [prefix] b or yuuji@70: [prefix] l, yahtml prompts you to input class name with completion from yuuji@265: the words which are effective to h1 or h2. And if you defined yuuji@70: global class like this; yuuji@70: yuuji@70: @display yuuji@70: .caution @{ font-size: 120%; background-color: 0xc00000;@} yuuji@70: @end display yuuji@70: yuuji@70: when you input any tags via completing-read, yahtml prompts you to input yuuji@70: class name. If this is bothering, typing @kbd{C-j} instead of yuuji@70: @kbd{RET} (or @kbd{C-m}) cancels the next prompt to class name completion. yuuji@70: yuuji@70: @node Reread CSS definition, , CSS-class completion, CSS Support yuuji@70: @comment node-name, next, previous, up yuuji@70: @section Re-reading CSS definition yuuji@70: If you add some class to your CSS file and you want yahtml to load yuuji@70: new definitions, type @kbd{M-x yahtml-mode RET} to make yahtml do. yuuji@70: yuuji@70: @node Customizations, Copying, CSS Support, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Customizations yuuji@70: @cindex Customize yuuji@70: @cindex Key Assign yuuji@70: yuuji@70: Variables that modify yahtml's behavior. yuuji@70: yuuji@70: @menu yuuji@70: * All customizable variables:: List of customizable variables yuuji@70: * Hook variables:: hook variables yuuji@70: @end menu yuuji@70: yuuji@70: @node All customizable variables, Hook variables, Customizations, Customizations yuuji@70: @comment node-name, next, previous, up yuuji@70: @section List of customizable variables. Defaults in parenthesis yuuji@70: yuuji@70: @defvar yahtml-prefix yuuji@70: Prefix key for yahtml-mode. (@kbd{\C-c}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-image-viewer yuuji@70: Command to view image files refered by img. (xv) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-www-browser yuuji@70: Browser to view external pages with @kbd{[prefix]g}. (netscape) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-kanji-code yuuji@118: Default kanji code. 1=sjis, 2=jis, 3=euc, 4=utf-8 (2) yuuji@70: If yuuji@70: @quotation yuuji@70: AddType "text/html; charset=xxx" .html yuuji@70: @end quotation yuuji@70: is written in .htaccess, this will override yahtml-kanji-code. yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-fill-column yuuji@70: Columns to auto-fill (72) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-fill-prefix yuuji@70: fill-prefix specific to yahtml-mode. (@code{nil}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-path-url-alist yuuji@70: Matching list of URL and full path name on OS's file system. yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-directory-index yuuji@70: Default index filed opened when accessing a server without a filename, yuuji@70: usually index.html. (@code{"index.html"}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-lint-program yuuji@70: HTML syntax check program. (@code{"jweblint"}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-hate-too-deep-indentation yuuji@70: setq to t when indentations for nested enumerate elements are too deep. yuuji@70: (@code{nil}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-always-/p yuuji@70: setq to t if you always want @code{

} after @code{

}. @code{nil} yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-p-prefered-env-regexp yuuji@75: Elements that @code{

} will be automatically inserted. yuuji@75: (@code{"^\\(body\\|dl\\|blockquote\\)"}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-template-file yuuji@70: File to automatically insert when editing a new HTML file. yuuji@70: @file{"~/http/template.html"} yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-prefer-upcases yuuji@70: Use uppercase for tags. @code{nil} yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-prefer-upcase-attributes yuuji@70: Use uppercase for attributes. @code{nil} yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-server-type yuuji@70: setq to 'apache if using a Apache server, and will refer ./.htaccess. yuuji@70: @code{'apache} yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-apache-access-file yuuji@70: When @code{yahtml-server-type} is @code{'apache}, define name of access yuuji@70: restriction file. @file{".htaccess"} yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-shell-command-option yuuji@70: Options needed to invoke shell commands. yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-translate-hyphens-when-comment-region yuuji@70: Whether to change hyphens to @code{-} when commenting out region. yuuji@70: (@code{t}) yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-entity-reference-chars-alist yuuji@70: alist of characters that needs to be written by Entity Reference. Enter yuuji@70: as @code{'(?char . "EntityReference")}. By default, @code{<}, @code{>}, yuuji@70: @code{&}, @code{'}, is set. Add as needed. Do not include @code{&} at yuuji@70: beginning and @code{;} at end of cdr portion of @code{"EntityReference"}. yuuji@70: @end defvar yuuji@70: yuuji@70: @defvar yahtml-faithful-to-htmllint yuuji@70: When using htmllint to check syntax, it will complain about excess spaces. yuuji@70: setq to @code{t} to avoid this. yuuji@70: @end defvar yuuji@70: yuuji@72: @defvar yahtml-use-css yuuji@72: Use style-sheet support or not (@code{t}) yuuji@72: @end defvar yuuji@72: yuuji@72: @defvar yahtml-image-inspection-bytes yuuji@72: Number of bytes to inspect the image for geometry information (@code{10000}) yuuji@72: @end defvar yuuji@72: yuuji@72: @defvar yahtml:img-default-alt-format yuuji@72: format of img entity's ALT attributes. yuuji@72: %x: width, %y: height, %s: size in bytes, %c: first comment string, yuuji@72: %f: filename (@code{"%xx%y(%sbytes)"}) yuuji@72: @end defvar yuuji@72: yuuji@72: @defvar yahtml-escape-chars yuuji@72: When, completing href-s, Escape reserved characters to URL-encoding or not. yuuji@72: Nil for never, t for everytime, and 'ask for inquiring yuuji@72: at each reserved chars. (@code{'ask}) yuuji@72: @end defvar yuuji@72: yuuji@72: @defvar yahtml-use-font-lock yuuji@72: Use font-lock to fontify buffer or not yuuji@72: (@code{(featurep 'font-lock)}) yuuji@72: @end defvar yuuji@72: yuuji@75: @defvar yahtml-use-hilit19 yuuji@72: Use hilit19 to highlight buffer or not yuuji@72: (@code{(featurep 'hilit19)}) yuuji@72: @end defvar yuuji@72: yuuji@75: @defvar yahtml-indentation-boundary yuuji@75: Boundary regexp for indentation calculation. yuuji@75: (@code{"^\\s *"}) yuuji@75: @end defvar yuuji@70: yuuji@70: @node Hook variables, , All customizable variables, Customizations yuuji@70: @comment node-name, next, previous, up yuuji@70: @section hook variables yuuji@70: yuuji@70: yuuji@70: @node Copying, Concept Index, Customizations, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @chapter Copying yuuji@70: yuuji@70: This program is distributed as freesoftware. The author will take no yuuji@70: responsibility to any damages due to the usage of this software yuuji@70: whatsoever. There are no restrictions to its redistribution, just use yuuji@70: common sense. Mail me your thoughts on this program and I will be more yuuji@70: than willing to help. yuuji@70: yuuji@70: Complaints, requests, bug reports and comments are welcome. Make contacts yuuji@72: to yuuji@@yatex.org (as of December 2000) yuuji@70: yuuji@70: If you like this program and use it on a regular basis, please join the yuuji@70: mailing list "fj Wild Bird Society". Procedures can be found in the "etc" yuuji@72: section of @file{docs/htmlqa.eng} in this package. yuuji@70: yuuji@70: yuuji@70: @flushright yuuji@70: HIROSE, Yuuji yuuji@70: @end flushright yuuji@70: yuuji@70: yuuji@70: @node Concept Index, , Copying, Top yuuji@70: @comment node-name, next, previous, up yuuji@70: @unnumbered Index yuuji@70: @printindex cp yuuji@70: yuuji@70: yuuji@70: @contents yuuji@70: yuuji@70: @bye yuuji@70: yuuji@70: @c Local Variables: yuuji@70: @c fill-column: 74 yuuji@70: @c fill-prefix: nil yuuji@70: @c End: yuuji@70:  yuuji@70: Tag table: yuuji@70:  yuuji@70: End tag table