diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi index 00d5be70eb2..34a5ff5f2c1 100644 --- a/doc/emacs/cmdargs.texi +++ b/doc/emacs/cmdargs.texi @@ -39,7 +39,7 @@ corresponding long form. The long forms with @samp{--} are easier to remember, but longer to type. However, you don't have to spell out the whole option name; any -unambiguous abbreviation is enough. When a long option takes an +unambiguous abbreviation is enough. When a long option requires an argument, you can use either a space or an equal sign to separate the option name and the argument. Thus, for the option @samp{--display}, you can write either @samp{--display sugar-bombs:0.0} or @@ -347,13 +347,15 @@ Start Emacs with minimum customizations. This is similar to using @itemx --bg-daemon[=@var{name}] @itemx --fg-daemon[=@var{name}] Start Emacs as a daemon: after Emacs starts up, it starts the Emacs -server without opening any frames. -(Optionally, you can specify an explicit @var{name} for the server.) -You can then use the @command{emacsclient} command to connect to Emacs -for editing. @xref{Emacs Server}, for information about using Emacs -as a daemon. A ``background'' daemon disconnects from the terminal -and runs in the background (@samp{--daemon} is an alias for -@samp{--bg-daemon}). +server without opening any frames. You can then use the +@command{emacsclient} command to connect to Emacs for editing. +(Optionally, you can specify an explicit @var{name} for the server; if +you do, you will need to specify the same @var{name} when you invoke +@command{emacsclient}, via its @option{--socket-name} option, see +@ref{emacsclient Options}.) @xref{Emacs Server}, for information +about using Emacs as a daemon. A ``background'' daemon disconnects +from the terminal and runs in the background (@samp{--daemon} is an +alias for @samp{--bg-daemon}). @item --no-desktop @opindex --no-desktop diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 5f743927367..8bb603f49fa 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi @@ -1983,6 +1983,9 @@ omitted, @command{emacsclient} connects to the first server it finds. If you set @code{server-name} of the Emacs server to an absolute file name, give the same absolute file name as @var{server-name} to this option to instruct @command{emacsclient} to connect to that server. +You need to use this option if you started Emacs as daemon +(@pxref{Initial Options}) and specified the name for the server +started by the daemon. Alternatively, you can set the @env{EMACS_SOCKET_NAME} environment variable to point to the server socket. (The command-line option diff --git a/etc/NEWS.24 b/etc/NEWS.24 index 9150e49fd92..049005306fd 100644 --- a/etc/NEWS.24 +++ b/etc/NEWS.24 @@ -1117,6 +1117,8 @@ a non-nil `interactive-only' property. The value, if non-nil, is a regexp that specifies what to trim from the start and end of each substring. +** New function `delete-consecutive-dups'. + ** Completion *** The separator used by `completing-read-multiple' is now a regexp. diff --git a/lisp/emacs-lisp/eieio-base.el b/lisp/emacs-lisp/eieio-base.el index 3a0109877e7..7214f8aff72 100644 --- a/lisp/emacs-lisp/eieio-base.el +++ b/lisp/emacs-lisp/eieio-base.el @@ -64,10 +64,18 @@ SLOT-NAME is the offending slot. FN is the function signaling the error." ;; Throw the regular signal. (cl-call-next-method))) -(cl-defmethod clone ((obj eieio-instance-inheritor) &rest _params) +(cl-defmethod clone ((obj eieio-instance-inheritor) &rest params) "Clone OBJ, initializing `:parent' to OBJ. All slots are unbound, except those initialized with PARAMS." - (let ((nobj (cl-call-next-method))) + ;; call next method without params as we makeunbound slots anyhow + (let ((nobj (if (stringp (car params)) + (cl-call-next-method obj (pop params)) + (cl-call-next-method obj)))) + (dolist (descriptor (eieio-class-slots (class-of nobj))) + (let ((slot (eieio-slot-descriptor-name descriptor))) + (slot-makeunbound nobj slot))) + (when params + (shared-initialize nobj params)) (oset nobj parent-instance obj) nobj)) @@ -510,16 +518,18 @@ instance." All slots are unbound, except those initialized with PARAMS." (let* ((newname (and (stringp (car params)) (pop params))) (nobj (apply #'cl-call-next-method obj params)) - (nm (slot-value obj 'object-name))) - (eieio-oset obj 'object-name + (nm (slot-value nobj 'object-name))) + (eieio-oset nobj 'object-name (or newname - (save-match-data - (if (and nm (string-match "-\\([0-9]+\\)" nm)) - (let ((num (1+ (string-to-number - (match-string 1 nm))))) - (concat (substring nm 0 (match-beginning 0)) - "-" (int-to-string num))) - (concat nm "-1"))))) + (if (equal nm (slot-value obj 'object-name)) + (save-match-data + (if (and nm (string-match "-\\([0-9]+\\)" nm)) + (let ((num (1+ (string-to-number + (match-string 1 nm))))) + (concat (substring nm 0 (match-beginning 0)) + "-" (int-to-string num))) + (concat nm "-1"))) + nm))) nobj)) (cl-defmethod make-instance ((class (subclass eieio-named)) &rest args) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index 2d3c140536c..628e8840948 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -2507,8 +2507,8 @@ particular subset of them, and sorting by various criteria. Operations on marked buffers: \\ - `\\[ibuffer-do-save]' - Save the marked buffers - `\\[ibuffer-do-view]' - View the marked buffers in this frame. + `\\[ibuffer-do-save]' - Save the marked buffers. + `\\[ibuffer-do-view]' - View the marked buffers in the selected frame. `\\[ibuffer-do-view-other-frame]' - View the marked buffers in another frame. `\\[ibuffer-do-revert]' - Revert the marked buffers. `\\[ibuffer-do-toggle-read-only]' - Toggle read-only state of marked buffers. @@ -2531,7 +2531,7 @@ Operations on marked buffers: buffer's file as an argument. `\\[ibuffer-do-eval]' - Evaluate a form in each of the marked buffers. This is a very flexible command. For example, if you want to make all - of the marked buffers read only, try using (read-only-mode 1) as + of the marked buffers read-only, try using (read-only-mode 1) as the input form. `\\[ibuffer-do-view-and-eval]' - As above, but view each buffer while the form is evaluated. @@ -2546,21 +2546,20 @@ Marking commands: all unmarked buffers. `\\[ibuffer-change-marks]' - Change the mark used on marked buffers. `\\[ibuffer-unmark-forward]' - Unmark the buffer at point. - `\\[ibuffer-unmark-backward]' - Unmark the buffer at point, and move to the - previous line. + `\\[ibuffer-unmark-backward]' - Unmark the previous buffer. `\\[ibuffer-unmark-all]' - Unmark buffers marked with MARK. `\\[ibuffer-unmark-all-marks]' - Unmark all marked buffers. `\\[ibuffer-mark-by-mode]' - Mark buffers by major mode. `\\[ibuffer-mark-unsaved-buffers]' - Mark all \"unsaved\" buffers. This means that the buffer is modified, and has an associated file. `\\[ibuffer-mark-modified-buffers]' - Mark all modified buffers, - regardless of whether or not they have an associated file. + regardless of whether they have an associated file. `\\[ibuffer-mark-special-buffers]' - Mark all buffers whose name begins and ends with `*'. `\\[ibuffer-mark-dissociated-buffers]' - Mark all buffers which have an associated file, but that file doesn't currently exist. `\\[ibuffer-mark-read-only-buffers]' - Mark all read-only buffers. - `\\[ibuffer-mark-dired-buffers]' - Mark buffers in `dired' mode. + `\\[ibuffer-mark-dired-buffers]' - Mark buffers in `dired-mode'. `\\[ibuffer-mark-help-buffers]' - Mark buffers in `help-mode', `apropos-mode', etc. `\\[ibuffer-mark-old-buffers]' - Mark buffers older than `ibuffer-old-time'. `\\[ibuffer-mark-for-delete]' - Mark the buffer at point for deletion. @@ -2639,17 +2638,17 @@ Other commands: ** Information on Filtering: - You can filter your ibuffer view via different criteria. Each Ibuffer +You can filter your Ibuffer view via different criteria. Each Ibuffer buffer has its own stack of active filters. For example, suppose you are working on an Emacs Lisp project. You can create an Ibuffer -buffer displays buffers in just `emacs-lisp' modes via +buffer displaying only `emacs-lisp-mode' buffers via `\\[ibuffer-filter-by-mode] emacs-lisp-mode RET'. In this case, there is just one entry on the filtering stack. You can also combine filters. The various filtering commands push a new filter onto the stack, and the filters combine to show just buffers which satisfy ALL criteria on the stack. For example, suppose -you only want to see buffers in `emacs-lisp' mode, whose names begin +you only want to see buffers in `emacs-lisp-mode', whose names begin with \"gnus\". You can accomplish this via: \\[ibuffer-filter-by-mode] emacs-lisp-mode RET @@ -2693,8 +2692,8 @@ will not be displayed multiple times if they would be included in multiple filter groups; instead, the first filter group is used. The filter groups are displayed in this order of precedence. -You may rearrange filter groups by using the regular -`\\[ibuffer-kill-line]' and `\\[ibuffer-yank]' pair. Yanked groups +You may rearrange filter groups by using the usual pair +`\\[ibuffer-kill-line]' and `\\[ibuffer-yank]'. Yanked groups will be inserted before the group at point." ;; Include state info next to the mode name. (set (make-local-variable 'mode-line-process) diff --git a/src/lisp.h b/src/lisp.h index 61cc20e9d42..77f23be66b5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2236,7 +2236,7 @@ INLINE int } /* Placeholder for make-docfile to process. The actual symbol - definition is done by lread.c's defsym. */ + definition is done by lread.c's define_symbol. */ #define DEFSYM(sym, name) /* empty */ diff --git a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el index ea6df0f36fc..e6a35c4cd7a 100644 --- a/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el +++ b/test/lisp/emacs-lisp/eieio-tests/eieio-tests.el @@ -696,6 +696,17 @@ Do not override for `prot-2'." (setq eitest-II3 (clone eitest-II2 "eitest-II3 Test.")) (oset eitest-II3 slot3 'penguin) + ;; Test that slots are non-initialized slots are unbounded + (oref eitest-II2 slot1) + (should (slot-boundp eitest-II2 'slot1)) + (should-not (slot-boundp eitest-II2 'slot2)) + (should-not (slot-boundp eitest-II2 'slot3)) + (should-not (slot-boundp eitest-II3 'slot2)) + (should-not (slot-boundp eitest-II3 'slot1)) + (should-not (slot-boundp eitest-II3 'slot2)) + (should (eieio-instance-inheritor-slot-boundp eitest-II3 'slot2)) + (should (slot-boundp eitest-II3 'slot3)) + ;; Test level 1 inheritance (should (eq (oref eitest-II3 slot1) 'moose)) ;; Test level 2 inheritance @@ -862,8 +873,7 @@ Subclasses to override slot attributes.") (should (oref obj1 a-slot)))) (defclass NAMED (eieio-named) - ((some-slot :initform nil) - ) + ((some-slot :initform nil)) "A class inheriting from eieio-named.") (ert-deftest eieio-test-35-named-object () @@ -902,6 +912,48 @@ Subclasses to override slot attributes.") (should (fboundp 'eieio--defalias))) +(ert-deftest eieio-test-38-clone-named-object () + (let* ((A (NAMED :object-name "aa")) + (B (clone A :object-name "bb")) + (C (clone A "cc")) + (D (clone A)) + (E (clone D))) + (should (string= "aa" (oref A object-name))) + (should (string= "bb" (oref B object-name))) + (should (string= "cc" (oref C object-name))) + (should (string= "aa-1" (oref D object-name))) + (should (string= "aa-2" (oref E object-name))))) + +(defclass TII (eieio-instance-inheritor) + ((a :initform 1 :initarg :a) + (b :initarg :b) + (c :initarg :c)) + "Instance Inheritor test class.") + +(ert-deftest eieio-test-39-clone-instance-inheritor-with-args () + (let* ((A (TII)) + (B (clone A :b "bb")) + (C (clone B :a "aa"))) + + (should (string= "aa" (oref C :a))) + (should (string= "bb" (oref C :b))) + + (should (slot-boundp A :a)) + (should-not (slot-boundp A :b)) + (should-not (slot-boundp A :c)) + + (should-not (slot-boundp B :a)) + (should (slot-boundp B :b)) + (should-not (slot-boundp A :c)) + + (should (slot-boundp C :a)) + (should-not (slot-boundp C :b)) + (should-not (slot-boundp C :c)) + + (should (eieio-instance-inheritor-slot-boundp C :a)) + (should (eieio-instance-inheritor-slot-boundp C :b)) + (should-not (eieio-instance-inheritor-slot-boundp C :c)))) + (provide 'eieio-tests)