emacs-devel
[Top][All Lists]
Advanced

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

Re: File modes facilities.


From: Richard M. Stallman
Subject: Re: File modes facilities.
Date: Wed, 26 Oct 2005 21:31:07 -0400

    .. and it easily forms the foundation for implementing your
    preferred approach, i.e. include the lisp form directly in the C
    source file like this:

    DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2,
           "(list"
           "  (read-file-name \"File: \")"
           "  (read-number \"Modes: \"))",
           doc: /* Set mode bits of file named FILENAME to MODE (an integer).

That is what I would like to implement.

    My approach also allow aliases to be defined with a different
    interactive spec like this:

    (defalias 'chmod 'set-file-modes
      "Interactive frontend to `set-file-modes'."
      "fFile: \nnModes: ")

I don't like the idea of defining aliases with different interactive
specs, because it distorts the meaning of "alias".  Aliases should be
equivalent to the original function.

It is cleaner if people define that chmod function thus:

    (defun chmod (file mode)
      "Interactive frontend to `set-file-modes'."
      (interactive "fFile: \nnModes: ")
      (set-file-modes file mode))

Defining a new function in this way is better than defining
an alias which isn't really an alias.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]