[Date Prev] [Date Index] [Date Next]
[Thread Prev] [Thread Index] [Thread Next]

[xyzzy:08392] Re: buffer-menu-unmark



さっそく対応していただけたようで、どうもです。

なんで buf-menu.l ばっかり見てたかというと、こんなのを書きたかったから
です。

  (defun re-buffer-menu-delete (pattern)
    (interactive "sMark as Delete: ")
    (re-buffer-menu-do pattern #'buffer-menu-delete))

  (defun re-buffer-menu-save (pattern)
    (interactive "sMark as Save: ")
    (re-buffer-menu-do pattern #'buffer-menu-save))

  (defun re-buffer-menu-do (pattern do-what)
    (when (> (length pattern) 0)
      (save-excursion
        (let ((lines (buffer-lines)))
          (goto-line 3)
          (while (< (current-line-number) lines)
            (if (scan-buffer pattern :regexp t :limit (save-excursion (goto-eol) (point)))
                (funcall do-what)
              (forward-line 1)))))))

あとこんなのも。

  (defun buffer-menu-toggle-read-only ()
    (interactive)
    (let (read-only)
      (save-excursion
        (set-buffer (buffer-menu-buffname))
        (setq read-only (toggle-read-only)))
      (goto-column 2)
      (let ((buffer-read-only nil))
        (declare (special buffer-read-only))
        (insert (if read-only #\% #\SPC))
        (delete-char 1))
      (forward-line 1)))

また少し便利になりました。

--
加藤木 洋一
ykatogi@xxxxxxxxxxxxxxxxxxx

Index Home