summaryrefslogtreecommitdiff
path: root/lisp/mh-e/mh-thread.el
diff options
context:
space:
mode:
authorStephen Gildea <stepheng+emacs@gildea.com>2021-11-13 07:00:30 -0800
committerStephen Gildea <stepheng+emacs@gildea.com>2021-11-13 07:04:13 -0800
commit4df334a0f74700e72bfea7817e660605c3f2a2ee (patch)
tree04701661f2e58c65b2071aaf6558afdcd56a16a7 /lisp/mh-e/mh-thread.el
parentd3666ccdba7c3837ffffe3c50a179c110ed55569 (diff)
downloademacs-4df334a0f74700e72bfea7817e660605c3f2a2ee.tar.gz
MH-E threads code: use mh-scan variables correctly
* lisp/mh-e/mh-thread.el (mh-thread-current-indentation-level) (mh-thread-find-children): Fix off-by-one error by using 'mh-scan-field-from-start-offset' directly, as 'mh-thread-parse-scan-line' does. Previously, these functions would incorrectly consider the "date note" column as part of the thread indenting. Since that column is almost always a Space character, that almost always worked. (mh-thread-ancestor): Update caller. * test/lisp/mh-e/mh-thread-tests.el: New unit tests for affected code. * lisp/mh-e/mh-scan.el (mh-msg-num-width-to-column): Fix doc string typo.
Diffstat (limited to 'lisp/mh-e/mh-thread.el')
-rw-r--r--lisp/mh-e/mh-thread.el10
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/mh-e/mh-thread.el b/lisp/mh-e/mh-thread.el
index 21954da6acd..1be2185ecdf 100644
--- a/lisp/mh-e/mh-thread.el
+++ b/lisp/mh-e/mh-thread.el
@@ -139,7 +139,7 @@ to the message that started everything."
(cond (thread-root-flag
(while (mh-thread-immediate-ancestor))
(mh-maybe-show))
- ((equal current-level 1)
+ ((equal current-level 0)
(message "Message has no ancestor"))
(t (mh-thread-immediate-ancestor)
(mh-maybe-show)))))
@@ -242,8 +242,8 @@ sibling."
(defun mh-thread-current-indentation-level ()
"Find the number of spaces by which current message is indented."
(save-excursion
- (let ((address-start-offset (+ mh-cmd-note mh-scan-date-flag-width
- mh-scan-date-width 1))
+ (let ((address-start-offset (+ mh-cmd-note
+ mh-scan-field-from-start-offset))
(level 0))
(beginning-of-line)
(forward-char address-start-offset)
@@ -275,8 +275,8 @@ at the end."
(beginning-of-line)
(if (eobp)
nil
- (let ((address-start-offset (+ mh-cmd-note mh-scan-date-flag-width
- mh-scan-date-width 1))
+ (let ((address-start-offset (+ mh-cmd-note
+ mh-scan-field-from-start-offset))
(level (mh-thread-current-indentation-level))
spaces begin)
(setq begin (point))