Ticket #1854 (closed defect: fixed)

Opened 5 years ago

Last modified 3 years ago

No intuitive way to undo 'l' ("limit") command

Reported by: zinie@… Owned by: mutt-dev
Priority: trivial Milestone:
Component: mutt Version: 1.5.5.1+cvs20040105i
Keywords: Cc:

Description

Package: mutt
Version: 1.5.5.1-200401
Severity: wishlist

-- Please type your report below this line

Hello,

Small feature request: when I use the 'l' ("limit") command, there is no
obvious way to "remove the limit".  The only ways I've found so far to restore
the view to all messages are something like "l ~A" or "l .".

It sounds kludgy, as the use goal "remove the limit" does not match the needed
command, which is "set a limit matching everything".

I think a simple solution would be to consider an empty string limit as a
non-limit, so that if I do 'l' and then Enter, I see all my messages again.
That's the first thing I intuitively tried when I wanted to "remove the limit",
I think it makes sense and I've been quite surprised when it didn't work.

Thanks again for the good work!

Bye,

Enrico


-- System Information
System Version: Linux mitac 2.6.5-1-686 #1 Wed Apr 7 00:24:54 EST 2004 i686 GNU/Linux

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
cc
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian 20040401)

- CFLAGS
-Wall -pedantic -g -O2

-- Mutt Version Information

Mutt 1.5.5.1+cvs20040105i (2003-11-05)
Copyright (C) 1996-2002 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.5-1-686 (i686) [using ncurses 5.3] [using libidn 0.4.1 (compiled with 0.3.4)]
Opzioni di compilazione:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK
+USE_POP  +USE_IMAP  +IMAP_EDIT_THREADS  -USE_GSS  -USE_SSL  +USE_GNUTLS  +USE_SASL  +USE_SASL2  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +HAVE_GETADDRINFO  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
Per contattare gli sviluppatori scrivi a <mutt-dev@mutt.org>.
Per segnalare un bug usa il programma flea(1).

patch-1.5.5.1.tt.compat.1-cl
patch-1.5.4.vk.pgp_verbose_mime
patch-1.5.3.rr.compressed.1
patch-1.5.4.helmersson.incomplete_multibyte
patch-1.5.4.fw.maildir_inode_sort
patch-1.3.23.1.ametzler.pgp_good_sign
patch-1.5.3.Md.gpg_status_fd
patch-1.4.Md.gpg-agent
patch-1.5.3.Md.etc_mailname_gethostbyname
patch-1.5.1.cd.edit_threads.9.2
patch-1.3.27.bse.xtitles.1
Md.use_debian_editor
Md.muttbug
patch-1.4.admcd.gnutlsdlopen.53d
patch-1.4.admcd.gnutlsbuild.53d
patch-1.4.admcd.gnutls.56d


>How-To-Repeat:
>Fix:

Change History

Changed 5 years ago by zinie@…

Package: mutt
Version: 1.5.5.1-200401
Severity: wishlist

-- Please type your report below this line

Hello,

Small feature request: when I use the 'l' ("limit") command, there is no
obvious way to "remove the limit".  The only ways I've found so far to restore
the view to all messages are something like "l ~A" or "l .".

It sounds kludgy, as the use goal "remove the limit" does not match the needed
command, which is "set a limit matching everything".

I think a simple solution would be to consider an empty string limit as a
non-limit, so that if I do 'l' and then Enter, I see all my messages again.
That's the first thing I intuitively tried when I wanted to "remove the limit",
I think it makes sense and I've been quite surprised when it didn't work.

Thanks again for the good work!

Bye,

Enrico


-- System Information
System Version: Linux mitac 2.6.5-1-686 #1 Wed Apr 7 00:24:54 EST 2004 i686 GNU/Linux

-- Build environment information

(Note: This is the build environment installed on the system
muttbug is run on.  Information may or may not match the environment
used to build mutt.)

- gcc version information
cc
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.3 (Debian 20040401)

- CFLAGS
-Wall -pedantic -g -O2

-- Mutt Version Information

Mutt 1.5.5.1+cvs20040105i (2003-11-05)
Copyright (C) 1996-2002 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.5-1-686 (i686) [using ncurses 5.3] [using libidn 0.4.1 (compiled with 0.3.4)]
Opzioni di compilazione:
-DOMAIN
-DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK
+USE_POP  +USE_IMAP  +IMAP_EDIT_THREADS  -USE_GSS  -USE_SSL  +USE_GNUTLS  +USE_SASL  +USE_SASL2  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  -BUFFY_SIZE -EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET  +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +HAVE_GETADDRINFO  
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
Per contattare gli sviluppatori scrivi a <mutt-dev@mutt.org>.
Per segnalare un bug usa il programma flea(1).

