Function: reftex-index-phrases-set-macro-key

reftex-index-phrases-set-macro-key is an interactive and byte-compiled function defined in reftex-index.el.gz.

Signature

(reftex-index-phrases-set-macro-key)

Documentation

Change the macro key for the current line.

Prompts for a macro key and insert is at the beginning of the line. If you reply with \SPC, the macro key will be removed, so that the default macro will be used. If you reply with \RET, just prints information about the currently selected macro.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-index.el.gz
(defun reftex-index-phrases-set-macro-key ()
  "Change the macro key for the current line.
Prompts for a macro key and insert is at the beginning of the line.
If you reply with \\`SPC', the macro key will be removed, so that the
default macro will be used.  If you reply with \\`RET', just prints
information about the currently selected macro."
  (interactive)
  (reftex-index-phrases-parse-header)
  (save-excursion
    (beginning-of-line)
    (unless (or (looking-at reftex-index-phrases-phrase-regexp12)
                (looking-at "\t"))
      (error "This is not a phrase line"))
    (let* ((nc (reftex-index-select-phrases-macro 0))
           (macro-data (assoc nc reftex-index-phrases-macro-data))
           macro-fmt repeat)
      (cond (macro-data)
            ((equal nc ?\ )
             (setq nc ""
                   macro-data (car reftex-index-phrases-macro-data)))
            ((equal nc ?\C-m)
             (setq nc (char-after (point)))
             (if (equal nc ?\t)
                 (setq nc ""
                       macro-data (car reftex-index-phrases-macro-data))
               (setq macro-data (assoc nc reftex-index-phrases-macro-data))))
            (t (error "No macro associated with %c" nc)))

      (setq macro-fmt (nth 1 macro-data)
            repeat (nth 2 macro-data))
      (if macro-data
          (progn
            (if (looking-at "[^\t]") (delete-char 1))
            (insert nc)
            (message "Line will use %s %s repeat" macro-fmt
                     (if repeat "with" "without")))
        (error "Abort")))))