Skip to main content
deleted 15 characters in body
Source Link
Pablo
  • 369
  • 2
  • 8

[edited (again) to add:] CodeThe amended to reflectcode below works (taken from phils's suggestions in the answer below).

[edited (again) to add:] Code amended to reflect phils's suggestions in the answer below.

[edited to add:] The amended code below works (taken from phils's answer).

deleted 1 character in body
Source Link
Pablo
  • 369
  • 2
  • 8

[edit[edited (again) to add:] Code amended to reflect phils's suggestions in the answer below.

(defun switch-to-most-recent-buffer-in-mode (mode) (interactive "C") (let (found) (catch 'done (mapc (lambda (x) (when (with-current-buffer x (eq major-mode 'modemode)) (switch-to-buffer x) (setq found t) (throw 'done nil))) (buffer-list)) (unless found (message "not found"))))) 

[edit to add:] Code amended to reflect phils's suggestions in the answer below.

(defun switch-to-most-recent-buffer-in-mode (mode) (interactive "C") (let (found) (catch 'done (mapc (lambda (x) (when (with-current-buffer x (eq major-mode 'mode)) (switch-to-buffer x) (setq found t) (throw 'done nil))) (buffer-list)) (unless found (message "not found"))))) 

[edited (again) to add:] Code amended to reflect phils's suggestions in the answer below.

(defun switch-to-most-recent-buffer-in-mode (mode) (interactive "C") (let (found) (catch 'done (mapc (lambda (x) (when (with-current-buffer x (eq major-mode mode)) (switch-to-buffer x) (setq found t) (throw 'done nil))) (buffer-list)) (unless found (message "not found"))))) 
added 480 characters in body
Source Link
Pablo
  • 369
  • 2
  • 8

--

[edit to add:] Code amended to reflect phils's suggestions in the answer below.

(defun switch-to-most-recent-buffer-in-mode (mode) (interactive "C") (let (found) (catch 'done (mapc (lambda (x) (when (with-current-buffer x (eq major-mode 'mode)) (switch-to-buffer x) (setq found t) (throw 'done nil))) (buffer-list)) (unless found (message "not found"))))) 

--

[edit to add:] Code amended to reflect phils's suggestions in the answer below.

(defun switch-to-most-recent-buffer-in-mode (mode) (interactive "C") (let (found) (catch 'done (mapc (lambda (x) (when (with-current-buffer x (eq major-mode 'mode)) (switch-to-buffer x) (setq found t) (throw 'done nil))) (buffer-list)) (unless found (message "not found"))))) 
Add the modified function
Source Link
phils
  • 55k
  • 3
  • 90
  • 134
Loading
deleted 4 characters in body
Source Link
Pablo
  • 369
  • 2
  • 8
Loading
edited tags
Link
Drew
  • 80.9k
  • 10
  • 125
  • 265
Loading
Source Link
Pablo
  • 369
  • 2
  • 8
Loading