From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#23781: 25.0.95; read-string with HIST lexically bound Date: Fri, 17 Jun 2016 14:19:02 +0900 Message-ID: <6bd7ad5e-7319-5f07-4612-26cda5621291@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1466140828 15228 80.91.229.3 (17 Jun 2016 05:20:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 17 Jun 2016 05:20:28 +0000 (UTC) To: 23781@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 17 07:20:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bDmCW-0004NI-F7 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 07:20:16 +0200 Original-Received: from localhost ([::1]:53924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmCS-0004rc-D9 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 Jun 2016 01:20:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmCM-0004pB-It for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:20:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDmCI-0000cd-Bl for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:20:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmCI-0000cY-8N for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bDmCH-0005dE-VG for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 Jun 2016 05:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 23781 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.146614076121584 (code B ref -1); Fri, 17 Jun 2016 05:20:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jun 2016 05:19:21 +0000 Original-Received: from localhost ([127.0.0.1]:43751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDmBc-0005c3-MV for submit@debbugs.gnu.org; Fri, 17 Jun 2016 01:19:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDmBb-0005br-BZ for submit@debbugs.gnu.org; Fri, 17 Jun 2016 01:19:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDmBU-0000Uy-VF for submit@debbugs.gnu.org; Fri, 17 Jun 2016 01:19:14 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:33837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmBU-0000Ud-SC for submit@debbugs.gnu.org; Fri, 17 Jun 2016 01:19:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmBS-0004M4-6y for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:19:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDmBN-0000Tk-TK for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:19:09 -0400 Original-Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:33910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDmBN-0000Tc-J1 for bug-gnu-emacs@gnu.org; Fri, 17 Jun 2016 01:19:05 -0400 Original-Received: by mail-pf0-x231.google.com with SMTP id h14so11915039pfe.1 for ; Thu, 16 Jun 2016 22:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=HX03r2HJtkRKSQ+3/8jdzM+d/GZs/lCWjkn0Eyqv/z4=; b=qD6tF7TP+KIu0Aw8ratvMkYcGacIafGZxyWEOy4z0QMW5Px9UaKno4fstwEcEwEYz/ TkN8AMQzbCBnltZM9AqjovMcgY7vawV1Acco1wSklSncizlbFG+Obt+n6q0wMFcjz8Ln 2fYnlDeoj66HMocBkm1jWpFmwMESuHqBKQSdRTm+/R1uQNAOWv5U8WwIzwnbo5qDmbJq 3hsfsZf8i1hurx0NX8wBdL6K9zkzgG0rBHomkd46KIriI2f5oO6urb6JnBxIxNlxn4cu k/9T024cEB7oUx7OQOf1j68SXB7VlQ7mzt9bCNt1VlH7NB+Jh5iei4tsChQsEGGNtqxz wFoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=HX03r2HJtkRKSQ+3/8jdzM+d/GZs/lCWjkn0Eyqv/z4=; b=Vz122GSGiFvdr9JuSeIM+GrSdDavqTgoblfty/Q4/3DPZ4ZmWfcqt0a8nHefQ9kLDB 8OagSySMb8vfNPmNR6BpfeajO7OsPF1HFz2wqDq9bK1ZUOCwoeIQaDD9bSZr81COIoz9 xWRF94Jh6mPCCCcAtyxDs/G2wq0+tN4Uc/leAHI5tktEF6iSxBmg+ynhij0NNvSjMvUe KUMo7xvfUZtI8q1NZBKVosFVaOvFWNrI28wjuDhPB8trf/SpaDOULnYDnfW1h9muv1Ay BTijVjUEynxRI4mufZOU7zIWFK8a76ADCSAOhqbeekhrscN+QSt2YDsPD90+JWBnQQVY dDFw== X-Gm-Message-State: ALyK8tIhekgNo3UCGg4QwIUv+KYlc/ulzLxNNKHKwQ/dht3qOk9FjdIDhOPfVxQD1Gh9ow== X-Received: by 10.98.193.65 with SMTP id i62mr332919pfg.78.1466140744479; Thu, 16 Jun 2016 22:19:04 -0700 (PDT) Original-Received: from [192.168.1.51] (softbank126075177055.bbtec.net. [126.75.177.55]) by smtp.gmail.com with ESMTPSA id b67sm13372766pfg.85.2016.06.16.22.19.03 for (version=TLSv1/SSLv3 cipher=OTHER); Thu, 16 Jun 2016 22:19:04 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119652 Archived-At: Hello, recently i have noticed that arg HIST in read-from-minibuffer/read-string needs to be dynamically bound. If the file has the local variable lexical-binding non-nil those functions just pick up one element of HIST. In case this is a feature, it would be worth to mention it on the manual. Following example reproduce the issue: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; I) Create two files 'test-dynamic.el', 'test-lexical.el' as follows: *) test-dynamic.el: (defun my-test-dynamic () "Test of dynamic-binding." (interactive) (let ((values '("a" "b" "c"))) (read-string "dynamic: " (car values) '(values . 1)))) *) test-lexical.el: ;; -*- lexical-binding: t; -*- (defvar my-test-var nil) (defun my-test-lexical-defvar () "Test of lexical-binding with defvar." (interactive) (let ((values '("a" "b" "c"))) (setq my-test-var values)) (read-string "lexical-defvar: " (car my-test-var) '(my-test-var . 1))) (defun my-test-lexical () "Test of lexical-binding." (interactive) (let ((values '("a" "b" "c"))) (read-string "lexical: " (car values) '(values . 1)))) II) emacs -Q -l test-dynamic.el -l test-lexical.el II.1) M-x my-test-dynamic RET ;; minibuffer shows: dynamic: a M-p ;; minibuffer shows: dynamic: b M-p ;; minibuffer shows: dynamic: c II.2) (Similar than II.1) M-x my-test-lexical-defvar RET ;; minibuffer shows: lexical-defvar: a M-p ;; minibuffer shows: lexical-defvar: b M-p ;; minibuffer shows: lexical-defvar: c II.3) (Different) M-x my-test-lexical RET ;; minibuffer shows: lexical: a M-p ;; user-error: Beginning of history; no preceding item ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; In GNU Emacs 25.0.95.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6) of 2016-06-15 built on calancha-pc Repository revision: d7084f2260943287cdfb5e3021ac33aab6a14c6d Windowing system distributor 'The X.Org Foundation', version 11.0.11803000 System Description: Debian GNU/Linux testing (stretch) Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Quit [2 times] user-error: Beginning of history; no preceding item [2 times] Quit Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode easymenu cl-loaddefs pcase cl-lib mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 86343 6478) (symbols 48 19751 0) (miscs 40 38 121) (strings 32 14375 4876) (string-bytes 1 409631) (vectors 16 11718) (vector-slots 8 428578 4129) (floats 8 164 84) (intervals 56 193 0) (buffers 976 11) (heap 1024 28246 991))