texts: How to persistently move the cursor in a buffer other than the current one?

texts:
NB: The post How to move point to the end of another buffer, using `with-current-buffer` and `goto-char`? presumably asks the same question as this one, but the answers given to it do not readily apply to my case here.  E.g. those answers involve inserting text in the other buffer, etc.  The question I'm asking here is considerably simpler, and I expect the answer to it should be correspondingly simple as well.

Suppose that

the Emacs frame is split into two windows, where one of the windows holds a buffer called *whatever* and the other one holds the standard *scratch* buffer;
the *whatever* buffer contains several lines of text;
the cursor in the *whatever* buffer is at the beginning of that buffer (i.e. at its (point-min));
the *scratch* buffer is the current one;

If I now evaluate any of the following in the *scratch* buffer, the position of the cursor in the *whatever* buffer remains unchanged:

 (with-current-buffer "*whatever*"
   (goto-char (point-max)))

 (with-current-buffer "*whatever*"
   (end-of-buffer))

 (save-excursion
   (set-buffer "*whatever*")
   (goto-char (point-max)))

 (save-excursion
   (set-buffer "*whatever*")
   (end-of-buffer))

I figure that, whatever (goto-char (point-max)) or (end-of-buffer) does to *whatever*'s cursor's position gets subsequently discarded.

How must I modify any of the snippets above so that the *whatever* buffer's cursor gets positioned (persistently!) at the end of that buffer.
What should I have done to answer this question myself using the Emacs docs?  I tried everything I could think of.

After reading Jules Tamagnan's illuminating answer I realized that I need make a further stipulation explicit:

I'm looking for a solution that will work irrespective of whether the buffer in question is visible in a window or not.

After all, if I view buffer B in a window W, move the cursor to a particular location L, then view some other buffer C in the same window W, and finally point W back to buffer B, I expect to see the cursor at the same location L where I left it.  IOW, there must be a way for a buffer to remember where its point is, irrespective of whether it is associated with a window or not.

What about the case where the target buffer is currently visible in two or more windows (W1, W2, W3, ...)?  There are many reasonable possibilities for this case.  The proposed solution could, for example, change the position of the cursor

in the most recently active window among W1, W2, W3, ...;
in all the windows W1, W2, W3, ...; or
etc., etc.

