org-list: Remove radio lists
* lisp/org-list.el (org-list-radio-list-templates): Remove variable. (org-list-insert-radio-list): (org-list-send-list): Remove functions. * contrib/manual.org: Remove references to radio lists.
This commit is contained in:
parent
2b96b08eaf
commit
87eb9ab4e9
|
@ -15683,10 +15683,10 @@ a map of files for a given project.
|
|||
Plug-in function to use for generation of the sitemap. It is
|
||||
called with two arguments: the title of the site-map and
|
||||
a representation of the files and directories involved in the
|
||||
project as a radio list (see [[*Radio lists]]). The latter can
|
||||
further be transformed using ~org-list-to-generic~,
|
||||
~org-list-to-subtree~ and alike. Default value generates a plain
|
||||
list of links to all files in the project.
|
||||
project as a nested list, which can further be transformed using
|
||||
~org-list-to-generic~, ~org-list-to-subtree~ and alike. Default
|
||||
value generates a plain list of links to all files in the
|
||||
project.
|
||||
|
||||
- ~:sitemap-sort-folders~ ::
|
||||
|
||||
|
@ -19486,49 +19486,6 @@ list consisting of parameters specified in the =#+ORGTBL: SEND= line.
|
|||
Please share your translator functions by posting them to the Org
|
||||
users mailing list, at mailto:emacs-orgmode@gnu.org.
|
||||
|
||||
*** Radio lists
|
||||
:PROPERTIES:
|
||||
:DESCRIPTION: Sending and receiving lists.
|
||||
:END:
|
||||
#+cindex: radio lists
|
||||
|
||||
#+findex: org-list-insert-radio-list
|
||||
Call the ~org-list-insert-radio-list~ function to insert a radio list
|
||||
template in HTML, LaTeX, and Texinfo mode documents. Sending and
|
||||
receiving radio lists works is the same as for radio tables (see
|
||||
[[*Radio tables]]) except for these differences:
|
||||
|
||||
#+cindex: ORGLST, keyword
|
||||
- Orgstruct mode must be active.
|
||||
- Use the =ORGLST= keyword instead of =ORGTBL=.
|
||||
- {{{kbd(C-c C-c)}}} works only on the first list item.
|
||||
|
||||
#+findex: org-list-to-latex
|
||||
#+findex: org-list-to-html
|
||||
#+findex: org-list-to-texinfo
|
||||
#+findex: org-list-to-generic
|
||||
Built-in translator functions are: ~org-list-to-latex~,
|
||||
~org-list-to-html~ and ~org-list-to-texinfo~. They use the
|
||||
~org-list-to-generic~ translator function. See its documentation for
|
||||
parameters for accurate customizations of lists. Here is a LaTeX
|
||||
example:
|
||||
|
||||
#+begin_example
|
||||
% BEGIN RECEIVE ORGLST to-buy
|
||||
% END RECEIVE ORGLST to-buy
|
||||
\begin{comment}
|
||||
,#+ORGLST: SEND to-buy org-list-to-latex
|
||||
- a new house
|
||||
- a new computer
|
||||
+ a new keyboard
|
||||
+ a new mouse
|
||||
- a new life
|
||||
\end{comment}
|
||||
#+end_example
|
||||
|
||||
{{{kbd(C-c C-c)}}} on =a new house= inserts the translated LaTeX list
|
||||
in-between the =BEGIN= and =END= marker lines.
|
||||
|
||||
** Dynamic blocks
|
||||
:PROPERTIES:
|
||||
:DESCRIPTION: Automatically filled blocks.
|
||||
|
|
|
@ -357,33 +357,6 @@ clearly distinguish sub-items in a list."
|
|||
:version "24.1"
|
||||
:type 'integer)
|
||||
|
||||
(defcustom org-list-radio-list-templates
|
||||
'((latex-mode "% BEGIN RECEIVE ORGLST %n
|
||||
% END RECEIVE ORGLST %n
|
||||
\\begin{comment}
|
||||
#+ORGLST: SEND %n org-list-to-latex
|
||||
-
|
||||
\\end{comment}\n")
|
||||
(texinfo-mode "@c BEGIN RECEIVE ORGLST %n
|
||||
@c END RECEIVE ORGLST %n
|
||||
@ignore
|
||||
#+ORGLST: SEND %n org-list-to-texinfo
|
||||
-
|
||||
@end ignore\n")
|
||||
(html-mode "<!-- BEGIN RECEIVE ORGLST %n -->
|
||||
<!-- END RECEIVE ORGLST %n -->
|
||||
<!--
|
||||
#+ORGLST: SEND %n org-list-to-html
|
||||
-
|
||||
-->\n"))
|
||||
"Templates for radio lists in different major modes.
|
||||
All occurrences of %n in a template will be replaced with the name of the
|
||||
list, obtained by prompting the user."
|
||||
:group 'org-plain-lists
|
||||
:type '(repeat
|
||||
(list (symbol :tag "Major mode")
|
||||
(string :tag "Format"))))
|
||||
|
||||
(defvar org-list-forbidden-blocks '("example" "verse" "src" "export")
|
||||
"Names of blocks where lists are not allowed.
|
||||
Names must be in lower case.")
|
||||
|
@ -3208,76 +3181,6 @@ Point is left at list's end."
|
|||
(let ((list (save-excursion (org-list-to-lisp t))))
|
||||
(insert (org-list-to-subtree list)))))
|
||||
|
||||
(defun org-list-insert-radio-list ()
|
||||
"Insert a radio list template appropriate for this major mode."
|
||||
(interactive)
|
||||
(let* ((e (cl-assoc-if #'derived-mode-p org-list-radio-list-templates))
|
||||
(txt (nth 1 e))
|
||||
name pos)
|
||||
(unless e (error "No radio list setup defined for %s" major-mode))
|
||||
(setq name (read-string "List name: "))
|
||||
(while (string-match "%n" txt)
|
||||
(setq txt (replace-match name t t txt)))
|
||||
(or (bolp) (insert "\n"))
|
||||
(setq pos (point))
|
||||
(insert txt)
|
||||
(goto-char pos)))
|
||||
|
||||
(defun org-list-send-list (&optional maybe)
|
||||
"Send a transformed version of this list to the receiver position.
|
||||
With argument MAYBE, fail quietly if no transformation is defined
|
||||
for this list."
|
||||
(interactive)
|
||||
(catch 'exit
|
||||
(unless (org-at-item-p) (error "Not at a list item"))
|
||||
(save-excursion
|
||||
(let ((case-fold-search t))
|
||||
(re-search-backward "^[ \t]*#\\+ORGLST:" nil t)
|
||||
(unless (looking-at
|
||||
"[ \t]*#\\+ORGLST:[ \t]+SEND[ \t]+\\(\\S-+\\)[ \t]+\\([^ \t\n]+\\)")
|
||||
(if maybe (throw 'exit nil)
|
||||
(error "Don't know how to transform this list")))))
|
||||
(let* ((name (regexp-quote (match-string 1)))
|
||||
(transform (intern (match-string 2)))
|
||||
(bottom-point
|
||||
(save-excursion
|
||||
(re-search-forward
|
||||
"\\(\\\\end{comment}\\|@end ignore\\|-->\\)" nil t)
|
||||
(match-beginning 0)))
|
||||
(top-point
|
||||
(progn
|
||||
(re-search-backward "#\\+ORGLST" nil t)
|
||||
(re-search-forward (org-item-beginning-re) bottom-point t)
|
||||
(match-beginning 0)))
|
||||
(plain-list (save-excursion
|
||||
(goto-char top-point)
|
||||
(org-list-to-lisp))))
|
||||
(unless (fboundp transform)
|
||||
(error "No such transformation function %s" transform))
|
||||
(let ((txt (funcall transform plain-list)))
|
||||
;; Find the insertion(s) place(s).
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(let ((receiver-count 0)
|
||||
(begin-re (format "BEGIN +RECEIVE +ORGLST +%s\\([ \t]\\|$\\)"
|
||||
name))
|
||||
(end-re (format "END +RECEIVE +ORGLST +%s\\([ \t]\\|$\\)"
|
||||
name)))
|
||||
(while (re-search-forward begin-re nil t)
|
||||
(cl-incf receiver-count)
|
||||
(let ((beg (line-beginning-position 2)))
|
||||
(unless (re-search-forward end-re nil t)
|
||||
(user-error "Cannot find end of receiver location at %d" beg))
|
||||
(beginning-of-line)
|
||||
(delete-region beg (point))
|
||||
(insert txt "\n")))
|
||||
(cond
|
||||
((> receiver-count 1)
|
||||
(message "List converted and installed at receiver locations"))
|
||||
((= receiver-count 1)
|
||||
(message "List converted and installed at receiver location"))
|
||||
(t (user-error "No valid receiver location found")))))))))
|
||||
|
||||
(defun org-list-to-generic (list params)
|
||||
"Convert a LIST parsed through `org-list-to-lisp' to a custom format.
|
||||
|
||||
|
|
Loading…
Reference in New Issue