aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/files.el20
2 files changed, 22 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 8a13d525450..0c561ccc511 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -115,8 +115,8 @@ have been added. They are: 'file-attribute-type',
115'file-attribute-group-id', 'file-attribute-access-time', 115'file-attribute-group-id', 'file-attribute-access-time',
116'file-attribute-modification-time', 116'file-attribute-modification-time',
117'file-attribute-status-change-time', 'file-attribute-size', 117'file-attribute-status-change-time', 'file-attribute-size',
118'file-attribute-modes', 'file-attribute-inode-number', and 118'file-attribute-modes', 'file-attribute-inode-number',
119'file-attribute-device-number'. 119'file-attribute-device-number' and 'file-attribute-collect'.
120 120
121+++ 121+++
122** The new function 'buffer-hash' computes a fast, non-consing hash of 122** The new function 'buffer-hash' computes a fast, non-consing hash of
diff --git a/lisp/files.el b/lisp/files.el
index aad9f751cc4..b93cc79648d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -7225,6 +7225,26 @@ of the form (HIGH MIDDLE . LOW): first the high bits, then the
7225middle 24 bits, and finally the low 16 bits." 7225middle 24 bits, and finally the low 16 bits."
7226 (nth 11 attributes)) 7226 (nth 11 attributes))
7227 7227
7228(defun file-attribute-collect (attributes &rest attr-names)
7229 "Return a sublist of ATTRIBUTES returned by `file-attributes'.
7230ATTR-NAMES are symbols with the selected attribute names.
7231
7232Valid attribute names are: type, link-number, user-id, group-id,
7233access-time, modification-time, status-change-time, size, modes,
7234inode-number and device-number."
7235 (let ((all '(type link-number user-id group-id access-time
7236 modification-time status-change-time
7237 size modes inode-number device-number))
7238 result)
7239 (while attr-names
7240 (let ((attr (pop attr-names)))
7241 (if (memq attr all)
7242 (push (funcall
7243 (intern (format "file-attribute-%s" (symbol-name attr)))
7244 attributes)
7245 result)
7246 (error "Wrong attribute name '%S'" attr))))
7247 (nreverse result)))
7228 7248
7229(define-key ctl-x-map "\C-f" 'find-file) 7249(define-key ctl-x-map "\C-f" 'find-file)
7230(define-key ctl-x-map "\C-r" 'find-file-read-only) 7250(define-key ctl-x-map "\C-r" 'find-file-read-only)