363 |
(outline-back-to-heading) |
(outline-back-to-heading) |
364 |
(let* ((head (match-string 0)) |
(let* ((head (match-string 0)) |
365 |
(level (save-match-data (funcall outline-level))) |
(level (save-match-data (funcall outline-level))) |
366 |
(up-head (or (cdr (assoc head outline-level-headings)) |
(up-head (or (cdr (assoc head outline-level-heading)) |
367 |
(cdr (assoc (1- level) outline-level-headings)) |
(cdr (assoc (1- level) outline-level-heading)) |
368 |
(save-excursion |
(save-excursion |
369 |
(save-match-data |
(save-match-data |
370 |
(outline-up-heading 1 t) |
(outline-up-heading 1 t) |
371 |
(match-string 0)))))) |
(match-string 0)))))) |
372 |
|
|
373 |
(unless (assoc level outline-level-headings) |
(unless (assoc level outline-level-heading) |
374 |
(push (cons level head) outline-level-headings)) |
(push (cons level head) outline-level-heading)) |
375 |
|
|
376 |
(replace-match up-head nil t) |
(replace-match up-head nil t) |
377 |
(when children |
(when children |
385 |
(let* ((head (match-string 0)) |
(let* ((head (match-string 0)) |
386 |
(level (save-match-data (funcall outline-level))) |
(level (save-match-data (funcall outline-level))) |
387 |
(down-head |
(down-head |
388 |
(or (let ((x (car (rassoc head outline-level-headings)))) |
(or (let ((x (car (rassoc head outline-level-heading)))) |
389 |
(if (stringp x) x)) |
(if (stringp x) x)) |
390 |
(cdr (assoc (1+ level) outline-level-headings)) |
(cdr (assoc (1+ level) outline-level-heading)) |
391 |
(save-excursion |
(save-excursion |
392 |
(save-match-data |
(save-match-data |
393 |
(while (and (not (eobp)) |
(while (and (not (eobp)) |
412 |
;; Didn't work: keep it as is so it's still a heading. |
;; Didn't work: keep it as is so it's still a heading. |
413 |
head)))))) |
head)))))) |
414 |
|
|
415 |
(unless (assoc level outline-level-headings) |
(unless (assoc level outline-level-heading) |
416 |
(push (cons level head) outline-level-headings)) |
(push (cons level head) outline-level-heading)) |
417 |
|
|
418 |
(replace-match down-head nil t) |
(replace-match down-head nil t) |
419 |
(when children |
(when children |