patch-1.5.5.1.tt.compat.1-cl
patch-1.5.4.vk.pgp_verbose_mime
patch-1.5.3.rr.compressed.1
patch-1.5.4.helmersson.incomplete_multibyte
patch-1.5.4.fw.maildir_inode_sort
patch-1.3.23.1.ametzler.pgp_good_sign
patch-1.5.3.Md.gpg_status_fd
patch-1.4.Md.gpg-agent
patch-1.5.3.Md.etc_mailname_gethostbyname
patch-1.5.1.cd.edit_threads.9.2
patch-1.3.27.bse.xtitles.1
Md.use_debian_editor
Md.muttbug
patch-1.4.admcd.gnutlsdlopen.53d
patch-1.4.admcd.gnutlsbuild.53d
patch-1.4.admcd.gnutls.56d

Changed 5 years ago by TAKAHASHI Tamotsu <ttakah@…>

On Tue, Apr 13, 2004 at 07:48:49PM +0100, zinie@cs.unibo.it wrote:

> Small feature request: when I use the 'l' ("limit") command, there is no
> obvious way to "remove the limit".  The only ways I've found so far to restore
> the view to all messages are something like "l ~A" or "l .".
> 
> It sounds kludgy, as the use goal "remove the limit" does not match the needed
> command, which is "set a limit matching everything".

It seems that ~A removes your previous patterns.
pattern.c:
   else if (mutt_strncmp (buf, "~A", 2) != 0)
   {
     Context->pattern = simple;
     simple = NULL; /* don't clobber it */
     Context->limit_pattern = mutt_pattern_comp (buf, M_FULL_MSG, &err);
   }


> I think a simple solution would be to consider an empty string limit as a
> non-limit, so that if I do 'l' and then Enter, I see all my messages again.
> That's the first thing I intuitively tried when I wanted to "remove the limit",

Me, too.

> I think it makes sense and I've been quite surprised when it didn't work.

Could you (or any developer) write a patch to check whether buf is not '\0'?

-- 
tamo

Changed 5 years ago by TAKAHASHI Tamotsu <ttakah@…>

On Thu, Apr 29, 2004 at 04:13:37PM +0900, TAKAHASHI Tamotsu wrote:

> It seems that ~A removes your previous patterns.
> pattern.c:
>     else if (mutt_strncmp (buf, "~A", 2) != 0)
>     {
>       Context->pattern = simple;
>       simple = NULL; /* don't clobber it */
>       Context->limit_pattern = mutt_pattern_comp (buf, M_FULL_MSG, &err);
>     }
> 
> 
> > I think a simple solution would be to consider an empty string limit as a
> > non-limit, so that if I do 'l' and then Enter, I see all my messages again.
> > That's the first thing I intuitively tried when I wanted to "remove the limit",
> 
> Me, too.
> 
> > I think it makes sense and I've been quite surprised when it didn't work.
> 
> Could you (or any developer) write a patch to check whether buf is not '\0'?

Doesn't this work? I haven't tested yet:

-    else if (mutt_strncmp (buf, "~A", 2) != 0)
+    else if ((mutt_strncmp (buf, "~A", 2) != 0) && (buf[0] != '\0'))

-- 
tamo

Changed 5 years ago by TAKAHASHI Tamotsu <ttakah@…>

At last, I made a patch which really allows me to
unlimit patterns with "<limit>\n"


Index: pattern.c
===================================================================
RCS file: /home/roessler/cvs/mutt/pattern.c,v
retrieving revision 3.11
diff -u -r3.11 pattern.c
--- pattern.c	12 Apr 2004 19:34:45 -0000	3.11
+++ pattern.c	7 May 2004 10:00:47 -0000
@@ -1117,8 +1117,14 @@
  int i;

  strfcpy (buf, NONULL (Context->pattern), sizeof (buf));
-  if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0 || !buf[0])
+  if (mutt_get_field (prompt, buf, sizeof (buf), M_PATTERN | M_CLEAR) != 0)
    return (-1);
+  if (!buf[0]) {
+     if (op == M_LIMIT)
+       strfcpy (buf, "~A", sizeof (buf));
+     else
+       return (-1);
+  }

  mutt_message _("Compiling search pattern...");

Changed 3 years ago by brendan

  • status changed from new to closed
  • resolution set to fixed
Fixed in CVS. Thanks for the patch, Tamo.
Note: See TracTickets for help on using tickets.