]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/gnus/gnus-start.el (gnus-group-change-level): Simplify
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 4 Jan 2020 23:07:23 +0000 (18:07 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 4 Jan 2020 23:07:23 +0000 (18:07 -0500)
* lisp/gnus/gnus-group.el (gnus-group-unsubscribe-group): Simplify.

lisp/gnus/gnus-group.el
lisp/gnus/gnus-start.el

index b89f040b43533d86ea4fe5b95115bcc9a98c8bd3..da7db589ec384add91ef7440a76ae158e95ea100 100644 (file)
@@ -3761,10 +3761,10 @@ group line."
      (newsrc
       ;; Toggle subscription flag.
       (gnus-group-change-level
-       newsrc (if level level (if (<= (gnus-info-level (nth 1 newsrc))
-                                     gnus-level-subscribed)
-                                 (1+ gnus-level-subscribed)
-                               gnus-level-default-subscribed)))
+       newsrc (or level (if (<= (gnus-info-level (nth 1 newsrc))
+                               gnus-level-subscribed)
+                           (1+ gnus-level-subscribed)
+                         gnus-level-default-subscribed)))
       (unless silent
        (gnus-group-update-group group)))
      ((and (stringp group)
@@ -3773,7 +3773,7 @@ group line."
       ;; Add new newsgroup.
       (gnus-group-change-level
        group
-       (if level level gnus-level-default-subscribed)
+       (or level gnus-level-default-subscribed)
        (or (and (member group gnus-zombie-list)
                gnus-level-zombie)
           gnus-level-killed)
index 61319266ced5c9392bd44185bf9c454a6e21ffc0..1fd2575ea1f42136331776eac62dbec599dd97c6 100644 (file)
@@ -1256,19 +1256,19 @@ INFO-LIST), otherwise it's a list in the format of the
 `gnus-newsrc-hashtb' entries.  LEVEL is the new level of the
 group, OLDLEVEL is the old level and PREVIOUS is the group (a
 string name) to insert this group before."
-  (let (group info active num)
-    ;; Glean what info we can from the arguments.
-    (if (consp entry)
-       (setq group (if fromkilled (nth 1 entry) (car (nth 1 entry))))
-      (setq group entry))
+  ;; Glean what info we can from the arguments.
+  (let ((group (if (consp entry)
+                  (if fromkilled (nth 1 entry) (car (nth 1 entry)))
+                entry))
+       info active num)
     (when (and (stringp entry)
               oldlevel
               (< oldlevel gnus-level-zombie))
       (setq entry (gnus-group-entry entry)))
-    (if (and (not oldlevel)
-            (consp entry))
-       (setq oldlevel (gnus-info-level (nth 1 entry)))
-      (setq oldlevel (or oldlevel gnus-level-killed)))
+    (setq oldlevel (if (and (not oldlevel)
+                           (consp entry))
+                      (gnus-info-level (nth 1 entry))
+                    (or oldlevel gnus-level-killed)))
 
     ;; This table is used for completion, so put a dummy entry there.
     (unless (gethash group gnus-active-hashtb)