• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/textmodes/

Lines Matching +defs:insert +defs:char

121 ;; command M-x `table-insert' RET.  It'll ask you number of columns,
128 ;; `table-insert'. The document includes a short tutorial. When you
157 ;; |`table-insert' |Insert a table consisting of grid |
162 ;; |`table-insert-row' |Insert row(s) of cells before the |
166 ;; |`table-insert-column' |Insert column(s) of cells before |
246 ;; | |and insert it into a specified |
249 ;; |`table-insert-sequence' |Travel cells forward while |
367 ;; of tables, such as to insert a table, to insert rows and columns,
396 ;; table-cell-vertical-char `|' or table-cell-intersection-char `+'.
398 ;; table-cell-horizontal-char `-' or table-cell-intersection-char `+'.
400 ;; table-cell-intersection-char `+'. A cell must contain at least one
516 ;; `table-word-continuation-char'. The continuation character is
635 ;; (unless (fboundp 'unibyte-char-to-multibyte)
636 ;; (defun unibyte-char-to-multibyte (char)))
646 See `table-insert' for examples about how to use."
704 (defcustom table-cell-vertical-char ?\|
710 (defcustom table-cell-intersection-char ?\+
716 (defcustom table-word-continuation-char ?\\
741 location is indicated by `table-word-continuation-char'. This
885 (defvar table-cell-self-insert-command-count 0
938 (defvar table-insert-row-column-history '("row"))
989 ([(control ?+)] . table-insert-row-column)
998 '((self-insert-command . *table--cell-self-insert-command)
999 (completion-separator-self-insert-autofilling . *table--cell-self-insert-command)
1000 (completion-separator-self-insert-command . *table--cell-self-insert-command)
1001 (delete-char . *table--cell-delete-char)
1002 (delete-backward-char . *table--cell-delete-backward-char)
1003 (backward-delete-char . *table--cell-delete-backward-char)
1004 (backward-delete-char-untabify . *table--cell-delete-backward-char)
1008 (quoted-insert . *table--cell-quoted-insert)
1027 ["a Table..." table-insert
1030 ["Row" table-insert-row
1033 ["Column" table-insert-column
1076 ["Row" table-insert-row
1079 ["Column" table-insert-column
1213 ["Insert Sequence" table-insert-sequence
1334 (goto-char (point-min))
1336 (goto-char (match-beginning 1))))
1471 insert))
1504 (defun table-insert (columns rows &optional cell-width cell-height)
1516 \\[table-insert] inserts a table at the current point location.
1523 Type \\[table-insert] and hit ENTER key. As it asks table
1551 width information to `table-insert'.
1570 Type \\[table-insert-row-column] and tell it to insert a row.
1591 Type M-x table-insert-row instead of \\[table-insert-row-column]. \\[table-insert-row-column] does not work
1629 (error "Can't insert a table inside a table"))
1666 (insert table-cell-intersection-char)
1670 (insert (make-string (car cw) (string-to-char table-cell-horizontal-chars)) table-cell-intersection-char)
1676 (insert table-cell-vertical-char)
1681 (insert (make-string (car cw) ?\s))
1682 (insert table-cell-vertical-char)
1701 (insert border-str))
1706 (insert cell-str)
1710 (insert border-str)
1718 (defun table-insert-row (n)
1734 (vertical-str (string table-cell-vertical-char))
1735 (vertical-str-with-properties (let ((str (string table-cell-vertical-char)))
1759 (concat (if exclude-left "" (char-to-string table-cell-intersection-char))
1760 (make-string (- (cadr this) (caar this)) (string-to-char table-cell-horizontal-chars))
1761 (if exclude-right "" (char-to-string table-cell-intersection-char)))
1778 (goto-char beg))
1779 (table--insert-rectangle rect)))
1788 (delete-char 1) (insert table-cell-intersection-char)
1790 (delete-char 1) (insert table-cell-intersection-char)
1801 (defun table-insert-column (n)
1813 (border-str (table--multiply-string (concat (make-string cell-width (string-to-char table-cell-horizontal-chars))
1814 (char-to-string table-cell-intersection-char)) n))
1816 (let ((str (string table-cell-vertical-char)))
1865 ;; insert the extended rectangle
1867 (table--insert-rectangle rect)))
1876 (delete-char 1) (insert table-cell-intersection-char)
1878 (delete-char 1) (insert table-cell-intersection-char)
1891 (defun table-insert-row-column (row-column n)
1893 See `table-insert-row' and `table-insert-column'."
1898 (default (car table-insert-row-column-history)))
1906 nil t nil 'table-insert-row-column-history default))))
1909 (table-insert-row n))
1911 (table-insert-column n))))
1926 (goto-char (point-min))
1929 table-cell-vertical-char
1930 table-cell-intersection-char))
1934 table-cell-vertical-char
1935 table-cell-intersection-char)))
1952 (setq end (goto-char (point-max))))
1975 (goto-char beg)
1978 table-cell-vertical-char
1979 table-cell-intersection-char))
1982 table-cell-vertical-char
1983 table-cell-intersection-char))
1993 (forward-char 1))
1996 (goto-char (match-beginning 0))
1997 (goto-char end)))
1999 (goto-char (next-single-property-change (point) 'table-cell nil end)))
2005 (goto-char end))))))))))
2095 (table--insert-rectangle rectangle)))))
2121 (vertical-str (string table-cell-vertical-char))
2122 (vertical-str-with-properties (string table-cell-vertical-char))
2155 (goto-char beg)
2156 (table--insert-rectangle rect)))
2262 (goto-char beg)
2263 (table--insert-rectangle rect)
2272 (goto-char beg)
2273 (table--insert-rectangle rect)))
2281 (goto-char beg)
2282 (table--insert-rectangle rect)))
2332 table-cell-intersection-char
2333 table-cell-intersection-char))
2356 ;; insert the bar n times
2357 (goto-char beg)
2361 (table--insert-rectangle rectangle))
2413 (unless (bolp) (forward-char -1))
2518 (if cell (goto-char (car cell)) ; done
2556 (if tip (goto-char (car tip)) ; done
2575 (goto-char (car edge))))) ; the top left cell
2654 (goto-char beg)
2659 (above-contp (and (goto-char beg)
2662 (looking-at (regexp-quote (char-to-string table-cell-vertical-char)))))
2663 (below-contp (and (goto-char end)
2664 (progn (forward-char -1) t)
2667 (looking-at (regexp-quote (char-to-string table-cell-vertical-char))))))
2670 (char-to-string table-cell-intersection-char)
2678 (char-to-string table-cell-intersection-char)
2682 (goto-char beg)
2683 (table--insert-rectangle rectangle))
2685 (insert (if (and (> (point) (point-min))
2687 (forward-char -1)
2690 table-cell-intersection-char
2691 table-cell-vertical-char)
2695 table-cell-intersection-char
2696 table-cell-vertical-char))))
2725 (goto-char beg)
2727 (insert table-cell-intersection-char
2728 (make-string table-cell-info-width (string-to-char table-cell-horizontal-chars))
2729 table-cell-intersection-char)
2737 (goto-char (point-min))
2738 (insert line ?\n)
2739 (goto-char (point-min)) ;; don't heighten cell unnecessarily
2763 (goto-char (point-min))
2792 (setq rectangle (cons (char-to-string table-cell-intersection-char) nil))
2795 (setq rectangle (cons (char-to-string table-cell-vertical-char) rectangle))))
2796 (setq rectangle (cons (char-to-string table-cell-intersection-char) rectangle))
2800 (goto-char beg)
2801 (table--insert-rectangle rectangle)
2805 (forward-char 1)
2809 (forward-char 1))
2819 ;; insert the strip only when it is not a completely blank one
2823 (goto-char (point-min))
2824 (table--insert-rectangle strip-rect)
2828 (insert cell-contents)
2834 (goto-char (match-beginning 1))))
2902 (goto-char (car cell))
2919 (goto-char (car cell))
2951 (if where (goto-char where))
3077 (goto-char (car origin-cell))
3087 ;; insert closing
3093 (goto-char (point-min))
3107 "Generate and insert source prologue into DEST-BUFFER."
3111 (insert (format "<!-- This HTML table template is generated by emacs %s -->\n" emacs-version)
3118 (insert (format "%% This LaTeX table template is generated by emacs %s\n" emacs-version)
3122 (insert (format "<!-- This CALS table template is generated by emacs %s -->\n" emacs-version)
3126 (insert " <title>" caption "</title>\n"))
3127 (insert (format " <tgroup cols=\"%d\" align=\"left\" colsep=\"1\" rowsep=\"1\">\n" (length col-list)))
3130 (set-marker-insertion-type (table-get-source-info 'colspec-marker) nil) ;; insert after
3131 (insert (format " <%s valign=\"top\">\n" (table-get-source-info 'row-type))))
3135 "Generate and insert source epilogue into DEST-BUFFER."
3139 (insert "</table>\n"))
3141 (insert "\\end{tabular}\n"))
3143 (set-marker-insertion-type (table-get-source-info 'colspec-marker) t) ;; insert before
3145 (goto-char (table-get-source-info 'colspec-marker))
3148 (insert (format " <colspec colnum=\"%d\" colname=\"c%d\"/>\n" col col)))
3150 (insert (format " </%s>\n </tgroup>\n</table>\n" (table-get-source-info 'row-type))))
3154 "Generate and insert source rows into DEST-BUFFER."
3160 (insert " <tr>\n"))
3162 (insert " <row>\n"))
3168 (insert " </tr>\n"))
3170 (insert " </row>\n")
3172 (insert (format " </%s>\n" (table-get-source-info 'row-type)))
3173 (insert (format " <%s valign=\"top\">\n" (table-put-source-info 'row-type "tbody")))))))
3178 "Generate and insert source cells into DEST-BUFFER."
3210 (insert (format " <%s"
3217 (insert " " table-html-cell-attribute))
3218 (if (> colspan 1) (insert (format " colspan=\"%d\"" colspan)))
3219 (if (> rowspan 1) (insert (format " rowspan=\"%d\"" rowspan)))
3220 (insert (format " align=\"%s\"" (if alignment (symbol-name alignment) "left")))
3221 (insert (format " valign=\"%s\"" (if valign (symbol-name valign) "top")))
3222 (insert ">\n"))
3224 (insert " <entry")
3233 (insert (format " namest=\"c%d\" nameend=\"c%d\"" scol ecol))))
3234 (if (> rowspan 1) (insert (format " morerows=\"%d\"" (1- rowspan))))
3237 (insert " align=\"" (symbol-name alignment) "\""))
3240 (insert " valign=\"" (symbol-name valign) "\""))
3241 (insert ">\n"))
3247 (insert (format" </%s>\n" (table-get-source-info 'cell-type))))
3249 (insert " </entry>\n"))
3256 "Generate and insert source cell contents of a CELL into DEST-BUFFER."
3259 (table--insert-rectangle cell-contents)
3261 (goto-char (point-min))
3271 (goto-char (point-min))
3274 (insert "<br />")
3275 (forward-char 1)))
3278 (goto-char (point-min))
3288 (insert cell-contents)
3293 (insert ?\n)))))
3295 (defun table--cell-horizontal-char-p (c)
3310 (border-char-list
3312 (if border-p (char-after (table--goto-coordinate (cons x y)))
3313 (char-before (table--goto-coordinate (cons x y)))))
3318 (if (and (table--cell-horizontal-char-p (car border-char-list))
3319 (table--uniform-list-p border-char-list))
3321 (insert "\\hline\n"))
3323 (while (setq c (nth i border-char-list))
3324 (if (and start (not (table--cell-horizontal-char-p c)))
3327 (insert (format "\\cline{%d-%d}\n" (1+ start) i)))
3329 (if (and (not start) (table--cell-horizontal-char-p c))
3334 (insert (format "\\cline{%d-%d}\n" (1+ start) i)))))
3338 (insert-column ;; a function that processes one column/multicolumn
3346 (insert line)
3347 (goto-char (point-min))
3351 (goto-char (match-beginning 1))
3352 (insert "\\"))
3357 ;; insert a column separator and column/multicolumn contents
3360 (insert (if (eq (char-before) ?\s) "" " ") "& "))
3362 (insert (format "\\multicolumn{%d}{%sl|}{%s}" span (if first-p "|" "") line))
3363 (insert line)))
3369 (while (setq c (nth i border-char-list))
3370 (if (eq c table-cell-vertical-char)
3371 (funcall insert-column start (1- (nth i col-list)))
3374 (funcall insert-column start x1))
3376 (insert (if (eq (char-before) ?\s) "" " ") "\\\\\n"))))
3379 (insert "\\hline\n"))
3383 (defun table-insert-sequence (str n increment interval justify)
3390 number of sequence elements to insert. When N is negative the cell
3404 (table-insert 16 3 5 1)
3406 (table-insert-sequence \"D0\" -16 1 1 'center)
3408 (table-insert-sequence \"A[0]\" -16 1 1 'center)
3410 (table-insert-sequence \"-\" 16 0 1 'center))
3413 (table-insert 16 8 5 1)
3414 (table-insert-sequence \"@\" 0 1 2 'right)
3416 (table-insert-sequence \"64\" 0 1 2 'left))
3445 (fmt (format "%%%s%dd" (if (eq (string-to-char index) ?0) "0" "") (length index)))
3466 (goto-char (point-min))
3469 (insert prefix)
3470 (if index (insert (format fmt index)))
3471 (insert postfix)
3481 (char-to-string
3482 (+ (string-to-char (substring prefix len-1)) increment)))))))
3528 ;; insert the remaining area while appending blank lines below it
3529 (table--insert-rectangle
3542 (looking-at (regexp-quote (char-to-string table-cell-vertical-char))))
3544 (looking-at (regexp-quote (char-to-string table-cell-vertical-char))))))
3546 (delete-char 1)
3547 (insert table-cell-intersection-char))
3548 (delete-char 1)
3549 (insert (string-to-char table-cell-horizontal-chars)))
3597 (delete-char 1)
3598 (insert table-cell-intersection-char))
3599 (delete-char 1)
3600 (insert table-cell-vertical-char))
3645 In case the function is called interactively user must use \\[quoted-insert] `quoted-insert'
3723 (error "Can't insert a table inside a table"))
3764 (insert contents)
3766 (goto-char (point-max))
3768 (insert ?\n))
3770 (goto-char (point-min))
3772 (goto-char (match-end 0)))
3822 (goto-char beg)
3824 (insert ?\n))
3827 (insert ?\n)))
3828 ;; insert the table
3829 ;; insert the cell contents
3834 (insert contents)
3840 (table-insert cols rows width height)
3842 (insert contents)
3845 (table-insert cols rows min-cell-width 1)
3858 (insert (car cell-list))
3899 (goto-char old-point))))))
3946 (defun *table--cell-self-insert-command ()
3947 "Table cell version of `self-insert-command'."
3949 (let ((char (table--unibyte-char-to-multibyte last-command-char)))
3952 (setq table-cell-self-insert-command-count 0)
3954 (if (>= table-cell-self-insert-command-count 19)
3955 (setq table-cell-self-insert-command-count 0)
3957 (setq table-cell-self-insert-command-count (1+ table-cell-self-insert-command-count))))))
3958 (table--cell-insert-char char overwrite-mode)))
3960 (defun *table--cell-delete-backward-char (n)
3961 "Table cell version of `delete-backward-char'."
3963 (*table--cell-delete-char (- n)))
3970 (insert ?\n)
3987 (insert (make-string n ?\n))
3996 (defun *table--cell-delete-char (n)
3997 "Table cell version of `delete-char'."
4009 (delete-char 1)))
4010 (delete-char -1)
4011 (insert ?\s)
4012 (forward-char -1)))
4022 (delete-char n)
4027 (equal (char-before) table-word-continuation-char)
4028 (delete-char -2))
4045 (backward-char)
4051 (defun *table--cell-quoted-insert (arg)
4052 "Table cell version of `quoted-insert'."
4054 (let ((char (table--unibyte-char-to-multibyte (read-quoted-char))))
4056 (table--cell-insert-char char nil)
4082 specified in the variable `table-word-continuation-char'.
4107 (let ((dabbrev-abbrev-char-regexp (concat "[^"
4108 (char-to-string table-cell-vertical-char)
4109 (char-to-string table-cell-intersection-char)
4118 (let ((dabbrev-abbrev-char-regexp (concat "[^"
4119 (char-to-string table-cell-vertical-char)
4120 (char-to-string table-cell-intersection-char)
4130 (goto-char (posn-point (event-start event)))
4177 (table--insert-rectangle rectangle)
4219 (unless (bolp) (forward-char -1))
4260 (unless (bolp) (forward-char -1))
4276 "Move point to top left corner of the current table and return the char position."
4283 "Move point to top right corner of the current table and return the char position."
4290 "Move point to bottom left corner of the current table and return the char position."
4297 "Move point to bottom right corner of the current table and return the char position."
4355 (defun table--unibyte-char-to-multibyte (char)
4356 "Convert CHAR by `unibyte-char-to-multibyte' when possible and necessary."
4357 ;; This part is take from `quoted-insert'.
4362 (fboundp 'unibyte-char-to-multibyte)
4363 (>= char ?\240)
4364 (<= char ?\377))
4365 (unibyte-char-to-multibyte char)
4366 char))
4372 (narrow-to-region (goto-char beg) end)
4390 (goto-char (point-min))
4399 (goto-char (point-min))
4403 (insert (make-string (/ (- table-cell-info-height content-height) 2) ?\n)))
4405 (insert (make-string (- table-cell-info-height content-height) ?\n))))
4409 (goto-char saved-point)
4429 (let ((frame-char
4431 (list table-cell-intersection-char table-cell-vertical-char))))
4435 ((eq (char-after) table-cell-intersection-char)
4442 (delete-char 1)
4443 (insert-before-markers ?\s))
4444 ((table--cell-horizontal-char-p (char-after))
4446 (delete-char 1)
4447 (insert-before-markers ?\s)
4448 (table--cell-horizontal-char-p (char-after)))))
4449 ((eq (char-after) table-cell-vertical-char)
4451 (delete-char 1)
4452 (insert-before-markers ?\s)
4456 (eq (char-after) table-cell-vertical-char))))))
4457 (memq (char-after) frame-char)))))
4500 (table--insert-rectangle cell-contents)
4502 (goto-char (point-min))
4524 (goto-char (point-min))
4606 (delete-char columns-to-extend))
4608 (insert (make-string columns-to-extend ?\s)))
4620 (delete-char columns-to-extend))
4622 (insert (make-string columns-to-extend ?\s)))
4654 (insert ?\n))
4656 (insert prefix ?\n))
4697 "Return non-nil if it makes sense to insert a row or a column at point."
4728 table-cell-vertical-char
4729 table-cell-intersection-char))))
4823 (defun table--cell-insert-char (char &optional overwrite)
4843 (insert "\n" char)
4845 (insert char)
4847 (delete-char 1)))
4848 (insert char)
4850 (delete-char 1))))
4851 (if (not (eq char ?\s))
4852 (if char (insert char))
4857 (forward-char -2)
4859 (regexp-quote (char-to-string table-word-continuation-char))
4863 (insert char))
4867 (insert (make-string (forward-line 1) ?\n))
4868 (unless (bolp) (insert ?\n))))
4878 (goto-char o-point)
4884 (insert ?\n)))))))))
4898 (goto-char (point-min))
4909 (goto-char (point-min))
4914 (goto-char (match-beginning 0))
4955 (goto-char (car cell))
5049 (goto-char location)
5057 (let ((cell-beg (progn (goto-char beg) (table--probe-cell))))
5059 (equal cell-beg (progn (goto-char end) (table--probe-cell))))))))
5075 (let ((vertical-str (regexp-quote (char-to-string table-cell-vertical-char)))
5076 (intersection-str (regexp-quote (char-to-string table-cell-intersection-char)))
5077 (v-border (format "[%c%c]" table-cell-vertical-char table-cell-intersection-char))
5078 (h-border (format "[%s%c]" table-cell-horizontal-chars table-cell-intersection-char))
5101 (forward-char 1)
5113 (let ((vertical-str (regexp-quote (char-to-string table-cell-vertical-char)))
5114 (intersection-str (regexp-quote (char-to-string table-cell-intersection-char)))
5115 (v-border (format "[%c%c]" table-cell-vertical-char table-cell-intersection-char))
5116 (h-border (format "[%s%c]" table-cell-horizontal-chars table-cell-intersection-char))
5124 (forward-char -1)
5135 ((save-excursion (forward-char -1) (looking-at (concat h-border intersection-str)))
5141 (forward-char 1)
5167 table-cell-vertical-char
5168 table-cell-intersection-char)))
5205 (defun table--insert-rectangle (rectangle)
5207 Same as insert-rectangle except that mark operation is eliminated."
5215 (or (bolp) (insert ?\n))
5218 (insert (car lines))
5413 (goto-char beg)
5446 (goto-char marker-point)
5454 chopped location is indicated with table-word-continuation-char."
5460 (goto-char beg)
5462 (format "[^%c ]\\(" table-word-continuation-char)
5463 (regexp-quote (char-to-string table-word-continuation-char))
5471 (goto-char beg)
5479 (t (forward-char -1)
5480 (insert-before-markers (if (equal (char-before) ?\s) ?\s table-word-continuation-char)
5496 (goto-char (point-min))
5531 (if where (goto-char where))
5538 (if location (goto-char location))
5565 (defun table--char-in-str-at-column (str column)
5579 (setq col (+ col (char-width (aref str idx))))