aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-04-11 09:07:16 -0700
committerPaul Eggert2016-04-11 09:07:16 -0700
commitd1e2b10afa2df313e029b3faeeb0d694fd6e0fbc (patch)
tree8584e88dc40f4617ead97664b3732d041c21982d
parent7b45cc583c4f16cc070a9925431ca944f510a685 (diff)
parent96d9e78bd40edff9c901eee1c95ea56d93b55acb (diff)
downloademacs-d1e2b10afa2df313e029b3faeeb0d694fd6e0fbc.tar.gz
emacs-d1e2b10afa2df313e029b3faeeb0d694fd6e0fbc.zip
Merge from origin/emacs-25
96d9e78 Fix "Beginning of buffer" error in forward-page 20686f7 Add a `transient' project type
-rw-r--r--lisp/progmodes/project.el10
-rw-r--r--lisp/textmodes/page.el13
2 files changed, 15 insertions, 8 deletions
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 1251bca2491..9c8a88c80fc 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -101,7 +101,9 @@ that it is not applicable, or a project instance.")
101(defun project-current (&optional maybe-prompt dir) 101(defun project-current (&optional maybe-prompt dir)
102 "Return the project instance in DIR or `default-directory'. 102 "Return the project instance in DIR or `default-directory'.
103When no project found in DIR, and MAYBE-PROMPT is non-nil, ask 103When no project found in DIR, and MAYBE-PROMPT is non-nil, ask
104the user for a different directory to look in." 104the user for a different directory to look in. If that directory
105is not a part of a detectable project either, return a
106`transient' project instance rooted in it."
105 (unless dir (setq dir default-directory)) 107 (unless dir (setq dir default-directory))
106 (let ((pr (project--find-in-directory dir))) 108 (let ((pr (project--find-in-directory dir)))
107 (cond 109 (cond
@@ -110,7 +112,8 @@ the user for a different directory to look in."
110 (setq dir (read-directory-name "Choose the project directory: " dir nil t) 112 (setq dir (read-directory-name "Choose the project directory: " dir nil t)
111 pr (project--find-in-directory dir)) 113 pr (project--find-in-directory dir))
112 (unless pr 114 (unless pr
113 (user-error "No project found in `%s'" dir)))) 115 (message "Using '%s' as a transient project root" dir)
116 (setq pr (cons 'transient dir)))))
114 pr)) 117 pr))
115 118
116(defun project--find-in-directory (dir) 119(defun project--find-in-directory (dir)
@@ -182,6 +185,9 @@ to find the list of ignores for each directory."
182 (t 185 (t
183 (complete-with-action action all-files string pred)))))) 186 (complete-with-action action all-files string pred))))))
184 187
188(cl-defmethod project-roots ((project (head transient)))
189 (list (cdr project)))
190
185(defgroup project-vc nil 191(defgroup project-vc nil
186 "Project implementation using the VC package." 192 "Project implementation using the VC package."
187 :version "25.1" 193 :version "25.1"
diff --git a/lisp/textmodes/page.el b/lisp/textmodes/page.el
index 17fda677754..22c73591b91 100644
--- a/lisp/textmodes/page.el
+++ b/lisp/textmodes/page.el
@@ -48,12 +48,13 @@ A page boundary is any line whose beginning matches the regexp
48 (and (save-excursion (re-search-backward page-delimiter nil t)) 48 (and (save-excursion (re-search-backward page-delimiter nil t))
49 (= (match-end 0) (point)) 49 (= (match-end 0) (point))
50 (goto-char (match-beginning 0))) 50 (goto-char (match-beginning 0)))
51 (forward-char -1) 51 (unless (bobp)
52 (if (re-search-backward page-delimiter nil t) 52 (forward-char -1)
53 ;; We found one--move to the end of it. 53 (if (re-search-backward page-delimiter nil t)
54 (goto-char (match-end 0)) 54 ;; We found one--move to the end of it.
55 ;; We found nothing--go to beg of buffer. 55 (goto-char (match-end 0))
56 (goto-char (point-min))) 56 ;; We found nothing--go to beg of buffer.
57 (goto-char (point-min))))
57 (setq count (1+ count)))) 58 (setq count (1+ count))))
58 59
59(defun backward-page (&optional count) 60(defun backward-page (&optional count)