Source of Nothingness - directory)

* Menu

[[About:self:AboutPage.txt]] | [[Profile:http://iddy.jp/profile/southly/]] | [[まとめ:self:1163859357.txt]] | [[オリジナル:http://ninjinix.x0.com/rn/]] | [[xyzzy:http://raido.sakura.ne.jp/southly/xyzzy/site-lisp/]] | [[あんてな:http://i-know.jp/southly/listall]] | [[■:http://raido.sakura.ne.jp/southly/lisp/ni/view.lisp]] | [[buzz:http://www.google.com/profiles/southly#buzz]]

* 2010-02-28 :

; #<PACKAGE "ASDF1">
; registering #<SYSTEM SB-GROVEL {B4F1921}> as SB-GROVEL
;
; compilation unit aborted
;   caught 1 fatal ERROR condition

Error running init-common-lisp-controller-v4: Lock on package SB-IMPL violated
                                              when interning NATIVE-FILE-KIND.
See also:
  The SBCL Manual, Node "Package Locks"

--- /usr/share/common-lisp/source/common-lisp-controller/post-sysdef-install.lisp~      2010-02-28 17:58:19.000000000 +0900
+++ /usr/share/common-lisp/source/common-lisp-controller/post-sysdef-install.lisp       2010-02-28 18:01:36.000000000 +0900
@@ -61,7 +61,7 @@
 #+sbcl
 (defun get-owner-and-mode (directory)
   (when (eq :directory
-           (sb-impl::native-file-kind (namestring directory)))
+           (sb-unix::unix-file-kind (namestring directory)))
     ;; check who owns it
     (multiple-value-bind (res dev ino mode nlink uid gid rdev size atime mtime)
        (sb-unix:unix-stat (namestring directory))
で、以下を実行。
$ sudo dpkg-reconfigure common-lisp-controller

* xyzzy : gtags.l

たかだか3つの関数のためにemacs.lに依存するのはもったいないと思ったので、てきとーに実装してみました。
GPLなんですしemacs.lからもってくるのもありかと。
マイナーモードにする関数はed::toggle-modeを使いましょう。それでelisp::prefix-numeric-valueは不要になります。

(defun count-line(beg end)
  (if (eql beg end)
      0
    (1+ (- (save-excursion
             (goto-char end)
             (when (eql (preceding-char) #\LFD) (backward-char))
             (current-line-number))
           (save-excursion
             (goto-char beg)
             (current-line-number))))))

(defun expand-file-name (file &optional (dir (default-directory)))
  (merge-pathnames file dir))

[[(ReadMore...) index.rb?1196394719.txt]]

* xyzzy lisp : ディレクトリ付きにしてユニークなバッファ名に

機能的にはさんと同等。
ひとつ上のディレクトリでやめてしまうみたいだから自分で書いてみた。
(defun buffer-name-with-directory ()
  (let* ((buffer (selected-buffer))
         (name (buffer-name buffer))
         dirs)
    (when (string-match "<[0-9]+>" name)
      (setq dirs (reverse (pathname-directory (get-buffer-file-name buffer))))
      (setq name (format nil "~A/~A" (pop dirs) (file-namestring (get-buffer-file-name buffer))))
      (while (and dirs (dolist (x (buffer-list))
                         (if (string= (buffer-name x) name)
                             (return t))))
        (setq name (format nil "~A/~A" (pop dirs) name)))
      (rename-buffer (abbreviate-display-string name 40) buffer))))
(add-hook '*find-file-hooks* 'buffer-name-with-directory)