(I don't have a strong opinion on this corner case, since I expect it to be extremely rare in practice.)


texts:
I'd like to start using Emacs (Spacemacs) for my python work, however, a lot of what I do requires me to interact with the data in the IPython REPL, plot inline graphs, etc.

For example, I might have a python script that filters some signals, then create multiple plots of them, then jump into the REPL to rearrange some data and create more plots.

I know I can just run an IPython interpreter inside Emacs, but it doesn't seem to handle inline plotting. New plots just appear in new windows, and if I'm creating many of them sequentially I have to close the old window before the new plot window shows up.

Ive tried setting python-shell-interpreter-args "-pylab" in my config file, but it doesn't prevent plots from showing in new popup windows.

What do I need to add/change to have plots be shown inside Emacs?

I'd like to stay away from IPython notebooks if at all possible because they're not as portable as regular .py script files.


texts: Trouble connecting GNU emacs to work machine through SSH & TRAMP

texts:
I am a new emacs user. Previously, for work, I would ssh into my work machine by activating my VPN and then running ssh work (work is an ssh nickname defined in .ssh/config) in my terminal. This would bring me to my virtual machine. From here I would fire up my configured vim-tmux setup.

I am now converting to emacs (specifically spacemacs), but I can't seem to connect to my virtual machine with emacs GNU. I have tried two methods of connecting with TRAMP

I run helm-find-files (SPC f f) and type /ssh:work:
open an eshell and type /ssh:work:`

In both cases, emacs GNU freezes up and says Waiting for prompts from remote shell... for quite some time. Then a mini buffer pops up resembling the azure virtual machine I work on. However, any button press immediately closes the mini buffer. Then the bottom says /ssh:work:/: command not found

I have tried to the best of my ability to read the docs to figure out what I need to do, but I quickly get overwhelmed by the scope of TRAMP. Any guidance would be greatly appreciated.


texts: How to display only leading spaces in whitespace mode

texts:
I've been having trouble getting whitespace to visualize properly. Specifically for 'spaces' I'd like to only display leading spaces, but turning on space white space visualization includes all spaces, not just leading spaces.

I've tried a few things, including setting whitespace-space-regexp and whitespace-hspace-regexp without any luck.

Considering the below screen shot

http://droplr.the-coder.com/EG8EJ8

I thought that since the leading space glyphs are being displayed with the correct face and the inner glyphs are displayed as white that they must have different faces.

So I tried to set the inner glyphs face color to match the buffer's background to 'hide' them. But I've been unable to figure out what face they are.

Here is my whitespace configuration

(setq whitespace-style
    (quote (face
            trailing
            tabs
            empty
            indention
            spaces
            space-mark
            space-after-tab
            space-before-tab
            tab-mark)))

(setq whitespace-space-regexp "\\(^ +\\)")
(setq whitespace-hspace-regexp "\\(^\xA0+\\)")

(setq whitespace-display-mappings
    '((face)
        (space-mark 32 [183] [46])
        (tab-mark 9 [8594 9] [92 9])))

If anyone has any suggestions on how to either programmatically never display the inner space glyphs or simply how to set their face color in such a way as to hide them, I'd greatly appreciate any help.


texts: How do i remove the title of a specific org file in the agenda view?

texts: As it is now, i have my school schedule in an org file. When I use the agenda view, it says "Schedule" (the file name) in front of the schedule entries. I believe that it would look cleaner to remove the file name for that specific file in the agenda view but I can't figure it out.


texts: tools for camelcase and other means of word separation

texts:
Often I am involved with transforming text with one system of word separation (e.g., camelcase) into another system (e.g., hyphen separation, space separation, underscore separation. For example, if I am transforming from camelcase separation to hyphen separatio, and there's a phrase of words separated by camelcase boundaries, e.g., TimeOfDay, I will may have to change it to time-of-day, or search for time-of-day, etc.  Or I might have to go back and forth, or deal with multiple systems together.
What does Emacs have in terms of packages or modes or tools for dealing with these systems.  It seems like a triviality, but it's kind of pain that something I take so for granted, like Meta-F moving to forward from the beginning of "time-of-day" to the end of the word "time", is totally useless to moving past the first word in "TimeOfDay",  since it would move you to the end of the word "day".


texts: Why does GUI emacs take longer to start?

texts:
I care about the time it takes to start emacs. I bounce around a lot and edit many files. I cannot use emacsclient due to some limitations in my workflow and machine.

In the terminal emacs -nw -Q M-x emacs-init-time returns 0.0 seconds
In the GUI emacs -Q M-x emacs-init-time returns 0.8 seconds

What is the reason for this discrepancy? Can it be corrected?

emacs 24.4.1
Arch Linux


texts: org-mode How to fold an arbitrary block of text

texts:
How to fold arbitrary blocks of text?
Something like #BEGIN_SRC org .. but don't edit in another mode... using <language> 'org' doesn't really work, for example, enter on a [[link]] fails.  Drawers don't seem to work except after a heading. BEGIN _EXAMPLE, or _VERSE _QUOTE all have issues.  I want something like a heading with an end marker (that isn't another header).

#+BEGIN_SRC org
whatever text... edit etc the same as all other org text
but allow folding this block
(and enter on '[[link]]' should still work)
#+END_SRC


texts: File mode name with -mode suffix or not?

texts:
I am not sure when I should name file x-mode.el and when x.el.

Note that because of established practice mode writer should put (provide 'x) or (provide x-mode) to the end of file and end-users load your mode via (require 'x) or (require x-mode).

What if there are no any *-mode functions inside mode?

What if mode is library?

What if mode is minor mode?


texts: 'projectile-global-mode' function is void at the startup, why?

texts:
I am addicted to helm-projectile, unfortunately after a recent update, all of a sudden I get the warning message at Emacs start-up that the function projectile-global-mode is void. Before that, everything was working perfectly fine.

related init.el

(require 'package) ; only once in init.el
(package-initialize) ; only once in init.el
(require 'helm) ; install package
(require 'helm-config)
(helm-mode 1)
(setq exec-path (add-to-list 'exec-path "C:/Program Files/Gow/bin"))
(setenv "PATH" (concat "C:\\Program Files\\Gow\\bin;" (getenv "PATH")))
(projectile-global-mode)
(setq projectile-completion-system 'helm)
(helm-projectile-on)
(setq projectile-indexing-method 'alien)
(setq projectile-switch-project-action 'projectile-dired)
(setq projectile-enable-caching t)

I tried to change it to:

(projectile-global-mode +1)

but no success.

I tried to search for this function projectile-global-mode but could not find it when I do C-h f and could not even find it in the helm-projectile.el file where supposed to be AFAIK. So what am I missing?

Notes
- Windows 7 machine 32bit
- Emacs version 24.4.1
- all packages were updated from MELPA


texts:
I am trying to install ropemacs (https://github.com/python-rope/ropemacs) using:

(require 'pymacs)
(pymacs-load "ropemacs" "rope-")

and did: pip install ropemacs

Which gives me following error:

Debugger entered--Lisp error: (error "Python: Traceback (most recent call last):
  File \"/home/netlab/venv/lib/python3.6/site-packages/Pymacs.py\", line 201, in loop
    value = eval(text)
  File \"<string>\", line 1, in <module>
  File \"/home/netlab/venv/lib/python3.6/site-packages/Pymacs.py\", line 429, in pymacs_load_helper
    module = __import__(module_name)
  File \"/home/netlab/venv/lib/python3.6/site-packages/ropemacs/__init__.py\", line 675, in <module>
    _load_ropemacs()
  File \"/home/netlab/venv/lib/python3.6/site-packages/ropemacs/__init__.py\", line 653, in _load_ropemacs
    _interface = ropemode.interface.RopeMode(env=LispUtils())
  File \"/home/netlab/venv/lib/python3.6/site-packages/ropemode/interface.py\", line 19, in __init__
    self._init_mode()
  File \"/home/netlab/venv/lib/python3.6/site-packages/ropemode/interface.py\", line 33, in _init_mode
    self.env.local_command(attrname, attr, key, prefix)
  File \"/home/netlab/venv/lib/python3.6/site-packages/ropemacs/__init__.py\", line 306, in local_command
    self._set_interaction(callback, prefix)
  File \"/home/netlab/venv/lib/python3.6/site-packages/ropemacs/__init__.py\", line 341, in _set_interaction
    callback.interaction = ''
AttributeError: 'method' object has no attribute 'interaction'
")

=> What may be the main reason of this error?

Please note that I have installed its dependency pymacs (https://github.com/dgentry/Pymacs) using:

$ wget https://github.com/dgentry/Pymacs/raw/master/install-pymacs.sh
$ chmod +x install-pymacs.sh
$ ./install-pymacs.sh

copying build/lib/Pymacs.py -> /home/netlab/venv/lib/python3.6/site-packages
byte-compiling /home/netlab/venv/lib/python3.6/site-packages/Pymacs.py to Pymacs.cpython-36.pyc
running install_egg_info
Writing /home/netlab/venv/lib/python3.6/site-packages/Pymacs-0.26.egg-info

Copying pymacs.el to /home/netlab/.emacs.d/lisp

Elpy Configuration

Emacs.............: 25.2.2
Elpy..............: 1.32.0
Virtualenv........: venv (/home/netlab/venv)
Interactive Python: python3 3.6.8 (/home/netlab/venv/bin/python3)
RPC virtualenv....: rpc-venv (/home/netlab/.emacs.d/elpy/rpc-venv)
 Python...........: python3 3.6.8 (/home/netlab/.emacs.d/elpy/rpc-venv/bin/python3)
 Jedi.............: 0.17.0
 Rope.............: 0.16.0
 Autopep8.........: 1.5.1
 Yapf.............: 0.29.0
 Black............: 19.10b0
Syntax checker....: flake8 (/home/netlab/venv/bin/flake8)


texts: CUA mode is implictly cutting and copying from region

texts:
I'm confused about some CUA mode implicit behaviour that I got after upgrading Emacs, specifically:

Marking a region automatically copies it, without having to type C-c
Deleting a region automatically kills it, without having to type C-x

I find this confusing because I often want to kill a region with C-x, do a backspace on a second region to delete it and then paste with C-v to replace with the original region.

I find however that once I delete the second region, it replaces the first one in the kill ring and I get it pasted right back again after C-v.

EDIT: Here's an example of what is currently happening. Suppose I have a buffer with these two lines

This number is 1
This number is 2

I want to swap the characters 1 and 2 between the two lines. I try to take these steps:

Put a region around '1' and cut it with C-x. The character duly disappears:

This number is
This number is 2

Put a region around '2' and type backspace to delete:

This number is
This number is

Put the cursor at the end of the second line and type C-v in the hope that it will paste the '1' character. What I get instead is:

This number is
This number is 2

So, deleting the region around '2' implicitly put it in the kill ring, as if I had typed C-x.

A similar thing happens just by setting the region, which CUA is implicitly copying as if I had typed C-c. If I then move the cursor somewhere else and type C-v, I get the region pasted back.

Is this normal behaviour? I would prefer to do the cutting and copying explicitly, without CUA doing it behind my back.


texts:
I have read the guide found here:
How Emacs Finds Your Init File
I cannot find any .emacs directory in my home directory.  I have show hidden files selected. I also cannot find the init.el file in Emacs home directory.
Since I have been unable to find the init.el file, is it reasonable to think there isn't one?
I am using Emacs 27.1 on Windows 10. Except for Emacs home directory I installed with the defaults. I used no command-line options during install.
I seem to remember I have once read a post which explained Emacs has an internal variable which is used to hold the value of the location of where Emacs found the init.el file after it starts, but after searches I have been unable to find what that variable is.
How can I find my init.el file, having failed to locate it in the locations mentioned in the manual?
Does a variable exist which says where the init.el file was found? If so, what is it?


texts: In table-mode, how do I change the face used for cells?

texts:
If I make a table (with M-x table-insert), the background color is a dark blue, and the text color is a light grey. I'd like to make the face different, but I'm not sure what face I need to change.

The emacs documentation for tables doesn't say what the face is. I'd like to find the face used without having to look through all the Emacs code, so I can change it.


texts: Loading and executing .el file if it exists on startup

texts:
I am having trouble telling Emacs to load and evaluate an additional .el file which only contains some lisp code to load an org file

;; keep my personal settings not in the .emacs file
;; http://www.mygooglest.com/fni/dot-emacs.html
;; load it if it exists
(let ((personal-settings "~/personal.el"))
 (when (file-exists-p personal-settings)
   (load-file personal-settings))
)

If I call the file personal.el interactively via load-file Emacs executes the code (which just contains some lisp code to load an org file).

If I run M-X eval-buffer on the .emacs manually, the personal.el is executed properly, the org file is loaded.

What do I need to do to make Emacs load the file if it exists during emacs start?

EDIT

I rephrased the question and ran additional tests: (expand-file-name) did not have any effect but more weird is that Emacs does not evaluate a hard-coded (find-file "~/Dropbox/orgmode.org") even if it is the only line in my .emacs file. And again it works if I load this file manually and run m-x eval-buffer on it.


texts: How to execute a python program (with a GUI) from Emacs?

texts:
I'm trying to test a program written in Python with a front panel generated with Qt Designer (converted from .ui to .py using pyuic4). I can make the following code work outside Emacs, from a terminal (it is just a main window with some labels and buttons):

from PyQt4 import QtCore, QtGui
from panelSimple import Ui_VentanaPrincipal

class Window(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_VentanaPrincipal()
        self.ui.setupUi(self)

if __name__ == '__main__':

    import sys
    app = QtGui.QApplication(sys.argv)

    miVentana = Window()
    miVentana.show()

    sys.exit(app.exec_())

I would like to execute this code from within Emacs, but when I send the buffer to the Python interpreter, and it opens an "Inferior Python" buffer, nothing happens.

On the other hand, if I don't use any graphical user interface, python programs work very well.

Is it possible to make my program's GUI execute from inside Emacs?

I started using Spacemacs with its default settings. For my tries I select a virtual environment (with PyQt4 installed), and then I send the buffer to the interpreter. I don't know what other information could be useful to answer my question.


texts: How to recreate iA Writer-style typewriter scrolling in Emacs?

texts: The popular Mac editor iA Writer (https://ia.net/writer/mac/) has many nifty features that I rather like. So far, I've been able to recreate the look and feel for the most part -- except for the typewriter-style scrolling that keeps the current line centered in the window. Any ideas on how to implement this?


texts: What is this M-q behaviour in Emacs 26.1 message mode

texts:
Since updating to Emacs 26.1. message mode was changed so that M-q does something unexpected.  I have fill-column and message-fill-column both set to 72 and pressing M-q on this text:

turns it into this text:

It seems that in other modes M-q does what it usually does.  In particular, if I switch this buffer to text mode I can get the expected formatting.

Update: I have researched the issue. It appears as if in message mode the function message-fill-paragraph is called. This function was slightly changed from 25.3 to 26.1.  But essentially it just calls message-newline-and-reformat which actually does something else. I can't find the reason for the totally unexpected behaviour of message-fill-paragraph.  It does not what it says it should do and for example seems totally unrelated to the value of message-fill-column.


texts: Can we get inline results with polymode for Rmd files?

texts:
As a new Emacs user, I've recently learned how to use polymode to handle R code in org-mode. I'm happy with it, since I get the same features than those implemented for example in Rstudio for Rmd files (e.g., facilities to execute code chunks and visualize the results directly in the org file, display inline images, code completion in code chunks, etc.).

Even if I prefer now working with org-babel than rmarkdown, I wonder if it is possible to get the same features for Rmd files with polymode.

With my current settings, when working on an Rmd file, code completion works properly inside R chunks, and R chunks can be executed (i.e., sent to an inferior R process) by C-c C-c. Everything is okay for that. But I don't understand how to display/preview/visualize the results and plots produced by R chunks directly within the Rmd file, and I don't even know if it is possible. All the chunks are sent and executed in a separate R buffer, but it would be more convenient to have the results displayed just below the chunks, as with org-babel.

All information is welcome :)


texts: How to search and replace in the entire buffer?

texts: Search and replace, by M-% and !, is done from current position to the end of the buffer. How can I do it for the entire buffer? Thanks.


texts: emphasise the current error in the *compilation* window

texts:
When running the compile command and jumping to the 'next error', emacs identifies the line of the current error by placing a little black triangle, pointing right, in the left-hand fringe of the *compilation* buffer.  This is nice, but my old eyes would like a bolder indicator.   The fundamental goal here is to be able to quickly visually identify which line emacs is identifying as the current compiler error.  Some solutions which come to mind:

a different face for the current error (bigger for example).
a different background color for the current error (something like hl-line-mode).
a bigger triangle.

but I'm open to other ideas too.

Can someone help me out?


texts: How to reopen just killed buffer, like C-S-t in Firefox Browser?

texts:
Sometimes I accidentally kill a buffer and want to reopen it, just like C-S-t to undo closed tab in Firefox, but there is no built-in command in Emacs, the defun undo-kill-buffer in http://www.emacswiki.org/RecentFiles :

(defun undo-kill-buffer (arg)
  "Re-open the last buffer killed.  With ARG, re-open the nth buffer."
  (interactive "p")
  (let ((recently-killed-list (copy-sequence recentf-list))
     (buffer-files-list
      (delq nil (mapcar (lambda (buf)
                  (when (buffer-file-name buf)
                (expand-file-name (buffer-file-name buf)))) (buffer-list)))))
    (mapc
     (lambda (buf-file)
       (setq recently-killed-list
         (delq buf-file recently-killed-list)))
     buffer-files-list)
    (find-file
     (if arg (nth arg recently-killed-list)
       (car recently-killed-list)))))

doesn't work at all. If you know elisp, how to solve this problem?

If it can show a list of the closed buffers and them I can choose one from them to reopen, that would be better.


texts:
I use the same configuration of emacs on multiple machines, and I want to use use-package to keep the packages the same on all machines.  I have an init file in each machine's home directory that looks like this:

;;Set the custom file to Dropbox .emacscommon
(setq custom-file "~/Dropbox/.emacs.d/.emacscommon")

;;These are commands that should be common across systems.

(load "~/Dropbox/.emacs.d/.emacscommon")

And the beginning of .emacscommon has these lines:

;;; -*- mode: Emacs-Lisp; -*-

(eval-when-compile
  (require 'use-package))

(require 'use-package-ensure)
(setq use-package-always-ensure t)

(use-package auto-package-update
  :config
  (setq auto-package-update-delete-old-versions t)
  (setq auto-package-update-hide-results t)
  (auto-package-update-maybe))

When I start up Emacs, though, I get the following error.

Warning (initialization): An error occurred while loading ‘/Users/basil/.emacs’:

File is missing: Cannot open load file, No such file or directory, use-package

Checking the value of "load-path" via "describe-variable" gives a long list which includes "/Users/basil/.emacs.d/elpa/use-package-20190405.2047", so use-package appears to be accessible.  Why can't Emacs find it?  If I omit the use-package lines from .emacscommon, all other packages work just fine.


texts: Latex subscript in .Rmd file registers as markdown italics in buffer

texts:
I am using ess, polymode, and poly-R.
The latex subscript registers as markdown italics in my .Rmd file

Notice it only takes effect with an open and close _.
Is there a way to specify that these lines are latex and should be treated as such?


texts:
I am working on Spacemacs which gives you the ability toggle between Emacs "holy-mode" and Vim "evil-mode". However the evil-escape minor mode is still enabled. I am trying to find some way to disable evil-escape in the holy-mode setup function and then restore its previous state (enabled/disabled) in holy-mode's teardown function. I tried this but it didn't work.

  ;; setup
  (setq evil-escape-mode-set (symbol-value 'evil-escape-mode))
  (evil-escape-mode -1)

  ;; teardown
  (when (evil-escape-mode-set)
     (evil-escape-mode))

but the teardown doesn't seem to work. How can I accomplish this?


texts: How to rename a file with dired with the current file name as default?

texts:
In the macOS Finder, I can rename a file or directory by pressing RET and the current value becomes the default for the new file name. This helps if I make a small change, such as adding a date at the beginning of the filename.

In Emacs with dired, I can rename with R but I don't have the previous value as the default, so I auto-complete it. This becomes dangerous if I make a mistake in the auto-completion and overwrite another file.

Can Emacs dired rename files incrementally as in the Finder?


texts: How to create a function that have the functionality of helm-projectile-switch-to-buffer but with added opened org files?

texts:
I really like helm-projectile-switch-to-buffer as it shows buffers for the specific project I am working in (i have multiple projects open at the same time). But I also rely on org files for notes and debug information.

How is it possible to create a function that performs the exact same functionality of helm-projectile-switch-to-buffer but add to the possible buffers to switch to the opened org files as well?


texts: unescaped character literals detection error

texts:
When I reload my init file I get an error (or warning) saying
unescaped character literals `?(', `?)', `?[', `?]' detected!

What does this error (warning) mean and how can one fix it?


texts:
During the i-search if I use dracula theme it highlights the line-number if the searched word is the first in the line.
Example view:

If I uncomment (load-theme 'dracula t) the example view would be where line number is not highlighted:

==> I just want to disable the highlight option for line numbers for a specific theme, is it possible? How to discard line-number highlight during i-search?

my setup:
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(load-theme 'dracula t)

(setq linum-format "%d ")
(add-hook 'isearch-mode-hook (lambda () (linum-mode 1)))
(add-hook 'isearch-mode-end-hook (lambda () (linum-mode 0)))
(delete-selection-mode 1) ;; Overwrite selected text

(define-key isearch-mode-map (kbd "C-w") 'isearch-forward-symbol-at-point)

(defadvice isearch-repeat (after isearch-no-fail activate)
  (unless isearch-success
    (ad-disable-advice 'isearch-repeat 'after 'isearch-no-fail)
    (ad-activate 'isearch-repeat)
    (isearch-repeat (if isearch-forward 'forward))
    (ad-enable-advice 'isearch-repeat 'after 'isearch-no-fail)
    (ad-activate 'isearch-repeat)))

(define-advice isearch-repeat (:before (direction) goto-other-end)
  "If reversing, start the search from the other end of the current match."
  (unless (eq isearch-forward (eq direction 'forward))
    (when isearch-other-end
      (goto-char isearch-other-end))))


texts: How can I run imenu in all project files?

texts:
Is there any package which will allow to run the imenu in all project files of a current mode?
More specifically I have a Go project defined by projectile and I would like to search for a symbol in the whole project.
I know about imenu-anywhere - but it only searches through symbols in opened buffers.


texts: How show (filter) only text lines with all uppercase chars?

texts:
Suppose I has the next text:

test
HELLO
help
HOW ARE YOU
buy

I need to get (filter) only text lines with all uppercase chars. So result must be like this:

HELLO
HOW ARE YOU


texts: Flyspell check entire document upon opening

texts:
I have enabled Flyspell in .emacs:

(add-hook 'org-mode-hook 'turn-on-flyspell)

When I open a document and start typing, typos will be underlined. However, when I close and reopen the document, the same error will not be underlined unless I select the word or move over it with the cursors.

Q: Is there a way to recheck (non-interactively) the whole document and underline errors upon opening a document with Flyspell?


texts: "Wrong type argument: symbolp" on function usage

texts:
I am trying to use following code:

(defun rust-save-and-build (mode)
  (interactive)
  (save-buffer)

  (setq tmp (shell-command-to-string (format "cygpath.exe -m %s"
                     (buffer-file-name)))

(if (locate-dominating-file buffer-file-name "Cargo.toml")
        (compile mode)

  (compile
   (format "rustc %s %s.exe"
       tmp
       (file-name-sans-extension tmp))))))

(defun rust-cmd-run ()
  (interactive)
  (rust-save-and-build "cargo run"))

(defun rust-cmd-build ()
  (interactive)
  (rust-save-and-build "cargo build"))

(defun rust-cmd-test ()
  (interactive)
  (rust-save-and-build "cargo test"))

(add-hook 'rust-mode-hook
  (lambda ()
    (define-key rust-mode-map (kbd "<f5>") 'rust-cmd-run)))

(add-hook 'rust-mode-hook
  (lambda ()
    (define-key rust-mode-map (kbd "<f6>") 'rust-cmd-build)))

(add-hook 'rust-mode-hook
  (lambda ()
    (define-key rust-mode-map (kbd "<f7>") 'rust-cmd-test)))

but get "Wrong type argument: symbolp" error when use f-keys. The debug message is:

 Debugger entered--Lisp error: (wrong-type-argument symbolp (if (locate-dominating-file buffer-file-name "Cargo.toml") (compile mode) (compile (format "rustc %s %s.exe" tmp (file-name-sans-extension tmp)))))
 (setq tmp (shell-command-to-string (format "cygpath.exe -m %s" (buffer-file-name))) (if (locate-dominating-file buffer-file-name "Cargo.toml") (compile mode) (compile (format "rustc %s %s.exe" tmp (file-name-sans-extension tmp)))))
  rust-save-and-build("cargo run")
  rust-cmd-run()
  call-interactively(rust-cmd-run nil nil)
  command-execute(rust-cmd-run)

NB that rust-save-and-build function works perfectly without argument.


texts: Append region to the end of the lines of another region of same length

texts:
Here are two cases i am interested in:

Case 1: lines of identical length

Given some lines

const int name1
const int name2
const int name3
const int name4

and some other lines

= 1
= 2
= 3
= 4

I would like to move the other lines to the end of the first lines.

const int name1 = 1
const int name2 = 2
const int name3 = 3
const int name4 = 4

Is there an easy way to do this?

Case 2: lines of different lengths

In this cae the lines of the first region do not have the same length:

const int someName
const int anotherName
const int yetAnotherName
const int name

I would still like to move the other lines to the end of the first lines, like this:

const int someName = 1
const int anotherName = 2
const int yetAnotherName = 3
const int name = 4

Is there an easy way to do this?


texts: How to refresh dabbrev candidates displayed by company after each save

texts:
I've been using Ivy Irony Company for some time and it works great on all libraries I included in my C++ program so far, but I've noticed Ivy rarely auto-completes my user defined classes, objects, variables and enumerations.

I've read about company having dabbrev backend for everything user defined in opened buffers. Also I've noticed that after I build my project with make company now displays my user defined enumerations, objects etc..

Is there a way to update dabbrev backend after each save and should I put dabbrev inside grouped backend for it to work?

As far as my init.el configuration, for autocompletion part I'm using config from https://github.com/dfrib/emacs_setup#cmake-idertags I've commented out rtags part:

(use-package irony
  :config
  (add-hook 'c-mode-hook 'irony-mode)
  (add-hook 'c++-mode-hook 'irony-mode)
  (add-hook 'objc-mode-hook 'irony-mode)
  (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
  (defun my-irony-mode-hook ()
  (define-key irony-mode-map [remap completion-at-point]
    'irony-completion-at-point-async)
  (define-key irony-mode-map [remap complete-symbol]
    'irony-completion-at-point-async))
  (add-hook 'irony-mode-hook 'my-irony-mode-hook)
  (add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options)
  )

;; Company mode.
(use-package company
  :config (global-company-mode)
  )

;; company-irony.
(use-package company-irony
  :after company
  :config (global-company-mode)
  ;; (optional) adds CC special commands to `company-begin-commands' in order to
  (add-hook 'irony-mode-hook 'company-irony-setup-begin-commands)
  )

;; Company-mode backend for C/C++ header files that works with irony-mode.
;; Complementary to company-irony by offering completion suggestions to header files.
(use-package company-irony-c-headers
  :after company-irony
  :config
  ;; Load with `irony-mode` as a grouped backend
  (eval-after-load 'company
  '(add-to-list
    'company-backends '(company-irony-c-headers company-irony)))
  )

(use-package ivy
  :config
  (ivy-mode)
  (setq ivy-use-virtual-buffers t)
  (setq enable-recursive-minibuffers t)
``````````


texts: Including standard boiler-plate on opening a new latex file

texts:
Most of my \LaTeX files have the same boiler plate code, so I would like Emacs to automatically insert this boiler-plate whenever I open a fresh, blank \LaTeX file.

In particular, I would like to include the following preamble.

    \usepackage{amsthm}
    \usepackage{amssymb}
    \usepackage[backend=bibtex, style=numeric, sorting=none]{biblatex}
    \setlength\bibitemsep{\baselineskip}
    \addbibresource{References.bib}
    \author{A.U.Thor}
    \date{}

    \begin{document}
    \setcounter{tocdepth}{0}

    \nocite{*}
    \printbibliography
    \end{document}

How should I modify my .emacs file to do this?


texts: How to get exit code of command supplied to `compile' function?

texts:
compile can execute command line, show you result, indicate exit code in mode line and more. How do you get exit code of the executed command from Lisp? Documentation of the function is silent about it.

I've tried to read descriptions of various variables that start with compilation- prefix. No luck. Anyway, exit code is displayed in mode line, so it should be available. Looks like long digging into source code can help here.

Maybe you can save me and future readers time? What is the official (if this word can be used here) way to get exit code?


texts:
Whenever I'm using M-x rgrep to search inside my project arborescence, the interactive prompts suggest the following default arguments for the function:

Search for (default: <current word>) (OK, always what I want)

Search for <current word> in files (default: *.<extension of the current file>) (mostly OK, not always what I want but I can live with that)

Base directory: <current directory> (not OK, I never want it to use the current directory)

I like the first proposed argument, but I'd like to change the second one, and especially the third one, to use other defaults (such as "parent directory" instead of "current directory").

How can I modify rgrep so that (1) either it remains interactive, but proposes different default values, or (2) it becomes non-interactive, but uses the word currently under the cursor as first argument?


texts: how to disable minor mode (enabled using prog-mode-hook) for a particular major mode

texts:
I've enabled auto-complete-mode mode using prog-mode-hook like so: (add-hook 'prog-mode-hook 'auto-complete-mode), but I want auto-complete-mode to be disabled for python-mode. How can I achieve this ?

I tried doing this :-
(add-hook 'python-mode-hook (lambda() (auto-complete-mode -1)))
But, auto-complete-mode is still enabled for python-mode.


texts: Autocomplete signatures from new C Headers

texts:
I use Emacs(work environment is Linux. and at home i use Windows 7) for most of my Python coding and documentation. I'm mostly working for visual effects pipeline products. Off late I'm learning bits of OpenGL and using C++ for that. I'm using the minimalist Gnu (C:/MinGW/)(g++) for compiling and I have been successfully compiling code.

I used Visual Studio once for the same purpose and I found out that once I have added the libraries to the project's auto-complete or intellisence(whatever vs uses) adapted to the new libraries. for example in SFML vs2017 was predicting all sf:: namespace elements. I've Auto-complete for general C++ mode in Emacs how do i make it read from GLFW or SFML or GLEW or ncurses libraries.

(I saw a lot on discussions about company-mode and clang and irony and sarcasm but makes it no sense as g++ compiler is not mentioned anywhere.)


texts: highlight-chars and magit is conflicting

texts:
first time StackExchange user here.

I'm having trouble with highlight-chars (probably font-lock) and magit.
Enabling hc-toggle-highlight-* functions will remove the coloring from magit buffers.

Possibly duplicate:
Font-lock for strings messes up non-code buffers

Anyone else have this trouble, or know some possible workaround?

Minimum .emacs:

(require 'package)
(add-to-list 'package-archives
         '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

(require 'magit) ;; Current version 20160210.555
(require 'highlight-chars) ;; Current version 20151231.1335

;; (hc-toggle-highlight-tabs t)
;; (hc-toggle-highlight-trailing-whitespace t)
(add-hook 'font-lock-mode-hook 'hc-highlight-tabs)
(add-hook 'font-lock-mode-hook 'hc-highlight-trailing-whitespace)


texts:
In my Spacemacs, I enabled the spell-checking layer which enables ispell. I noticed that my Tramp connection is very slow, and after debugging, I found that one of the causes is ispell:

02:07:20.446250 tramp-do-file-attributes-with-stat (5) # file attributes with stat: /path/to/.ispell_words
....
....
....
....
02:07:23.961344 tramp-send-command (6) # test -r /path/to/.ispell_default 2>/dev/null; echo tramp_exit_status $?

So about 3 seconds are wasted on ispell. I tried disabling the spell-checking layer and found that Tramp is indeed faster.

However, I don't want to totally disable spell-checking, as I in fact use it frequently when editing locally. Is it possible to disable ispell only when I use Tramp? Thanks!


texts:
I am running Emacs 24.5.1 (compiled) and Spacemacs v.0.105.4 on Ubuntu 12.04.

When I try to use the spotify layer I get the following error:
peculiar error: "Emacs not compiled with dbus support".

How do I fix it?


texts: Can a defmacro generate a string with the name of the .el file where it is expanded?

texts:
I'd like to create a Emacs Lisp macro that is able to generate a string literal that contains the name of the .el file into which the macro is expanded. Is this possible?
Background:
I am writing a Elisp macro that generate one or several defun forms.  Some may be inside conditional forms (if or conditions or whatever) and the macro being expanded may also be inside a conditional block form.
Assuming I have the following code inside a file called my-file.el:
(when some-condition
    (my-macro lisp arg1 arg2))

I'd like to be able to write a defmacro form that would be able to determine that it is being expanded inside my-file.el and would be able to generate the string literal "my-file".  Something like:
(when some-condition
   (defun my-lisp-function (some-arg arg1)
     (some-code-here arg1 whatever))
     (declare-function my-lisp-function "my-file")
   ;;
   (some-other-code etc etc)
   ;;
   (my-lisp-function arg2))

In the example above I'm using the file name string literal inside a declare-function form to prevent the byte-compiler from complaining about the generated my-lisp-function not being defined.  And at the same time allow the check-declare package to verify the existence of the function.
I tried to use the variable byte-compile-current-file from bytecomp.el by accessing it in the non-generated portion of the macro, but that did not work.


texts: How to make `pulse-momentary-highlight-region` stop highlighting after 1 second?

texts:
When I do pulse-momentary-highlight-region,
the highlight stays till I press any key.

(I'm on macOS emacs -nw.)

How can I make the pulse to go away after a short while?


texts: [OSX]Octave not quite working within Emacs

texts:
it is my first time asking question here. I am a college sophomore. I am taking a Matlab course this semester and find Octave an alternative so I get that installed through Homebrew in my Mac.

The problem is that Octave doesn't seem to be compatible with emacs (or saying, lots of bugs?). First of all, functions like clc, clean won't work in Emacs (by running M-x run-octave) while it works in the terminal. Also, I was trying to make plotting work but whenever I tried to plot in Emacs, they say "no graphics toolkits are available!," further verified by typing "available_graphics_toolkits" and they shown nothing. The strange thing is that if I run the same line "available_graphics_toolkits" in the terminal, gnuplot does shown up. It seems like I  get everything set up but Emacs just somehow doesn't recognize it. I have done research online but still problem not solved.
Here are some screenshots:

[My OS version] [need at least 10 reputation :(]
OSX El Capitain Version 10.11.3

[Octave settings in ~/.emacs] [need at least 10 reputation :(]

  ;Manipulating the Load Path for Octave
(setq inferior-octave-program "/usr/local/bin/octave")
;Fix the frezze error
(setq inferior-octave-prompt ">> ")
;Fix can't find the program error
(add-to-list 'load-path "/usr/local/bin/gnuplot")
;Octave Settings
;using Octave mode for all .m files you visit
(setq auto-mode-alist
      (cons '("\\.m$" . octave-mode) auto-mode-alist))
;turn on the abbrevs, auto-fill and font-lock features automatically
(add-hook 'octave-mode-hook
          (lambda ()
            (abbrev-mode 1)
            (auto-fill-mode 1)
            (if (eq window-system 'x)
                (font-lock-mode 1))))

Let me know for any further information and feel free to give me advises on how to make my question better. Thank you so much.

UPDATE1: Tried installing the package exec-path-from-shell as Dan suggested, doesn't seem to work.

UPDATE2: UPDATE1 actually work after I put those lines in to ~/.emacs instead of ~/.emacs.d/init.el Now the only thing that is bugging me is the clc command still doesn't work. Any ideas?


texts: Is it possible to disable font faces in Markdown for tables only?

texts: I really like the markdown mode in Emacs (markdown-mode.el v2.4-dev) but when I have monospace in table cells the columns get out of alignment.  Not only that, but at times the rendering kind of jerks around.  I'd prefer if it just didn't do any font changes in tables.  Is that some kind of configuration?  Alternatively, could I disable font-faces for the whole mode?


texts: How can I find out exactly what my modeline is telling me?

texts:
I'd like to know exactly what my modeline is telling me and how it's derived. Right now, if I'm working with a graphical terminal I can hover over each modeline entry in turn, and if I'm lucky, a tooltip will pop up; obviously, this won't work in a console.  Alternately I can examine the mode-line-format variable, but it's not at all obvious how the values correlate to what's displayed.

Ideally I'd like something within Emacs that would explain, for example, how am I getting from "%e" in mode-line-format to U:---, what that means and where to get more information:  “U:--- comes from %e in mode-line-format and means this, that and the other.  You can customize it here.”

Is there a mode or tool that will help me?


texts: Change buffer displayed in window after x amount of time

texts: I find myself switching between buffers constantly to double check activity in other buffers. Is it possible for windows to display different buffers after x amount of time? In other words can I get "billboard" like behaviour?


texts: In an Emacs Lisp function, I would like to insert some text at point or - if the region is active - overwrite it with such text.  How to do it?


texts: ac-php "Wrong type argument: hash-table-p, nil" when calling company-complete

texts:
I'm using emacs 27 compiled from git sources and company for code completion.
I tried to set-up ac-php with company and php-mode, but when company tries tp perform auto-complete, I get the following error :

Company: An error occurred in auto-begin
Company: backend (company-ac-php-backend company-dabbrev-code) error "Wrong type argument: hash-table-p, nil" with args (candidates $this->)

Here is my conf for php-mode (the same as advised on ac-php Github):

(use-package php-mode
    :ensure t
    :init

    (require 'company-php)
    (add-to-list 'semantic-symref-filepattern-alist  '(php-mode "*.php" "*.tpl"))

    ;; Enable ElDoc support (optional)
    (ac-php-core-eldoc-setup)

    (set (make-local-variable 'company-backends)
      '((company-ac-php-backend company-dabbrev-code)
         company-capf company-files))

     ;; Jump to definition (optional)
     (define-key php-mode-map (kbd "M-]")
      'ac-php-find-symbol-at-point)

     ;; Return back (optional)
     (define-key php-mode-map (kbd "M-[")
      'ac-php-location-stack-back)
   )

What did I do wrong?


texts: Search for text and navigate between the occurrences

texts: I want to be able to search for some text and navigate quickly between the occurrences. What is a convenient way to search for some text, view all the occurrences, and jump quickly to the next/previous occurrence?


texts:
I changed the default font of GNU emacs 24 to DejaVu and when I want to open a file I had this weird output(characters start appearing in small size)!
Anyone knows how to solve this problem?

I'm using emacs for several days now, so can you please explain as much as possible. Thanks!


texts: Uncommenting not working on Javascript file

texts:
I am trying to use the block un-comment command C-x C-; but I am getting the error message "Can't find the comment end". I am writing Javascript code in an .html file. The block comment command works and correctly adds the //-type commands. Any recommendations? Is this a bug? Is there any other info that might be necessary to know?
Edit: The following code gives a simple example of what's going wrong:
<!DOCTYPE html>

    <meta charset="utf-8">
    <title>Comment Test</title>

Here is some stuff

If I put my cursor at the end of the console.log("Hello World!"); command and then type C-x C-; Emacs gives "Can't find the comment end". The C-u M-x comment-region command gives the same error, so I think it is already bound to that key set.
Edit 2: I am currently in version 27.1, and my init file only changes the theme. The major mode that I am in appears to switch to mhtml-mode when I am in the html portion of the document, and js-mode when I am in the Javascript portion of the document. When I switch to either html-mode or javascript-mode it comments and uncomments fine.


texts: Unexpected behavior of Meta-RET in org-mode

texts:
when using lists in org-mode, the Meta-RET binding does not behave as expected. What I expect is that the binding will create a new item at the same level as the previous item. What I get is a new line indented to the level of the last item.

When I check the binding with C-h k [M-RET], it tells me that it is an alias for:

comment-indent-new-line

whereas I expect something like org-meta-return. Why is it so?

How can I change the behavior of M-RET so it behaves as I except with org-mode?

I am using Emacs 23.1.1 and org-mode 6.21b.


texts: How can I have Org use `sidewaysfigure` in LaTeX export?

texts:
I am writing an Org document with some large figures (images) which I would like to place on a separate page in landscape orientation when exporting to LaTeX.  In LaTeX I can achieve what I want by using \begin{sidewaysfigure}.  What is the easiest way to get Org to do this?

Google turns up this documentation, which mentions sideways tables but not sideways figures AFAICT, and this patch, which should add support for sideways figures, but I don't think it has been merged into the version I installed from the Org-mode ELPA repository.  (M-x org-version displays Org-mode version 8.2.9 (8.2.9-elpaplus @ […] ~/.emacs.d/elpa/org-plus-contrib-20141012/).

Is there an easy way to get this behavior with my current version of Org?

(Edited to add: It looks like the patch above has been merged into the bleeding-edge Org snapshot, so perhaps I should just install that.  However, I would still be interested to know if there is a way to get this functionality using the current stable release of Org from October 2014).


texts: How to convert an org string to html in an elisp program (with macros)?

texts:
In an elisp program, I am trying to convert strings from org syntax to (say) html. For that, I use org-html-convert-region-to-html with a temporary buffer, and everything is fine:

(defun tv/org-string-to-html (string &optional macros)
  (if (or (not string) (string-empty-p string)) ""
    (with-temp-buffer
      (insert string)
      (set-mark (point-min))
      (goto-char (point-max))
      (when macros (setq org-macro-templates macros)) ;; not working
      (org-html-convert-region-to-html)
      (substring
       (buffer-substring-no-properties (point-min) (point-max))
       4 -5))))

;; ELISP> (tv/org-string-to-html "This is [[file:test][a link]], this is *bold*, and this is /italic/")
;; "This is a link, this is bold, and this is italic"

However, it does not work if the string I am trying to convert has a macro, because my temporary buffer does not know about this macro.

I have tried to pass the content of the org-macro-templates variable to my converter function in the function above, but it doesn't appear to work, the macro is still not recognized.

Examining org-macro-expand with edebug, it appears that the macro templates are overwritten by org -- which makes sense. And the org-macro-templates variable does warn not to set it directly, but to use #+MACRO: lines instead.

Now, the obvious solution would be to collect all the macros in the org buffer and insert them in the temporary buffer, or to simply use the current org buffer instead of a temporary buffer. Neither option is really nice...

Is there a proper way to achieve what I want?


texts:
I've been using EWW and I noticed that it displays inline LaTeX expressions ($ ... $) but it fails to display those that have their own line ($$ ... $$). I'm attaching a print below. Have a look the blank space after the sentence "Symbolically, ".

I'm very new to Emacs, EWW, and text-based browsers so I have the following questions:

Is it possible to display those $$ ... $$ LaTeX formulas?
Can I choose whether I want to see the LaTeX code or the rendered version?


texts: How to disable schema validation in nxml-mode but keep validation of well-formedness?

texts:
By default, nxml-mode looks at the name of the root element and decides to validate the document against some schema based on that name.

I would like to disable this and just validate that the document is well-formed, since I edit documents in my own custom format with element names that coincides with some schema nxml-mode knows about but that is not relevant to my purposes.

I know I can toggle validation using C-c C-v, but I'd prefer to keep the check for well-formedness enabled at all times, if possible.


texts: Running aspell in emacs with aspell key bindings

texts:
I am using aspell on the (Linux) command line, and have also started using it with mu4e in emacs to spell-check my composed messages using ispell-message.  That command runs aspell, but with ispell key bindings, which I find confusing (in particular if a means add in the one and ignore in the other, while i means ignore in the one and add in the other).  Is there a way to run aspell in emacs with aspell key bindings?

(Running aspell with ispell key bindings in the terminal is easier, but has the effect that I make mistakes there too...  I also know I should move to hunspell, but I have to resolve another issue there first).


texts:
After updating packages from MELPA, I'm getting the message:
Warning (emacs): dnd-unescape-uri is undefined. Some things may not work.
It is a separate buffer. Not in the messages buffer.
I can just close the buffer and Emacs seems to be working alright.
I'm using Emacs 27.1 with the Spacemacs layer.
Two questions: Is this dangerous? And what can I do about this?


texts: bibtex2html options in org-mode publishing

texts:
How do I pass the bibtex2html option -nobibsource when publishing via ox-bibtex.el? I have added it directly to the ox-bibtex.el file by commentling out line 265 and adding my own:

;;'("-a" "-nodoc" "-noheader" "-nofooter")
'("-a" "-nodoc" "-noheader" "-nofooter" "-nobibsource")

I'm sure this isn't the right way to do it. I'm using org 8.3beta.


texts: Exiting insert mode in Evil mode and saving immediately (Ctrl + [, :w) causes errors

texts:
I've recently shifted to Emacs + Evil for my dev setup, and seem to be running into a rather strange issue with Emacs 24: when I exit Insert mode using Ctrl+[ and try to save the file with :w, Emacs enters the debugger with this error message:

Debugger entered--Lisp error: (void-variable w)
eval(w nil)
eval-expression(w nil)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)

This does not happen if I pause for a few seconds after Ctrl+[. This also appears to be restricted only to Emacs in terminal - this happens quite frequently on bash/Cygwin, but never happens on the standalone version of Emacs

Does anyone know what could be going wrong? I have this configuration in my .emacs foe evil mode:

(setq evil-want-C-i-jump nil)
(require 'evil)
(evil-mode t)


texts: Why "mobile-inbox.org" filename cannot be changed?

texts:
I have

 (setq org-mobile-inbox-for-pull "~/org/m-Inbox.org")

in my .emacs (also set the var manually to the same effect), and still when doing (org-mobile-pull) emacs stores new entries in the file named mobile-inbox.org instead of m-Inbox.org

What gives?


texts: How to write custom read-file-name with expanded set of completions?

texts:
I am seeking advice for how to get tab completion in the minibar with a custom set of completion candidates that are either subdirectories or build targets from Makefiles.

For context, I'm using the Emacs compile command to build code, with the instructions for the build inside Makefiles.  There may be multiple Makefiles in the project and each one might contain multiple targets which I want to build. I would like something like an augmented read-file-name that either lets me move through the directory tree to find Makefiles in some subdirectory or that completes with the list of make targets if the current directory contains a Makefile.

To be concrete, say the layout of my project is as follows.

.
├── dir
│   ├── README
│   ├── some_config_file
│   └── subdir
│       ├── do_it.sh
│       └── Makefile
└── Makefile

Lets says that the top-level Makefile has possible targets "target1" and "target2", and dir/subdir/Makefile has "target3".

How can I write somethign like read-file-name which would offer possible completions:

dir or target1 or target2 when in the top-level directory
subdir when in dir
target3 when in subdir

I am only guessing that read-file-name is the right starting point, but if that guess is wrong, please feel free to suggest alternatives too.


texts: How to move the cursor to the next instance of the text the cursor is currently on?

texts:
Suppose your code looks like this:

1. term_cursor_is_on = 500
2. cursory_next_line = 42
[...]
101. next_instance_line = term_cursor_is_on

And suppose that your cursor is on line 1 (unimportant, but suppose it is between 'c' and 'u') and you want to jump to the next instance of "term_cursor_is_on" on line 101.

Naively, you can do an I-search for "term_cursor_is_on" and press ctrl+s.

But this seems inefficient, since it requires you to type the currently-hovered-over term into I-search. Is there a better way to jump to the next instance of the term? Either a package, or some shortcut to auto-paste the hovered-over-term into I-search?


texts:
Q: how does one test string equality but ignore case?

I've got a situation in which I'd like to compare strings but ignore case.  Case is significant for string-equal, and apparently is insensitive to case-fold-search:

(string-equal "string" "StrinG")        ; => nil
(let ((case-fold-search t))
  (string-equal "string" "StrinG"))     ; => nil

I could always preprocess the strings (say, with downcase) before comparing them:

(string-equal (downcase "string")
              (downcase "StrinG"))      ; => t

But that seems like overkill to do two extra function calls every time.  Have I overlooked the relevant predicate function somewhere?


texts:
I'm trying to use spacemacs (basically a thin layer with nice defaults around emacs) at work, but it wants to connect to elpa and melpa to download stuff - and is basically unusable without getting those packages.

If I set up spacemacs the way I like it on my linux laptop at home, and it's all in elisp and self-contained, would the directory work at work on my Windows desktop?

It should, shouldn't it?

Follow-on question: If I use version control, is there anything I should avoid tracking that's dynamically created?

Is .emacs.d portable across platforms?


texts: APIs to create a custom issue list on Magit Forge?

texts:
Using Magit Forge, I'd like to organize a list of open issues by assignee.  Ideally I'd like to display them in groups by assignee, but I'd settle for a single list if the assignee were added to the display of each issue.
I started poking around the code, and I've just bumped into a lot of undocumented functions, like forge-insert-topics, closql--remake-instance, and so on.  Is there a reasonably small set of functions I can master to create a custom display of issues?  Or should I pay attention to my feelings of You Are Not Meant To Mess With This?


texts:
I have to deal with long integers frequently, typically 9+ digits, and all of the digits matter (so scientific notation doesn't help me.  Is there a minor mode that helps make it easier to visually scan such numbers?  I encounter these numbers both in files and in shell buffers (bash, ipython, matlab).
As an example, I would like numbers with more than 6 digits to be displayed in a way to visually demarcate the number, as we typically do with commas.  For example: 10987654321.


texts: Correct commandline options (by pure elisp) for emacsclient to create a new frame only if the file is not already open otherwise switchs to it

texts:
If I invoke emacsclient with emacsclient -na runemacs file1 emacsclients switch to the frame containing file1.
But if later I invoke emacs with emacsclient -na runemacs file2 emacsclient opens file2 in the existing frame of file1.

On the other hand emacsclient -cna runemacs file1 always creates a new frame regardless of if file1 is already opened or not.

I prefer that emacsclient creates a new frame of a file if that file is not already open in the existing frames, otherwise emacsclient switchs to the frame containing it.

I guess I should send some elisp code by -e option to the emacsclient for checking this but I was not able to find the right code.

There is a related question Make emacsclient create a frame only if there isn't one already without an accepted answer. The upvoted answer there uses a bash script hence not a pure elisp solution.


texts: Character encoding when copying some text from somewhere to Emacs and saving to a file

texts:
Suppose I copy some text from a source (e.g. a webpage, a text file opened in an editor such as gedit or emacs) to a buffer in emacs, and then save the buffer to a text file.

When I copy the text from the source to the Emacs buffer,

Do I actually copy "the code values of the text under the encoding
method used by the source" to the Emacs buffer? Or do I copy
something else of the text?

Does emacs need to know the encoding method of the text in the
source?

Does conversion of encoding involve during this copy
process?
When Emacs writes the buffer to a text file,

by default, without customized configurations of emacs, will emacs
write the buffer to the text file using the same encoding method as
the source does?


texts:
(add-to-list 'custom-theme-load-path "~/.emacs.d")
(load-theme 'sanityinc-solarized-dark-theme)

I have these two lines in my .emacs file, and those theme files in the listed directory, yet emacs still does not detect the theme file.

I've seen other threads with similar issues, but none have worked for me so far, particularly with using package.el

Any help?


texts: Looking for something like cl-applicable-method-p

texts:
I am looking for something that could be used like this:

(when (cl-applicable-method-p 'foo "arg") ...)

I vaguely remember that I have seen that once and that it came with a comment saying that one shouldn't use it. However I would like to at least investigate this approach, which I cannot do if I cannot guess the name and am unable to find the implementation. (But please let me know what is wrong with using such a predicate, if anything.)

I cannot just call the generic function and prepare to handle cl-no-applicable-method errors or use a no-op default-method because I have to do some additional work before and after calling the generic function, but only if it actually is implemented given the arguments I intend to call it with

Actually the "argument" is the current major-mode, the arglist of the methods is (&context (major-mode MODE)), which probably complicates this further.

It would be nice if I could do something like:

(when (cl-applicable-method-p 'foo &context major-mode)
  (prepare)
  (foo)
  (finish))

Another approach would be:

(defmacro foo-common (&rest body)
  `(progn (prepare)
          ,@body
          (finish)))

(cl-defgeneric foo ()
  nil) ; noop

(cl-defmethod foo (&context (major-mode emacs-lisp-mode))
  (foo-common
   (mode-specific-stuff)))

but that feels hackish, it would be nicer if foo-common could be replaced with a foo :around method.

I am trying to replace the various magit-...-refresh-buffer functions used in magit-refresh-buffer with a generic function.


texts: Insert and view GIF INLINE? Insert and view SVG, video, audio, OTHER files in side pane?

texts:
I've never used emacs, but am interested in to try it for its 'org-mode'...
I understand that its now possible to view images inline - but can GIFS be viewed inline?

And then, is it possible to view video, audio, pdf, web, etc with emacs OWN viewer? If not (especially for uncommon file types), via a relevant application of choice (excel, chrome, etc) that opens in a separate PANE, but same window?

If so - are these hard to implement?


texts:
I use Mu4e to do email and my emails are stored locally in a maildir.  People often send me emails with large attachments.  I'd like to keep the emails but not the attachments because I'm paying for storage and would like to keep cost low.  What's the best way to remove attachments from selected emails?

Background: I'm using the development version of Emacs and Ubuntu 16.04.


texts: Capitalizing letters that follow colons using 'replace-regexp-in-string'

texts:
I want to capitalize letters that follow colons.  Here is the code:

(replace-regexp-in-string ": \w" 'upcase ": really")

The result I expected is : Really.  Instead I get : really.

Similarly, this also doesn't work:

(replace-regexp-in-string ": [:alpha:]" 'upcase ": really")

But this works:

(replace-regexp-in-string ": r" 'upcase ": really")

And this, too:

(replace-regexp-in-string ": [:alpha:]" 'upcase ": alright")

My LANG environment variable is set to en_US.UTF-8.


texts: Stop highlighting parentheses when I start typing

texts:
I use (show-paren-mode 1) to get help seeing where parentheses are. I have (setq show-paren-delay 2) to prevent intrusive highlighting when I don't need it. This is how it works now:

Put cursor on a parenthesis. After 2 seconds, both parentheses highlight
Use cursor keys. Highlighting stays on as long as I keep cursoring.
Stop moving around. Highlighting eventually disappears, after 2 seconds.

It should work like this:

Same as above.
Use cursor keys. Highlighting disappears immediately!

The rationale is that I need highlighting as an aide to find the matching parenthesis, or to detect imbalance. Once I've established this, the highlighting is no longer useful and I want it gone.


texts: Insert White-space to Right to Even Out Region

texts:
Lets say I have the following block of text:

----
##
----
##
----

There is no white space after the # character. Is there some command to insert white space to the right of lines to even them with the longest line in the region? So it would become a rectangle of text, including spaces.


texts: Turn off auto-completion/company while in org-journal

texts:
Trying to get org-journal working, but it wants to auto-complete nearly every word I type, then require two space bar hits to advance to type next word.
I tried this and it works
(add-hook 'org-mode-hook (lambda () (toggle-auto-completion-off)))

but this is a false-friend and causes bizarre problems other places. I want company on but just not while typing text in org-journal. Can that be done?
Here is my org-journal config
(use-package org-journal
  :after org
  :custom
  (org-journal-dir "~/Dropbox/org/journal/")
  (org-journal-date-prefix "#+TITLE: ")
  (org-journal-time-prefix "* ")
  (org-journal-file-format "%Y/%m/%Y%m%d.org")
  (org-journal-date-format "%Y-%m-%dT%H:%M:%S")
  (org-journal-enable-agenda-integration t)
  :bind
  ("C-c j" . org-journal-new-entry))

Yes, when I disable company, the problem goes away. A hook should allow this, but I'm getting it wrong?
(add-hook 'org-journal-mode-hook (company-mode -1))


texts:
I've seen this question: Loading bibtex file in org-mode file as well as this one: https://tex.stackexchange.com/questions/114864/how-to-get-bibtex-to-work-with-org-mode-latex-export

I've tried adding #+BIBLIOGRAPHY: sources plain to my Org document, this allowed org-reflex-cite to find the reference I'm citing, but the generated tex file has no mentions of bibliography.  If I add LaTeX headers such as:

#+LATEX_HEADER: \bibliographystyle{plain}
#+LATEX_HEADER: \bibliography{sources}

They are copied as is into the document, but that has no effect.

Org mode always generates an empty bbl file.

I've tried all of these commands for generating tex / pdf files:

(setq org-latex-pdf-process
        ;; ("texi2dvi -p -b -V %f")
        '("texi2dvi --pdf --clean --verbose --batch %f"
          "bibtex %b" "texi2dvi --pdf --clean --verbose --batch %f"
          "texi2dvi --pdf --clean --verbose --batch %f")

        ;; '("latexmk -pdflatex='pdflatex -shell-escape -interaction nonstopmode' -pdf -bibtex -f %f"))

with the result being the same.

Below is the sources.bib I'm using:

                  @Preamble{"\def\germ{\frak} \def\scr{\cal}
 \ifx\documentclass\undefinedcs
      \def\bf{\fam\bffam\tenbf}\def\rm{\fam0\tenrm}\fi
                          % f**k-amstex!
 \def\defaultdefine#1#2{\expandafter\ifx\csname#1\endcsname\relax
 \expandafter\def\csname#1\endcsname{#2}\fi}
 \defaultdefine{Bbb}{\bf}   \defaultdefine{frak}{\bf}
  \defaultdefine{=}{\B}   % doublef**k-amstex!!
  \defaultdefine{mathfrak}{\frak}
       \defaultdefine{mathbb}{\bf}
       \defaultdefine{mathcal}{\cal}
      \defaultdefine{beth}{BETH}\defaultdefine{cal}{\bf}
     \def\bbfI{{\Bbb I}}   \def\mbox{\hbox}  \def\text{\hbox}
   \def\om{\omega}    \def\Cal#1{{\bf #1}} \def\pcf{pcf}
        \defaultdefine{cf}{cf}
    \defaultdefine{reals}{{\Bbb R}} \defaultdefine{real}{{\Bbb R}}
   \def\restriction{{|}}  \def\club{CLUB}
   \def\w{\omega} \def\exist{\exists}
   \def\se{{\germ se}}     \def\bb{{\bf b}}
   \def\equivalence{\equiv}
   \let\lt<  \let\gt>
           "}

@article{Secil,
author = {Mustafa Seçil, Obuz, Funda, Altay, Canan, Ömür Gencel, Igci, Enis, et al.},
title = {{The role of dynamic subtraction MRI in detection of hepatocellular carcinoma}},
journal = {Diagnostic and Interventional Radiology; Ankara},
volume = {14, Iss. 4}
pages = {200--204},
year = {Dec 2008},
}

I copied the preamble from an example here: http://shelah.logic.at/eindex.html (I don't really know how bibtex works, and was hoping to skip learning this part for now...)


texts: Save my Emacs registry entries without having to use desktop-save

texts: I frequently create registry entries which I wish to keep across Sessions. Emacs does not save registry entries across sessions. This can be done by using desktop-save, but the downside is that desktop-save also saves buffers across sessions and in my experience is generally temperamental. (I have frequently lost information saved this way.) I have also tried saving them by adding the register-alist to savehist-additional-variables but this did not work for me. In short, I would like to save my registry entries without having to use desktop-save, i.e. in the simplest way possible.


texts: Integrating org-download with org-journal; images do not download

texts:
I have org-journal entries which I'd like to link to images that are also stored alongside them in the filesystem. Ideally this would happen automatically when an image is dragged-and-dropped on the buffer.

Org-download seems to be a good fit for this application. I can configure org-download to download and link images into regular org files, but I cannot achieve the same for org-journal files.

I received some suggestions for this on Reddit. For normal org-mode files, from my init.el:

(use-package org-download
  :ensure t
  :defer t
  :init
  ;; Add handlers for drag-and-drop when Org is loaded.
    (with-eval-after-load 'org
      (org-download-enable)))

I would expect this to also work for org-journal files, since they are also org-mode files. But it does not, so I've tried adjusting the configuration:

(use-package org-download
  :ensure t
  :defer t
  :after (:any 'org 'org-journal)
  :config
    (org-download-enable))

This also does not work. Next I tried manually instigating with M-: (org-download-enable) while working on an org-journal entry. That command returns nil and dragging and dropping images still does not work.

At this point I'm not sure how to proceed. I'm new to configuring emacs, and likely am missing something simple. Any suggestions would be appreciated.


texts: Set default timing for reminders/warnings, without identical intervals

texts:
In what follows, I use the terms "warning" and "reminder" synonymously.

By default, I would like Org to visually warn me of upcoming appointments, at the following times:

15 minutes in advance;
1 hour in advance;
3 hours in advance; and
24 hours in advance.

I would also like to be able to manually override this default, for certain appointments, specifying instead a different sequence of reminders.

How can I achieve this?

N.B. This question is similar. However, my question differs in some significant respects, which is why I think this is not a duplicate question:

That question specifically asks about setting warning intervals for appt rather than for Org mode. While it's true that the answer to my question might involve invoking appt, it also might not.
My question asks about setting reminders that occur more than just a few minutes in advance.
My question asks about manually overriding the default intervals.


texts: list-packages hangs when contacting melpa

texts:
I'm running Emacs 26.3 on Linux Mint 20. I am using paradox, but this also happens when I use the vanilla Emacs packages interface.
When I call list-packages, the Paradox Menu section of the mode line just says "Loading', and the little progress indicator keeps going, but it never completes. I have a bunch of different package archives enabled, but I commented them all out and re-enabled them one by one, and it's only melpa that causes the problem. Even melpa-stable works.
Anybody encountered this? Any troubleshooting steps to try?


texts: How to run `find-dired` and toggle all files?

texts:
This is what I have so far:

(defun find-and-toggle ()
  (interactive)
  (find-dired "~/my-project" "-name *.py")
  (dired-toggle-marks))

This switches to the find-dired buffer, but dired-toggle-marks appears to do nothing. What am I doing incorrectly?


texts:
I'm trying to build custom agenda block which would sort completed tasks by CLOSED property. org-agenda-sorting-strategy only supports ordering by SCHEDULED and DEADLINE properties, so I guess only way to implement this is to use custom sorting function with org-agenda-cmp-user-defined. Any help would be greatly appreciated.

  ;; custom sorting for closed items (does not work)
  (defun my/org-custom-cmp (a b)
    (org-cmp-ts a b "closed")
    )

  (setq org-agenda-cmp-user-defined 'my/org-custom-cmp)

  (setq org-agenda-custom-commands
        '(("z" "Tasks Overview"
           ((tags "+TODO=\"DONE\"+CLOSED>\"<-3d>\"" ((org-agenda-cmp-user-defined 'my/org-custom-cmp)
                                                     (org-agenda-sorting-strategy '(user-defined-up))
                                                     (org-agenda-max-entries 15)
                                                     (org-agenda-overriding-header "Recently Completed Tasks")))

            ))
;; ...


texts: ido-like restrict to matches while completing

texts:
When using ido, the command ido-restrict-to-matches (bound to C-SPC) is one of my favourite. What it does: instead of completing input against the initial collection of things, it will:

restrict that collection to the list of those things that match[*] the current input, and
remove the current input.

This allows to narrow down the list incrementally.

I would love to see such a mechanism work with the default completion system of emacs (I'm in particular interested in icomplete-mode). Does it exist, or how to do it ?

[*] Or, with a prefix arg, those that do not match (should be available in emacs-25.1, yet unreleased).


texts:
I've got a mild annoyance that I'm sure is fixable, but I'm not sure where to look. When using org-ref-helm-insert-cite-link to insert citations in my org documents, the citation is inserted at the current point. The problem is that if I've left insert mode, the current point is before the space, rather than after the space where I'd like the citation to go. I've read this question, but it seems to be trying to do something different.

Example

Typed text:

These·steps·are·called·authentication·

After org-ref-helm-insert-cite-link:

These·steps·are·called·authenticationcite:Furnell2000·

Desired format:

These·steps·are·called·authentication·cite:Furnell2000

Configuration: Spacemacs with vim style


texts: How to update Org-mode via Package Manager?

texts:
I have org-version 9.1.9 installed on Spacemacs and am attempting to install the latest org-version 9.2.6.
Install instructions are on https://orgmode.org/worg/org-faq.html#installing-via-elpa and https://orgmode.org/elpa.html.
I performed the following steps.

Check version installed:

M-x org-version
9.1.9

From Can't Install org Through Package Manager > Jeremy Roe.
Switch to default fundamental mode (not in an org file):

M-x fundamental-mode

Refresh and list packages:

M-x package-refresh-contents
M-x package-list-packages

Search list for org package:

C-s org

which listed two org entries; one from gnu and one from the org repo:

org 9.2.6     available gnu
org 20191007  available org

Install org from gnu repo:

org 9.2.6 RET org 9.2.6 RET Install RET
Install package 'org-9.2.6'? y
contacting host: elpa.gnu.org:443

Check version installed:

M-x org-version
9.1.9

Restart Emacs:

M-x org-version
9.1.9
M-x locate-library RET org
Library is file ~/.emacs.d/elpa/org-plus-contrib-20190617/org.elc

The newer org-version did not install.
Same result when I attempted to install package 20191007 from org repo.

I posted a similar question on How to update Org-mode through Emacs' Package Manager?

M-x spacemacs/describe-system-info
#### System Info :computer:
- OS: gnu/linux
- Emacs: 26.2
- Spacemacs: 0.200.13
- Spacemacs branch: master (rev. 8c0b8c344)
- Graphic display: t
- Distribution: spacemacs
- Editing style: vim
- Completion: ivy
- Layers:
```elisp
(javascript rust html csv c-c++ git shell spell-checking ivy emacs-lisp markdown org)
```
- System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND DBUS GSETTINGS GLIB NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LCMS2


texts: How to prevent emacs from keeping buffers open in helm follow mode

texts: Each time I preview a file with helm-follow-mode it creates a buffer with the previewed file opened and doesn't kill that buffer after I end helm-find-files. How can I change this behavior such that it automatically kills all buffers immediately after previewing the file or at least after I exit my helm-find-file, helm-mini, helm-ag ... session.


texts:
Is it possible that emacs shows real formulas in the editor if they are written in Latex or similiar? I am asking because it would be much more readable if you are coding (in lets say python or C++) and the comments contain real formulas instead of something like this

// Calculate average for $\mu_1 = \frac{1}{n} ~ \sum_{1=i}^n ~ x_i$

Is there a plugin which compiles Latex code in a comment to a picture and display it in the editor?


texts: Move cursor to beginning of visible text in current buffer

texts: Is there a shortcut key combination for moving the cursor to the beginning, resp. end, of the visible text in the current buffer, i.e. to the first, resp. last, cursor position that can be seen on the current screen, without scrolling up or down? Contrast this with the absolute beginning/end of the text in the current buffer, for which the shortcuts M-<, resp. M->, will work.


texts:
I have a custom comment-dwim-line command that I want to bind to the key combination C-M-; (in other words, control, meta and ; buttons pressed simultaneously). The built-in comment-dwim command is bound to M-; by default, and I want to keep this binding.

So far I have tried:

(global-set-key "\C-M-;" 'comment-dwim-line)

which throws global-set-key: Key sequence RET - ; starts with non-prefix key RET.

(global-set-key "\C-\M-;" 'comment-dwim-line)

which throws load-with-code-conversion: Invalid modifier in string.

(global-set-key "C-\M-;" 'comment-dwim-line)

which throws global-set-key: Key sequence C - M-; starts with non-prefix key C.

(global-set-key [?\C-M-;] 'next-line)

which throws read--expression: Invalid read syntax: "?".

(global-set-key [?\C-\M-;] 'next-line)

which throws Symbol's value as variable is void: M-.

Finally

(global-set-key (kbd "C-M-;") 'comment-dwim-line)

does not throw an error, but the key binding has no effect: when I actually press C-M-; it behaves the same as M-;(default comment-dwim is called).

I am using Emacs 24.4 on Mac OS X 10.10, running in iTerm2.


texts: set-mark-command (C-SPC) not recognised/broken

texts:
I would like to know how to start troubleshooting the following:
C-SPC is not doing anything.

It's not appearing in the mini-buffer when I type it but when I look at M-x set-mark-commandit's showing as bound to C-SPC.

Environment
I've installed GNU Emacs (24.5.1) via Homebrew and my .emacs.dis based off of Clojure for the Brave and True with some additional packages.

Steps taken so far
I firstly tried deleting and reinstalling with no affect so what steps can I take to pin-point what's going on?

Additional Info
A list of all installed packages is in screenshot below:


texts: Is there something like brace expansion in eshell?

texts:
Is there something like brace expansion in bash or zsh for eshell?

For those unfamiliar with brace expansion: it is a part of shell expansion in some shells, such as bash or zsh that works as follows: if a word contains a list of words in braces, you get a list of copies of the word with the part in braces replaced by each of the words in the list in turn. This is clearer with an example: the command blah x{a,b,c}y is transformed to blah xay xby xcy by shell expansion, before running blah.

EDIT:

Assuming that @rekado is right and there is no builtin, I wrote this short function that does brace-like expansion:

(defun be (&rest args)
  (cond
   ((null args) '(""))
   ((null (cdr args))
    (let ((hd (car args)))
      (cond
       ((vectorp hd) (cl-mapcan #'be hd))
       ((listp hd) (apply #'be hd))
       ((atom hd) (list (format "%s" hd))))))
   (t (let ((be-tl (be (cdr args)))
            (r '()))
        (dolist (x (be (car args)))
          (dolist (y be-tl)
            (push (concat x y) r)))
        (reverse r)))))

It uses lists (or simply passing multiple arguments) for sequencing and vectors to indicate choice. The atoms can be given as strings, symbols or numbers. For example:

bash$ echo a{b,c{d,e}f}{g,h}i
abgi abhi acdfgi acdfhi acefgi acefhi

(be '(a [b (c [d e] f)] [g h] i))
("abgi" "abhi" "acdfgi" "acdfhi" "acefgi" "acefhi")

(be 'a [b (c [d e] f)] [g h] 'i)
("abgi" "abhi" "acdfgi" "acdfhi" "acefgi" "acefhi")


texts: function to search and replace multiple words - necessary to goto-line 1 every time?

texts:
This is a very rudimentary question, but I have a document in which I need to replace many different words fairly frequently, so I created a function that goes like this:
(defun chikan ()
  (interactive)
  (goto-line 1)
  (replace-string "ichi" "one")
  (goto-line 1)
  (replace-string "ni" "two")
)

The actual function is a lot longer (the words in the example are just placeholders). I figured out that I had to stick the (goto-line 1) before every (replace-string) because it was going through the whole doc on the first sweep and then stopping, and not replacing words later in the list.
My rudimentary question: is there another way to make it search and replace all words in a document?


texts:
Running Doom Emacs v 2.0.9.

My ~/.doom.d/init.el contains:

(custom-set-variables
 '(org-tags-column -80)
)

When I add tags using counsel-org-tag, the tag alignment in the current headline is destroyed. When I try to realign them using SPC-u C-C C-C, all tags become left aligned!

When I customize-variables org-tag-column, it shows 'changed outside customize'. When I set up the value again and go back to the buffer to SPC-u C-C C-C all works as expected.

I thought with that setting in init.el, all these steps should be unnecessary.

How do I get the alignment behavior as expected?


texts: how can I see the result of 'ping -c 5 127.0.0.1' live using org babel session

texts:
https://github.com/whacked/ob-shstream/blob/master/ob-shstream.el

There's an add-on for org babel that let's you see streaming output of bash shell blocks. It's documentation reads like this:

;; the default ob-sh evaluation for shell scripts in org-mode is
;; blocking, so commands like e.g.
;;
;; #+BEGIN_SRC sh
;; ping -c 5 127.0.0.1
;; #+END_SRC
;;
;; will block when run, and results only become visible when the
;; process terminates. :session may be able to hand this,
;; doesn't currently work for me OOTB. ob-shstream is a simple
;; workaround.

The author indicates that :session may be able to handle it. How?
I'm running in to much weirdness after installing https://github.com/whacked/ob-shstream/blob/master/ob-shstream.el,
so I prefer if there a ":session" way of doing it, since ":session" is part of core.


texts:
I install (latest) org-mode on emacs 25.1 from
http://orgmode.org/elpa/ like this

(use-package org
  :ensure org-plus-contrib
  :defer t)

(require 'ox-md)

If I try to export the draft of my book (this is just used as a ready example, any org-mode file I create suffers the same problem)

https://raw.githubusercontent.com/fommil/fp-scala-mortals/master/manuscript/book.org

using C-c C-e and select m m (Markdown), I get this error:

  Debugger entered--Lisp error: (wrong-type-argument listp #("2017" 0 4
(:parent (#1))))
    org-element-set-contents(#("2017" 0 4 (:parent (#0))))
    apply(org-element-set-contents #("2017" 0 4 (:parent (#0))) nil)

If I revert back to the version of ox-md that comes with Emacs 25.1, the file is exported ok.

Is this a bug or have I done something dumb?


texts: How disable show warning message in shell?

texts:
Emacs 26.1
Every time when I start shell I get the next message:

How I can disable this message?


texts: Quitting minibufer works no more in 24.5.1?

texts:
In GNU Emacs 24.5.1, which comes with Ubuntu 16.04 Xenial Xerus the C-g does not abort the command like it used to do in earlier versions, which is annoying as it breaks the habit.

There is C-] command, which seemingly does the same thing, but keybindings help screen shows they are bound to the same command abort-recursive-edit.

How to return C-g it's previous behavior of aborting a command with input in minibuffer? Are there caveats in changing C-g?

Update: in emacs -Q, press C-x C-f as if to find some file, but then press C-g to abandon the attempt. "Quit" is seen briefly, but "Find file: ..." message is still there in minibuffer, while it is expected to go away, like is the case with C-] command. Of coure, C-x C-f is only an example. Same happens with other commands as well.


texts:
The Emacs manual says:

M-x print-buffer
Print hardcopy of current buffer with page headings containing the file name and page number.
M-x lpr-buffer
Print hardcopy of current buffer without page headings.
M-x print-region
Like print-buffer but print only the current region.
M-x lpr-region
Like lpr-buffer but print only the current region.
[...]
To specify the printer to use, set the variable printer-name. The default, nil, specifies the default printer.

How do we specify the printer to use?
For example, a PDF printer, which is not shown in the output of
lpstat -p -d

Thanks.


texts:
In org-mode for emacs I used to get a prompt while closing a recurring task. This gave the ability to leave a note.

Trying to configure this with org-log-done hasn't worked out.

Anyone an idea how to get this functionality?

---- just to explain ---

in org-mode for emacs I can change the setting:

M-x Customize Variable

org-log-done

While using spacemacs the customisation isn't available via this route. In line 107 of the file layers/+emacs/org/packages.el is written: org-log-done t
To my idea this is a spacemacs file. Trying to change the t to note (as it would be the setting via the original method) doesn't work.


texts: Generate a list of calendar days for a year

texts:
Usually, a calendar comes as a table. I want to generate a list instead:

October
October  1, 2017, Sunday
October  2, 2017, Monday
October  3, 2017, Tuesday
October  4, 2017, Wednesday
October  5, 2017, Thursday
October  6, 2017, Friday
October  7, 2017, Saturday
October  8, 2017, Sunday
...
October 30, 2017, Monday
October 31, 2017, Tuesday
November
November 1, 2017, Wednesday
...

I am wondering how to do it for the whole year. M-x calendar can generate tex and html for only a month and, what's more substantial, day names do not correspond to dates directly. Please, help.


texts: How to disable hints for certain keywords in python elpy

texts:
I enabled elpy mode for python and I get hints when I type a keyword. Also I have yasnippets. Unfortunately, when I type "for" keyword, elpy gives me a useless hint, blocking <tab> key for yasnippet expansion. I have to click left - right to get rid of it.

How can I disable hints for "for" keyword?


texts:
When I'm writing my weekly review I want to see my habits in a way that tells me which habit I did and which I didn't in this week.
Show the complete graph of habits may be enough for this, but how can I see this graph alone? If I opened my agenda I need to go to the next day to see the complete graph again.


texts: mouse click in margins to move point (gui macos) rather than error?

texts:
Currently, I have text modes configured with wide margins for readability with
(defun text-margins ()
  (setq left-margin-width 16)
  (setq right-margin-width 16))
(add-hook 'text-mode-hook 'text-margins)

in my init.
And this is great, except that sometimes I want to use the mouse to move point to the beginning of a line (in the GUI, on MacOS).
Clicking on a line inside the text moves point to the location clicked, as expected.
However, clicking on my nice wide margin next to a line doesn't move point. Instead, it beeps at me with an error and leaves point where it started.
Is there any way to catch a mouse event inside a margin, so that I can give it a function to move point rather than just yell at me?


texts:
I am trying to derive mode based on Sample Mode. Reduced contents here:

;;; pandoc-template.el --- Pandoc-Template major mode

;; Copyright (C) 2017

;; Author: VaclavHaisman
;; Keywords: extensions
(defvar pandoc-template-mode-syntax-table
  (let ((st (make-syntax-table)))
    ;(modify-syntax-entry ?# "<" st)
    ;(modify-syntax-entry ?\n ">" st)
    st)
  "Syntax table for `pandoc-template-mode'.")

(defvar pandoc-template-font-lock-keywords
   '(("\\(\\$\\)\\(if\\)(\\([^)]+\\))\\(\\$\\)"
      . font-lock-preprocessor-face)
      ;(1 font-lock-preprocessor-face)
      ;(2 font-lock-keyword-face)
      ;(3 font-lock-variable-face)
      ;(4 font-lock-preprocessor-face))
     ("\\$endif\\$" . font-lock-keyword-face)
     )
  "Keyword highlighting specification for `pandoc-template-mode'.")

 ;;;###autoload
(define-derived-mode pandoc-template-mode fundamental-mode "Pandoc-Template"
  "A major mode for editing Pandoc-Template files."
  :syntax-table nil ;pandoc-template-mode-syntax-table
  ;(setq-local comment-start "# ")
  ;(setq-local comment-start-skip "#+\\s-*")
  (setq-local font-lock-defaults
              '(pandoc-template-font-lock-keywords))

  )

(provide 'pandoc-template-mode)
 ;;; pandoc-template.el ends here

It does nothing. I cannot tell why it does not highlight anything. Sample text of the Pandoc template:

\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{usenames,dvipsnames}{color}
$endif$
%
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
$if(beamerarticle)$
\usepackage{beamerarticle} % needs to be loaded first
$endif$
$if(fontfamily)$
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$


texts: Manage packages completely inside emacs config file, not inside the Emacs directory?

texts:
i use currently melpa for managing my emacs packages, but I'm not satisfied with that. Melpa seems to manage the packages by dumping them into my emacs.d - which i don't want to store inside my dotfiles git repo. But still, i want to be able to easily reinstall my emacs without much interaction (ideally just executing an update command)

Most Plugin Managers of vim provided a very neat way of solving that issue. They dump also the packages inside my .vim, but mainly manage them by a list inside the main vim config file:

call plug#begin('~/.dotfiles/nvim/autoload/plugged')

" Languages
Plug '0robustus1/vim-tmux-conf'
Plug 'hrother/offlineimaprc.vim'
Plug 'LaTeX-Box-Team/LaTeX-Box'
Plug 'Matt-Deacalion/vim-systemd-syntax'

" Editing
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdcommenter'

" git helpers
Plug 'jreybert/vimagit'
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'vim-scripts/gitdiff.vim'

" other useful stuff
Plug 'tyru/open-browser.vim'
Plug 'godlygeek/tabular'

call plug#end()

The packages there are basically listed as 'github-user/repo', therefore e.g. the url for 'godlygeek/tabular' is https://github.com/godlygeek/tabular. This way, i can completely ignore the content of my plugin directory. After reinstalling my vim, i can just execute ':PlugInstall'

To be clear what i search for: I don't care where my emacs installs its packages from (e.g. github, from the melpa servers, etc.). I just want to know a method how i can list all packages i want to install inside my emacs config file (like the vim solution).

is there sth similar for emacs?


texts: Magit - remove confirmation when popping stash

texts:
Is there a way to remove a confirmation when popping a stash? Documentation say nothing about popping the stash. It says however that when dropping more than one stash, it has the confirmation by default.

However, I'm popping only one stash and I still get the confirmation, even after adding (add-to-list 'magit-no-confirm 'drop-stashes) to the config. Has someone made that work?


texts:
Emacs uses overlays / prettify-symbols-mode / etc which modify how data is displayed to user.

I like to copy visible content as I see it. For example I aligned columns in CSV file with M-x csv-align-fields but content is copied as it in file (with commas instead of aligned columns).


texts:
I have some elisp code in my ~/.emacs which sets a variable for the default font:

(let ((myfont "Ubuntu Mono-13"))
  (unless (member myfont (font-family-list))
    (setq myfont "DejaVu Sans Mono-13"))
  (add-to-list 'default-frame-list '(font . myfont))
  (set-face-attribute 'default nil :font myfont))

however I'm having a hard time constructing the string which is the last parameter of the call to (add-to-list) such that the variable 'myfont' is evaluated. Instead of:

'(font . myfont)

I would like to send:

'(font . "Ubuntu Mono-13")

or

'(font . "DejaVu Sans Mono-13")

I've tried various things with (car), (cdr), and (concat) to no avail.


texts: How to convert an org-mode outline into a Microsoft Word outline?

texts:
The title of this post says it all: I have an outline in an org-mode file, and I want to convert it to a Microsoft Word document that I can open in "outline view"1.
Unfortunately, the Microsoft Word requirement is non-negotiable in this case; it's mandated by my employer as company-wide policy.

1 Or maybe it's "outline mode", or some such; I'm not very sure of Word's terminology for its outlining support, but I know it has it.


texts: emacs multiple-cursors insert letters (numbers) issue

texts: I've created an ascii video at https://asciinema.org/a/63b67gx2hm5pasdvjkhiyq4ud to demo my emacs issue with multiple-cursors. I created 4 lines of text and created 4 cursors (see 00:36). Then I use C-a moved the cursors to the beginning of the lines. After that, I use mc/insert-letters to insert letters (see 00:46).  Note that at this time the status line shows mc:4 means I have 4 cursors.  After I inserted the letters, the status line shows mc:3 (see 00:49) and the mini buffer is still activated with the command mc/insert-letters selected by default. If I press Enter again, the letters a, b, c only installed in line 2, 3, 4 and the status line shows mc:4 again. At the end of the video, I tried the command mc/insert-numbers and it shows similar behavior. It seems this behavior is not correct. Could anyone help to confirm please? If it's an issue, how to fix it?


texts: Executing commands through shell-command (what is the PATH used)?

texts:
If I do:

  (getenv "PATH")

I get a list of colon-separated directories, including:

  /Users/michaeln/Library/Haskell/bin

If I look at the exec-path variable, I see a list including the same directory.  If I do:

  (shell-command "echo $PATH")

I get a list of colon-separated directories including the same Haskell/bin directory as above.  There is an executable pandoc in that directory.  And yet, if I do:

  (shell-command "pandoc")

I get in response:

  /bin/bash: pandoc: command not found

What am I doing wrong?


texts: Is it possible to make flycheck-mode and company-mode play nice together?

texts:
I've encountered two very nice modes when it comes to developing C++ in Emacs. First we have flycheck-mode which on the fly checks the syntax of my code using various backends such as clang or gcc. The second one is company-mode which provides auto-completion in various situations, function names, method names, object fields, using a back end such as clang.

The problem is that both likes to rewrite the contents of the buffer. Company-mode adds it's list of completions while flycheck-mode adds underscoring to problematic parts of the code. These collide for example when a user starts typing a function name, company-mode pops up the completion list, the user reads the available options which disappear half a second later because flycheck rewrites the display due to the incorrect, half-written, function call.

After further investigation it turns out that this bug only occurs in terminal emacs when the buffer can't be displayed in a single window. A video of the bug can be found on youtube: https://www.youtube.com/watch?v=Lg40mtSk_u8

So is it possible to make these two modes play nicely together? Or are there any good alternative modes that do work together and provide the same functionality?


texts: How quick search folder/file only by letters only?

texts:
Emacs 26.1, Window 10

If I want to find in dired mode some file/folder I :

C-s
Input file/folder name

Here result:

OK. It's work.
But it slow.
Is it possible to search file/folder only by input file/folder names. Without C-s operation.

Is it possible?


texts: A custom type specification like “repeat,” but when there’s only one item, it’s inline

texts:
So, I’m trying to add Customize support to packages that use a lot of plists, and where the value of pretty much any option can be either a single item or a list. I could have every single plist option’s value-type wrapped in a choice between “Single item” and “Multiple items,” but on an interface level that is cumbersome and counterintuitive. What I need is something like the specification (plist :options ((:meow (repeat (const purr))))), but: while multiple entries in the repeat will yield the overall value (:meow (purr purr …)), a single entry in the repeat should yield (:meow purr) instead of (:meow (purr)).

I tried making a simple version of this:

(defun tina/oom-value-set (widget value)
  (widget-put widget :inline (if (cdr value) nil t))
  (widget-default-value-set (widget value)))

(define-widget 'one-or-more 'repeat
  "Like ‘repeat’, but becomes inline when set with only one value.
Becomes non-inline when set with multiple values."
  :value-set 'tina/oom-value-set)

(defcustom tina/oom-test '(:meow)
  "Test my custom widget"
  :type '(plist :options ((:meow (one-or-more (const purr))))))

But, to my sadness, after customizing tina/oom-test, adding one “purr”, and saving it, the variable is now bound to (:meow (purr)), instead of (:meow purr) as I intended.

How can I get this working?