A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jcs-emacs/jcs-emacs/commit/62039e725e816ad381b6a8d126bb28be22d65101 below:

Record the window starting point · jcs-emacs/jcs-emacs@62039e7 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+7

-8

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+7

-8

lines changed Original file line number Diff line number Diff line change

@@ -152,37 +152,36 @@ ALL-FRAMES."

152 152 153 153

(defvar jcs-window--record-buffer-names nil "Record all windows' buffer.")

154 154

(defvar jcs-window--record-points nil "Record all windows point.")

155 -

(defvar jcs-window--record-first-visible-lines nil

156 -

"Record all windows' first visible line.")

155 +

(defvar jcs-window--record-wstarts nil "Record all windows starting points.")

157 156 158 157

(defun jcs-window-record-once ()

159 158

"Record windows status once."

160 -

(let ((buf-names nil) (pts nil) (f-lns nil))

159 +

(let ((buf-names nil) (pts nil) (wstarts nil))

161 160

;; Record down all the window information with the same buffer opened.

162 161

(jcs-walk-windows

163 162

(lambda ()

164 163

(jcs-push (jcs-buffer-name-or-buffer-file-name) buf-names) ; Record as string!

165 164

(jcs-push (point) pts)

166 -

(jcs-push (jcs-first-visible-line-in-window) f-lns)))

165 +

(jcs-push (window-start) wstarts)))

167 166

(push buf-names jcs-window--record-buffer-names)

168 167

(push pts jcs-window--record-points)

169 -

(push f-lns jcs-window--record-first-visible-lines)))

168 +

(push wstarts jcs-window--record-wstarts)))

170 169 171 170

(defun jcs-window-restore-once ()

172 171

"Restore windows status once."

173 172

(let ((buf-names (pop jcs-window--record-buffer-names))

174 173

(pts (pop jcs-window--record-points))

175 -

(f-lns (pop jcs-window--record-first-visible-lines))

174 +

(wstarts (pop jcs-window--record-wstarts))

176 175

(win-cnt 0))

177 176

;; Restore the window information after, including opening the same buffer.

178 177

(jcs-walk-windows

179 178

(lambda ()

180 179

(let* ((buf-name (nth win-cnt buf-names))

181 180

(current-pt (nth win-cnt pts))

182 -

(current-first-vs-line (nth win-cnt f-lns))

181 +

(current-wstart (nth win-cnt wstarts))

183 182

(actual-buf (jcs-get-buffer-by-path buf-name)))

184 183

(if actual-buf (switch-to-buffer actual-buf) (find-file buf-name))

185 -

(jcs-make-first-visible-line-to current-first-vs-line)

184 +

(set-window-start nil current-wstart)

186 185

(goto-char current-pt)

187 186

(cl-incf win-cnt))))))

188 187

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4